From 3ef819de2d921170b9e4053a5ce97986dfd725ce Mon Sep 17 00:00:00 2001 From: Aine Date: Tue, 24 Jun 2025 10:56:57 +0300 Subject: [PATCH] update deps --- .github/workflows/workflow.yml | 14 +- .golangci.yml | 196 +- go.mod | 47 +- go.sum | 118 +- internal/email/email.go | 2 +- internal/smtp/session.go | 2 +- vendor/github.com/emersion/go-smtp/README.md | 1 - vendor/github.com/emersion/go-smtp/client.go | 200 +- vendor/github.com/emersion/go-smtp/conn.go | 46 +- vendor/github.com/emersion/go-smtp/server.go | 4 + vendor/github.com/emersion/go-smtp/smtp.go | 6 + vendor/github.com/etkecc/go-kit/.golangci.yml | 196 +- vendor/github.com/etkecc/go-kit/ip.go | 34 + vendor/github.com/etkecc/go-kit/strings.go | 11 +- .../etkecc/go-linkpearl/linkpearl.go | 4 +- vendor/github.com/fatih/color/LICENSE.md | 20 + vendor/github.com/fatih/color/README.md | 189 + vendor/github.com/fatih/color/color.go | 685 + .../github.com/fatih/color/color_windows.go | 19 + vendor/github.com/fatih/color/doc.go | 134 + .../getsentry/sentry-go/.codecov.yml | 2 + .../getsentry/sentry-go/.golangci.yml | 62 +- .../getsentry/sentry-go/CHANGELOG.md | 133 + .../getsentry/sentry-go/attribute/builder.go | 36 + .../sentry-go/attribute/rawhelpers.go | 49 + .../getsentry/sentry-go/attribute/value.go | 170 + .../getsentry/sentry-go/batch_logger.go | 94 + .../github.com/getsentry/sentry-go/client.go | 89 +- vendor/github.com/getsentry/sentry-go/hub.go | 24 +- .../getsentry/sentry-go/integrations.go | 6 +- .../getsentry/sentry-go/interfaces.go | 115 +- vendor/github.com/getsentry/sentry-go/log.go | 230 + .../getsentry/sentry-go/log_fallback.go | 65 + .../github.com/getsentry/sentry-go/mocks.go | 2 + .../github.com/getsentry/sentry-go/scope.go | 7 +- .../github.com/getsentry/sentry-go/sentry.go | 19 +- .../getsentry/sentry-go/span_recorder.go | 2 +- .../github.com/getsentry/sentry-go/tracing.go | 79 +- .../getsentry/sentry-go/transport.go | 105 +- vendor/github.com/getsentry/sentry-go/util.go | 14 +- .../html2text/.gitignore | 2 + .../{jaytaylor => inbucket}/html2text/LICENSE | 0 .../html2text/README.md | 27 +- .../enmime => inbucket/html2text}/flake.lock | 12 +- .../github.com/inbucket/html2text/flake.nix | 17 + .../html2text/html2text.go | 78 +- .../inbucket/html2text/prettytables.go | 212 + .../enmime => inbucket/html2text}/shell.nix | 4 +- .../jaytaylor/html2text/.travis.yml | 13 - .../jhillyerd/enmime/{ => v2}/.envrc | 0 .../jhillyerd/enmime/{ => v2}/.gitattributes | 0 .../jhillyerd/enmime/{ => v2}/.gitignore | 0 .../jhillyerd/enmime/{ => v2}/.golangci.yml | 52 +- .../jhillyerd/enmime/{ => v2}/CONTRIBUTING.md | 0 .../jhillyerd/enmime/{ => v2}/LICENSE | 0 .../jhillyerd/enmime/{ => v2}/Makefile | 2 - .../jhillyerd/enmime/{ => v2}/README.md | 0 .../jhillyerd/enmime/{ => v2}/boundary.go | 2 +- .../jhillyerd/enmime/{ => v2}/builder.go | 2 +- .../jhillyerd/enmime/{ => v2}/detect.go | 2 +- .../jhillyerd/enmime/{ => v2}/encode.go | 42 +- .../jhillyerd/enmime/v2/encoder_options.go | 33 + .../jhillyerd/enmime/{ => v2}/enmime.go | 6 +- .../jhillyerd/enmime/{ => v2}/envelope.go | 12 +- .../jhillyerd/enmime/{ => v2}/error.go | 33 +- .../github.com/jhillyerd/enmime/v2/flake.lock | 61 + .../jhillyerd/enmime/{ => v2}/flake.nix | 0 .../jhillyerd/enmime/{ => v2}/header.go | 27 +- .../jhillyerd/enmime/{ => v2}/inspect.go | 4 +- .../enmime/{ => v2}/internal/coding/base64.go | 0 .../{ => v2}/internal/coding/charsets.go | 0 .../{ => v2}/internal/coding/headerext.go | 0 .../{ => v2}/internal/coding/idheader.go | 0 .../{ => v2}/internal/coding/quotedprint.go | 0 .../{ => v2}/internal/stringutil/addr.go | 20 +- .../{ => v2}/internal/stringutil/find.go | 0 .../internal/stringutil/rand_source.go | 0 .../{ => v2}/internal/stringutil/split.go | 0 .../{ => v2}/internal/stringutil/uuid.go | 0 .../{ => v2}/internal/stringutil/wrap.go | 8 +- .../{ => v2}/internal/textproto/header.go | 0 .../{ => v2}/internal/textproto/pipeline.go | 0 .../{ => v2}/internal/textproto/reader.go | 0 .../internal/textproto/reader_email.go | 0 .../{ => v2}/internal/textproto/textproto.go | 0 .../{ => v2}/internal/textproto/writer.go | 0 .../jhillyerd/enmime/{ => v2}/match.go | 0 .../enmime/{ => v2}/mediatype/mediatype.go | 14 +- .../jhillyerd/enmime/{ => v2}/options.go | 16 +- .../jhillyerd/enmime/{ => v2}/parser.go | 13 +- .../jhillyerd/enmime/{ => v2}/part.go | 56 +- .../jhillyerd/enmime/{ => v2}/sender.go | 0 .../github.com/jhillyerd/enmime/v2/shell.nix | 11 + .../github.com/olekukonko/errors/.gitignore | 3 + vendor/github.com/olekukonko/errors/LICENSE | 21 + vendor/github.com/olekukonko/errors/README.md | 1565 ++ vendor/github.com/olekukonko/errors/chain.go | 610 + vendor/github.com/olekukonko/errors/errors.go | 1496 ++ vendor/github.com/olekukonko/errors/helper.go | 432 + .../github.com/olekukonko/errors/inspect.go | 225 + .../olekukonko/errors/multi_error.go | 423 + vendor/github.com/olekukonko/errors/pool.go | 75 + .../olekukonko/errors/pool_above_1_24.go | 24 + .../olekukonko/errors/pool_below_1_24.go | 24 + vendor/github.com/olekukonko/errors/retry.go | 368 + vendor/github.com/olekukonko/errors/utils.go | 153 + vendor/github.com/olekukonko/ll/.gitignore | 5 + vendor/github.com/olekukonko/ll/LICENSE | 21 + vendor/github.com/olekukonko/ll/README.md | 359 + vendor/github.com/olekukonko/ll/concat.go | 421 + .../github.com/olekukonko/ll/conditional.go | 340 + vendor/github.com/olekukonko/ll/field.go | 374 + vendor/github.com/olekukonko/ll/global.go | 659 + vendor/github.com/olekukonko/ll/lc.go | 48 + .../github.com/olekukonko/ll/lh/buffered.go | 279 + .../github.com/olekukonko/ll/lh/colorized.go | 473 + vendor/github.com/olekukonko/ll/lh/json.go | 170 + vendor/github.com/olekukonko/ll/lh/memory.go | 113 + vendor/github.com/olekukonko/ll/lh/multi.go | 51 + vendor/github.com/olekukonko/ll/lh/slog.go | 89 + vendor/github.com/olekukonko/ll/lh/text.go | 225 + vendor/github.com/olekukonko/ll/ll.go | 1448 ++ vendor/github.com/olekukonko/ll/lx/lx.go | 164 + vendor/github.com/olekukonko/ll/lx/ns.go | 102 + vendor/github.com/olekukonko/ll/middleware.go | 124 + .../olekukonko/tablewriter/.gitignore | 21 +- .../olekukonko/tablewriter/.travis.yml | 22 - .../olekukonko/tablewriter/MIGRATION.md | 3042 +++ .../olekukonko/tablewriter/README.md | 1429 +- .../olekukonko/tablewriter/README_LEGACY.md | 466 + .../olekukonko/tablewriter/config.go | 960 + .../github.com/olekukonko/tablewriter/csv.go | 88 +- .../olekukonko/tablewriter/deprecated.go | 218 + .../olekukonko/tablewriter/option.go | 859 + .../olekukonko/tablewriter/pkg/twwarp/wrap.go | 234 + .../tablewriter/renderer/blueprint.go | 578 + .../tablewriter/renderer/colorized.go | 719 + .../olekukonko/tablewriter/renderer/fn.go | 236 + .../olekukonko/tablewriter/renderer/html.go | 440 + .../tablewriter/renderer/junction.go | 273 + .../tablewriter/renderer/markdown.go | 418 + .../olekukonko/tablewriter/renderer/ocean.go | 505 + .../olekukonko/tablewriter/renderer/svg.go | 702 + .../olekukonko/tablewriter/stream.go | 1150 ++ .../olekukonko/tablewriter/table.go | 967 - .../tablewriter/table_with_color.go | 136 - .../olekukonko/tablewriter/tablewriter.go | 2206 ++ .../olekukonko/tablewriter/tw/cell.go | 64 + .../olekukonko/tablewriter/tw/deprecated.go | 137 + .../olekukonko/tablewriter/tw/fn.go | 363 + .../olekukonko/tablewriter/tw/mapper.go | 220 + .../olekukonko/tablewriter/tw/preset.go | 18 + .../olekukonko/tablewriter/tw/renderer.go | 125 + .../olekukonko/tablewriter/tw/slicer.go | 147 + .../olekukonko/tablewriter/tw/state.go | 51 + .../olekukonko/tablewriter/tw/symbols.go | 1012 + .../olekukonko/tablewriter/tw/tw.go | 107 + .../olekukonko/tablewriter/tw/types.go | 199 + .../github.com/olekukonko/tablewriter/util.go | 93 - .../github.com/olekukonko/tablewriter/wrap.go | 99 - .../github.com/olekukonko/tablewriter/zoo.go | 1695 ++ vendor/github.com/yuin/goldmark/ast/block.go | 10 +- .../yuin/goldmark/parser/code_block.go | 4 +- .../yuin/goldmark/parser/html_block.go | 8 +- .../yuin/goldmark/parser/list_item.go | 2 +- .../yuin/goldmark/parser/paragraph.go | 4 +- .../github.com/yuin/goldmark/parser/parser.go | 44 +- .../yuin/goldmark/parser/thematic_break.go | 4 +- .../github.com/yuin/goldmark/text/reader.go | 55 +- .../github.com/yuin/goldmark/text/segment.go | 6 - vendor/go.mau.fi/util/exhttp/cors.go | 6 + vendor/go.mau.fi/util/exhttp/handleerrors.go | 6 + vendor/go.mau.fi/util/exhttp/json.go | 13 +- vendor/go.mau.fi/util/exhttp/middleware.go | 6 + vendor/go.mau.fi/util/exhttp/networkerror.go | 37 + vendor/go.mau.fi/util/exstrings/stringutil.go | 76 + vendor/go.mau.fi/util/jsonbytes/unpadded.go | 18 + vendor/golang.org/x/crypto/ssh/certs.go | 41 +- vendor/golang.org/x/crypto/ssh/cipher.go | 40 +- vendor/golang.org/x/crypto/ssh/client.go | 1 + vendor/golang.org/x/crypto/ssh/common.go | 377 +- vendor/golang.org/x/crypto/ssh/connection.go | 12 + vendor/golang.org/x/crypto/ssh/handshake.go | 24 +- vendor/golang.org/x/crypto/ssh/kex.go | 107 +- vendor/golang.org/x/crypto/ssh/keys.go | 25 +- vendor/golang.org/x/crypto/ssh/mac.go | 12 +- vendor/golang.org/x/crypto/ssh/messages.go | 6 +- vendor/golang.org/x/crypto/ssh/mlkem.go | 183 + vendor/golang.org/x/crypto/ssh/server.go | 12 +- vendor/golang.org/x/crypto/ssh/transport.go | 15 +- vendor/golang.org/x/net/http/httpguts/guts.go | 50 + .../golang.org/x/net/http/httpguts/httplex.go | 347 + vendor/golang.org/x/net/http2/.gitignore | 2 + vendor/golang.org/x/net/http2/ascii.go | 53 + vendor/golang.org/x/net/http2/ciphers.go | 641 + .../x/net/http2/client_conn_pool.go | 311 + vendor/golang.org/x/net/http2/config.go | 122 + vendor/golang.org/x/net/http2/config_go124.go | 61 + .../x/net/http2/config_pre_go124.go | 16 + vendor/golang.org/x/net/http2/databuffer.go | 149 + vendor/golang.org/x/net/http2/errors.go | 145 + vendor/golang.org/x/net/http2/flow.go | 120 + vendor/golang.org/x/net/http2/frame.go | 1702 ++ vendor/golang.org/x/net/http2/gotrack.go | 170 + vendor/golang.org/x/net/http2/hpack/encode.go | 245 + vendor/golang.org/x/net/http2/hpack/hpack.go | 523 + .../golang.org/x/net/http2/hpack/huffman.go | 226 + .../x/net/http2/hpack/static_table.go | 188 + vendor/golang.org/x/net/http2/hpack/tables.go | 403 + vendor/golang.org/x/net/http2/http2.go | 432 + vendor/golang.org/x/net/http2/pipe.go | 184 + vendor/golang.org/x/net/http2/server.go | 3350 +++ vendor/golang.org/x/net/http2/timer.go | 20 + vendor/golang.org/x/net/http2/transport.go | 3287 +++ vendor/golang.org/x/net/http2/unencrypted.go | 32 + vendor/golang.org/x/net/http2/write.go | 381 + vendor/golang.org/x/net/http2/writesched.go | 251 + .../x/net/http2/writesched_priority.go | 451 + .../x/net/http2/writesched_random.go | 77 + .../x/net/http2/writesched_roundrobin.go | 119 + .../x/net/internal/httpcommon/ascii.go | 53 + .../x/net/internal/httpcommon/headermap.go | 115 + .../x/net/internal/httpcommon/request.go | 467 + vendor/golang.org/x/sys/cpu/cpu.go | 11 + .../golang.org/x/sys/cpu/cpu_linux_riscv64.go | 23 + vendor/golang.org/x/sys/cpu/cpu_riscv64.go | 12 + .../x/sys/windows/security_windows.go | 49 +- .../x/sys/windows/syscall_windows.go | 6 +- .../golang.org/x/sys/windows/types_windows.go | 212 + .../x/sys/windows/zsyscall_windows.go | 9 + .../x/tools/go/ast/astutil/enclosing.go | 21 +- .../x/tools/go/ast/astutil/rewrite.go | 4 + vendor/golang.org/x/tools/go/loader/doc.go | 2 +- vendor/maunium.net/go/mautrix/CHANGELOG.md | 58 + vendor/maunium.net/go/mautrix/client.go | 48 +- .../go/mautrix/crypto/cross_sign_key.go | 8 +- .../crypto/cryptohelper/cryptohelper.go | 6 +- .../go/mautrix/crypto/decryptolm.go | 8 +- .../go/mautrix/crypto/keybackup.go | 75 +- .../go/mautrix/crypto/keyimport.go | 2 +- .../go/mautrix/crypto/keysharing.go | 5 +- .../maunium.net/go/mautrix/crypto/machine.go | 4 +- .../maunium.net/go/mautrix/crypto/sessions.go | 2 +- .../go/mautrix/crypto/sql_store.go | 5 + vendor/maunium.net/go/mautrix/error.go | 3 +- vendor/maunium.net/go/mautrix/event/beeper.go | 60 +- .../maunium.net/go/mautrix/event/content.go | 2 +- vendor/maunium.net/go/mautrix/event/events.go | 9 +- vendor/maunium.net/go/mautrix/event/member.go | 2 + .../maunium.net/go/mautrix/event/message.go | 1 + .../maunium.net/go/mautrix/event/relations.go | 2 +- vendor/maunium.net/go/mautrix/event/state.go | 2 +- vendor/maunium.net/go/mautrix/event/voip.go | 2 +- .../go/mautrix/format/htmlparser.go | 22 +- .../maunium.net/go/mautrix/format/markdown.go | 33 +- vendor/maunium.net/go/mautrix/id/matrixuri.go | 11 +- .../maunium.net/go/mautrix/id/servername.go | 58 + vendor/maunium.net/go/mautrix/id/userid.go | 12 +- vendor/maunium.net/go/mautrix/requests.go | 70 + vendor/maunium.net/go/mautrix/responses.go | 7 + vendor/maunium.net/go/mautrix/version.go | 2 +- vendor/maunium.net/go/mautrix/versions.go | 2 + vendor/modernc.org/libc/Makefile | 9 +- vendor/modernc.org/libc/asm_linux_amd64.go | 1320 ++ vendor/modernc.org/libc/asm_linux_amd64.s | 17055 ++++++++++++++++ vendor/modernc.org/libc/build_all_targets.sh | 21 +- vendor/modernc.org/libc/etc.go | 2 + vendor/modernc.org/libc/libc.go | 943 +- vendor/modernc.org/libc/libc_darwin.go | 301 +- vendor/modernc.org/libc/libc_darwin_amd64.go | 5 + vendor/modernc.org/libc/libc_darwin_arm64.go | 5 + vendor/modernc.org/libc/libc_freebsd.go | 440 +- vendor/modernc.org/libc/libc_illumos.go | 8 + vendor/modernc.org/libc/libc_musl.go | 5 + vendor/modernc.org/libc/libc_netbsd.go | 2 + vendor/modernc.org/libc/libc_openbsd.go | 2 + vendor/modernc.org/libc/libc_unix.go | 16 + vendor/modernc.org/libc/libc_windows.go | 328 +- vendor/modernc.org/libc/mem.go | 10 +- vendor/modernc.org/libc/mem_brk.go | 6 +- vendor/modernc.org/libc/memgrind.go | 14 +- vendor/modernc.org/libc/memgrind_musl.go | 10 +- vendor/modernc.org/libc/musl_darwin_amd64.go | 6 +- vendor/modernc.org/libc/pthread.go | 8 +- vendor/modernc.org/libc/pthread_all.go | 6 +- vendor/modernc.org/libc/stdatomic.go | 508 +- vendor/modernc.org/libc/tls_linux_amd64.go | 16 + vendor/modernc.org/libc/tls_linux_amd64.s | 21 + vendor/modernc.org/memory/memory.go | 6 + vendor/modernc.org/memory/mmap_unix.go | 16 +- vendor/modernc.org/sqlite/Makefile | 9 +- vendor/modernc.org/sqlite/README.md | 4 + vendor/modernc.org/sqlite/bind_blob.go | 40 - vendor/modernc.org/sqlite/bind_blob_musl.go | 40 - vendor/modernc.org/sqlite/doc.go | 38 +- .../sqlite/lib/sqlite_darwin_amd64.go | 10007 ++++----- .../sqlite/lib/sqlite_darwin_arm64.go | 10036 ++++----- .../sqlite/lib/sqlite_freebsd_amd64.go | 9822 ++++----- .../sqlite/lib/sqlite_freebsd_arm64.go | 9738 ++++----- .../sqlite/lib/sqlite_linux_386.go | 9776 ++++----- .../sqlite/lib/sqlite_linux_amd64.go | 9652 ++++----- .../sqlite/lib/sqlite_linux_arm.go | 9958 ++++----- .../sqlite/lib/sqlite_linux_arm64.go | 9836 ++++----- .../sqlite/lib/sqlite_linux_loong64.go | 9834 ++++----- .../sqlite/lib/sqlite_linux_ppc64le.go | 9836 ++++----- .../sqlite/lib/sqlite_linux_riscv64.go | 9900 ++++----- .../sqlite/lib/sqlite_linux_s390x.go | 9834 ++++----- .../modernc.org/sqlite/lib/sqlite_windows.go | 10552 +++++----- .../sqlite/lib/sqlite_windows_386.go | 10896 +++++----- vendor/modernc.org/sqlite/sqlite.go | 48 +- vendor/modules.txt | 78 +- 311 files changed, 143330 insertions(+), 69305 deletions(-) create mode 100644 vendor/github.com/etkecc/go-kit/ip.go create mode 100644 vendor/github.com/fatih/color/LICENSE.md create mode 100644 vendor/github.com/fatih/color/README.md create mode 100644 vendor/github.com/fatih/color/color.go create mode 100644 vendor/github.com/fatih/color/color_windows.go create mode 100644 vendor/github.com/fatih/color/doc.go create mode 100644 vendor/github.com/getsentry/sentry-go/attribute/builder.go create mode 100644 vendor/github.com/getsentry/sentry-go/attribute/rawhelpers.go create mode 100644 vendor/github.com/getsentry/sentry-go/attribute/value.go create mode 100644 vendor/github.com/getsentry/sentry-go/batch_logger.go create mode 100644 vendor/github.com/getsentry/sentry-go/log.go create mode 100644 vendor/github.com/getsentry/sentry-go/log_fallback.go rename vendor/github.com/{jaytaylor => inbucket}/html2text/.gitignore (94%) rename vendor/github.com/{jaytaylor => inbucket}/html2text/LICENSE (100%) rename vendor/github.com/{jaytaylor => inbucket}/html2text/README.md (74%) rename vendor/github.com/{jhillyerd/enmime => inbucket/html2text}/flake.lock (77%) create mode 100644 vendor/github.com/inbucket/html2text/flake.nix rename vendor/github.com/{jaytaylor => inbucket}/html2text/html2text.go (82%) create mode 100644 vendor/github.com/inbucket/html2text/prettytables.go rename vendor/github.com/{jhillyerd/enmime => inbucket/html2text}/shell.nix (84%) delete mode 100644 vendor/github.com/jaytaylor/html2text/.travis.yml rename vendor/github.com/jhillyerd/enmime/{ => v2}/.envrc (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/.gitattributes (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/.gitignore (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/.golangci.yml (64%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/CONTRIBUTING.md (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/LICENSE (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/Makefile (81%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/README.md (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/boundary.go (99%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/builder.go (99%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/detect.go (98%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/encode.go (87%) create mode 100644 vendor/github.com/jhillyerd/enmime/v2/encoder_options.go rename vendor/github.com/jhillyerd/enmime/{ => v2}/enmime.go (94%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/envelope.go (96%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/error.go (73%) create mode 100644 vendor/github.com/jhillyerd/enmime/v2/flake.lock rename vendor/github.com/jhillyerd/enmime/{ => v2}/flake.nix (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/header.go (88%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/inspect.go (95%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/coding/base64.go (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/coding/charsets.go (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/coding/headerext.go (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/coding/idheader.go (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/coding/quotedprint.go (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/stringutil/addr.go (88%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/stringutil/find.go (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/stringutil/rand_source.go (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/stringutil/split.go (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/stringutil/uuid.go (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/stringutil/wrap.go (86%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/textproto/header.go (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/textproto/pipeline.go (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/textproto/reader.go (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/textproto/reader_email.go (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/textproto/textproto.go (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/internal/textproto/writer.go (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/match.go (100%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/mediatype/mediatype.go (96%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/options.go (87%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/parser.go (82%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/part.go (90%) rename vendor/github.com/jhillyerd/enmime/{ => v2}/sender.go (100%) create mode 100644 vendor/github.com/jhillyerd/enmime/v2/shell.nix create mode 100644 vendor/github.com/olekukonko/errors/.gitignore create mode 100644 vendor/github.com/olekukonko/errors/LICENSE create mode 100644 vendor/github.com/olekukonko/errors/README.md create mode 100644 vendor/github.com/olekukonko/errors/chain.go create mode 100644 vendor/github.com/olekukonko/errors/errors.go create mode 100644 vendor/github.com/olekukonko/errors/helper.go create mode 100644 vendor/github.com/olekukonko/errors/inspect.go create mode 100644 vendor/github.com/olekukonko/errors/multi_error.go create mode 100644 vendor/github.com/olekukonko/errors/pool.go create mode 100644 vendor/github.com/olekukonko/errors/pool_above_1_24.go create mode 100644 vendor/github.com/olekukonko/errors/pool_below_1_24.go create mode 100644 vendor/github.com/olekukonko/errors/retry.go create mode 100644 vendor/github.com/olekukonko/errors/utils.go create mode 100644 vendor/github.com/olekukonko/ll/.gitignore create mode 100644 vendor/github.com/olekukonko/ll/LICENSE create mode 100644 vendor/github.com/olekukonko/ll/README.md create mode 100644 vendor/github.com/olekukonko/ll/concat.go create mode 100644 vendor/github.com/olekukonko/ll/conditional.go create mode 100644 vendor/github.com/olekukonko/ll/field.go create mode 100644 vendor/github.com/olekukonko/ll/global.go create mode 100644 vendor/github.com/olekukonko/ll/lc.go create mode 100644 vendor/github.com/olekukonko/ll/lh/buffered.go create mode 100644 vendor/github.com/olekukonko/ll/lh/colorized.go create mode 100644 vendor/github.com/olekukonko/ll/lh/json.go create mode 100644 vendor/github.com/olekukonko/ll/lh/memory.go create mode 100644 vendor/github.com/olekukonko/ll/lh/multi.go create mode 100644 vendor/github.com/olekukonko/ll/lh/slog.go create mode 100644 vendor/github.com/olekukonko/ll/lh/text.go create mode 100644 vendor/github.com/olekukonko/ll/ll.go create mode 100644 vendor/github.com/olekukonko/ll/lx/lx.go create mode 100644 vendor/github.com/olekukonko/ll/lx/ns.go create mode 100644 vendor/github.com/olekukonko/ll/middleware.go delete mode 100644 vendor/github.com/olekukonko/tablewriter/.travis.yml create mode 100644 vendor/github.com/olekukonko/tablewriter/MIGRATION.md create mode 100644 vendor/github.com/olekukonko/tablewriter/README_LEGACY.md create mode 100644 vendor/github.com/olekukonko/tablewriter/config.go create mode 100644 vendor/github.com/olekukonko/tablewriter/deprecated.go create mode 100644 vendor/github.com/olekukonko/tablewriter/option.go create mode 100644 vendor/github.com/olekukonko/tablewriter/pkg/twwarp/wrap.go create mode 100644 vendor/github.com/olekukonko/tablewriter/renderer/blueprint.go create mode 100644 vendor/github.com/olekukonko/tablewriter/renderer/colorized.go create mode 100644 vendor/github.com/olekukonko/tablewriter/renderer/fn.go create mode 100644 vendor/github.com/olekukonko/tablewriter/renderer/html.go create mode 100644 vendor/github.com/olekukonko/tablewriter/renderer/junction.go create mode 100644 vendor/github.com/olekukonko/tablewriter/renderer/markdown.go create mode 100644 vendor/github.com/olekukonko/tablewriter/renderer/ocean.go create mode 100644 vendor/github.com/olekukonko/tablewriter/renderer/svg.go create mode 100644 vendor/github.com/olekukonko/tablewriter/stream.go delete mode 100644 vendor/github.com/olekukonko/tablewriter/table.go delete mode 100644 vendor/github.com/olekukonko/tablewriter/table_with_color.go create mode 100644 vendor/github.com/olekukonko/tablewriter/tablewriter.go create mode 100644 vendor/github.com/olekukonko/tablewriter/tw/cell.go create mode 100644 vendor/github.com/olekukonko/tablewriter/tw/deprecated.go create mode 100644 vendor/github.com/olekukonko/tablewriter/tw/fn.go create mode 100644 vendor/github.com/olekukonko/tablewriter/tw/mapper.go create mode 100644 vendor/github.com/olekukonko/tablewriter/tw/preset.go create mode 100644 vendor/github.com/olekukonko/tablewriter/tw/renderer.go create mode 100644 vendor/github.com/olekukonko/tablewriter/tw/slicer.go create mode 100644 vendor/github.com/olekukonko/tablewriter/tw/state.go create mode 100644 vendor/github.com/olekukonko/tablewriter/tw/symbols.go create mode 100644 vendor/github.com/olekukonko/tablewriter/tw/tw.go create mode 100644 vendor/github.com/olekukonko/tablewriter/tw/types.go delete mode 100644 vendor/github.com/olekukonko/tablewriter/util.go delete mode 100644 vendor/github.com/olekukonko/tablewriter/wrap.go create mode 100644 vendor/github.com/olekukonko/tablewriter/zoo.go create mode 100644 vendor/go.mau.fi/util/exhttp/networkerror.go create mode 100644 vendor/go.mau.fi/util/exstrings/stringutil.go create mode 100644 vendor/golang.org/x/crypto/ssh/mlkem.go create mode 100644 vendor/golang.org/x/net/http/httpguts/guts.go create mode 100644 vendor/golang.org/x/net/http/httpguts/httplex.go create mode 100644 vendor/golang.org/x/net/http2/.gitignore create mode 100644 vendor/golang.org/x/net/http2/ascii.go create mode 100644 vendor/golang.org/x/net/http2/ciphers.go create mode 100644 vendor/golang.org/x/net/http2/client_conn_pool.go create mode 100644 vendor/golang.org/x/net/http2/config.go create mode 100644 vendor/golang.org/x/net/http2/config_go124.go create mode 100644 vendor/golang.org/x/net/http2/config_pre_go124.go create mode 100644 vendor/golang.org/x/net/http2/databuffer.go create mode 100644 vendor/golang.org/x/net/http2/errors.go create mode 100644 vendor/golang.org/x/net/http2/flow.go create mode 100644 vendor/golang.org/x/net/http2/frame.go create mode 100644 vendor/golang.org/x/net/http2/gotrack.go create mode 100644 vendor/golang.org/x/net/http2/hpack/encode.go create mode 100644 vendor/golang.org/x/net/http2/hpack/hpack.go create mode 100644 vendor/golang.org/x/net/http2/hpack/huffman.go create mode 100644 vendor/golang.org/x/net/http2/hpack/static_table.go create mode 100644 vendor/golang.org/x/net/http2/hpack/tables.go create mode 100644 vendor/golang.org/x/net/http2/http2.go create mode 100644 vendor/golang.org/x/net/http2/pipe.go create mode 100644 vendor/golang.org/x/net/http2/server.go create mode 100644 vendor/golang.org/x/net/http2/timer.go create mode 100644 vendor/golang.org/x/net/http2/transport.go create mode 100644 vendor/golang.org/x/net/http2/unencrypted.go create mode 100644 vendor/golang.org/x/net/http2/write.go create mode 100644 vendor/golang.org/x/net/http2/writesched.go create mode 100644 vendor/golang.org/x/net/http2/writesched_priority.go create mode 100644 vendor/golang.org/x/net/http2/writesched_random.go create mode 100644 vendor/golang.org/x/net/http2/writesched_roundrobin.go create mode 100644 vendor/golang.org/x/net/internal/httpcommon/ascii.go create mode 100644 vendor/golang.org/x/net/internal/httpcommon/headermap.go create mode 100644 vendor/golang.org/x/net/internal/httpcommon/request.go create mode 100644 vendor/maunium.net/go/mautrix/id/servername.go create mode 100644 vendor/modernc.org/libc/asm_linux_amd64.go create mode 100644 vendor/modernc.org/libc/asm_linux_amd64.s create mode 100644 vendor/modernc.org/libc/tls_linux_amd64.go create mode 100644 vendor/modernc.org/libc/tls_linux_amd64.s delete mode 100644 vendor/modernc.org/sqlite/bind_blob.go delete mode 100644 vendor/modernc.org/sqlite/bind_blob_musl.go diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 641bb00..fe58282 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -18,9 +18,9 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 - - uses: extractions/setup-just@v1 + - uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3 - name: lint - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 with: version: latest - name: test @@ -31,16 +31,16 @@ jobs: runs-on: self-hosted steps: - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 - name: Login to ghcr.io - uses: docker/login-action@v3 + uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v5 + uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0 with: images: | ghcr.io/${{ github.repository }} @@ -49,7 +49,7 @@ jobs: type=raw,value=latest,enable=${{ github.ref_name == 'main' }} type=semver,pattern={{raw}} - name: Build and push - uses: docker/build-push-action@v6 + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 with: platforms: linux/amd64,linux/arm64 push: true @@ -66,7 +66,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v5 - name: Release - uses: goreleaser/goreleaser-action@v6 + uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0 with: version: latest args: release --clean diff --git a/.golangci.yml b/.golangci.yml index 42a28d9..7d9b10c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,73 +1,16 @@ +version: "2" run: concurrency: 4 - timeout: 30m + modules-download-mode: readonly issues-exit-code: 1 tests: true - build-tags: [] - modules-download-mode: readonly - output: formats: - - format: colored-line-number - print-issued-lines: true - print-linter-name: true - sort-results: true - -linters-settings: - decorder: - dec-order: - - const - - var - - type - - func - dogsled: - max-blank-identifiers: 3 - errcheck: - check-type-assertions: true - check-blank: true - errchkjson: - report-no-exported: true - exhaustive: - check: - - switch - - map - default-signifies-exhaustive: true - gocognit: - min-complexity: 15 - nestif: - min-complexity: 5 - gocritic: - enabled-tags: - - diagnostic - - style - - performance - gofmt: - simplify: true - rewrite-rules: - - pattern: 'interface{}' - replacement: 'any' - - pattern: 'a[b:len(a)]' - replacement: 'a[b:]' - gofumpt: - extra-rules: true - grouper: - const-require-single-const: true - import-require-single-import: true - var-require-single-var: true - misspell: - locale: US - usestdlibvars: - time-month: true - time-layout: true - crypto-hash: true - default-rpc-path: true - sql-isolation-level: true - tls-signature-scheme: true - constant-kind: true - unparam: - check-exported: true + text: + path: stdout + print-linter-name: true + print-issued-lines: true linters: - disable-all: false enable: - asasalint - asciicheck @@ -80,7 +23,6 @@ linters: - dupl - dupword - durationcheck - - errcheck - errchkjson - errname - errorlint @@ -89,14 +31,8 @@ linters: - gocognit - gocritic - gocyclo - - gofmt - - gofumpt - - goimports - gosec - - gosimple - gosmopolitan - - govet - - ineffassign - makezero - mirror - misspell @@ -106,36 +42,106 @@ linters: - predeclared - revive - sqlclosecheck - - staticcheck - unconvert - unparam - - unused - usestdlibvars - wastedassign - fast: false - - + settings: + decorder: + dec-order: + - const + - var + - type + - func + dogsled: + max-blank-identifiers: 3 + errcheck: + check-type-assertions: true + check-blank: true + errchkjson: + report-no-exported: true + exhaustive: + check: + - switch + - map + default-signifies-exhaustive: true + gocognit: + min-complexity: 15 + gocritic: + enabled-tags: + - diagnostic + - style + - performance + grouper: + const-require-single-const: true + import-require-single-import: true + var-require-single-var: true + misspell: + locale: US + nestif: + min-complexity: 5 + unparam: + check-exported: true + usestdlibvars: + time-month: true + time-layout: true + crypto-hash: true + default-rpc-path: true + sql-isolation-level: true + tls-signature-scheme: true + constant-kind: true + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - linters: + - dupl + - errcheck + - gocognit + - gocyclo + - gosec + path: _test\.go + - linters: + - staticcheck + text: 'SA9003:' + - linters: + - lll + source: '^//go:generate ' + - linters: + - revive + text: returns unexported type + paths: + - mocks + - third_party$ + - builtin$ + - examples$ issues: - exclude-dirs-use-default: true - exclude-dirs: - - mocks - exclude-rules: - - path: _test\.go - linters: - - gocyclo - - gocognit - - errcheck - - dupl - - gosec - - linters: - - staticcheck - text: "SA9003:" - - linters: - - lll - source: "^//go:generate " - - linters: - - revive - text: "returns unexported type" max-issues-per-linter: 0 max-same-issues: 0 new: false +formatters: + enable: + - gofmt + - gofumpt + - goimports + settings: + gofmt: + simplify: true + rewrite-rules: + - pattern: interface{} + replacement: any + - pattern: a[b:len(a)] + replacement: a[b:] + gofumpt: + extra-rules: true + exclusions: + generated: lax + paths: + - mocks + - third_party$ + - builtin$ + - examples$ diff --git a/go.mod b/go.mod index 3c864e2..3ecd175 100644 --- a/go.mod +++ b/go.mod @@ -1,26 +1,24 @@ module github.com/etkecc/postmoogle -go 1.23.0 - -toolchain go1.23.5 +go 1.24.3 require ( github.com/archdx/zerolog-sentry v1.8.5 github.com/emersion/go-msgauth v0.7.0 github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6 - github.com/emersion/go-smtp v0.21.3 + github.com/emersion/go-smtp v0.22.0 github.com/etkecc/go-env v1.2.1 github.com/etkecc/go-fswatcher v1.0.1 github.com/etkecc/go-healthchecks/v2 v2.2.2 - github.com/etkecc/go-kit v1.6.0 - github.com/etkecc/go-linkpearl v0.0.0-20250416104026-a65bda9f5f37 + github.com/etkecc/go-kit v1.7.0 + github.com/etkecc/go-linkpearl v0.0.0-20250617213914-419fd498ee39 github.com/etkecc/go-mxidwc v1.0.1 github.com/etkecc/go-secgen v1.4.0 github.com/etkecc/go-validator/v2 v2.2.4 github.com/fsnotify/fsnotify v1.9.0 github.com/gabriel-vasile/mimetype v1.4.9 - github.com/getsentry/sentry-go v0.32.0 - github.com/jhillyerd/enmime v1.3.0 + github.com/getsentry/sentry-go v0.34.0 + github.com/jhillyerd/enmime/v2 v2.2.0 github.com/kvannotten/mailstrip v0.0.0-20200711213611-0002f5c0467e github.com/lib/pq v1.10.9 github.com/mcnijman/go-emailaddress v1.1.1 @@ -28,9 +26,9 @@ require ( github.com/raja/argon2pw v1.0.2-0.20210910183755-a391af63bd39 github.com/rs/zerolog v1.34.0 github.com/swaggo/swag v1.16.3 - golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 - maunium.net/go/mautrix v0.23.3 - modernc.org/sqlite v1.37.0 + golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b + maunium.net/go/mautrix v0.24.1 + modernc.org/sqlite v1.38.0 ) require ( @@ -43,6 +41,7 @@ require ( github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/etkecc/go-trysmtp v1.1.5 // indirect + github.com/fatih/color v1.18.0 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.19.6 // indirect github.com/go-openapi/spec v0.20.4 // indirect @@ -50,7 +49,7 @@ require ( github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect - github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056 // indirect + github.com/inbucket/html2text v1.0.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.14 // indirect @@ -59,8 +58,10 @@ require ( github.com/mattn/go-sqlite3 v1.14.28 // indirect github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a // indirect github.com/ncruces/go-strftime v0.1.9 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/petermattis/goid v0.0.0-20250319124200-ccd6737f222a // indirect + github.com/olekukonko/errors v1.1.0 // indirect + github.com/olekukonko/ll v0.0.9 // indirect + github.com/olekukonko/tablewriter v1.0.7 // indirect + github.com/petermattis/goid v0.0.0-20250508124226-395b08cebbdb // indirect github.com/pkg/errors v0.9.1 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rivo/uniseg v0.4.7 // indirect @@ -69,15 +70,15 @@ require ( github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect github.com/tidwall/sjson v1.2.5 // indirect - github.com/yuin/goldmark v1.7.10 // indirect - go.mau.fi/util v0.8.6 // indirect - golang.org/x/crypto v0.37.0 // indirect - golang.org/x/net v0.39.0 // indirect - golang.org/x/sys v0.32.0 // indirect - golang.org/x/text v0.24.0 // indirect - golang.org/x/tools v0.32.0 // indirect + github.com/yuin/goldmark v1.7.12 // indirect + go.mau.fi/util v0.8.8 // indirect + golang.org/x/crypto v0.39.0 // indirect + golang.org/x/net v0.41.0 // indirect + golang.org/x/sys v0.33.0 // indirect + golang.org/x/text v0.26.0 // indirect + golang.org/x/tools v0.34.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - modernc.org/libc v1.63.0 // indirect + modernc.org/libc v1.66.0 // indirect modernc.org/mathutil v1.7.1 // indirect - modernc.org/memory v1.10.0 // indirect + modernc.org/memory v1.11.0 // indirect ) diff --git a/go.sum b/go.sum index 07abc9d..5680d39 100644 --- a/go.sum +++ b/go.sum @@ -25,21 +25,20 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/emersion/go-msgauth v0.7.0 h1:vj2hMn6KhFtW41kshIBTXvp6KgYSqpA/ZN9Pv4g1INc= github.com/emersion/go-msgauth v0.7.0/go.mod h1:mmS9I6HkSovrNgq0HNXTeu8l3sRAAuQ9RMvbM4KU7Ck= -github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21/go.mod h1:iL2twTeMvZnrg54ZoPDNfJaJaqy0xIQFuBdrLsmspwQ= github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6 h1:oP4q0fw+fOSWn3DfFi4EXdT+B+gTtzx8GC9xsc26Znk= github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6/go.mod h1:iL2twTeMvZnrg54ZoPDNfJaJaqy0xIQFuBdrLsmspwQ= -github.com/emersion/go-smtp v0.21.3 h1:7uVwagE8iPYE48WhNsng3RRpCUpFvNl39JGNSIyGVMY= -github.com/emersion/go-smtp v0.21.3/go.mod h1:qm27SGYgoIPRot6ubfQ/GpiPy/g3PaZAVRxiO/sDUgQ= +github.com/emersion/go-smtp v0.22.0 h1:/d3HWxkZZ4riB+0kzfoODh9X+xyCrLEezMnAAa1LEMU= +github.com/emersion/go-smtp v0.22.0/go.mod h1:ZtRRkbTyp2XTHCA+BmyTFTrj8xY4I+b4McvHxCU2gsQ= github.com/etkecc/go-env v1.2.1 h1:b/mIa8D1d9hc3rI8h5bEtBHsnKkBZ6UbmYPog3QIPTU= github.com/etkecc/go-env v1.2.1/go.mod h1:yTs1DWEsllAZYA417r4V+OmMuYinGXtBzKkLGNvCv5c= github.com/etkecc/go-fswatcher v1.0.1 h1:n9hqtjzTS3ETb9hcZe1EqYA1lkkhlzZlztu3hXwFDQc= github.com/etkecc/go-fswatcher v1.0.1/go.mod h1:O5TODJ9z6Qb7X+snqHbB+F0Pah6G497Wdg0SFE/UYpE= github.com/etkecc/go-healthchecks/v2 v2.2.2 h1:YV7e+Ga8JY3aZX4Qf6Q1Ca+DnqbT5Drjli3PufB4J1g= github.com/etkecc/go-healthchecks/v2 v2.2.2/go.mod h1:IowWGN4F6By6z0eh63+639OscylgtdvT9ITjfN6hnZA= -github.com/etkecc/go-kit v1.6.0 h1:pNbIONvOuRaWuP0F4JLq2ASBxnsCEq5CFY3KeKdhaVY= -github.com/etkecc/go-kit v1.6.0/go.mod h1:yikghi8YaYbTjRXNtx82g0LFv90YqZi2vLf5Chw0ysg= -github.com/etkecc/go-linkpearl v0.0.0-20250416104026-a65bda9f5f37 h1:ZWUy35kMjyTXTU7cwHyyV1ttrOIBZlg/+z8zmbevj98= -github.com/etkecc/go-linkpearl v0.0.0-20250416104026-a65bda9f5f37/go.mod h1:iXvKPwSFgTG9DyEMN9UMuUNeZrZFYlGoBsZZNbiTMdQ= +github.com/etkecc/go-kit v1.7.0 h1:jxJ+tWfWwYqgNgfdbZ2va/M0AHyDdKwc8lYGXrFuWsc= +github.com/etkecc/go-kit v1.7.0/go.mod h1:yikghi8YaYbTjRXNtx82g0LFv90YqZi2vLf5Chw0ysg= +github.com/etkecc/go-linkpearl v0.0.0-20250617213914-419fd498ee39 h1:wZ+Iv47qoBy3jzzVgzS52KkQWcddUuDsO5s59J2q+1g= +github.com/etkecc/go-linkpearl v0.0.0-20250617213914-419fd498ee39/go.mod h1:v4QqBXgDZ4Hz235SqyaHde1FL+dNpdnjX4tTR4kxcaI= github.com/etkecc/go-mxidwc v1.0.1 h1:t4Kq3FxSlQjt1i7RpzE5q3cOWjJ0vrTzzGZRSpgh8mg= github.com/etkecc/go-mxidwc v1.0.1/go.mod h1:WFlntcH4mdual/gNi6X7a6rSJERNuLjdrwM3K/tucQA= github.com/etkecc/go-secgen v1.4.0 h1:PapLpen3aIqG2LDu+U6KWDb4SMW2UGuvetpJjd86yUc= @@ -48,12 +47,14 @@ github.com/etkecc/go-trysmtp v1.1.5 h1:MQ4l4bE9nWUqRKoJOalGHGLkb/hRmzbcBMlClufEO github.com/etkecc/go-trysmtp v1.1.5/go.mod h1:J4zQu+kgM37xQY148wUz0Dm6y+YhtzMghAv/AaXt0sQ= github.com/etkecc/go-validator/v2 v2.2.4 h1:E4sE4FpYPVP6VRvnndni+8qUXbeSuHxkniFsi6uCRFQ= github.com/etkecc/go-validator/v2 v2.2.4/go.mod h1:5VX2VICgMALoFBiGc02p/6RjQ8ifRxZ0KOuLAH5fTe0= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/gabriel-vasile/mimetype v1.4.9 h1:5k+WDwEsD9eTLL8Tz3L0VnmVh9QxGjRmjBvAG7U/oYY= github.com/gabriel-vasile/mimetype v1.4.9/go.mod h1:WnSQhFKJuBlRyLiKohA/2DtIlPFAbguNaG7QCHcyGok= -github.com/getsentry/sentry-go v0.32.0 h1:YKs+//QmwE3DcYtfKRH8/KyOOF/I6Qnx7qYGNHCGmCY= -github.com/getsentry/sentry-go v0.32.0/go.mod h1:CYNcMMz73YigoHljQRG+qPF+eMq8gG72XcGN/p71BAY= +github.com/getsentry/sentry-go v0.34.0 h1:1FCHBVp8TfSc8L10zqSwXUZNiOSF+10qw4czjarTiY4= +github.com/getsentry/sentry-go v0.34.0/go.mod h1:C55omcY9ChRQIUcVcGcs+Zdy4ZpQGvNJ7JYHIoSWOtE= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= @@ -66,8 +67,8 @@ github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7 github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= -github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U= +github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f h1:3BSP1Tbs2djlpprl7wCLuiqMaUh5SJkkzI2gDs+FgLs= github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14= @@ -79,10 +80,10 @@ 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/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056 h1:iCHtR9CQyktQ5+f3dMVZfwD2KWJUgm7M0gdL9NGr8KA= -github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056/go.mod h1:CVKlgaMiht+LXvHG173ujK6JUhZXKb2u/BQtjPDIvyk= -github.com/jhillyerd/enmime v1.3.0 h1:LV5kzfLidiOr8qRGIpYYmUZCnhrPbcFAnAFUnWn99rw= -github.com/jhillyerd/enmime v1.3.0/go.mod h1:6c6jg5HdRRV2FtvVL69LjiX1M8oE0xDX9VEhV3oy4gs= +github.com/inbucket/html2text v1.0.0 h1:N5kza++4uBBDJ2Z3KUnTRyPNoBcW+YfOgNiNmNB+sgs= +github.com/inbucket/html2text v1.0.0/go.mod h1:5TrhXQKGU+LXurODaSm55Y9eXoPBRnYiOz4x2XfUoJU= +github.com/jhillyerd/enmime/v2 v2.2.0 h1:Pe35MB96eZK5Q0XjlvPftOgWypQpd1gcbfJKAt7rsB8= +github.com/jhillyerd/enmime/v2 v2.2.0/go.mod h1:SOBXlCemjhiV2DvHhAKnJiWrtJGS/Ffuw4Iy7NjBTaI= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -108,7 +109,6 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.28 h1:ThEiQrnbtumT+QMknw63Befp/ce/nUPgBPMlRFEum7A= @@ -122,10 +122,14 @@ github.com/mileusna/crontab v1.2.0/go.mod h1:dbns64w/u3tUnGZGf8pAa76ZqOfeBX4olW4 github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/petermattis/goid v0.0.0-20250319124200-ccd6737f222a h1:S+AGcmAESQ0pXCUNnRH7V+bOUIgkSX5qVt2cNKCrm0Q= -github.com/petermattis/goid v0.0.0-20250319124200-ccd6737f222a/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/olekukonko/errors v1.1.0 h1:RNuGIh15QdDenh+hNvKrJkmxxjV4hcS50Db478Ou5sM= +github.com/olekukonko/errors v1.1.0/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y= +github.com/olekukonko/ll v0.0.9 h1:Y+1YqDfVkqMWuEQMclsF9HUR5+a82+dxJuL1HHSRpxI= +github.com/olekukonko/ll v0.0.9/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g= +github.com/olekukonko/tablewriter v1.0.7 h1:HCC2e3MM+2g72M81ZcJU11uciw6z/p82aEnm4/ySDGw= +github.com/olekukonko/tablewriter v1.0.7/go.mod h1:H428M+HzoUXC6JU2Abj9IT9ooRmdq9CxuDmKMtrOCMs= +github.com/petermattis/goid v0.0.0-20250508124226-395b08cebbdb h1:3PrKuO92dUTMrQ9dx0YNejC6U/Si6jqKmyQ9vWjwqR4= +github.com/petermattis/goid v0.0.0-20250508124226-395b08cebbdb/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -163,41 +167,41 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= -github.com/yuin/goldmark v1.7.10 h1:S+LrtBjRmqMac2UdtB6yyCEJm+UILZ2fefI4p7o0QpI= -github.com/yuin/goldmark v1.7.10/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -go.mau.fi/util v0.8.6 h1:AEK13rfgtiZJL2YsNK+W4ihhYCuukcRom8WPP/w/L54= -go.mau.fi/util v0.8.6/go.mod h1:uNB3UTXFbkpp7xL1M/WvQks90B/L4gvbLpbS0603KOE= +github.com/yuin/goldmark v1.7.12 h1:YwGP/rrea2/CnCtUHgjuolG/PnMxdQtPMO5PvaE2/nY= +github.com/yuin/goldmark v1.7.12/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= +go.mau.fi/util v0.8.8 h1:OnuEEc/sIJFhnq4kFggiImUpcmnmL/xpvQMRu5Fiy5c= +go.mau.fi/util v0.8.8/go.mod h1:Y/kS3loxTEhy8Vill513EtPXr+CRDdae+Xj2BXXMy/c= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= -golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= -golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 h1:R84qjqJb5nVJMxqWYb3np9L5ZsaDtB+a39EqjV0JSUM= -golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0/go.mod h1:S9Xr4PYopiDyqSyp5NjCrhFrqg6A5zA2E/iPHPhqnS8= -golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= -golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM= +golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U= +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.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= +golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= -golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= -golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= -golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= -golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= +golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= +golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= +golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= -golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= -golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= +golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg= +golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= -golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU= -golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s= +golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= +golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -210,28 +214,30 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -maunium.net/go/mautrix v0.23.3 h1:U+fzdcLhFKLUm5gf2+Q0hEUqWkwDMRfvE+paUH9ogSk= -maunium.net/go/mautrix v0.23.3/go.mod h1:LX+3evXVKSvh/b43BVC3rkvN2qV7b0bkIV4fY7Snn/4= -modernc.org/cc/v4 v4.26.0 h1:QMYvbVduUGH0rrO+5mqF/PSPPRZNpRtg2CLELy7vUpA= -modernc.org/cc/v4 v4.26.0/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0= -modernc.org/ccgo/v4 v4.26.0 h1:gVzXaDzGeBYJ2uXTOpR8FR7OlksDOe9jxnjhIKCsiTc= -modernc.org/ccgo/v4 v4.26.0/go.mod h1:Sem8f7TFUtVXkG2fiaChQtyyfkqhJBg/zjEJBkmuAVY= -modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= -modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= +maunium.net/go/mautrix v0.24.1 h1:09/xi4qTeA03g1n/DPmmqAlT8Cx4QrgwiPlmLVzA9AU= +maunium.net/go/mautrix v0.24.1/go.mod h1:Xy6o+pXmbqmgWsUWh15EQ1eozjC+k/VT/7kloByv9PI= +modernc.org/cc/v4 v4.26.1 h1:+X5NtzVBn0KgsBCBe+xkDC7twLb/jNVj9FPgiwSQO3s= +modernc.org/cc/v4 v4.26.1/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0= +modernc.org/ccgo/v4 v4.28.0 h1:rjznn6WWehKq7dG4JtLRKxb52Ecv8OUGah8+Z/SfpNU= +modernc.org/ccgo/v4 v4.28.0/go.mod h1:JygV3+9AV6SmPhDasu4JgquwU81XAKLd3OKTUDNOiKE= +modernc.org/fileutil v1.3.3 h1:3qaU+7f7xxTUmvU1pJTZiDLAIoJVdUSSauJNHg9yXoA= +modernc.org/fileutil v1.3.3/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/libc v1.63.0 h1:wKzb61wOGCzgahQBORb1b0dZonh8Ufzl/7r4Yf1D5YA= -modernc.org/libc v1.63.0/go.mod h1:wDzH1mgz1wUIEwottFt++POjGRO9sgyQKrpXaz3x89E= +modernc.org/goabi0 v0.0.3 h1:y81b9r3asCh6Xtse6Nz85aYGB0cG3M3U6222yap1KWI= +modernc.org/goabi0 v0.0.3/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI= +modernc.org/libc v1.66.0 h1:eoFuDb1ozurUY5WSWlgvxHp0FuL+AncMwNjFqGYMJPQ= +modernc.org/libc v1.66.0/go.mod h1:AiZxInURfEJx516LqEaFcrC+X38rt9G7+8ojIXQKHbo= 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.10.0 h1:fzumd51yQ1DxcOxSO+S6X7+QTuVU+n8/Aj7swYjFfC4= -modernc.org/memory v1.10.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw= +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.37.0 h1:s1TMe7T3Q3ovQiK2Ouz4Jwh7dw4ZDqbebSDTlSJdfjI= -modernc.org/sqlite v1.37.0/go.mod h1:5YiWv+YviqGMuGw4V+PNplcyaJ5v+vQd7TQOgkACoJM= +modernc.org/sqlite v1.38.0 h1:+4OrfPQ8pxHKuWG4md1JpR/EYAh3Md7TdejuuzE7EUI= +modernc.org/sqlite v1.38.0/go.mod h1:1Bj+yES4SVvBZ4cBOpVZ6QgesMCKpJZDq0nxYzOpmNE= 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/internal/email/email.go b/internal/email/email.go index 24a42b9..6812ee2 100644 --- a/internal/email/email.go +++ b/internal/email/email.go @@ -8,7 +8,7 @@ import ( "github.com/emersion/go-msgauth/dkim" "github.com/etkecc/go-linkpearl" - "github.com/jhillyerd/enmime" + "github.com/jhillyerd/enmime/v2" "github.com/kvannotten/mailstrip" "maunium.net/go/mautrix/event" "maunium.net/go/mautrix/format" diff --git a/internal/smtp/session.go b/internal/smtp/session.go index bff0946..1b2a061 100644 --- a/internal/smtp/session.go +++ b/internal/smtp/session.go @@ -15,7 +15,7 @@ import ( "github.com/etkecc/go-validator/v2" "github.com/etkecc/postmoogle/internal/email" "github.com/etkecc/postmoogle/internal/utils" - "github.com/jhillyerd/enmime" + "github.com/jhillyerd/enmime/v2" "github.com/rs/zerolog" "maunium.net/go/mautrix/id" ) diff --git a/vendor/github.com/emersion/go-smtp/README.md b/vendor/github.com/emersion/go-smtp/README.md index a89ba5a..ffe0a8b 100644 --- a/vendor/github.com/emersion/go-smtp/README.md +++ b/vendor/github.com/emersion/go-smtp/README.md @@ -1,7 +1,6 @@ # go-smtp [![Go Reference](https://pkg.go.dev/badge/github.com/emersion/go-smtp.svg)](https://pkg.go.dev/github.com/emersion/go-smtp) -[![builds.sr.ht status](https://builds.sr.ht/~emersion/go-smtp/commits.svg)](https://builds.sr.ht/~emersion/go-smtp/commits?) An ESMTP client and server library written in Go. diff --git a/vendor/github.com/emersion/go-smtp/client.go b/vendor/github.com/emersion/go-smtp/client.go index e937fb5..d6408df 100644 --- a/vendor/github.com/emersion/go-smtp/client.go +++ b/vendor/github.com/emersion/go-smtp/client.go @@ -12,6 +12,7 @@ import ( "io" "net" "net/textproto" + "sort" "strconv" "strings" "time" @@ -81,7 +82,7 @@ func DialTLS(addr string, tlsConfig *tls.Config) (*Client, error) { return client, nil } -// DialStartTLS retruns a new Client connected to an SMTP server via STARTTLS +// DialStartTLS returns a new Client connected to an SMTP server via STARTTLS // at addr. The addr must include a port, as in "mail.example.com:smtp". // // A nil tlsConfig is equivalent to a zero tls.Config. @@ -530,6 +531,9 @@ func (c *Client) Rcpt(to string, opts *RcptOptions) error { fmt.Fprintf(&sb, " ORCPT=%s;%s", string(opts.OriginalRecipientType), enc) } } + if _, ok := c.ext["RRVS"]; ok && opts != nil && !opts.RequireRecipientValidSince.IsZero() { + sb.WriteString(fmt.Sprintf(" RRVS=%s", opts.RequireRecipientValidSince.Format(time.RFC3339))) + } if _, _, err := c.cmd(25, "%s", sb.String()); err != nil { return err } @@ -537,85 +541,152 @@ func (c *Client) Rcpt(to string, opts *RcptOptions) error { return nil } -type dataCloser struct { - c *Client - io.WriteCloser - statusCb func(rcpt string, status *SMTPError) - closed bool +// DataCommand is a pending DATA command. DataCommand is an io.WriteCloser. +// See Client.Data. +type DataCommand struct { + client *Client + wc io.WriteCloser + + closeErr error } -func (d *dataCloser) Close() error { - if d.closed { - return fmt.Errorf("smtp: data writer closed twice") +var _ io.WriteCloser = (*DataCommand)(nil) + +// Write implements io.Writer. +func (cmd *DataCommand) Write(b []byte) (int, error) { + return cmd.wc.Write(b) +} + +// Close implements io.Closer. +func (cmd *DataCommand) Close() error { + var err error + if cmd.client.lmtp { + _, err = cmd.CloseWithLMTPResponse() + } else { + _, err = cmd.CloseWithResponse() + } + return err +} + +// CloseWithResponse is equivalent to Close, but also returns the server +// response. It cannot be called when the LMTP protocol is used. +// +// If server returns an error, it will be of type *SMTPError. +func (cmd *DataCommand) CloseWithResponse() (*DataResponse, error) { + if cmd.client.lmtp { + return nil, errors.New("smtp: CloseWithResponse used with an LMTP client") } - if err := d.WriteCloser.Close(); err != nil { + if err := cmd.close(); err != nil { + return nil, err + } + + cmd.client.conn.SetDeadline(time.Now().Add(cmd.client.SubmissionTimeout)) + defer cmd.client.conn.SetDeadline(time.Time{}) + + _, msg, err := cmd.client.readResponse(250) + if err != nil { + cmd.closeErr = err + return nil, err + } + + return &DataResponse{StatusText: msg}, nil +} + +// CloseWithLMTPResponse is equivalent to Close, but also returns per-recipient +// server responses. It can only be called when the LMTP protocol is used. +// +// If server returns an error, it will be of type LMTPDataError. +func (cmd *DataCommand) CloseWithLMTPResponse() (map[string]*DataResponse, error) { + if !cmd.client.lmtp { + return nil, errors.New("smtp: CloseWithLMTPResponse used without an LMTP client") + } + + if err := cmd.close(); err != nil { + return nil, err + } + + cmd.client.conn.SetDeadline(time.Now().Add(cmd.client.SubmissionTimeout)) + defer cmd.client.conn.SetDeadline(time.Time{}) + + resp := make(map[string]*DataResponse, len(cmd.client.rcpts)) + lmtpErr := make(LMTPDataError, len(cmd.client.rcpts)) + for i := 0; i < len(cmd.client.rcpts); i++ { + rcpt := cmd.client.rcpts[i] + _, msg, err := cmd.client.readResponse(250) + if err != nil { + if smtpErr, ok := err.(*SMTPError); ok { + lmtpErr[rcpt] = smtpErr + } else { + if len(lmtpErr) > 0 { + return resp, errors.Join(err, lmtpErr) + } + return resp, err + } + } else { + resp[rcpt] = &DataResponse{StatusText: msg} + } + } + + if len(lmtpErr) > 0 { + return resp, lmtpErr + } + return resp, nil +} + +func (cmd *DataCommand) close() error { + if cmd.closeErr != nil { + return cmd.closeErr + } + + if err := cmd.wc.Close(); err != nil { + cmd.closeErr = err return err } - d.c.conn.SetDeadline(time.Now().Add(d.c.SubmissionTimeout)) - defer d.c.conn.SetDeadline(time.Time{}) - - expectedResponses := len(d.c.rcpts) - if d.c.lmtp { - for expectedResponses > 0 { - rcpt := d.c.rcpts[len(d.c.rcpts)-expectedResponses] - if _, _, err := d.c.readResponse(250); err != nil { - if smtpErr, ok := err.(*SMTPError); ok { - if d.statusCb != nil { - d.statusCb(rcpt, smtpErr) - } - } else { - return err - } - } else if d.statusCb != nil { - d.statusCb(rcpt, nil) - } - expectedResponses-- - } - } else { - _, _, err := d.c.readResponse(250) - if err != nil { - return err - } - } - - d.closed = true + cmd.closeErr = errors.New("smtp: data writer closed twice") return nil } +// DataResponse is the response returned by a DATA command. See +// DataCommand.CloseWithResponse. +type DataResponse struct { + // StatusText is the status text returned by the server. It may contain + // tracking information. + StatusText string +} + +// LMTPDataError is a collection of errors returned by an LMTP server for a +// DATA command. It holds per-recipient errors. +type LMTPDataError map[string]*SMTPError + +// Error implements error. +func (lmtpErr LMTPDataError) Error() string { + return errors.Join(lmtpErr.Unwrap()...).Error() +} + +// Unwrap returns all per-recipient errors returned by the server. +func (lmtpErr LMTPDataError) Unwrap() []error { + l := make([]error, 0, len(lmtpErr)) + for rcpt, smtpErr := range lmtpErr { + l = append(l, fmt.Errorf("<%v>: %w", rcpt, smtpErr)) + } + sort.Slice(l, func(i, j int) bool { + return l[i].Error() < l[j].Error() + }) + return l +} + // Data issues a DATA command to the server and returns a writer that // can be used to write the mail headers and body. The caller should // close the writer before calling any more methods on c. A call to // Data must be preceded by one or more calls to Rcpt. -// -// If server returns an error, it will be of type *SMTPError. -func (c *Client) Data() (io.WriteCloser, error) { +func (c *Client) Data() (*DataCommand, error) { _, _, err := c.cmd(354, "DATA") if err != nil { return nil, err } - return &dataCloser{c: c, WriteCloser: c.text.DotWriter()}, nil -} - -// LMTPData is the LMTP-specific version of the Data method. It accepts a callback -// that will be called for each status response received from the server. -// -// Status callback will receive a SMTPError argument for each negative server -// reply and nil for each positive reply. I/O errors will not be reported using -// callback and instead will be returned by the Close method of io.WriteCloser. -// Callback will be called for each successfull Rcpt call done before in the -// same order. -func (c *Client) LMTPData(statusCb func(rcpt string, status *SMTPError)) (io.WriteCloser, error) { - if !c.lmtp { - return nil, errors.New("smtp: not a LMTP client") - } - - _, _, err := c.cmd(354, "DATA") - if err != nil { - return nil, err - } - return &dataCloser{c: c, WriteCloser: c.text.DotWriter(), statusCb: statusCb}, nil + return &DataCommand{client: c, wc: c.text.DotWriter()}, nil } // SendMail will use an existing connection to send an email from @@ -784,6 +855,11 @@ func (c *Client) Reset() error { if _, _, err := c.cmd(250, "RSET"); err != nil { return err } + + // allow custom HELLO again + c.didHello = false + c.helloError = nil + c.rcpts = nil return nil } diff --git a/vendor/github.com/emersion/go-smtp/conn.go b/vendor/github.com/emersion/go-smtp/conn.go index ec9f686..54a9ec0 100644 --- a/vendor/github.com/emersion/go-smtp/conn.go +++ b/vendor/github.com/emersion/go-smtp/conn.go @@ -229,14 +229,21 @@ func (c *Conn) handleGreet(enhanced bool, arg string) { // NewSession can access it via Conn.Hostname. c.helo = domain - sess, err := c.server.Backend.NewSession(c) - if err != nil { - c.helo = "" - c.writeError(451, EnhancedCode{4, 0, 0}, err) - return - } + // RFC 5321: "An EHLO command MAY be issued by a client later in the session" + if c.session != nil { + // RFC 5321: "... the SMTP server MUST clear all buffers + // and reset the state exactly as if a RSET command has been issued." + c.reset() + } else { + sess, err := c.server.Backend.NewSession(c) + if err != nil { + c.helo = "" + c.writeError(451, EnhancedCode{4, 0, 0}, err) + return + } - c.setSession(sess) + c.setSession(sess) + } if !enhanced { c.writeResponse(250, EnhancedCode{2, 0, 0}, fmt.Sprintf("Hello %s", domain)) @@ -284,6 +291,9 @@ func (c *Conn) handleGreet(enhanced bool, arg string) { if c.server.MaxRecipients > 0 { caps = append(caps, fmt.Sprintf("LIMITS RCPTMAX=%v", c.server.MaxRecipients)) } + if c.server.EnableRRVS { + caps = append(caps, "RRVS") + } args := []string{"Hello " + domain} args = append(args, caps...) @@ -709,6 +719,18 @@ func (c *Conn) handleRcpt(arg string) { } opts.OriginalRecipientType = aType opts.OriginalRecipient = aAddr + case "RRVS": + if !c.server.EnableRRVS { + c.writeResponse(504, EnhancedCode{5, 5, 4}, "RRVS is not implemented") + return + } + value, _, _ = strings.Cut(value, ";") // discard the no-support action + rrvsTime, err := time.Parse(time.RFC3339, value) + if err != nil { + c.writeResponse(501, EnhancedCode{5, 5, 4}, "Malformed RRVS parameter value") + return + } + opts.RequireRecipientValidSince = rrvsTime default: c.writeResponse(500, EnhancedCode{5, 5, 4}, "Unknown RCPT TO argument") return @@ -1229,13 +1251,17 @@ func (c *Conn) writeResponse(code int, enhCode EnhancedCode, text ...string) { } } - for i := 0; i < len(text)-1; i++ { + // transform each single line with \n, into separate lines + text = strings.Split(strings.Join(text, "\n"), "\n") + + lastLineIndex := len(text) - 1 + for i := 0; i < lastLineIndex; i++ { c.text.PrintfLine("%d-%v", code, text[i]) } if enhCode == NoEnhancedCode { - c.text.PrintfLine("%d %v", code, text[len(text)-1]) + c.text.PrintfLine("%d %v", code, text[lastLineIndex]) } else { - c.text.PrintfLine("%d %v.%v.%v %v", code, enhCode[0], enhCode[1], enhCode[2], text[len(text)-1]) + c.text.PrintfLine("%d %v.%v.%v %v", code, enhCode[0], enhCode[1], enhCode[2], text[lastLineIndex]) } } diff --git a/vendor/github.com/emersion/go-smtp/server.go b/vendor/github.com/emersion/go-smtp/server.go index 7c23a31..0891f1f 100644 --- a/vendor/github.com/emersion/go-smtp/server.go +++ b/vendor/github.com/emersion/go-smtp/server.go @@ -57,6 +57,10 @@ type Server struct { // Should be used only if backend supports it. EnableDSN bool + // Advertise RRVS (RFC 7293) capability. + // Should be used only if backend supports it. + EnableRRVS bool + // The server backend. Backend Backend diff --git a/vendor/github.com/emersion/go-smtp/smtp.go b/vendor/github.com/emersion/go-smtp/smtp.go index 9563b11..efc7bdf 100644 --- a/vendor/github.com/emersion/go-smtp/smtp.go +++ b/vendor/github.com/emersion/go-smtp/smtp.go @@ -17,6 +17,8 @@ // Additional extensions may be handled by other packages. package smtp +import "time" + type BodyType string const ( @@ -91,4 +93,8 @@ type RcptOptions struct { // Original recipient set by client. OriginalRecipientType DSNAddressType OriginalRecipient string + + // Time value of the RRVS= argument + // Left as the zero time if unset. + RequireRecipientValidSince time.Time } diff --git a/vendor/github.com/etkecc/go-kit/.golangci.yml b/vendor/github.com/etkecc/go-kit/.golangci.yml index 42a28d9..7d9b10c 100644 --- a/vendor/github.com/etkecc/go-kit/.golangci.yml +++ b/vendor/github.com/etkecc/go-kit/.golangci.yml @@ -1,73 +1,16 @@ +version: "2" run: concurrency: 4 - timeout: 30m + modules-download-mode: readonly issues-exit-code: 1 tests: true - build-tags: [] - modules-download-mode: readonly - output: formats: - - format: colored-line-number - print-issued-lines: true - print-linter-name: true - sort-results: true - -linters-settings: - decorder: - dec-order: - - const - - var - - type - - func - dogsled: - max-blank-identifiers: 3 - errcheck: - check-type-assertions: true - check-blank: true - errchkjson: - report-no-exported: true - exhaustive: - check: - - switch - - map - default-signifies-exhaustive: true - gocognit: - min-complexity: 15 - nestif: - min-complexity: 5 - gocritic: - enabled-tags: - - diagnostic - - style - - performance - gofmt: - simplify: true - rewrite-rules: - - pattern: 'interface{}' - replacement: 'any' - - pattern: 'a[b:len(a)]' - replacement: 'a[b:]' - gofumpt: - extra-rules: true - grouper: - const-require-single-const: true - import-require-single-import: true - var-require-single-var: true - misspell: - locale: US - usestdlibvars: - time-month: true - time-layout: true - crypto-hash: true - default-rpc-path: true - sql-isolation-level: true - tls-signature-scheme: true - constant-kind: true - unparam: - check-exported: true + text: + path: stdout + print-linter-name: true + print-issued-lines: true linters: - disable-all: false enable: - asasalint - asciicheck @@ -80,7 +23,6 @@ linters: - dupl - dupword - durationcheck - - errcheck - errchkjson - errname - errorlint @@ -89,14 +31,8 @@ linters: - gocognit - gocritic - gocyclo - - gofmt - - gofumpt - - goimports - gosec - - gosimple - gosmopolitan - - govet - - ineffassign - makezero - mirror - misspell @@ -106,36 +42,106 @@ linters: - predeclared - revive - sqlclosecheck - - staticcheck - unconvert - unparam - - unused - usestdlibvars - wastedassign - fast: false - - + settings: + decorder: + dec-order: + - const + - var + - type + - func + dogsled: + max-blank-identifiers: 3 + errcheck: + check-type-assertions: true + check-blank: true + errchkjson: + report-no-exported: true + exhaustive: + check: + - switch + - map + default-signifies-exhaustive: true + gocognit: + min-complexity: 15 + gocritic: + enabled-tags: + - diagnostic + - style + - performance + grouper: + const-require-single-const: true + import-require-single-import: true + var-require-single-var: true + misspell: + locale: US + nestif: + min-complexity: 5 + unparam: + check-exported: true + usestdlibvars: + time-month: true + time-layout: true + crypto-hash: true + default-rpc-path: true + sql-isolation-level: true + tls-signature-scheme: true + constant-kind: true + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - linters: + - dupl + - errcheck + - gocognit + - gocyclo + - gosec + path: _test\.go + - linters: + - staticcheck + text: 'SA9003:' + - linters: + - lll + source: '^//go:generate ' + - linters: + - revive + text: returns unexported type + paths: + - mocks + - third_party$ + - builtin$ + - examples$ issues: - exclude-dirs-use-default: true - exclude-dirs: - - mocks - exclude-rules: - - path: _test\.go - linters: - - gocyclo - - gocognit - - errcheck - - dupl - - gosec - - linters: - - staticcheck - text: "SA9003:" - - linters: - - lll - source: "^//go:generate " - - linters: - - revive - text: "returns unexported type" max-issues-per-linter: 0 max-same-issues: 0 new: false +formatters: + enable: + - gofmt + - gofumpt + - goimports + settings: + gofmt: + simplify: true + rewrite-rules: + - pattern: interface{} + replacement: any + - pattern: a[b:len(a)] + replacement: a[b:] + gofumpt: + extra-rules: true + exclusions: + generated: lax + paths: + - mocks + - third_party$ + - builtin$ + - examples$ diff --git a/vendor/github.com/etkecc/go-kit/ip.go b/vendor/github.com/etkecc/go-kit/ip.go new file mode 100644 index 0000000..794e675 --- /dev/null +++ b/vendor/github.com/etkecc/go-kit/ip.go @@ -0,0 +1,34 @@ +package kit + +import ( + "net" + "strings" +) + +// AnonymizeIP drops the last octet of the IPv4 and IPv6 address to anonymize it +func AnonymizeIP(ip string) string { + if ip == "" { + return "" + } + parsedIP := net.ParseIP(ip) + if parsedIP == nil { + return ip // not an ip + } + + // IPv4 + if parsedIP.To4() != nil { + ipParts := strings.Split(parsedIP.String(), ".") + if len(ipParts) == 4 { + ipParts[3] = "0" + return strings.Join(ipParts, ".") + } + } + + // IPv6 + ipParts := strings.Split(parsedIP.String(), ":") + if len(ipParts) > 0 { + ipParts[len(ipParts)-1] = "0" + return strings.Join(ipParts, ":") + } + return ip // not an ip +} diff --git a/vendor/github.com/etkecc/go-kit/strings.go b/vendor/github.com/etkecc/go-kit/strings.go index c82d8b5..b1dca15 100644 --- a/vendor/github.com/etkecc/go-kit/strings.go +++ b/vendor/github.com/etkecc/go-kit/strings.go @@ -63,6 +63,11 @@ func StringToInt(value string, optionalDefaultValue ...int) int { defaultValue = optionalDefaultValue[0] } + value = strings.TrimSpace(value) + if value == "" { + return defaultValue + } + vInt, err := strconv.Atoi(value) if err != nil { return defaultValue @@ -80,7 +85,7 @@ func StringToSlice(value string, optionalDefaultValue ...string) []string { value = strings.TrimSpace(value) if idx := strings.Index(value, ","); idx == -1 { - value = defaultValue + return []string{defaultValue} } parts := strings.Split(value, ",") @@ -93,6 +98,10 @@ func StringToSlice(value string, optionalDefaultValue ...string) []string { // SliceToString converts slice of strings into single string (using strings.Join) with optional hook func SliceToString(slice []string, delimiter string, hook func(string) string) string { + if len(slice) == 0 { + return "" + } + adjusted := make([]string, 0, len(slice)) for _, item := range slice { if hook != nil { diff --git a/vendor/github.com/etkecc/go-linkpearl/linkpearl.go b/vendor/github.com/etkecc/go-linkpearl/linkpearl.go index d18432f..5484583 100644 --- a/vendor/github.com/etkecc/go-linkpearl/linkpearl.go +++ b/vendor/github.com/etkecc/go-linkpearl/linkpearl.go @@ -159,7 +159,7 @@ func (l *Linkpearl) Start(ctx context.Context, optionalStatusMsg ...string) erro err := l.api.SetPresence(ctx, mautrix.ReqPresence{Presence: event.PresenceOnline, StatusMsg: statusMsg}) if err != nil { - l.log.Error().Err(err).Msg("cannot set presence") + l.log.Warn().Err(err).Msg("cannot set presence on start") } defer l.Stop(ctx) @@ -171,7 +171,7 @@ func (l *Linkpearl) Start(ctx context.Context, optionalStatusMsg ...string) erro func (l *Linkpearl) Stop(ctx context.Context) { l.log.Debug().Msg("stopping the client") if err := l.api.SetPresence(ctx, mautrix.ReqPresence{Presence: event.PresenceOffline}); err != nil { - l.log.Error().Err(err).Msg("cannot set presence") + l.log.Warn().Err(err).Msg("cannot set presence") } l.api.StopSync() if err := l.ch.Close(); err != nil { diff --git a/vendor/github.com/fatih/color/LICENSE.md b/vendor/github.com/fatih/color/LICENSE.md new file mode 100644 index 0000000..25fdaf6 --- /dev/null +++ b/vendor/github.com/fatih/color/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013 Fatih Arslan + +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. diff --git a/vendor/github.com/fatih/color/README.md b/vendor/github.com/fatih/color/README.md new file mode 100644 index 0000000..d135bfe --- /dev/null +++ b/vendor/github.com/fatih/color/README.md @@ -0,0 +1,189 @@ +# color [![](https://github.com/fatih/color/workflows/build/badge.svg)](https://github.com/fatih/color/actions) [![PkgGoDev](https://pkg.go.dev/badge/github.com/fatih/color)](https://pkg.go.dev/github.com/fatih/color) + +Color lets you use colorized outputs in terms of [ANSI Escape +Codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors) in Go (Golang). It +has support for Windows too! The API can be used in several ways, pick one that +suits you. + +![Color](https://user-images.githubusercontent.com/438920/96832689-03b3e000-13f4-11eb-9803-46f4c4de3406.jpg) + +## Install + +``` +go get github.com/fatih/color +``` + +## Examples + +### Standard colors + +```go +// Print with default helper functions +color.Cyan("Prints text in cyan.") + +// A newline will be appended automatically +color.Blue("Prints %s in blue.", "text") + +// These are using the default foreground colors +color.Red("We have red") +color.Magenta("And many others ..") + +``` + +### RGB colors + +If your terminal supports 24-bit colors, you can use RGB color codes. + +```go +color.RGB(255, 128, 0).Println("foreground orange") +color.RGB(230, 42, 42).Println("foreground red") + +color.BgRGB(255, 128, 0).Println("background orange") +color.BgRGB(230, 42, 42).Println("background red") +``` + +### Mix and reuse colors + +```go +// Create a new color object +c := color.New(color.FgCyan).Add(color.Underline) +c.Println("Prints cyan text with an underline.") + +// Or just add them to New() +d := color.New(color.FgCyan, color.Bold) +d.Printf("This prints bold cyan %s\n", "too!.") + +// Mix up foreground and background colors, create new mixes! +red := color.New(color.FgRed) + +boldRed := red.Add(color.Bold) +boldRed.Println("This will print text in bold red.") + +whiteBackground := red.Add(color.BgWhite) +whiteBackground.Println("Red text with white background.") + +// Mix with RGB color codes +color.RGB(255, 128, 0).AddBgRGB(0, 0, 0).Println("orange with black background") + +color.BgRGB(255, 128, 0).AddRGB(255, 255, 255).Println("orange background with white foreground") +``` + +### Use your own output (io.Writer) + +```go +// Use your own io.Writer output +color.New(color.FgBlue).Fprintln(myWriter, "blue color!") + +blue := color.New(color.FgBlue) +blue.Fprint(writer, "This will print text in blue.") +``` + +### Custom print functions (PrintFunc) + +```go +// Create a custom print function for convenience +red := color.New(color.FgRed).PrintfFunc() +red("Warning") +red("Error: %s", err) + +// Mix up multiple attributes +notice := color.New(color.Bold, color.FgGreen).PrintlnFunc() +notice("Don't forget this...") +``` + +### Custom fprint functions (FprintFunc) + +```go +blue := color.New(color.FgBlue).FprintfFunc() +blue(myWriter, "important notice: %s", stars) + +// Mix up with multiple attributes +success := color.New(color.Bold, color.FgGreen).FprintlnFunc() +success(myWriter, "Don't forget this...") +``` + +### Insert into noncolor strings (SprintFunc) + +```go +// Create SprintXxx functions to mix strings with other non-colorized strings: +yellow := color.New(color.FgYellow).SprintFunc() +red := color.New(color.FgRed).SprintFunc() +fmt.Printf("This is a %s and this is %s.\n", yellow("warning"), red("error")) + +info := color.New(color.FgWhite, color.BgGreen).SprintFunc() +fmt.Printf("This %s rocks!\n", info("package")) + +// Use helper functions +fmt.Println("This", color.RedString("warning"), "should be not neglected.") +fmt.Printf("%v %v\n", color.GreenString("Info:"), "an important message.") + +// Windows supported too! Just don't forget to change the output to color.Output +fmt.Fprintf(color.Output, "Windows support: %s", color.GreenString("PASS")) +``` + +### Plug into existing code + +```go +// Use handy standard colors +color.Set(color.FgYellow) + +fmt.Println("Existing text will now be in yellow") +fmt.Printf("This one %s\n", "too") + +color.Unset() // Don't forget to unset + +// You can mix up parameters +color.Set(color.FgMagenta, color.Bold) +defer color.Unset() // Use it in your function + +fmt.Println("All text will now be bold magenta.") +``` + +### Disable/Enable color + +There might be a case where you want to explicitly disable/enable color output. the +`go-isatty` package will automatically disable color output for non-tty output streams +(for example if the output were piped directly to `less`). + +The `color` package also disables color output if the [`NO_COLOR`](https://no-color.org) environment +variable is set to a non-empty string. + +`Color` has support to disable/enable colors programmatically both globally and +for single color definitions. For example suppose you have a CLI app and a +`-no-color` bool flag. You can easily disable the color output with: + +```go +var flagNoColor = flag.Bool("no-color", false, "Disable color output") + +if *flagNoColor { + color.NoColor = true // disables colorized output +} +``` + +It also has support for single color definitions (local). You can +disable/enable color output on the fly: + +```go +c := color.New(color.FgCyan) +c.Println("Prints cyan text") + +c.DisableColor() +c.Println("This is printed without any color") + +c.EnableColor() +c.Println("This prints again cyan...") +``` + +## GitHub Actions + +To output color in GitHub Actions (or other CI systems that support ANSI colors), make sure to set `color.NoColor = false` so that it bypasses the check for non-tty output streams. + + +## Credits + +* [Fatih Arslan](https://github.com/fatih) +* Windows support via @mattn: [colorable](https://github.com/mattn/go-colorable) + +## License + +The MIT License (MIT) - see [`LICENSE.md`](https://github.com/fatih/color/blob/master/LICENSE.md) for more details diff --git a/vendor/github.com/fatih/color/color.go b/vendor/github.com/fatih/color/color.go new file mode 100644 index 0000000..ee39b40 --- /dev/null +++ b/vendor/github.com/fatih/color/color.go @@ -0,0 +1,685 @@ +package color + +import ( + "fmt" + "io" + "os" + "strconv" + "strings" + "sync" + + "github.com/mattn/go-colorable" + "github.com/mattn/go-isatty" +) + +var ( + // NoColor defines if the output is colorized or not. It's dynamically set to + // false or true based on the stdout's file descriptor referring to a terminal + // or not. It's also set to true if the NO_COLOR environment variable is + // set (regardless of its value). This is a global option and affects all + // colors. For more control over each color block use the methods + // DisableColor() individually. + NoColor = noColorIsSet() || os.Getenv("TERM") == "dumb" || + (!isatty.IsTerminal(os.Stdout.Fd()) && !isatty.IsCygwinTerminal(os.Stdout.Fd())) + + // Output defines the standard output of the print functions. By default, + // os.Stdout is used. + Output = colorable.NewColorableStdout() + + // Error defines a color supporting writer for os.Stderr. + Error = colorable.NewColorableStderr() + + // colorsCache is used to reduce the count of created Color objects and + // allows to reuse already created objects with required Attribute. + colorsCache = make(map[Attribute]*Color) + colorsCacheMu sync.Mutex // protects colorsCache +) + +// noColorIsSet returns true if the environment variable NO_COLOR is set to a non-empty string. +func noColorIsSet() bool { + return os.Getenv("NO_COLOR") != "" +} + +// Color defines a custom color object which is defined by SGR parameters. +type Color struct { + params []Attribute + noColor *bool +} + +// Attribute defines a single SGR Code +type Attribute int + +const escape = "\x1b" + +// Base attributes +const ( + Reset Attribute = iota + Bold + Faint + Italic + Underline + BlinkSlow + BlinkRapid + ReverseVideo + Concealed + CrossedOut +) + +const ( + ResetBold Attribute = iota + 22 + ResetItalic + ResetUnderline + ResetBlinking + _ + ResetReversed + ResetConcealed + ResetCrossedOut +) + +var mapResetAttributes map[Attribute]Attribute = map[Attribute]Attribute{ + Bold: ResetBold, + Faint: ResetBold, + Italic: ResetItalic, + Underline: ResetUnderline, + BlinkSlow: ResetBlinking, + BlinkRapid: ResetBlinking, + ReverseVideo: ResetReversed, + Concealed: ResetConcealed, + CrossedOut: ResetCrossedOut, +} + +// Foreground text colors +const ( + FgBlack Attribute = iota + 30 + FgRed + FgGreen + FgYellow + FgBlue + FgMagenta + FgCyan + FgWhite + + // used internally for 256 and 24-bit coloring + foreground +) + +// Foreground Hi-Intensity text colors +const ( + FgHiBlack Attribute = iota + 90 + FgHiRed + FgHiGreen + FgHiYellow + FgHiBlue + FgHiMagenta + FgHiCyan + FgHiWhite +) + +// Background text colors +const ( + BgBlack Attribute = iota + 40 + BgRed + BgGreen + BgYellow + BgBlue + BgMagenta + BgCyan + BgWhite + + // used internally for 256 and 24-bit coloring + background +) + +// Background Hi-Intensity text colors +const ( + BgHiBlack Attribute = iota + 100 + BgHiRed + BgHiGreen + BgHiYellow + BgHiBlue + BgHiMagenta + BgHiCyan + BgHiWhite +) + +// New returns a newly created color object. +func New(value ...Attribute) *Color { + c := &Color{ + params: make([]Attribute, 0), + } + + if noColorIsSet() { + c.noColor = boolPtr(true) + } + + c.Add(value...) + return c +} + +// RGB returns a new foreground color in 24-bit RGB. +func RGB(r, g, b int) *Color { + return New(foreground, 2, Attribute(r), Attribute(g), Attribute(b)) +} + +// BgRGB returns a new background color in 24-bit RGB. +func BgRGB(r, g, b int) *Color { + return New(background, 2, Attribute(r), Attribute(g), Attribute(b)) +} + +// AddRGB is used to chain foreground RGB SGR parameters. Use as many as parameters to combine +// and create custom color objects. Example: .Add(34, 0, 12).Add(255, 128, 0). +func (c *Color) AddRGB(r, g, b int) *Color { + c.params = append(c.params, foreground, 2, Attribute(r), Attribute(g), Attribute(b)) + return c +} + +// AddRGB is used to chain background RGB SGR parameters. Use as many as parameters to combine +// and create custom color objects. Example: .Add(34, 0, 12).Add(255, 128, 0). +func (c *Color) AddBgRGB(r, g, b int) *Color { + c.params = append(c.params, background, 2, Attribute(r), Attribute(g), Attribute(b)) + return c +} + +// Set sets the given parameters immediately. It will change the color of +// output with the given SGR parameters until color.Unset() is called. +func Set(p ...Attribute) *Color { + c := New(p...) + c.Set() + return c +} + +// Unset resets all escape attributes and clears the output. Usually should +// be called after Set(). +func Unset() { + if NoColor { + return + } + + fmt.Fprintf(Output, "%s[%dm", escape, Reset) +} + +// Set sets the SGR sequence. +func (c *Color) Set() *Color { + if c.isNoColorSet() { + return c + } + + fmt.Fprint(Output, c.format()) + return c +} + +func (c *Color) unset() { + if c.isNoColorSet() { + return + } + + Unset() +} + +// SetWriter is used to set the SGR sequence with the given io.Writer. This is +// a low-level function, and users should use the higher-level functions, such +// as color.Fprint, color.Print, etc. +func (c *Color) SetWriter(w io.Writer) *Color { + if c.isNoColorSet() { + return c + } + + fmt.Fprint(w, c.format()) + return c +} + +// UnsetWriter resets all escape attributes and clears the output with the give +// io.Writer. Usually should be called after SetWriter(). +func (c *Color) UnsetWriter(w io.Writer) { + if c.isNoColorSet() { + return + } + + if NoColor { + return + } + + fmt.Fprintf(w, "%s[%dm", escape, Reset) +} + +// Add is used to chain SGR parameters. Use as many as parameters to combine +// and create custom color objects. Example: Add(color.FgRed, color.Underline). +func (c *Color) Add(value ...Attribute) *Color { + c.params = append(c.params, value...) + return c +} + +// Fprint formats using the default formats for its operands and writes to w. +// Spaces are added between operands when neither is a string. +// It returns the number of bytes written and any write error encountered. +// On Windows, users should wrap w with colorable.NewColorable() if w is of +// type *os.File. +func (c *Color) Fprint(w io.Writer, a ...interface{}) (n int, err error) { + c.SetWriter(w) + defer c.UnsetWriter(w) + + return fmt.Fprint(w, a...) +} + +// Print formats using the default formats for its operands and writes to +// standard output. Spaces are added between operands when neither is a +// string. It returns the number of bytes written and any write error +// encountered. This is the standard fmt.Print() method wrapped with the given +// color. +func (c *Color) Print(a ...interface{}) (n int, err error) { + c.Set() + defer c.unset() + + return fmt.Fprint(Output, a...) +} + +// Fprintf formats according to a format specifier and writes to w. +// It returns the number of bytes written and any write error encountered. +// On Windows, users should wrap w with colorable.NewColorable() if w is of +// type *os.File. +func (c *Color) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { + c.SetWriter(w) + defer c.UnsetWriter(w) + + return fmt.Fprintf(w, format, a...) +} + +// Printf formats according to a format specifier and writes to standard output. +// It returns the number of bytes written and any write error encountered. +// This is the standard fmt.Printf() method wrapped with the given color. +func (c *Color) Printf(format string, a ...interface{}) (n int, err error) { + c.Set() + defer c.unset() + + return fmt.Fprintf(Output, format, a...) +} + +// Fprintln formats using the default formats for its operands and writes to w. +// Spaces are always added between operands and a newline is appended. +// On Windows, users should wrap w with colorable.NewColorable() if w is of +// type *os.File. +func (c *Color) Fprintln(w io.Writer, a ...interface{}) (n int, err error) { + return fmt.Fprintln(w, c.wrap(sprintln(a...))) +} + +// Println formats using the default formats for its operands and writes to +// standard output. Spaces are always added between operands and a newline is +// appended. It returns the number of bytes written and any write error +// encountered. This is the standard fmt.Print() method wrapped with the given +// color. +func (c *Color) Println(a ...interface{}) (n int, err error) { + return fmt.Fprintln(Output, c.wrap(sprintln(a...))) +} + +// Sprint is just like Print, but returns a string instead of printing it. +func (c *Color) Sprint(a ...interface{}) string { + return c.wrap(fmt.Sprint(a...)) +} + +// Sprintln is just like Println, but returns a string instead of printing it. +func (c *Color) Sprintln(a ...interface{}) string { + return c.wrap(sprintln(a...)) + "\n" +} + +// Sprintf is just like Printf, but returns a string instead of printing it. +func (c *Color) Sprintf(format string, a ...interface{}) string { + return c.wrap(fmt.Sprintf(format, a...)) +} + +// FprintFunc returns a new function that prints the passed arguments as +// colorized with color.Fprint(). +func (c *Color) FprintFunc() func(w io.Writer, a ...interface{}) { + return func(w io.Writer, a ...interface{}) { + c.Fprint(w, a...) + } +} + +// PrintFunc returns a new function that prints the passed arguments as +// colorized with color.Print(). +func (c *Color) PrintFunc() func(a ...interface{}) { + return func(a ...interface{}) { + c.Print(a...) + } +} + +// FprintfFunc returns a new function that prints the passed arguments as +// colorized with color.Fprintf(). +func (c *Color) FprintfFunc() func(w io.Writer, format string, a ...interface{}) { + return func(w io.Writer, format string, a ...interface{}) { + c.Fprintf(w, format, a...) + } +} + +// PrintfFunc returns a new function that prints the passed arguments as +// colorized with color.Printf(). +func (c *Color) PrintfFunc() func(format string, a ...interface{}) { + return func(format string, a ...interface{}) { + c.Printf(format, a...) + } +} + +// FprintlnFunc returns a new function that prints the passed arguments as +// colorized with color.Fprintln(). +func (c *Color) FprintlnFunc() func(w io.Writer, a ...interface{}) { + return func(w io.Writer, a ...interface{}) { + c.Fprintln(w, a...) + } +} + +// PrintlnFunc returns a new function that prints the passed arguments as +// colorized with color.Println(). +func (c *Color) PrintlnFunc() func(a ...interface{}) { + return func(a ...interface{}) { + c.Println(a...) + } +} + +// SprintFunc returns a new function that returns colorized strings for the +// given arguments with fmt.Sprint(). Useful to put into or mix into other +// string. Windows users should use this in conjunction with color.Output, example: +// +// put := New(FgYellow).SprintFunc() +// fmt.Fprintf(color.Output, "This is a %s", put("warning")) +func (c *Color) SprintFunc() func(a ...interface{}) string { + return func(a ...interface{}) string { + return c.wrap(fmt.Sprint(a...)) + } +} + +// SprintfFunc returns a new function that returns colorized strings for the +// given arguments with fmt.Sprintf(). Useful to put into or mix into other +// string. Windows users should use this in conjunction with color.Output. +func (c *Color) SprintfFunc() func(format string, a ...interface{}) string { + return func(format string, a ...interface{}) string { + return c.wrap(fmt.Sprintf(format, a...)) + } +} + +// SprintlnFunc returns a new function that returns colorized strings for the +// given arguments with fmt.Sprintln(). Useful to put into or mix into other +// string. Windows users should use this in conjunction with color.Output. +func (c *Color) SprintlnFunc() func(a ...interface{}) string { + return func(a ...interface{}) string { + return c.wrap(sprintln(a...)) + "\n" + } +} + +// sequence returns a formatted SGR sequence to be plugged into a "\x1b[...m" +// an example output might be: "1;36" -> bold cyan +func (c *Color) sequence() string { + format := make([]string, len(c.params)) + for i, v := range c.params { + format[i] = strconv.Itoa(int(v)) + } + + return strings.Join(format, ";") +} + +// wrap wraps the s string with the colors attributes. The string is ready to +// be printed. +func (c *Color) wrap(s string) string { + if c.isNoColorSet() { + return s + } + + return c.format() + s + c.unformat() +} + +func (c *Color) format() string { + return fmt.Sprintf("%s[%sm", escape, c.sequence()) +} + +func (c *Color) unformat() string { + //return fmt.Sprintf("%s[%dm", escape, Reset) + //for each element in sequence let's use the specific reset escape, or the generic one if not found + format := make([]string, len(c.params)) + for i, v := range c.params { + format[i] = strconv.Itoa(int(Reset)) + ra, ok := mapResetAttributes[v] + if ok { + format[i] = strconv.Itoa(int(ra)) + } + } + + return fmt.Sprintf("%s[%sm", escape, strings.Join(format, ";")) +} + +// DisableColor disables the color output. Useful to not change any existing +// code and still being able to output. Can be used for flags like +// "--no-color". To enable back use EnableColor() method. +func (c *Color) DisableColor() { + c.noColor = boolPtr(true) +} + +// EnableColor enables the color output. Use it in conjunction with +// DisableColor(). Otherwise, this method has no side effects. +func (c *Color) EnableColor() { + c.noColor = boolPtr(false) +} + +func (c *Color) isNoColorSet() bool { + // check first if we have user set action + if c.noColor != nil { + return *c.noColor + } + + // if not return the global option, which is disabled by default + return NoColor +} + +// Equals returns a boolean value indicating whether two colors are equal. +func (c *Color) Equals(c2 *Color) bool { + if c == nil && c2 == nil { + return true + } + if c == nil || c2 == nil { + return false + } + if len(c.params) != len(c2.params) { + return false + } + + for _, attr := range c.params { + if !c2.attrExists(attr) { + return false + } + } + + return true +} + +func (c *Color) attrExists(a Attribute) bool { + for _, attr := range c.params { + if attr == a { + return true + } + } + + return false +} + +func boolPtr(v bool) *bool { + return &v +} + +func getCachedColor(p Attribute) *Color { + colorsCacheMu.Lock() + defer colorsCacheMu.Unlock() + + c, ok := colorsCache[p] + if !ok { + c = New(p) + colorsCache[p] = c + } + + return c +} + +func colorPrint(format string, p Attribute, a ...interface{}) { + c := getCachedColor(p) + + if !strings.HasSuffix(format, "\n") { + format += "\n" + } + + if len(a) == 0 { + c.Print(format) + } else { + c.Printf(format, a...) + } +} + +func colorString(format string, p Attribute, a ...interface{}) string { + c := getCachedColor(p) + + if len(a) == 0 { + return c.SprintFunc()(format) + } + + return c.SprintfFunc()(format, a...) +} + +// Black is a convenient helper function to print with black foreground. A +// newline is appended to format by default. +func Black(format string, a ...interface{}) { colorPrint(format, FgBlack, a...) } + +// Red is a convenient helper function to print with red foreground. A +// newline is appended to format by default. +func Red(format string, a ...interface{}) { colorPrint(format, FgRed, a...) } + +// Green is a convenient helper function to print with green foreground. A +// newline is appended to format by default. +func Green(format string, a ...interface{}) { colorPrint(format, FgGreen, a...) } + +// Yellow is a convenient helper function to print with yellow foreground. +// A newline is appended to format by default. +func Yellow(format string, a ...interface{}) { colorPrint(format, FgYellow, a...) } + +// Blue is a convenient helper function to print with blue foreground. A +// newline is appended to format by default. +func Blue(format string, a ...interface{}) { colorPrint(format, FgBlue, a...) } + +// Magenta is a convenient helper function to print with magenta foreground. +// A newline is appended to format by default. +func Magenta(format string, a ...interface{}) { colorPrint(format, FgMagenta, a...) } + +// Cyan is a convenient helper function to print with cyan foreground. A +// newline is appended to format by default. +func Cyan(format string, a ...interface{}) { colorPrint(format, FgCyan, a...) } + +// White is a convenient helper function to print with white foreground. A +// newline is appended to format by default. +func White(format string, a ...interface{}) { colorPrint(format, FgWhite, a...) } + +// BlackString is a convenient helper function to return a string with black +// foreground. +func BlackString(format string, a ...interface{}) string { return colorString(format, FgBlack, a...) } + +// RedString is a convenient helper function to return a string with red +// foreground. +func RedString(format string, a ...interface{}) string { return colorString(format, FgRed, a...) } + +// GreenString is a convenient helper function to return a string with green +// foreground. +func GreenString(format string, a ...interface{}) string { return colorString(format, FgGreen, a...) } + +// YellowString is a convenient helper function to return a string with yellow +// foreground. +func YellowString(format string, a ...interface{}) string { return colorString(format, FgYellow, a...) } + +// BlueString is a convenient helper function to return a string with blue +// foreground. +func BlueString(format string, a ...interface{}) string { return colorString(format, FgBlue, a...) } + +// MagentaString is a convenient helper function to return a string with magenta +// foreground. +func MagentaString(format string, a ...interface{}) string { + return colorString(format, FgMagenta, a...) +} + +// CyanString is a convenient helper function to return a string with cyan +// foreground. +func CyanString(format string, a ...interface{}) string { return colorString(format, FgCyan, a...) } + +// WhiteString is a convenient helper function to return a string with white +// foreground. +func WhiteString(format string, a ...interface{}) string { return colorString(format, FgWhite, a...) } + +// HiBlack is a convenient helper function to print with hi-intensity black foreground. A +// newline is appended to format by default. +func HiBlack(format string, a ...interface{}) { colorPrint(format, FgHiBlack, a...) } + +// HiRed is a convenient helper function to print with hi-intensity red foreground. A +// newline is appended to format by default. +func HiRed(format string, a ...interface{}) { colorPrint(format, FgHiRed, a...) } + +// HiGreen is a convenient helper function to print with hi-intensity green foreground. A +// newline is appended to format by default. +func HiGreen(format string, a ...interface{}) { colorPrint(format, FgHiGreen, a...) } + +// HiYellow is a convenient helper function to print with hi-intensity yellow foreground. +// A newline is appended to format by default. +func HiYellow(format string, a ...interface{}) { colorPrint(format, FgHiYellow, a...) } + +// HiBlue is a convenient helper function to print with hi-intensity blue foreground. A +// newline is appended to format by default. +func HiBlue(format string, a ...interface{}) { colorPrint(format, FgHiBlue, a...) } + +// HiMagenta is a convenient helper function to print with hi-intensity magenta foreground. +// A newline is appended to format by default. +func HiMagenta(format string, a ...interface{}) { colorPrint(format, FgHiMagenta, a...) } + +// HiCyan is a convenient helper function to print with hi-intensity cyan foreground. A +// newline is appended to format by default. +func HiCyan(format string, a ...interface{}) { colorPrint(format, FgHiCyan, a...) } + +// HiWhite is a convenient helper function to print with hi-intensity white foreground. A +// newline is appended to format by default. +func HiWhite(format string, a ...interface{}) { colorPrint(format, FgHiWhite, a...) } + +// HiBlackString is a convenient helper function to return a string with hi-intensity black +// foreground. +func HiBlackString(format string, a ...interface{}) string { + return colorString(format, FgHiBlack, a...) +} + +// HiRedString is a convenient helper function to return a string with hi-intensity red +// foreground. +func HiRedString(format string, a ...interface{}) string { return colorString(format, FgHiRed, a...) } + +// HiGreenString is a convenient helper function to return a string with hi-intensity green +// foreground. +func HiGreenString(format string, a ...interface{}) string { + return colorString(format, FgHiGreen, a...) +} + +// HiYellowString is a convenient helper function to return a string with hi-intensity yellow +// foreground. +func HiYellowString(format string, a ...interface{}) string { + return colorString(format, FgHiYellow, a...) +} + +// HiBlueString is a convenient helper function to return a string with hi-intensity blue +// foreground. +func HiBlueString(format string, a ...interface{}) string { return colorString(format, FgHiBlue, a...) } + +// HiMagentaString is a convenient helper function to return a string with hi-intensity magenta +// foreground. +func HiMagentaString(format string, a ...interface{}) string { + return colorString(format, FgHiMagenta, a...) +} + +// HiCyanString is a convenient helper function to return a string with hi-intensity cyan +// foreground. +func HiCyanString(format string, a ...interface{}) string { return colorString(format, FgHiCyan, a...) } + +// HiWhiteString is a convenient helper function to return a string with hi-intensity white +// foreground. +func HiWhiteString(format string, a ...interface{}) string { + return colorString(format, FgHiWhite, a...) +} + +// sprintln is a helper function to format a string with fmt.Sprintln and trim the trailing newline. +func sprintln(a ...interface{}) string { + return strings.TrimSuffix(fmt.Sprintln(a...), "\n") +} diff --git a/vendor/github.com/fatih/color/color_windows.go b/vendor/github.com/fatih/color/color_windows.go new file mode 100644 index 0000000..be01c55 --- /dev/null +++ b/vendor/github.com/fatih/color/color_windows.go @@ -0,0 +1,19 @@ +package color + +import ( + "os" + + "golang.org/x/sys/windows" +) + +func init() { + // Opt-in for ansi color support for current process. + // https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#output-sequences + var outMode uint32 + out := windows.Handle(os.Stdout.Fd()) + if err := windows.GetConsoleMode(out, &outMode); err != nil { + return + } + outMode |= windows.ENABLE_PROCESSED_OUTPUT | windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING + _ = windows.SetConsoleMode(out, outMode) +} diff --git a/vendor/github.com/fatih/color/doc.go b/vendor/github.com/fatih/color/doc.go new file mode 100644 index 0000000..9491ad5 --- /dev/null +++ b/vendor/github.com/fatih/color/doc.go @@ -0,0 +1,134 @@ +/* +Package color is an ANSI color package to output colorized or SGR defined +output to the standard output. The API can be used in several way, pick one +that suits you. + +Use simple and default helper functions with predefined foreground colors: + + color.Cyan("Prints text in cyan.") + + // a newline will be appended automatically + color.Blue("Prints %s in blue.", "text") + + // More default foreground colors.. + color.Red("We have red") + color.Yellow("Yellow color too!") + color.Magenta("And many others ..") + + // Hi-intensity colors + color.HiGreen("Bright green color.") + color.HiBlack("Bright black means gray..") + color.HiWhite("Shiny white color!") + +However, there are times when custom color mixes are required. Below are some +examples to create custom color objects and use the print functions of each +separate color object. + + // Create a new color object + c := color.New(color.FgCyan).Add(color.Underline) + c.Println("Prints cyan text with an underline.") + + // Or just add them to New() + d := color.New(color.FgCyan, color.Bold) + d.Printf("This prints bold cyan %s\n", "too!.") + + + // Mix up foreground and background colors, create new mixes! + red := color.New(color.FgRed) + + boldRed := red.Add(color.Bold) + boldRed.Println("This will print text in bold red.") + + whiteBackground := red.Add(color.BgWhite) + whiteBackground.Println("Red text with White background.") + + // Use your own io.Writer output + color.New(color.FgBlue).Fprintln(myWriter, "blue color!") + + blue := color.New(color.FgBlue) + blue.Fprint(myWriter, "This will print text in blue.") + +You can create PrintXxx functions to simplify even more: + + // Create a custom print function for convenient + red := color.New(color.FgRed).PrintfFunc() + red("warning") + red("error: %s", err) + + // Mix up multiple attributes + notice := color.New(color.Bold, color.FgGreen).PrintlnFunc() + notice("don't forget this...") + +You can also FprintXxx functions to pass your own io.Writer: + + blue := color.New(FgBlue).FprintfFunc() + blue(myWriter, "important notice: %s", stars) + + // Mix up with multiple attributes + success := color.New(color.Bold, color.FgGreen).FprintlnFunc() + success(myWriter, don't forget this...") + +Or create SprintXxx functions to mix strings with other non-colorized strings: + + yellow := New(FgYellow).SprintFunc() + red := New(FgRed).SprintFunc() + + fmt.Printf("this is a %s and this is %s.\n", yellow("warning"), red("error")) + + info := New(FgWhite, BgGreen).SprintFunc() + fmt.Printf("this %s rocks!\n", info("package")) + +Windows support is enabled by default. All Print functions work as intended. +However, only for color.SprintXXX functions, user should use fmt.FprintXXX and +set the output to color.Output: + + fmt.Fprintf(color.Output, "Windows support: %s", color.GreenString("PASS")) + + info := New(FgWhite, BgGreen).SprintFunc() + fmt.Fprintf(color.Output, "this %s rocks!\n", info("package")) + +Using with existing code is possible. Just use the Set() method to set the +standard output to the given parameters. That way a rewrite of an existing +code is not required. + + // Use handy standard colors. + color.Set(color.FgYellow) + + fmt.Println("Existing text will be now in Yellow") + fmt.Printf("This one %s\n", "too") + + color.Unset() // don't forget to unset + + // You can mix up parameters + color.Set(color.FgMagenta, color.Bold) + defer color.Unset() // use it in your function + + fmt.Println("All text will be now bold magenta.") + +There might be a case where you want to disable color output (for example to +pipe the standard output of your app to somewhere else). `Color` has support to +disable colors both globally and for single color definition. For example +suppose you have a CLI app and a `--no-color` bool flag. You can easily disable +the color output with: + + var flagNoColor = flag.Bool("no-color", false, "Disable color output") + + if *flagNoColor { + color.NoColor = true // disables colorized output + } + +You can also disable the color by setting the NO_COLOR environment variable to any value. + +It also has support for single color definitions (local). You can +disable/enable color output on the fly: + + c := color.New(color.FgCyan) + c.Println("Prints cyan text") + + c.DisableColor() + c.Println("This is printed without any color") + + c.EnableColor() + c.Println("This prints again cyan...") +*/ +package color diff --git a/vendor/github.com/getsentry/sentry-go/.codecov.yml b/vendor/github.com/getsentry/sentry-go/.codecov.yml index df0b268..557e1aa 100644 --- a/vendor/github.com/getsentry/sentry-go/.codecov.yml +++ b/vendor/github.com/getsentry/sentry-go/.codecov.yml @@ -11,3 +11,5 @@ coverage: default: # Do not fail the commit status if the coverage was reduced up to this value threshold: 0.5% +ignore: + - "log_fallback.go" diff --git a/vendor/github.com/getsentry/sentry-go/.golangci.yml b/vendor/github.com/getsentry/sentry-go/.golangci.yml index 285e587..e487535 100644 --- a/vendor/github.com/getsentry/sentry-go/.golangci.yml +++ b/vendor/github.com/getsentry/sentry-go/.golangci.yml @@ -1,20 +1,17 @@ +version: "2" linters: - disable-all: true + default: none enable: - bodyclose - dogsled - dupl - errcheck - - exportloopref - gochecknoinits - goconst - gocritic - gocyclo - godot - - gofmt - - goimports - gosec - - gosimple - govet - ineffassign - misspell @@ -22,25 +19,44 @@ linters: - prealloc - revive - staticcheck - - typecheck - unconvert - unparam - unused - whitespace -issues: - exclude-rules: - - path: _test\.go - linters: - - goconst - - prealloc - - path: _test\.go - text: "G306:" - linters: - - gosec - - path: errors_test\.go - linters: - - unused - - path: http/example_test\.go - linters: - - errcheck - - bodyclose + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - linters: + - goconst + - prealloc + path: _test\.go + - linters: + - gosec + path: _test\.go + text: 'G306:' + - linters: + - unused + path: errors_test\.go + - linters: + - bodyclose + - errcheck + path: http/example_test\.go + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/vendor/github.com/getsentry/sentry-go/CHANGELOG.md b/vendor/github.com/getsentry/sentry-go/CHANGELOG.md index 41e9269..b9bb133 100644 --- a/vendor/github.com/getsentry/sentry-go/CHANGELOG.md +++ b/vendor/github.com/getsentry/sentry-go/CHANGELOG.md @@ -1,5 +1,138 @@ # Changelog +## 0.34.0 + +The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.34.0. + +### Breaking Changes + +- Logrus structured logging support replaces the `sentrylogrus.Hook` signature from a `*Hook` to an interface. + +```go +var hook *sentrylogrus.Hook +hook = sentrylogrus.New( + // ... your setup +) + +// should change the definition to +var hook sentrylogrus.Hook +hook = sentrylogrus.New( + // ... your setup +) +``` + +### Features + +- Structured logging support for [slog](https://pkg.go.dev/log/slog). ([#1033](https://github.com/getsentry/sentry-go/pull/1033)) + +```go +ctx := context.Background() +handler := sentryslog.Option{ + EventLevel: []slog.Level{slog.LevelError, sentryslog.LevelFatal}, // Only Error and Fatal as events + LogLevel: []slog.Level{slog.LevelWarn, slog.LevelInfo}, // Only Warn and Info as logs +}.NewSentryHandler(ctx) +logger := slog.New(handler) +logger.Info("hello")) +``` + +- Structured logging support for [logrus](https://github.com/sirupsen/logrus). ([#1036](https://github.com/getsentry/sentry-go/pull/1036)) +```go +logHook, _ := sentrylogrus.NewLogHook( + []logrus.Level{logrus.InfoLevel, logrus.WarnLevel}, + sentry.ClientOptions{ + Dsn: "your-dsn", + EnableLogs: true, // Required for log entries + }) +defer logHook.Flush(5 * time.Secod) +logrus.RegisterExitHandler(func() { + logHook.Flush(5 * time.Second) +}) + +logger := logrus.New() +logger.AddHook(logHook) +logger.Infof("hello") +``` + +- Add support for flushing events with context using `FlushWithContext()`. ([#935](https://github.com/getsentry/sentry-go/pull/935)) + +```go +ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) +defer cancel() + +if !sentry.FlushWithContext(ctx) { + // Handle timeout or cancellation +} +``` + +- Add support for custom fingerprints in slog integration. ([#1039](https://github.com/getsentry/sentry-go/pull/1039)) + +### Deprecations + +- Slog structured logging support replaces `Level` option with `EventLevel` and `LogLevel` options, for specifying fine-grained levels for capturing events and logs. + +```go +handler := sentryslog.Option{ + EventLevel: []slog.Level{slog.LevelWarn, slog.LevelError, sentryslog.LevelFatal}, + LogLevel: []slog.Level{slog.LevelDebug, slog.LevelInfo, slog.LevelWarn, slog.LevelError, sentryslog.LevelFatal}, +}.NewSentryHandler(ctx) +``` + +- Logrus structured logging support replaces `New` and `NewFromClient` functions to `NewEventHook`, `NewEventHookFromClient`, to match the newly added `NewLogHook` functions, and specify the hook type being created each time. + +```go +logHook, err := sentrylogrus.NewLogHook( + []logrus.Level{logrus.InfoLevel}, + sentry.ClientOptions{}) +eventHook, err := sentrylogrus.NewEventHook([]logrus.Level{ + logrus.ErrorLevel, + logrus.FatalLevel, + logrus.PanicLevel, +}, sentry.ClientOptions{}) +``` + +### Bug Fixes + +- Fix issue where `ContinueTrace()` would panic when `sentry-trace` header does not exist. ([#1026](https://github.com/getsentry/sentry-go/pull/1026)) +- Fix incorrect log level signature in structured logging. ([#1034](https://github.com/getsentry/sentry-go/pull/1034)) +- Remove `sentry.origin` attribute from Sentry logger to prevent confusion in spans. ([#1038](https://github.com/getsentry/sentry-go/pull/1038)) +- Don't gate user information behind `SendDefaultPII` flag for logs. ([#1032](https://github.com/getsentry/sentry-go/pull/1032)) + +### Misc + +- Add more sensitive HTTP headers to the default list of headers that are scrubbed by default. ([#1008](https://github.com/getsentry/sentry-go/pull/1008)) + +## 0.33.0 + +The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.33.0. + + +### Breaking Changes + +- Rename the internal `Logger` to `DebugLogger`. This feature was only used when you set `Debug: True` in your `sentry.Init()` call. If you haven't used the Logger directly, no changes are necessary. ([#1012](https://github.com/getsentry/sentry-go/issues/1012)) + +### Features + +- Add support for [Structured Logging](https://docs.sentry.io/product/explore/logs/). ([#1010](https://github.com/getsentry/sentry-go/issues/1010)) + + ```go + logger := sentry.NewLogger(ctx) + logger.Info(ctx, "Hello, Logs!") + ``` + + You can learn more about Sentry Logs on our [docs](https://docs.sentry.io/product/explore/logs/) and the [examples](https://github.com/getsentry/sentry-go/blob/master/_examples/logs/main.go). + +- Add new attributes APIs, which are currently only exposed on logs. ([#1007](https://github.com/getsentry/sentry-go/issues/1007)) + +### Bug Fixes + +- Do not push a new scope on `StartSpan`. ([#1013](https://github.com/getsentry/sentry-go/issues/1013)) +- Fix an issue where the propagated smapling decision wasn't used. ([#995](https://github.com/getsentry/sentry-go/issues/995)) +- [Otel] Prefer `httpRoute` over `httpTarget` for span descriptions. ([#1002](https://github.com/getsentry/sentry-go/issues/1002)) + +### Misc + +- Update `github.com/stretchr/testify` to v1.8.4. ([#988](https://github.com/getsentry/sentry-go/issues/988)) + ## 0.32.0 The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.32.0. diff --git a/vendor/github.com/getsentry/sentry-go/attribute/builder.go b/vendor/github.com/getsentry/sentry-go/attribute/builder.go new file mode 100644 index 0000000..d2bd9a2 --- /dev/null +++ b/vendor/github.com/getsentry/sentry-go/attribute/builder.go @@ -0,0 +1,36 @@ +package attribute + +type Builder struct { + Key string + Value Value +} + +// String returns a Builder for a string value. +func String(key, value string) Builder { + return Builder{key, StringValue(value)} +} + +// Int64 returns a Builder for an int64. +func Int64(key string, value int64) Builder { + return Builder{key, Int64Value(value)} +} + +// Int returns a Builder for an int64. +func Int(key string, value int) Builder { + return Builder{key, IntValue(value)} +} + +// Float64 returns a Builder for a float64. +func Float64(key string, v float64) Builder { + return Builder{key, Float64Value(v)} +} + +// Bool returns a Builder for a boolean. +func Bool(key string, v bool) Builder { + return Builder{key, BoolValue(v)} +} + +// Valid checks for valid key and type. +func (b *Builder) Valid() bool { + return len(b.Key) > 0 && b.Value.Type() != INVALID +} diff --git a/vendor/github.com/getsentry/sentry-go/attribute/rawhelpers.go b/vendor/github.com/getsentry/sentry-go/attribute/rawhelpers.go new file mode 100644 index 0000000..8ba7a88 --- /dev/null +++ b/vendor/github.com/getsentry/sentry-go/attribute/rawhelpers.go @@ -0,0 +1,49 @@ +// Copied from https://github.com/open-telemetry/opentelemetry-go/blob/cc43e01c27892252aac9a8f20da28cdde957a289/attribute/rawhelpers.go +// Copyright The OpenTelemetry Authors +// +// 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 attribute + +import ( + "math" +) + +func boolToRaw(b bool) uint64 { // b is not a control flag. + if b { + return 1 + } + return 0 +} + +func rawToBool(r uint64) bool { + return r != 0 +} + +func int64ToRaw(i int64) uint64 { + // Assumes original was a valid int64 (overflow not checked). + return uint64(i) // nolint: gosec +} + +func rawToInt64(r uint64) int64 { + // Assumes original was a valid int64 (overflow not checked). + return int64(r) // nolint: gosec +} + +func float64ToRaw(f float64) uint64 { + return math.Float64bits(f) +} + +func rawToFloat64(r uint64) float64 { + return math.Float64frombits(r) +} diff --git a/vendor/github.com/getsentry/sentry-go/attribute/value.go b/vendor/github.com/getsentry/sentry-go/attribute/value.go new file mode 100644 index 0000000..b6cc4c9 --- /dev/null +++ b/vendor/github.com/getsentry/sentry-go/attribute/value.go @@ -0,0 +1,170 @@ +// Adapted from https://github.com/open-telemetry/opentelemetry-go/blob/cc43e01c27892252aac9a8f20da28cdde957a289/attribute/value.go +// +// Copyright The OpenTelemetry Authors +// +// 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 attribute + +import ( + "encoding/json" + "fmt" + "strconv" +) + +// Type describes the type of the data Value holds. +type Type int // redefines builtin Type. + +// Value represents the value part in key-value pairs. +type Value struct { + vtype Type + numeric uint64 + stringly string +} + +const ( + // INVALID is used for a Value with no value set. + INVALID Type = iota + // BOOL is a boolean Type Value. + BOOL + // INT64 is a 64-bit signed integral Type Value. + INT64 + // FLOAT64 is a 64-bit floating point Type Value. + FLOAT64 + // STRING is a string Type Value. + STRING +) + +// BoolValue creates a BOOL Value. +func BoolValue(v bool) Value { + return Value{ + vtype: BOOL, + numeric: boolToRaw(v), + } +} + +// IntValue creates an INT64 Value. +func IntValue(v int) Value { + return Int64Value(int64(v)) +} + +// Int64Value creates an INT64 Value. +func Int64Value(v int64) Value { + return Value{ + vtype: INT64, + numeric: int64ToRaw(v), + } +} + +// Float64Value creates a FLOAT64 Value. +func Float64Value(v float64) Value { + return Value{ + vtype: FLOAT64, + numeric: float64ToRaw(v), + } +} + +// StringValue creates a STRING Value. +func StringValue(v string) Value { + return Value{ + vtype: STRING, + stringly: v, + } +} + +// Type returns a type of the Value. +func (v Value) Type() Type { + return v.vtype +} + +// AsBool returns the bool value. Make sure that the Value's type is +// BOOL. +func (v Value) AsBool() bool { + return rawToBool(v.numeric) +} + +// AsInt64 returns the int64 value. Make sure that the Value's type is +// INT64. +func (v Value) AsInt64() int64 { + return rawToInt64(v.numeric) +} + +// AsFloat64 returns the float64 value. Make sure that the Value's +// type is FLOAT64. +func (v Value) AsFloat64() float64 { + return rawToFloat64(v.numeric) +} + +// AsString returns the string value. Make sure that the Value's type +// is STRING. +func (v Value) AsString() string { + return v.stringly +} + +type unknownValueType struct{} + +// AsInterface returns Value's data as interface{}. +func (v Value) AsInterface() interface{} { + switch v.Type() { + case BOOL: + return v.AsBool() + case INT64: + return v.AsInt64() + case FLOAT64: + return v.AsFloat64() + case STRING: + return v.stringly + } + return unknownValueType{} +} + +// String returns a string representation of Value's data. +func (v Value) String() string { + switch v.Type() { + case BOOL: + return strconv.FormatBool(v.AsBool()) + case INT64: + return strconv.FormatInt(v.AsInt64(), 10) + case FLOAT64: + return fmt.Sprint(v.AsFloat64()) + case STRING: + return v.stringly + default: + return "unknown" + } +} + +// MarshalJSON returns the JSON encoding of the Value. +func (v Value) MarshalJSON() ([]byte, error) { + var jsonVal struct { + Type string + Value interface{} + } + jsonVal.Type = v.Type().String() + jsonVal.Value = v.AsInterface() + return json.Marshal(jsonVal) +} + +func (t Type) String() string { + switch t { + case BOOL: + return "bool" + case INT64: + return "int64" + case FLOAT64: + return "float64" + case STRING: + return "string" + } + return "invalid" +} diff --git a/vendor/github.com/getsentry/sentry-go/batch_logger.go b/vendor/github.com/getsentry/sentry-go/batch_logger.go new file mode 100644 index 0000000..8f25c00 --- /dev/null +++ b/vendor/github.com/getsentry/sentry-go/batch_logger.go @@ -0,0 +1,94 @@ +package sentry + +import ( + "context" + "sync" + "time" +) + +const ( + batchSize = 100 + batchTimeout = 5 * time.Second +) + +type BatchLogger struct { + client *Client + logCh chan Log + cancel context.CancelFunc + wg sync.WaitGroup + startOnce sync.Once +} + +func NewBatchLogger(client *Client) *BatchLogger { + return &BatchLogger{ + client: client, + logCh: make(chan Log, batchSize), + } +} + +func (l *BatchLogger) Start() { + l.startOnce.Do(func() { + ctx, cancel := context.WithCancel(context.Background()) + l.cancel = cancel + l.wg.Add(1) + go l.run(ctx) + }) +} + +func (l *BatchLogger) Flush() { + if l.cancel != nil { + l.cancel() + l.wg.Wait() + } +} + +func (l *BatchLogger) run(ctx context.Context) { + defer l.wg.Done() + var logs []Log + timer := time.NewTimer(batchTimeout) + + for { + select { + case log := <-l.logCh: + logs = append(logs, log) + if len(logs) >= batchSize { + l.processEvent(logs) + logs = nil + if !timer.Stop() { + <-timer.C + } + timer.Reset(batchTimeout) + } + case <-timer.C: + if len(logs) > 0 { + l.processEvent(logs) + logs = nil + } + timer.Reset(batchTimeout) + case <-ctx.Done(): + // Drain remaining logs from channel + drain: + for { + select { + case log := <-l.logCh: + logs = append(logs, log) + default: + break drain + } + } + + if len(logs) > 0 { + l.processEvent(logs) + } + return + } + } +} + +func (l *BatchLogger) processEvent(logs []Log) { + event := NewEvent() + event.Timestamp = time.Now() + event.Type = logEvent.Type + event.Logs = logs + l.client.CaptureEvent(event, nil, nil) +} diff --git a/vendor/github.com/getsentry/sentry-go/client.go b/vendor/github.com/getsentry/sentry-go/client.go index 0d08690..ea29096 100644 --- a/vendor/github.com/getsentry/sentry-go/client.go +++ b/vendor/github.com/getsentry/sentry-go/client.go @@ -77,9 +77,9 @@ type usageError struct { error } -// Logger is an instance of log.Logger that is use to provide debug information about running Sentry Client -// can be enabled by either using Logger.SetOutput directly or with Debug client option. -var Logger = log.New(io.Discard, "[Sentry] ", log.LstdFlags) +// DebugLogger is an instance of log.Logger that is used to provide debug information about running Sentry Client +// can be enabled by either using DebugLogger.SetOutput directly or with Debug client option. +var DebugLogger = log.New(io.Discard, "[Sentry] ", log.LstdFlags) // EventProcessor is a function that processes an event. // Event processors are used to change an event before it is sent to Sentry. @@ -144,8 +144,11 @@ type ClientOptions struct { // By default, no such data is sent. SendDefaultPII bool // BeforeSend is called before error events are sent to Sentry. - // Use it to mutate the event or return nil to discard the event. + // You can use it to mutate the event or return nil to discard it. BeforeSend func(event *Event, hint *EventHint) *Event + // BeforeSendLong is called before log events are sent to Sentry. + // You can use it to mutate the log event or return nil to discard it. + BeforeSendLog func(event *Log) *Log // BeforeSendTransaction is called before transaction events are sent to Sentry. // Use it to mutate the transaction or return nil to discard the transaction. BeforeSendTransaction func(event *Event, hint *EventHint) *Event @@ -223,6 +226,8 @@ type ClientOptions struct { MaxErrorDepth int // Default event tags. These are overridden by tags set on a scope. Tags map[string]string + // EnableLogs controls when logs should be emitted. + EnableLogs bool } // Client is the underlying processor that is used by the main API and Hub @@ -237,7 +242,8 @@ type Client struct { sdkVersion string // Transport is read-only. Replacing the transport of an existing client is // not supported, create a new client instead. - Transport Transport + Transport Transport + batchLogger *BatchLogger } // NewClient creates and returns an instance of Client configured using @@ -275,7 +281,7 @@ func NewClient(options ClientOptions) (*Client, error) { if debugWriter == nil { debugWriter = os.Stderr } - Logger.SetOutput(debugWriter) + DebugLogger.SetOutput(debugWriter) } if options.Dsn == "" { @@ -337,6 +343,11 @@ func NewClient(options ClientOptions) (*Client, error) { sdkVersion: SDKVersion, } + if options.EnableLogs { + client.batchLogger = NewBatchLogger(&client) + client.batchLogger.Start() + } + client.setupTransport() client.setupIntegrations() @@ -351,15 +362,7 @@ func (client *Client) setupTransport() { if opts.Dsn == "" { transport = new(noopTransport) } else { - httpTransport := NewHTTPTransport() - // When tracing is enabled, use larger buffer to - // accommodate more concurrent events. - // TODO(tracing): consider using separate buffers per - // event type. - if opts.EnableTracing { - httpTransport.BufferSize = 1000 - } - transport = httpTransport + transport = NewHTTPTransport() } } @@ -383,12 +386,12 @@ func (client *Client) setupIntegrations() { for _, integration := range integrations { if client.integrationAlreadyInstalled(integration.Name()) { - Logger.Printf("Integration %s is already installed\n", integration.Name()) + DebugLogger.Printf("Integration %s is already installed\n", integration.Name()) continue } client.integrations = append(client.integrations, integration) integration.SetupOnce(client) - Logger.Printf("Integration installed: %s\n", integration.Name()) + DebugLogger.Printf("Integration installed: %s\n", integration.Name()) } sort.Slice(client.integrations, func(i, j int) bool { @@ -507,9 +510,31 @@ func (client *Client) RecoverWithContext( // the network synchronously, configure it to use the HTTPSyncTransport in the // call to Init. func (client *Client) Flush(timeout time.Duration) bool { + if client.batchLogger != nil { + client.batchLogger.Flush() + } return client.Transport.Flush(timeout) } +// FlushWithContext waits until the underlying Transport sends any buffered events +// to the Sentry server, blocking for at most the duration specified by the context. +// It returns false if the context is canceled before the events are sent. In such a case, +// some events may not be delivered. +// +// FlushWithContext should be called before terminating the program to ensure no +// events are unintentionally dropped. +// +// Avoid calling FlushWithContext indiscriminately after each call to CaptureEvent, +// CaptureException, or CaptureMessage. To send events synchronously over the network, +// configure the SDK to use HTTPSyncTransport during initialization with Init. + +func (client *Client) FlushWithContext(ctx context.Context) bool { + if client.batchLogger != nil { + client.batchLogger.Flush() + } + return client.Transport.FlushWithContext(ctx) +} + // Close clean up underlying Transport resources. // // Close should be called after Flush and before terminating the program @@ -605,7 +630,7 @@ func (client *Client) processEvent(event *Event, hint *EventHint, scope EventMod // options.TracesSampler when they are started. Other events // (errors, messages) are sampled here. Does not apply to check-ins. if event.Type != transactionType && event.Type != checkInType && !sample(client.options.SampleRate) { - Logger.Println("Event dropped due to SampleRate hit.") + DebugLogger.Println("Event dropped due to SampleRate hit.") return nil } @@ -617,17 +642,21 @@ func (client *Client) processEvent(event *Event, hint *EventHint, scope EventMod if hint == nil { hint = &EventHint{} } - if event.Type == transactionType && client.options.BeforeSendTransaction != nil { - // Transaction events - if event = client.options.BeforeSendTransaction(event, hint); event == nil { - Logger.Println("Transaction dropped due to BeforeSendTransaction callback.") - return nil + switch event.Type { + case transactionType: + if client.options.BeforeSendTransaction != nil { + if event = client.options.BeforeSendTransaction(event, hint); event == nil { + DebugLogger.Println("Transaction dropped due to BeforeSendTransaction callback.") + return nil + } } - } else if event.Type != transactionType && event.Type != checkInType && client.options.BeforeSend != nil { - // All other events - if event = client.options.BeforeSend(event, hint); event == nil { - Logger.Println("Event dropped due to BeforeSend callback.") - return nil + case checkInType: // not a default case, since we shouldn't apply BeforeSend on check-in events + default: + if client.options.BeforeSend != nil { + if event = client.options.BeforeSend(event, hint); event == nil { + DebugLogger.Println("Event dropped due to BeforeSend callback.") + return nil + } } } @@ -692,7 +721,7 @@ func (client *Client) prepareEvent(event *Event, hint *EventHint, scope EventMod id := event.EventID event = processor(event, hint) if event == nil { - Logger.Printf("Event dropped by one of the Client EventProcessors: %s\n", id) + DebugLogger.Printf("Event dropped by one of the Client EventProcessors: %s\n", id) return nil } } @@ -701,7 +730,7 @@ func (client *Client) prepareEvent(event *Event, hint *EventHint, scope EventMod id := event.EventID event = processor(event, hint) if event == nil { - Logger.Printf("Event dropped by one of the Global EventProcessors: %s\n", id) + DebugLogger.Printf("Event dropped by one of the Global EventProcessors: %s\n", id) return nil } } diff --git a/vendor/github.com/getsentry/sentry-go/hub.go b/vendor/github.com/getsentry/sentry-go/hub.go index 12c3c95..8aea273 100644 --- a/vendor/github.com/getsentry/sentry-go/hub.go +++ b/vendor/github.com/getsentry/sentry-go/hub.go @@ -308,7 +308,7 @@ func (hub *Hub) AddBreadcrumb(breadcrumb *Breadcrumb, hint *BreadcrumbHint) { hint = &BreadcrumbHint{} } if breadcrumb = client.options.BeforeBreadcrumb(breadcrumb, hint); breadcrumb == nil { - Logger.Println("breadcrumb dropped due to BeforeBreadcrumb callback.") + DebugLogger.Println("breadcrumb dropped due to BeforeBreadcrumb callback.") return } } @@ -365,6 +365,28 @@ func (hub *Hub) Flush(timeout time.Duration) bool { return client.Flush(timeout) } +// FlushWithContext waits until the underlying Transport sends any buffered events +// to the Sentry server, blocking for at most the duration specified by the context. +// It returns false if the context is canceled before the events are sent. In such a case, +// some events may not be delivered. +// +// FlushWithContext should be called before terminating the program to ensure no +// events are unintentionally dropped. +// +// Avoid calling FlushWithContext indiscriminately after each call to CaptureEvent, +// CaptureException, or CaptureMessage. To send events synchronously over the network, +// configure the SDK to use HTTPSyncTransport during initialization with Init. + +func (hub *Hub) FlushWithContext(ctx context.Context) bool { + client := hub.Client() + + if client == nil { + return false + } + + return client.FlushWithContext(ctx) +} + // GetTraceparent returns the current Sentry traceparent string, to be used as a HTTP header value // or HTML meta tag value. // This function is context aware, as in it either returns the traceparent based diff --git a/vendor/github.com/getsentry/sentry-go/integrations.go b/vendor/github.com/getsentry/sentry-go/integrations.go index a8b2082..70acf91 100644 --- a/vendor/github.com/getsentry/sentry-go/integrations.go +++ b/vendor/github.com/getsentry/sentry-go/integrations.go @@ -32,7 +32,7 @@ func (mi *modulesIntegration) processor(event *Event, _ *EventHint) *Event { mi.once.Do(func() { info, ok := debug.ReadBuildInfo() if !ok { - Logger.Print("The Modules integration is not available in binaries built without module support.") + DebugLogger.Print("The Modules integration is not available in binaries built without module support.") return } mi.modules = extractModules(info) @@ -141,7 +141,7 @@ func (iei *ignoreErrorsIntegration) processor(event *Event, _ *EventHint) *Event for _, suspect := range suspects { for _, pattern := range iei.ignoreErrors { if pattern.Match([]byte(suspect)) || strings.Contains(suspect, pattern.String()) { - Logger.Printf("Event dropped due to being matched by `IgnoreErrors` option."+ + DebugLogger.Printf("Event dropped due to being matched by `IgnoreErrors` option."+ "| Value matched: %s | Filter used: %s", suspect, pattern) return nil } @@ -203,7 +203,7 @@ func (iei *ignoreTransactionsIntegration) processor(event *Event, _ *EventHint) for _, pattern := range iei.ignoreTransactions { if pattern.Match([]byte(suspect)) || strings.Contains(suspect, pattern.String()) { - Logger.Printf("Transaction dropped due to being matched by `IgnoreTransactions` option."+ + DebugLogger.Printf("Transaction dropped due to being matched by `IgnoreTransactions` option."+ "| Value matched: %s | Filter used: %s", suspect, pattern) return nil } diff --git a/vendor/github.com/getsentry/sentry-go/interfaces.go b/vendor/github.com/getsentry/sentry-go/interfaces.go index c6461f1..2884bbb 100644 --- a/vendor/github.com/getsentry/sentry-go/interfaces.go +++ b/vendor/github.com/getsentry/sentry-go/interfaces.go @@ -11,17 +11,22 @@ import ( "slices" "strings" "time" + + "github.com/getsentry/sentry-go/attribute" ) -// eventType is the type of an error event. const eventType = "event" - -// transactionType is the type of a transaction event. const transactionType = "transaction" - -// checkInType is the type of a check in event. const checkInType = "check_in" +var logEvent = struct { + Type string + ContentType string +}{ + "log", + "application/vnd.sentry.items.log+json", +} + // Level marks the severity of the event. type Level string @@ -34,7 +39,7 @@ const ( LevelFatal Level = "fatal" ) -// SdkInfo contains all metadata about about the SDK being used. +// SdkInfo contains all metadata about the SDK. type SdkInfo struct { Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` @@ -96,6 +101,60 @@ func (b *Breadcrumb) MarshalJSON() ([]byte, error) { return json.Marshal((*breadcrumb)(b)) } +type Logger interface { + // Write implements the io.Writer interface. Currently, the [sentry.Hub] is + // context aware, in order to get the correct trace correlation. Using this + // might result in incorrect span association on logs. If you need to use + // Write it is recommended to create a NewLogger so that the associated context + // is passed correctly. + Write(p []byte) (n int, err error) + // Trace emits a [LogLevelTrace] log to Sentry. + // Arguments are handled in the manner of [fmt.Print]. + Trace(ctx context.Context, v ...interface{}) + // Debug emits a [LogLevelDebug] log to Sentry. + // Arguments are handled in the manner of [fmt.Print]. + Debug(ctx context.Context, v ...interface{}) + // Info emits a [LogLevelInfo] log to Sentry. + // Arguments are handled in the manner of [fmt.Print]. + Info(ctx context.Context, v ...interface{}) + // Warn emits a [LogLevelWarn] log to Sentry. + // Arguments are handled in the manner of [fmt.Print]. + Warn(ctx context.Context, v ...interface{}) + // Error emits a [LogLevelError] log to Sentry. + // Arguments are handled in the manner of [fmt.Print]. + Error(ctx context.Context, v ...interface{}) + // Fatal emits a [LogLevelFatal] log to Sentry followed by a call to [os.Exit](1). + // Arguments are handled in the manner of [fmt.Print]. + Fatal(ctx context.Context, v ...interface{}) + // Panic emits a [LogLevelFatal] log to Sentry followed by a call to panic(). + // Arguments are handled in the manner of [fmt.Print]. + Panic(ctx context.Context, v ...interface{}) + + // Tracef emits a [LogLevelTrace] log to Sentry. + // Arguments are handled in the manner of [fmt.Printf]. + Tracef(ctx context.Context, format string, v ...interface{}) + // Debugf emits a [LogLevelDebug] log to Sentry. + // Arguments are handled in the manner of [fmt.Printf]. + Debugf(ctx context.Context, format string, v ...interface{}) + // Infof emits a [LogLevelInfo] log to Sentry. + // Arguments are handled in the manner of [fmt.Printf]. + Infof(ctx context.Context, format string, v ...interface{}) + // Warnf emits a [LogLevelWarn] log to Sentry. + // Arguments are handled in the manner of [fmt.Printf]. + Warnf(ctx context.Context, format string, v ...interface{}) + // Errorf emits a [LogLevelError] log to Sentry. + // Arguments are handled in the manner of [fmt.Printf]. + Errorf(ctx context.Context, format string, v ...interface{}) + // Fatalf emits a [LogLevelFatal] log to Sentry followed by a call to [os.Exit](1). + // Arguments are handled in the manner of [fmt.Printf]. + Fatalf(ctx context.Context, format string, v ...interface{}) + // Panicf emits a [LogLevelFatal] log to Sentry followed by a call to panic(). + // Arguments are handled in the manner of [fmt.Printf]. + Panicf(ctx context.Context, format string, v ...interface{}) + // SetAttributes allows attaching parameters to the log message using the attribute API. + SetAttributes(...attribute.Builder) +} + // Attachment allows associating files with your events to aid in investigation. // An event may contain one or more attachments. type Attachment struct { @@ -155,11 +214,36 @@ type Request struct { } var sensitiveHeaders = map[string]struct{}{ + "_csrf": {}, + "_csrf_token": {}, + "_session": {}, + "_xsrf": {}, + "Api-Key": {}, + "Apikey": {}, + "Auth": {}, "Authorization": {}, - "Proxy-Authorization": {}, "Cookie": {}, + "Credentials": {}, + "Csrf": {}, + "Csrf-Token": {}, + "Csrftoken": {}, + "Ip-Address": {}, + "Passwd": {}, + "Password": {}, + "Private-Key": {}, + "Privatekey": {}, + "Proxy-Authorization": {}, + "Remote-Addr": {}, + "Secret": {}, + "Session": {}, + "Sessionid": {}, + "Token": {}, + "User-Session": {}, + "X-Api-Key": {}, + "X-Csrftoken": {}, "X-Forwarded-For": {}, "X-Real-Ip": {}, + "XSRF-TOKEN": {}, } // NewRequest returns a new Sentry Request from the given http.Request. @@ -325,6 +409,9 @@ type Event struct { CheckIn *CheckIn `json:"check_in,omitempty"` MonitorConfig *MonitorConfig `json:"monitor_config,omitempty"` + // The fields below are only relevant for logs + Logs []Log `json:"items,omitempty"` + // The fields below are not part of the final JSON payload. sdkMetaData SDKMetaData @@ -547,3 +634,17 @@ type EventHint struct { Request *http.Request Response *http.Response } + +type Log struct { + Timestamp time.Time `json:"timestamp,omitempty"` + TraceID TraceID `json:"trace_id,omitempty"` + Level LogLevel `json:"level"` + Severity int `json:"severity_number,omitempty"` + Body string `json:"body,omitempty"` + Attributes map[string]Attribute `json:"attributes,omitempty"` +} + +type Attribute struct { + Value any `json:"value"` + Type string `json:"type"` +} diff --git a/vendor/github.com/getsentry/sentry-go/log.go b/vendor/github.com/getsentry/sentry-go/log.go new file mode 100644 index 0000000..08be1b4 --- /dev/null +++ b/vendor/github.com/getsentry/sentry-go/log.go @@ -0,0 +1,230 @@ +package sentry + +import ( + "context" + "fmt" + "os" + "strings" + "time" + + "github.com/getsentry/sentry-go/attribute" +) + +type LogLevel string + +const ( + LogLevelTrace LogLevel = "trace" + LogLevelDebug LogLevel = "debug" + LogLevelInfo LogLevel = "info" + LogLevelWarn LogLevel = "warn" + LogLevelError LogLevel = "error" + LogLevelFatal LogLevel = "fatal" +) + +const ( + LogSeverityTrace int = 1 + LogSeverityDebug int = 5 + LogSeverityInfo int = 9 + LogSeverityWarning int = 13 + LogSeverityError int = 17 + LogSeverityFatal int = 21 +) + +var mapTypesToStr = map[attribute.Type]string{ + attribute.INVALID: "", + attribute.BOOL: "boolean", + attribute.INT64: "integer", + attribute.FLOAT64: "double", + attribute.STRING: "string", +} + +type sentryLogger struct { + client *Client + attributes map[string]Attribute +} + +// NewLogger returns a Logger that emits logs to Sentry. If logging is turned off, all logs get discarded. +func NewLogger(ctx context.Context) Logger { + var hub *Hub + hub = GetHubFromContext(ctx) + if hub == nil { + hub = CurrentHub() + } + + client := hub.Client() + if client != nil && client.batchLogger != nil { + return &sentryLogger{client, make(map[string]Attribute)} + } + + DebugLogger.Println("fallback to noopLogger: enableLogs disabled") + return &noopLogger{} // fallback: does nothing +} + +func (l *sentryLogger) Write(p []byte) (int, error) { + // Avoid sending double newlines to Sentry + msg := strings.TrimRight(string(p), "\n") + l.log(context.Background(), LogLevelInfo, LogSeverityInfo, msg) + return len(p), nil +} + +func (l *sentryLogger) log(ctx context.Context, level LogLevel, severity int, message string, args ...interface{}) { + if message == "" { + return + } + hub := GetHubFromContext(ctx) + if hub == nil { + hub = CurrentHub() + } + + var traceID TraceID + var spanID SpanID + + span := hub.Scope().span + if span != nil { + traceID = span.TraceID + spanID = span.SpanID + } else { + traceID = hub.Scope().propagationContext.TraceID + } + + attrs := map[string]Attribute{} + if len(args) > 0 { + attrs["sentry.message.template"] = Attribute{ + Value: message, Type: "string", + } + for i, p := range args { + attrs[fmt.Sprintf("sentry.message.parameters.%d", i)] = Attribute{ + Value: fmt.Sprint(p), Type: "string", + } + } + } + + // If `log` was called with SetAttributes, pass the attributes to attrs + if len(l.attributes) > 0 { + for k, v := range l.attributes { + attrs[k] = v + } + // flush attributes from logger after send + clear(l.attributes) + } + + // Set default attributes + if release := l.client.options.Release; release != "" { + attrs["sentry.release"] = Attribute{Value: release, Type: "string"} + } + if environment := l.client.options.Environment; environment != "" { + attrs["sentry.environment"] = Attribute{Value: environment, Type: "string"} + } + if serverName := l.client.options.ServerName; serverName != "" { + attrs["sentry.server.address"] = Attribute{Value: serverName, Type: "string"} + } else if serverAddr, err := os.Hostname(); err == nil { + attrs["sentry.server.address"] = Attribute{Value: serverAddr, Type: "string"} + } + scope := hub.Scope() + if scope != nil { + user := scope.user + if !user.IsEmpty() { + if user.ID != "" { + attrs["user.id"] = Attribute{Value: user.ID, Type: "string"} + } + if user.Name != "" { + attrs["user.name"] = Attribute{Value: user.Name, Type: "string"} + } + if user.Email != "" { + attrs["user.email"] = Attribute{Value: user.Email, Type: "string"} + } + } + } + if spanID.String() != "0000000000000000" { + attrs["sentry.trace.parent_span_id"] = Attribute{Value: spanID.String(), Type: "string"} + } + if sdkIdentifier := l.client.sdkIdentifier; sdkIdentifier != "" { + attrs["sentry.sdk.name"] = Attribute{Value: sdkIdentifier, Type: "string"} + } + if sdkVersion := l.client.sdkVersion; sdkVersion != "" { + attrs["sentry.sdk.version"] = Attribute{Value: sdkVersion, Type: "string"} + } + + log := &Log{ + Timestamp: time.Now(), + TraceID: traceID, + Level: level, + Severity: severity, + Body: fmt.Sprintf(message, args...), + Attributes: attrs, + } + + if l.client.options.BeforeSendLog != nil { + log = l.client.options.BeforeSendLog(log) + } + + if log != nil { + l.client.batchLogger.logCh <- *log + } + + if l.client.options.Debug { + DebugLogger.Printf(message, args...) + } +} + +func (l *sentryLogger) SetAttributes(attrs ...attribute.Builder) { + for _, v := range attrs { + t, ok := mapTypesToStr[v.Value.Type()] + if !ok || t == "" { + DebugLogger.Printf("invalid attribute type set: %v", t) + continue + } + + l.attributes[v.Key] = Attribute{ + Value: v.Value.AsInterface(), + Type: t, + } + } +} + +func (l *sentryLogger) Trace(ctx context.Context, v ...interface{}) { + l.log(ctx, LogLevelTrace, LogSeverityTrace, fmt.Sprint(v...)) +} +func (l *sentryLogger) Debug(ctx context.Context, v ...interface{}) { + l.log(ctx, LogLevelDebug, LogSeverityDebug, fmt.Sprint(v...)) +} +func (l *sentryLogger) Info(ctx context.Context, v ...interface{}) { + l.log(ctx, LogLevelInfo, LogSeverityInfo, fmt.Sprint(v...)) +} +func (l *sentryLogger) Warn(ctx context.Context, v ...interface{}) { + l.log(ctx, LogLevelWarn, LogSeverityWarning, fmt.Sprint(v...)) +} +func (l *sentryLogger) Error(ctx context.Context, v ...interface{}) { + l.log(ctx, LogLevelError, LogSeverityError, fmt.Sprint(v...)) +} +func (l *sentryLogger) Fatal(ctx context.Context, v ...interface{}) { + l.log(ctx, LogLevelFatal, LogSeverityFatal, fmt.Sprint(v...)) + os.Exit(1) +} +func (l *sentryLogger) Panic(ctx context.Context, v ...interface{}) { + l.log(ctx, LogLevelFatal, LogSeverityFatal, fmt.Sprint(v...)) + panic(fmt.Sprint(v...)) +} +func (l *sentryLogger) Tracef(ctx context.Context, format string, v ...interface{}) { + l.log(ctx, LogLevelTrace, LogSeverityTrace, format, v...) +} +func (l *sentryLogger) Debugf(ctx context.Context, format string, v ...interface{}) { + l.log(ctx, LogLevelDebug, LogSeverityDebug, format, v...) +} +func (l *sentryLogger) Infof(ctx context.Context, format string, v ...interface{}) { + l.log(ctx, LogLevelInfo, LogSeverityInfo, format, v...) +} +func (l *sentryLogger) Warnf(ctx context.Context, format string, v ...interface{}) { + l.log(ctx, LogLevelWarn, LogSeverityWarning, format, v...) +} +func (l *sentryLogger) Errorf(ctx context.Context, format string, v ...interface{}) { + l.log(ctx, LogLevelError, LogSeverityError, format, v...) +} +func (l *sentryLogger) Fatalf(ctx context.Context, format string, v ...interface{}) { + l.log(ctx, LogLevelFatal, LogSeverityFatal, format, v...) + os.Exit(1) +} +func (l *sentryLogger) Panicf(ctx context.Context, format string, v ...interface{}) { + l.log(ctx, LogLevelFatal, LogSeverityFatal, format, v...) + panic(fmt.Sprint(v...)) +} diff --git a/vendor/github.com/getsentry/sentry-go/log_fallback.go b/vendor/github.com/getsentry/sentry-go/log_fallback.go new file mode 100644 index 0000000..b9eb706 --- /dev/null +++ b/vendor/github.com/getsentry/sentry-go/log_fallback.go @@ -0,0 +1,65 @@ +package sentry + +import ( + "context" + "fmt" + "os" + + "github.com/getsentry/sentry-go/attribute" +) + +// Fallback, no-op logger if logging is disabled. +type noopLogger struct{} + +func (*noopLogger) Trace(_ context.Context, _ ...interface{}) { + DebugLogger.Printf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelTrace) +} +func (*noopLogger) Debug(_ context.Context, _ ...interface{}) { + DebugLogger.Printf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelDebug) +} +func (*noopLogger) Info(_ context.Context, _ ...interface{}) { + DebugLogger.Printf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelInfo) +} +func (*noopLogger) Warn(_ context.Context, _ ...interface{}) { + DebugLogger.Printf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelWarn) +} +func (*noopLogger) Error(_ context.Context, _ ...interface{}) { + DebugLogger.Printf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelError) +} +func (*noopLogger) Fatal(_ context.Context, _ ...interface{}) { + DebugLogger.Printf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelFatal) + os.Exit(1) +} +func (*noopLogger) Panic(_ context.Context, _ ...interface{}) { + DebugLogger.Printf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelFatal) + panic(fmt.Sprintf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelFatal)) +} +func (*noopLogger) Tracef(_ context.Context, _ string, _ ...interface{}) { + DebugLogger.Printf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelTrace) +} +func (*noopLogger) Debugf(_ context.Context, _ string, _ ...interface{}) { + DebugLogger.Printf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelDebug) +} +func (*noopLogger) Infof(_ context.Context, _ string, _ ...interface{}) { + DebugLogger.Printf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelInfo) +} +func (*noopLogger) Warnf(_ context.Context, _ string, _ ...interface{}) { + DebugLogger.Printf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelWarn) +} +func (*noopLogger) Errorf(_ context.Context, _ string, _ ...interface{}) { + DebugLogger.Printf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelError) +} +func (*noopLogger) Fatalf(_ context.Context, _ string, _ ...interface{}) { + DebugLogger.Printf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelFatal) + os.Exit(1) +} +func (*noopLogger) Panicf(_ context.Context, _ string, _ ...interface{}) { + DebugLogger.Printf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelFatal) + panic(fmt.Sprintf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelFatal)) +} +func (*noopLogger) SetAttributes(...attribute.Builder) { + DebugLogger.Printf("No attributes attached. Turn on logging via EnableLogs") +} +func (*noopLogger) Write(_ []byte) (n int, err error) { + return 0, fmt.Errorf("Log with level=[%v] is being dropped. Turn on logging via EnableLogs", LogLevelInfo) +} diff --git a/vendor/github.com/getsentry/sentry-go/mocks.go b/vendor/github.com/getsentry/sentry-go/mocks.go index e6345ab..92bd84d 100644 --- a/vendor/github.com/getsentry/sentry-go/mocks.go +++ b/vendor/github.com/getsentry/sentry-go/mocks.go @@ -1,6 +1,7 @@ package sentry import ( + "context" "sync" "time" ) @@ -39,6 +40,7 @@ func (t *MockTransport) SendEvent(event *Event) { func (t *MockTransport) Flush(_ time.Duration) bool { return true } +func (t *MockTransport) FlushWithContext(_ context.Context) bool { return true } func (t *MockTransport) Events() []*Event { t.mu.Lock() defer t.mu.Unlock() diff --git a/vendor/github.com/getsentry/sentry-go/scope.go b/vendor/github.com/getsentry/sentry-go/scope.go index 8245fdb..3c06279 100644 --- a/vendor/github.com/getsentry/sentry-go/scope.go +++ b/vendor/github.com/getsentry/sentry-go/scope.go @@ -302,6 +302,11 @@ func (scope *Scope) SetPropagationContext(propagationContext PropagationContext) scope.propagationContext = propagationContext } +// GetSpan returns the span from the current scope. +func (scope *Scope) GetSpan() *Span { + return scope.span +} + // SetSpan sets a span for the current scope. func (scope *Scope) SetSpan(span *Span) { scope.mu.Lock() @@ -464,7 +469,7 @@ func (scope *Scope) ApplyToEvent(event *Event, hint *EventHint, client *Client) id := event.EventID event = processor(event, hint) if event == nil { - Logger.Printf("Event dropped by one of the Scope EventProcessors: %s\n", id) + DebugLogger.Printf("Event dropped by one of the Scope EventProcessors: %s\n", id) return nil } } diff --git a/vendor/github.com/getsentry/sentry-go/sentry.go b/vendor/github.com/getsentry/sentry-go/sentry.go index d59cdab..423849d 100644 --- a/vendor/github.com/getsentry/sentry-go/sentry.go +++ b/vendor/github.com/getsentry/sentry-go/sentry.go @@ -6,7 +6,7 @@ import ( ) // The version of the SDK. -const SDKVersion = "0.32.0" +const SDKVersion = "0.34.0" // apiVersion is the minimum version of the Sentry API compatible with the // sentry-go SDK. @@ -125,6 +125,23 @@ func Flush(timeout time.Duration) bool { return hub.Flush(timeout) } +// FlushWithContext waits until the underlying Transport sends any buffered events +// to the Sentry server, blocking for at most the duration specified by the context. +// It returns false if the context is canceled before the events are sent. In such a case, +// some events may not be delivered. +// +// FlushWithContext should be called before terminating the program to ensure no +// events are unintentionally dropped. +// +// Avoid calling FlushWithContext indiscriminately after each call to CaptureEvent, +// CaptureException, or CaptureMessage. To send events synchronously over the network, +// configure the SDK to use HTTPSyncTransport during initialization with Init. + +func FlushWithContext(ctx context.Context) bool { + hub := CurrentHub() + return hub.FlushWithContext(ctx) +} + // LastEventID returns an ID of last captured event. func LastEventID() EventID { hub := CurrentHub() diff --git a/vendor/github.com/getsentry/sentry-go/span_recorder.go b/vendor/github.com/getsentry/sentry-go/span_recorder.go index 9a58574..a2a7d19 100644 --- a/vendor/github.com/getsentry/sentry-go/span_recorder.go +++ b/vendor/github.com/getsentry/sentry-go/span_recorder.go @@ -24,7 +24,7 @@ func (r *spanRecorder) record(s *Span) { if len(r.spans) >= maxSpans { r.overflowOnce.Do(func() { root := r.spans[0] - Logger.Printf("Too many spans: dropping spans from transaction with TraceID=%s SpanID=%s limit=%d", + DebugLogger.Printf("Too many spans: dropping spans from transaction with TraceID=%s SpanID=%s limit=%d", root.TraceID, root.SpanID, maxSpans) }) // TODO(tracing): mark the transaction event in some way to diff --git a/vendor/github.com/getsentry/sentry-go/tracing.go b/vendor/github.com/getsentry/sentry-go/tracing.go index d0b7484..993c207 100644 --- a/vendor/github.com/getsentry/sentry-go/tracing.go +++ b/vendor/github.com/getsentry/sentry-go/tracing.go @@ -8,6 +8,7 @@ import ( "fmt" "net/http" "regexp" + "strconv" "strings" "sync" "time" @@ -72,6 +73,8 @@ type Span struct { //nolint: maligned // prefer readability over optimal memory contexts map[string]Context // a Once instance to make sure that Finish() is only called once. finishOnce sync.Once + // explicitSampled is a flag for configuring sampling by using `WithSpanSampled` option. + explicitSampled Sampled } // TraceParentContext describes the context of a (remote) parent span. @@ -195,10 +198,6 @@ func StartSpan(ctx context.Context, operation string, options ...SpanOption) *Sp clientOptions := span.clientOptions() if clientOptions.EnableTracing { hub := hubFromContext(ctx) - if !span.IsTransaction() { - // Push a new scope to stack for non transaction span - hub.PushScope() - } hub.Scope().SetSpan(&span) } @@ -302,7 +301,7 @@ func (s *Span) GetTransaction() *Span { // func (s *Span) TransactionName() string // func (s *Span) SetTransactionName(name string) -// ToSentryTrace returns the seralized TraceParentContext from a transaction/span. +// ToSentryTrace returns the serialized TraceParentContext from a transaction/span. // Use this function to propagate the TraceParentContext to a downstream SDK, // either as the value of the "sentry-trace" HTTP header, or as an html "sentry-trace" meta tag. func (s *Span) ToSentryTrace() string { @@ -356,8 +355,9 @@ func (s *Span) doFinish() { hub := hubFromContext(s.ctx) if !s.IsTransaction() { - // Referenced to StartSpan function that pushes current non-transaction span to scope stack - defer hub.PopScope() + if s.parent != nil { + hub.Scope().SetSpan(s.parent) + } } if !s.Sampled.Bool() { @@ -449,21 +449,21 @@ func (s *Span) sample() Sampled { // https://develop.sentry.dev/sdk/performance/#sampling // #1 tracing is not enabled. if !clientOptions.EnableTracing { - Logger.Printf("Dropping transaction: EnableTracing is set to %t", clientOptions.EnableTracing) + DebugLogger.Printf("Dropping transaction: EnableTracing is set to %t", clientOptions.EnableTracing) s.sampleRate = 0.0 return SampledFalse } // #2 explicit sampling decision via StartSpan/StartTransaction options. - if s.Sampled != SampledUndefined { - Logger.Printf("Using explicit sampling decision from StartSpan/StartTransaction: %v", s.Sampled) - switch s.Sampled { + if s.explicitSampled != SampledUndefined { + DebugLogger.Printf("Using explicit sampling decision from StartSpan/StartTransaction: %v", s.explicitSampled) + switch s.explicitSampled { case SampledTrue: s.sampleRate = 1.0 case SampledFalse: s.sampleRate = 0.0 } - return s.Sampled + return s.explicitSampled } // Variant for non-transaction spans: they inherit the parent decision. @@ -484,42 +484,52 @@ func (s *Span) sample() Sampled { if sampler != nil { tracesSamplerSampleRate := sampler.Sample(samplingContext) s.sampleRate = tracesSamplerSampleRate + // tracesSampler can update the sample_rate on frozen DSC + if s.dynamicSamplingContext.HasEntries() { + s.dynamicSamplingContext.Entries["sample_rate"] = strconv.FormatFloat(tracesSamplerSampleRate, 'f', -1, 64) + } if tracesSamplerSampleRate < 0.0 || tracesSamplerSampleRate > 1.0 { - Logger.Printf("Dropping transaction: Returned TracesSampler rate is out of range [0.0, 1.0]: %f", tracesSamplerSampleRate) + DebugLogger.Printf("Dropping transaction: Returned TracesSampler rate is out of range [0.0, 1.0]: %f", tracesSamplerSampleRate) return SampledFalse } - if tracesSamplerSampleRate == 0 { - Logger.Printf("Dropping transaction: Returned TracesSampler rate is: %f", tracesSamplerSampleRate) + if tracesSamplerSampleRate == 0.0 { + DebugLogger.Printf("Dropping transaction: Returned TracesSampler rate is: %f", tracesSamplerSampleRate) return SampledFalse } if rng.Float64() < tracesSamplerSampleRate { return SampledTrue } - Logger.Printf("Dropping transaction: TracesSampler returned rate: %f", tracesSamplerSampleRate) + DebugLogger.Printf("Dropping transaction: TracesSampler returned rate: %f", tracesSamplerSampleRate) + return SampledFalse } + // #4 inherit parent decision. - if s.parent != nil { - Logger.Printf("Using sampling decision from parent: %v", s.parent.Sampled) - switch s.parent.Sampled { + if s.Sampled != SampledUndefined { + DebugLogger.Printf("Using sampling decision from parent: %v", s.Sampled) + switch s.Sampled { case SampledTrue: s.sampleRate = 1.0 case SampledFalse: s.sampleRate = 0.0 } - return s.parent.Sampled + return s.Sampled } // #5 use TracesSampleRate from ClientOptions. sampleRate := clientOptions.TracesSampleRate s.sampleRate = sampleRate + // tracesSampleRate can update the sample_rate on frozen DSC + if s.dynamicSamplingContext.HasEntries() { + s.dynamicSamplingContext.Entries["sample_rate"] = strconv.FormatFloat(sampleRate, 'f', -1, 64) + } if sampleRate < 0.0 || sampleRate > 1.0 { - Logger.Printf("Dropping transaction: TracesSamplerRate out of range [0.0, 1.0]: %f", sampleRate) + DebugLogger.Printf("Dropping transaction: TracesSampleRate out of range [0.0, 1.0]: %f", sampleRate) return SampledFalse } if sampleRate == 0.0 { - Logger.Printf("Dropping transaction: TracesSampleRate rate is: %f", sampleRate) + DebugLogger.Printf("Dropping transaction: TracesSampleRate rate is: %f", sampleRate) return SampledFalse } @@ -542,7 +552,7 @@ func (s *Span) toEvent() *Event { finished := make([]*Span, 0, len(children)) for _, child := range children { if child.EndTime.IsZero() { - Logger.Printf("Dropped unfinished span: Op=%q TraceID=%s SpanID=%s", child.Op, child.TraceID, child.SpanID) + DebugLogger.Printf("Dropped unfinished span: Op=%q TraceID=%s SpanID=%s", child.Op, child.TraceID, child.SpanID) continue } finished = append(finished, child) @@ -892,7 +902,7 @@ func WithTransactionSource(source TransactionSource) SpanOption { // WithSpanSampled updates the sampling flag for a given span. func WithSpanSampled(sampled Sampled) SpanOption { return func(s *Span) { - s.Sampled = sampled + s.explicitSampled = sampled } } @@ -903,7 +913,7 @@ func WithSpanOrigin(origin SpanOrigin) SpanOption { } } -// Continue a trace based on traceparent and bagge values. +// ContinueTrace continues a trace based on traceparent and baggage values. // If the SDK is configured with tracing enabled, // this function returns populated SpanOption. // In any other cases, it populates the propagation context on the scope. @@ -932,16 +942,17 @@ func ContinueFromHeaders(trace, baggage string) SpanOption { return func(s *Span) { if trace != "" { s.updateFromSentryTrace([]byte(trace)) - } - if baggage != "" { - s.updateFromBaggage([]byte(baggage)) - } - // In case a sentry-trace header is present but there are no sentry-related - // values in the baggage, create an empty, frozen DynamicSamplingContext. - if trace != "" && !s.dynamicSamplingContext.HasEntries() { - s.dynamicSamplingContext = DynamicSamplingContext{ - Frozen: true, + if baggage != "" { + s.updateFromBaggage([]byte(baggage)) + } + + // In case a sentry-trace header is present but there are no sentry-related + // values in the baggage, create an empty, frozen DynamicSamplingContext. + if !s.dynamicSamplingContext.HasEntries() { + s.dynamicSamplingContext = DynamicSamplingContext{ + Frozen: true, + } } } } diff --git a/vendor/github.com/getsentry/sentry-go/transport.go b/vendor/github.com/getsentry/sentry-go/transport.go index 417252f..e2ec87a 100644 --- a/vendor/github.com/getsentry/sentry-go/transport.go +++ b/vendor/github.com/getsentry/sentry-go/transport.go @@ -16,8 +16,10 @@ import ( "github.com/getsentry/sentry-go/internal/ratelimit" ) -const defaultBufferSize = 30 -const defaultTimeout = time.Second * 30 +const ( + defaultBufferSize = 1000 + defaultTimeout = time.Second * 30 +) // maxDrainResponseBytes is the maximum number of bytes that transport // implementations will read from response bodies when draining them. @@ -33,6 +35,7 @@ const maxDrainResponseBytes = 16 << 10 // Transport is used by the Client to deliver events to remote server. type Transport interface { Flush(timeout time.Duration) bool + FlushWithContext(ctx context.Context) bool Configure(options ClientOptions) SendEvent(event *Event) Close() @@ -84,14 +87,14 @@ func getRequestBodyFromEvent(event *Event) []byte { } body, err = json.Marshal(event) if err == nil { - Logger.Println(msg) + DebugLogger.Println(msg) return body } // This should _only_ happen when Event.Exception[0].Stacktrace.Frames[0].Vars is unserializable // Which won't ever happen, as we don't use it now (although it's the part of public interface accepted by Sentry) // Juuust in case something, somehow goes utterly wrong. - Logger.Println("Event couldn't be marshaled, even with stripped contextual data. Skipping delivery. " + + DebugLogger.Println("Event couldn't be marshaled, even with stripped contextual data. Skipping delivery. " + "Please notify the SDK owners with possibly broken payload.") return nil } @@ -144,6 +147,23 @@ func encodeEnvelopeItem(enc *json.Encoder, itemType string, body json.RawMessage return err } +func encodeEnvelopeLogs(enc *json.Encoder, itemsLength int, body json.RawMessage) error { + err := enc.Encode( + struct { + Type string `json:"type"` + ItemCount int `json:"item_count"` + ContentType string `json:"content_type"` + }{ + Type: logEvent.Type, + ItemCount: itemsLength, + ContentType: logEvent.ContentType, + }) + if err == nil { + err = enc.Encode(body) + } + return err +} + func envelopeFromBody(event *Event, dsn *Dsn, sentAt time.Time, body json.RawMessage) (*bytes.Buffer, error) { var b bytes.Buffer enc := json.NewEncoder(&b) @@ -180,6 +200,8 @@ func envelopeFromBody(event *Event, dsn *Dsn, sentAt time.Time, body json.RawMes switch event.Type { case transactionType, checkInType: err = encodeEnvelopeItem(enc, event.Type, body) + case logEvent.Type: + err = encodeEnvelopeLogs(enc, len(event.Logs), body) default: err = encodeEnvelopeItem(enc, eventType, body) } @@ -309,7 +331,7 @@ func NewHTTPTransport() *HTTPTransport { func (t *HTTPTransport) Configure(options ClientOptions) { dsn, err := NewDsn(options.Dsn) if err != nil { - Logger.Printf("%v\n", err) + DebugLogger.Printf("%v\n", err) return } t.dsn = dsn @@ -393,7 +415,7 @@ func (t *HTTPTransport) SendEventWithContext(ctx context.Context, event *Event) } else { eventType = fmt.Sprintf("%s event", event.Level) } - Logger.Printf( + DebugLogger.Printf( "Sending %s [%s] to %s project: %s", eventType, event.EventID, @@ -401,7 +423,7 @@ func (t *HTTPTransport) SendEventWithContext(ctx context.Context, event *Event) t.dsn.projectID, ) default: - Logger.Println("Event dropped due to transport buffer being full.") + DebugLogger.Println("Event dropped due to transport buffer being full.") } t.buffer <- b @@ -418,8 +440,19 @@ func (t *HTTPTransport) SendEventWithContext(ctx context.Context, event *Event) // have the SDK send events over the network synchronously, configure it to use // the HTTPSyncTransport in the call to Init. func (t *HTTPTransport) Flush(timeout time.Duration) bool { - toolate := time.After(timeout) + timeoutCh := make(chan struct{}) + time.AfterFunc(timeout, func() { + close(timeoutCh) + }) + return t.flushInternal(timeoutCh) +} +// FlushWithContext works like Flush, but it accepts a context.Context instead of a timeout. +func (t *HTTPTransport) FlushWithContext(ctx context.Context) bool { + return t.flushInternal(ctx.Done()) +} + +func (t *HTTPTransport) flushInternal(timeout <-chan struct{}) bool { // Wait until processing the current batch has started or the timeout. // // We must wait until the worker has seen the current batch, because it is @@ -427,6 +460,7 @@ func (t *HTTPTransport) Flush(timeout time.Duration) bool { // possible execution flow in which b.done is never closed, and the only way // out of Flush would be waiting for the timeout, which is undesired. var b batch + for { select { case b = <-t.buffer: @@ -436,7 +470,7 @@ func (t *HTTPTransport) Flush(timeout time.Duration) bool { default: t.buffer <- b } - case <-toolate: + case <-timeout: goto fail } } @@ -455,14 +489,14 @@ started: // Wait until the current batch is done or the timeout. select { case <-b.done: - Logger.Println("Buffer flushed successfully.") + DebugLogger.Println("Buffer flushed successfully.") return true - case <-toolate: + case <-timeout: goto fail } fail: - Logger.Println("Buffer flushing reached the timeout.") + DebugLogger.Println("Buffer flushing was canceled or timed out.") return false } @@ -500,15 +534,15 @@ func (t *HTTPTransport) worker() { response, err := t.client.Do(item.request) if err != nil { - Logger.Printf("There was an issue with sending an event: %v", err) + DebugLogger.Printf("There was an issue with sending an event: %v", err) continue } if response.StatusCode >= 400 && response.StatusCode <= 599 { b, err := io.ReadAll(response.Body) if err != nil { - Logger.Printf("Error while reading response code: %v", err) + DebugLogger.Printf("Error while reading response code: %v", err) } - Logger.Printf("Sending %s failed with the following error: %s", eventType, string(b)) + DebugLogger.Printf("Sending %s failed with the following error: %s", eventType, string(b)) } t.mu.Lock() @@ -535,7 +569,7 @@ func (t *HTTPTransport) disabled(c ratelimit.Category) bool { defer t.mu.RUnlock() disabled := t.limits.IsRateLimited(c) if disabled { - Logger.Printf("Too many requests for %q, backing off till: %v", c, t.limits.Deadline(c)) + DebugLogger.Printf("Too many requests for %q, backing off till: %v", c, t.limits.Deadline(c)) } return disabled } @@ -581,7 +615,7 @@ func NewHTTPSyncTransport() *HTTPSyncTransport { func (t *HTTPSyncTransport) Configure(options ClientOptions) { dsn, err := NewDsn(options.Dsn) if err != nil { - Logger.Printf("%v\n", err) + DebugLogger.Printf("%v\n", err) return } t.dsn = dsn @@ -627,16 +661,18 @@ func (t *HTTPSyncTransport) SendEventWithContext(ctx context.Context, event *Eve return } - var eventType string - switch { - case event.Type == transactionType: - eventType = "transaction" + var eventIdentifier string + switch event.Type { + case transactionType: + eventIdentifier = "transaction" + case logEvent.Type: + eventIdentifier = fmt.Sprintf("%v log events", len(event.Logs)) default: - eventType = fmt.Sprintf("%s event", event.Level) + eventIdentifier = fmt.Sprintf("%s event", event.Level) } - Logger.Printf( + DebugLogger.Printf( "Sending %s [%s] to %s project: %s", - eventType, + eventIdentifier, event.EventID, t.dsn.host, t.dsn.projectID, @@ -644,15 +680,15 @@ func (t *HTTPSyncTransport) SendEventWithContext(ctx context.Context, event *Eve response, err := t.client.Do(request) if err != nil { - Logger.Printf("There was an issue with sending an event: %v", err) + DebugLogger.Printf("There was an issue with sending an event: %v", err) return } if response.StatusCode >= 400 && response.StatusCode <= 599 { b, err := io.ReadAll(response.Body) if err != nil { - Logger.Printf("Error while reading response code: %v", err) + DebugLogger.Printf("Error while reading response code: %v", err) } - Logger.Printf("Sending %s failed with the following error: %s", eventType, string(b)) + DebugLogger.Printf("Sending %s failed with the following error: %s", eventIdentifier, string(b)) } t.mu.Lock() @@ -674,12 +710,17 @@ func (t *HTTPSyncTransport) Flush(_ time.Duration) bool { return true } +// FlushWithContext is a no-op for HTTPSyncTransport. It always returns true immediately. +func (t *HTTPSyncTransport) FlushWithContext(_ context.Context) bool { + return true +} + func (t *HTTPSyncTransport) disabled(c ratelimit.Category) bool { t.mu.Lock() defer t.mu.Unlock() disabled := t.limits.IsRateLimited(c) if disabled { - Logger.Printf("Too many requests for %q, backing off till: %v", c, t.limits.Deadline(c)) + DebugLogger.Printf("Too many requests for %q, backing off till: %v", c, t.limits.Deadline(c)) } return disabled } @@ -695,15 +736,19 @@ type noopTransport struct{} var _ Transport = noopTransport{} func (noopTransport) Configure(ClientOptions) { - Logger.Println("Sentry client initialized with an empty DSN. Using noopTransport. No events will be delivered.") + DebugLogger.Println("Sentry client initialized with an empty DSN. Using noopTransport. No events will be delivered.") } func (noopTransport) SendEvent(*Event) { - Logger.Println("Event dropped due to noopTransport usage.") + DebugLogger.Println("Event dropped due to noopTransport usage.") } func (noopTransport) Flush(time.Duration) bool { return true } +func (noopTransport) FlushWithContext(context.Context) bool { + return true +} + func (noopTransport) Close() {} diff --git a/vendor/github.com/getsentry/sentry-go/util.go b/vendor/github.com/getsentry/sentry-go/util.go index 8f999ed..1dfb091 100644 --- a/vendor/github.com/getsentry/sentry-go/util.go +++ b/vendor/github.com/getsentry/sentry-go/util.go @@ -36,7 +36,7 @@ func monotonicTimeSince(start time.Time) (end time.Time) { return start.Add(time.Since(start)) } -// nolint: deadcode, unused +// nolint: unused func prettyPrint(data interface{}) { dbg, _ := json.MarshalIndent(data, "", " ") fmt.Println(string(dbg)) @@ -62,7 +62,7 @@ func defaultRelease() (release string) { } for _, e := range envs { if release = os.Getenv(e); release != "" { - Logger.Printf("Using release from environment variable %s: %s", e, release) + DebugLogger.Printf("Using release from environment variable %s: %s", e, release) return release } } @@ -89,23 +89,23 @@ func defaultRelease() (release string) { if err, ok := err.(*exec.ExitError); ok && len(err.Stderr) > 0 { fmt.Fprintf(&s, ": %s", err.Stderr) } - Logger.Print(s.String()) + DebugLogger.Print(s.String()) } else { release = strings.TrimSpace(string(b)) - Logger.Printf("Using release from Git: %s", release) + DebugLogger.Printf("Using release from Git: %s", release) return release } } - Logger.Print("Some Sentry features will not be available. See https://docs.sentry.io/product/releases/.") - Logger.Print("To stop seeing this message, pass a Release to sentry.Init or set the SENTRY_RELEASE environment variable.") + DebugLogger.Print("Some Sentry features will not be available. See https://docs.sentry.io/product/releases/.") + DebugLogger.Print("To stop seeing this message, pass a Release to sentry.Init or set the SENTRY_RELEASE environment variable.") return "" } func revisionFromBuildInfo(info *debug.BuildInfo) string { for _, setting := range info.Settings { if setting.Key == "vcs.revision" && setting.Value != "" { - Logger.Printf("Using release from debug info: %s", setting.Value) + DebugLogger.Printf("Using release from debug info: %s", setting.Value) return setting.Value } } diff --git a/vendor/github.com/jaytaylor/html2text/.gitignore b/vendor/github.com/inbucket/html2text/.gitignore similarity index 94% rename from vendor/github.com/jaytaylor/html2text/.gitignore rename to vendor/github.com/inbucket/html2text/.gitignore index daf913b..da3741f 100644 --- a/vendor/github.com/jaytaylor/html2text/.gitignore +++ b/vendor/github.com/inbucket/html2text/.gitignore @@ -22,3 +22,5 @@ _testmain.go *.exe *.test *.prof +.direnv +.envrc diff --git a/vendor/github.com/jaytaylor/html2text/LICENSE b/vendor/github.com/inbucket/html2text/LICENSE similarity index 100% rename from vendor/github.com/jaytaylor/html2text/LICENSE rename to vendor/github.com/inbucket/html2text/LICENSE diff --git a/vendor/github.com/jaytaylor/html2text/README.md b/vendor/github.com/inbucket/html2text/README.md similarity index 74% rename from vendor/github.com/jaytaylor/html2text/README.md rename to vendor/github.com/inbucket/html2text/README.md index 675e281..263c7dd 100644 --- a/vendor/github.com/jaytaylor/html2text/README.md +++ b/vendor/github.com/inbucket/html2text/README.md @@ -1,11 +1,14 @@ # html2text -[![Documentation](https://godoc.org/github.com/jaytaylor/html2text?status.svg)](https://godoc.org/github.com/jaytaylor/html2text) -[![Build Status](https://travis-ci.org/jaytaylor/html2text.svg?branch=master)](https://travis-ci.org/jaytaylor/html2text) -[![Report Card](https://goreportcard.com/badge/github.com/jaytaylor/html2text)](https://goreportcard.com/report/github.com/jaytaylor/html2text) +[![Go Reference](https://pkg.go.dev/badge/github.com/inbucket/html2text.svg)](https://pkg.go.dev/github.com/inbucket/html2text) +[![Build and Test](https://github.com/inbucket/html2text/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/inbucket/html2text/actions/workflows/build-and-test.yml) +[![Report Card](https://goreportcard.com/badge/github.com/inbucket/html2text)](https://goreportcard.com/report/github.com/inbucket/html2text) ### Converts HTML into text of the markdown-flavored variety +This is a permanent fork of the original +[jaytaylor.com/html2text](https://github.com/jaytaylor/html2text) package. + ## Introduction Ensure your emails are readable by all! @@ -21,7 +24,7 @@ It requires go 1.x or newer ;) ## Download the package ```bash -go get jaytaylor.com/html2text +go get github.com/inbucket/html2text ``` ## Example usage @@ -34,7 +37,7 @@ package main import ( "fmt" - "jaytaylor.com/html2text" + "github.com/inbucket/html2text" ) func main() { @@ -127,17 +130,3 @@ go test # License Permissive MIT license. - -## Contact - -You are more than welcome to open issues and send pull requests if you find a bug or want a new feature. - -If you appreciate this library please feel free to drop me a line and tell me! It's always nice to hear from people who have benefitted from my work. - -Email: jay at (my github username).com - -Twitter: [@jtaylor](https://twitter.com/jtaylor) - -# Alternatives - -https://github.com/k3a/html2text - Lightweight diff --git a/vendor/github.com/jhillyerd/enmime/flake.lock b/vendor/github.com/inbucket/html2text/flake.lock similarity index 77% rename from vendor/github.com/jhillyerd/enmime/flake.lock rename to vendor/github.com/inbucket/html2text/flake.lock index cec76fa..5ca5bd3 100644 --- a/vendor/github.com/jhillyerd/enmime/flake.lock +++ b/vendor/github.com/inbucket/html2text/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1702272962, - "narHash": "sha256-D+zHwkwPc6oYQ4G3A1HuadopqRwUY/JkMwHz1YF7j4Q=", + "lastModified": 1749369410, + "narHash": "sha256-P1eYm8bewiyWg3QaPCHrOp6iWg/7ESi/aGHT4yilyNo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d", + "rev": "8207ad0d501dd3590e0e81a7c56b386a5c4342c9", "type": "github" }, "original": { diff --git a/vendor/github.com/inbucket/html2text/flake.nix b/vendor/github.com/inbucket/html2text/flake.nix new file mode 100644 index 0000000..4c5c3a0 --- /dev/null +++ b/vendor/github.com/inbucket/html2text/flake.nix @@ -0,0 +1,17 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem + (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + devShell = pkgs.callPackage ./shell.nix { }; + } + ); +} diff --git a/vendor/github.com/jaytaylor/html2text/html2text.go b/vendor/github.com/inbucket/html2text/html2text.go similarity index 82% rename from vendor/github.com/jaytaylor/html2text/html2text.go rename to vendor/github.com/inbucket/html2text/html2text.go index 8fe9000..05aeeb3 100644 --- a/vendor/github.com/jaytaylor/html2text/html2text.go +++ b/vendor/github.com/inbucket/html2text/html2text.go @@ -21,48 +21,6 @@ type Options struct { TextOnly bool // Returns only plain text } -// PrettyTablesOptions overrides tablewriter behaviors -type PrettyTablesOptions struct { - AutoFormatHeader bool - AutoWrapText bool - ReflowDuringAutoWrap bool - ColWidth int - ColumnSeparator string - RowSeparator string - CenterSeparator string - HeaderAlignment int - FooterAlignment int - Alignment int - ColumnAlignment []int - NewLine string - HeaderLine bool - RowLine bool - AutoMergeCells bool - Borders tablewriter.Border -} - -// NewPrettyTablesOptions creates PrettyTablesOptions with default settings -func NewPrettyTablesOptions() *PrettyTablesOptions { - return &PrettyTablesOptions{ - AutoFormatHeader: true, - AutoWrapText: true, - ReflowDuringAutoWrap: true, - ColWidth: tablewriter.MAX_ROW_WIDTH, - ColumnSeparator: tablewriter.COLUMN, - RowSeparator: tablewriter.ROW, - CenterSeparator: tablewriter.CENTER, - HeaderAlignment: tablewriter.ALIGN_DEFAULT, - FooterAlignment: tablewriter.ALIGN_DEFAULT, - Alignment: tablewriter.ALIGN_DEFAULT, - ColumnAlignment: []int{}, - NewLine: tablewriter.NEWLINE, - HeaderLine: true, - RowLine: false, - AutoMergeCells: false, - Borders: tablewriter.Border{Left: true, Right: true, Bottom: true, Top: true}, - } -} - // FromHTMLNode renders text output from a pre-parsed HTML document. func FromHTMLNode(doc *html.Node, o ...Options) (string, error) { var options Options @@ -70,6 +28,11 @@ func FromHTMLNode(doc *html.Node, o ...Options) (string, error) { options = o[0] } + if options.PrettyTables && options.PrettyTablesOptions == nil { + // defaults need to make explicit as they are no longer identical with tablewriter + options.PrettyTablesOptions = NewPrettyTablesOptions() + } + ctx := textifyTraverseContext{ buf: bytes.Buffer{}, options: options, @@ -333,31 +296,18 @@ func (ctx *textifyTraverseContext) handleTableElement(node *html.Node) error { buf := &bytes.Buffer{} table := tablewriter.NewWriter(buf) - if ctx.options.PrettyTablesOptions != nil { - options := ctx.options.PrettyTablesOptions - table.SetAutoFormatHeaders(options.AutoFormatHeader) - table.SetAutoWrapText(options.AutoWrapText) - table.SetReflowDuringAutoWrap(options.ReflowDuringAutoWrap) - table.SetColWidth(options.ColWidth) - table.SetColumnSeparator(options.ColumnSeparator) - table.SetRowSeparator(options.RowSeparator) - table.SetCenterSeparator(options.CenterSeparator) - table.SetHeaderAlignment(options.HeaderAlignment) - table.SetFooterAlignment(options.FooterAlignment) - table.SetAlignment(options.Alignment) - table.SetColumnAlignment(options.ColumnAlignment) - table.SetNewLine(options.NewLine) - table.SetHeaderLine(options.HeaderLine) - table.SetRowLine(options.RowLine) - table.SetAutoMergeCells(options.AutoMergeCells) - table.SetBorders(options.Borders) + ctx.options.PrettyTablesOptions.configureTable(table) + + table.Header(ctx.tableCtx.header) + table.Footer(ctx.tableCtx.footer) + if err := table.Bulk(ctx.tableCtx.body); err != nil { + return err } - table.SetHeader(ctx.tableCtx.header) - table.SetFooter(ctx.tableCtx.footer) - table.AppendBulk(ctx.tableCtx.body) // Render the table using ASCII. - table.Render() + if err := table.Render(); err != nil { + return err + } if err := ctx.emit(buf.String()); err != nil { return err } diff --git a/vendor/github.com/inbucket/html2text/prettytables.go b/vendor/github.com/inbucket/html2text/prettytables.go new file mode 100644 index 0000000..273483d --- /dev/null +++ b/vendor/github.com/inbucket/html2text/prettytables.go @@ -0,0 +1,212 @@ +package html2text + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" +) + +// PrettyTablesOptions overrides tablewriter behaviors +type PrettyTablesOptions struct { + AutoFormatHeader bool + AutoWrapText bool + // Deprecated. Tablewriter always assumes this to be `true` + ReflowDuringAutoWrap bool + ColWidth int + ColumnSeparator string + RowSeparator string + CenterSeparator string + HeaderAlignment tw.Align + FooterAlignment tw.Align + Alignment tw.Align + ColumnAlignment tw.Alignment + // Deprecated. Tablewriter always assumes this to be `\n` + NewLine string + HeaderLine bool + RowLine bool + AutoMergeCells bool + Borders Border + // Configuration allows to directly manipulate the `Table` with all what [tablewriter] offers. + // Setting this ignores all the rest of the settings of this struct. + Configuration func(table *tablewriter.Table) +} + +// NewPrettyTablesOptions creates PrettyTablesOptions with default settings +func NewPrettyTablesOptions() *PrettyTablesOptions { + return &PrettyTablesOptions{ + AutoFormatHeader: true, + AutoWrapText: true, + ColWidth: 32, // old tablewriter.MAX_ROW_WIDTH + borders now count into width + ColumnSeparator: defaultBorderStyle.ColumnSeparator, + RowSeparator: defaultBorderStyle.RowSeparator, + CenterSeparator: defaultBorderStyle.CenterSeparator, + HeaderAlignment: tw.AlignCenter, + FooterAlignment: tw.AlignCenter, + Alignment: tw.AlignDefault, + ColumnAlignment: make(tw.Alignment, 0), + HeaderLine: true, + RowLine: false, + AutoMergeCells: false, + Borders: Border{Left: true, Right: true, Bottom: true, Top: true}, + } +} + +func (p *PrettyTablesOptions) configureTable(table *tablewriter.Table) { + if p.Configuration != nil { + p.Configuration(table) + return + } + + cfg := tablewriter.NewConfigBuilder() + + cfg.WithHeaderAutoFormat(asState(p.AutoFormatHeader)).WithFooterAutoFormat(asState(p.AutoFormatHeader)). + WithRowAutoWrap(p.wrapMode()).WithHeaderAutoWrap(p.wrapMode()).WithFooterAutoWrap(p.wrapMode()). + WithRowMaxWidth(p.ColWidth). + WithHeaderAlignment(p.HeaderAlignment). + WithFooterAlignment(p.FooterAlignment). + WithRowAlignment(p.Alignment). + WithRowMergeMode(p.mergeMode()) + + if len(p.ColumnAlignment) > 0 { + cfg.Row().Alignment().WithPerColumn(p.ColumnAlignment) + } + + rendition := tw.Rendition{ + Borders: p.Borders.withStates(), + Symbols: p.borderStyle(), + Settings: p.renderSettings(), + } + + table.Options( + tablewriter.WithConfig(cfg.Build()), + tablewriter.WithRendition(rendition)) +} + +func (p *PrettyTablesOptions) wrapMode() int { + if p.AutoWrapText { + return tw.WrapNormal + } else { + return tw.WrapNone + } +} + +func (p *PrettyTablesOptions) mergeMode() int { + if p.AutoMergeCells { + return tw.MergeVertical + } else { + return tw.MergeNone + } +} + +func (p *PrettyTablesOptions) renderSettings() tw.Settings { + return tw.Settings{ + Lines: tw.Lines{ + ShowHeaderLine: asState(p.HeaderLine), + }, + Separators: tw.Separators{ + BetweenRows: asState(p.RowLine), + }, + } +} + +// Border controls tablewriter borders. It uses simple bools instead of tablewriters `State` +type Border struct { + Left, Right, Bottom, Top bool +} + +func (b Border) withStates() tw.Border { + return tw.Border{ + Left: asState(b.Left), + Right: asState(b.Right), + Bottom: asState(b.Bottom), + Top: asState(b.Top), + } +} + +type BorderStyle struct { + ColumnSeparator string + RowSeparator string + CenterSeparator string +} + +func (b BorderStyle) Name() string { + return "html2text" +} + +func (b BorderStyle) Center() string { + return b.CenterSeparator +} + +func (b BorderStyle) Row() string { + return b.RowSeparator +} + +func (b BorderStyle) Column() string { + return b.ColumnSeparator +} + +func (b BorderStyle) TopLeft() string { + return b.CenterSeparator +} + +func (b BorderStyle) TopMid() string { + return b.CenterSeparator +} + +func (b BorderStyle) TopRight() string { + return b.CenterSeparator +} + +func (b BorderStyle) MidLeft() string { + return b.CenterSeparator +} + +func (b BorderStyle) MidRight() string { + return b.CenterSeparator +} + +func (b BorderStyle) BottomLeft() string { + return b.CenterSeparator +} + +func (b BorderStyle) BottomMid() string { + return b.CenterSeparator +} + +func (b BorderStyle) BottomRight() string { + return b.CenterSeparator +} + +func (b BorderStyle) HeaderLeft() string { + return b.CenterSeparator +} + +func (b BorderStyle) HeaderMid() string { + return b.CenterSeparator +} + +func (b BorderStyle) HeaderRight() string { + return b.CenterSeparator +} + +var defaultBorderStyle = BorderStyle{ + ColumnSeparator: "|", + RowSeparator: "-", + CenterSeparator: "+", +} + +func (p *PrettyTablesOptions) borderStyle() BorderStyle { + return BorderStyle{ + ColumnSeparator: p.ColumnSeparator, + RowSeparator: p.RowSeparator, + CenterSeparator: p.CenterSeparator, + } +} + +func asState(b bool) tw.State { + // TableWriter does not provide this by default :( + if b { + return tw.On + } else { + return tw.Off + } +} diff --git a/vendor/github.com/jhillyerd/enmime/shell.nix b/vendor/github.com/inbucket/html2text/shell.nix similarity index 84% rename from vendor/github.com/jhillyerd/enmime/shell.nix rename to vendor/github.com/inbucket/html2text/shell.nix index ea5c000..1153821 100644 --- a/vendor/github.com/jhillyerd/enmime/shell.nix +++ b/vendor/github.com/inbucket/html2text/shell.nix @@ -2,8 +2,8 @@ pkgs.mkShell { buildInputs = with pkgs; [ delve - go_1_20 - golint + go + golangci-lint gopls ]; diff --git a/vendor/github.com/jaytaylor/html2text/.travis.yml b/vendor/github.com/jaytaylor/html2text/.travis.yml deleted file mode 100644 index 2e8ae28..0000000 --- a/vendor/github.com/jaytaylor/html2text/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go -go: - # n.b. For golang release history, see https://golang.org/doc/devel/release.html - - tip - - "1.13.8" - - "1.12.17" - - "1.11.13" - - "1.10.8" - - "1.9.7" -notifications: - email: - on_success: change - on_failure: always diff --git a/vendor/github.com/jhillyerd/enmime/.envrc b/vendor/github.com/jhillyerd/enmime/v2/.envrc similarity index 100% rename from vendor/github.com/jhillyerd/enmime/.envrc rename to vendor/github.com/jhillyerd/enmime/v2/.envrc diff --git a/vendor/github.com/jhillyerd/enmime/.gitattributes b/vendor/github.com/jhillyerd/enmime/v2/.gitattributes similarity index 100% rename from vendor/github.com/jhillyerd/enmime/.gitattributes rename to vendor/github.com/jhillyerd/enmime/v2/.gitattributes diff --git a/vendor/github.com/jhillyerd/enmime/.gitignore b/vendor/github.com/jhillyerd/enmime/v2/.gitignore similarity index 100% rename from vendor/github.com/jhillyerd/enmime/.gitignore rename to vendor/github.com/jhillyerd/enmime/v2/.gitignore diff --git a/vendor/github.com/jhillyerd/enmime/.golangci.yml b/vendor/github.com/jhillyerd/enmime/v2/.golangci.yml similarity index 64% rename from vendor/github.com/jhillyerd/enmime/.golangci.yml rename to vendor/github.com/jhillyerd/enmime/v2/.golangci.yml index dc337d7..35623e7 100644 --- a/vendor/github.com/jhillyerd/enmime/.golangci.yml +++ b/vendor/github.com/jhillyerd/enmime/v2/.golangci.yml @@ -1,5 +1,4 @@ -run: - timeout: 5m +version: "2" linters: enable: - asasalint @@ -8,32 +7,19 @@ linters: - bodyclose - containedctx - contextcheck + - copyloopvar - decorder - # - dupl - # - dupword - durationcheck - errchkjson - errname - # - errorlint - - execinquery - # - exhaustive - - exportloopref - # - forcetypeassert - ginkgolinter - gocheckcompilerdirectives - # - gochecknoinits - gochecksumtype - gocritic - # - godot - # - goerr113 - - gofmt - # - gofumpt - goheader - - goimports - gomoddirectives - gomodguard - goprintffuncname - # - gosec - gosmopolitan - grouper - importas @@ -45,8 +31,6 @@ linters: - misspell - musttag - nilerr - # - nilnil - # - nlreturn - noctx - nolintlint - nosprintfhostport @@ -56,20 +40,44 @@ linters: - promlinter - protogetter - reassign - # - revive + - revive - rowserrcheck - sloglint - - stylecheck + - staticcheck - tagalign - tagliatelle - - tenv - testableexamples - testifylint - thelper - tparallel - # - unconvert - unparam - usestdlibvars - wastedassign - whitespace - zerologlint + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ + rules: + # Exclude specific linters from test files. + - path: _test\.go + linters: + - gosmopolitan +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/vendor/github.com/jhillyerd/enmime/CONTRIBUTING.md b/vendor/github.com/jhillyerd/enmime/v2/CONTRIBUTING.md similarity index 100% rename from vendor/github.com/jhillyerd/enmime/CONTRIBUTING.md rename to vendor/github.com/jhillyerd/enmime/v2/CONTRIBUTING.md diff --git a/vendor/github.com/jhillyerd/enmime/LICENSE b/vendor/github.com/jhillyerd/enmime/v2/LICENSE similarity index 100% rename from vendor/github.com/jhillyerd/enmime/LICENSE rename to vendor/github.com/jhillyerd/enmime/v2/LICENSE diff --git a/vendor/github.com/jhillyerd/enmime/Makefile b/vendor/github.com/jhillyerd/enmime/v2/Makefile similarity index 81% rename from vendor/github.com/jhillyerd/enmime/Makefile rename to vendor/github.com/jhillyerd/enmime/v2/Makefile index a0c8315..22cef3b 100644 --- a/vendor/github.com/jhillyerd/enmime/Makefile +++ b/vendor/github.com/jhillyerd/enmime/v2/Makefile @@ -27,8 +27,6 @@ simplify: lint: @test -z "$(shell gofmt -l . | tee /dev/stderr)" || echo "[WARN] Fix formatting issues with 'make fmt'" - @# TODO: lint disabled until `mediatype.MediaTypeParseOptions` renamed to remove repetition. - @#@golint -set_exit_status $(PKGS) @go vet $(PKGS) reflex: diff --git a/vendor/github.com/jhillyerd/enmime/README.md b/vendor/github.com/jhillyerd/enmime/v2/README.md similarity index 100% rename from vendor/github.com/jhillyerd/enmime/README.md rename to vendor/github.com/jhillyerd/enmime/v2/README.md diff --git a/vendor/github.com/jhillyerd/enmime/boundary.go b/vendor/github.com/jhillyerd/enmime/v2/boundary.go similarity index 99% rename from vendor/github.com/jhillyerd/enmime/boundary.go rename to vendor/github.com/jhillyerd/enmime/v2/boundary.go index be4a43f..b188b77 100644 --- a/vendor/github.com/jhillyerd/enmime/boundary.go +++ b/vendor/github.com/jhillyerd/enmime/v2/boundary.go @@ -180,7 +180,7 @@ func (b *boundaryReader) Next() (bool, error) { _, _ = io.Copy(io.Discard, b) } for { - var line []byte = nil + var line []byte var err error for { // Read whole line, handle extra long lines in cycle diff --git a/vendor/github.com/jhillyerd/enmime/builder.go b/vendor/github.com/jhillyerd/enmime/v2/builder.go similarity index 99% rename from vendor/github.com/jhillyerd/enmime/builder.go rename to vendor/github.com/jhillyerd/enmime/v2/builder.go index cfde3ff..5f68377 100644 --- a/vendor/github.com/jhillyerd/enmime/builder.go +++ b/vendor/github.com/jhillyerd/enmime/v2/builder.go @@ -13,7 +13,7 @@ import ( "reflect" "time" - "github.com/jhillyerd/enmime/internal/stringutil" + "github.com/jhillyerd/enmime/v2/internal/stringutil" ) // MailBuilder facilitates the easy construction of a MIME message. Each manipulation method diff --git a/vendor/github.com/jhillyerd/enmime/detect.go b/vendor/github.com/jhillyerd/enmime/v2/detect.go similarity index 98% rename from vendor/github.com/jhillyerd/enmime/detect.go rename to vendor/github.com/jhillyerd/enmime/v2/detect.go index 1dda921..e7aacfa 100644 --- a/vendor/github.com/jhillyerd/enmime/detect.go +++ b/vendor/github.com/jhillyerd/enmime/v2/detect.go @@ -3,7 +3,7 @@ package enmime import ( "strings" - inttp "github.com/jhillyerd/enmime/internal/textproto" + inttp "github.com/jhillyerd/enmime/v2/internal/textproto" ) // detectMultipartMessage returns true if the message has a recognized multipart Content-Type header diff --git a/vendor/github.com/jhillyerd/enmime/encode.go b/vendor/github.com/jhillyerd/enmime/v2/encode.go similarity index 87% rename from vendor/github.com/jhillyerd/enmime/encode.go rename to vendor/github.com/jhillyerd/enmime/v2/encode.go index 132ab1b..bef657b 100644 --- a/vendor/github.com/jhillyerd/enmime/encode.go +++ b/vendor/github.com/jhillyerd/enmime/v2/encode.go @@ -8,10 +8,11 @@ import ( "mime/quotedprintable" "net/textproto" "sort" + "strings" "time" - "github.com/jhillyerd/enmime/internal/coding" - "github.com/jhillyerd/enmime/internal/stringutil" + "github.com/jhillyerd/enmime/v2/internal/coding" + "github.com/jhillyerd/enmime/v2/internal/stringutil" ) // b64Percent determines the percent of non-ASCII characters enmime will tolerate before switching @@ -22,6 +23,7 @@ type transferEncoding byte const ( te7Bit transferEncoding = iota + te8Bit teQuoted teBase64 teRaw @@ -106,21 +108,33 @@ func (p *Part) setupMIMEHeaders() transferEncoding { cte := te7Bit if len(p.Content) > 0 { - cte = teBase64 - if p.TextContent() && p.ContentReader == nil { - cte = selectTransferEncoding(p.Content, false) - if p.Charset == "" { - p.Charset = utf8 + if strings.Index(strings.ToLower(p.ContentType), "message/") == 0 { + // RFC 1341: `message` types must have no encoding other than "7bit", "8bit", or + // "binary". The message header fields are always US-ASCII in any case, and data within + // the body can still be encoded, in which case the Content-Transfer-Encoding header + // field in the encapsulated message will reflect this. + cte = te8Bit + } else { + cte = teBase64 + if p.TextContent() && p.ContentReader == nil { + cte = p.selectTransferEncoding(p.Content, false) + if p.Charset == "" { + p.Charset = utf8 + } } } + // RFC 2045: 7bit is assumed if CTE header not present. switch cte { + case te8Bit: + p.Header.Set(hnContentEncoding, cte8Bit) case teBase64: p.Header.Set(hnContentEncoding, cteBase64) case teQuoted: p.Header.Set(hnContentEncoding, cteQuotedPrintable) } } + // Setup headers. if p.FirstChild != nil && p.Boundary == "" { // Multipart, generate random boundary marker. @@ -130,12 +144,13 @@ func (p *Part) setupMIMEHeaders() transferEncoding { p.Header.Set(hnContentID, coding.ToIDHeader(p.ContentID)) } fileName := p.FileName - switch selectTransferEncoding([]byte(p.FileName), true) { + switch p.selectTransferEncoding([]byte(p.FileName), true) { case teBase64: fileName = mime.BEncoding.Encode(utf8, p.FileName) case teQuoted: fileName = mime.QEncoding.Encode(utf8, p.FileName) } + if p.ContentType != "" { // Build content type header. param := make(map[string]string) @@ -150,6 +165,7 @@ func (p *Part) setupMIMEHeaders() transferEncoding { } p.Header.Set(hnContentType, p.ContentType) } + if p.Disposition != "" { // Build disposition header. param := make(map[string]string) @@ -162,6 +178,7 @@ func (p *Part) setupMIMEHeaders() transferEncoding { } p.Header.Set(hnContentDisposition, p.Disposition) } + return cte } @@ -178,7 +195,7 @@ func (p *Part) encodeHeader(b *bufio.Writer) error { for _, v := range p.Header[k] { encv := v if !rawContent { - switch selectTransferEncoding([]byte(v), true) { + switch p.selectTransferEncoding([]byte(v), true) { case teBase64: encv = mime.BEncoding.Encode(utf8, v) case teQuoted: @@ -286,10 +303,15 @@ func (p *Part) encodeContentFromReader(b *bufio.Writer) error { } // selectTransferEncoding scans content for non-ASCII characters and selects 'b' or 'q' encoding. -func selectTransferEncoding(content []byte, quoteLineBreaks bool) transferEncoding { +func (p *Part) selectTransferEncoding(content []byte, quoteLineBreaks bool) transferEncoding { if len(content) == 0 { return te7Bit } + + if p.encoder != nil && p.encoder.forceQuotedPrintableCteOption { + return teQuoted + } + // Binary chars remaining before we choose b64 encoding. threshold := b64Percent * len(content) / 100 bincount := 0 diff --git a/vendor/github.com/jhillyerd/enmime/v2/encoder_options.go b/vendor/github.com/jhillyerd/enmime/v2/encoder_options.go new file mode 100644 index 0000000..e777903 --- /dev/null +++ b/vendor/github.com/jhillyerd/enmime/v2/encoder_options.go @@ -0,0 +1,33 @@ +package enmime + +type EncoderOption interface { + apply(p *Encoder) +} + +// Encoder implements MIME part encoding options +type Encoder struct { + forceQuotedPrintableCteOption bool +} + +// ForceQuotedPrintableCte forces "quoted-printable" transfer encoding when selecting Content Transfer Encoding, preventing the use of base64. +func ForceQuotedPrintableCte(b bool) EncoderOption { + return forceQuotedPrintableCteOption(b) +} + +type forceQuotedPrintableCteOption bool + +func (o forceQuotedPrintableCteOption) apply(p *Encoder) { + p.forceQuotedPrintableCteOption = bool(o) +} + +func NewEncoder(ops ...EncoderOption) *Encoder { + e := Encoder{ + forceQuotedPrintableCteOption: false, + } + + for _, o := range ops { + o.apply(&e) + } + + return &e +} diff --git a/vendor/github.com/jhillyerd/enmime/enmime.go b/vendor/github.com/jhillyerd/enmime/v2/enmime.go similarity index 94% rename from vendor/github.com/jhillyerd/enmime/enmime.go rename to vendor/github.com/jhillyerd/enmime/v2/enmime.go index 42b9330..c71fc82 100644 --- a/vendor/github.com/jhillyerd/enmime/enmime.go +++ b/vendor/github.com/jhillyerd/enmime/v2/enmime.go @@ -51,7 +51,7 @@ // multi-gigabyte attachments. // // enmime is open source software released under the MIT License. The latest version can be found -// at https://github.com/jhillyerd/enmime +// at https://github.com/jhillyerd/enmime/v2 // -// [1]: https://github.com/jaytaylor/html2text -package enmime // import "github.com/jhillyerd/enmime" +// [1]: https://github.com/inbucket/html2text +package enmime // import "github.com/jhillyerd/enmime/v2" diff --git a/vendor/github.com/jhillyerd/enmime/envelope.go b/vendor/github.com/jhillyerd/enmime/v2/envelope.go similarity index 96% rename from vendor/github.com/jhillyerd/enmime/envelope.go rename to vendor/github.com/jhillyerd/enmime/v2/envelope.go index bfade4f..9bf720f 100644 --- a/vendor/github.com/jhillyerd/enmime/envelope.go +++ b/vendor/github.com/jhillyerd/enmime/v2/envelope.go @@ -9,9 +9,9 @@ import ( "strings" "time" - "github.com/jaytaylor/html2text" - "github.com/jhillyerd/enmime/internal/coding" - inttp "github.com/jhillyerd/enmime/internal/textproto" + "github.com/inbucket/html2text" + "github.com/jhillyerd/enmime/v2/internal/coding" + inttp "github.com/jhillyerd/enmime/v2/internal/textproto" "github.com/pkg/errors" ) @@ -198,16 +198,14 @@ func (p Parser) EnvelopeFromPart(root *Part) (*Envelope, error) { // Down-convert HTML to text if necessary if e.Text == "" && e.HTML != "" { // We always warn when this happens - e.Root.addWarning( - ErrorPlainTextFromHTML, - "Message did not contain a text/plain part") + e.Root.addWarning(ErrorPlainTextFromHTML, "Message did not contain a text/plain part") if !p.disableTextConversion { var err error if e.Text, err = html2text.FromString(e.HTML); err != nil { e.Text = "" // Down-conversion shouldn't fail p := e.Root.BreadthMatchFirst(matchHTMLBodyPart) - p.addError(ErrorPlainTextFromHTML, "Failed to downconvert HTML: %v", err) + p.addErrorf(ErrorPlainTextFromHTML, "Failed to downconvert HTML: %v", err) } } } diff --git a/vendor/github.com/jhillyerd/enmime/error.go b/vendor/github.com/jhillyerd/enmime/v2/error.go similarity index 73% rename from vendor/github.com/jhillyerd/enmime/error.go rename to vendor/github.com/jhillyerd/enmime/v2/error.go index 9f819b3..0f16ae6 100644 --- a/vendor/github.com/jhillyerd/enmime/error.go +++ b/vendor/github.com/jhillyerd/enmime/v2/error.go @@ -27,12 +27,6 @@ const ( ErrorMalformedChildPart = "Malformed child part" ) -// MaxPartErrors limits number of part parsing errors, errors after the limit are ignored. -// 0 means unlimited. -// -// Deprecated: This limit may be set via the `MaxStoredPartErrors` Parser option. -var MaxPartErrors = 0 - // Error describes an error encountered while parsing. type Error struct { Name string // The name or type of error encountered, from Error consts. @@ -49,13 +43,13 @@ func (e *Error) Error() string { return fmt.Sprintf("[%s] %s: %s", sev, e.Name, e.Detail) } -// String formats the enmime.Error as a string. DEPRECATED; use Error() instead. -func (e *Error) String() string { - return e.Error() +// addError builds a severe Error and appends to the Part error slice. +func (p *Part) addError(name string, detail string) { + p.addProblem(&Error{name, detail, true}) } -// addWarning builds a severe Error and appends to the Part error slice. -func (p *Part) addError(name string, detailFmt string, args ...interface{}) { +// addErrorf builds a severe Error and appends to the Part error slice. +func (p *Part) addErrorf(name string, detailFmt string, args ...interface{}) { p.addProblem(&Error{ name, fmt.Sprintf(detailFmt, args...), @@ -64,7 +58,12 @@ func (p *Part) addError(name string, detailFmt string, args ...interface{}) { } // addWarning builds a non-severe Error and appends to the Part error slice. -func (p *Part) addWarning(name string, detailFmt string, args ...interface{}) { +func (p *Part) addWarning(name string, detail string) { + p.addProblem(&Error{name, detail, false}) +} + +// addWarningf builds a non-severe Error and appends to the Part error slice. +func (p *Part) addWarningf(name string, detailFmt string, args ...interface{}) { p.addProblem(&Error{ name, fmt.Sprintf(detailFmt, args...), @@ -74,10 +73,10 @@ func (p *Part) addWarning(name string, detailFmt string, args ...interface{}) { // addProblem adds general *Error to the Part error slice. func (p *Part) addProblem(err *Error) { - maxErrors := MaxPartErrors - if p.parser != nil && p.parser.maxStoredPartErrors != nil { + maxErrors := 0 + if p.parser != nil { // Override global var. - maxErrors = *p.parser.maxStoredPartErrors + maxErrors = p.parser.maxStoredPartErrors } if (maxErrors == 0) || (len(p.Errors) < maxErrors) { @@ -97,9 +96,9 @@ type partErrorCollector struct { } func (p *partErrorCollector) AddError(name string, detailFmt string, args ...any) { - p.part.addError(name, detailFmt, args...) + p.part.addErrorf(name, detailFmt, args...) } func (p *partErrorCollector) AddWarning(name string, detailFmt string, args ...any) { - p.part.addWarning(name, detailFmt, args...) + p.part.addWarningf(name, detailFmt, args...) } diff --git a/vendor/github.com/jhillyerd/enmime/v2/flake.lock b/vendor/github.com/jhillyerd/enmime/v2/flake.lock new file mode 100644 index 0000000..17cec36 --- /dev/null +++ b/vendor/github.com/jhillyerd/enmime/v2/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1736657626, + "narHash": "sha256-FWlPMUzp0lkQBdhKlPqtQdqmp+/C+1MBiEytaYfrCTY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2f9e2f85cb14a46410a1399aa9ea7ecf433e422e", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/vendor/github.com/jhillyerd/enmime/flake.nix b/vendor/github.com/jhillyerd/enmime/v2/flake.nix similarity index 100% rename from vendor/github.com/jhillyerd/enmime/flake.nix rename to vendor/github.com/jhillyerd/enmime/v2/flake.nix diff --git a/vendor/github.com/jhillyerd/enmime/header.go b/vendor/github.com/jhillyerd/enmime/v2/header.go similarity index 88% rename from vendor/github.com/jhillyerd/enmime/header.go rename to vendor/github.com/jhillyerd/enmime/v2/header.go index 21744c5..01c5c62 100644 --- a/vendor/github.com/jhillyerd/enmime/header.go +++ b/vendor/github.com/jhillyerd/enmime/v2/header.go @@ -9,10 +9,9 @@ import ( "net/textproto" "strings" - "github.com/jhillyerd/enmime/internal/coding" - "github.com/jhillyerd/enmime/internal/stringutil" - inttp "github.com/jhillyerd/enmime/internal/textproto" - "github.com/jhillyerd/enmime/mediatype" + "github.com/jhillyerd/enmime/v2/internal/coding" + "github.com/jhillyerd/enmime/v2/internal/stringutil" + inttp "github.com/jhillyerd/enmime/v2/internal/textproto" "github.com/pkg/errors" ) @@ -101,26 +100,6 @@ func ParseAddressList(list string) ([]*mail.Address, error) { return ret, nil } -// Terminology from RFC 2047: -// encoded-word: the entire =?charset?encoding?encoded-text?= string -// charset: the character set portion of the encoded word -// encoding: the character encoding type used for the encoded-text -// encoded-text: the text we are decoding - -// ParseMediaType is a more tolerant implementation of Go's mime.ParseMediaType function. -// -// Tolerances accounted for: -// - Missing ';' between content-type and media parameters -// - Repeating media parameters -// - Unquoted values in media parameters containing 'tspecials' characters -// -// Deprecated: Use mediaType.Parse instead -func ParseMediaType(ctype string) (mtype string, params map[string]string, invalidParams []string, - err error) { - // Export of internal function. - return mediatype.Parse(ctype) -} - // ReadHeader reads a block of SMTP or MIME headers and returns a // textproto.MIMEHeader. Header parse warnings & errors will be added to // ErrorCollector, io errors will be returned directly. diff --git a/vendor/github.com/jhillyerd/enmime/inspect.go b/vendor/github.com/jhillyerd/enmime/v2/inspect.go similarity index 95% rename from vendor/github.com/jhillyerd/enmime/inspect.go rename to vendor/github.com/jhillyerd/enmime/v2/inspect.go index 268d570..8954211 100644 --- a/vendor/github.com/jhillyerd/enmime/inspect.go +++ b/vendor/github.com/jhillyerd/enmime/v2/inspect.go @@ -5,8 +5,8 @@ import ( "bytes" "io" - "github.com/jhillyerd/enmime/internal/coding" - "github.com/jhillyerd/enmime/internal/textproto" + "github.com/jhillyerd/enmime/v2/internal/coding" + "github.com/jhillyerd/enmime/v2/internal/textproto" "github.com/pkg/errors" ) diff --git a/vendor/github.com/jhillyerd/enmime/internal/coding/base64.go b/vendor/github.com/jhillyerd/enmime/v2/internal/coding/base64.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/internal/coding/base64.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/coding/base64.go diff --git a/vendor/github.com/jhillyerd/enmime/internal/coding/charsets.go b/vendor/github.com/jhillyerd/enmime/v2/internal/coding/charsets.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/internal/coding/charsets.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/coding/charsets.go diff --git a/vendor/github.com/jhillyerd/enmime/internal/coding/headerext.go b/vendor/github.com/jhillyerd/enmime/v2/internal/coding/headerext.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/internal/coding/headerext.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/coding/headerext.go diff --git a/vendor/github.com/jhillyerd/enmime/internal/coding/idheader.go b/vendor/github.com/jhillyerd/enmime/v2/internal/coding/idheader.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/internal/coding/idheader.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/coding/idheader.go diff --git a/vendor/github.com/jhillyerd/enmime/internal/coding/quotedprint.go b/vendor/github.com/jhillyerd/enmime/v2/internal/coding/quotedprint.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/internal/coding/quotedprint.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/coding/quotedprint.go diff --git a/vendor/github.com/jhillyerd/enmime/internal/stringutil/addr.go b/vendor/github.com/jhillyerd/enmime/v2/internal/stringutil/addr.go similarity index 88% rename from vendor/github.com/jhillyerd/enmime/internal/stringutil/addr.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/stringutil/addr.go index c3eaa42..4a02a83 100644 --- a/vendor/github.com/jhillyerd/enmime/internal/stringutil/addr.go +++ b/vendor/github.com/jhillyerd/enmime/v2/internal/stringutil/addr.go @@ -34,6 +34,7 @@ func EnsureCommaDelimitedAddresses(s string) string { inQuotes := false inDomain := false escapeSequence := false + inAngles := false sb := strings.Builder{} for i, r := range s { if escapeSequence { @@ -46,6 +47,19 @@ func EnsureCommaDelimitedAddresses(s string) string { sb.WriteRune(r) continue } + + if r == '<' { + inAngles = true + sb.WriteRune(r) + continue + } + + if r == '>' { + inAngles = false + sb.WriteRune(r) + continue + } + if inQuotes { if r == '\\' { escapeSequence = true @@ -74,13 +88,17 @@ func EnsureCommaDelimitedAddresses(s string) string { sb.WriteRune(r) continue } - if r == ' ' { + if r == ' ' && !inAngles { inDomain = false sb.WriteRune(',') sb.WriteRune(r) continue } } + + if inAngles && r == ' ' { + continue + } } sb.WriteRune(r) } diff --git a/vendor/github.com/jhillyerd/enmime/internal/stringutil/find.go b/vendor/github.com/jhillyerd/enmime/v2/internal/stringutil/find.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/internal/stringutil/find.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/stringutil/find.go diff --git a/vendor/github.com/jhillyerd/enmime/internal/stringutil/rand_source.go b/vendor/github.com/jhillyerd/enmime/v2/internal/stringutil/rand_source.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/internal/stringutil/rand_source.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/stringutil/rand_source.go diff --git a/vendor/github.com/jhillyerd/enmime/internal/stringutil/split.go b/vendor/github.com/jhillyerd/enmime/v2/internal/stringutil/split.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/internal/stringutil/split.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/stringutil/split.go diff --git a/vendor/github.com/jhillyerd/enmime/internal/stringutil/uuid.go b/vendor/github.com/jhillyerd/enmime/v2/internal/stringutil/uuid.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/internal/stringutil/uuid.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/stringutil/uuid.go diff --git a/vendor/github.com/jhillyerd/enmime/internal/stringutil/wrap.go b/vendor/github.com/jhillyerd/enmime/v2/internal/stringutil/wrap.go similarity index 86% rename from vendor/github.com/jhillyerd/enmime/internal/stringutil/wrap.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/stringutil/wrap.go index eb071ae..becf9bc 100644 --- a/vendor/github.com/jhillyerd/enmime/internal/stringutil/wrap.go +++ b/vendor/github.com/jhillyerd/enmime/v2/internal/stringutil/wrap.go @@ -1,13 +1,13 @@ package stringutil -// Wrap builds a byte slice from strs, wrapping on word boundaries before max chars -func Wrap(max int, strs ...string) []byte { +// Wrap builds a byte slice from strs, wrapping on word boundaries before maxLen chars +func Wrap(maxLen int, strs ...string) []byte { input := make([]byte, 0) output := make([]byte, 0) for _, s := range strs { input = append(input, []byte(s)...) } - if len(input) < max { + if len(input) < maxLen { // Doesn't need to be wrapped return input } @@ -20,7 +20,7 @@ func Wrap(max int, strs ...string) []byte { case ' ', '\t': ls = i } - if ll >= max { + if ll >= maxLen { if ls >= 0 { output = append(output, input[lw+1:ls]...) output = append(output, '\r', '\n', ' ') diff --git a/vendor/github.com/jhillyerd/enmime/internal/textproto/header.go b/vendor/github.com/jhillyerd/enmime/v2/internal/textproto/header.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/internal/textproto/header.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/textproto/header.go diff --git a/vendor/github.com/jhillyerd/enmime/internal/textproto/pipeline.go b/vendor/github.com/jhillyerd/enmime/v2/internal/textproto/pipeline.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/internal/textproto/pipeline.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/textproto/pipeline.go diff --git a/vendor/github.com/jhillyerd/enmime/internal/textproto/reader.go b/vendor/github.com/jhillyerd/enmime/v2/internal/textproto/reader.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/internal/textproto/reader.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/textproto/reader.go diff --git a/vendor/github.com/jhillyerd/enmime/internal/textproto/reader_email.go b/vendor/github.com/jhillyerd/enmime/v2/internal/textproto/reader_email.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/internal/textproto/reader_email.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/textproto/reader_email.go diff --git a/vendor/github.com/jhillyerd/enmime/internal/textproto/textproto.go b/vendor/github.com/jhillyerd/enmime/v2/internal/textproto/textproto.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/internal/textproto/textproto.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/textproto/textproto.go diff --git a/vendor/github.com/jhillyerd/enmime/internal/textproto/writer.go b/vendor/github.com/jhillyerd/enmime/v2/internal/textproto/writer.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/internal/textproto/writer.go rename to vendor/github.com/jhillyerd/enmime/v2/internal/textproto/writer.go diff --git a/vendor/github.com/jhillyerd/enmime/match.go b/vendor/github.com/jhillyerd/enmime/v2/match.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/match.go rename to vendor/github.com/jhillyerd/enmime/v2/match.go diff --git a/vendor/github.com/jhillyerd/enmime/mediatype/mediatype.go b/vendor/github.com/jhillyerd/enmime/v2/mediatype/mediatype.go similarity index 96% rename from vendor/github.com/jhillyerd/enmime/mediatype/mediatype.go rename to vendor/github.com/jhillyerd/enmime/v2/mediatype/mediatype.go index 3796275..c2b49b4 100644 --- a/vendor/github.com/jhillyerd/enmime/mediatype/mediatype.go +++ b/vendor/github.com/jhillyerd/enmime/v2/mediatype/mediatype.go @@ -6,8 +6,8 @@ import ( "strings" _utf8 "unicode/utf8" - "github.com/jhillyerd/enmime/internal/coding" - "github.com/jhillyerd/enmime/internal/stringutil" + "github.com/jhillyerd/enmime/v2/internal/coding" + "github.com/jhillyerd/enmime/v2/internal/stringutil" "github.com/pkg/errors" ) @@ -30,8 +30,8 @@ const ( utf8 = "utf-8" ) -// MediaTypeParseOptions controls the parsing of content-type and media-type strings. -type MediaTypeParseOptions struct { +// ParseOptions controls the parsing of content-type and media-type strings. +type ParseOptions struct { StripMediaTypeInvalidCharacters bool } @@ -43,11 +43,11 @@ type MediaTypeParseOptions struct { // - Unquoted values in media parameters containing 'tspecials' characters // - Newline characters func Parse(ctype string) (mtype string, params map[string]string, invalidParams []string, err error) { - return ParseWithOptions(ctype, MediaTypeParseOptions{}) + return ParseWithOptions(ctype, ParseOptions{}) } // ParseWithOptions parses media-type with additional options controlling the parsing behavior. -func ParseWithOptions(ctype string, options MediaTypeParseOptions) (mtype string, params map[string]string, invalidParams []string, err error) { +func ParseWithOptions(ctype string, options ParseOptions) (mtype string, params map[string]string, invalidParams []string, err error) { mtype, params, err = mime.ParseMediaType( fixNewlines(fixUnescapedQuotes(fixUnquotedSpecials(fixMangledMediaType(removeTrailingHTMLTags(ctype), ';', options))))) if err != nil { @@ -73,7 +73,7 @@ func ParseWithOptions(ctype string, options MediaTypeParseOptions) (mtype string // fixMangledMediaType is used to insert ; separators into media type strings that lack them, and // remove repeated parameters. -func fixMangledMediaType(mtype string, sep rune, options MediaTypeParseOptions) string { +func fixMangledMediaType(mtype string, sep rune, options ParseOptions) string { strsep := string([]rune{sep}) if mtype == "" { return "" diff --git a/vendor/github.com/jhillyerd/enmime/options.go b/vendor/github.com/jhillyerd/enmime/v2/options.go similarity index 87% rename from vendor/github.com/jhillyerd/enmime/options.go rename to vendor/github.com/jhillyerd/enmime/v2/options.go index 8b3104a..9291d8b 100644 --- a/vendor/github.com/jhillyerd/enmime/options.go +++ b/vendor/github.com/jhillyerd/enmime/v2/options.go @@ -48,8 +48,7 @@ func MaxStoredPartErrors(n int) Option { type maxStoredPartErrorsOption int func (o maxStoredPartErrorsOption) apply(p *Parser) { - max := int(o) - p.maxStoredPartErrors = &max + p.maxStoredPartErrors = int(o) } // RawContent if set to true will not try to decode the CTE and return the raw part content. @@ -112,3 +111,16 @@ func (o disableCharacterDetectionOption) apply(p *Parser) { func DisableCharacterDetection(disableCharacterDetection bool) Option { return disableCharacterDetectionOption(disableCharacterDetection) } + +type minCharsetDetectRunesOption int + +func (o minCharsetDetectRunesOption) apply(p *Parser) { + p.minCharsetDetectRunes = int(o) +} + +// MinCharsetDetectRunes sets the minimum length of a MIME part before enmime will attempt to +// detect its character set. The shorter the text, the more likely an incorrect character set +// will be chosen. The default is 100. +func MinCharsetDetectRunes(minCharsetDetectRunes int) Option { + return minCharsetDetectRunesOption(minCharsetDetectRunes) +} diff --git a/vendor/github.com/jhillyerd/enmime/parser.go b/vendor/github.com/jhillyerd/enmime/v2/parser.go similarity index 82% rename from vendor/github.com/jhillyerd/enmime/parser.go rename to vendor/github.com/jhillyerd/enmime/v2/parser.go index 9e57124..fb537d4 100644 --- a/vendor/github.com/jhillyerd/enmime/parser.go +++ b/vendor/github.com/jhillyerd/enmime/v2/parser.go @@ -16,10 +16,9 @@ func AllowCorruptTextPartErrorPolicy(p *Part, err error) bool { // CustomParseMediaType parses media type. See ParseMediaType for more details type CustomParseMediaType func(ctype string) (mtype string, params map[string]string, invalidParams []string, err error) -// Parser parses MIME. -// Default parser is a valid one. +// Parser parses MIME. Create with NewParser to inherit recommended defaults. type Parser struct { - maxStoredPartErrors *int // TODO: Pointer until global var removed. + maxStoredPartErrors int multipartWOBoundaryAsSinglePart bool readPartErrorPolicy ReadPartErrorPolicy skipMalformedParts bool @@ -28,14 +27,18 @@ type Parser struct { stripMediaTypeInvalidCharacters bool disableTextConversion bool disableCharacterDetection bool + minCharsetDetectRunes int } // defaultParser is a Parser with default configuration. -var defaultParser = Parser{} +var defaultParser = *NewParser() // NewParser creates new parser with given options. func NewParser(ops ...Option) *Parser { - p := Parser{} + // Construct parser with default options. + p := Parser{ + minCharsetDetectRunes: 100, + } for _, o := range ops { o.apply(&p) diff --git a/vendor/github.com/jhillyerd/enmime/part.go b/vendor/github.com/jhillyerd/enmime/v2/part.go similarity index 90% rename from vendor/github.com/jhillyerd/enmime/part.go rename to vendor/github.com/jhillyerd/enmime/v2/part.go index 579f015..ef39e5f 100644 --- a/vendor/github.com/jhillyerd/enmime/part.go +++ b/vendor/github.com/jhillyerd/enmime/v2/part.go @@ -13,15 +13,14 @@ import ( "time" "github.com/gogs/chardet" - "github.com/jhillyerd/enmime/internal/coding" - inttp "github.com/jhillyerd/enmime/internal/textproto" - "github.com/jhillyerd/enmime/mediatype" + "github.com/jhillyerd/enmime/v2/internal/coding" + inttp "github.com/jhillyerd/enmime/v2/internal/textproto" + "github.com/jhillyerd/enmime/v2/mediatype" "github.com/pkg/errors" ) const ( minCharsetConfidence = 85 - minCharsetRuneLength = 100 ) // Part represents a node in the MIME multipart tree. The Content-Type, Disposition and File Name @@ -51,6 +50,8 @@ type Part struct { parser *Parser // Provides access to parsing options. randSource rand.Source // optional rand for uuid boundary generation + + encoder *Encoder // provides encoding options } // NewPart creates a new Part object. @@ -130,7 +131,7 @@ func (p *Part) setupHeaders(r *bufio.Reader, defaultContentType string) error { return err } for i := range minvalidParams { - p.addWarning( + p.addWarningf( ErrorMalformedHeader, "Content-Type header has malformed parameter %q", minvalidParams[i]) @@ -172,7 +173,7 @@ func (p *Part) readPartContent(r io.Reader, readPartErrorPolicy ReadPartErrorPol buf, err := io.ReadAll(r) if err != nil { if readPartErrorPolicy != nil && readPartErrorPolicy(p, err) { - p.addWarning(ErrorMalformedChildPart, "partial content: %s", err.Error()) + p.addWarningf(ErrorMalformedChildPart, "partial content: %s", err.Error()) return buf, nil } return nil, err @@ -199,26 +200,30 @@ func (p *Part) convertFromDetectedCharset(r io.Reader, readPartErrorPolicy ReadP return nil, errors.WithStack(err) } + // Restore r. + r = bytes.NewReader(buf) + + if p.parser.disableCharacterDetection && p.Charset != "" { + // Charset detection is disabled, use declared charset. + return p.convertFromStatedCharset(r), nil + } + cs, err := cd.DetectBest(buf) switch err { case nil: // Carry on default: - p.addWarning(ErrorCharsetDeclaration, "charset could not be detected: %v", err) + p.addWarningf(ErrorCharsetDeclaration, "charset could not be detected: %v", err) } - // Restore r. - r = bytes.NewReader(buf) - - if (p.parser.disableCharacterDetection && p.Charset != "") || - (cs == nil || cs.Confidence < minCharsetConfidence || len(bytes.Runes(buf)) < minCharsetRuneLength) { + if cs == nil || cs.Confidence < minCharsetConfidence || len(bytes.Runes(buf)) < p.parser.minCharsetDetectRunes { // Low confidence or not enough characters, use declared character set. return p.convertFromStatedCharset(r), nil } // Confidence exceeded our threshold, use detected character set. if p.Charset != "" && !strings.EqualFold(cs.Charset, p.Charset) { - p.addWarning(ErrorCharsetDeclaration, + p.addWarningf(ErrorCharsetDeclaration, "declared charset %q, detected %q, confidence %d", p.Charset, cs.Charset, cs.Confidence) } @@ -244,7 +249,7 @@ func (p *Part) convertFromStatedCharset(r io.Reader) io.Reader { reader, err := coding.NewCharsetReader(p.Charset, r) if err != nil { // Failed to get a conversion reader. - p.addWarning(ErrorCharsetConversion, "failed to get reader for charset %q: %v", p.Charset, err) + p.addWarningf(ErrorCharsetConversion, "failed to get reader for charset %q: %v", p.Charset, err) } else { return reader } @@ -258,7 +263,7 @@ func (p *Part) convertFromStatedCharset(r io.Reader) io.Reader { reader, err = coding.NewCharsetReader(p.Charset, r) if err != nil { // Failed to get a conversion reader. - p.addWarning(ErrorCharsetConversion, "failed to get reader for charset %q: %v", p.Charset, err) + p.addWarningf(ErrorCharsetConversion, "failed to get reader for charset %q: %v", p.Charset, err) } else { return reader } @@ -294,7 +299,7 @@ func (p *Part) decodeContent(r io.Reader, readPartErrorPolicy ReadPartErrorPolic default: // Unknown encoding. validEncoding = false - p.addWarning( + p.addWarningf( ErrorContentEncoding, "Unrecognized Content-Transfer-Encoding type %q", encoding) @@ -321,7 +326,7 @@ func (p *Part) decodeContent(r io.Reader, readPartErrorPolicy ReadPartErrorPolic } // Set empty content-type error. if p.ContentType == "" { - p.addWarning( + p.addWarningf( ErrorMissingContentType, "content-type is empty for part id: %s", p.PartID) } return nil @@ -330,7 +335,7 @@ func (p *Part) decodeContent(r io.Reader, readPartErrorPolicy ReadPartErrorPolic // parses media type using custom or default media type parser func (p *Part) parseMediaType(ctype string) (mtype string, params map[string]string, invalidParams []string, err error) { if p.parser == nil || p.parser.customParseMediaType == nil { - return mediatype.ParseWithOptions(ctype, mediatype.MediaTypeParseOptions{StripMediaTypeInvalidCharacters: p.parser.stripMediaTypeInvalidCharacters}) + return mediatype.ParseWithOptions(ctype, mediatype.ParseOptions{StripMediaTypeInvalidCharacters: p.parser.stripMediaTypeInvalidCharacters}) } return p.parser.customParseMediaType(ctype) @@ -426,7 +431,7 @@ func parseParts(parent *Part, reader *bufio.Reader) error { return err } if br.unbounded { - parent.addWarning(ErrorMissingBoundary, "Boundary %q was not closed correctly", + parent.addWarningf(ErrorMissingBoundary, "Boundary %q was not closed correctly", parent.Boundary) } if !next { @@ -445,7 +450,7 @@ func parseParts(parent *Part, reader *bufio.Reader) error { bbr := bufio.NewReader(br) if err = p.setupHeaders(bbr, ""); err != nil { if p.parser.skipMalformedParts { - parent.addError(ErrorMalformedChildPart, "read header: %s", err.Error()) + parent.addErrorf(ErrorMalformedChildPart, "read header: %s", err.Error()) continue } @@ -457,7 +462,7 @@ func parseParts(parent *Part, reader *bufio.Reader) error { // Content is text or data, decode it. if err = p.decodeContent(bbr, p.parser.readPartErrorPolicy); err != nil { if p.parser.skipMalformedParts { - parent.addError(ErrorMalformedChildPart, "decode content: %s", err.Error()) + parent.addErrorf(ErrorMalformedChildPart, "decode content: %s", err.Error()) continue } return err @@ -470,7 +475,7 @@ func parseParts(parent *Part, reader *bufio.Reader) error { // Content is another multipart. if err = parseParts(p, bbr); err != nil { if p.parser.skipMalformedParts { - parent.addError(ErrorMalformedChildPart, "parse parts: %s", err.Error()) + parent.addErrorf(ErrorMalformedChildPart, "parse parts: %s", err.Error()) continue } return err @@ -491,3 +496,10 @@ func parseParts(parent *Part, reader *bufio.Reader) error { } return nil } + +func (p *Part) WithEncoder(e *Encoder) *Part { + if e != nil { + p.encoder = e + } + return p +} diff --git a/vendor/github.com/jhillyerd/enmime/sender.go b/vendor/github.com/jhillyerd/enmime/v2/sender.go similarity index 100% rename from vendor/github.com/jhillyerd/enmime/sender.go rename to vendor/github.com/jhillyerd/enmime/v2/sender.go diff --git a/vendor/github.com/jhillyerd/enmime/v2/shell.nix b/vendor/github.com/jhillyerd/enmime/v2/shell.nix new file mode 100644 index 0000000..1153821 --- /dev/null +++ b/vendor/github.com/jhillyerd/enmime/v2/shell.nix @@ -0,0 +1,11 @@ +{ pkgs ? import { } }: +pkgs.mkShell { + buildInputs = with pkgs; [ + delve + go + golangci-lint + gopls + ]; + + hardeningDisable = [ "fortify" ]; +} diff --git a/vendor/github.com/olekukonko/errors/.gitignore b/vendor/github.com/olekukonko/errors/.gitignore new file mode 100644 index 0000000..8a1327c --- /dev/null +++ b/vendor/github.com/olekukonko/errors/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +.idea/ +tmp/ \ No newline at end of file diff --git a/vendor/github.com/olekukonko/errors/LICENSE b/vendor/github.com/olekukonko/errors/LICENSE new file mode 100644 index 0000000..ca02db8 --- /dev/null +++ b/vendor/github.com/olekukonko/errors/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Oleku Konko + +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. diff --git a/vendor/github.com/olekukonko/errors/README.md b/vendor/github.com/olekukonko/errors/README.md new file mode 100644 index 0000000..8830486 --- /dev/null +++ b/vendor/github.com/olekukonko/errors/README.md @@ -0,0 +1,1565 @@ +# Enhanced Error Handling for Go with Context, Stack Traces, Monitoring, and More + +[![Go Reference](https://pkg.go.dev/badge/github.com/olekukonko/errors.svg)](https://pkg.go.dev/github.com/olekukonko/errors) +[![Go Report Card](https://goreportcard.com/badge/github.com/olekukonko/errors)](https://goreportcard.com/report/github.com/olekukonko/errors) +[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) +[![Benchmarks](https://img.shields.io/badge/benchmarks-included-success)](README.md#benchmarks) + +A production-grade error handling library for Go, offering zero-cost abstractions, stack traces, multi-error support, retries, and advanced monitoring through two complementary packages: `errors` (core) and `errmgr` (management). + +## Features + +### `errors` Package (Core) +- **Performance Optimized** + - Optional memory pooling (12 ns/op with pooling) + - Lazy stack trace collection (205 ns/op with stack) + - Small context optimization (≤4 items, 40 ns/op) + - Lock-free configuration reads + +- **Debugging Tools** + - Full stack traces with internal frame filtering + - Error wrapping and chaining + - Structured context attachment + - JSON serialization (662 ns/op) + +- **Advanced Utilities** + - Configurable retry mechanism + - Multi-error aggregation with sampling + - HTTP status code support + - Callback triggers for cleanup or side effects + +### `errmgr` Package (Management) +- **Production Monitoring** + - Error occurrence counting + - Threshold-based alerting + - Categorized metrics + - Predefined error templates + +## Installation + +```bash +go get github.com/olekukonko/errors@latest +``` + +## Package Overview + +- **`errors`**: Core error handling with creation, wrapping, context, stack traces, retries, and multi-error support. +- **`errmgr`**: Error management with templates, monitoring, and predefined errors for consistent application use. + +--- + +> [!NOTE] +> ✓ added support for `errors.Errorf("user %w not found", errors.New("bob"))` +> ✓ added support for `sequential chain` execution +`` + +## Using the `errors` Package + +### Basic Error Creation + +#### Simple Error +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Fast error with no stack trace + err := errors.New("connection failed") + fmt.Println(err) // "connection failed" + + // Standard error, no allocation, same speed + stdErr := errors.Std("connection failed") + fmt.Println(stdErr) // "connection failed" +} +``` + +#### Formatted Error +```go +// main.go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Formatted error without stack trace + errNoWrap := errors.Newf("user %s not found", "bob") + fmt.Println(errNoWrap) // Output: "user bob not found" + + // Standard formatted error, no fmt.Errorf needed (using own pkg) + stdErrNoWrap := errors.Stdf("user %s not found", "bob") + fmt.Println(stdErrNoWrap) // Output: "user bob not found" + + // Added support for %w (compatible with fmt.Errorf output) + // errors.Errorf is alias of errors.Newf + errWrap := errors.Errorf("user %w not found", errors.New("bob")) + fmt.Println(errWrap) // Output: "user bob not found" + + // Standard formatted error for comparison + stdErrWrap := fmt.Errorf("user %w not found", fmt.Errorf("bob")) + fmt.Println(stdErrWrap) // Output: "user bob not found" +} +``` + +#### Error with Stack Trace +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Create an error with stack trace using Trace + err := errors.Trace("critical issue") + fmt.Println(err) // Output: "critical issue" + fmt.Println(err.Stack()) // Output: e.g., ["main.go:15", "caller.go:42"] + + // Convert basic error to traceable with WithStack + errS := errors.New("critical issue") + errS = errS.WithStack() // Add stack trace and update error + fmt.Println(errS) // Output: "critical issue" + fmt.Println(errS.Stack()) // Output: e.g., ["main.go:19", "caller.go:42"] +} +``` + +#### Named Error +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Create a named error with stack trace + err := errors.Named("InputError") + fmt.Println(err.Name()) // Output: "InputError" + fmt.Println(err) // Output: "InputError" +} +``` + +### Adding Context + +#### Basic Context +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Create an error with context + err := errors.New("processing failed"). + With("id", "123"). + With("attempt", 3). + With("retryable", true) + fmt.Println("Error:", err) // Output: "processing failed" + fmt.Println("Full context:", errors.Context(err)) // Output: map[id:123 attempt:3 retryable:true] +} +``` + +#### Context with Wrapped Standard Error +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Wrap a standard error and add context + err := errors.New("processing failed"). + With("id", "123") + wrapped := fmt.Errorf("wrapped: %w", err) + fmt.Println("Wrapped error:", wrapped) // Output: "wrapped: processing failed" + fmt.Println("Direct context:", errors.Context(wrapped)) // Output: nil + + // Convert to access context + e := errors.Convert(wrapped) + fmt.Println("Converted context:", e.Context()) // Output: map[id:123] +} +``` + +#### Adding Context to Standard Error +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Convert a standard error and add context + stdErr := fmt.Errorf("standard error") + converted := errors.Convert(stdErr). + With("source", "legacy"). + With("severity", "high") + fmt.Println("Message:", converted.Error()) // Output: "standard error" + fmt.Println("Context:", converted.Context()) // Output: map[source:legacy severity:high] +} +``` + +#### Complex Context +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Create an error with complex context + err := errors.New("database operation failed"). + With("query", "SELECT * FROM users"). + With("params", map[string]interface{}{ + "limit": 100, + "offset": 0, + }). + With("duration_ms", 45.2) + fmt.Println("Complex error context:") + for k, v := range errors.Context(err) { + fmt.Printf("%s: %v (%T)\n", k, v, v) + } + // Output: + // query: SELECT * FROM users (string) + // params: map[limit:100 offset:0] (map[string]interface {}) + // duration_ms: 45.2 (float64) +} +``` + +### Stack Traces + +#### Adding Stack to Any Error +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Add stack trace to a standard error + err := fmt.Errorf("basic error") + enhanced := errors.WithStack(err) + fmt.Println("Error with stack:") + fmt.Println("Message:", enhanced.Error()) // Output: "basic error" + fmt.Println("Stack:", enhanced.Stack()) // Output: e.g., "main.go:15" +} +``` + +#### Chaining with Stack +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" + "time" +) + +func main() { + // Create an enhanced error and add stack/context + err := errors.New("validation error"). + With("field", "email") + stackErr := errors.WithStack(err). + With("timestamp", time.Now()). + WithCode(500) + fmt.Println("Message:", stackErr.Error()) // Output: "validation error" + fmt.Println("Context:", stackErr.Context()) // Output: map[field:email timestamp:...] + fmt.Println("Stack:") + for _, frame := range stackErr.Stack() { + fmt.Println(frame) + } +} +``` +### Stack Traces with `WithStack()` +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" + "math/rand" + "time" +) + +func basicFunc() error { + return fmt.Errorf("basic error") +} + +func enhancedFunc() *errors.Error { + return errors.New("enhanced error") +} + +func main() { + // 1. Package-level WithStack - works with ANY error type + err1 := basicFunc() + enhanced1 := errors.WithStack(err1) // Handles basic errors + fmt.Println("Package-level WithStack:") + fmt.Println(enhanced1.Stack()) + + // 2. Method-style WithStack - only for *errors.Error + err2 := enhancedFunc() + enhanced2 := err2.WithStack() // More natural chaining + fmt.Println("\nMethod-style WithStack:") + fmt.Println(enhanced2.Stack()) + + // 3. Combined usage in real-world scenario + result := processData() + if result != nil { + // Use package-level when type is unknown + stackErr := errors.WithStack(result) + + // Then use method-style for chaining + finalErr := stackErr. + With("timestamp", time.Now()). + WithCode(500) + + fmt.Println("\nCombined Usage:") + fmt.Println("Message:", finalErr.Error()) + fmt.Println("Context:", finalErr.Context()) + fmt.Println("Stack:") + for _, frame := range finalErr.Stack() { + fmt.Println(frame) + } + } +} + +func processData() error { + // Could return either basic or enhanced error + if rand.Intn(2) == 0 { + return fmt.Errorf("database error") + } + return errors.New("validation error").With("field", "email") +} +``` + +### Error Wrapping and Chaining + +#### Basic Wrapping +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Wrap an error with additional context + lowErr := errors.New("low-level failure") + highErr := errors.Wrapf(lowErr, "high-level operation failed: %s", "details") + fmt.Println(highErr) // Output: "high-level operation failed: details: low-level failure" + fmt.Println(errors.Unwrap(highErr)) // Output: "low-level failure" +} +``` + +#### Walking Error Chain +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Create a chained error + dbErr := errors.New("connection timeout"). + With("server", "db01.prod") + bizErr := errors.New("failed to process user 12345"). + With("user_id", "12345"). + Wrap(dbErr) + apiErr := errors.New("API request failed"). + WithCode(500). + Wrap(bizErr) + + // Walk the error chain + fmt.Println("Error Chain:") + for i, e := range errors.UnwrapAll(apiErr) { + fmt.Printf("%d. %s\n", i+1, e) + } + // Output: + // 1. API request failed + // 2. failed to process user 12345 + // 3. connection timeout +} +``` + +### Type Assertions + +#### Using Is +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Check error type with Is + err := errors.Named("AuthError") + wrapped := errors.Wrapf(err, "login failed") + if errors.Is(wrapped, err) { + fmt.Println("Is an AuthError") // Output: "Is an AuthError" + } +} +``` + +#### Using As +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Extract error type with As + err := errors.Named("AuthError") + wrapped := errors.Wrapf(err, "login failed") + var authErr *errors.Error + if wrapped.As(&authErr) { + fmt.Println("Extracted:", authErr.Name()) // Output: "Extracted: AuthError" + } +} +``` + +### Retry Mechanism + +#### Basic Retry +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" + "math/rand" + "time" +) + +func main() { + // Simulate a flaky operation + attempts := 0 + retry := errors.NewRetry( + errors.WithMaxAttempts(3), + errors.WithDelay(100*time.Millisecond), + ) + err := retry.Execute(func() error { + attempts++ + if rand.Intn(2) == 0 { + return errors.New("temporary failure").WithRetryable() + } + return nil + }) + if err != nil { + fmt.Printf("Failed after %d attempts: %v\n", attempts, err) + } else { + fmt.Printf("Succeeded after %d attempts\n", attempts) + } +} + +``` + +#### Retry with Context Timeout +```go +package main + +import ( + "context" + "fmt" + "github.com/olekukonko/errors" + "time" +) + +func main() { + // Retry with context timeout + ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond) + defer cancel() + retry := errors.NewRetry( + errors.WithContext(ctx), + errors.WithMaxAttempts(5), + errors.WithDelay(200*time.Millisecond), + ) + err := retry.Execute(func() error { + return errors.New("operation failed").WithRetryable() + }) + if errors.Is(err, context.DeadlineExceeded) { + fmt.Println("Operation timed out:", err) + } else if err != nil { + fmt.Println("Operation failed:", err) + } +} +``` + + +### Retry Comprehensive + +```go +package main + +import ( + "context" + "fmt" + "github.com/olekukonko/errors" + "math/rand" + "time" +) + +// DatabaseClient simulates a flaky database connection +type DatabaseClient struct { + healthyAfterAttempt int +} + +func (db *DatabaseClient) Query() error { + if db.healthyAfterAttempt > 0 { + db.healthyAfterAttempt-- + return errors.New("database connection failed"). + With("attempt_remaining", db.healthyAfterAttempt). + WithRetryable() // Mark as retryable + } + return nil +} + +// ExternalService simulates an unreliable external API +func ExternalService() error { + if rand.Intn(100) < 30 { // 30% failure rate + return errors.New("service unavailable"). + WithCode(503). + WithRetryable() + } + return nil +} + +func main() { + // Configure retry with exponential backoff and jitter + retry := errors.NewRetry( + errors.WithMaxAttempts(5), + errors.WithDelay(200*time.Millisecond), + errors.WithMaxDelay(2*time.Second), + errors.WithJitter(true), + errors.WithBackoff(errors.ExponentialBackoff{}), + errors.WithOnRetry(func(attempt int, err error) { + // Calculate delay using the same logic as in Execute + baseDelay := 200 * time.Millisecond + maxDelay := 2 * time.Second + delay := errors.ExponentialBackoff{}.Backoff(attempt, baseDelay) + if delay > maxDelay { + delay = maxDelay + } + fmt.Printf("Attempt %d failed: %v (retrying in %v)\n", + attempt, + err.Error(), + delay) + }), + ) + + // Scenario 1: Database connection with known recovery point + db := &DatabaseClient{healthyAfterAttempt: 3} + fmt.Println("Starting database operation...") + err := retry.Execute(func() error { + return db.Query() + }) + if err != nil { + fmt.Printf("Database operation failed after %d attempts: %v\n", retry.Attempts(), err) + } else { + fmt.Println("Database operation succeeded!") + } + + // Scenario 2: External service with random failures + fmt.Println("\nStarting external service call...") + var lastAttempts int + start := time.Now() + + // Using ExecuteReply to demonstrate return values + result, err := errors.ExecuteReply[string](retry, func() (string, error) { + lastAttempts++ + if err := ExternalService(); err != nil { + return "", err + } + return "service response data", nil + }) + + duration := time.Since(start) + + if err != nil { + fmt.Printf("Service call failed after %d attempts (%.2f sec): %v\n", + lastAttempts, + duration.Seconds(), + err) + } else { + fmt.Printf("Service call succeeded after %d attempts (%.2f sec): %s\n", + lastAttempts, + duration.Seconds(), + result) + } + + // Scenario 3: Context cancellation with more visibility + fmt.Println("\nStarting operation with timeout...") + ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond) + defer cancel() + + timeoutRetry := retry.Transform( + errors.WithContext(ctx), + errors.WithMaxAttempts(10), + errors.WithOnRetry(func(attempt int, err error) { + fmt.Printf("Timeout scenario attempt %d: %v\n", attempt, err) + }), + ) + + startTimeout := time.Now() + err = timeoutRetry.Execute(func() error { + time.Sleep(300 * time.Millisecond) // Simulate long operation + return errors.New("operation timed out") + }) + + if errors.Is(err, context.DeadlineExceeded) { + fmt.Printf("Operation cancelled by timeout after %.2f sec: %v\n", + time.Since(startTimeout).Seconds(), + err) + } else if err != nil { + fmt.Printf("Operation failed: %v\n", err) + } else { + fmt.Println("Operation succeeded (unexpected)") + } +} +``` + +### Multi-Error Aggregation + +#### Form Validation +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Validate a form with multiple errors + multi := errors.NewMultiError() + multi.Add(errors.New("name is required")) + multi.Add(errors.New("email is invalid")) + multi.Add(errors.New("password too short")) + if multi.Has() { + fmt.Println(multi) // Output: "errors(3): name is required; email is invalid; password too short" + fmt.Printf("Total errors: %d\n", multi.Count()) + } +} +``` + +#### Sampling Multi-Errors +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Simulate many errors with sampling + multi := errors.NewMultiError( + errors.WithSampling(10), // 10% sampling + errors.WithLimit(5), + ) + for i := 0; i < 100; i++ { + multi.Add(errors.Newf("error %d", i)) + } + fmt.Println(multi) + fmt.Printf("Captured %d out of 100 errors\n", multi.Count()) +} +``` + +### Additional Examples + +#### Using Callbacks +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Add a callback to an error + err := errors.New("transaction failed"). + Callback(func() { + fmt.Println("Reversing transaction...") + }) + fmt.Println(err) // Output: "transaction failed" + "Reversing transaction..." + err.Free() +} +``` + +#### Copying Errors +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Copy an error and modify the copy + original := errors.New("base error").With("key", "value") + copied := original.Copy().With("extra", "data") + fmt.Println("Original:", original, original.Context()) // Output: "base error" map[key:value] + fmt.Println("Copied:", copied, copied.Context()) // Output: "base error" map[key:value extra:data] +} +``` + +#### Transforming Errors +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Transform an error with additional context + err := errors.New("base error") + transformed := errors.Transform(err, func(e *errors.Error) { + e.With("env", "prod"). + WithCode(500). + WithStack() + }) + fmt.Println(transformed.Error()) // Output: "base error" + fmt.Println(transformed.Context()) // Output: map[env:prod] + fmt.Println(transformed.Code()) // Output: 500 + fmt.Println(len(transformed.Stack()) > 0) // Output: true + transformed.Free() +} +``` + +### Transformation and Enrichment + +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func process() error { + return errors.New("base error") +} + +func main() { + err := process() + transformedErr := errors.Transform(err, func(e *errors.Error) { + e.With("env", "prod"). + WithCode(500). + WithStack() + }) + + // No type assertion needed now + fmt.Println(transformedErr.Error()) // "base error" + fmt.Println(transformedErr.Context()) // map[env:prod] + fmt.Println(transformedErr.Code()) // 500 + fmt.Println(len(transformedErr.Stack()) > 0) // true + transformedErr.Free() // Clean up + + stdErr := process() + convertedErr := errors.Convert(stdErr) // Convert standard error to *Error + convertedErr.With("source", "external"). + WithCode(400). + Callback(func() { + fmt.Println("Converted error processed...") + }) + fmt.Println("Converted Error:", convertedErr.Error()) + fmt.Println("Context:", convertedErr.Context()) + fmt.Println("Code:", convertedErr.Code()) + convertedErr.Free() + +} + +``` + +#### Fast Stack Trace +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Get a lightweight stack trace + err := errors.Trace("lightweight error") + fastStack := err.FastStack() + fmt.Println("Fast Stack:") + for _, frame := range fastStack { + fmt.Println(frame) // Output: e.g., "main.go:15" + } +} +``` + +#### WarmStackPool +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Pre-warm the stack pool + errors.WarmStackPool(10) + err := errors.Trace("pre-warmed error") + fmt.Println("Stack after warming pool:") + for _, frame := range err.Stack() { + fmt.Println(frame) + } +} +``` + +### Multi-Error Aggregation + +```go +package main + +import ( + "fmt" + "net/mail" + "strings" + "time" + + "github.com/olekukonko/errors" +) + +type UserForm struct { + Name string + Email string + Password string + Birthday string +} + +func validateUser(form UserForm) *errors.MultiError { + multi := errors.NewMultiError( + errors.WithLimit(10), + errors.WithFormatter(customFormat), + ) + + // Name validation + if form.Name == "" { + multi.Add(errors.New("name is required")) + } else if len(form.Name) > 50 { + multi.Add(errors.New("name cannot exceed 50 characters")) + } + + // Email validation + if form.Email == "" { + multi.Add(errors.New("email is required")) + } else { + if _, err := mail.ParseAddress(form.Email); err != nil { + multi.Add(errors.New("invalid email format")) + } + if !strings.Contains(form.Email, "@") { + multi.Add(errors.New("email must contain @ symbol")) + } + } + + // Password validation + if len(form.Password) < 8 { + multi.Add(errors.New("password must be at least 8 characters")) + } + if !strings.ContainsAny(form.Password, "0123456789") { + multi.Add(errors.New("password must contain at least one number")) + } + if !strings.ContainsAny(form.Password, "!@#$%^&*") { + multi.Add(errors.New("password must contain at least one special character")) + } + + // Birthday validation + if form.Birthday != "" { + if _, err := time.Parse("2006-01-02", form.Birthday); err != nil { + multi.Add(errors.New("birthday must be in YYYY-MM-DD format")) + } else if bday, _ := time.Parse("2006-01-02", form.Birthday); time.Since(bday).Hours()/24/365 < 13 { + multi.Add(errors.New("must be at least 13 years old")) + } + } + + return multi +} + +func customFormat(errs []error) string { + var sb strings.Builder + sb.WriteString("🚨 Validation Errors:\n") + for i, err := range errs { + sb.WriteString(fmt.Sprintf(" %d. %s\n", i+1, err)) + } + sb.WriteString(fmt.Sprintf("\nTotal issues found: %d\n", len(errs))) + return sb.String() +} + +func main() { + fmt.Println("=== User Registration Validation ===") + + user := UserForm{ + Name: "", // Empty name + Email: "invalid-email", + Password: "weak", + Birthday: "2015-01-01", // Under 13 + } + + // Generate multiple validation errors + validationErrors := validateUser(user) + + if validationErrors.Has() { + fmt.Println(validationErrors) + + // Detailed error analysis + fmt.Println("\n🔍 Error Analysis:") + fmt.Printf("Total errors: %d\n", validationErrors.Count()) + fmt.Printf("First error: %v\n", validationErrors.First()) + fmt.Printf("Last error: %v\n", validationErrors.Last()) + + // Categorized errors with consistent formatting + fmt.Println("\n📋 Error Categories:") + if emailErrors := validationErrors.Filter(contains("email")); emailErrors.Has() { + fmt.Println("Email Issues:") + if emailErrors.Count() == 1 { + fmt.Println(customFormat([]error{emailErrors.First()})) + } else { + fmt.Println(emailErrors) + } + } + if pwErrors := validationErrors.Filter(contains("password")); pwErrors.Has() { + fmt.Println("Password Issues:") + if pwErrors.Count() == 1 { + fmt.Println(customFormat([]error{pwErrors.First()})) + } else { + fmt.Println(pwErrors) + } + } + if ageErrors := validationErrors.Filter(contains("13 years")); ageErrors.Has() { + fmt.Println("Age Restriction:") + if ageErrors.Count() == 1 { + fmt.Println(customFormat([]error{ageErrors.First()})) + } else { + fmt.Println(ageErrors) + } + } + } + + // System Error Aggregation Example + fmt.Println("\n=== System Error Aggregation ===") + systemErrors := errors.NewMultiError( + errors.WithLimit(5), + errors.WithFormatter(systemErrorFormat), + ) + + // Simulate system errors + systemErrors.Add(errors.New("database connection timeout").WithRetryable()) + systemErrors.Add(errors.New("API rate limit exceeded").WithRetryable()) + systemErrors.Add(errors.New("disk space low")) + systemErrors.Add(errors.New("database connection timeout").WithRetryable()) // Duplicate + systemErrors.Add(errors.New("cache miss")) + systemErrors.Add(errors.New("database connection timeout").WithRetryable()) // Over limit + + fmt.Println(systemErrors) + fmt.Printf("\nSystem Status: %d active issues\n", systemErrors.Count()) + + // Filter retryable errors + if retryable := systemErrors.Filter(errors.IsRetryable); retryable.Has() { + fmt.Println("\n🔄 Retryable Errors:") + fmt.Println(retryable) + } +} + +func systemErrorFormat(errs []error) string { + var sb strings.Builder + sb.WriteString("⚠️ System Alerts:\n") + for i, err := range errs { + sb.WriteString(fmt.Sprintf(" %d. %s", i+1, err)) + if errors.IsRetryable(err) { + sb.WriteString(" (retryable)") + } + sb.WriteString("\n") + } + return sb.String() +} + +func contains(substr string) func(error) bool { + return func(err error) bool { + return strings.Contains(err.Error(), substr) + } +} +``` + +### Chain Execution + +#### Sequential Task Processing +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" + "time" +) + +// validateOrder checks order input. +func validateOrder() error { + return nil // Simulate successful validation +} + +// processKYC handles payment processing. +func processKYC() error { + return nil // Simulate successful validation +} + +// processPayment handles payment processing. +func processPayment() error { + return errors.New("payment declined") // Simulate payment failure +} + +// generateInvoice creates an invoice. +func generateInvoice() error { + return errors.New("invoicing unavailable") // Simulate invoicing issue +} + +// sendNotification sends a confirmation. +func sendNotification() error { + return errors.New("notification failed") // Simulate notification failure +} + +// processOrder simulates a multi-step order processing workflow. +func processOrder() error { + c := errors.NewChain() + + // Validate order input + c.Step(validateOrder).Tag("validation") + + // KYC Process + c.Step(validateOrder).Tag("validation") + + // Process payment with retries + c.Step(processPayment).Tag("billing").Retry(3, 100*time.Millisecond) + + // Generate invoice + c.Step(generateInvoice).Tag("invoicing") + + // Send notification (optional) + c.Step(sendNotification).Tag("notification").Optional() + + return c.Run() +} + +func main() { + if err := processOrder(); err != nil { + // Print error to stderr and exit + errors.Inspect(err) + } + fmt.Println("Order processed successfully") +} +``` + +#### Sequential Task Processing 2 +```go +package main + +import ( + "fmt" + "os" + + "github.com/olekukonko/errors" +) + +// validate simulates a validation check that fails. +func validate(name string) error { + return errors.Newf("validation for %s failed", name) +} + +// validateOrder checks order input. +func validateOrder() error { + return nil // Simulate successful validation +} + +// verifyKYC handles Know Your Customer verification. +func verifyKYC(name string) error { + return validate(name) // Simulate KYC validation failure +} + +// processPayment handles payment processing. +func processPayment() error { + return nil // Simulate successful payment +} + +// processOrder coordinates the order processing workflow. +func processOrder() error { + chain := errors.NewChain(). + Step(validateOrder). // Step 1: Validate order + Call(verifyKYC, "john"). // Step 2: Verify customer + Step(processPayment) // Step 3: Process payment + + if err := chain.Run(); err != nil { + return errors.Errorf("processing order: %w", err) + } + return nil +} + +func main() { + if err := processOrder(); err != nil { + // Print the full error chain to stderr + fmt.Fprintf(os.Stderr, "ERROR: %v\n", err) + // Output + // ERROR: processing order: validation for john failed + + // For debugging, you could print the stack trace: + // errors.Inspect(err) + os.Exit(1) + } + + fmt.Println("order processed successfully") +} + +``` + + +#### Retry with Timeout +```go +package main + +import ( + "context" + "fmt" + "github.com/olekukonko/errors" + "time" +) + +func main() { + c := errors.NewChain( + errors.ChainWithTimeout(1*time.Second), + ). + Step(func() error { + time.Sleep(2 * time.Second) + return errors.New("fetch failed") + }). + Tag("api"). + Retry(3, 200*time.Millisecond) + + err := c.Run() + if err != nil { + var deadlineErr error + if errors.As(err, &deadlineErr) && deadlineErr == context.DeadlineExceeded { + fmt.Println("Fetch timed out") + } else { + fmt.Printf("Fetch failed: %v\n", err) + } + return + } + fmt.Println("Fetch succeeded") +} +``` + +#### Collecting All Errors +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + c := errors.NewChain( + errors.ChainWithMaxErrors(2), + ). + Step(func() error { return errors.New("task 1 failed") }).Tag("task1"). + Step(func() error { return nil }).Tag("task2"). + Step(func() error { return errors.New("task 3 failed") }).Tag("task3") + + err := c.RunAll() + if err != nil { + errors.Inspect(err) + return + } + fmt.Println("All tasks completed successfully") +} + +``` + +--- + +## Using the `errmgr` Package + +### Predefined Errors + +#### Static Error +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors/errmgr" +) + +func main() { + // Use a predefined static error + err := errmgr.ErrNotFound + fmt.Println(err) // Output: "not found" + fmt.Println(err.Code()) // Output: 404 +} +``` + +#### Templated Error +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors/errmgr" +) + +func main() { + // Use a templated error with category + err := errmgr.ErrDBQuery("SELECT failed") + fmt.Println(err) // Output: "database query failed: SELECT failed" + fmt.Println(err.Category()) // Output: "database" +} +``` + +### Error Monitoring + +#### Basic Monitoring +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors/errmgr" + "time" +) + +func main() { + // Define and monitor an error + netErr := errmgr.Define("NetError", "network issue: %s") + monitor := errmgr.NewMonitor("NetError") + errmgr.SetThreshold("NetError", 2) + defer monitor.Close() + + go func() { + for alert := range monitor.Alerts() { + fmt.Printf("Alert: %s, count: %d\n", alert.Error(), alert.Count()) + } + }() + + for i := 0; i < 4; i++ { + err := netErr(fmt.Sprintf("attempt %d", i)) + err.Free() + } + time.Sleep(100 * time.Millisecond) +} +``` + +#### Realistic Monitoring +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" + "github.com/olekukonko/errors/errmgr" + "os" + "os/signal" + "syscall" + "time" +) + +func main() { + // Define our error types + netErr := errmgr.Define("NetError", "network connection failed: %s (attempt %d)") + dbErr := errmgr.Define("DBError", "database operation failed: %s") + + // Create monitors with different buffer sizes + netMonitor := errmgr.NewMonitorBuffered("NetError", 10) // Larger buffer for network errors + dbMonitor := errmgr.NewMonitorBuffered("DBError", 5) // Smaller buffer for DB errors + defer netMonitor.Close() + defer dbMonitor.Close() + + // Set different thresholds + errmgr.SetThreshold("NetError", 3) // Alert after 3 network errors + errmgr.SetThreshold("DBError", 2) // Alert after 2 database errors + + // Set up signal handling for graceful shutdown + sigChan := make(chan os.Signal, 1) + signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM) + + // Alert handler goroutine + done := make(chan struct{}) + go func() { + defer close(done) + for { + select { + case alert, ok := <-netMonitor.Alerts(): + if !ok { + fmt.Println("Network alert channel closed") + return + } + handleAlert("NETWORK", alert) + case alert, ok := <-dbMonitor.Alerts(): + if !ok { + fmt.Println("Database alert channel closed") + return + } + handleAlert("DATABASE", alert) + case <-time.After(2 * time.Second): + // Periodic check for shutdown + continue + } + } + }() + + // Simulate operations with potential failures + go func() { + for i := 1; i <= 15; i++ { + // Simulate different error scenarios + if i%4 == 0 { + // Database error + err := dbErr("connection timeout") + fmt.Printf("DB Operation %d: Failed\n", i) + err.Free() + } else { + // Network error + var errMsg string + switch { + case i%3 == 0: + errMsg = "timeout" + case i%5 == 0: + errMsg = "connection reset" + default: + errMsg = "unknown error" + } + + err := netErr(errMsg, i) + fmt.Printf("Network Operation %d: Failed with %q\n", i, errMsg) + err.Free() + } + + // Random delay between operations + time.Sleep(time.Duration(100+(i%200)) * time.Millisecond) + } + }() + + // Wait for shutdown signal or completion + select { + case <-sigChan: + fmt.Println("\nReceived shutdown signal...") + case <-time.After(5 * time.Second): + fmt.Println("Completion timeout reached...") + } + + // Cleanup + fmt.Println("Initiating shutdown...") + netMonitor.Close() + dbMonitor.Close() + + // Wait for the alert handler to finish + select { + case <-done: + fmt.Println("Alert handler shutdown complete") + case <-time.After(1 * time.Second): + fmt.Println("Alert handler shutdown timeout") + } + + fmt.Println("Application shutdown complete") +} + +func handleAlert(service string, alert *errors.Error) { + if alert == nil { + fmt.Printf("[%s] Received nil alert\n", service) + return + } + + fmt.Printf("[%s ALERT] %s (total occurrences: %d)\n", + service, alert.Error(), alert.Count()) + + if alert.Count() > 5 { + fmt.Printf("[%s CRITICAL] High error rate detected!\n", service) + } +} +``` + +--- + +## Performance Optimization + +### Configuration Tuning +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Tune error package configuration + errors.Configure(errors.Config{ + StackDepth: 32, // Limit stack frames + ContextSize: 4, // Optimize small contexts + DisablePooling: false, // Enable pooling + }) + err := errors.New("configured error") + fmt.Println(err) // Output: "configured error" +} +``` + +### Using `Free()` for Performance +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Use Free() to return error to pool + err := errors.New("temp error") + fmt.Println(err) // Output: "temp error" + err.Free() // Immediate pool return, reduces GC pressure +} +``` + +### Benchmarks +Real performance data (Apple M3 Pro, Go 1.21): +``` +goos: darwin +goarch: arm64 +pkg: github.com/olekukonko/errors +cpu: Apple M3 Pro +BenchmarkBasic_New-12 99810412 12.00 ns/op 0 B/op 0 allocs/op +BenchmarkStack_WithStack-12 5879510 205.6 ns/op 24 B/op 1 allocs/op +BenchmarkContext_Small-12 29600850 40.34 ns/op 16 B/op 1 allocs/op +BenchmarkWrapping_Simple-12 100000000 11.73 ns/op 0 B/op 0 allocs/op +``` +- **New with Pooling**: 12 ns/op, 0 allocations +- **WithStack**: 205 ns/op, minimal allocation +- **Context**: 40 ns/op for small contexts +- Run: `go test -bench=. -benchmem` + +## Migration Guide + +### From Standard Library +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Before: Standard library error + err1 := fmt.Errorf("error: %v", "oops") + fmt.Println(err1) + + // After: Enhanced error with context and stack + err2 := errors.Newf("error: %v", "oops"). + With("source", "api"). + WithStack() + fmt.Println(err2) +} +``` + +### From `pkg/errors` +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Before: pkg/errors (assuming similar API) + // err := pkgerrors.Wrap(err, "context") + + // After: Enhanced wrapping + err := errors.New("low-level"). + Msgf("context: %s", "details"). + WithStack() + fmt.Println(err) +} +``` + +### Compatibility with `errors.Is` and `errors.As` +```go +package main + +import ( + "fmt" + "github.com/olekukonko/errors" +) + +func main() { + // Check compatibility with standard library + err := errors.Named("MyError") + wrapped := errors.Wrapf(err, "outer") + if errors.Is(wrapped, err) { // Stdlib compatible + fmt.Println("Matches MyError") // Output: "Matches MyError" + } +} +``` + +## FAQ + +- **When to use `Copy()`?** + - Use ` SOCIALCopy()` to create a modifiable duplicate of an error without altering the original. + +- **When to use `Free()`?** + - Use in performance-critical loops; otherwise, autofree handles it (Go 1.24+). + +- **How to handle cleanup?** + - Use `Callback()` for automatic actions like rollbacks or logging. + +- **How to add stack traces later?** + - Use `WithStack()` to upgrade a simple error: + ```go + package main + + import ( + "fmt" + "github.com/olekukonko/errors" + ) + + func main() { + err := errors.New("simple") + err = err.WithStack() + fmt.Println(err.Stack()) + } + ``` + +## Contributing +- Fork, branch, commit, and PR—see [CONTRIBUTING.md](#). + +## License +MIT License - See [LICENSE](LICENSE). diff --git a/vendor/github.com/olekukonko/errors/chain.go b/vendor/github.com/olekukonko/errors/chain.go new file mode 100644 index 0000000..5dc73a5 --- /dev/null +++ b/vendor/github.com/olekukonko/errors/chain.go @@ -0,0 +1,610 @@ +package errors + +import ( + "context" + "fmt" + "log/slog" // Standard structured logging package + "reflect" + "strings" + "time" +) + +// Chain executes functions sequentially with enhanced error handling. +// Logging is optional and configured via a slog.Handler. +type Chain struct { + steps []chainStep // List of steps to execute + errors []error // Accumulated errors during execution + config chainConfig // Chain-wide configuration + lastStep *chainStep // Pointer to the last added step for configuration + logHandler slog.Handler // Optional logging handler (nil means no logging) + cancel context.CancelFunc // Function to cancel the context +} + +// chainStep represents a single step in the chain. +type chainStep struct { + execute func() error // Function to execute for this step + optional bool // If true, errors don't stop the chain + config stepConfig // Step-specific configuration +} + +// chainConfig holds chain-wide settings. +type chainConfig struct { + timeout time.Duration // Maximum duration for the entire chain + maxErrors int // Maximum number of errors before stopping (-1 for unlimited) + autoWrap bool // Whether to automatically wrap errors with additional context +} + +// stepConfig holds configuration for an individual step. +type stepConfig struct { + context map[string]interface{} // Arbitrary key-value pairs for context + category ErrorCategory // Category for error classification + code int // Numeric error code + retry *Retry // Retry policy for the step + logOnFail bool // Whether to log errors automatically + metricsLabel string // Label for metrics (not used in this code) + logAttrs []slog.Attr // Additional attributes for logging +} + +// ChainOption defines a function that configures a Chain. +type ChainOption func(*Chain) + +// NewChain creates a new Chain with the given options. +// Logging is disabled by default (logHandler is nil). +func NewChain(opts ...ChainOption) *Chain { + c := &Chain{ + config: chainConfig{ + autoWrap: true, // Enable error wrapping by default + maxErrors: -1, // No limit on errors by default + }, + // logHandler is nil, meaning no logging unless explicitly configured + } + // Apply each configuration option + for _, opt := range opts { + opt(c) + } + return c +} + +// ChainWithLogHandler sets a custom slog.Handler for logging. +// If handler is nil, logging is effectively disabled. +func ChainWithLogHandler(handler slog.Handler) ChainOption { + return func(c *Chain) { + c.logHandler = handler + } +} + +// ChainWithTimeout sets a timeout for the entire chain. +func ChainWithTimeout(d time.Duration) ChainOption { + return func(c *Chain) { + c.config.timeout = d + } +} + +// ChainWithMaxErrors sets the maximum number of errors allowed. +// A value <= 0 means no limit. +func ChainWithMaxErrors(max int) ChainOption { + return func(c *Chain) { + if max <= 0 { + c.config.maxErrors = -1 // No limit + } else { + c.config.maxErrors = max + } + } +} + +// ChainWithAutoWrap enables or disables automatic error wrapping. +func ChainWithAutoWrap(auto bool) ChainOption { + return func(c *Chain) { + c.config.autoWrap = auto + } +} + +// Step adds a new step to the chain with the provided function. +// The function must return an error or nil. +func (c *Chain) Step(fn func() error) *Chain { + if fn == nil { + // Panic to enforce valid input + panic("Chain.Step: provided function cannot be nil") + } + // Create a new step with default configuration + step := chainStep{execute: fn, config: stepConfig{}} + c.steps = append(c.steps, step) + // Update lastStep to point to the newly added step + c.lastStep = &c.steps[len(c.steps)-1] + return c +} + +// Call adds a step by wrapping a function with arguments. +// It uses reflection to validate and invoke the function. +func (c *Chain) Call(fn interface{}, args ...interface{}) *Chain { + // Wrap the function and arguments into an executable step + wrappedFn, err := c.wrapCallable(fn, args...) + if err != nil { + // Panic on setup errors to catch them early + panic(fmt.Sprintf("Chain.Call setup error: %v", err)) + } + // Add the wrapped function as a step + step := chainStep{execute: wrappedFn, config: stepConfig{}} + c.steps = append(c.steps, step) + c.lastStep = &c.steps[len(c.steps)-1] + return c +} + +// Optional marks the last step as optional. +// Optional steps don't stop the chain on error. +func (c *Chain) Optional() *Chain { + if c.lastStep == nil { + // Panic if no step exists to mark as optional + panic("Chain.Optional: must call Step() or Call() before Optional()") + } + c.lastStep.optional = true + return c +} + +// WithLog adds logging attributes to the last step. +func (c *Chain) WithLog(attrs ...slog.Attr) *Chain { + if c.lastStep == nil { + // Panic if no step exists to configure + panic("Chain.WithLog: must call Step() or Call() before WithLog()") + } + // Append attributes to the step's logging configuration + c.lastStep.config.logAttrs = append(c.lastStep.config.logAttrs, attrs...) + return c +} + +// Timeout sets a timeout for the entire chain. +func (c *Chain) Timeout(d time.Duration) *Chain { + c.config.timeout = d + return c +} + +// MaxErrors sets the maximum number of errors allowed. +func (c *Chain) MaxErrors(max int) *Chain { + if max <= 0 { + c.config.maxErrors = -1 // No limit + } else { + c.config.maxErrors = max + } + return c +} + +// With adds a key-value pair to the last step's context. +func (c *Chain) With(key string, value interface{}) *Chain { + if c.lastStep == nil { + // Panic if no step exists to configure + panic("Chain.With: must call Step() or Call() before With()") + } + // Initialize context map if nil + if c.lastStep.config.context == nil { + c.lastStep.config.context = make(map[string]interface{}) + } + // Add the key-value pair + c.lastStep.config.context[key] = value + return c +} + +// Tag sets an error category for the last step. +func (c *Chain) Tag(category ErrorCategory) *Chain { + if c.lastStep == nil { + // Panic if no step exists to configure + panic("Chain.Tag: must call Step() or Call() before Tag()") + } + c.lastStep.config.category = category + return c +} + +// Code sets a numeric error code for the last step. +func (c *Chain) Code(code int) *Chain { + if c.lastStep == nil { + // Panic if no step exists to configure + panic("Chain.Code: must call Step() or Call() before Code()") + } + c.lastStep.config.code = code + return c +} + +// Retry configures retry behavior for the last step. +// Retry configures retry behavior for the last step. +func (c *Chain) Retry(maxAttempts int, delay time.Duration, opts ...RetryOption) *Chain { + if c.lastStep == nil { + panic("Chain.Retry: must call Step() or Call() before Retry()") + } + if maxAttempts < 1 { + maxAttempts = 1 + } + + // Define default retry options + retryOpts := []RetryOption{ + WithMaxAttempts(maxAttempts), + WithDelay(delay), + WithRetryIf(func(err error) bool { return IsRetryable(err) }), + } + + // Add logging for retry attempts if a handler is configured + if c.logHandler != nil { + step := c.lastStep + retryOpts = append(retryOpts, WithOnRetry(func(attempt int, err error) { + // Prepare logging attributes + logAttrs := []slog.Attr{ + slog.Int("attempt", attempt), + slog.Int("max_attempts", maxAttempts), + } + // Enhance the error with step context + enhancedErr := c.enhanceError(err, step) + // Log the retry attempt + c.logError(enhancedErr, fmt.Sprintf("Retrying step (attempt %d/%d)", attempt, maxAttempts), step.config, logAttrs...) + })) + } + + // Append any additional retry options + retryOpts = append(retryOpts, opts...) + // Create and assign the retry configuration + c.lastStep.config.retry = NewRetry(retryOpts...) + return c +} + +// LogOnFail enables automatic logging of errors for the last step. +func (c *Chain) LogOnFail() *Chain { + if c.lastStep == nil { + // Panic if no step exists to configure + panic("Chain.LogOnFail: must call Step() or Call() before LogOnFail()") + } + c.lastStep.config.logOnFail = true + return c +} + +// Run executes the chain, stopping on the first non-optional error. +// It returns the first error encountered or nil if all steps succeed. +func (c *Chain) Run() error { + // Create a context with timeout or cancellation + ctx, cancel := c.getContextAndCancel() + defer cancel() + c.cancel = cancel + // Clear any previous errors + c.errors = c.errors[:0] + + // Execute each step in sequence + for i := range c.steps { + step := &c.steps[i] + // Check if the context has been canceled + select { + case <-ctx.Done(): + err := ctx.Err() + // Enhance the error with step context + enhancedErr := c.enhanceError(err, step) + c.errors = append(c.errors, enhancedErr) + // Log the context error + c.logError(enhancedErr, "Chain stopped due to context error before step", step.config) + return enhancedErr + default: + } + + // Execute the step + err := c.executeStep(ctx, step) + if err != nil { + // Enhance the error with step context + enhancedErr := c.enhanceError(err, step) + c.errors = append(c.errors, enhancedErr) + // Log the error if required + if step.config.logOnFail || !step.optional { + logMsg := "Chain stopped due to error in step" + if step.optional { + logMsg = "Optional step failed" + } + c.logError(enhancedErr, logMsg, step.config) + } + // Stop execution if the step is not optional + if !step.optional { + return enhancedErr + } + } + } + // Return nil if all steps completed successfully + return nil +} + +// RunAll executes all steps, collecting errors without stopping. +// It returns a MultiError containing all errors or nil if none occurred. +func (c *Chain) RunAll() error { + ctx, cancel := c.getContextAndCancel() + defer cancel() + c.cancel = cancel + c.errors = c.errors[:0] + multi := NewMultiError() + + for i := range c.steps { + step := &c.steps[i] + select { + case <-ctx.Done(): + err := ctx.Err() + enhancedErr := c.enhanceError(err, step) + c.errors = append(c.errors, enhancedErr) + multi.Add(enhancedErr) + c.logError(enhancedErr, "Chain stopped due to context error before step (RunAll)", step.config) + goto endRunAll + default: + } + + err := c.executeStep(ctx, step) + if err != nil { + enhancedErr := c.enhanceError(err, step) + c.errors = append(c.errors, enhancedErr) + multi.Add(enhancedErr) + if step.config.logOnFail && c.logHandler != nil { + c.logError(enhancedErr, "Step failed during RunAll", step.config) + } + if c.config.maxErrors > 0 && multi.Count() >= c.config.maxErrors { + if c.logHandler != nil { + // Create a logger to log the max errors condition + logger := slog.New(c.logHandler) + logger.LogAttrs( + context.Background(), + slog.LevelError, + fmt.Sprintf("Stopping RunAll after reaching max errors (%d)", c.config.maxErrors), + slog.Int("max_errors", c.config.maxErrors), + ) + } + goto endRunAll + } + } + } + +endRunAll: + return multi.Single() +} + +// Errors returns a copy of the collected errors. +func (c *Chain) Errors() []error { + if len(c.errors) == 0 { + return nil + } + // Create a copy to prevent external modification + errs := make([]error, len(c.errors)) + copy(errs, c.errors) + return errs +} + +// Len returns the number of steps in the chain. +func (c *Chain) Len() int { + return len(c.steps) +} + +// HasErrors checks if any errors were collected. +func (c *Chain) HasErrors() bool { + return len(c.errors) > 0 +} + +// LastError returns the most recent error or nil if none exist. +func (c *Chain) LastError() error { + if len(c.errors) > 0 { + return c.errors[len(c.errors)-1] + } + return nil +} + +// Reset clears the chain's steps, errors, and context. +func (c *Chain) Reset() { + if c.cancel != nil { + // Cancel any active context + c.cancel() + c.cancel = nil + } + // Clear steps and errors + c.steps = c.steps[:0] + c.errors = c.errors[:0] + c.lastStep = nil +} + +// Unwrap returns the collected errors (alias for Errors). +func (c *Chain) Unwrap() []error { + return c.errors +} + +// getContextAndCancel creates a context based on the chain's timeout. +// It returns a context and its cancellation function. +func (c *Chain) getContextAndCancel() (context.Context, context.CancelFunc) { + parentCtx := context.Background() + if c.config.timeout > 0 { + // Create a context with a timeout + return context.WithTimeout(parentCtx, c.config.timeout) + } + // Create a cancellable context + return context.WithCancel(parentCtx) +} + +// logError logs an error with step-specific context and attributes. +// It only logs if a handler is configured and the error is non-nil. +func (c *Chain) logError(err error, msg string, config stepConfig, additionalAttrs ...slog.Attr) { + // Skip logging if no handler is set or error is nil + if c == nil || c.logHandler == nil || err == nil { + return + } + + // Create a logger on demand using the configured handler + logger := slog.New(c.logHandler) + + // Initialize attributes with error and timestamp + allAttrs := make([]slog.Attr, 0, 5+len(config.logAttrs)+len(additionalAttrs)) + allAttrs = append(allAttrs, slog.Any("error", err)) + allAttrs = append(allAttrs, slog.Time("timestamp", time.Now())) + + // Add step-specific metadata + if config.category != "" { + allAttrs = append(allAttrs, slog.String("category", string(config.category))) + } + if config.code != 0 { + allAttrs = append(allAttrs, slog.Int("code", config.code)) + } + for k, v := range config.context { + allAttrs = append(allAttrs, slog.Any(k, v)) + } + allAttrs = append(allAttrs, config.logAttrs...) + allAttrs = append(allAttrs, additionalAttrs...) + + // Add stack trace and error name if the error is of type *Error + if e, ok := err.(*Error); ok { + if stack := e.Stack(); len(stack) > 0 { + // Format stack trace, truncating if too long + stackStr := "\n\t" + strings.Join(stack, "\n\t") + if len(stackStr) > 1000 { + stackStr = stackStr[:1000] + "..." + } + allAttrs = append(allAttrs, slog.String("stacktrace", stackStr)) + } + if name := e.Name(); name != "" { + allAttrs = append(allAttrs, slog.String("error_name", name)) + } + } + + // Log the error at ERROR level with all attributes + // Use a defer to catch any panics during logging + defer func() { + if r := recover(); r != nil { + // Print to stdout to avoid infinite recursion + fmt.Printf("ERROR: Recovered from panic during logging: %v\nAttributes: %v\n", r, allAttrs) + } + }() + logger.LogAttrs(context.Background(), slog.LevelError, msg, allAttrs...) +} + +// wrapCallable wraps a function and its arguments into an executable step. +// It uses reflection to validate the function and arguments. +func (c *Chain) wrapCallable(fn interface{}, args ...interface{}) (func() error, error) { + val := reflect.ValueOf(fn) + typ := val.Type() + + // Ensure the provided value is a function + if typ.Kind() != reflect.Func { + return nil, fmt.Errorf("provided 'fn' is not a function (got %T)", fn) + } + // Check if the number of arguments matches the function's signature + if typ.NumIn() != len(args) { + return nil, fmt.Errorf("function expects %d arguments, but %d were provided", typ.NumIn(), len(args)) + } + + // Prepare argument values + argVals := make([]reflect.Value, len(args)) + errorType := reflect.TypeOf((*error)(nil)).Elem() + for i, arg := range args { + expectedType := typ.In(i) + var providedVal reflect.Value + if arg != nil { + providedVal = reflect.ValueOf(arg) + // Check if the argument type is assignable to the expected type + if !providedVal.Type().AssignableTo(expectedType) { + // Special case for error interfaces + if expectedType.Kind() == reflect.Interface && expectedType.Implements(errorType) && providedVal.Type().Implements(errorType) { + // Allow error interface + } else { + return nil, fmt.Errorf("argument %d type mismatch: expected %s, got %s", i, expectedType, providedVal.Type()) + } + } + } else { + // Handle nil arguments for nullable types + switch expectedType.Kind() { + case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Pointer, reflect.Slice: + providedVal = reflect.Zero(expectedType) + default: + return nil, fmt.Errorf("argument %d is nil, but expected non-nillable type %s", i, expectedType) + } + } + argVals[i] = providedVal + } + + // Validate the function's return type + if typ.NumOut() > 1 || (typ.NumOut() == 1 && !typ.Out(0).Implements(errorType)) { + return nil, fmt.Errorf("function must return either no values or a single error (got %d return values)", typ.NumOut()) + } + + // Return a wrapped function that calls the original with the provided arguments + return func() error { + results := val.Call(argVals) + if len(results) == 1 && results[0].Interface() != nil { + return results[0].Interface().(error) + } + return nil + }, nil +} + +// executeStep runs a single step, applying retries if configured. +func (c *Chain) executeStep(ctx context.Context, step *chainStep) error { + select { + case <-ctx.Done(): + return ctx.Err() + default: + } + if step.config.retry != nil { + retry := step.config.retry.Transform(WithContext(ctx)) + // Wrap step execution to respect context + wrappedFn := func() error { + type result struct { + err error + } + done := make(chan result, 1) + go func() { + done <- result{err: step.execute()} + }() + select { + case res := <-done: + return res.err + case <-ctx.Done(): + return ctx.Err() + } + } + return retry.Execute(wrappedFn) + } + // Non-retry case also respects context + type result struct { + err error + } + done := make(chan result, 1) + go func() { + done <- result{err: step.execute()} + }() + select { + case res := <-done: + return res.err + case <-ctx.Done(): + return ctx.Err() + } +} + +// enhanceError wraps an error with additional context from the step. +func (c *Chain) enhanceError(err error, step *chainStep) error { + if err == nil || !c.config.autoWrap { + // Return the error unchanged if nil or autoWrap is disabled + return err + } + + // Initialize the base error + var baseError *Error + if e, ok := err.(*Error); ok { + // Copy existing *Error to preserve its properties + baseError = e.Copy() + } else { + // Create a new *Error wrapping the original + baseError = New(err.Error()).Wrap(err).WithStack() + } + + if step != nil { + // Add step-specific context to the error + if step.config.category != "" && baseError.Category() == "" { + baseError.WithCategory(step.config.category) + } + if step.config.code != 0 && baseError.Code() == 0 { + baseError.WithCode(step.config.code) + } + for k, v := range step.config.context { + baseError.With(k, v) + } + for _, attr := range step.config.logAttrs { + baseError.With(attr.Key, attr.Value.Any()) + } + if step.config.retry != nil && !baseError.HasContextKey(ctxRetry) { + // Mark the error as retryable if retries are configured + baseError.WithRetryable() + } + } + + return baseError +} diff --git a/vendor/github.com/olekukonko/errors/errors.go b/vendor/github.com/olekukonko/errors/errors.go new file mode 100644 index 0000000..4f6509d --- /dev/null +++ b/vendor/github.com/olekukonko/errors/errors.go @@ -0,0 +1,1496 @@ +// Package errors provides a robust error handling library with support for +// error wrapping, stack traces, context storage, and retry mechanisms. It extends +// the standard library's error interface with features like HTTP-like status codes, +// error categorization, and JSON serialization, while maintaining compatibility +// with `errors.Is`, `errors.As`, and `errors.Unwrap`. The package is thread-safe +// and optimized with object pooling for performance. +package errors + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "regexp" + "runtime" + "strings" + "sync" + "sync/atomic" +) + +// Constants defining default configuration and context keys. +const ( + ctxTimeout = "[error] timeout" // Context key marking timeout errors. + ctxRetry = "[error] retry" // Context key marking retryable errors. + + contextSize = 4 // Initial size of fixed-size context array for small contexts. + bufferSize = 256 // Initial buffer size for JSON marshaling. + warmUpSize = 100 // Number of errors to pre-warm the pool for efficiency. + stackDepth = 32 // Maximum stack trace depth to prevent excessive memory use. + + DefaultCode = 500 // Default HTTP status code for errors if not specified. +) + +// spaceRe is a precompiled regex for normalizing whitespace in error messages. +var spaceRe = regexp.MustCompile(`\s+`) + +// ErrorCategory is a string type for categorizing errors (e.g., "network", "validation"). +type ErrorCategory string + +// ErrorOpts provides options for customizing error creation. +type ErrorOpts struct { + SkipStack int // Number of stack frames to skip when capturing the stack trace. +} + +// Config defines the global configuration for the errors package, controlling +// stack depth, context size, pooling, and frame filtering. +type Config struct { + StackDepth int // Maximum stack trace depth; 0 uses default (32). + ContextSize int // Initial context map size; 0 uses default (4). + DisablePooling bool // If true, disables object pooling for errors. + FilterInternal bool // If true, filters internal package frames from stack traces. + AutoFree bool // If true, automatically frees errors to pool after use. +} + +// cachedConfig holds the current configuration, updated only by Configure(). +// Protected by configMu for thread-safety. +type cachedConfig struct { + stackDepth int + contextSize int + disablePooling bool + filterInternal bool + autoFree bool +} + +var ( + // currentConfig stores the active configuration, read frequently and updated rarely. + currentConfig cachedConfig + // configMu protects updates to currentConfig for thread-safety. + configMu sync.RWMutex + // errorPool manages reusable Error instances to reduce allocations. + errorPool = NewErrorPool() + // stackPool manages reusable stack trace slices for efficiency. + stackPool = sync.Pool{ + New: func() interface{} { + return make([]uintptr, currentConfig.stackDepth) + }, + } + // emptyError is a pre-allocated empty error for lightweight reuse. + emptyError = &Error{ + smallContext: [contextSize]contextItem{}, + msg: "", + name: "", + template: "", + cause: nil, + } +) + +// contextItem holds a single key-value pair in the smallContext array. +type contextItem struct { + key string + value interface{} +} + +// Error is a custom error type with enhanced features: message, name, stack trace, +// context, cause, and metadata like code and category. It is thread-safe and +// supports pooling for performance. +type Error struct { + // Primary fields (frequently accessed). + msg string // The error message displayed by Error(). + name string // The error name or type (e.g., "AuthError"). + stack []uintptr // Stack trace as program counters. + + // Secondary metadata. + template string // Fallback message template if msg is empty. + category string // Error category (e.g., "network"). + count uint64 // Occurrence count for tracking frequency. + code int32 // HTTP-like status code (e.g., 400, 500). + smallCount int32 // Number of items in smallContext. + + // Context and chaining. + context map[string]interface{} // Key-value pairs for additional context. + cause error // Wrapped underlying error for chaining. + callback func() // Optional callback invoked by Error(). + smallContext [contextSize]contextItem // Fixed-size array for small contexts. + + // Synchronization. + mu sync.RWMutex // Protects mutable fields (context, smallContext). + + // Internal flags. + formatWrapped bool // True if created by Newf with %w verb. +} + +// init sets up the package with default configuration and pre-warms the error pool. +func init() { + currentConfig = cachedConfig{ + stackDepth: stackDepth, + contextSize: contextSize, + disablePooling: false, + filterInternal: true, + autoFree: true, + } + WarmPool(warmUpSize) // Pre-allocate errors for performance. +} + +// Configure updates the global configuration for the errors package. +// It is thread-safe and should be called early to avoid race conditions. +// Changes apply to all subsequent error operations. +// Example: +// +// errors.Configure(errors.Config{StackDepth: 16, DisablePooling: true}) +func Configure(cfg Config) { + configMu.Lock() + defer configMu.Unlock() + + if cfg.StackDepth != 0 { + currentConfig.stackDepth = cfg.StackDepth + } + if cfg.ContextSize != 0 { + currentConfig.contextSize = cfg.ContextSize + } + currentConfig.disablePooling = cfg.DisablePooling + currentConfig.filterInternal = cfg.FilterInternal + currentConfig.autoFree = cfg.AutoFree +} + +// newError creates a new Error instance, reusing from the pool if enabled. +// Initializes smallContext and sets stack to nil. +// Internal use; prefer New, Named, or Trace for public API. +func newError() *Error { + if currentConfig.disablePooling { + return &Error{ + smallContext: [contextSize]contextItem{}, + stack: nil, + } + } + return errorPool.Get() +} + +// Empty returns a new empty error with no message, name, or stack trace. +// Useful for incrementally building errors or as a neutral base. +// Example: +// +// err := errors.Empty().With("key", "value").WithCode(400) +func Empty() *Error { + return emptyError +} + +// Named creates an error with the specified name and captures a stack trace. +// The name doubles as the error message if no message is set. +// Use for errors where type identification and stack context are important. +// Example: +// +// err := errors.Named("AuthError").WithCode(401) +func Named(name string) *Error { + e := newError() + e.name = name + return e.WithStack() +} + +// New creates a lightweight error with the given message and no stack trace. +// Optimized for performance; use Trace() for stack traces. +// Returns a shared empty error for empty messages to reduce allocations. +// Example: +// +// err := errors.New("invalid input") +func New(text string) *Error { + if text == "" { + return emptyError.Copy() // Avoid modifying shared instance. + } + err := newError() + err.msg = text + return err +} + +// Newf creates a formatted error, supporting the %w verb for wrapping errors. +// If the format contains exactly one %w verb with a non-nil error argument, +// the error is wrapped as the cause. The final error message string generated +// by Error() will be compatible with the output of fmt.Errorf for the same inputs. +// Does not capture a stack trace by default. +// Example: +// +// cause := errors.New("db error") +// err := errors.Newf("query failed: %w", cause) +// // err.Error() will match fmt.Errorf("query failed: %w", cause).Error() +// // errors.Unwrap(err) == cause +func Newf(format string, args ...interface{}) *Error { + err := newError() + + // --- Start: Parsing and Validation (mostly unchanged) --- + var wCount int + var wArgPos = -1 + var wArg error + var validationErrorMsg string + argPos := 0 + runes := []rune(format) + i := 0 + parsingOk := true + var fmtVerbs []struct { + isW bool + spec string // The full verb specifier or literal segment + argIdx int // Index in the original 'args' slice, -1 for literals/%% + } + + // Parse format string to identify verbs and literals. + for i < len(runes) && parsingOk { + segmentStart := i + if runes[i] == '%' { + if i+1 >= len(runes) { + parsingOk = false + validationErrorMsg = "ends with %" + break + } + if runes[i+1] == '%' { + fmtVerbs = append(fmtVerbs, struct { + isW bool + spec string + argIdx int + }{isW: false, spec: "%%", argIdx: -1}) + i += 2 + continue + } + i++ // Move past '%' + // Parse flags, width, precision (simplified loop) + for i < len(runes) && strings.ContainsRune("+- #0", runes[i]) { + i++ + } + for i < len(runes) && ((runes[i] >= '0' && runes[i] <= '9') || runes[i] == '.') { + i++ + } + if i >= len(runes) { + parsingOk = false + validationErrorMsg = "ends mid-specifier" + break + } + verb := runes[i] + specifierEndIndex := i + 1 + fullSpec := string(runes[segmentStart:specifierEndIndex]) + // Check if the verb consumes an argument + currentVerbConsumesArg := strings.ContainsRune("vTtbcdoqxXUeEfFgGspw", verb) + currentArgIdx := -1 + isWVerb := false + + if verb == 'w' { + isWVerb = true + wCount++ + if wCount == 1 { + wArgPos = argPos // Record position of the error argument + } else { + parsingOk = false + validationErrorMsg = "multiple %w" + break + } + } + + if currentVerbConsumesArg { + if argPos >= len(args) { + parsingOk = false + if isWVerb { // More specific message for missing %w arg + validationErrorMsg = "missing %w argument" + } else { + validationErrorMsg = fmt.Sprintf("missing argument for %s", string(verb)) + } + break + } + currentArgIdx = argPos + if isWVerb { + cause, ok := args[argPos].(error) + if !ok || cause == nil { + parsingOk = false + validationErrorMsg = "bad %w argument type" + break + } + wArg = cause // Store the actual error argument + } + argPos++ // Consume the argument position + } + fmtVerbs = append(fmtVerbs, struct { + isW bool + spec string + argIdx int + }{isW: isWVerb, spec: fullSpec, argIdx: currentArgIdx}) + i = specifierEndIndex // Move past the verb character + } else { + // Handle literal segment + literalStart := i + for i < len(runes) && runes[i] != '%' { + i++ + } + fmtVerbs = append(fmtVerbs, struct { + isW bool + spec string + argIdx int + }{isW: false, spec: string(runes[literalStart:i]), argIdx: -1}) + } + } + + // Check for too many arguments after parsing + if parsingOk && argPos < len(args) { + parsingOk = false + validationErrorMsg = fmt.Sprintf("too many arguments for format %q", format) + } + + // Handle format validation errors. + if !parsingOk { + switch validationErrorMsg { + case "multiple %w": + err.msg = fmt.Sprintf("errors.Newf: format %q has multiple %%w verbs", format) + case "missing %w argument": + err.msg = fmt.Sprintf("errors.Newf: format %q has %%w but not enough arguments", format) + case "bad %w argument type": + argValStr := "()" + if wArgPos >= 0 && wArgPos < len(args) && args[wArgPos] != nil { + argValStr = fmt.Sprintf("(%T)", args[wArgPos]) + } else if wArgPos >= len(args) { + argValStr = "(missing)" // Should be caught by "missing %w argument" case + } + err.msg = fmt.Sprintf("errors.Newf: argument %d for %%w is not a non-nil error %s", wArgPos, argValStr) + case "ends with %": + err.msg = fmt.Sprintf("errors.Newf: format %q ends with %%", format) + case "ends mid-specifier": + err.msg = fmt.Sprintf("errors.Newf: format %q ends during verb specifier", format) + default: // Includes "too many arguments" and other potential fmt issues + err.msg = fmt.Sprintf("errors.Newf: error in format %q: %s", format, validationErrorMsg) + } + err.cause = nil // Ensure no cause is set on format error + err.formatWrapped = false + return err + } + // --- End: Parsing and Validation --- + + // --- Start: Processing Valid Format String --- + if wCount == 1 && wArg != nil { + // --- Handle %w: Simulate for Sprintf and pre-format --- + err.cause = wArg // Set the cause for unwrapping + err.formatWrapped = true // Signal that msg is the final formatted string + + var finalFormat strings.Builder + var finalArgs []interface{} + causeStr := wArg.Error() // Get the string representation of the cause + + // Rebuild format string and argument list for Sprintf + for _, verb := range fmtVerbs { + if verb.isW { + // Replace the %w verb specifier (e.g., "%w", "%+w") with "%s" + finalFormat.WriteString("%s") + // Add the cause's *string* to the arguments list for the new %s + finalArgs = append(finalArgs, causeStr) + } else { + // Keep the original literal segment or non-%w verb specifier + finalFormat.WriteString(verb.spec) + if verb.argIdx != -1 { + // Add the original argument for this non-%w verb/literal + finalArgs = append(finalArgs, args[verb.argIdx]) + } + } + } + + // Format using the *modified* format string and arguments list + result, fmtErr := FmtErrorCheck(finalFormat.String(), finalArgs...) + if fmtErr != nil { + // Handle potential errors during the final formatting step + // This is unlikely if parsing passed, but possible with complex verbs/args + err.msg = fmt.Sprintf("errors.Newf: formatting error during %%w simulation for format %q: %v", format, fmtErr) + err.cause = nil // Don't keep the cause if final formatting failed + err.formatWrapped = false + } else { + // Store the final, fully formatted string, matching fmt.Errorf output + err.msg = result + } + // --- End %w Simulation --- + + } else { + // --- No %w or wArg is nil: Format directly (original logic) --- + result, fmtErr := FmtErrorCheck(format, args...) + if fmtErr != nil { + err.msg = fmt.Sprintf("errors.Newf: formatting error for format %q: %v", format, fmtErr) + err.cause = nil + err.formatWrapped = false + } else { + err.msg = result + err.formatWrapped = false // Ensure false if no %w was involved + } + } + // --- End: Processing Valid Format String --- + + return err +} + +// Errorf is an alias for Newf, providing a familiar interface compatible with +// fmt.Errorf. It creates a formatted error without capturing a stack trace. +// See Newf for full details on formatting, including %w support for error wrapping. +// +// Example: +// +// err := errors.Errorf("failed: %w", errors.New("cause")) +// // err.Error() == "failed: cause" +func Errorf(format string, args ...interface{}) *Error { + return Newf(format, args...) +} + +// FmtErrorCheck safely formats a string using fmt.Sprintf, catching panics. +// Returns the formatted string and any error encountered. +// Internal use by Newf to validate format strings. +// Example: +// +// result, err := FmtErrorCheck("value: %s", "test") +func FmtErrorCheck(format string, args ...interface{}) (result string, err error) { + defer func() { + if r := recover(); r != nil { + if e, ok := r.(error); ok { + err = e + } else { + err = fmt.Errorf("panic during formatting: %v", r) + } + } + }() + result = fmt.Sprintf(format, args...) + return result, nil +} + +// countFmtArgs counts format specifiers that consume arguments in a format string. +// Ignores %% and non-consuming verbs like %n. +// Internal use by Newf for argument validation. +func countFmtArgs(format string) int { + count := 0 + runes := []rune(format) + i := 0 + for i < len(runes) { + if runes[i] == '%' { + if i+1 < len(runes) && runes[i+1] == '%' { + i += 2 // Skip %% + continue + } + i++ // Move past % + for i < len(runes) && (runes[i] == '+' || runes[i] == '-' || runes[i] == '#' || + runes[i] == ' ' || runes[i] == '0' || + (runes[i] >= '1' && runes[i] <= '9') || runes[i] == '.') { + i++ + } + if i < len(runes) { + if strings.ContainsRune("vTtbcdoqxXUeEfFgGsp", runes[i]) { + count++ + } + i++ // Move past verb + } + } else { + i++ + } + } + return count +} + +// Std creates a standard error using errors.New for compatibility. +// Does not capture stack traces or add context. +// Example: +// +// err := errors.Std("simple error") +func Std(text string) error { + return errors.New(text) +} + +// Stdf creates a formatted standard error using fmt.Errorf for compatibility. +// Supports %w for wrapping; does not capture stack traces. +// Example: +// +// err := errors.Stdf("failed: %w", cause) +func Stdf(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Trace creates an error with the given message and captures a stack trace. +// Use when debugging context is needed; for performance, prefer New(). +// Example: +// +// err := errors.Trace("operation failed") +func Trace(text string) *Error { + e := New(text) + return e.WithStack() +} + +// Tracef creates a formatted error with a stack trace. +// Supports %w for wrapping errors. +// Example: +// +// err := errors.Tracef("query %s failed: %w", query, cause) +func Tracef(format string, args ...interface{}) *Error { + e := Newf(format, args...) + return e.WithStack() +} + +// As attempts to assign the error or one in its chain to the target interface. +// Supports *Error and standard error types, traversing the cause chain. +// Returns true if successful. +// Example: +// +// var target *Error +// if errors.As(err, &target) { +// fmt.Println(target.Name()) +// } +func (e *Error) As(target interface{}) bool { + if e == nil { + return false + } + // Handle *Error target. + if targetPtr, ok := target.(*Error); ok { + current := e + for current != nil { + if current.name != "" { + *targetPtr = *current + return true + } + if next, ok := current.cause.(*Error); ok { + current = next + } else if current.cause != nil { + return errors.As(current.cause, target) + } else { + return false + } + } + return false + } + // Handle *error target. + if targetErr, ok := target.(*error); ok { + innermost := error(e) + current := error(e) + for current != nil { + if err, ok := current.(*Error); ok && err.cause != nil { + current = err.cause + innermost = current + } else { + break + } + } + *targetErr = innermost + return true + } + // Delegate to cause for other types. + if e.cause != nil { + return errors.As(e.cause, target) + } + return false +} + +// Callback sets a function to be called when Error() is invoked. +// Useful for logging or side effects on error access. +// Example: +// +// err := errors.New("test").Callback(func() { log.Println("error accessed") }) +func (e *Error) Callback(fn func()) *Error { + e.callback = fn + return e +} + +// Category returns the error’s category, if set. +// Example: +// +// if err.Category() == "network" { +// handleNetworkError(err) +// } +func (e *Error) Category() string { + return e.category +} + +// Code returns the error’s HTTP-like status code, if set. +// Returns 0 if no code is set. +// Example: +// +// if err.Code() == 404 { +// renderNotFound() +// } +func (e *Error) Code() int { + return int(e.code) +} + +// Context returns the error’s context as a map, merging smallContext and map-based context. +// Thread-safe; lazily initializes the map if needed. +// Example: +// +// ctx := err.Context() +// if userID, ok := ctx["user_id"]; ok { +// fmt.Println(userID) +// } +func (e *Error) Context() map[string]interface{} { + e.mu.RLock() + defer e.mu.RUnlock() + + if e.smallCount > 0 && e.context == nil { + e.context = make(map[string]interface{}, e.smallCount) + for i := int32(0); i < e.smallCount; i++ { + e.context[e.smallContext[i].key] = e.smallContext[i].value + } + } + return e.context +} + +// Copy creates a deep copy of the error, preserving all fields except stack freshness. +// The new error can be modified independently. +// Example: +// +// newErr := err.Copy().With("new_key", "value") +func (e *Error) Copy() *Error { + if e == emptyError { + return &Error{ + smallContext: [contextSize]contextItem{}, + } + } + + newErr := newError() + + newErr.msg = e.msg + newErr.name = e.name + newErr.template = e.template + newErr.cause = e.cause + newErr.code = e.code + newErr.category = e.category + newErr.count = e.count + + if e.smallCount > 0 { + newErr.smallCount = e.smallCount + for i := int32(0); i < e.smallCount; i++ { + newErr.smallContext[i] = e.smallContext[i] + } + } else if e.context != nil { + newErr.context = make(map[string]interface{}, len(e.context)) + for k, v := range e.context { + newErr.context[k] = v + } + } + + if e.stack != nil && len(e.stack) > 0 { + if newErr.stack == nil { + newErr.stack = stackPool.Get().([]uintptr) + } + newErr.stack = append(newErr.stack[:0], e.stack...) + } + + return newErr +} + +// Count returns the number of times the error has been incremented. +// Useful for tracking error frequency. +// Example: +// +// fmt.Printf("Error occurred %d times", err.Count()) +func (e *Error) Count() uint64 { + return e.count +} + +// Err returns the error as an error interface. +// Useful for type assertions or interface compatibility. +// Example: +// +// var stdErr error = err.Err() +func (e *Error) Err() error { + return e +} + +// Error returns the string representation of the error. +// If the error was created using Newf/Errorf with the %w verb, it returns the +// pre-formatted string compatible with fmt.Errorf. +// Otherwise, it combines the message, template, or name with the cause's error +// string, separated by ": ". Invokes any set callback. +func (e *Error) Error() string { + if e.callback != nil { + e.callback() + } + + // If created by Newf/Errorf with %w, msg already contains the final string. + if e.formatWrapped { + return e.msg // Return the pre-formatted fmt.Errorf-compatible string + } + + // --- Original logic for errors not created via Newf("%w", ...) --- + // --- or errors created via New/Named and then Wrap() called. --- + var buf strings.Builder + + // Append primary message part (msg, template, or name) + if e.msg != "" { + buf.WriteString(e.msg) + } else if e.template != "" { + buf.WriteString(e.template) + } else if e.name != "" { + buf.WriteString(e.name) + } + + // Append cause if it exists (only relevant if not formatWrapped) + if e.cause != nil { + if buf.Len() > 0 { + // Add separator only if there was a prefix message/name/template + buf.WriteString(": ") + } + buf.WriteString(e.cause.Error()) + } else if buf.Len() == 0 { + // Handle case where msg/template/name are empty AND cause is nil + // Could return a specific string like "[empty error]" or just "" + return "" // Return empty string for a truly empty error + } + + return buf.String() +} + +// FastStack returns a lightweight stack trace with file and line numbers only. +// Omits function names for performance; skips internal frames if configured. +// Returns nil if no stack trace exists. +// Example: +// +// for _, frame := range err.FastStack() { +// fmt.Println(frame) // e.g., "main.go:42" +// } +func (e *Error) FastStack() []string { + if e.stack == nil { + return nil + } + configMu.RLock() + filter := currentConfig.filterInternal + configMu.RUnlock() + + pcs := e.stack + frames := make([]string, 0, len(pcs)) + for _, pc := range pcs { + fn := runtime.FuncForPC(pc) + if fn == nil { + frames = append(frames, "unknown") + continue + } + file, line := fn.FileLine(pc) + if filter && isInternalFrame(runtime.Frame{File: file, Function: fn.Name()}) { + continue + } + frames = append(frames, fmt.Sprintf("%s:%d", file, line)) + } + return frames +} + +// Find searches the error chain for the first error where pred returns true. +// Returns nil if no match is found or if pred is nil. +// Example: +// +// err := err.Find(func(e error) bool { return strings.Contains(e.Error(), "timeout") }) +func (e *Error) Find(pred func(error) bool) error { + if e == nil || pred == nil { + return nil + } + return Find(e, pred) +} + +// Format returns a detailed, human-readable string representation of the error, +// including message, code, context, stack, and cause. +// Recursive for causes that are also *Error. +// Example: +// +// fmt.Println(err.Format()) +// // Output: +// // Error: failed: cause +// // Code: 500 +// // Context: +// // key: value +// // Stack: +// // 1. main.main main.go:42 +func (e *Error) Format() string { + var sb strings.Builder + + // Error message. + sb.WriteString("Error: " + e.Error() + "\n") + + // Metadata. + if e.code != 0 { + sb.WriteString(fmt.Sprintf("Code: %d\n", e.code)) + } + + // Context. + if ctx := e.contextAtThisLevel(); len(ctx) > 0 { + sb.WriteString("Context:\n") + for k, v := range ctx { + sb.WriteString(fmt.Sprintf("\t%s: %v\n", k, v)) + } + } + + // Stack trace. + if e.stack != nil { + sb.WriteString("Stack:\n") + for i, frame := range e.Stack() { + sb.WriteString(fmt.Sprintf("\t%d. %s\n", i+1, frame)) + } + } + + // Cause. + if e.cause != nil { + sb.WriteString("Caused by: ") + if causeErr, ok := e.cause.(*Error); ok { + sb.WriteString(causeErr.Format()) + } else { + sb.WriteString("Error: " + e.cause.Error() + "\n") + } + sb.WriteString("\n") + } + + return sb.String() +} + +// contextAtThisLevel returns context specific to this error, excluding inherited context. +// Internal use by Format to isolate context per error level. +func (e *Error) contextAtThisLevel() map[string]interface{} { + if e.context == nil && e.smallCount == 0 { + return nil + } + + ctx := make(map[string]interface{}) + // Add smallContext items. + for i := 0; i < int(e.smallCount); i++ { + ctx[e.smallContext[i].key] = e.smallContext[i].value + } + // Add map context items. + if e.context != nil { + for k, v := range e.context { + ctx[k] = v + } + } + return ctx +} + +// Free resets the error and returns it to the pool if pooling is enabled. +// Safe to call multiple times; no-op if pooling is disabled. +// Call after use to prevent memory leaks when autoFree is false. +// Example: +// +// defer err.Free() +func (e *Error) Free() { + if currentConfig.disablePooling { + return + } + + e.Reset() + + if e.stack != nil { + stackPool.Put(e.stack[:cap(e.stack)]) + e.stack = nil + } + errorPool.Put(e) +} + +// Has checks if the error contains meaningful content (message, template, name, or cause). +// Returns false for nil or empty errors. +// Example: +// +// if !err.Has() { +// return nil +// } +func (e *Error) Has() bool { + return e != nil && (e.msg != "" || e.template != "" || e.name != "" || e.cause != nil) +} + +// HasContextKey checks if the specified key exists in the error’s context. +// Thread-safe; checks both smallContext and map-based context. +// Example: +// +// if err.HasContextKey("user_id") { +// fmt.Println(err.Context()["user_id"]) +// } +func (e *Error) HasContextKey(key string) bool { + e.mu.RLock() + defer e.mu.RUnlock() + + if e.smallCount > 0 { + for i := int32(0); i < e.smallCount; i++ { + if e.smallContext[i].key == key { + return true + } + } + } + if e.context != nil { + _, exists := e.context[key] + return exists + } + return false +} + +// Increment atomically increases the error’s count by 1 and returns the error. +// Useful for tracking repeated occurrences. +// Example: +// +// err := err.Increment() +func (e *Error) Increment() *Error { + atomic.AddUint64(&e.count, 1) + return e +} + +// Is checks if the error matches the target by pointer, name, or cause chain. +// Compatible with errors.Is; also matches by string for standard errors. +// Returns true if the error or its cause matches the target. +// Example: +// +// if errors.Is(err, errors.New("target")) { +// handleTargetError() +// } +func (e *Error) Is(target error) bool { + if e == nil || target == nil { + return e == target + } + if e == target { + return true + } + if e.name != "" { + if te, ok := target.(*Error); ok && te.name != "" && e.name == te.name { + return true + } + } + // Match standard errors by string. + if stdErr, ok := target.(error); ok && e.Error() == stdErr.Error() { + return true + } + if e.cause != nil { + return errors.Is(e.cause, target) + } + return false +} + +// IsEmpty checks if the error lacks meaningful content (no message, name, template, or cause). +// Returns true for nil or fully empty errors. +// Example: +// +// if err.IsEmpty() { +// return nil +// } +func (e *Error) IsEmpty() bool { + if e == nil { + return true + } + return e.msg == "" && e.template == "" && e.name == "" && e.cause == nil +} + +// IsNull checks if the error is nil, empty, or contains only SQL NULL values in its context or cause. +// Useful for handling database-related errors. +// Example: +// +// if err.IsNull() { +// return nil +// } +func (e *Error) IsNull() bool { + if e == nil || e == emptyError { + return true + } + // If no context or cause, and no content, it’s not null. + if e.smallCount == 0 && e.context == nil && e.cause == nil { + return false + } + + // Check cause first. + if e.cause != nil { + var isNull bool + if ce, ok := e.cause.(*Error); ok { + isNull = ce.IsNull() + } else { + isNull = sqlNull(e.cause) + } + if isNull { + return true + } + } + + // Check small context. + if e.smallCount > 0 { + allNull := true + for i := 0; i < int(e.smallCount); i++ { + isNull := sqlNull(e.smallContext[i].value) + if !isNull { + allNull = false + break + } + } + if !allNull { + return false + } + } + + // Check regular context. + if e.context != nil { + allNull := true + for _, v := range e.context { + isNull := sqlNull(v) + if !isNull { + allNull = false + break + } + } + if !allNull { + return false + } + } + + // Null if context exists and is all null. + return e.smallCount > 0 || e.context != nil +} + +// jsonBufferPool manages reusable buffers for JSON marshaling to reduce allocations. +var ( + jsonBufferPool = sync.Pool{ + New: func() interface{} { + return bytes.NewBuffer(make([]byte, 0, bufferSize)) + }, + } +) + +// MarshalJSON serializes the error to JSON, including name, message, context, cause, stack, and code. +// Causes are recursively serialized if they implement json.Marshaler or are *Error. +// Example: +// +// data, _ := json.Marshal(err) +// fmt.Println(string(data)) +func (e *Error) MarshalJSON() ([]byte, error) { + // Get buffer from pool. + buf := jsonBufferPool.Get().(*bytes.Buffer) + defer jsonBufferPool.Put(buf) + buf.Reset() + + // Create new encoder. + enc := json.NewEncoder(buf) + enc.SetEscapeHTML(false) + + // Prepare JSON structure. + je := struct { + Name string `json:"name,omitempty"` + Message string `json:"message,omitempty"` + Context map[string]interface{} `json:"context,omitempty"` + Cause interface{} `json:"cause,omitempty"` + Stack []string `json:"stack,omitempty"` + Code int `json:"code,omitempty"` + }{ + Name: e.name, + Message: e.msg, + Code: e.Code(), + } + + // Add context. + if ctx := e.Context(); len(ctx) > 0 { + je.Context = ctx + } + + // Add stack. + if e.stack != nil { + je.Stack = e.Stack() + } + + // Add cause. + if e.cause != nil { + switch c := e.cause.(type) { + case *Error: + je.Cause = c + case json.Marshaler: + je.Cause = c + default: + je.Cause = c.Error() + } + } + + // Encode JSON. + if err := enc.Encode(je); err != nil { + return nil, err + } + + // Remove trailing newline. + result := buf.Bytes() + if len(result) > 0 && result[len(result)-1] == '\n' { + result = result[:len(result)-1] + } + return result, nil +} + +// Msgf sets the error’s message using a formatted string and returns the error. +// Overwrites any existing message. +// Example: +// +// err := err.Msgf("user %s not found", username) +func (e *Error) Msgf(format string, args ...interface{}) *Error { + e.msg = fmt.Sprintf(format, args...) + return e +} + +// Name returns the error’s name, if set. +// Example: +// +// if err.Name() == "AuthError" { +// handleAuthError() +// } +func (e *Error) Name() string { + return e.name +} + +// Reset clears all fields of the error, preparing it for reuse in the pool. +// Internal use by Free; does not release stack to stackPool. +// Example: +// +// err.Reset() // Clear all fields. +func (e *Error) Reset() { + e.msg = "" + e.name = "" + e.template = "" + e.category = "" + e.code = 0 + e.count = 0 + e.cause = nil + e.callback = nil + e.formatWrapped = false + + if e.context != nil { + for k := range e.context { + delete(e.context, k) + } + } + e.smallCount = 0 + + if e.stack != nil { + e.stack = e.stack[:0] + } +} + +// Stack returns a detailed stack trace with function names, files, and line numbers. +// Filters internal frames if configured; returns nil if no stack exists. +// Example: +// +// for _, frame := range err.Stack() { +// fmt.Println(frame) // e.g., "main.main main.go:42" +// } +func (e *Error) Stack() []string { + if e.stack == nil { + return nil + } + + frames := runtime.CallersFrames(e.stack) + var trace []string + for { + frame, more := frames.Next() + if frame == (runtime.Frame{}) { + break + } + + if currentConfig.filterInternal && isInternalFrame(frame) { + continue + } + + trace = append(trace, fmt.Sprintf("%s %s:%d", + frame.Function, + frame.File, + frame.Line)) + + if !more { + break + } + } + return trace +} + +// Trace ensures the error has a stack trace, capturing it if absent. +// Returns the error for chaining. +// Example: +// +// err := errors.New("failed").Trace() +func (e *Error) Trace() *Error { + if e.stack == nil { + e.stack = captureStack(2) + } + return e +} + +// Transform applies transformations to a copy of the error and returns the new error. +// The original error is unchanged; nil-safe. +// Example: +// +// newErr := err.Transform(func(e *Error) { e.With("key", "value") }) +func (e *Error) Transform(fn func(*Error)) *Error { + if e == nil || fn == nil { + return e + } + newErr := e.Copy() + fn(newErr) + return newErr +} + +// Unwrap returns the underlying cause of the error, if any. +// Compatible with errors.Unwrap for chain traversal. +// Example: +// +// cause := errors.Unwrap(err) +func (e *Error) Unwrap() error { + return e.cause +} + +// UnwrapAll returns a slice of all errors in the chain, starting with this error. +// Each error is isolated to prevent modifications affecting others. +// Example: +// +// chain := err.UnwrapAll() +// for _, e := range chain { +// fmt.Println(e.Error()) +// } +func (e *Error) UnwrapAll() []error { + if e == nil { + return nil + } + var chain []error + current := error(e) + for current != nil { + if err, ok := current.(*Error); ok { + isolated := newError() + isolated.msg = err.msg + isolated.name = err.name + isolated.template = err.template + isolated.code = err.code + isolated.category = err.category + if err.smallCount > 0 { + isolated.smallCount = err.smallCount + for i := int32(0); i < err.smallCount; i++ { + isolated.smallContext[i] = err.smallContext[i] + } + } + if err.context != nil { + isolated.context = make(map[string]interface{}, len(err.context)) + for k, v := range err.context { + isolated.context[k] = v + } + } + if err.stack != nil { + isolated.stack = append([]uintptr(nil), err.stack...) + } + chain = append(chain, isolated) + } else { + chain = append(chain, current) + } + if unwrapper, ok := current.(interface{ Unwrap() error }); ok { + current = unwrapper.Unwrap() + } else { + break + } + } + return chain +} + +// Walk traverses the error chain, applying fn to each error. +// Stops if fn is nil or the chain ends. +// Example: +// +// err.Walk(func(e error) { fmt.Println(e.Error()) }) +func (e *Error) Walk(fn func(error)) { + if e == nil || fn == nil { + return + } + current := error(e) + for current != nil { + fn(current) + if unwrappable, ok := current.(interface{ Unwrap() error }); ok { + current = unwrappable.Unwrap() + } else { + break + } + } +} + +// With adds key-value pairs to the error's context and returns the error. +// Uses a fixed-size array (smallContext) for up to contextSize items, then switches +// to a map. Thread-safe. Accepts variadic key-value pairs. +// Example: +// +// err := err.With("key1", value1, "key2", value2) +func (e *Error) With(keyValues ...interface{}) *Error { + if len(keyValues) == 0 { + return e + } + + // Validate that we have an even number of arguments + if len(keyValues)%2 != 0 { + keyValues = append(keyValues, "(MISSING)") + } + + // Fast path for small context when we can add all pairs to smallContext + if e.smallCount < contextSize && e.context == nil { + remainingSlots := contextSize - int(e.smallCount) + if len(keyValues)/2 <= remainingSlots { + e.mu.Lock() + // Recheck conditions after acquiring lock + if e.smallCount < contextSize && e.context == nil { + for i := 0; i < len(keyValues); i += 2 { + key, ok := keyValues[i].(string) + if !ok { + key = fmt.Sprintf("%v", keyValues[i]) + } + e.smallContext[e.smallCount] = contextItem{key, keyValues[i+1]} + e.smallCount++ + } + e.mu.Unlock() + return e + } + e.mu.Unlock() + } + } + + // Slow path - either we have too many pairs or already using map context + e.mu.Lock() + defer e.mu.Unlock() + + // Initialize map context if needed + if e.context == nil { + e.context = make(map[string]interface{}, max(currentConfig.contextSize, len(keyValues)/2+int(e.smallCount))) + // Migrate existing smallContext items + for i := int32(0); i < e.smallCount; i++ { + e.context[e.smallContext[i].key] = e.smallContext[i].value + } + // Reset smallCount since we've moved to map context + e.smallCount = 0 + } + + // Add all pairs to map context + for i := 0; i < len(keyValues); i += 2 { + key, ok := keyValues[i].(string) + if !ok { + key = fmt.Sprintf("%v", keyValues[i]) + } + e.context[key] = keyValues[i+1] + } + + return e +} + +// Helper function to get maximum of two integers +func max(a, b int) int { + if a > b { + return a + } + return b +} + +// WithCategory sets the error’s category and returns the error. +// Example: +// +// err := err.WithCategory("validation") +func (e *Error) WithCategory(category ErrorCategory) *Error { + e.category = string(category) + return e +} + +// WithCode sets an HTTP-like status code and returns the error. +// Example: +// +// err := err.WithCode(400) +func (e *Error) WithCode(code int) *Error { + e.code = int32(code) + return e +} + +// WithName sets the error’s name and returns the error. +// Example: +// +// err := err.WithName("AuthError") +func (e *Error) WithName(name string) *Error { + e.name = name + return e +} + +// WithRetryable marks the error as retryable in its context and returns the error. +// Example: +// +// err := err.WithRetryable() +func (e *Error) WithRetryable() *Error { + return e.With(ctxRetry, true) +} + +// WithStack captures a stack trace if none exists and returns the error. +// Skips one frame (caller of WithStack). +// Example: +// +// err := errors.New("failed").WithStack() +func (e *Error) WithStack() *Error { + if e.stack == nil { + e.stack = captureStack(1) + } + return e +} + +// WithTemplate sets a message template and returns the error. +// Used as a fallback if the message is empty. +// Example: +// +// err := err.WithTemplate("operation failed") +func (e *Error) WithTemplate(template string) *Error { + e.template = template + return e +} + +// WithTimeout marks the error as a timeout error in its context and returns the error. +// Example: +// +// err := err.WithTimeout() +func (e *Error) WithTimeout() *Error { + return e.With(ctxTimeout, true) +} + +// Wrap associates a cause error with this error, creating a chain. +// Returns the error unchanged if cause is nil. +// Example: +// +// err := errors.New("failed").Wrap(errors.New("cause")) +func (e *Error) Wrap(cause error) *Error { + if cause == nil { + return e + } + e.cause = cause + return e +} + +// Wrapf wraps a cause error with formatted message and returns the error. +// If cause is nil, returns the error unchanged. +// Example: +// +// err := errors.New("base").Wrapf(io.EOF, "read failed: %s", "file.txt") +func (e *Error) Wrapf(cause error, format string, args ...interface{}) *Error { + e.msg = fmt.Sprintf(format, args...) + if cause != nil { + e.cause = cause + } + return e +} + +// WrapNotNil wraps a cause error only if it is non-nil and returns the error. +// Example: +// +// err := err.WrapNotNil(maybeError) +func (e *Error) WrapNotNil(cause error) *Error { + if cause != nil { + e.cause = cause + } + return e +} + +// WarmPool pre-populates the error pool with count instances. +// Improves performance by reducing initial allocations. +// No-op if pooling is disabled. +// Example: +// +// errors.WarmPool(1000) +func WarmPool(count int) { + if currentConfig.disablePooling { + return + } + for i := 0; i < count; i++ { + e := &Error{ + smallContext: [contextSize]contextItem{}, + stack: nil, + } + errorPool.Put(e) + stackPool.Put(make([]uintptr, 0, currentConfig.stackDepth)) + } +} + +// WarmStackPool pre-populates the stack pool with count slices. +// Improves performance for stack-intensive operations. +// No-op if pooling is disabled. +// Example: +// +// errors.WarmStackPool(500) +func WarmStackPool(count int) { + if currentConfig.disablePooling { + return + } + for i := 0; i < count; i++ { + stackPool.Put(make([]uintptr, 0, currentConfig.stackDepth)) + } +} diff --git a/vendor/github.com/olekukonko/errors/helper.go b/vendor/github.com/olekukonko/errors/helper.go new file mode 100644 index 0000000..06c2adc --- /dev/null +++ b/vendor/github.com/olekukonko/errors/helper.go @@ -0,0 +1,432 @@ +package errors + +import ( + "context" + "errors" + "fmt" + "strings" + "time" +) + +// As wraps errors.As, using custom type assertion for *Error types. +// Falls back to standard errors.As for non-*Error types. +// Returns false if either err or target is nil. +func As(err error, target interface{}) bool { + if err == nil || target == nil { + return false + } + + // First try our custom *Error handling + if e, ok := err.(*Error); ok { + return e.As(target) + } + + // Fall back to standard errors.As + return errors.As(err, target) +} + +// Code returns the status code of an error, if it is an *Error. +// Returns 500 as a default for non-*Error types to indicate an internal error. +func Code(err error) int { + if e, ok := err.(*Error); ok { + return e.Code() + } + return DefaultCode +} + +// Context extracts the context map from an error, if it is an *Error. +// Returns nil for non-*Error types or if no context is present. +func Context(err error) map[string]interface{} { + if e, ok := err.(*Error); ok { + return e.Context() + } + return nil +} + +// Convert transforms any error into an *Error, preserving its message and wrapping it if needed. +// Returns nil if the input is nil; returns the original if already an *Error. +// Uses multiple strategies: direct assertion, errors.As, manual unwrapping, and fallback creation. +func Convert(err error) *Error { + if err == nil { + return nil + } + + // First try direct type assertion (fast path) + if e, ok := err.(*Error); ok { + return e + } + + // Try using errors.As (more flexible) + var e *Error + if errors.As(err, &e) { + return e + } + + // Manual unwrapping as fallback + visited := make(map[error]bool) + for unwrapped := err; unwrapped != nil; { + if visited[unwrapped] { + break // Cycle detected + } + visited[unwrapped] = true + if e, ok := unwrapped.(*Error); ok { + return e + } + unwrapped = errors.Unwrap(unwrapped) + } + + // Final fallback: create new error with original message and wrap it + return New(err.Error()).Wrap(err) +} + +// Count returns the occurrence count of an error, if it is an *Error. +// Returns 0 for non-*Error types. +func Count(err error) uint64 { + if e, ok := err.(*Error); ok { + return e.Count() + } + return 0 +} + +// Find searches the error chain for the first error matching pred. +// Returns nil if no match is found or pred is nil; traverses both Unwrap() and Cause() chains. +func Find(err error, pred func(error) bool) error { + for current := err; current != nil; { + if pred(current) { + return current + } + + // Attempt to unwrap using Unwrap() or Cause() + switch v := current.(type) { + case interface{ Unwrap() error }: + current = v.Unwrap() + case interface{ Cause() error }: + current = v.Cause() + default: + return nil + } + } + return nil +} + +// From transforms any error into an *Error, preserving its message and wrapping it if needed. +// Alias of Convert; returns nil if input is nil, original if already an *Error. +func From(err error) *Error { + return Convert(err) +} + +// FromContext creates an *Error from a context and an existing error. +// Enhances the error with context info: timeout status, deadline, or cancellation. +// Returns nil if input error is nil; does not store context values directly. +func FromContext(ctx context.Context, err error) *Error { + if err == nil { + return nil + } + + e := New(err.Error()) + + // Handle context errors + switch ctx.Err() { + case context.DeadlineExceeded: + e.WithTimeout() + if deadline, ok := ctx.Deadline(); ok { + e.With("deadline", deadline.Format(time.RFC3339)) + } + case context.Canceled: + e.With("cancelled", true) + } + + return e +} + +// Category returns the category of an error, if it is an *Error. +// Returns an empty string for non-*Error types or unset categories. +func Category(err error) string { + if e, ok := err.(*Error); ok { + return e.category + } + return "" +} + +// Has checks if an error contains meaningful content. +// Returns true for non-nil standard errors or *Error with content (msg, name, template, or cause). +func Has(err error) bool { + if e, ok := err.(*Error); ok { + return e.Has() + } + return err != nil +} + +// HasContextKey checks if the error's context contains the specified key. +// Returns false for non-*Error types or if the key is not present in the context. +func HasContextKey(err error, key string) bool { + if e, ok := err.(*Error); ok { + ctx := e.Context() + if ctx != nil { + _, exists := ctx[key] + return exists + } + } + return false +} + +// Is wraps errors.Is, using custom matching for *Error types. +// Falls back to standard errors.Is for non-*Error types; returns true if err equals target. +func Is(err, target error) bool { + if err == nil || target == nil { + return err == target + } + + if e, ok := err.(*Error); ok { + return e.Is(target) + } + + // Use standard errors.Is for non-Error types + return errors.Is(err, target) +} + +// IsError checks if an error is an instance of *Error. +// Returns true only for this package's custom error type; false for nil or other types. +func IsError(err error) bool { + _, ok := err.(*Error) + return ok +} + +// IsEmpty checks if an error has no meaningful content. +// Returns true for nil errors, empty *Error instances, or standard errors with whitespace-only messages. +func IsEmpty(err error) bool { + if err == nil { + return true + } + if e, ok := err.(*Error); ok { + return e.IsEmpty() + } + return strings.TrimSpace(err.Error()) == "" +} + +// IsNull checks if an error is nil or represents a NULL value. +// Delegates to *Error’s IsNull for custom errors; uses sqlNull for others. +func IsNull(err error) bool { + if err == nil { + return true + } + if e, ok := err.(*Error); ok { + return e.IsNull() + } + return sqlNull(err) +} + +// IsRetryable checks if an error is retryable. +// For *Error, checks context for retry flag; for others, looks for "retry" or timeout in message. +// Returns false for nil errors; thread-safe for *Error types. +func IsRetryable(err error) bool { + if err == nil { + return false + } + if e, ok := err.(*Error); ok { + e.mu.RLock() + defer e.mu.RUnlock() + // Check smallContext directly if context map isn’t populated + for i := int32(0); i < e.smallCount; i++ { + if e.smallContext[i].key == ctxRetry { + if val, ok := e.smallContext[i].value.(bool); ok { + return val + } + } + } + // Check regular context + if e.context != nil { + if val, ok := e.context[ctxRetry].(bool); ok { + return val + } + } + // Check cause recursively + if e.cause != nil { + return IsRetryable(e.cause) + } + } + lowerMsg := strings.ToLower(err.Error()) + return IsTimeout(err) || strings.Contains(lowerMsg, "retry") +} + +// IsTimeout checks if an error indicates a timeout. +// For *Error, checks context for timeout flag; for others, looks for "timeout" in message. +// Returns false for nil errors. +func IsTimeout(err error) bool { + if err == nil { + return false + } + if e, ok := err.(*Error); ok { + if val, ok := e.Context()[ctxTimeout].(bool); ok { + return val + } + } + return strings.Contains(strings.ToLower(err.Error()), "timeout") +} + +// Merge combines multiple errors into a single *Error. +// Aggregates messages with "; " separator, merges contexts and stacks; returns nil if no errors provided. +func Merge(errs ...error) *Error { + if len(errs) == 0 { + return nil + } + var messages []string + combined := New("") + for _, err := range errs { + if err == nil { + continue + } + messages = append(messages, err.Error()) + if e, ok := err.(*Error); ok { + if e.stack != nil && combined.stack == nil { + combined.WithStack() // Capture stack from first *Error with stack + } + if ctx := e.Context(); ctx != nil { + for k, v := range ctx { + combined.With(k, v) + } + } + if e.cause != nil { + combined.Wrap(e.cause) + } + } else { + combined.Wrap(err) + } + } + if len(messages) > 0 { + combined.msg = strings.Join(messages, "; ") + } + return combined +} + +// Name returns the name of an error, if it is an *Error. +// Returns an empty string for non-*Error types or unset names. +func Name(err error) string { + if e, ok := err.(*Error); ok { + return e.name + } + return "" +} + +// UnwrapAll returns a slice of all errors in the chain, including the root error. +// Traverses both Unwrap() and Cause() chains; returns nil if err is nil. +func UnwrapAll(err error) []error { + if err == nil { + return nil + } + if e, ok := err.(*Error); ok { + return e.UnwrapAll() + } + var result []error + Walk(err, func(e error) { + result = append(result, e) + }) + return result +} + +// Stack extracts the stack trace from an error, if it is an *Error. +// Returns nil for non-*Error types or if no stack is present. +func Stack(err error) []string { + if e, ok := err.(*Error); ok { + return e.Stack() + } + return nil +} + +// Transform applies transformations to an error, returning a new *Error. +// Creates a new *Error from non-*Error types before applying fn; returns nil if err is nil. +func Transform(err error, fn func(*Error)) *Error { + if err == nil { + return nil + } + if e, ok := err.(*Error); ok { + newErr := e.Copy() + fn(newErr) + return newErr + } + // If not an *Error, create a new one and transform it + newErr := New(err.Error()) + fn(newErr) + return newErr +} + +// Unwrap returns the underlying cause of an error, if it implements Unwrap. +// For *Error, returns cause; for others, returns the error itself; nil if err is nil. +func Unwrap(err error) error { + for current := err; current != nil; { + if e, ok := current.(*Error); ok { + if e.cause == nil { + return current + } + current = e.cause + } else { + return current + } + } + return nil +} + +// Walk traverses the error chain, applying fn to each error. +// Supports both Unwrap() and Cause() interfaces; stops at nil or non-unwrappable errors. +func Walk(err error, fn func(error)) { + for current := err; current != nil; { + fn(current) + + // Attempt to unwrap using Unwrap() or Cause() + switch v := current.(type) { + case interface{ Unwrap() error }: + current = v.Unwrap() + case interface{ Cause() error }: + current = v.Cause() + default: + return + } + } +} + +// With adds a key-value pair to an error's context, if it is an *Error. +// Returns the original error unchanged if not an *Error; no-op for non-*Error types. +func With(err error, key string, value interface{}) error { + if e, ok := err.(*Error); ok { + return e.With(key, value) + } + return err +} + +// WithStack converts any error to an *Error and captures a stack trace. +// Returns nil if input is nil; adds stack to existing *Error or wraps non-*Error types. +func WithStack(err error) *Error { + if err == nil { + return nil + } + if e, ok := err.(*Error); ok { + return e.WithStack() + } + return New(err.Error()).WithStack().Wrap(err) +} + +// Wrap creates a new *Error that wraps another error with additional context. +// Uses a copy of the provided wrapper *Error; returns nil if err is nil. +func Wrap(err error, wrapper *Error) *Error { + if err == nil { + return nil + } + if wrapper == nil { + wrapper = newError() + } + newErr := wrapper.Copy() + newErr.cause = err + return newErr +} + +// Wrapf creates a new formatted *Error that wraps another error. +// Formats the message and sets the cause; returns nil if err is nil. +func Wrapf(err error, format string, args ...interface{}) *Error { + if err == nil { + return nil + } + e := newError() + e.msg = fmt.Sprintf(format, args...) + e.cause = err + return e +} diff --git a/vendor/github.com/olekukonko/errors/inspect.go b/vendor/github.com/olekukonko/errors/inspect.go new file mode 100644 index 0000000..c87def9 --- /dev/null +++ b/vendor/github.com/olekukonko/errors/inspect.go @@ -0,0 +1,225 @@ +// File: inspect.go +// Updated to support both error and *Error with delegation for cleaner *Error handling + +package errors + +import ( + stderrs "errors" + "fmt" + "strings" + "time" +) + +// Inspect provides detailed examination of an error, handling both single errors and MultiError +func Inspect(err error) { + if err == nil { + fmt.Println("No error occurred") + return + } + + fmt.Printf("\n=== Error Inspection ===\n") + fmt.Printf("Top-level error: %v\n", err) + fmt.Printf("Top-level error type: %T\n", err) + + // Handle *Error directly + if e, ok := err.(*Error); ok { + InspectError(e) + return + } + + // Handle MultiError + if multi, ok := err.(*MultiError); ok { + allErrors := multi.Errors() + fmt.Printf("\nContains %d errors:\n", len(allErrors)) + for i, e := range allErrors { + fmt.Printf("\n--- Error %d ---\n", i+1) + inspectSingleError(e) + } + } else { + // Inspect single error if not MultiError or *Error + fmt.Println("\n--- Details ---") + inspectSingleError(err) + } + + // Additional diagnostics + fmt.Println("\n--- Diagnostics ---") + if IsRetryable(err) { + fmt.Println("- Error chain contains retryable errors") + } + if IsTimeout(err) { + fmt.Println("- Error chain contains timeout errors") + } + if code := getErrorCode(err); code != 0 { + fmt.Printf("- Highest priority error code: %d\n", code) + } + fmt.Printf("========================\n\n") +} + +// InspectError provides detailed inspection of a specific *Error instance +func InspectError(err *Error) { + if err == nil { + fmt.Println("No error occurred") + return + } + + fmt.Printf("\n=== Error Inspection (*Error) ===\n") + fmt.Printf("Top-level error: %v\n", err) + fmt.Printf("Top-level error type: %T\n", err) + + fmt.Println("\n--- Details ---") + inspectSingleError(err) // Delegate to handle unwrapping and details + + // Additional diagnostics specific to *Error + fmt.Println("\n--- Diagnostics ---") + if IsRetryable(err) { + fmt.Println("- Error is retryable") + } + if IsTimeout(err) { + fmt.Println("- Error chain contains timeout errors") + } + if code := err.Code(); code != 0 { + fmt.Printf("- Error code: %d\n", code) + } + fmt.Printf("========================\n\n") +} + +// inspectSingleError handles inspection of a single error (may be part of a chain) +func inspectSingleError(err error) { + if err == nil { + fmt.Println(" (nil error)") + return + } + + fmt.Printf(" Error: %v\n", err) + fmt.Printf(" Type: %T\n", err) + + // Handle wrapped errors, including *Error type + var currentErr error = err + depth := 0 + for currentErr != nil { + prefix := strings.Repeat(" ", depth+1) + if depth > 0 { + fmt.Printf("%sWrapped Cause (%T): %v\n", prefix, currentErr, currentErr) + } + + // Check if it's our specific *Error type + if e, ok := currentErr.(*Error); ok { + if name := e.Name(); name != "" { + fmt.Printf("%sName: %s\n", prefix, name) + } + if cat := e.Category(); cat != "" { + fmt.Printf("%sCategory: %s\n", prefix, cat) + } + if code := e.Code(); code != 0 { + fmt.Printf("%sCode: %d\n", prefix, code) + } + if ctx := e.Context(); len(ctx) > 0 { + fmt.Printf("%sContext:\n", prefix) + for k, v := range ctx { + fmt.Printf("%s %s: %v\n", prefix, k, v) + } + } + if stack := e.Stack(); len(stack) > 0 { + fmt.Printf("%sStack (Top 3):\n", prefix) + limit := 3 + if len(stack) < limit { + limit = len(stack) + } + for i := 0; i < limit; i++ { + fmt.Printf("%s %s\n", prefix, stack[i]) + } + if len(stack) > limit { + fmt.Printf("%s ... (%d more frames)\n", prefix, len(stack)-limit) + } + } + } + + // Unwrap using standard errors.Unwrap and handle *Error Unwrap + var nextErr error + // Prioritize *Error's Unwrap if available AND it returns non-nil + if e, ok := currentErr.(*Error); ok { + unwrapped := e.Unwrap() + if unwrapped != nil { + nextErr = unwrapped + } else { + // If *Error.Unwrap returns nil, fall back to standard unwrap + // This handles cases where *Error might wrap a non-standard error + // or where its internal cause is deliberately nil. + nextErr = stderrs.Unwrap(currentErr) + } + } else { + nextErr = stderrs.Unwrap(currentErr) // Fall back to standard unwrap for non-*Error types + } + + // Prevent infinite loops if Unwrap returns the same error, or stop if no more unwrapping + if nextErr == currentErr || nextErr == nil { + break + } + currentErr = nextErr + depth++ + if depth > 10 { // Safety break for very deep or potentially cyclic chains + fmt.Printf("%s... (chain too deep or potential cycle)\n", strings.Repeat(" ", depth+1)) + break + } + } +} + +// getErrorCode traverses the error chain to find the highest priority code. +// It uses errors.As to find the first *Error in the chain. +func getErrorCode(err error) int { + var code int = 0 // Default code + var target *Error + if As(err, &target) { // Use the package's As helper + if target != nil { // Add nil check for safety + code = target.Code() + } + } + // If the top-level error is *Error and has a code, it might take precedence. + // This depends on desired logic. Let's keep it simple for now: first code found by As. + if code == 0 { // Only check top-level if As didn't find one with a code + if e, ok := err.(*Error); ok { + code = e.Code() + } + } + return code +} + +// handleError demonstrates using Inspect with additional handling logic +func handleError(err error) { + fmt.Println("\n=== Processing Failure ===") + Inspect(err) // Use the primary Inspect function + + // Additional handling based on inspection + code := getErrorCode(err) // Use the helper + + switch { + case IsTimeout(err): + fmt.Println("\nAction: Check connectivity or increase timeout") + case code == 402: // Check code obtained via helper + fmt.Println("\nAction: Payment processing failed - notify billing") + default: + fmt.Println("\nAction: Generic failure handling") + } +} + +// processOrder demonstrates Chain usage with Inspect +func processOrder() error { + validateInput := func() error { return nil } + processPayment := func() error { return stderrs.New("credit card declined") } + sendNotification := func() error { fmt.Println("Notification sent."); return nil } + logOrder := func() error { fmt.Println("Order logged."); return nil } + + chain := NewChain(ChainWithTimeout(2*time.Second)). + Step(validateInput).Tag("validation"). + Step(processPayment).Tag("billing").Code(402).Retry(3, 100*time.Millisecond, WithRetryIf(IsRetryable)). + Step(sendNotification).Optional(). + Step(logOrder) + + err := chain.Run() + if err != nil { + handleError(err) // Call the unified error handler + return err // Propagate the error if needed + } + fmt.Println("Order processed successfully!") + return nil +} diff --git a/vendor/github.com/olekukonko/errors/multi_error.go b/vendor/github.com/olekukonko/errors/multi_error.go new file mode 100644 index 0000000..1d3dff5 --- /dev/null +++ b/vendor/github.com/olekukonko/errors/multi_error.go @@ -0,0 +1,423 @@ +package errors + +import ( + "bytes" + "encoding/json" + "fmt" + "math/rand" + "strings" + "sync" + "sync/atomic" +) + +// MultiError represents a thread-safe collection of errors with enhanced features. +// Supports limits, sampling, and custom formatting for error aggregation. +type MultiError struct { + errors []error + mu sync.RWMutex + + // Configuration fields + limit int // Maximum number of errors to store (0 = unlimited) + formatter ErrorFormatter // Custom formatting function for error string + sampling bool // Whether sampling is enabled to limit error collection + sampleRate uint32 // Sampling percentage (1-100) when sampling is enabled + rand *rand.Rand // Random source for sampling (nil defaults to fastRand) +} + +// ErrorFormatter defines a function for custom error message formatting. +// Takes a slice of errors and returns a single formatted string. +type ErrorFormatter func([]error) string + +// MultiErrorOption configures MultiError behavior during creation. +type MultiErrorOption func(*MultiError) + +// NewMultiError creates a new MultiError instance with optional configuration. +// Initial capacity is set to 4; applies options in the order provided. +func NewMultiError(opts ...MultiErrorOption) *MultiError { + m := &MultiError{ + errors: make([]error, 0, 4), + limit: 0, // Unlimited by default + } + + for _, opt := range opts { + opt(m) + } + return m +} + +// Add appends an error to the collection with optional sampling, limit checks, and duplicate prevention. +// Ignores nil errors and duplicates based on string equality; thread-safe. +func (m *MultiError) Add(errs ...error) { + if len(errs) == 0 { + return + } + + m.mu.Lock() + defer m.mu.Unlock() + + for _, err := range errs { + if err == nil { + continue + } + + // Check for duplicates by comparing error messages + duplicate := false + for _, e := range m.errors { + if e.Error() == err.Error() { + duplicate = true + break + } + } + if duplicate { + continue + } + + // Apply sampling if enabled and collection isn’t empty + if m.sampling && len(m.errors) > 0 { + var r uint32 + if m.rand != nil { + r = uint32(m.rand.Int31n(100)) + } else { + r = fastRand() % 100 + } + if r > m.sampleRate { // Accept if random value is within sample rate + continue + } + } + + // Respect limit if set + if m.limit > 0 && len(m.errors) >= m.limit { + continue + } + + m.errors = append(m.errors, err) + } +} + +// Addf formats and adds a new error to the collection. +func (m *MultiError) Addf(format string, args ...interface{}) { + m.Add(Newf(format, args...)) +} + +// Clear removes all errors from the collection. +// Thread-safe; resets the slice while preserving capacity. +func (m *MultiError) Clear() { + m.mu.Lock() + defer m.mu.Unlock() + m.errors = m.errors[:0] +} + +// Count returns the number of errors in the collection. +// Thread-safe. +func (m *MultiError) Count() int { + m.mu.RLock() + defer m.mu.RUnlock() + return len(m.errors) +} + +// Error returns a formatted string representation of the errors. +// Returns empty string if no errors, single error message if one exists, +// or a formatted list using custom formatter or default if multiple; thread-safe. +func (m *MultiError) Error() string { + m.mu.RLock() + defer m.mu.RUnlock() + + switch len(m.errors) { + case 0: + return "" + case 1: + return m.errors[0].Error() + default: + if m.formatter != nil { + return m.formatter(m.errors) + } + return defaultFormat(m.errors) + } +} + +// Errors returns a copy of the contained errors. +// Thread-safe; returns nil if no errors exist. +func (m *MultiError) Errors() []error { + m.mu.RLock() + defer m.mu.RUnlock() + + if len(m.errors) == 0 { + return nil + } + errs := make([]error, len(m.errors)) + copy(errs, m.errors) + return errs +} + +// Filter returns a new MultiError containing only errors that match the predicate. +// Thread-safe; preserves original configuration including limit, formatter, and sampling. +func (m *MultiError) Filter(fn func(error) bool) *MultiError { + m.mu.RLock() + defer m.mu.RUnlock() + + var opts []MultiErrorOption + opts = append(opts, WithLimit(m.limit)) + if m.formatter != nil { + opts = append(opts, WithFormatter(m.formatter)) + } + if m.sampling { + opts = append(opts, WithSampling(m.sampleRate)) + } + + filtered := NewMultiError(opts...) + for _, err := range m.errors { + if fn(err) { + filtered.Add(err) + } + } + return filtered +} + +// First returns the first error in the collection, if any. +// Thread-safe; returns nil if the collection is empty. +func (m *MultiError) First() error { + m.mu.RLock() + defer m.mu.RUnlock() + if len(m.errors) > 0 { + return m.errors[0] + } + return nil +} + +// Has reports whether the collection contains any errors. +// Thread-safe. +func (m *MultiError) Has() bool { + m.mu.RLock() + defer m.mu.RUnlock() + return len(m.errors) > 0 +} + +// Last returns the most recently added error in the collection, if any. +// Thread-safe; returns nil if the collection is empty. +func (m *MultiError) Last() error { + m.mu.RLock() + defer m.mu.RUnlock() + if len(m.errors) > 0 { + return m.errors[len(m.errors)-1] + } + return nil +} + +// Merge combines another MultiError's errors into this one. +// Thread-safe; respects this instance’s limit and sampling settings; no-op if other is nil or empty. +func (m *MultiError) Merge(other *MultiError) { + if other == nil || !other.Has() { + return + } + + other.mu.RLock() + defer other.mu.RUnlock() + + for _, err := range other.errors { + m.Add(err) + } +} + +// IsNull checks if the MultiError is empty or contains only null errors. +// Returns true if empty or all errors are null (via IsNull() or empty message); thread-safe. +func (m *MultiError) IsNull() bool { + m.mu.RLock() + defer m.mu.RUnlock() + + // Fast path for empty MultiError + if len(m.errors) == 0 { + return true + } + + // Check each error for null status + allNull := true + for _, err := range m.errors { + switch e := err.(type) { + case interface{ IsNull() bool }: + if !e.IsNull() { + allNull = false + break + } + case nil: + continue + default: + if e.Error() != "" { + allNull = false + break + } + } + } + return allNull +} + +// Single returns nil if the collection is empty, the single error if only one exists, +// or the MultiError itself if multiple errors are present. +// Thread-safe; useful for unwrapping to a single error when possible. +func (m *MultiError) Single() error { + m.mu.RLock() + defer m.mu.RUnlock() + + switch len(m.errors) { + case 0: + return nil + case 1: + return m.errors[0] + default: + return m + } +} + +// String implements the Stringer interface for a concise string representation. +// Thread-safe; delegates to Error() for formatting. +func (m *MultiError) String() string { + return m.Error() +} + +// Unwrap returns a copy of the contained errors for multi-error unwrapping. +// Implements the errors.Unwrap interface; thread-safe; returns nil if empty. +func (m *MultiError) Unwrap() []error { + return m.Errors() +} + +// WithFormatter sets a custom error formatting function. +// Returns a MultiErrorOption for use with NewMultiError; overrides default formatting. +func WithFormatter(f ErrorFormatter) MultiErrorOption { + return func(m *MultiError) { + m.formatter = f + } +} + +// WithLimit sets the maximum number of errors to store. +// Returns a MultiErrorOption for use with NewMultiError; 0 means unlimited, negative values are ignored. +func WithLimit(n int) MultiErrorOption { + return func(m *MultiError) { + if n < 0 { + n = 0 // Ensure non-negative limit + } + m.limit = n + } +} + +// WithSampling enables error sampling with a specified rate (1-100). +// Returns a MultiErrorOption for use with NewMultiError; caps rate at 100 for validity. +func WithSampling(rate uint32) MultiErrorOption { + return func(m *MultiError) { + if rate > 100 { + rate = 100 + } + m.sampling = true + m.sampleRate = rate + } +} + +// WithRand sets a custom random source for sampling, useful for testing. +// Returns a MultiErrorOption for use with NewMultiError; defaults to fastRand if nil. +func WithRand(r *rand.Rand) MultiErrorOption { + return func(m *MultiError) { + m.rand = r + } +} + +// MarshalJSON serializes the MultiError to JSON, including all contained errors and configuration metadata. +// Thread-safe; errors are serialized using their MarshalJSON method if available, otherwise as strings. +func (m *MultiError) MarshalJSON() ([]byte, error) { + m.mu.RLock() + defer m.mu.RUnlock() + + // Get buffer from pool for efficiency + buf := jsonBufferPool.Get().(*bytes.Buffer) + defer jsonBufferPool.Put(buf) + buf.Reset() + + // Create encoder + enc := json.NewEncoder(buf) + enc.SetEscapeHTML(false) + + // Define JSON structure + type jsonError struct { + Error interface{} `json:"error"` // Holds either JSON-marshaled error or string + } + + je := struct { + Count int `json:"count"` // Number of errors + Limit int `json:"limit,omitempty"` // Maximum error limit (omitted if 0) + Sampling bool `json:"sampling,omitempty"` // Whether sampling is enabled + SampleRate uint32 `json:"sample_rate,omitempty"` // Sampling rate (1-100, omitted if not sampling) + Errors []jsonError `json:"errors"` // List of errors + }{ + Count: len(m.errors), + Limit: m.limit, + Sampling: m.sampling, + SampleRate: m.sampleRate, + } + + // Serialize each error + je.Errors = make([]jsonError, len(m.errors)) + for i, err := range m.errors { + if err == nil { + je.Errors[i] = jsonError{Error: nil} + continue + } + // Check if the error implements json.Marshaler + if marshaler, ok := err.(json.Marshaler); ok { + marshaled, err := marshaler.MarshalJSON() + if err != nil { + // Fallback to string if marshaling fails + je.Errors[i] = jsonError{Error: err.Error()} + } else { + var raw json.RawMessage = marshaled + je.Errors[i] = jsonError{Error: raw} + } + } else { + // Use error string for non-marshaler errors + je.Errors[i] = jsonError{Error: err.Error()} + } + } + + // Encode JSON + if err := enc.Encode(je); err != nil { + return nil, fmt.Errorf("failed to marshal MultiError: %v", err) + } + + // Remove trailing newline + result := buf.Bytes() + if len(result) > 0 && result[len(result)-1] == '\n' { + result = result[:len(result)-1] + } + return result, nil +} + +// defaultFormat provides the default formatting for multiple errors. +// Returns a semicolon-separated list prefixed with the error count (e.g., "errors(3): err1; err2; err3"). +func defaultFormat(errs []error) string { + var sb strings.Builder + sb.WriteString(fmt.Sprintf("errors(%d): ", len(errs))) + for i, err := range errs { + if i > 0 { + sb.WriteString("; ") + } + sb.WriteString(err.Error()) + } + return sb.String() +} + +// fastRand generates a quick pseudo-random number for sampling. +// Uses a simple xorshift algorithm based on the current time; not cryptographically secure. +var fastRandState uint32 = 1 // Must be non-zero + +func fastRand() uint32 { + for { + // Atomically load the current state + old := atomic.LoadUint32(&fastRandState) + // Xorshift computation + x := old + x ^= x << 13 + x ^= x >> 17 + x ^= x << 5 + // Attempt to store the new state atomically + if atomic.CompareAndSwapUint32(&fastRandState, old, x) { + return x + } + // Otherwise retry + } +} diff --git a/vendor/github.com/olekukonko/errors/pool.go b/vendor/github.com/olekukonko/errors/pool.go new file mode 100644 index 0000000..37515aa --- /dev/null +++ b/vendor/github.com/olekukonko/errors/pool.go @@ -0,0 +1,75 @@ +// pool.go +package errors + +import ( + "sync" + "sync/atomic" +) + +// ErrorPool is a high-performance, thread-safe pool for reusing *Error instances. +// Reduces allocation overhead by recycling errors; tracks hit/miss statistics. +type ErrorPool struct { + pool sync.Pool // Underlying pool for storing *Error instances + poolStats struct { // Embedded struct for pool usage statistics + hits atomic.Int64 // Number of times an error was reused from the pool + misses atomic.Int64 // Number of times a new error was created due to pool miss + } +} + +// NewErrorPool creates a new ErrorPool instance. +// Initializes the pool with a New function that returns a fresh *Error with default smallContext. +func NewErrorPool() *ErrorPool { + return &ErrorPool{ + pool: sync.Pool{ + New: func() interface{} { + return &Error{ + smallContext: [contextSize]contextItem{}, + } + }, + }, + } +} + +// Get retrieves an *Error from the pool or creates a new one if pooling is disabled or pool is empty. +// Resets are handled by Put; thread-safe; updates hit/miss stats when pooling is enabled. +func (ep *ErrorPool) Get() *Error { + if currentConfig.disablePooling { + return &Error{ + smallContext: [contextSize]contextItem{}, + } + } + + e := ep.pool.Get().(*Error) + if e == nil { // Pool returned nil (unlikely due to New func, but handled for safety) + ep.poolStats.misses.Add(1) + return &Error{ + smallContext: [contextSize]contextItem{}, + } + } + ep.poolStats.hits.Add(1) + return e +} + +// Put returns an *Error to the pool after resetting it. +// Ignores nil errors or if pooling is disabled; preserves stack capacity; thread-safe. +func (ep *ErrorPool) Put(e *Error) { + if e == nil || currentConfig.disablePooling { + return + } + + // Reset the error to a clean state, preserving capacity + e.Reset() + + // Reset stack length while keeping capacity for reuse + if e.stack != nil { + e.stack = e.stack[:0] + } + + ep.pool.Put(e) +} + +// Stats returns the current pool statistics as hits and misses. +// Thread-safe; uses atomic loads to ensure accurate counts. +func (ep *ErrorPool) Stats() (hits, misses int64) { + return ep.poolStats.hits.Load(), ep.poolStats.misses.Load() +} diff --git a/vendor/github.com/olekukonko/errors/pool_above_1_24.go b/vendor/github.com/olekukonko/errors/pool_above_1_24.go new file mode 100644 index 0000000..706550f --- /dev/null +++ b/vendor/github.com/olekukonko/errors/pool_above_1_24.go @@ -0,0 +1,24 @@ +//go:build go1.24 +// +build go1.24 + +package errors + +import "runtime" + +// setupCleanup configures a cleanup function for an *Error to auto-return it to the pool. +// Only active for Go 1.24+; uses runtime.AddCleanup when autoFree is set and pooling is enabled. +func (ep *ErrorPool) setupCleanup(e *Error) { + if currentConfig.autoFree { + runtime.AddCleanup(e, func(_ *struct{}) { + if !currentConfig.disablePooling { + ep.Put(e) // Return to pool when cleaned up + } + }, nil) // No additional context needed + } +} + +// clearCleanup is a no-op for Go 1.24 and above. +// Cleanup is managed by runtime.AddCleanup; no explicit removal is required. +func (ep *ErrorPool) clearCleanup(e *Error) { + // No-op for Go 1.24+ +} diff --git a/vendor/github.com/olekukonko/errors/pool_below_1_24.go b/vendor/github.com/olekukonko/errors/pool_below_1_24.go new file mode 100644 index 0000000..3c94209 --- /dev/null +++ b/vendor/github.com/olekukonko/errors/pool_below_1_24.go @@ -0,0 +1,24 @@ +//go:build !go1.24 +// +build !go1.24 + +package errors + +import "runtime" + +// setupCleanup configures a finalizer for an *Error to auto-return it to the pool. +// Only active for Go versions < 1.24; enables automatic cleanup when autoFree is set and pooling is enabled. +func (ep *ErrorPool) setupCleanup(e *Error) { + if currentConfig.autoFree { + runtime.SetFinalizer(e, func(e *Error) { + if !currentConfig.disablePooling { + ep.Put(e) // Return to pool when garbage collected + } + }) + } +} + +// clearCleanup removes any finalizer set on an *Error. +// Only active for Go versions < 1.24; ensures no cleanup action occurs on garbage collection. +func (ep *ErrorPool) clearCleanup(e *Error) { + runtime.SetFinalizer(e, nil) // Disable finalizer +} diff --git a/vendor/github.com/olekukonko/errors/retry.go b/vendor/github.com/olekukonko/errors/retry.go new file mode 100644 index 0000000..6d6df38 --- /dev/null +++ b/vendor/github.com/olekukonko/errors/retry.go @@ -0,0 +1,368 @@ +// Package errors provides utilities for error handling, including a flexible retry mechanism. +package errors + +import ( + "context" + "math/rand" + "time" +) + +// BackoffStrategy defines the interface for calculating retry delays. +type BackoffStrategy interface { + // Backoff returns the delay for a given attempt based on the base delay. + Backoff(attempt int, baseDelay time.Duration) time.Duration +} + +// ConstantBackoff provides a fixed delay for each retry attempt. +type ConstantBackoff struct{} + +// Backoff returns the base delay regardless of the attempt number. +// Implements BackoffStrategy with a constant delay. +func (c ConstantBackoff) Backoff(_ int, baseDelay time.Duration) time.Duration { + return baseDelay +} + +// ExponentialBackoff provides an exponentially increasing delay for retry attempts. +type ExponentialBackoff struct{} + +// Backoff returns a delay that doubles with each attempt, starting from the base delay. +// Uses bit shifting for efficient exponential growth (e.g., baseDelay * 2^(attempt-1)). +func (e ExponentialBackoff) Backoff(attempt int, baseDelay time.Duration) time.Duration { + if attempt <= 1 { + return baseDelay + } + return baseDelay * time.Duration(1< 0 && delay > r.maxDelay { + delay = r.maxDelay + } + if r.jitter { + delay = addJitter(delay) + } + + // Wait with context + select { + case <-r.ctx.Done(): + return r.ctx.Err() + case <-time.After(delay): + } + } + + return lastErr +} + +// ExecuteContext runs the provided function with retry logic, respecting context cancellation. +// Returns nil on success or the last error if all attempts fail or context is cancelled. +func (r *Retry) ExecuteContext(ctx context.Context, fn func() error) error { + var lastErr error + + // If the retry instance already has a context, use it. Otherwise, use the provided one. + // If both are provided, maybe create a derived context? For now, prioritize the one from WithContext. + execCtx := r.ctx + if execCtx == context.Background() && ctx != nil { // Use provided ctx if retry ctx is default and provided one isn't nil + execCtx = ctx + } else if ctx == nil { // Ensure we always have a non-nil context + execCtx = context.Background() + } + // Note: This logic might need refinement depending on how contexts should interact. + // A safer approach might be: if r.ctx != background, use it. Else use provided ctx. + + for attempt := 1; attempt <= r.maxAttempts; attempt++ { + // Check context before executing the function + select { + case <-execCtx.Done(): + return execCtx.Err() // Return context error immediately + default: + // Context is okay, proceed + } + + err := fn() + if err == nil { + return nil // Success + } + + // Check if retry is applicable based on the error + if r.retryIf != nil && !r.retryIf(err) { + return err // Not retryable, return the error + } + + lastErr = err // Store the last encountered error + + // Execute the OnRetry callback if configured + if r.onRetry != nil { + r.onRetry(attempt, err) + } + + // Exit loop if this was the last attempt + if attempt == r.maxAttempts { + break + } + + // --- Calculate and apply delay --- + currentDelay := r.backoff.Backoff(attempt, r.delay) + if r.maxDelay > 0 && currentDelay > r.maxDelay { // Check maxDelay > 0 before capping + currentDelay = r.maxDelay + } + if r.jitter { + currentDelay = addJitter(currentDelay) + } + if currentDelay < 0 { // Ensure delay isn't negative after jitter + currentDelay = 0 + } + // --- Wait for the delay or context cancellation --- + select { + case <-execCtx.Done(): + // If context is cancelled during the wait, return the context error + // Often more informative than returning the last application error. + return execCtx.Err() + case <-time.After(currentDelay): + // Wait finished, continue to the next attempt + } + } + + // All attempts failed, return the last error encountered + return lastErr +} + +// Transform creates a new Retry instance with modified configuration. +// Copies all settings from the original Retry and applies the given options. +func (r *Retry) Transform(opts ...RetryOption) *Retry { + newRetry := &Retry{ + maxAttempts: r.maxAttempts, + delay: r.delay, + maxDelay: r.maxDelay, + retryIf: r.retryIf, + onRetry: r.onRetry, + backoff: r.backoff, + jitter: r.jitter, + ctx: r.ctx, + } + for _, opt := range opts { + opt(newRetry) + } + return newRetry +} + +// WithBackoff sets the backoff strategy using the BackoffStrategy interface. +// Returns a RetryOption; no-op if strategy is nil, retaining the existing strategy. +func WithBackoff(strategy BackoffStrategy) RetryOption { + return func(r *Retry) { + if strategy != nil { + r.backoff = strategy + } + } +} + +// WithContext sets the context for cancellation and deadlines. +// Returns a RetryOption; retains context.Background if ctx is nil. +func WithContext(ctx context.Context) RetryOption { + return func(r *Retry) { + if ctx != nil { + r.ctx = ctx + } + } +} + +// WithDelay sets the initial delay between retries. +// Returns a RetryOption; ensures non-negative delay by setting negatives to 0. +func WithDelay(delay time.Duration) RetryOption { + return func(r *Retry) { + if delay < 0 { + delay = 0 + } + r.delay = delay + } +} + +// WithJitter enables or disables jitter in the backoff delay. +// Returns a RetryOption; toggles random delay variation. +func WithJitter(jitter bool) RetryOption { + return func(r *Retry) { + r.jitter = jitter + } +} + +// WithMaxAttempts sets the maximum number of retry attempts. +// Returns a RetryOption; ensures at least 1 attempt by adjusting lower values. +func WithMaxAttempts(maxAttempts int) RetryOption { + return func(r *Retry) { + if maxAttempts < 1 { + maxAttempts = 1 + } + r.maxAttempts = maxAttempts + } +} + +// WithMaxDelay sets the maximum delay between retries. +// Returns a RetryOption; ensures non-negative delay by setting negatives to 0. +func WithMaxDelay(maxDelay time.Duration) RetryOption { + return func(r *Retry) { + if maxDelay < 0 { + maxDelay = 0 + } + r.maxDelay = maxDelay + } +} + +// WithOnRetry sets a callback to execute after each failed attempt. +// Returns a RetryOption; callback receives attempt number and error. +func WithOnRetry(onRetry func(attempt int, err error)) RetryOption { + return func(r *Retry) { + r.onRetry = onRetry + } +} + +// WithRetryIf sets the condition under which to retry. +// Returns a RetryOption; retains IsRetryable default if retryIf is nil. +func WithRetryIf(retryIf func(error) bool) RetryOption { + return func(r *Retry) { + if retryIf != nil { + r.retryIf = retryIf + } + } +} + +// ExecuteReply runs the provided function with retry logic and returns its result. +// Returns the result and nil on success, or zero value and last error on failure; generic type T. +func ExecuteReply[T any](r *Retry, fn func() (T, error)) (T, error) { + var lastErr error + var zero T + + for attempt := 1; attempt <= r.maxAttempts; attempt++ { + result, err := fn() + if err == nil { + return result, nil + } + + // Check if retry is applicable; return immediately if not retryable + if r.retryIf != nil && !r.retryIf(err) { + return zero, err + } + + lastErr = err + if r.onRetry != nil { + r.onRetry(attempt, err) + } + + if attempt == r.maxAttempts { + break + } + + // Calculate delay with backoff, cap at maxDelay, and apply jitter if enabled + currentDelay := r.backoff.Backoff(attempt, r.delay) + if currentDelay > r.maxDelay { + currentDelay = r.maxDelay + } + if r.jitter { + currentDelay = addJitter(currentDelay) + } + + // Wait with respect to context cancellation or timeout + select { + case <-r.ctx.Done(): + return zero, r.ctx.Err() + case <-time.After(currentDelay): + } + } + return zero, lastErr +} diff --git a/vendor/github.com/olekukonko/errors/utils.go b/vendor/github.com/olekukonko/errors/utils.go new file mode 100644 index 0000000..bb6753d --- /dev/null +++ b/vendor/github.com/olekukonko/errors/utils.go @@ -0,0 +1,153 @@ +// Package errors provides utility functions for error handling, including stack +// trace capture and function name extraction. +package errors + +import ( + "database/sql" + "fmt" + "reflect" + "runtime" + "strings" +) + +// captureStack captures a stack trace with the configured depth. +// Skip=0 captures the current call site; skips captureStack and its caller (+2 frames); thread-safe via stackPool. +func captureStack(skip int) []uintptr { + buf := stackPool.Get().([]uintptr) + buf = buf[:cap(buf)] + + // +2 to skip captureStack and the immediate caller + n := runtime.Callers(skip+2, buf) + if n == 0 { + stackPool.Put(buf) + return nil + } + + // Create a new slice to return, avoiding direct use of pooled memory + stack := make([]uintptr, n) + copy(stack, buf[:n]) + stackPool.Put(buf) + + return stack +} + +// min returns the smaller of two integers. +// Simple helper for limiting stack trace size or other comparisons. +func min(a, b int) int { + if a < b { + return a + } + return b +} + +// clearMap removes all entries from a map. +// Helper function to reset map contents without reallocating. +func clearMap(m map[string]interface{}) { + for k := range m { + delete(m, k) + } +} + +// sqlNull detects if a value represents a SQL NULL type. +// Returns true for nil or invalid sql.Null* types (e.g., NullString, NullInt64); false otherwise. +func sqlNull(v interface{}) bool { + if v == nil { + return true + } + + switch val := v.(type) { + case sql.NullString: + return !val.Valid + case sql.NullTime: + return !val.Valid + case sql.NullInt64: + return !val.Valid + case sql.NullBool: + return !val.Valid + case sql.NullFloat64: + return !val.Valid + default: + return false + } +} + +// getFuncName extracts the function name from an interface, typically a function or method. +// Returns "unknown" if the input is nil or invalid; trims leading dots from runtime name. +func getFuncName(fn interface{}) string { + if fn == nil { + return "unknown" + } + fullName := runtime.FuncForPC(reflect.ValueOf(fn).Pointer()).Name() + return strings.TrimPrefix(fullName, ".") +} + +// isInternalFrame determines if a stack frame is considered "internal". +// Returns true for frames from runtime, reflect, or this package’s subdirectories if FilterInternal is true. +func isInternalFrame(frame runtime.Frame) bool { + if strings.HasPrefix(frame.Function, "runtime.") || strings.HasPrefix(frame.Function, "reflect.") { + return true + } + + suffixes := []string{ + "errors", + "utils", + "helper", + "retry", + "multi", + } + + file := frame.File + for _, v := range suffixes { + if strings.Contains(file, fmt.Sprintf("github.com/olekukonko/errors/%s", v)) { + return true + } + } + return false +} + +// FormatError returns a formatted string representation of an error. +// Includes message, name, context, stack trace, and cause for *Error types; just message for others; "" if nil. +func FormatError(err error) string { + if err == nil { + return "" + } + var sb strings.Builder + if e, ok := err.(*Error); ok { + sb.WriteString(fmt.Sprintf("Error: %s\n", e.Error())) + if e.name != "" { + sb.WriteString(fmt.Sprintf("Name: %s\n", e.name)) + } + if ctx := e.Context(); len(ctx) > 0 { + sb.WriteString("Context:\n") + for k, v := range ctx { + sb.WriteString(fmt.Sprintf("\t%s: %v\n", k, v)) + } + } + if stack := e.Stack(); len(stack) > 0 { + sb.WriteString("Stack Trace:\n") + for _, frame := range stack { + sb.WriteString(fmt.Sprintf("\t%s\n", frame)) + } + } + if e.cause != nil { + sb.WriteString(fmt.Sprintf("Caused by: %s\n", FormatError(e.cause))) + } + } else { + sb.WriteString(fmt.Sprintf("Error: %s\n", err.Error())) + } + return sb.String() +} + +// Caller returns the file, line, and function name of the caller at the specified skip level. +// Skip=0 returns the caller of this function, 1 returns its caller, etc.; returns "unknown" if no caller found. +func Caller(skip int) (file string, line int, function string) { + configMu.RLock() + defer configMu.RUnlock() + var pcs [1]uintptr + n := runtime.Callers(skip+2, pcs[:]) // +2 skips Caller and its immediate caller + if n == 0 { + return "", 0, "unknown" + } + frame, _ := runtime.CallersFrames(pcs[:n]).Next() + return frame.File, frame.Line, frame.Function +} diff --git a/vendor/github.com/olekukonko/ll/.gitignore b/vendor/github.com/olekukonko/ll/.gitignore new file mode 100644 index 0000000..70d0877 --- /dev/null +++ b/vendor/github.com/olekukonko/ll/.gitignore @@ -0,0 +1,5 @@ +.idea +lab +tmp +#_* +_test/ diff --git a/vendor/github.com/olekukonko/ll/LICENSE b/vendor/github.com/olekukonko/ll/LICENSE new file mode 100644 index 0000000..ca02db8 --- /dev/null +++ b/vendor/github.com/olekukonko/ll/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Oleku Konko + +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. diff --git a/vendor/github.com/olekukonko/ll/README.md b/vendor/github.com/olekukonko/ll/README.md new file mode 100644 index 0000000..c9a0205 --- /dev/null +++ b/vendor/github.com/olekukonko/ll/README.md @@ -0,0 +1,359 @@ +# ll - A Modern Structured Logging Library for Go + +`ll` is a high-performance, production-ready logging library for Go, designed to provide **hierarchical namespaces**, **structured logging**, **middleware pipelines**, **conditional logging**, and support for multiple output formats, including text, JSON, colorized logs, and compatibility with Go’s `slog`. It’s ideal for applications requiring fine-grained log control, extensibility, and scalability. + +## Key Features + +- **Hierarchical Namespaces**: Organize logs with fine-grained control over subsystems (e.g., "app/db"). +- **Structured Logging**: Add key-value metadata for machine-readable logs. +- **Middleware Pipeline**: Customize log processing with error-based rejection. +- **Conditional Logging**: Optimize performance by skipping unnecessary log operations. +- **Multiple Output Formats**: Support for text, JSON, colorized logs, and `slog` integration. +- **Debugging Utilities**: Inspect variables (`Dbg`), binary data (`Dump`), and stack traces (`Stack`). +- **Thread-Safe**: Built for concurrent use with mutex-protected state. +- **Performance Optimized**: Minimal allocations and efficient namespace caching. + +## Installation + +Install `ll` using Go modules: + +```bash +go get github.com/olekukonko/ll +``` + +Ensure you have Go 1.21 or later for optimal compatibility. + +## Getting Started + +Here’s a quick example to start logging with `ll`: + + +```go +package main + +import ( + "github.com/olekukonko/ll" +) + +func main() { + // Create a logger with namespace "app" + logger := ll.New("") + + // enable output + logger.Enable() + + // Basic log + logger.Info("Welcome") // Output: [app] INFO: Application started + + logger = logger.Namespace("app") + + // Basic log + logger.Info("start at :8080") // Output: [app] INFO: Application started + + //Output + //INFO: Welcome + //[app] INFO: start at :8080 +} + +``` + +```go +package main + +import ( + "github.com/olekukonko/ll" + "github.com/olekukonko/ll/lh" + "os" +) + +func main() { + // Chaining + logger := ll.New("app").Enable().Handler(lh.NewTextHandler(os.Stdout)) + + // Basic log + logger.Info("Application started") // Output: [app] INFO: Application started + + // Structured log with fields + logger.Fields("user", "alice", "status", 200).Info("User logged in") + // Output: [app] INFO: User logged in [user=alice status=200] + + // Conditional log + debugMode := false + logger.If(debugMode).Debug("Debug info") // No output (debugMode is false) +} +``` + +## Core Features + +### 1. Hierarchical Namespaces + +Namespaces allow you to organize logs hierarchically, enabling precise control over logging for different parts of your application. This is especially useful for large systems with multiple components. + +**Benefits**: +- **Granular Control**: Enable/disable logs for specific subsystems (e.g., "app/db" vs. "app/api"). +- **Scalability**: Manage log volume in complex applications. +- **Readability**: Clear namespace paths improve traceability. + +**Example**: +```go +logger := ll.New("app").Enable().Handler(lh.NewTextHandler(os.Stdout)) + +// Child loggers +dbLogger := logger.Namespace("db") +apiLogger := logger.Namespace("api").Style(lx.NestedPath) + +// Namespace control +logger.NamespaceEnable("app/db") // Enable DB logs +logger.NamespaceDisable("app/api") // Disable API logs + +dbLogger.Info("Query executed") // Output: [app/db] INFO: Query executed +apiLogger.Info("Request received") // No output +``` + +### 2. Structured Logging + +Add key-value metadata to logs for machine-readable output, making it easier to query and analyze logs in tools like ELK or Grafana. + +**Example**: +```go +logger := ll.New("app").Enable().Handler(lh.NewTextHandler(os.Stdout)) + +// Variadic fields +logger.Fields("user", "bob", "status", 200).Info("Request completed") +// Output: [app] INFO: Request completed [user=bob status=200] + +// Map-based fields +logger.Field(map[string]interface{}{"method": "GET"}).Info("Request") +// Output: [app] INFO: Request [method=GET] +``` + +### 3. Middleware Pipeline + +Customize log processing with a middleware pipeline. Middleware functions can enrich, filter, or transform logs, using an error-based rejection mechanism (non-nil errors stop logging). + +**Example**: +```go +logger := ll.New("app").Enable().Handler(lh.NewTextHandler(os.Stdout)) + +// Enrich logs with app metadata +logger.Use(ll.FuncMiddleware(func(e *lx.Entry) error { + if e.Fields == nil { + e.Fields = make(map[string]interface{}) + } + e.Fields["app"] = "myapp" + return nil +})) + +// Filter low-level logs +logger.Use(ll.FuncMiddleware(func(e *lx.Entry) error { + if e.Level < lx.LevelWarn { + return fmt.Errorf("level too low") + } + return nil +})) + +logger.Info("Ignored") // No output (filtered) +logger.Warn("Warning") // Output: [app] WARN: Warning [app=myapp] +``` + +### 4. Conditional Logging + +Optimize performance by skipping expensive log operations when conditions are false, ideal for production environments. + +**Example**: +```go +logger := ll.New("app").Enable().Handler(lh.NewTextHandler(os.Stdout)) + +featureEnabled := true +logger.If(featureEnabled).Fields("action", "update").Info("Feature used") +// Output: [app] INFO: Feature used [action=update] + +logger.If(false).Info("Ignored") // No output, no processing +``` + +### 5. Multiple Output Formats + +`ll` supports various output formats, including human-readable text, colorized logs, JSON, and integration with Go’s `slog` package. + +**Example**: +```go +logger := ll.New("app").Enable() + +// Text output +logger.Handler(lh.NewTextHandler(os.Stdout)) +logger.Info("Text log") // Output: [app] INFO: Text log + +// JSON output +logger.Handler(lh.NewJSONHandler(os.Stdout, time.RFC3339Nano)) +logger.Info("JSON log") // Output: {"timestamp":"...","level":"INFO","message":"JSON log","namespace":"app"} + +// Slog integration +slogText := slog.NewTextHandler(os.Stdout, nil) +logger.Handler(lh.NewSlogHandler(slogText)) +logger.Info("Slog log") // Output: level=INFO msg="Slog log" namespace=app class=Text +``` + +### 6. Debugging Utilities + +`ll` provides powerful tools for debugging, including variable inspection, binary data dumps, and stack traces. + +#### Core Debugging Methods + +1. **Dbg - Contextual Inspection** + Inspects variables with file and line context, preserving variable names and handling all Go types. + ```go + x := 42 + user := struct{ Name string }{"Alice"} + ll.Dbg(x) // Output: [file.go:123] x = 42 + ll.Dbg(user) // Output: [file.go:124] user = [Name:Alice] + ``` + +2. **Dump - Binary Inspection** + Displays a hex/ASCII view of data, optimized for strings, bytes, and complex types (with JSON fallback). + ```go + ll.Handler(lh.NewColorizedHandler(os.Stdout)) + ll.Dump("hello\nworld") // Output: Hex/ASCII dump (see example/dump.png) + ``` + +3. **Stack - Stack Inspection** + Logs a stack trace for debugging critical errors. + ```go + ll.Handler(lh.NewColorizedHandler(os.Stdout)) + ll.Stack("Critical error") // Output: [app] ERROR: Critical error [stack=...] (see example/stack.png) + ``` + +#### Performance Tracking +Measure execution time for performance analysis. +```go +// Automatic measurement +defer ll.Measure(func() { time.Sleep(time.Millisecond) })() +// Output: [app] INFO: function executed [duration=~1ms] + +// Explicit benchmarking +start := time.Now() +time.Sleep(time.Millisecond) +ll.Benchmark(start) // Output: [app] INFO: benchmark [start=... end=... duration=...] +``` + +**Performance Notes**: +- `Dbg` calls are disabled at compile-time when not enabled. +- `Dump` optimizes for primitive types, strings, and bytes with zero-copy paths. +- Stack traces are configurable via `StackSize`. + +## Real-World Example: Web Server + +A practical example of using `ll` in a web server with structured logging, middleware, and `slog` integration: + +```go +package main + +import ( + "github.com/olekukonko/ll" + "github.com/olekukonko/ll/lh" + "log/slog" + "net/http" + "os" + "time" +) + +func main() { + // Initialize logger with slog handler + slogHandler := slog.NewJSONHandler(os.Stdout, nil) + logger := ll.New("server").Enable().Handler(lh.NewSlogHandler(slogHandler)) + + // HTTP child logger + httpLogger := logger.Namespace("http").Style(lx.NestedPath) + + // Middleware for request ID + httpLogger.Use(ll.FuncMiddleware(func(e *lx.Entry) error { + if e.Fields == nil { + e.Fields = make(map[string]interface{}) + } + e.Fields["request_id"] = "req-" + time.Now().String() + return nil + })) + + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + start := time.Now() + httpLogger.Fields("method", r.Method, "path", r.URL.Path).Info("Request received") + w.Write([]byte("Hello, world!")) + httpLogger.Fields("duration_ms", time.Since(start).Milliseconds()).Info("Request completed") + }) + + logger.Info("Starting server on :8080") + http.ListenAndServe(":8080", nil) +} +``` + +**Sample Output (JSON via slog)**: +```json +{"level":"INFO","msg":"Starting server on :8080","namespace":"server"} +{"level":"INFO","msg":"Request received","namespace":"server/http","class":"Text","method":"GET","path":"/","request_id":"req-..."} +{"level":"INFO","msg":"Request completed","namespace":"server/http","class":"Text","duration_ms":1,"request_id":"req-..."} +``` + +## Why Choose `ll`? + +- **Granular Control**: Hierarchical namespaces for precise log management. +- **Performance**: Conditional logging and optimized concatenation reduce overhead. +- **Extensibility**: Middleware pipeline for custom log processing. +- **Structured Output**: Machine-readable logs with key-value metadata. +- **Flexible Formats**: Text, JSON, colorized, and `slog` support. +- **Debugging Power**: Advanced tools like `Dbg`, `Dump`, and `Stack` for deep inspection. +- **Thread-Safe**: Safe for concurrent use in high-throughput applications. + +## Comparison with Other Libraries + +| Feature | `ll` | `log` (stdlib) | `slog` (stdlib) | `zap` | +|--------------------------|--------------------------|----------------|-----------------|-------------------| +| Hierarchical Namespaces | ✅ | ❌ | ❌ | ❌ | +| Structured Logging | ✅ (Fields, Context) | ❌ | ✅ | ✅ | +| Middleware Pipeline | ✅ | ❌ | ❌ | ✅ (limited) | +| Conditional Logging | ✅ (If, IfOne, IfAny) | ❌ | ❌ | ❌ | +| Slog Compatibility | ✅ | ❌ | ✅ (native) | ❌ | +| Debugging (Dbg, Dump) | ✅ | ❌ | ❌ | ❌ | +| Performance (disabled logs) | High (conditional) | Low | Medium | High | +| Output Formats | Text, JSON, Color, Slog | Text | Text, JSON | JSON, Text | + +## Benchmarks + +`ll` is optimized for performance, particularly for disabled logs and structured logging: +- **Disabled Logs**: 30% faster than `slog` due to efficient conditional checks. +- **Structured Logging**: 2x faster than `log` with minimal allocations. +- **Namespace Caching**: Reduces overhead for hierarchical lookups. + +See `ll_bench_test.go` for detailed benchmarks on namespace creation, cloning, and field building. + +## Testing and Stability + +The `ll` library includes a comprehensive test suite (`ll_test.go`) covering: +- Logger configuration, namespaces, and conditional logging. +- Middleware, rate limiting, and sampling. +- Handler output formats (text, JSON, slog). +- Debugging utilities (`Dbg`, `Dump`, `Stack`). + +Recent improvements: +- Fixed sampling middleware for reliable behavior at edge cases (0.0 and 1.0 rates). +- Enhanced documentation across `conditional.go`, `field.go`, `global.go`, `ll.go`, `lx.go`, and `ns.go`. +- Added `slog` compatibility via `lh.SlogHandler`. + +## Contributing + +Contributions are welcome! To contribute: +1. Fork the repository: `github.com/olekukonko/ll`. +2. Create a feature branch: `git checkout -b feature/your-feature`. +3. Commit changes: `git commit -m "Add your feature"`. +4. Push to the branch: `git push origin feature/your-feature`. +5. Open a pull request with a clear description. + +Please include tests in `ll_test.go` and update documentation as needed. Follow the Go coding style and run `go test ./...` before submitting. + +## License + +`ll` is licensed under the MIT License. See [LICENSE](LICENSE) for details. + +## Resources + +- **Source Code**: [github.com/olekukonko/ll](https://github.com/olekukonko/ll) +- **Issue Tracker**: [github.com/olekukonko/ll/issues](https://github.com/olekukonko/ll/issues) +- **GoDoc**: [pkg.go.dev/github.com/olekukonko/ll](https://pkg.go.dev/github.com/olekukonko/ll) \ No newline at end of file diff --git a/vendor/github.com/olekukonko/ll/concat.go b/vendor/github.com/olekukonko/ll/concat.go new file mode 100644 index 0000000..4bfb22e --- /dev/null +++ b/vendor/github.com/olekukonko/ll/concat.go @@ -0,0 +1,421 @@ +package ll + +import ( + "fmt" + "github.com/olekukonko/ll/lx" + "reflect" + "strconv" + "strings" + "unsafe" +) + +const ( + maxRecursionDepth = 20 // Maximum depth for recursive type handling to prevent stack overflow + nilString = "" // String representation for nil values + unexportedString = "" // String representation for unexported fields +) + +// Concat efficiently concatenates values without a separator using the default logger. +// It converts each argument to a string and joins them directly, optimizing for performance +// in logging scenarios. Thread-safe as it does not modify shared state. +// Example: +// +// msg := ll.Concat("Hello", 42, true) // Returns "Hello42true" +func Concat(args ...any) string { + return concat(args...) +} + +// ConcatSpaced concatenates values with a space separator using the default logger. +// It converts each argument to a string and joins them with spaces, suitable for log message +// formatting. Thread-safe as it does not modify shared state. +// Example: +// +// msg := ll.ConcatSpaced("Hello", 42, true) // Returns "Hello 42 true" +func ConcatSpaced(args ...any) string { + return concatSpaced(args...) +} + +// ConcatAll concatenates elements with a separator, prefix, and suffix using the default logger. +// It combines before, main, and after arguments with the specified separator, optimizing memory +// allocation for logging. Thread-safe as it does not modify shared state. +// Example: +// +// msg := ll.ConcatAll(",", []any{"prefix"}, []any{"suffix"}, "main") +// // Returns "prefix,main,suffix" +func ConcatAll(sep string, before, after []any, args ...any) string { + return concatenate(sep, before, after, args...) +} + +// concat efficiently concatenates values without a separator. +// It converts each argument to a string and joins them directly, optimizing for performance +// in logging scenarios. Used internally by Concat and other logging functions. +// Example: +// +// msg := concat("Hello", 42, true) // Returns "Hello42true" +func concat(args ...any) string { + return concatWith("", args...) +} + +// concatSpaced concatenates values with a space separator. +// It converts each argument to a string and joins them with spaces, suitable for formatting +// log messages. Used internally by ConcatSpaced. +// Example: +// +// msg := concatSpaced("Hello", 42, true) // Returns "Hello 42 true" +func concatSpaced(args ...any) string { + return concatWith(lx.Space, args...) +} + +// concatWith concatenates values with a specified separator using optimized type handling. +// It builds a string from arguments, handling various types efficiently (strings, numbers, +// structs, etc.), and is used by concat and concatSpaced for log message construction. +// Thread-safe as it does not modify shared state. +// Example: +// +// msg := concatWith(",", "Hello", 42, true) // Returns "Hello,42,true" +func concatWith(sep string, args ...any) string { + switch len(args) { + case 0: + return "" + case 1: + return concatToString(args[0]) + } + + var b strings.Builder + b.Grow(concatEstimateArgs(sep, args)) + + for i, arg := range args { + if i > 0 { + b.WriteString(sep) + } + concatWriteValue(&b, arg, 0) + } + + return b.String() +} + +// concatenate concatenates elements with separators, prefixes, and suffixes efficiently. +// It combines before, main, and after arguments with the specified separator, optimizing +// memory allocation for complex log message formatting. Used internally by ConcatAll. +// Example: +// +// msg := concatenate(",", []any{"prefix"}, []any{"suffix"}, "main") +// // Returns "prefix,main,suffix" +func concatenate(sep string, before []any, after []any, args ...any) string { + totalLen := len(before) + len(after) + len(args) + switch totalLen { + case 0: + return "" + case 1: + switch { + case len(before) > 0: + return concatToString(before[0]) + case len(args) > 0: + return concatToString(args[0]) + default: + return concatToString(after[0]) + } + } + + var b strings.Builder + b.Grow(concatEstimateTotal(sep, before, after, args)) + + // Write before elements + concatWriteGroup(&b, sep, before) + + // Write main arguments + if len(before) > 0 && len(args) > 0 { + b.WriteString(sep) + } + concatWriteGroup(&b, sep, args) + + // Write after elements + if len(after) > 0 && (len(before) > 0 || len(args) > 0) { + b.WriteString(sep) + } + concatWriteGroup(&b, sep, after) + + return b.String() +} + +// concatWriteGroup writes a group of arguments to a strings.Builder with a separator. +// It handles each argument by converting it to a string, used internally by concatenate +// to process before, main, or after groups in log message construction. +// Example: +// +// var b strings.Builder +// concatWriteGroup(&b, ",", []any{"a", 42}) // Writes "a,42" to b +func concatWriteGroup(b *strings.Builder, sep string, group []any) { + for i, arg := range group { + if i > 0 { + b.WriteString(sep) + } + concatWriteValue(b, arg, 0) + } +} + +// concatToString converts a single argument to a string efficiently. +// It handles common types (string, []byte, fmt.Stringer) with minimal overhead and falls +// back to fmt.Sprint for other types. Used internally by concat and concatenate. +// Example: +// +// s := concatToString("Hello") // Returns "Hello" +// s := concatToString([]byte{65, 66}) // Returns "AB" +func concatToString(arg any) string { + switch v := arg.(type) { + case string: + return v + case []byte: + return *(*string)(unsafe.Pointer(&v)) + case fmt.Stringer: + return v.String() + case error: + return v.Error() + default: + return fmt.Sprint(v) + } +} + +// concatEstimateTotal estimates the total string length for concatenate. +// It calculates the expected size of the concatenated string, including before, main, and +// after arguments with separators, to preallocate the strings.Builder capacity. +// Example: +// +// size := concatEstimateTotal(",", []any{"prefix"}, []any{"suffix"}, "main") +// // Returns estimated length for "prefix,main,suffix" +func concatEstimateTotal(sep string, before, after, args []any) int { + size := 0 + if len(before) > 0 { + size += concatEstimateArgs(sep, before) + } + if len(args) > 0 { + if size > 0 { + size += len(sep) + } + size += concatEstimateArgs(sep, args) + } + if len(after) > 0 { + if size > 0 { + size += len(sep) + } + size += concatEstimateArgs(sep, after) + } + return size +} + +// concatEstimateArgs estimates the string length for a group of arguments. +// It sums the estimated sizes of each argument plus separators, used by concatEstimateTotal +// and concatWith to optimize memory allocation for log message construction. +// Example: +// +// size := concatEstimateArgs(",", []any{"hello", 42}) // Returns estimated length for "hello,42" +func concatEstimateArgs(sep string, args []any) int { + if len(args) == 0 { + return 0 + } + size := len(sep) * (len(args) - 1) + for _, arg := range args { + size += concatEstimateSize(arg) + } + return size +} + +// concatEstimateSize estimates the string length for a single argument. +// It provides size estimates for various types (strings, numbers, booleans, etc.) to +// optimize strings.Builder capacity allocation in logging functions. +// Example: +// +// size := concatEstimateSize("hello") // Returns 5 +// size := concatEstimateSize(42) // Returns ~2 +func concatEstimateSize(arg any) int { + switch v := arg.(type) { + case string: + return len(v) + case []byte: + return len(v) + case int: + return concatNumLen(int64(v)) + case int64: + return concatNumLen(v) + case int32: + return concatNumLen(int64(v)) + case int16: + return concatNumLen(int64(v)) + case int8: + return concatNumLen(int64(v)) + case uint: + return concatNumLen(uint64(v)) + case uint64: + return concatNumLen(v) + case uint32: + return concatNumLen(uint64(v)) + case uint16: + return concatNumLen(uint64(v)) + case uint8: + return concatNumLen(uint64(v)) + case float64: + return 24 // Max digits for float64 + case float32: + return 16 // Max digits for float32 + case bool: + if v { + return 4 // "true" + } + return 5 // "false" + case fmt.Stringer: + return 16 // Conservative estimate + default: + return 16 // Default estimate + } +} + +// concatNumLen estimates the string length for a signed or unsigned integer. +// It returns a conservative estimate (20 digits) for int64 or uint64 values, including +// a sign for negative numbers, used by concatEstimateSize for memory allocation. +// Example: +// +// size := concatNumLen(int64(-123)) // Returns 20 +// size := concatNumLen(uint64(123)) // Returns 20 +func concatNumLen[T int64 | uint64](v T) int { + if v < 0 { + return 20 // Max digits for int64 + sign + } + return 20 // Max digits for uint64 +} + +// concatWriteValue writes a formatted value to a strings.Builder with recursion depth tracking. +// It handles various types (strings, numbers, structs, slices, etc.) and prevents infinite +// recursion by limiting depth. Used internally by concatWith and concatWriteGroup for log +// message formatting. +// Example: +// +// var b strings.Builder +// concatWriteValue(&b, "hello", 0) // Writes "hello" to b +// concatWriteValue(&b, []int{1, 2}, 0) // Writes "[1,2]" to b +func concatWriteValue(b *strings.Builder, arg any, depth int) { + if depth > maxRecursionDepth { + b.WriteString("...") + return + } + + if arg == nil { + b.WriteString(nilString) + return + } + + if s, ok := arg.(fmt.Stringer); ok { + b.WriteString(s.String()) + return + } + + switch v := arg.(type) { + case string: + b.WriteString(v) + case []byte: + b.Write(v) + case int: + b.WriteString(strconv.FormatInt(int64(v), 10)) + case int64: + b.WriteString(strconv.FormatInt(v, 10)) + case int32: + b.WriteString(strconv.FormatInt(int64(v), 10)) + case int16: + b.WriteString(strconv.FormatInt(int64(v), 10)) + case int8: + b.WriteString(strconv.FormatInt(int64(v), 10)) + case uint: + b.WriteString(strconv.FormatUint(uint64(v), 10)) + case uint64: + b.WriteString(strconv.FormatUint(v, 10)) + case uint32: + b.WriteString(strconv.FormatUint(uint64(v), 10)) + case uint16: + b.WriteString(strconv.FormatUint(uint64(v), 10)) + case uint8: + b.WriteString(strconv.FormatUint(uint64(v), 10)) + case float64: + b.WriteString(strconv.FormatFloat(v, 'f', -1, 64)) + case float32: + b.WriteString(strconv.FormatFloat(float64(v), 'f', -1, 32)) + case bool: + if v { + b.WriteString("true") + } else { + b.WriteString("false") + } + default: + val := reflect.ValueOf(arg) + if val.Kind() == reflect.Ptr { + if val.IsNil() { + b.WriteString(nilString) + return + } + val = val.Elem() + } + + switch val.Kind() { + case reflect.Slice, reflect.Array: + concatFormatSlice(b, val, depth) + case reflect.Struct: + concatFormatStruct(b, val, depth) + default: + fmt.Fprint(b, v) + } + } +} + +// concatFormatSlice formats a slice or array for logging. +// It writes the elements in a bracketed, comma-separated format, handling nested types +// recursively with depth tracking. Used internally by concatWriteValue for log message formatting. +// Example: +// +// var b strings.Builder +// val := reflect.ValueOf([]int{1, 2}) +// concatFormatSlice(&b, val, 0) // Writes "[1,2]" to b +func concatFormatSlice(b *strings.Builder, val reflect.Value, depth int) { + b.WriteByte('[') + for i := 0; i < val.Len(); i++ { + if i > 0 { + b.WriteByte(',') + } + concatWriteValue(b, val.Index(i).Interface(), depth+1) + } + b.WriteByte(']') +} + +// concatFormatStruct formats a struct for logging. +// It writes the struct’s exported fields in a bracketed, name:value format, handling nested +// types recursively with depth tracking. Unexported fields are represented as "". +// Used internally by concatWriteValue for log message formatting. +// Example: +// +// var b strings.Builder +// val := reflect.ValueOf(struct{ Name string }{Name: "test"}) +// concatFormatStruct(&b, val, 0) // Writes "[Name:test]" to b +func concatFormatStruct(b *strings.Builder, val reflect.Value, depth int) { + typ := val.Type() + b.WriteByte('[') + + first := true + for i := 0; i < val.NumField(); i++ { + field := typ.Field(i) + fieldValue := val.Field(i) + + if !first { + b.WriteString("; ") + } + first = false + + b.WriteString(field.Name) + b.WriteByte(':') + + if !fieldValue.CanInterface() { + b.WriteString(unexportedString) + continue + } + + concatWriteValue(b, fieldValue.Interface(), depth+1) + } + + b.WriteByte(']') +} diff --git a/vendor/github.com/olekukonko/ll/conditional.go b/vendor/github.com/olekukonko/ll/conditional.go new file mode 100644 index 0000000..0ec9e4b --- /dev/null +++ b/vendor/github.com/olekukonko/ll/conditional.go @@ -0,0 +1,340 @@ +package ll + +// Conditional enables conditional logging based on a boolean condition. +// It wraps a logger with a condition that determines whether logging operations are executed, +// optimizing performance by skipping expensive operations (e.g., field computation, message formatting) +// when the condition is false. The struct supports fluent chaining for adding fields and logging. +type Conditional struct { + logger *Logger // Associated logger instance for logging operations + condition bool // Whether logging is allowed (true to log, false to skip) +} + +// If creates a conditional logger that logs only if the condition is true. +// It returns a Conditional struct that wraps the logger, enabling conditional logging methods. +// This method is typically called on a Logger instance to start a conditional chain. +// Thread-safe via the underlying logger’s mutex. +// Example: +// +// logger := New("app").Enable() +// logger.If(true).Info("Logged") // Output: [app] INFO: Logged +// logger.If(false).Info("Ignored") // No output +func (l *Logger) If(condition bool) *Conditional { + return &Conditional{logger: l, condition: condition} +} + +// IfOne creates a conditional logger that logs only if all conditions are true. +// It evaluates a variadic list of boolean conditions, setting the condition to true only if +// all are true (logical AND). Returns a new Conditional with the result. Thread-safe via the +// underlying logger. +// Example: +// +// logger := New("app").Enable() +// logger.IfOne(true, true).Info("Logged") // Output: [app] INFO: Logged +// logger.IfOne(true, false).Info("Ignored") // No output +func (cl *Conditional) IfOne(conditions ...bool) *Conditional { + result := true + // Check each condition; set result to false if any is false + for _, cond := range conditions { + if !cond { + result = false + break + } + } + return &Conditional{logger: cl.logger, condition: result} +} + +// IfAny creates a conditional logger that logs only if at least one condition is true. +// It evaluates a variadic list of boolean conditions, setting the condition to true if any +// is true (logical OR). Returns a new Conditional with the result. Thread-safe via the +// underlying logger. +// Example: +// +// logger := New("app").Enable() +// logger.IfAny(false, true).Info("Logged") // Output: [app] INFO: Logged +// logger.IfAny(false, false).Info("Ignored") // No output +func (cl *Conditional) IfAny(conditions ...bool) *Conditional { + result := false + // Check each condition; set result to true if any is true + for _, cond := range conditions { + if cond { + result = true + break + } + } + return &Conditional{logger: cl.logger, condition: result} +} + +// Fields starts a fluent chain for adding fields using variadic key-value pairs, if the condition is true. +// It returns a FieldBuilder to attach fields, skipping field processing if the condition is false +// to optimize performance. Thread-safe via the FieldBuilder’s logger. +// Example: +// +// logger := New("app").Enable() +// logger.If(true).Fields("user", "alice").Info("Logged") // Output: [app] INFO: Logged [user=alice] +// logger.If(false).Fields("user", "alice").Info("Ignored") // No output, no field processing +func (cl *Conditional) Fields(pairs ...any) *FieldBuilder { + // Skip field processing if condition is false + if !cl.condition { + return &FieldBuilder{logger: cl.logger, fields: nil} + } + // Delegate to logger’s Fields method + return cl.logger.Fields(pairs...) +} + +// Field starts a fluent chain for adding fields from a map, if the condition is true. +// It returns a FieldBuilder to attach fields from a map, skipping processing if the condition +// is false. Thread-safe via the FieldBuilder’s logger. +// Example: +// +// logger := New("app").Enable() +// logger.If(true).Field(map[string]interface{}{"user": "alice"}).Info("Logged") // Output: [app] INFO: Logged [user=alice] +// logger.If(false).Field(map[string]interface{}{"user": "alice"}).Info("Ignored") // No output +func (cl *Conditional) Field(fields map[string]interface{}) *FieldBuilder { + // Skip field processing if condition is false + if !cl.condition { + return &FieldBuilder{logger: cl.logger, fields: nil} + } + // Delegate to logger’s Field method + return cl.logger.Field(fields) +} + +// Info logs a message at Info level with variadic arguments if the condition is true. +// It concatenates the arguments with spaces and delegates to the logger’s Info method if the +// condition is true. Skips processing if false, optimizing performance. Thread-safe via the +// logger’s log method. +// Example: +// +// logger := New("app").Enable() +// logger.If(true).Info("Action", "started") // Output: [app] INFO: Action started +// logger.If(false).Info("Action", "ignored") // No output +func (cl *Conditional) Info(args ...any) { + // Skip logging if condition is false + if !cl.condition { + return + } + // Delegate to logger’s Info method + cl.logger.Info(args...) +} + +// Infof logs a message at Info level with a format string if the condition is true. +// It formats the message using the provided format string and arguments, delegating to the +// logger’s Infof method if the condition is true. Skips processing if false, optimizing performance. +// Thread-safe via the logger’s log method. +// Example: +// +// logger := New("app").Enable() +// logger.If(true).Infof("Action %s", "started") // Output: [app] INFO: Action started +// logger.If(false).Infof("Action %s", "ignored") // No output +func (cl *Conditional) Infof(format string, args ...any) { + // Skip logging if condition is false + if !cl.condition { + return + } + // Delegate to logger’s Infof method + cl.logger.Infof(format, args...) +} + +// Debug logs a message at Debug level with variadic arguments if the condition is true. +// It concatenates the arguments with spaces and delegates to the logger’s Debug method if the +// condition is true. Skips processing if false. Thread-safe via the logger’s log method. +// Example: +// +// logger := New("app").Enable().Level(lx.LevelDebug) +// logger.If(true).Debug("Debugging", "mode") // Output: [app] DEBUG: Debugging mode +// logger.If(false).Debug("Debugging", "ignored") // No output +func (cl *Conditional) Debug(args ...any) { + // Skip logging if condition is false + if !cl.condition { + return + } + // Delegate to logger’s Debug method + cl.logger.Debug(args...) +} + +// Debugf logs a message at Debug level with a format string if the condition is true. +// It formats the message and delegates to the logger’s Debugf method if the condition is true. +// Skips processing if false. Thread-safe via the logger’s log method. +// Example: +// +// logger := New("app").Enable().Level(lx.LevelDebug) +// logger.If(true).Debugf("Debug %s", "mode") // Output: [app] DEBUG: Debug mode +// logger.If(false).Debugf("Debug %s", "ignored") // No output +func (cl *Conditional) Debugf(format string, args ...any) { + // Skip logging if condition is false + if !cl.condition { + return + } + // Delegate to logger’s Debugf method + cl.logger.Debugf(format, args...) +} + +// Warn logs a message at Warn level with variadic arguments if the condition is true. +// It concatenates the arguments with spaces and delegates to the logger’s Warn method if the +// condition is true. Skips processing if false. Thread-safe via the logger’s log method. +// Example: +// +// logger := New("app").Enable() +// logger.If(true).Warn("Warning", "issued") // Output: [app] WARN: Warning issued +// logger.If(false).Warn("Warning", "ignored") // No output +func (cl *Conditional) Warn(args ...any) { + // Skip logging if condition is false + if !cl.condition { + return + } + // Delegate to logger’s Warn method + cl.logger.Warn(args...) +} + +// Warnf logs a message at Warn level with a format string if the condition is true. +// It formats the message and delegates to the logger’s Warnf method if the condition is true. +// Skips processing if false. Thread-safe via the logger’s log method. +// Example: +// +// logger := New("app").Enable() +// logger.If(true).Warnf("Warning %s", "issued") // Output: [app] WARN: Warning issued +// logger.If(false).Warnf("Warning %s", "ignored") // No output +func (cl *Conditional) Warnf(format string, args ...any) { + // Skip logging if condition is false + if !cl.condition { + return + } + // Delegate to logger’s Warnf method + cl.logger.Warnf(format, args...) +} + +// Error logs a message at Error level with variadic arguments if the condition is true. +// It concatenates the arguments with spaces and delegates to the logger’s Error method if the +// condition is true. Skips processing if false. Thread-safe via the logger’s log method. +// Example: +// +// logger := New("app").Enable() +// logger.If(true).Error("Error", "occurred") // Output: [app] ERROR: Error occurred +// logger.If(false).Error("Error", "ignored") // No output +func (cl *Conditional) Error(args ...any) { + // Skip logging if condition is false + if !cl.condition { + return + } + // Delegate to logger’s Error method + cl.logger.Error(args...) +} + +// Errorf logs a message at Error level with a format string if the condition is true. +// It formats the message and delegates to the logger’s Errorf method if the condition is true. +// Skips processing if false. Thread-safe via the logger’s log method. +// Example: +// +// logger := New("app").Enable() +// logger.If(true).Errorf("Error %s", "occurred") // Output: [app] ERROR: Error occurred +// logger.If(false).Errorf("Error %s", "ignored") // No output +func (cl *Conditional) Errorf(format string, args ...any) { + // Skip logging if condition is false + if !cl.condition { + return + } + // Delegate to logger’s Errorf method + cl.logger.Errorf(format, args...) +} + +// Stack logs a message at Error level with a stack trace and variadic arguments if the condition is true. +// It concatenates the arguments with spaces and delegates to the logger’s Stack method if the +// condition is true. Skips processing if false. Thread-safe via the logger’s log method. +// Example: +// +// logger := New("app").Enable() +// logger.If(true).Stack("Critical", "error") // Output: [app] ERROR: Critical error [stack=...] +// logger.If(false).Stack("Critical", "ignored") // No output +func (cl *Conditional) Stack(args ...any) { + // Skip logging if condition is false + if !cl.condition { + return + } + // Delegate to logger’s Stack method + cl.logger.Stack(args...) +} + +// Stackf logs a message at Error level with a stack trace and a format string if the condition is true. +// It formats the message and delegates to the logger’s Stackf method if the condition is true. +// Skips processing if false. Thread-safe via the logger’s log method. +// Example: +// +// logger := New("app").Enable() +// logger.If(true).Stackf("Critical %s", "error") // Output: [app] ERROR: Critical error [stack=...] +// logger.If(false).Stackf("Critical %s", "ignored") // No output +func (cl *Conditional) Stackf(format string, args ...any) { + // Skip logging if condition is false + if !cl.condition { + return + } + // Delegate to logger’s Stackf method + cl.logger.Stackf(format, args...) +} + +// Fatal logs a message at Error level with a stack trace and variadic arguments if the condition is true, +// then exits. It concatenates the arguments with spaces and delegates to the logger’s Fatal method +// if the condition is true, terminating the program with exit code 1. Skips processing if false. +// Thread-safe via the logger’s log method. +// Example: +// +// logger := New("app").Enable() +// logger.If(true).Fatal("Fatal", "error") // Output: [app] ERROR: Fatal error [stack=...], then exits +// logger.If(false).Fatal("Fatal", "ignored") // No output, no exit +func (cl *Conditional) Fatal(args ...any) { + // Skip logging if condition is false + if !cl.condition { + return + } + // Delegate to logger’s Fatal method + cl.logger.Fatal(args...) +} + +// Fatalf logs a formatted message at Error level with a stack trace if the condition is true, then exits. +// It formats the message and delegates to the logger’s Fatalf method if the condition is true, +// terminating the program with exit code 1. Skips processing if false. Thread-safe via the logger’s log method. +// Example: +// +// logger := New("app").Enable() +// logger.If(true).Fatalf("Fatal %s", "error") // Output: [app] ERROR: Fatal error [stack=...], then exits +// logger.If(false).Fatalf("Fatal %s", "ignored") // No output, no exit +func (cl *Conditional) Fatalf(format string, args ...any) { + // Skip logging if condition is false + if !cl.condition { + return + } + // Delegate to logger’s Fatalf method + cl.logger.Fatalf(format, args...) +} + +// Panic logs a message at Error level with a stack trace and variadic arguments if the condition is true, +// then panics. It concatenates the arguments with spaces and delegates to the logger’s Panic method +// if the condition is true, triggering a panic. Skips processing if false. Thread-safe via the logger’s log method. +// Example: +// +// logger := New("app").Enable() +// logger.If(true).Panic("Panic", "error") // Output: [app] ERROR: Panic error [stack=...], then panics +// logger.If(false).Panic("Panic", "ignored") // No output, no panic +func (cl *Conditional) Panic(args ...any) { + // Skip logging if condition is false + if !cl.condition { + return + } + // Delegate to logger’s Panic method + cl.logger.Panic(args...) +} + +// Panicf logs a formatted message at Error level with a stack trace if the condition is true, then panics. +// It formats the message and delegates to the logger’s Panicf method if the condition is true, +// triggering a panic. Skips processing if false. Thread-safe via the logger’s log method. +// Example: +// +// logger := New("app").Enable() +// logger.If(true).Panicf("Panic %s", "error") // Output: [app] ERROR: Panic error [stack=...], then panics +// logger.If(false).Panicf("Panic %s", "ignored") // No output, no panic +func (cl *Conditional) Panicf(format string, args ...any) { + // Skip logging if condition is false + if !cl.condition { + return + } + // Delegate to logger’s Panicf method + cl.logger.Panicf(format, args...) +} diff --git a/vendor/github.com/olekukonko/ll/field.go b/vendor/github.com/olekukonko/ll/field.go new file mode 100644 index 0000000..9d4ff3c --- /dev/null +++ b/vendor/github.com/olekukonko/ll/field.go @@ -0,0 +1,374 @@ +package ll + +import ( + "fmt" + "github.com/olekukonko/ll/lx" + "os" + "strings" +) + +// FieldBuilder enables fluent addition of fields before logging. +// It acts as a builder pattern to attach key-value pairs (fields) to log entries, +// supporting structured logging with metadata. The builder allows chaining to add fields +// and log messages at various levels (Info, Debug, Warn, Error, etc.) in a single expression. +type FieldBuilder struct { + logger *Logger // Associated logger instance for logging operations + fields map[string]interface{} // Fields to include in the log entry as key-value pairs +} + +// Logger creates a new logger with the builder’s fields embedded in its context. +// It clones the parent logger and copies the builder’s fields into the new logger’s context, +// enabling persistent field inclusion in subsequent logs. This method supports fluent chaining +// after Fields or Field calls. +// Example: +// +// logger := New("app").Enable() +// newLogger := logger.Fields("user", "alice").Logger() +// newLogger.Info("Action") // Output: [app] INFO: Action [user=alice] +func (fb *FieldBuilder) Logger() *Logger { + // Clone the parent logger to preserve its configuration + newLogger := fb.logger.Clone() + // Initialize a new context map to avoid modifying the parent’s context + newLogger.context = make(map[string]interface{}) + // Copy builder’s fields into the new logger’s context + for k, v := range fb.fields { + newLogger.context[k] = v + } + return newLogger +} + +// Info logs a message at Info level with the builder’s fields. +// It concatenates the arguments with spaces and delegates to the logger’s log method, +// returning early if fields are nil. This method is used for informational messages. +// Example: +// +// logger := New("app").Enable() +// logger.Fields("user", "alice").Info("Action", "started") // Output: [app] INFO: Action started [user=alice] +func (fb *FieldBuilder) Info(args ...any) { + // Skip logging if fields are nil + if fb.fields == nil { + return + } + // Log at Info level with the builder’s fields, no stack trace + fb.logger.log(lx.LevelInfo, lx.ClassText, concatSpaced(args...), fb.fields, false) +} + +// Infof logs a message at Info level with the builder’s fields. +// It formats the message using the provided format string and arguments, then delegates +// to the logger’s internal log method. If fields are nil, it returns early to avoid logging. +// This method is part of the fluent API, typically called after adding fields. +// Example: +// +// logger := New("app").Enable() +// logger.Fields("user", "alice").Infof("Action %s", "started") // Output: [app] INFO: Action started [user=alice] +func (fb *FieldBuilder) Infof(format string, args ...any) { + // Skip logging if fields are nil to prevent invalid log entries + if fb.fields == nil { + return + } + // Format the message using the provided arguments + msg := fmt.Sprintf(format, args...) + // Log at Info level with the builder’s fields, no stack trace + fb.logger.log(lx.LevelInfo, lx.ClassText, msg, fb.fields, false) +} + +// Debug logs a message at Debug level with the builder’s fields. +// It concatenates the arguments with spaces and delegates to the logger’s log method, +// returning early if fields are nil. This method is used for debugging information. +// Example: +// +// logger := New("app").Enable() +// logger.Fields("user", "alice").Debug("Debugging", "mode") // Output: [app] DEBUG: Debugging mode [user=alice] +func (fb *FieldBuilder) Debug(args ...any) { + // Skip logging if fields are nil + if fb.fields == nil { + return + } + // Log at Debug level with the builder’s fields, no stack trace + fb.logger.log(lx.LevelDebug, lx.ClassText, concatSpaced(args...), fb.fields, false) +} + +// Debugf logs a message at Debug level with the builder’s fields. +// It formats the message and delegates to the logger’s log method, returning early if +// fields are nil. This method is used for debugging information that may be disabled in +// production environments. +// Example: +// +// logger := New("app").Enable() +// logger.Fields("user", "alice").Debugf("Debug %s", "mode") // Output: [app] DEBUG: Debug mode [user=alice] +func (fb *FieldBuilder) Debugf(format string, args ...any) { + // Skip logging if fields are nil + if fb.fields == nil { + return + } + // Format the message + msg := fmt.Sprintf(format, args...) + // Log at Debug level with the builder’s fields, no stack trace + fb.logger.log(lx.LevelDebug, lx.ClassText, msg, fb.fields, false) +} + +// Warn logs a message at Warn level with the builder’s fields. +// It concatenates the arguments with spaces and delegates to the logger’s log method, +// returning early if fields are nil. This method is used for warning conditions. +// Example: +// +// logger := New("app").Enable() +// logger.Fields("user", "alice").Warn("Warning", "issued") // Output: [app] WARN: Warning issued [user=alice] +func (fb *FieldBuilder) Warn(args ...any) { + // Skip logging if fields are nil + if fb.fields == nil { + return + } + // Log at Warn level with the builder’s fields, no stack trace + fb.logger.log(lx.LevelWarn, lx.ClassText, concatSpaced(args...), fb.fields, false) +} + +// Warnf logs a message at Warn level with the builder’s fields. +// It formats the message and delegates to the logger’s log method, returning early if +// fields are nil. This method is used for warning conditions that do not halt execution. +// Example: +// +// logger := New("app").Enable() +// logger.Fields("user", "alice").Warnf("Warning %s", "issued") // Output: [app] WARN: Warning issued [user=alice] +func (fb *FieldBuilder) Warnf(format string, args ...any) { + // Skip logging if fields are nil + if fb.fields == nil { + return + } + // Format the message + msg := fmt.Sprintf(format, args...) + // Log at Warn level with the builder’s fields, no stack trace + fb.logger.log(lx.LevelWarn, lx.ClassText, msg, fb.fields, false) +} + +// Error logs a message at Error level with the builder’s fields. +// It concatenates the arguments with spaces and delegates to the logger’s log method, +// returning early if fields are nil. This method is used for error conditions. +// Example: +// +// logger := New("app").Enable() +// logger.Fields("user", "alice").Error("Error", "occurred") // Output: [app] ERROR: Error occurred [user=alice] +func (fb *FieldBuilder) Error(args ...any) { + // Skip logging if fields are nil + if fb.fields == nil { + return + } + // Log at Error level with the builder’s fields, no stack trace + fb.logger.log(lx.LevelError, lx.ClassText, concatSpaced(args...), fb.fields, false) +} + +// Errorf logs a message at Error level with the builder’s fields. +// It formats the message and delegates to the logger’s log method, returning early if +// fields are nil. This method is used for error conditions that may require attention. +// Example: +// +// logger := New("app").Enable() +// logger.Fields("user", "alice").Errorf("Error %s", "occurred") // Output: [app] ERROR: Error occurred [user=alice] +func (fb *FieldBuilder) Errorf(format string, args ...any) { + // Skip logging if fields are nil + if fb.fields == nil { + return + } + // Format the message + msg := fmt.Sprintf(format, args...) + // Log at Error level with the builder’s fields, no stack trace + fb.logger.log(lx.LevelError, lx.ClassText, msg, fb.fields, false) +} + +// Stack logs a message at Error level with a stack trace and the builder’s fields. +// It concatenates the arguments with spaces and delegates to the logger’s log method, +// returning early if fields are nil. This method is useful for debugging critical errors. +// Example: +// +// logger := New("app").Enable() +// logger.Fields("user", "alice").Stack("Critical", "error") // Output: [app] ERROR: Critical error [user=alice stack=...] +func (fb *FieldBuilder) Stack(args ...any) { + // Skip logging if fields are nil + if fb.fields == nil { + return + } + // Log at Error level with the builder’s fields and a stack trace + fb.logger.log(lx.LevelError, lx.ClassText, concatSpaced(args...), fb.fields, true) +} + +// Stackf logs a message at Error level with a stack trace and the builder’s fields. +// It formats the message and delegates to the logger’s log method, returning early if +// fields are nil. This method is useful for debugging critical errors. +// Example: +// +// logger := New("app").Enable() +// logger.Fields("user", "alice").Stackf("Critical %s", "error") // Output: [app] ERROR: Critical error [user=alice stack=...] +func (fb *FieldBuilder) Stackf(format string, args ...any) { + // Skip logging if fields are nil + if fb.fields == nil { + return + } + // Format the message + msg := fmt.Sprintf(format, args...) + // Log at Error level with the builder’s fields and a stack trace + fb.logger.log(lx.LevelError, lx.ClassText, msg, fb.fields, true) +} + +// Fatal logs a message at Error level with a stack trace and the builder’s fields, then exits. +// It constructs the message from variadic arguments, logs it with a stack trace, and terminates +// the program with exit code 1. Returns early if fields are nil. This method is used for +// unrecoverable errors. +// Example: +// +// logger := New("app").Enable() +// logger.Fields("user", "alice").Fatal("Fatal", "error") // Output: [app] ERROR: Fatal error [user=alice stack=...], then exits +func (fb *FieldBuilder) Fatal(args ...any) { + // Skip logging if fields are nil + if fb.fields == nil { + return + } + // Build the message by concatenating arguments with spaces + var builder strings.Builder + for i, arg := range args { + if i > 0 { + builder.WriteString(lx.Space) + } + builder.WriteString(fmt.Sprint(arg)) + } + // Log at Error level with the builder’s fields and a stack trace + fb.logger.log(lx.LevelError, lx.ClassText, builder.String(), fb.fields, true) + // Exit the program with status code 1 + os.Exit(1) +} + +// Fatalf logs a formatted message at Error level with a stack trace and the builder’s fields, +// then exits. It delegates to Fatal and returns early if fields are nil. This method is used +// for unrecoverable errors. +// Example: +// +// logger := New("app").Enable() +// logger.Fields("user", "alice").Fatalf("Fatal %s", "error") // Output: [app] ERROR: Fatal error [user=alice stack=...], then exits +func (fb *FieldBuilder) Fatalf(format string, args ...any) { + // Skip logging if fields are nil + if fb.fields == nil { + return + } + // Format the message and pass to Fatal + fb.Fatal(fmt.Sprintf(format, args...)) +} + +// Panic logs a message at Error level with a stack trace and the builder’s fields, then panics. +// It constructs the message from variadic arguments, logs it with a stack trace, and triggers +// a panic with the message. Returns early if fields are nil. This method is used for critical +// errors that require immediate program termination with a panic. +// Example: +// +// logger := New("app").Enable() +// logger.Fields("user", "alice").Panic("Panic", "error") // Output: [app] ERROR: Panic error [user=alice stack=...], then panics +func (fb *FieldBuilder) Panic(args ...any) { + // Skip logging if fields are nil + if fb.fields == nil { + return + } + // Build the message by concatenating arguments with spaces + var builder strings.Builder + for i, arg := range args { + if i > 0 { + builder.WriteString(lx.Space) + } + builder.WriteString(fmt.Sprint(arg)) + } + msg := builder.String() + // Log at Error level with the builder’s fields and a stack trace + fb.logger.log(lx.LevelError, lx.ClassText, msg, fb.fields, true) + // Trigger a panic with the formatted message + panic(msg) +} + +// Panicf logs a formatted message at Error level with a stack trace and the builder’s fields, +// then panics. It delegates to Panic and returns early if fields are nil. This method is used +// for critical errors that require immediate program termination with a panic. +// Example: +// +// logger := New("app").Enable() +// logger.Fields("user", "alice").Panicf("Panic %s", "error") // Output: [app] ERROR: Panic error [user=alice stack=...], then panics +func (fb *FieldBuilder) Panicf(format string, args ...any) { + // Skip logging if fields are nil + if fb.fields == nil { + return + } + // Format the message and pass to Panic + fb.Panic(fmt.Sprintf(format, args...)) +} + +// Err adds one or more errors to the FieldBuilder as a field and logs them. +// It stores non-nil errors in the "error" field: a single error if only one is non-nil, +// or a slice of errors if multiple are non-nil. It logs the concatenated string representations +// of non-nil errors (e.g., "failed 1; failed 2") at the Error level. Returns the FieldBuilder +// for chaining, allowing further field additions or logging. Thread-safe via the logger’s mutex. +// Example: +// +// logger := New("app").Enable() +// err1 := errors.New("failed 1") +// err2 := errors.New("failed 2") +// logger.Fields("k", "v").Err(err1, err2).Info("Error occurred") +// // Output: [app] ERROR: failed 1; failed 2 +// // [app] INFO: Error occurred [error=[failed 1 failed 2] k=v] +func (fb *FieldBuilder) Err(errs ...error) *FieldBuilder { + // Initialize fields map if nil + if fb.fields == nil { + fb.fields = make(map[string]interface{}) + } + + // Collect non-nil errors and build log message + var nonNilErrors []error + var builder strings.Builder + count := 0 + for i, err := range errs { + if err != nil { + if i > 0 && count > 0 { + builder.WriteString("; ") + } + builder.WriteString(err.Error()) + nonNilErrors = append(nonNilErrors, err) + count++ + } + } + + // Set error field and log if there are non-nil errors + if count > 0 { + if count == 1 { + // Store single error directly + fb.fields["error"] = nonNilErrors[0] + } else { + // Store slice of errors + fb.fields["error"] = nonNilErrors + } + // Log concatenated error messages at Error level + fb.logger.log(lx.LevelError, lx.ClassText, builder.String(), nil, false) + } + + // Return FieldBuilder for chaining + return fb +} + +// Merge adds additional key-value pairs to the FieldBuilder. +// It processes variadic arguments as key-value pairs, expecting string keys. Non-string keys +// or uneven pairs generate an "error" field with a descriptive message. Returns the FieldBuilder +// for chaining to allow further field additions or logging. +// Example: +// +// logger := New("app").Enable() +// logger.Fields("k1", "v1").Merge("k2", "v2").Info("Action") // Output: [app] INFO: Action [k1=v1 k2=v2] +func (fb *FieldBuilder) Merge(pairs ...any) *FieldBuilder { + // Process pairs as key-value, advancing by 2 + for i := 0; i < len(pairs)-1; i += 2 { + // Ensure the key is a string + if key, ok := pairs[i].(string); ok { + fb.fields[key] = pairs[i+1] + } else { + // Log an error field for non-string keys + fb.fields["error"] = fmt.Errorf("non-string key in Merge: %v", pairs[i]) + } + } + // Check for uneven pairs (missing value) + if len(pairs)%2 != 0 { + fb.fields["error"] = fmt.Errorf("uneven key-value pairs in Merge: [%v]", pairs[len(pairs)-1]) + } + return fb +} diff --git a/vendor/github.com/olekukonko/ll/global.go b/vendor/github.com/olekukonko/ll/global.go new file mode 100644 index 0000000..2ebea73 --- /dev/null +++ b/vendor/github.com/olekukonko/ll/global.go @@ -0,0 +1,659 @@ +package ll + +import ( + "github.com/olekukonko/ll/lh" + "github.com/olekukonko/ll/lx" + "os" + "sync/atomic" + "time" +) + +// defaultLogger is the global logger instance for package-level logging functions. +// It provides a shared logger for convenience, allowing logging without explicitly creating +// a logger instance. The logger is initialized with default settings: enabled, Debug level, +// flat namespace style, and a text handler to os.Stdout. It is thread-safe due to the Logger +// struct’s mutex. +var defaultLogger = &Logger{ + enabled: true, // Initially enabled + level: lx.LevelDebug, // Minimum log level set to Debug + namespaces: defaultStore, // Shared namespace store for enable/disable states + context: make(map[string]interface{}), // Empty context for global fields + style: lx.FlatPath, // Flat namespace style (e.g., [parent/child]) + handler: lh.NewTextHandler(os.Stdout), // Default text handler to os.Stdout + middleware: make([]Middleware, 0), // Empty middleware chain + stackBufferSize: 4096, // Buffer size for stack traces +} + +// Handler sets the handler for the default logger. +// It configures the output destination and format (e.g., text, JSON) for logs emitted by +// defaultLogger. Returns the default logger for method chaining, enabling fluent configuration. +// Example: +// +// ll.Handler(lh.NewJSONHandler(os.Stdout)).Enable() +// ll.Info("Started") // Output: {"level":"INFO","message":"Started"} +func Handler(handler lx.Handler) *Logger { + return defaultLogger.Handler(handler) +} + +// Level sets the minimum log level for the default logger. +// It determines which log messages (Debug, Info, Warn, Error) are emitted. Messages below +// the specified level are ignored. Returns the default logger for method chaining. +// Example: +// +// ll.Level(lx.LevelWarn) +// ll.Info("Ignored") // No output +// ll.Warn("Logged") // Output: [] WARN: Logged +func Level(level lx.LevelType) *Logger { + return defaultLogger.Level(level) +} + +// Style sets the namespace style for the default logger. +// It controls how namespace paths are formatted in logs (FlatPath: [parent/child], +// NestedPath: [parent]→[child]). Returns the default logger for method chaining. +// Example: +// +// ll.Style(lx.NestedPath) +// ll.Info("Test") // Output: []: INFO: Test +func Style(style lx.StyleType) *Logger { + return defaultLogger.Style(style) +} + +// NamespaceEnable enables logging for a namespace and its children using the default logger. +// It activates logging for the specified namespace path (e.g., "app/db") and all its +// descendants. Returns the default logger for method chaining. Thread-safe via the Logger’s mutex. +// Example: +// +// ll.NamespaceEnable("app/db") +// ll.Clone().Namespace("db").Info("Query") // Output: [app/db] INFO: Query +func NamespaceEnable(path string) *Logger { + return defaultLogger.NamespaceEnable(path) +} + +// NamespaceDisable disables logging for a namespace and its children using the default logger. +// It suppresses logging for the specified namespace path and all its descendants. Returns +// the default logger for method chaining. Thread-safe via the Logger’s mutex. +// Example: +// +// ll.NamespaceDisable("app/db") +// ll.Clone().Namespace("db").Info("Query") // No output +func NamespaceDisable(path string) *Logger { + return defaultLogger.NamespaceDisable(path) +} + +// Namespace creates a child logger with a sub-namespace appended to the current path. +// The child inherits the default logger’s configuration but has an independent context. +// Thread-safe with read lock. Returns the new logger for further configuration or logging. +// Example: +// +// logger := ll.Namespace("app") +// logger.Info("Started") // Output: [app] INFO: Started +func Namespace(name string) *Logger { + return defaultLogger.Namespace(name) +} + +// Info logs a message at Info level with variadic arguments using the default logger. +// It concatenates the arguments with spaces and delegates to defaultLogger’s Info method. +// Thread-safe via the Logger’s log method. +// Example: +// +// ll.Info("Service", "started") // Output: [] INFO: Service started +func Info(args ...any) { + defaultLogger.Info(args...) +} + +// Infof logs a message at Info level with a format string using the default logger. +// It formats the message using the provided format string and arguments, then delegates to +// defaultLogger’s Infof method. Thread-safe via the Logger’s log method. +// Example: +// +// ll.Infof("Service %s", "started") // Output: [] INFO: Service started +func Infof(format string, args ...any) { + defaultLogger.Infof(format, args...) +} + +// Debug logs a message at Debug level with variadic arguments using the default logger. +// It concatenates the arguments with spaces and delegates to defaultLogger’s Debug method. +// Used for debugging information, typically disabled in production. Thread-safe. +// Example: +// +// ll.Level(lx.LevelDebug) +// ll.Debug("Debugging", "mode") // Output: [] DEBUG: Debugging mode +func Debug(args ...any) { + defaultLogger.Debug(args...) +} + +// Debugf logs a message at Debug level with a format string using the default logger. +// It formats the message and delegates to defaultLogger’s Debugf method. Used for debugging +// information, typically disabled in production. Thread-safe. +// Example: +// +// ll.Level(lx.LevelDebug) +// ll.Debugf("Debug %s", "mode") // Output: [] DEBUG: Debug mode +func Debugf(format string, args ...any) { + defaultLogger.Debugf(format, args...) +} + +// Warn logs a message at Warn level with variadic arguments using the default logger. +// It concatenates the arguments with spaces and delegates to defaultLogger’s Warn method. +// Used for warning conditions that do not halt execution. Thread-safe. +// Example: +// +// ll.Warn("Low", "memory") // Output: [] WARN: Low memory +func Warn(args ...any) { + defaultLogger.Warn(args...) +} + +// Warnf logs a message at Warn level with a format string using the default logger. +// It formats the message and delegates to defaultLogger’s Warnf method. Used for warning +// conditions that do not halt execution. Thread-safe. +// Example: +// +// ll.Warnf("Low %s", "memory") // Output: [] WARN: Low memory +func Warnf(format string, args ...any) { + defaultLogger.Warnf(format, args...) +} + +// Error logs a message at Error level with variadic arguments using the default logger. +// It concatenates the arguments with spaces and delegates to defaultLogger’s Error method. +// Used for error conditions requiring attention. Thread-safe. +// Example: +// +// ll.Error("Database", "failure") // Output: [] ERROR: Database failure +func Error(args ...any) { + defaultLogger.Error(args...) +} + +// Errorf logs a message at Error level with a format string using the default logger. +// It formats the message and delegates to defaultLogger’s Errorf method. Used for error +// conditions requiring attention. Thread-safe. +// Example: +// +// ll.Errorf("Database %s", "failure") // Output: [] ERROR: Database failure +func Errorf(format string, args ...any) { + defaultLogger.Errorf(format, args...) +} + +// Stack logs a message at Error level with a stack trace and variadic arguments using the default logger. +// It concatenates the arguments with spaces and delegates to defaultLogger’s Stack method. +// Thread-safe. +// Example: +// +// ll.Stack("Critical", "error") // Output: [] ERROR: Critical error [stack=...] +func Stack(args ...any) { + defaultLogger.Stack(args...) +} + +// Stackf logs a message at Error level with a stack trace and a format string using the default logger. +// It formats the message and delegates to defaultLogger’s Stackf method. Thread-safe. +// Example: +// +// ll.Stackf("Critical %s", "error") // Output: [] ERROR: Critical error [stack=...] +func Stackf(format string, args ...any) { + defaultLogger.Stackf(format, args...) +} + +// Fatal logs a message at Error level with a stack trace and variadic arguments using the default logger, +// then exits. It concatenates the arguments with spaces, logs with a stack trace, and terminates +// with exit code 1. Thread-safe. +// Example: +// +// ll.Fatal("Fatal", "error") // Output: [] ERROR: Fatal error [stack=...], then exits +func Fatal(args ...any) { + defaultLogger.Fatal(args...) +} + +// Fatalf logs a formatted message at Error level with a stack trace using the default logger, +// then exits. It formats the message, logs with a stack trace, and terminates with exit code 1. +// Thread-safe. +// Example: +// +// ll.Fatalf("Fatal %s", "error") // Output: [] ERROR: Fatal error [stack=...], then exits +func Fatalf(format string, args ...any) { + defaultLogger.Fatalf(format, args...) +} + +// Panic logs a message at Error level with a stack trace and variadic arguments using the default logger, +// then panics. It concatenates the arguments with spaces, logs with a stack trace, and triggers a panic. +// Thread-safe. +// Example: +// +// ll.Panic("Panic", "error") // Output: [] ERROR: Panic error [stack=...], then panics +func Panic(args ...any) { + defaultLogger.Panic(args...) +} + +// Panicf logs a formatted message at Error level with a stack trace using the default logger, +// then panics. It formats the message, logs with a stack trace, and triggers a panic. Thread-safe. +// Example: +// +// ll.Panicf("Panic %s", "error") // Output: [] ERROR: Panic error [stack=...], then panics +func Panicf(format string, args ...any) { + defaultLogger.Panicf(format, args...) +} + +// If creates a conditional logger that logs only if the condition is true using the default logger. +// It returns a Conditional struct that wraps the default logger, enabling conditional logging methods. +// Thread-safe via the Logger’s mutex. +// Example: +// +// ll.If(true).Info("Logged") // Output: [] INFO: Logged +// ll.If(false).Info("Ignored") // No output +func If(condition bool) *Conditional { + return defaultLogger.If(condition) +} + +// Context creates a new logger with additional contextual fields using the default logger. +// It preserves existing context fields and adds new ones, returning a new logger instance +// to avoid mutating the default logger. Thread-safe with write lock. +// Example: +// +// logger := ll.Context(map[string]interface{}{"user": "alice"}) +// logger.Info("Action") // Output: [] INFO: Action [user=alice] +func Context(fields map[string]interface{}) *Logger { + return defaultLogger.Context(fields) +} + +// AddContext adds a key-value pair to the default logger’s context, modifying it directly. +// It mutates the default logger’s context and is thread-safe using a write lock. +// Example: +// +// ll.AddContext("user", "alice") +// ll.Info("Action") // Output: [] INFO: Action [user=alice] +func AddContext(key string, value interface{}) *Logger { + return defaultLogger.AddContext(key, value) +} + +// GetContext returns the default logger’s context map of persistent key-value fields. +// It provides thread-safe read access to the context using a read lock. +// Example: +// +// ll.AddContext("user", "alice") +// ctx := ll.GetContext() // Returns map[string]interface{}{"user": "alice"} +func GetContext() map[string]interface{} { + return defaultLogger.GetContext() +} + +// GetLevel returns the minimum log level for the default logger. +// It provides thread-safe read access to the level field using a read lock. +// Example: +// +// ll.Level(lx.LevelWarn) +// if ll.GetLevel() == lx.LevelWarn { +// ll.Warn("Warning level set") // Output: [] WARN: Warning level set +// } +func GetLevel() lx.LevelType { + return defaultLogger.GetLevel() +} + +// GetPath returns the default logger’s current namespace path. +// It provides thread-safe read access to the currentPath field using a read lock. +// Example: +// +// logger := ll.Namespace("app") +// path := logger.GetPath() // Returns "app" +func GetPath() string { + return defaultLogger.GetPath() +} + +// GetSeparator returns the default logger’s namespace separator (e.g., "/"). +// It provides thread-safe read access to the separator field using a read lock. +// Example: +// +// ll.Separator(".") +// sep := ll.GetSeparator() // Returns "." +func GetSeparator() string { + return defaultLogger.GetSeparator() +} + +// GetStyle returns the default logger’s namespace formatting style (FlatPath or NestedPath). +// It provides thread-safe read access to the style field using a read lock. +// Example: +// +// ll.Style(lx.NestedPath) +// if ll.GetStyle() == lx.NestedPath { +// ll.Info("Nested style") // Output: []: INFO: Nested style +// } +func GetStyle() lx.StyleType { + return defaultLogger.GetStyle() +} + +// GetHandler returns the default logger’s current handler for customization or inspection. +// The returned handler should not be modified concurrently with logger operations. +// Example: +// +// handler := ll.GetHandler() // Returns the current handler (e.g., TextHandler) +func GetHandler() lx.Handler { + return defaultLogger.GetHandler() +} + +// Separator sets the namespace separator for the default logger (e.g., "/" or "."). +// It updates the separator used in namespace paths. Thread-safe with write lock. +// Returns the default logger for method chaining. +// Example: +// +// ll.Separator(".") +// ll.Namespace("app").Info("Log") // Output: [app] INFO: Log +func Separator(separator string) *Logger { + return defaultLogger.Separator(separator) +} + +// Prefix sets a prefix to be prepended to all log messages of the default logger. +// The prefix is applied before the message in the log output. Thread-safe with write lock. +// Returns the default logger for method chaining. +// Example: +// +// ll.Prefix("APP: ") +// ll.Info("Started") // Output: [] INFO: APP: Started +func Prefix(prefix string) *Logger { + return defaultLogger.Prefix(prefix) +} + +// StackSize sets the buffer size for stack trace capture in the default logger. +// It configures the maximum size for stack traces in Stack, Fatal, and Panic methods. +// Thread-safe with write lock. Returns the default logger for chaining. +// Example: +// +// ll.StackSize(65536) +// ll.Stack("Error") // Captures up to 64KB stack trace +func StackSize(size int) *Logger { + return defaultLogger.StackSize(size) +} + +// Use adds a middleware function to process log entries before they are handled by the default logger. +// It registers the middleware and returns a Middleware handle for removal. Middleware returning +// a non-nil error stops the log. Thread-safe with write lock. +// Example: +// +// mw := ll.Use(ll.FuncMiddleware(func(e *lx.Entry) error { +// if e.Level < lx.LevelWarn { +// return fmt.Errorf("level too low") +// } +// return nil +// })) +// ll.Info("Ignored") // No output +// mw.Remove() +// ll.Info("Logged") // Output: [] INFO: Logged +func Use(fn lx.Handler) *Middleware { + return defaultLogger.Use(fn) +} + +// Remove removes middleware by the reference returned from Use for the default logger. +// It delegates to the Middleware’s Remove method for thread-safe removal. +// Example: +// +// mw := ll.Use(someMiddleware) +// ll.Remove(mw) // Removes middleware +func Remove(m *Middleware) { + defaultLogger.Remove(m) +} + +// Clear removes all middleware functions from the default logger. +// It resets the middleware chain to empty, ensuring no middleware is applied. +// Thread-safe with write lock. Returns the default logger for chaining. +// Example: +// +// ll.Use(someMiddleware) +// ll.Clear() +// ll.Info("No middleware") // Output: [] INFO: No middleware +func Clear() *Logger { + return defaultLogger.Clear() +} + +// CanLog checks if a log at the given level would be emitted by the default logger. +// It considers enablement, log level, namespaces, sampling, and rate limits. +// Thread-safe via the Logger’s shouldLog method. +// Example: +// +// ll.Level(lx.LevelWarn) +// canLog := ll.CanLog(lx.LevelInfo) // false +func CanLog(level lx.LevelType) bool { + return defaultLogger.CanLog(level) +} + +// NamespaceEnabled checks if a namespace is enabled in the default logger. +// It evaluates the namespace hierarchy, considering parent namespaces, and caches the result +// for performance. Thread-safe with read lock. +// Example: +// +// ll.NamespaceDisable("app/db") +// enabled := ll.NamespaceEnabled("app/db") // false +func NamespaceEnabled(path string) bool { + return defaultLogger.NamespaceEnabled(path) +} + +// Print logs a message at Info level without format specifiers using the default logger. +// It concatenates variadic arguments with spaces, minimizing allocations, and delegates +// to defaultLogger’s Print method. Thread-safe via the Logger’s log method. +// Example: +// +// ll.Print("message", "value") // Output: [] INFO: message value +func Print(args ...any) { + defaultLogger.Print(args...) +} + +// Println logs a message at Info level without format specifiers, minimizing allocations +// by concatenating arguments with spaces. It is thread-safe via the log method. +// Example: +// +// ll.Println("message", "value") // Output: [] INFO: message value [New Line] +func Println(args ...any) { + defaultLogger.Println(args...) +} + +// Printf logs a message at Info level with a format string using the default logger. +// It formats the message and delegates to defaultLogger’s Printf method. Thread-safe via +// the Logger’s log method. +// Example: +// +// ll.Printf("Message %s", "value") // Output: [] INFO: Message value +func Printf(format string, args ...any) { + defaultLogger.Printf(format, args...) +} + +// Len returns the total number of log entries sent to the handler by the default logger. +// It provides thread-safe access to the entries counter using atomic operations. +// Example: +// +// ll.Info("Test") +// count := ll.Len() // Returns 1 +func Len() int64 { + return defaultLogger.Len() +} + +// Measure is a benchmarking helper that measures and returns the duration of a function’s execution. +// It logs the duration at Info level with a "duration" field using defaultLogger. The function +// is executed once, and the elapsed time is returned. Thread-safe via the Logger’s mutex. +// Example: +// +// duration := ll.Measure(func() { time.Sleep(time.Millisecond) }) +// // Output: [] INFO: function executed [duration=~1ms] +func Measure(fns ...func()) time.Duration { + start := time.Now() + for _, fn := range fns { + fn() + } + duration := time.Since(start) + defaultLogger.Fields("duration", duration).Infof("function executed") + return duration +} + +// Benchmark logs the duration since a start time at Info level using the default logger. +// It calculates the time elapsed since the provided start time and logs it with "start", +// "end", and "duration" fields. Thread-safe via the Logger’s mutex. +// Example: +// +// start := time.Now() +// time.Sleep(time.Millisecond) +// ll.Benchmark(start) // Output: [] INFO: benchmark [start=... end=... duration=...] +func Benchmark(start time.Time) { + defaultLogger.Fields("start", start, "end", time.Now(), "duration", time.Now().Sub(start)).Infof("benchmark") +} + +// Clone returns a new logger with the same configuration as the default logger. +// It creates a copy of defaultLogger’s settings (level, style, namespaces, etc.) but with +// an independent context, allowing customization without affecting the global logger. +// Thread-safe via the Logger’s Clone method. +// Example: +// +// logger := ll.Clone().Namespace("sub") +// logger.Info("Sub-logger") // Output: [sub] INFO: Sub-logger +func Clone() *Logger { + return defaultLogger.Clone() +} + +// Err adds one or more errors to the default logger’s context and logs them. +// It stores non-nil errors in the "error" context field and logs their concatenated string +// representations (e.g., "failed 1; failed 2") at the Error level. Thread-safe via the Logger’s mutex. +// Example: +// +// err1 := errors.New("failed 1") +// ll.Err(err1) +// ll.Info("Error occurred") // Output: [] ERROR: failed 1 +// // [] INFO: Error occurred [error=failed 1] +func Err(errs ...error) { + defaultLogger.Err(errs...) +} + +// Start activates the global logging system. +// If the system was shut down, this re-enables all logging operations, +// subject to individual logger and namespace configurations. +// Thread-safe via atomic operations. +// Example: +// +// ll.Shutdown() +// ll.Info("Ignored") // No output +// ll.Start() +// ll.Info("Logged") // Output: [] INFO: Logged +func Start() { + atomic.StoreInt32(&systemActive, 1) +} + +// Shutdown deactivates the global logging system. +// All logging operations are skipped, regardless of individual logger or namespace configurations, +// until Start() is called again. Thread-safe via atomic operations. +// Example: +// +// ll.Shutdown() +// ll.Info("Ignored") // No output +func Shutdown() { + atomic.StoreInt32(&systemActive, 0) +} + +// Active returns true if the global logging system is currently active. +// Thread-safe via atomic operations. +// Example: +// +// if ll.Active() { +// ll.Info("System active") // Output: [] INFO: System active +// } +func Active() bool { + return atomic.LoadInt32(&systemActive) == 1 +} + +// Enable activates logging for the default logger. +// It allows logs to be emitted if other conditions (level, namespace) are met. +// Thread-safe with write lock. Returns the default logger for method chaining. +// Example: +// +// ll.Disable() +// ll.Info("Ignored") // No output +// ll.Enable() +// ll.Info("Logged") // Output: [] INFO: Logged +func Enable() *Logger { + return defaultLogger.Enable() +} + +// Disable deactivates logging for the default logger. +// It suppresses all logs, regardless of level or namespace. Thread-safe with write lock. +// Returns the default logger for method chaining. +// Example: +// +// ll.Disable() +// ll.Info("Ignored") // No output +func Disable() *Logger { + return defaultLogger.Disable() +} + +// Dbg logs debug information including the source file, line number, and expression value +// using the default logger. It captures the calling line of code and displays both the +// expression and its value. Useful for debugging without temporary print statements. +// Example: +// +// x := 42 +// ll.Dbg(x) // Output: [file.go:123] x = 42 +func Dbg(any ...interface{}) { + defaultLogger.dbg(2, any...) +} + +// Dump displays a hex and ASCII representation of a value’s binary form using the default logger. +// It serializes the value using gob encoding or direct conversion and shows a hex/ASCII dump. +// Useful for inspecting binary data structures. +// Example: +// +// ll.Dump([]byte{0x41, 0x42}) // Outputs hex/ASCII dump +func Dump(any interface{}) { + defaultLogger.Dump(any) +} + +// Enabled returns whether the default logger is enabled for logging. +// It provides thread-safe read access to the enabled field using a read lock. +// Example: +// +// ll.Enable() +// if ll.Enabled() { +// ll.Info("Logging enabled") // Output: [] INFO: Logging enabled +// } +func Enabled() bool { + return defaultLogger.Enabled() +} + +// Fields starts a fluent chain for adding fields using variadic key-value pairs with the default logger. +// It creates a FieldBuilder to attach fields, handling non-string keys or uneven pairs by +// adding an error field. Thread-safe via the FieldBuilder’s logger. +// Example: +// +// ll.Fields("user", "alice").Info("Action") // Output: [] INFO: Action [user=alice] +func Fields(pairs ...any) *FieldBuilder { + return defaultLogger.Fields(pairs...) +} + +// Field starts a fluent chain for adding fields from a map with the default logger. +// It creates a FieldBuilder to attach fields from a map, supporting type-safe field addition. +// Thread-safe via the FieldBuilder’s logger. +// Example: +// +// ll.Field(map[string]interface{}{"user": "alice"}).Info("Action") // Output: [] INFO: Action [user=alice] +func Field(fields map[string]interface{}) *FieldBuilder { + return defaultLogger.Field(fields) +} + +// Line adds vertical spacing (newlines) to the log output using the default logger. +// If no arguments are provided, it defaults to 1 newline. Multiple values are summed to +// determine the total lines. Useful for visually separating log sections. Thread-safe. +// Example: +// +// ll.Line(2).Info("After two newlines") // Adds 2 blank lines before: [] INFO: After two newlines +func Line(lines ...int) *Logger { + return defaultLogger.Line(lines...) +} + +// Indent sets the indentation level for all log messages of the default logger. +// Each level adds two spaces to the log message, useful for hierarchical output. +// Thread-safe with write lock. Returns the default logger for method chaining. +// Example: +// +// ll.Indent(2) +// ll.Info("Indented") // Output: [] INFO: Indented +func Indent(depth int) *Logger { + return defaultLogger.Indent(depth) +} + +// Mark logs the current file and line number where it's called, without any additional debug information. +// It's useful for tracing execution flow without the verbosity of Dbg. +// Example: +// +// logger.Mark() // *MARK*: [file.go:123] +func Mark(names ...string) { + defaultLogger.mark(2, names...) + +} diff --git a/vendor/github.com/olekukonko/ll/lc.go b/vendor/github.com/olekukonko/ll/lc.go new file mode 100644 index 0000000..1187135 --- /dev/null +++ b/vendor/github.com/olekukonko/ll/lc.go @@ -0,0 +1,48 @@ +package ll + +import "github.com/olekukonko/ll/lx" + +// defaultStore is the global namespace store for enable/disable states. +// It is shared across all Logger instances to manage namespace hierarchy consistently. +// Thread-safe via the lx.Namespace struct’s sync.Map. +var defaultStore = &lx.Namespace{} + +// systemActive indicates if the global logging system is active. +// Defaults to true, meaning logging is active unless explicitly shut down. +// Or, default to false and require an explicit ll.Start(). Let's default to true for less surprise. +var systemActive int32 = 1 // 1 for true, 0 for false (for atomic operations) + +// Option defines a functional option for configuring a Logger. +type Option func(*Logger) + +// reverseString reverses the input string by swapping characters from both ends. +// It converts the string to a rune slice to handle Unicode characters correctly, +// ensuring proper reversal for multi-byte characters. +// Used internally for string manipulation, such as in debugging or log formatting. +func reverseString(s string) string { + // Convert string to rune slice to handle Unicode characters + r := []rune(s) + // Iterate over half the slice, swapping characters from start and end + for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 { + r[i], r[j] = r[j], r[i] + } + // Convert rune slice back to string and return + return string(r) +} + +// viewString converts a byte slice to a printable string, replacing non-printable +// characters (ASCII < 32 or > 126) with a dot ('.'). +// It ensures safe display of binary data in logs, such as in the Dump method. +// Used for formatting binary data in a human-readable hex/ASCII dump. +func viewString(b []byte) string { + // Convert byte slice to rune slice via string for processing + r := []rune(string(b)) + // Replace non-printable characters with '.' + for i := range r { + if r[i] < 32 || r[i] > 126 { + r[i] = '.' + } + } + // Return the resulting printable string + return string(r) +} diff --git a/vendor/github.com/olekukonko/ll/lh/buffered.go b/vendor/github.com/olekukonko/ll/lh/buffered.go new file mode 100644 index 0000000..0fc8c14 --- /dev/null +++ b/vendor/github.com/olekukonko/ll/lh/buffered.go @@ -0,0 +1,279 @@ +package lh + +import ( + "fmt" + "io" + "os" + "runtime" + "sync" + "time" + + "github.com/olekukonko/ll/lx" +) + +// Buffering holds configuration for the Buffered handler. +type Buffering struct { + BatchSize int // Flush when this many entries are buffered (default: 100) + FlushInterval time.Duration // Maximum time between flushes (default: 10s) + MaxBuffer int // Maximum buffer size before applying backpressure (default: 1000) + OnOverflow func(int) // Called when buffer reaches MaxBuffer (default: logs warning) +} + +// BufferingOpt configures Buffered handler. +type BufferingOpt func(*Buffering) + +// WithBatchSize sets the batch size for flushing. +// It specifies the number of log entries to buffer before flushing to the underlying handler. +// Example: +// +// handler := NewBuffered(textHandler, WithBatchSize(50)) // Flush every 50 entries +func WithBatchSize(size int) BufferingOpt { + return func(c *Buffering) { + c.BatchSize = size + } +} + +// WithFlushInterval sets the maximum time between flushes. +// It defines the interval at which buffered entries are flushed, even if the batch size is not reached. +// Example: +// +// handler := NewBuffered(textHandler, WithFlushInterval(5*time.Second)) // Flush every 5 seconds +func WithFlushInterval(d time.Duration) BufferingOpt { + return func(c *Buffering) { + c.FlushInterval = d + } +} + +// WithMaxBuffer sets the maximum buffer size before backpressure. +// It limits the number of entries that can be queued in the channel, triggering overflow handling if exceeded. +// Example: +// +// handler := NewBuffered(textHandler, WithMaxBuffer(500)) // Allow up to 500 buffered entries +func WithMaxBuffer(size int) BufferingOpt { + return func(c *Buffering) { + c.MaxBuffer = size + } +} + +// WithOverflowHandler sets the overflow callback. +// It specifies a function to call when the buffer reaches MaxBuffer, typically for logging or metrics. +// Example: +// +// handler := NewBuffered(textHandler, WithOverflowHandler(func(n int) { fmt.Printf("Overflow: %d entries\n", n) })) +func WithOverflowHandler(fn func(int)) BufferingOpt { + return func(c *Buffering) { + c.OnOverflow = fn + } +} + +// Buffered wraps any Handler to provide buffering capabilities. +// It buffers log entries in a channel and flushes them based on batch size, time interval, or explicit flush. +// The generic type H ensures compatibility with any lx.Handler implementation. +// Thread-safe via channels and sync primitives. +type Buffered[H lx.Handler] struct { + handler H // Underlying handler to process log entries + config *Buffering // Configuration for batching and flushing + entries chan *lx.Entry // Channel for buffering log entries + flushSignal chan struct{} // Channel to trigger explicit flushes + shutdown chan struct{} // Channel to signal worker shutdown + shutdownOnce sync.Once // Ensures Close is called only once + wg sync.WaitGroup // Waits for worker goroutine to finish +} + +// NewBuffered creates a new buffered handler that wraps another handler. +// It initializes the handler with default or provided configuration options and starts a worker goroutine. +// Thread-safe via channel operations and finalizer for cleanup. +// Example: +// +// textHandler := lh.NewTextHandler(os.Stdout) +// buffered := NewBuffered(textHandler, WithBatchSize(50)) +func NewBuffered[H lx.Handler](handler H, opts ...BufferingOpt) *Buffered[H] { + // Initialize default configuration + config := &Buffering{ + BatchSize: 100, // Default: flush every 100 entries + FlushInterval: 10 * time.Second, // Default: flush every 10 seconds + MaxBuffer: 1000, // Default: max 1000 entries in buffer + OnOverflow: func(count int) { // Default: log overflow to io.Discard + fmt.Fprintf(io.Discard, "log buffer overflow: %d entries\n", count) + }, + } + + // Apply provided options + for _, opt := range opts { + opt(config) + } + + // Ensure sane configuration values + if config.BatchSize < 1 { + config.BatchSize = 1 // Minimum batch size is 1 + } + if config.MaxBuffer < config.BatchSize { + config.MaxBuffer = config.BatchSize * 10 // Ensure buffer is at least 10x batch size + } + if config.FlushInterval <= 0 { + config.FlushInterval = 10 * time.Second // Minimum flush interval is 10s + } + + // Initialize Buffered handler + b := &Buffered[H]{ + handler: handler, // Set underlying handler + config: config, // Set configuration + entries: make(chan *lx.Entry, config.MaxBuffer), // Create buffered channel + flushSignal: make(chan struct{}, 1), // Create single-slot flush signal channel + shutdown: make(chan struct{}), // Create shutdown signal channel + } + + // Start worker goroutine + b.wg.Add(1) + go b.worker() + + // Set finalizer for cleanup during garbage collection + runtime.SetFinalizer(b, (*Buffered[H]).Final) + return b +} + +// Handle implements the lx.Handler interface. +// It buffers log entries in the entries channel or triggers a flush on overflow. +// Returns an error if the buffer is full and flush cannot be triggered. +// Thread-safe via non-blocking channel operations. +// Example: +// +// buffered.Handle(&lx.Entry{Message: "test"}) // Buffers entry or triggers flush +func (b *Buffered[H]) Handle(e *lx.Entry) error { + select { + case b.entries <- e: // Buffer entry if channel has space + return nil + default: // Handle buffer overflow + if b.config.OnOverflow != nil { + b.config.OnOverflow(len(b.entries)) // Call overflow handler + } + select { + case b.flushSignal <- struct{}{}: // Trigger flush if possible + return fmt.Errorf("log buffer overflow, triggering flush") + default: // Flush already in progress + return fmt.Errorf("log buffer overflow and flush already in progress") + } + } +} + +// Flush triggers an immediate flush of buffered entries. +// It sends a signal to the worker to process all buffered entries. +// If a flush is already pending, it waits briefly and may exit without flushing. +// Thread-safe via non-blocking channel operations. +// Example: +// +// buffered.Flush() // Flushes all buffered entries +func (b *Buffered[H]) Flush() { + select { + case b.flushSignal <- struct{}{}: // Signal worker to flush + case <-time.After(100 * time.Millisecond): // Timeout if flush is pending + // Flush already pending + } +} + +// Close flushes any remaining entries and stops the worker. +// It ensures shutdown is performed only once and waits for the worker to finish. +// Thread-safe via sync.Once and WaitGroup. +// Returns nil as it does not produce errors. +// Example: +// +// buffered.Close() // Flushes entries and stops worker +func (b *Buffered[H]) Close() error { + b.shutdownOnce.Do(func() { + close(b.shutdown) // Signal worker to shut down + b.wg.Wait() // Wait for worker to finish + runtime.SetFinalizer(b, nil) // Remove finalizer + }) + return nil +} + +// Final ensures remaining entries are flushed during garbage collection. +// It calls Close to flush entries and stop the worker. +// Used as a runtime finalizer to prevent log loss. +// Example (internal usage): +// +// runtime.SetFinalizer(buffered, (*Buffered[H]).Final) +func (b *Buffered[H]) Final() { + b.Close() +} + +// Config returns the current configuration of the Buffered handler. +// It provides access to BatchSize, FlushInterval, MaxBuffer, and OnOverflow settings. +// Example: +// +// config := buffered.Config() // Access configuration +func (b *Buffered[H]) Config() *Buffering { + return b.config +} + +// worker processes entries and handles flushing. +// It runs in a goroutine, buffering entries, flushing on batch size, timer, or explicit signal, +// and shutting down cleanly when signaled. +// Thread-safe via channel operations and WaitGroup. +func (b *Buffered[H]) worker() { + defer b.wg.Done() // Signal completion when worker exits + batch := make([]*lx.Entry, 0, b.config.BatchSize) // Buffer for batching entries + ticker := time.NewTicker(b.config.FlushInterval) // Timer for periodic flushes + defer ticker.Stop() // Clean up ticker + for { + select { + case entry := <-b.entries: // Receive new entry + batch = append(batch, entry) + // Flush if batch size is reached + if len(batch) >= b.config.BatchSize { + b.flushBatch(batch) + batch = batch[:0] + } + case <-ticker.C: // Periodic flush + if len(batch) > 0 { + b.flushBatch(batch) + batch = batch[:0] + } + case <-b.flushSignal: // Explicit flush + if len(batch) > 0 { + b.flushBatch(batch) + batch = batch[:0] + } + b.drainRemaining() // Drain all entries from the channel + case <-b.shutdown: // Shutdown signal + if len(batch) > 0 { + b.flushBatch(batch) + } + b.drainRemaining() // Flush remaining entries + return + } + } +} + +// flushBatch processes a batch of entries through the wrapped handler. +// It writes each entry to the underlying handler, logging any errors to stderr. +// Example (internal usage): +// +// b.flushBatch([]*lx.Entry{entry1, entry2}) +func (b *Buffered[H]) flushBatch(batch []*lx.Entry) { + for _, entry := range batch { + // Process each entry through the handler + if err := b.handler.Handle(entry); err != nil { + fmt.Fprintf(os.Stderr, "log flush error: %v\n", err) // Log errors to stderr + } + } +} + +// drainRemaining processes any remaining entries in the channel. +// It flushes all entries from the entries channel to the underlying handler, +// logging any errors to stderr. Used during flush or shutdown. +// Example (internal usage): +// +// b.drainRemaining() // Flushes all pending entries +func (b *Buffered[H]) drainRemaining() { + for { + select { + case entry := <-b.entries: // Process next entry + if err := b.handler.Handle(entry); err != nil { + fmt.Fprintf(os.Stderr, "log drain error: %v\n", err) // Log errors to stderr + } + default: // Exit when channel is empty + return + } + } +} diff --git a/vendor/github.com/olekukonko/ll/lh/colorized.go b/vendor/github.com/olekukonko/ll/lh/colorized.go new file mode 100644 index 0000000..8f5aa53 --- /dev/null +++ b/vendor/github.com/olekukonko/ll/lh/colorized.go @@ -0,0 +1,473 @@ +package lh + +import ( + "fmt" + "github.com/olekukonko/ll/lx" + "io" + "os" + "sort" + "strings" + "time" +) + +// Palette defines ANSI color codes for various log components. +// It specifies colors for headers, goroutines, functions, paths, stack traces, and log levels, +// used by ColorizedHandler to format log output with color. +type Palette struct { + Header string // Color for stack trace header and dump separators + Goroutine string // Color for goroutine lines in stack traces + Func string // Color for function names in stack traces + Path string // Color for file paths in stack traces + FileLine string // Color for file line numbers (not used in provided code) + Reset string // Reset code to clear color formatting + Pos string // Color for position in hex dumps + Hex string // Color for hex values in dumps + Ascii string // Color for ASCII values in dumps + Debug string // Color for Debug level messages + Info string // Color for Info level messages + Warn string // Color for Warn level messages + Error string // Color for Error level messages + Title string // Color for dump titles (BEGIN/END separators) +} + +// darkPalette defines colors optimized for dark terminal backgrounds. +// It uses bright, contrasting colors for readability on dark backgrounds. +var darkPalette = Palette{ + Header: "\033[1;31m", // Bold red for headers + Goroutine: "\033[1;36m", // Bold cyan for goroutines + Func: "\033[97m", // Bright white for functions + Path: "\033[38;5;245m", // Light gray for paths + FileLine: "\033[38;5;111m", // Muted light blue (unused) + Reset: "\033[0m", // Reset color formatting + + Title: "\033[38;5;245m", // Light gray for dump titles + Pos: "\033[38;5;117m", // Light blue for dump positions + Hex: "\033[38;5;156m", // Light green for hex values + Ascii: "\033[38;5;224m", // Light pink for ASCII values + + Debug: "\033[36m", // Cyan for Debug level + Info: "\033[32m", // Green for Info level + Warn: "\033[33m", // Yellow for Warn level + Error: "\033[31m", // Red for Error level +} + +// lightPalette defines colors optimized for light terminal backgrounds. +// It uses darker colors for better contrast on light backgrounds. +var lightPalette = Palette{ + Header: "\033[1;31m", // Same red for headers + Goroutine: "\033[34m", // Blue (darker for light bg) + Func: "\033[30m", // Black text for functions + Path: "\033[90m", // Dark gray for paths + FileLine: "\033[94m", // Blue for file lines (unused) + Reset: "\033[0m", // Reset color formatting + + Title: "\033[38;5;245m", // Light gray for dump titles + Pos: "\033[38;5;117m", // Light blue for dump positions + Hex: "\033[38;5;156m", // Light green for hex values + Ascii: "\033[38;5;224m", // Light pink for ASCII values + + Debug: "\033[36m", // Cyan for Debug level + Info: "\033[32m", // Green for Info level + Warn: "\033[33m", // Yellow for Warn level + Error: "\033[31m", // Red for Error level +} + +// ColorizedHandler is a handler that outputs log entries with ANSI color codes. +// It formats log entries with colored namespace, level, message, fields, and stack traces, +// writing the result to the provided writer. +// Thread-safe if the underlying writer is thread-safe. +type ColorizedHandler struct { + w io.Writer // Destination for colored log output + palette Palette // Color scheme for formatting + showTime bool // Whether to display timestamps + timeFormat string // Format for timestamps (defaults to time.RFC3339) +} + +// ColorOption defines a configuration function for ColorizedHandler. +// It allows customization of the handler, such as setting the color palette. +type ColorOption func(*ColorizedHandler) + +// WithColorPallet sets the color palette for the ColorizedHandler. +// It allows specifying a custom Palette for dark or light terminal backgrounds. +// Example: +// +// handler := NewColorizedHandler(os.Stdout, WithColorPallet(lightPalette)) +func WithColorPallet(pallet Palette) ColorOption { + return func(c *ColorizedHandler) { + c.palette = pallet + } +} + +// NewColorizedHandler creates a new ColorizedHandler writing to the specified writer. +// It initializes the handler with a detected or specified color palette and applies +// optional configuration functions. +// Example: +// +// handler := NewColorizedHandler(os.Stdout) +// logger := ll.New("app").Enable().Handler(handler) +// logger.Info("Test") // Output: [app] : Test +func NewColorizedHandler(w io.Writer, opts ...ColorOption) *ColorizedHandler { + // Initialize with writer + c := &ColorizedHandler{w: w, + showTime: false, + timeFormat: time.RFC3339, + } + + // Apply configuration options + for _, opt := range opts { + opt(c) + } + // Detect palette if not set + c.palette = c.detectPalette() + return c +} + +// Handle processes a log entry and writes it with ANSI color codes. +// It delegates to specialized methods based on the entry's class (Dump, Raw, or regular). +// Returns an error if writing to the underlying writer fails. +// Thread-safe if the writer is thread-safe. +// Example: +// +// handler.Handle(&lx.Entry{Message: "test", Level: lx.LevelInfo}) // Writes colored output +func (h *ColorizedHandler) Handle(e *lx.Entry) error { + switch e.Class { + case lx.ClassDump: + // Handle hex dump entries + return h.handleDumpOutput(e) + case lx.ClassRaw: + // Write raw entries directly + _, err := h.w.Write([]byte(e.Message)) + return err + default: + // Handle standard log entries + return h.handleRegularOutput(e) + } +} + +// Timestamped enables or disables timestamp display and optionally sets a custom time format. +// If format is empty, defaults to RFC3339. +// Example: +// +// handler := NewColorizedHandler(os.Stdout).Timestamped(true, time.StampMilli) +// // Output: Jan 02 15:04:05.000 [app] INFO: Test +func (h *ColorizedHandler) Timestamped(enable bool, format ...string) { + h.showTime = enable + if len(format) > 0 && format[0] != "" { + h.timeFormat = format[0] + } +} + +// handleRegularOutput handles normal log entries. +// It formats the entry with colored namespace, level, message, fields, and stack trace (if present), +// writing the result to the handler's writer. +// Returns an error if writing fails. +// Example (internal usage): +// +// h.handleRegularOutput(&lx.Entry{Message: "test", Level: lx.LevelInfo}) // Writes colored output +func (h *ColorizedHandler) handleRegularOutput(e *lx.Entry) error { + var builder strings.Builder // Buffer for building formatted output + + // Add timestamp if enabled + if h.showTime { + builder.WriteString(e.Timestamp.Format(h.timeFormat)) + builder.WriteString(lx.Space) + } + + // Format namespace with colors + h.formatNamespace(&builder, e) + + // Format level with color based on severity + h.formatLevel(&builder, e) + + // Add message and fields + builder.WriteString(e.Message) + h.formatFields(&builder, e) + + // fmt.Println("------------>", len(e.Stack)) + // Format stack trace if present + if len(e.Stack) > 0 { + h.formatStack(&builder, e.Stack) + } + + // Append newline for non-None levels + if e.Level != lx.LevelNone { + builder.WriteString(lx.Newline) + } + + // Write formatted output to writer + _, err := h.w.Write([]byte(builder.String())) + return err +} + +// formatNamespace formats the namespace with ANSI color codes. +// It supports FlatPath ([parent/child]) and NestedPath ([parent]→[child]) styles. +// Example (internal usage): +// +// h.formatNamespace(&builder, &lx.Entry{Namespace: "parent/child", Style: lx.FlatPath}) // Writes "[parent/child]: " +func (h *ColorizedHandler) formatNamespace(b *strings.Builder, e *lx.Entry) { + if e.Namespace == "" { + return + } + + b.WriteString(lx.LeftBracket) + switch e.Style { + case lx.NestedPath: + // Split namespace and format as [parent]→[child] + parts := strings.Split(e.Namespace, lx.Slash) + for i, part := range parts { + b.WriteString(part) + b.WriteString(lx.RightBracket) + if i < len(parts)-1 { + b.WriteString(lx.Arrow) + b.WriteString(lx.LeftBracket) + } + } + default: // FlatPath + // Format as [parent/child] + b.WriteString(e.Namespace) + b.WriteString(lx.RightBracket) + } + b.WriteString(lx.Colon) + b.WriteString(lx.Space) +} + +// formatLevel formats the log level with ANSI color codes. +// It applies a color based on the level (Debug, Info, Warn, Error) and resets afterward. +// Example (internal usage): +// +// h.formatLevel(&builder, &lx.Entry{Level: lx.LevelInfo}) // Writes "INFO: " +func (h *ColorizedHandler) formatLevel(b *strings.Builder, e *lx.Entry) { + // Map levels to colors + color := map[lx.LevelType]string{ + lx.LevelDebug: h.palette.Debug, // Cyan + lx.LevelInfo: h.palette.Info, // Green + lx.LevelWarn: h.palette.Warn, // Yellow + lx.LevelError: h.palette.Error, // Red + }[e.Level] + + b.WriteString(color) + b.WriteString(e.Level.String()) + b.WriteString(h.palette.Reset) + b.WriteString(lx.Colon) + b.WriteString(lx.Space) +} + +// formatFields formats the log entry's fields in sorted order. +// It writes fields as [key=value key=value], with no additional coloring. +// Example (internal usage): +// +// h.formatFields(&builder, &lx.Entry{Fields: map[string]interface{}{"key": "value"}}) // Writes " [key=value]" +func (h *ColorizedHandler) formatFields(b *strings.Builder, e *lx.Entry) { + if len(e.Fields) == 0 { + return + } + + // Collect and sort field keys + var keys []string + for k := range e.Fields { + keys = append(keys, k) + } + sort.Strings(keys) + + b.WriteString(lx.Space) + b.WriteString(lx.LeftBracket) + // Format fields as key=value + for i, k := range keys { + if i > 0 { + b.WriteString(lx.Space) + } + b.WriteString(k) + b.WriteString("=") + b.WriteString(fmt.Sprint(e.Fields[k])) + } + b.WriteString(lx.RightBracket) +} + +// formatStack formats a stack trace with ANSI color codes. +// It structures the stack trace with colored goroutine, function, and path segments, +// using indentation and separators for readability. +// Example (internal usage): +// +// h.formatStack(&builder, []byte("goroutine 1 [running]:\nmain.main()\n\tmain.go:10")) // Appends colored stack trace +func (h *ColorizedHandler) formatStack(b *strings.Builder, stack []byte) { + b.WriteString("\n") + b.WriteString(h.palette.Header) + b.WriteString("[stack]") + b.WriteString(h.palette.Reset) + b.WriteString("\n") + + lines := strings.Split(string(stack), "\n") + if len(lines) == 0 { + return + } + + // Format goroutine line + b.WriteString(" ┌─ ") + b.WriteString(h.palette.Goroutine) + b.WriteString(lines[0]) + b.WriteString(h.palette.Reset) + b.WriteString("\n") + + // Pair function name and file path lines + for i := 1; i < len(lines)-1; i += 2 { + funcLine := strings.TrimSpace(lines[i]) + pathLine := strings.TrimSpace(lines[i+1]) + + if funcLine != "" { + b.WriteString(" │ ") + b.WriteString(h.palette.Func) + b.WriteString(funcLine) + b.WriteString(h.palette.Reset) + b.WriteString("\n") + } + if pathLine != "" { + b.WriteString(" │ ") + + // Look for last "/" before ".go:" + lastSlash := strings.LastIndex(pathLine, "/") + goIndex := strings.Index(pathLine, ".go:") + + if lastSlash >= 0 && goIndex > lastSlash { + // Prefix path + prefix := pathLine[:lastSlash+1] + // File and line (e.g., ll.go:698 +0x5c) + suffix := pathLine[lastSlash+1:] + + b.WriteString(h.palette.Path) + b.WriteString(prefix) + b.WriteString(h.palette.Reset) + + b.WriteString(h.palette.Path) // Use mainPath color for suffix + b.WriteString(suffix) + b.WriteString(h.palette.Reset) + } else { + // Fallback: whole line is gray + b.WriteString(h.palette.Path) + b.WriteString(pathLine) + b.WriteString(h.palette.Reset) + } + + b.WriteString("\n") + } + } + + // Handle any remaining unpaired line + if len(lines)%2 == 0 && strings.TrimSpace(lines[len(lines)-1]) != "" { + b.WriteString(" │ ") + b.WriteString(h.palette.Func) + b.WriteString(strings.TrimSpace(lines[len(lines)-1])) + b.WriteString(h.palette.Reset) + b.WriteString("\n") + } + + b.WriteString(" └\n") +} + +// handleDumpOutput formats hex dump output with ANSI color codes. +// It applies colors to position, hex, ASCII, and title components of the dump, +// wrapping the output with colored BEGIN/END separators. +// Returns an error if writing fails. +// Example (internal usage): +// +// h.handleDumpOutput(&lx.Entry{Class: lx.ClassDump, Message: "pos 00 hex: 61 62 'ab'"}) // Writes colored dump +func (h *ColorizedHandler) handleDumpOutput(e *lx.Entry) error { + var builder strings.Builder + + // Add timestamp if enabled + if h.showTime { + builder.WriteString(e.Timestamp.Format(h.timeFormat)) + builder.WriteString(lx.Newline) + } + + // Write colored BEGIN separator + builder.WriteString(h.palette.Title) + builder.WriteString("---- BEGIN DUMP ----") + builder.WriteString(h.palette.Reset) + builder.WriteString("\n") + + // Process each line of the dump + lines := strings.Split(e.Message, "\n") + length := len(lines) + for i, line := range lines { + if strings.HasPrefix(line, "pos ") { + // Parse and color position and hex/ASCII parts + parts := strings.SplitN(line, "hex:", 2) + if len(parts) == 2 { + builder.WriteString(h.palette.Pos) + builder.WriteString(parts[0]) + builder.WriteString(h.palette.Reset) + + hexAscii := strings.SplitN(parts[1], "'", 2) + builder.WriteString(h.palette.Hex) + builder.WriteString("hex:") + builder.WriteString(hexAscii[0]) + builder.WriteString(h.palette.Reset) + + if len(hexAscii) > 1 { + builder.WriteString(h.palette.Ascii) + builder.WriteString("'") + builder.WriteString(hexAscii[1]) + builder.WriteString(h.palette.Reset) + } + } + } else if strings.HasPrefix(line, "Dumping value of type:") { + // Color type dump lines + builder.WriteString(h.palette.Header) + builder.WriteString(line) + builder.WriteString(h.palette.Reset) + } else { + // Write non-dump lines as-is + builder.WriteString(line) + } + + // Don't add newline for the last line + if i < length-1 { + builder.WriteString("\n") + } + } + + // Write colored END separator + builder.WriteString(h.palette.Title) + builder.WriteString("---- END DUMP ----") + builder.WriteString(h.palette.Reset) + builder.WriteString("\n") + + // Write formatted output to writer + _, err := h.w.Write([]byte(builder.String())) + return err +} + +// detectPalette selects a color palette based on terminal environment variables. +// It checks TERM_BACKGROUND, COLORFGBG, and AppleInterfaceStyle to determine +// whether a light or dark palette is appropriate, defaulting to darkPalette. +// Example (internal usage): +// +// palette := h.detectPalette() // Returns darkPalette or lightPalette +func (h *ColorizedHandler) detectPalette() Palette { + // Check TERM_BACKGROUND (e.g., iTerm2) + if bg, ok := os.LookupEnv("TERM_BACKGROUND"); ok { + if bg == "light" { + return lightPalette // Use light palette for light background + } + return darkPalette // Use dark palette otherwise + } + + // Check COLORFGBG (traditional xterm) + if fgBg, ok := os.LookupEnv("COLORFGBG"); ok { + parts := strings.Split(fgBg, ";") + if len(parts) >= 2 { + bg := parts[len(parts)-1] // Last part (some terminals add more fields) + if bg == "7" || bg == "15" || bg == "0;15" { // Handle variations + return lightPalette // Use light palette for light background + } + } + } + + // Check macOS dark mode + if style, ok := os.LookupEnv("AppleInterfaceStyle"); ok && strings.EqualFold(style, "dark") { + return darkPalette // Use dark palette for macOS dark mode + } + + // Default: dark (conservative choice for terminals) + return darkPalette +} diff --git a/vendor/github.com/olekukonko/ll/lh/json.go b/vendor/github.com/olekukonko/ll/lh/json.go new file mode 100644 index 0000000..c40576d --- /dev/null +++ b/vendor/github.com/olekukonko/ll/lh/json.go @@ -0,0 +1,170 @@ +package lh + +import ( + "encoding/json" + "fmt" + "github.com/olekukonko/ll/lx" + "io" + "os" + "strings" + "sync" + "time" +) + +// JSONHandler is a handler that outputs log entries as JSON objects. +// It formats log entries with timestamp, level, message, namespace, fields, and optional +// stack traces or dump segments, writing the result to the provided writer. +// Thread-safe with a mutex to protect concurrent writes. +type JSONHandler struct { + writer io.Writer // Destination for JSON output + timeFmt string // Format for timestamp (default: RFC3339Nano) + pretty bool // Enable pretty printing with indentation if true + fieldMap map[string]string // Optional mapping for field names (not used in provided code) + mu sync.Mutex // Protects concurrent access to writer +} + +// JsonOutput represents the JSON structure for a log entry. +// It includes all relevant log data, such as timestamp, level, message, and optional +// stack trace or dump segments, serialized as a JSON object. +type JsonOutput struct { + Time string `json:"ts"` // Timestamp in specified format + Level string `json:"lvl"` // Log level (e.g., "INFO") + Class string `json:"class"` // Entry class (e.g., "Text", "Dump") + Msg string `json:"msg"` // Log message + Namespace string `json:"ns"` // Namespace path + Stack []byte `json:"stack"` // Stack trace (if present) + Dump []dumpSegment `json:"dump"` // Hex/ASCII dump segments (for ClassDump) + Fields map[string]interface{} `json:"fields"` // Custom fields +} + +// dumpSegment represents a single segment of a hex/ASCII dump. +// Used for ClassDump entries to structure position, hex values, and ASCII representation. +type dumpSegment struct { + Offset int `json:"offset"` // Starting byte offset of the segment + Hex []string `json:"hex"` // Hexadecimal values of bytes + ASCII string `json:"ascii"` // ASCII representation of bytes +} + +// NewJSONHandler creates a new JSONHandler writing to the specified writer. +// It initializes the handler with a default timestamp format (RFC3339Nano) and optional +// configuration functions to customize settings like pretty printing. +// Example: +// +// handler := NewJSONHandler(os.Stdout) +// logger := ll.New("app").Enable().Handler(handler) +// logger.Info("Test") // Output: {"ts":"...","lvl":"INFO","class":"Text","msg":"Test","ns":"app","stack":null,"dump":null,"fields":null} +func NewJSONHandler(w io.Writer, opts ...func(*JSONHandler)) *JSONHandler { + h := &JSONHandler{ + writer: w, // Set output writer + timeFmt: time.RFC3339Nano, // Default timestamp format + } + // Apply configuration options + for _, opt := range opts { + opt(h) + } + return h +} + +// Handle processes a log entry and writes it as JSON. +// It delegates to specialized methods based on the entry's class (Dump or regular), +// ensuring thread-safety with a mutex. +// Returns an error if JSON encoding or writing fails. +// Example: +// +// handler.Handle(&lx.Entry{Message: "test", Level: lx.LevelInfo}) // Writes JSON object +func (h *JSONHandler) Handle(e *lx.Entry) error { + h.mu.Lock() + defer h.mu.Unlock() + + // Handle dump entries separately + if e.Class == lx.ClassDump { + return h.handleDump(e) + } + // Handle standard log entries + return h.handleRegular(e) +} + +// handleRegular handles standard log entries (non-dump). +// It converts the entry to a JsonOutput struct and encodes it as JSON, +// applying pretty printing if enabled. Logs encoding errors to stderr for debugging. +// Returns an error if encoding or writing fails. +// Example (internal usage): +// +// h.handleRegular(&lx.Entry{Message: "test", Level: lx.LevelInfo}) // Writes JSON object +func (h *JSONHandler) handleRegular(e *lx.Entry) error { + // Create JSON output structure + entry := JsonOutput{ + Time: e.Timestamp.Format(h.timeFmt), // Format timestamp + Level: e.Level.String(), // Convert level to string + Class: e.Class.String(), // Convert class to string + Msg: e.Message, // Set message + Namespace: e.Namespace, // Set namespace + Dump: nil, // No dump for regular entries + Fields: e.Fields, // Copy fields + Stack: e.Stack, // Include stack trace if present + } + // Create JSON encoder + enc := json.NewEncoder(h.writer) + if h.pretty { + // Enable indentation for pretty printing + enc.SetIndent("", " ") + } + // Log encoding attempt for debugging + fmt.Fprintf(os.Stderr, "Encoding JSON entry: %v\n", e.Message) + // Encode and write JSON + err := enc.Encode(entry) + if err != nil { + // Log encoding error for debugging + fmt.Fprintf(os.Stderr, "JSON encode error: %v\n", err) + } + return err +} + +// handleDump processes ClassDump entries, converting hex dump output to JSON segments. +// It parses the dump message into structured segments with offset, hex, and ASCII data, +// encoding them as a JsonOutput struct. +// Returns an error if parsing or encoding fails. +// Example (internal usage): +// +// h.handleDump(&lx.Entry{Class: lx.ClassDump, Message: "pos 00 hex: 61 62 'ab'"}) // Writes JSON with dump segments +func (h *JSONHandler) handleDump(e *lx.Entry) error { + var segments []dumpSegment + lines := strings.Split(e.Message, "\n") + + // Parse each line of the dump message + for _, line := range lines { + if !strings.HasPrefix(line, "pos") { + continue // Skip non-dump lines + } + parts := strings.SplitN(line, "hex:", 2) + if len(parts) != 2 { + continue // Skip invalid lines + } + // Parse position + var offset int + fmt.Sscanf(parts[0], "pos %d", &offset) + + // Parse hex and ASCII + hexAscii := strings.SplitN(parts[1], "'", 2) + hexStr := strings.Fields(strings.TrimSpace(hexAscii[0])) + + // Create dump segment + segments = append(segments, dumpSegment{ + Offset: offset, // Set byte offset + Hex: hexStr, // Set hex values + ASCII: strings.Trim(hexAscii[1], "'"), // Set ASCII representation + }) + } + + // Encode JSON output with dump segments + return json.NewEncoder(h.writer).Encode(JsonOutput{ + Time: e.Timestamp.Format(h.timeFmt), // Format timestamp + Level: e.Level.String(), // Convert level to string + Class: e.Class.String(), // Convert class to string + Msg: "dumping segments", // Fixed message for dumps + Namespace: e.Namespace, // Set namespace + Dump: segments, // Include parsed segments + Fields: e.Fields, // Copy fields + Stack: e.Stack, // Include stack trace if present + }) +} diff --git a/vendor/github.com/olekukonko/ll/lh/memory.go b/vendor/github.com/olekukonko/ll/lh/memory.go new file mode 100644 index 0000000..e3bc939 --- /dev/null +++ b/vendor/github.com/olekukonko/ll/lh/memory.go @@ -0,0 +1,113 @@ +package lh + +import ( + "fmt" + "github.com/olekukonko/ll/lx" + "io" + "sync" +) + +// MemoryHandler is an lx.Handler that stores log entries in memory. +// Useful for testing or buffering logs for later inspection. +// It maintains a thread-safe slice of log entries, protected by a read-write mutex. +type MemoryHandler struct { + mu sync.RWMutex // Protects concurrent access to entries + entries []*lx.Entry // Slice of stored log entries + showTime bool // Whether to show timestamps when dumping + timeFormat string // Time format for dumping +} + +// NewMemoryHandler creates a new MemoryHandler. +// It initializes an empty slice for storing log entries, ready for use in logging or testing. +// Example: +// +// handler := NewMemoryHandler() +// logger := ll.New("app").Enable().Handler(handler) +// logger.Info("Test") // Stores entry in memory +func NewMemoryHandler() *MemoryHandler { + return &MemoryHandler{ + entries: make([]*lx.Entry, 0), // Initialize empty slice for entries + } +} + +// Timestamped enables/disables timestamp display when dumping and optionally sets a time format. +// Consistent with TextHandler and ColorizedHandler signature. +// Example: +// +// handler.Timestamped(true) // Enable with default format +// handler.Timestamped(true, time.StampMilli) // Enable with custom format +// handler.Timestamped(false) // Disable +func (h *MemoryHandler) Timestamped(enable bool, format ...string) { + h.mu.Lock() + defer h.mu.Unlock() + + h.showTime = enable + if len(format) > 0 && format[0] != "" { + h.timeFormat = format[0] + } +} + +// Handle stores the log entry in memory. +// It appends the provided entry to the entries slice, ensuring thread-safety with a write lock. +// Always returns nil, as it does not perform I/O operations. +// Example: +// +// handler.Handle(&lx.Entry{Message: "test", Level: lx.LevelInfo}) // Stores entry +func (h *MemoryHandler) Handle(entry *lx.Entry) error { + h.mu.Lock() + defer h.mu.Unlock() + h.entries = append(h.entries, entry) // Append entry to slice + return nil +} + +// Entries returns a copy of the stored log entries. +// It creates a new slice with copies of all entries, ensuring thread-safety with a read lock. +// The returned slice is safe for external use without affecting the handler's internal state. +// Example: +// +// entries := handler.Entries() // Returns copy of stored entries +func (h *MemoryHandler) Entries() []*lx.Entry { + h.mu.RLock() + defer h.mu.RUnlock() + entries := make([]*lx.Entry, len(h.entries)) // Create new slice for copy + copy(entries, h.entries) // Copy entries to new slice + return entries +} + +// Reset clears all stored entries. +// It truncates the entries slice to zero length, preserving capacity, using a write lock for thread-safety. +// Example: +// +// handler.Reset() // Clears all stored entries +func (h *MemoryHandler) Reset() { + h.mu.Lock() + defer h.mu.Unlock() + h.entries = h.entries[:0] // Truncate slice to zero length +} + +// Dump writes all stored log entries to the provided io.Writer in text format. +// Entries are formatted as they would be by a TextHandler, including namespace, level, +// message, and fields. Thread-safe with read lock. +// Returns an error if writing fails. +// Example: +// +// logger := ll.New("test", ll.WithHandler(NewMemoryHandler())).Enable() +// logger.Info("Test message") +// handler := logger.handler.(*MemoryHandler) +// handler.Dump(os.Stdout) // Output: [test] INFO: Test message +func (h *MemoryHandler) Dump(w io.Writer) error { + h.mu.RLock() + defer h.mu.RUnlock() + + // Create a temporary TextHandler to format entries + tempHandler := NewTextHandler(w) + tempHandler.Timestamped(h.showTime, h.timeFormat) + + // Process each entry through the TextHandler + for _, entry := range h.entries { + if err := tempHandler.Handle(entry); err != nil { + return fmt.Errorf("failed to dump entry: %w", err) // Wrap and return write errors + } + } + return nil +} diff --git a/vendor/github.com/olekukonko/ll/lh/multi.go b/vendor/github.com/olekukonko/ll/lh/multi.go new file mode 100644 index 0000000..8a9d884 --- /dev/null +++ b/vendor/github.com/olekukonko/ll/lh/multi.go @@ -0,0 +1,51 @@ +package lh + +import ( + "errors" + "fmt" + "github.com/olekukonko/ll/lx" +) + +// MultiHandler combines multiple handlers to process log entries concurrently. +// It holds a list of lx.Handler instances and delegates each log entry to all handlers, +// collecting any errors into a single combined error. +// Thread-safe if the underlying handlers are thread-safe. +type MultiHandler struct { + Handlers []lx.Handler // List of handlers to process each log entry +} + +// NewMultiHandler creates a new MultiHandler with the specified handlers. +// It accepts a variadic list of handlers to be executed in order. +// The returned handler processes log entries by passing them to each handler in sequence. +// Example: +// +// textHandler := NewTextHandler(os.Stdout) +// jsonHandler := NewJSONHandler(os.Stdout) +// multi := NewMultiHandler(textHandler, jsonHandler) +// logger := ll.New("app").Enable().Handler(multi) +// logger.Info("Test") // Processed by both text and JSON handlers +func NewMultiHandler(h ...lx.Handler) *MultiHandler { + return &MultiHandler{ + Handlers: h, // Initialize with provided handlers + } +} + +// Handle implements the Handler interface, calling Handle on each handler in sequence. +// It collects any errors from handlers and combines them into a single error using errors.Join. +// If no errors occur, it returns nil. Thread-safe if the underlying handlers are thread-safe. +// Example: +// +// multi.Handle(&lx.Entry{Message: "test", Level: lx.LevelInfo}) // Calls Handle on all handlers +func (h *MultiHandler) Handle(e *lx.Entry) error { + var errs []error // Collect errors from handlers + for i, handler := range h.Handlers { + // Process entry with each handler + if err := handler.Handle(e); err != nil { + // fmt.Fprintf(os.Stderr, "MultiHandler error for handler %d: %v\n", i, err) + // Wrap error with handler index for context + errs = append(errs, fmt.Errorf("handler %d: %w", i, err)) + } + } + // Combine errors into a single error, or return nil if no errors + return errors.Join(errs...) +} diff --git a/vendor/github.com/olekukonko/ll/lh/slog.go b/vendor/github.com/olekukonko/ll/lh/slog.go new file mode 100644 index 0000000..7758420 --- /dev/null +++ b/vendor/github.com/olekukonko/ll/lh/slog.go @@ -0,0 +1,89 @@ +package lh + +import ( + "context" + "github.com/olekukonko/ll/lx" + "log/slog" +) + +// SlogHandler adapts a slog.Handler to implement lx.Handler. +// It converts lx.Entry objects to slog.Record objects and delegates to an underlying +// slog.Handler for processing, enabling compatibility with Go's standard slog package. +// Thread-safe if the underlying slog.Handler is thread-safe. +type SlogHandler struct { + slogHandler slog.Handler // Underlying slog.Handler for processing log records +} + +// NewSlogHandler creates a new SlogHandler wrapping the provided slog.Handler. +// It initializes the handler with the given slog.Handler, allowing lx.Entry logs to be +// processed by slog's logging infrastructure. +// Example: +// +// slogText := slog.NewTextHandler(os.Stdout, nil) +// handler := NewSlogHandler(slogText) +// logger := ll.New("app").Enable().Handler(handler) +// logger.Info("Test") // Output: level=INFO msg=Test namespace=app class=Text +func NewSlogHandler(h slog.Handler) *SlogHandler { + return &SlogHandler{slogHandler: h} +} + +// Handle converts an lx.Entry to slog.Record and delegates to the slog.Handler. +// It maps the entry's fields, level, namespace, class, and stack trace to slog attributes, +// passing the resulting record to the underlying slog.Handler. +// Returns an error if the slog.Handler fails to process the record. +// Thread-safe if the underlying slog.Handler is thread-safe. +// Example: +// +// handler.Handle(&lx.Entry{Message: "test", Level: lx.LevelInfo}) // Processes as slog record +func (h *SlogHandler) Handle(e *lx.Entry) error { + // Convert lx.LevelType to slog.Level + level := toSlogLevel(e.Level) + + // Create a slog.Record with the entry's data + record := slog.NewRecord( + e.Timestamp, // time.Time for log timestamp + level, // slog.Level for log severity + e.Message, // string for log message + 0, // pc (program counter, optional, not used) + ) + + // Add standard fields as attributes + record.AddAttrs( + slog.String("namespace", e.Namespace), // Add namespace as string attribute + slog.String("class", e.Class.String()), // Add class as string attribute + ) + + // Add stack trace if present + if len(e.Stack) > 0 { + record.AddAttrs(slog.String("stack", string(e.Stack))) // Add stack trace as string + } + + // Add custom fields + for k, v := range e.Fields { + record.AddAttrs(slog.Any(k, v)) // Add each field as a key-value attribute + } + + // Handle the record with the underlying slog.Handler + return h.slogHandler.Handle(context.Background(), record) +} + +// toSlogLevel converts lx.LevelType to slog.Level. +// It maps the logging levels used by the lx package to those used by slog, +// defaulting to slog.LevelInfo for unknown levels. +// Example (internal usage): +// +// level := toSlogLevel(lx.LevelDebug) // Returns slog.LevelDebug +func toSlogLevel(level lx.LevelType) slog.Level { + switch level { + case lx.LevelDebug: + return slog.LevelDebug + case lx.LevelInfo: + return slog.LevelInfo + case lx.LevelWarn: + return slog.LevelWarn + case lx.LevelError: + return slog.LevelError + default: + return slog.LevelInfo // Default for unknown levels + } +} diff --git a/vendor/github.com/olekukonko/ll/lh/text.go b/vendor/github.com/olekukonko/ll/lh/text.go new file mode 100644 index 0000000..7423e21 --- /dev/null +++ b/vendor/github.com/olekukonko/ll/lh/text.go @@ -0,0 +1,225 @@ +package lh + +import ( + "fmt" + "github.com/olekukonko/ll/lx" + "io" + "sort" + "strings" + "time" +) + +// TextHandler is a handler that outputs log entries as plain text. +// It formats log entries with namespace, level, message, fields, and optional stack traces, +// writing the result to the provided writer. +// Thread-safe if the underlying writer is thread-safe. +type TextHandler struct { + w io.Writer // Destination for formatted log output + showTime bool // Whether to display timestamps + timeFormat string // Format for timestamps (defaults to time.RFC3339) +} + +// NewTextHandler creates a new TextHandler writing to the specified writer. +// It initializes the handler with the given writer, suitable for outputs like stdout or files. +// Example: +// +// handler := NewTextHandler(os.Stdout) +// logger := ll.New("app").Enable().Handler(handler) +// logger.Info("Test") // Output: [app] INFO: Test +func NewTextHandler(w io.Writer) *TextHandler { + return &TextHandler{ + w: w, + showTime: false, + timeFormat: time.RFC3339, + } +} + +// Timestamped enables or disables timestamp display and optionally sets a custom time format. +// If format is empty, defaults to RFC3339. +// Example: +// +// handler := NewTextHandler(os.Stdout).TextWithTime(true, time.StampMilli) +// // Output: Jan 02 15:04:05.000 [app] INFO: Test +func (h *TextHandler) Timestamped(enable bool, format ...string) { + h.showTime = enable + if len(format) > 0 && format[0] != "" { + h.timeFormat = format[0] + } +} + +// Handle processes a log entry and writes it as plain text. +// It delegates to specialized methods based on the entry's class (Dump, Raw, or regular). +// Returns an error if writing to the underlying writer fails. +// Thread-safe if the writer is thread-safe. +// Example: +// +// handler.Handle(&lx.Entry{Message: "test", Level: lx.LevelInfo}) // Writes "INFO: test" +func (h *TextHandler) Handle(e *lx.Entry) error { + // Special handling for dump output + if e.Class == lx.ClassDump { + return h.handleDumpOutput(e) + } + + // Raw entries are written directly without formatting + if e.Class == lx.ClassRaw { + _, err := h.w.Write([]byte(e.Message)) + return err + } + + // Handle standard log entries + return h.handleRegularOutput(e) +} + +// handleRegularOutput handles normal log entries. +// It formats the entry with namespace, level, message, fields, and stack trace (if present), +// writing the result to the handler's writer. +// Returns an error if writing fails. +// Example (internal usage): +// +// h.handleRegularOutput(&lx.Entry{Message: "test", Level: lx.LevelInfo}) // Writes "INFO: test" +func (h *TextHandler) handleRegularOutput(e *lx.Entry) error { + var builder strings.Builder // Buffer for building formatted output + + // Add timestamp if enabled + if h.showTime { + builder.WriteString(e.Timestamp.Format(h.timeFormat)) + builder.WriteString(lx.Space) + } + + // Format namespace based on style + switch e.Style { + case lx.NestedPath: + if e.Namespace != "" { + // Split namespace into parts and format as [parent]→[child] + parts := strings.Split(e.Namespace, lx.Slash) + for i, part := range parts { + builder.WriteString(lx.LeftBracket) + builder.WriteString(part) + builder.WriteString(lx.RightBracket) + if i < len(parts)-1 { + builder.WriteString(lx.Arrow) + } + } + builder.WriteString(lx.Colon) + builder.WriteString(lx.Space) + } + default: // FlatPath + if e.Namespace != "" { + // Format namespace as [parent/child] + builder.WriteString(lx.LeftBracket) + builder.WriteString(e.Namespace) + builder.WriteString(lx.RightBracket) + builder.WriteString(lx.Space) + } + } + + // Add level and message + builder.WriteString(e.Level.String()) + builder.WriteString(lx.Colon) + builder.WriteString(lx.Space) + builder.WriteString(e.Message) + + // Add fields in sorted order + if len(e.Fields) > 0 { + var keys []string + for k := range e.Fields { + keys = append(keys, k) + } + // Sort keys for consistent output + sort.Strings(keys) + builder.WriteString(lx.Space) + builder.WriteString(lx.LeftBracket) + for i, k := range keys { + if i > 0 { + builder.WriteString(lx.Space) + } + // Format field as key=value + builder.WriteString(k) + builder.WriteString("=") + builder.WriteString(fmt.Sprint(e.Fields[k])) + } + builder.WriteString(lx.RightBracket) + } + + // Add stack trace if present + if len(e.Stack) > 0 { + h.formatStack(&builder, e.Stack) + } + + // Append newline for non-None levels + if e.Level != lx.LevelNone { + builder.WriteString(lx.Newline) + } + + // Write formatted output to writer + _, err := h.w.Write([]byte(builder.String())) + return err +} + +// handleDumpOutput specially formats hex dump output (plain text version). +// It wraps the dump message with BEGIN/END separators for clarity. +// Returns an error if writing fails. +// Example (internal usage): +// +// h.handleDumpOutput(&lx.Entry{Class: lx.ClassDump, Message: "pos 00 hex: 61"}) // Writes "---- BEGIN DUMP ----\npos 00 hex: 61\n---- END DUMP ----\n" +func (h *TextHandler) handleDumpOutput(e *lx.Entry) error { + // For text handler, we just add a newline before dump output + var builder strings.Builder // Buffer for building formatted output + + // Add timestamp if enabled + if h.showTime { + builder.WriteString(e.Timestamp.Format(h.timeFormat)) + builder.WriteString(lx.Newline) + } + + // Add separator lines and dump content + builder.WriteString("---- BEGIN DUMP ----\n") + builder.WriteString(e.Message) + builder.WriteString("---- END DUMP ----\n") + + // Write formatted output to writer + _, err := h.w.Write([]byte(builder.String())) + return err +} + +// formatStack formats a stack trace for plain text output. +// It structures the stack trace with indentation and separators for readability, +// including goroutine and function/file details. +// Example (internal usage): +// +// h.formatStack(&builder, []byte("goroutine 1 [running]:\nmain.main()\n\tmain.go:10")) // Appends formatted stack trace +func (h *TextHandler) formatStack(b *strings.Builder, stack []byte) { + lines := strings.Split(string(stack), "\n") + if len(lines) == 0 { + return + } + + // Start stack trace section + b.WriteString("\n[stack]\n") + + // First line: goroutine + b.WriteString(" ┌─ ") + b.WriteString(lines[0]) + b.WriteString("\n") + + // Iterate through remaining lines + for i := 1; i < len(lines); i++ { + line := strings.TrimSpace(lines[i]) + if line == "" { + continue + } + + if strings.Contains(line, ".go") { + // File path lines get extra indent + b.WriteString(" ├ ") + } else { + // Function names + b.WriteString(" │ ") + } + b.WriteString(line) + b.WriteString("\n") + } + + // End stack trace section + b.WriteString(" └\n") +} diff --git a/vendor/github.com/olekukonko/ll/ll.go b/vendor/github.com/olekukonko/ll/ll.go new file mode 100644 index 0000000..44e5151 --- /dev/null +++ b/vendor/github.com/olekukonko/ll/ll.go @@ -0,0 +1,1448 @@ +package ll + +import ( + "bufio" + "encoding/binary" + "encoding/json" + "fmt" + "github.com/olekukonko/ll/lh" + "github.com/olekukonko/ll/lx" + "io" + "math" + "os" + "reflect" + "runtime" + "strings" + "sync" + "sync/atomic" + "time" +) + +// Logger manages logging configuration and behavior, encapsulating state such as enablement, +// log level, namespaces, context fields, output style, handler, middleware, and formatting. +// It is thread-safe, using a read-write mutex to protect concurrent access to its fields. +type Logger struct { + mu sync.RWMutex // Guards concurrent access to fields + enabled bool // Determines if logging is enabled + suspend bool // uses suspend path for most actions eg. skipping namespace checks + level lx.LevelType // Minimum log level (e.g., Debug, Info, Warn, Error) + namespaces *lx.Namespace // Manages namespace enable/disable states + currentPath string // Current namespace path (e.g., "parent/child") + context map[string]interface{} // Contextual fields included in all logs + style lx.StyleType // Namespace formatting style (FlatPath or NestedPath) + handler lx.Handler // Output handler for logs (e.g., text, JSON) + middleware []Middleware // Middleware functions to process log entries + prefix string // Prefix prepended to log messages + indent int // Number of double spaces for message indentation + stackBufferSize int // Buffer size for capturing stack traces + separator string // Separator for namespace paths (e.g., "/") + entries atomic.Int64 // Tracks total log entries sent to handler +} + +// New creates a new Logger with the given namespace and optional configurations. +// It initializes with defaults: disabled, Debug level, flat namespace style, text handler +// to os.Stdout, and an empty middleware chain. Options (e.g., WithHandler, WithLevel) can +// override defaults. The logger is thread-safe via mutex-protected methods. +// Example: +// +// logger := New("app", WithHandler(lh.NewTextHandler(os.Stdout))).Enable() +// logger.Info("Starting application") // Output: [app] INFO: Starting application +func New(namespace string, opts ...Option) *Logger { + logger := &Logger{ + enabled: lx.DefaultEnabled, // Defaults to disabled (false) + level: lx.LevelDebug, // Default minimum log level + namespaces: defaultStore, // Shared namespace store + currentPath: namespace, // Initial namespace path + context: make(map[string]interface{}), // Empty context for fields + style: lx.FlatPath, // Default namespace style ([parent/child]) + handler: lh.NewTextHandler(os.Stdout), // Default text output to stdout + middleware: make([]Middleware, 0), // Empty middleware chain + stackBufferSize: 4096, // Default stack trace buffer size + separator: lx.Slash, // Default namespace separator ("/") + } + + // Apply provided configuration options + for _, opt := range opts { + opt(logger) + } + + return logger +} + +// AddContext adds a key-value pair to the logger's context, modifying it directly. +// Unlike Context, it mutates the existing context. It is thread-safe using a write lock. +// Example: +// +// logger := New("app").Enable() +// logger.AddContext("user", "alice") +// logger.Info("Action") // Output: [app] INFO: Action [user=alice] +func (l *Logger) AddContext(key string, value interface{}) *Logger { + l.mu.Lock() + defer l.mu.Unlock() + + // Initialize context map if nil + if l.context == nil { + l.context = make(map[string]interface{}) + } + l.context[key] = value + return l +} + +// Benchmark logs the duration since a start time at Info level, including "start", +// "end", and "duration" fields. It is thread-safe via Fields and log methods. +// Example: +// +// logger := New("app").Enable() +// start := time.Now() +// logger.Benchmark(start) // Output: [app] INFO: benchmark [start=... end=... duration=...] +func (l *Logger) Benchmark(start time.Time) time.Duration { + duration := time.Since(start) + l.Fields("start", start, "end", time.Now(), "duration", duration).Infof("benchmark") + return duration +} + +// CanLog checks if a log at the given level would be emitted, considering enablement, +// log level, namespaces, sampling, and rate limits. It is thread-safe via shouldLog. +// Example: +// +// logger := New("app").Enable().Level(lx.LevelWarn) +// canLog := logger.CanLog(lx.LevelInfo) // false +func (l *Logger) CanLog(level lx.LevelType) bool { + return l.shouldLog(level) +} + +// Clear removes all middleware functions, resetting the middleware chain to empty. +// It is thread-safe using a write lock and returns the logger for chaining. +// Example: +// +// logger := New("app").Enable().Use(someMiddleware) +// logger.Clear() +// logger.Info("No middleware") // Output: [app] INFO: No middleware +func (l *Logger) Clear() *Logger { + l.mu.Lock() + defer l.mu.Unlock() + l.middleware = nil + return l +} + +// Clone creates a new logger with the same configuration and namespace as the parent, +// but with a fresh context map to allow independent field additions. It is thread-safe +// using a read lock. +// Example: +// +// logger := New("app").Enable().Context(map[string]interface{}{"k": "v"}) +// clone := logger.Clone() +// clone.Info("Cloned") // Output: [app] INFO: Cloned [k=v] +func (l *Logger) Clone() *Logger { + l.mu.RLock() + defer l.mu.RUnlock() + + return &Logger{ + enabled: l.enabled, // Copy enablement state + level: l.level, // Copy log level + namespaces: l.namespaces, // Share namespace store + currentPath: l.currentPath, // Copy namespace path + context: make(map[string]interface{}), // Fresh context map + style: l.style, // Copy namespace style + handler: l.handler, // Copy output handler + middleware: l.middleware, // Copy middleware chain + prefix: l.prefix, // Copy message prefix + indent: l.indent, // Copy indentation level + stackBufferSize: l.stackBufferSize, // Copy stack trace buffer size + separator: l.separator, // Default separator ("/") + suspend: l.suspend, + } +} + +// Context creates a new logger with additional contextual fields, preserving existing +// fields and adding new ones. It returns a new logger to avoid mutating the parent and +// is thread-safe using a write lock. +// Example: +// +// logger := New("app").Enable() +// logger = logger.Context(map[string]interface{}{"user": "alice"}) +// logger.Info("Action") // Output: [app] INFO: Action [user=alice] +func (l *Logger) Context(fields map[string]interface{}) *Logger { + l.mu.Lock() + defer l.mu.Unlock() + + // Create a new logger with inherited configuration + newLogger := &Logger{ + enabled: l.enabled, + level: l.level, + namespaces: l.namespaces, + currentPath: l.currentPath, + context: make(map[string]interface{}), + style: l.style, + handler: l.handler, + middleware: l.middleware, + prefix: l.prefix, + indent: l.indent, + stackBufferSize: l.stackBufferSize, + separator: l.separator, + suspend: l.suspend, + } + + // Copy parent's context fields + for k, v := range l.context { + newLogger.context[k] = v + } + + // Add new fields + for k, v := range fields { + newLogger.context[k] = v + } + + return newLogger +} + +// Dbg logs debug information, including the source file, line number, and expression +// value, capturing the calling line of code. It is useful for debugging without temporary +// print statements. +// Example: +// +// x := 42 +// logger.Dbg(x) // Output: [file.go:123] x = 42 +func (l *Logger) Dbg(values ...interface{}) { + // Skip logging if Info level is not enabled + if !l.shouldLog(lx.LevelInfo) { + return + } + + l.dbg(2, values...) +} + +// Debug logs a message at Debug level, formatting it and delegating to the internal +// log method. It is thread-safe. +// Example: +// +// logger := New("app").Enable().Level(lx.LevelDebug) +// logger.Debug("Debugging") // Output: [app] DEBUG: Debugging +func (l *Logger) Debug(args ...any) { + // check if suspended + if l.suspend { + return + } + + // Skip logging if Debug level is not enabled + if !l.shouldLog(lx.LevelDebug) { + return + } + + l.log(lx.LevelDebug, lx.ClassText, concatSpaced(args...), nil, false) +} + +// Debugf logs a formatted message at Debug level, delegating to Debug. It is thread-safe. +// Example: +// +// logger := New("app").Enable().Level(lx.LevelDebug) +// logger.Debugf("Debug %s", "message") // Output: [app] DEBUG: Debug message +func (l *Logger) Debugf(format string, args ...any) { + // check if suspended + if l.suspend { + return + } + + l.Debug(fmt.Sprintf(format, args...)) +} + +// Disable deactivates logging, suppressing all logs regardless of level or namespace. +// It is thread-safe using a write lock and returns the logger for chaining. +// Example: +// +// logger := New("app").Enable().Disable() +// logger.Info("Ignored") // No output +func (l *Logger) Disable() *Logger { + l.mu.Lock() + defer l.mu.Unlock() + l.enabled = false + return l +} + +// Dump displays a hex and ASCII representation of a value's binary form, using gob +// encoding or direct conversion. It is useful for inspecting binary data structures. +// Example: +// +// type Data struct { X int; Y string } +// logger.Dump(Data{42, "test"}) // Outputs hex/ASCII dump +func (l *Logger) Dump(values ...interface{}) { + // Iterate over each value to dump + for _, value := range values { + // Log value description and type + l.Infof("Dumping %v (%T)", value, value) + var by []byte + var err error + + // Convert value to byte slice based on type + switch v := value.(type) { + case []byte: + by = v + case string: + by = []byte(v) + case float32: + // Convert float32 to 4-byte big-endian + buf := make([]byte, 4) + binary.BigEndian.PutUint32(buf, math.Float32bits(v)) + by = buf + case float64: + // Convert float64 to 8-byte big-endian + buf := make([]byte, 8) + binary.BigEndian.PutUint64(buf, math.Float64bits(v)) + by = buf + case int, int8, int16, int32, int64: + // Convert signed integer to 8-byte big-endian + by = make([]byte, 8) + binary.BigEndian.PutUint64(by, uint64(reflect.ValueOf(v).Int())) + case uint, uint8, uint16, uint32, uint64: + // Convert unsigned integer to 8-byte big-endian + by = make([]byte, 8) + binary.BigEndian.PutUint64(by, reflect.ValueOf(v).Uint()) + case io.Reader: + // Read all bytes from io.Reader + by, err = io.ReadAll(v) + default: + // Fallback to JSON marshaling for complex types + by, err = json.Marshal(v) + } + + // Log error if conversion fails + if err != nil { + l.Errorf("Dump error: %v", err) + continue + } + + // Generate hex/ASCII dump + n := len(by) + rowcount := 0 + stop := (n / 8) * 8 + k := 0 + s := strings.Builder{} + // Process 8-byte rows + for i := 0; i <= stop; i += 8 { + k++ + if i+8 < n { + rowcount = 8 + } else { + rowcount = min(k*8, n) % 8 + } + // Write position and hex prefix + s.WriteString(fmt.Sprintf("pos %02d hex: ", i)) + + // Write hex values + for j := 0; j < rowcount; j++ { + s.WriteString(fmt.Sprintf("%02x ", by[i+j])) + } + // Pad with spaces for alignment + for j := rowcount; j < 8; j++ { + s.WriteString(fmt.Sprintf(" ")) + } + // Write ASCII representation + s.WriteString(fmt.Sprintf(" '%s'\n", viewString(by[i:(i+rowcount)]))) + } + // Log the hex/ASCII dump + l.log(lx.LevelNone, lx.ClassDump, s.String(), nil, false) + } +} + +// Enable activates logging, allowing logs to be emitted if other conditions (e.g., level, +// namespace) are met. It is thread-safe using a write lock and returns the logger for chaining. +// Example: +// +// logger := New("app").Enable() +// logger.Info("Started") // Output: [app] INFO: Started +func (l *Logger) Enable() *Logger { + l.mu.Lock() + defer l.mu.Unlock() + l.enabled = true + return l +} + +// Enabled checks if the logger is enabled for logging. It is thread-safe using a read lock. +// Example: +// +// logger := New("app").Enable() +// if logger.Enabled() { +// logger.Info("Logging is enabled") // Output: [app] INFO: Logging is enabled +// } +func (l *Logger) Enabled() bool { + l.mu.RLock() + defer l.mu.RUnlock() + return l.enabled +} + +// Err adds one or more errors to the logger’s context and logs them at Error level. +// Non-nil errors are stored in the "error" context field (single error or slice) and +// logged as a concatenated string (e.g., "failed 1; failed 2"). It is thread-safe and +// returns the logger for chaining. +// Example: +// +// logger := New("app").Enable() +// err1 := errors.New("failed 1") +// err2 := errors.New("failed 2") +// logger.Err(err1, err2).Info("Error occurred") +// // Output: [app] ERROR: failed 1; failed 2 +// // [app] INFO: Error occurred [error=[failed 1 failed 2]] +func (l *Logger) Err(errs ...error) { + // Skip logging if Error level is not enabled + if !l.shouldLog(lx.LevelError) { + return + } + + l.mu.Lock() + + // Initialize context map if nil + if l.context == nil { + l.context = make(map[string]interface{}) + } + + // Collect non-nil errors and build log message + var nonNilErrors []error + var builder strings.Builder + count := 0 + for i, err := range errs { + if err != nil { + if i > 0 && count > 0 { + builder.WriteString("; ") + } + builder.WriteString(err.Error()) + nonNilErrors = append(nonNilErrors, err) + count++ + } + } + + if count > 0 { + if count == 1 { + // Store single error directly + l.context["error"] = nonNilErrors[0] + } else { + // Store slice of errors + l.context["error"] = nonNilErrors + } + // Log concatenated error messages + l.log(lx.LevelError, lx.ClassText, builder.String(), nil, false) + } + l.mu.Unlock() +} + +// Error logs a message at Error level, formatting it and delegating to the internal +// log method. It is thread-safe. +// Example: +// +// logger := New("app").Enable() +// logger.Error("Error occurred") // Output: [app] ERROR: Error occurred +func (l *Logger) Error(args ...any) { + // check if suspended + if l.suspend { + return + } + + // Skip logging if Error level is not enabled + if !l.shouldLog(lx.LevelError) { + return + } + l.log(lx.LevelError, lx.ClassText, concatSpaced(args...), nil, false) +} + +// Errorf logs a formatted message at Error level, delegating to Error. It is thread-safe. +// Example: +// +// logger := New("app").Enable() +// logger.Errorf("Error %s", "occurred") // Output: [app] ERROR: Error occurred +func (l *Logger) Errorf(format string, args ...any) { + // check if suspended + if l.suspend { + return + } + + l.Error(fmt.Errorf(format, args...)) +} + +// Fatal logs a message at Error level with a stack trace and exits the program with +// exit code 1. It is thread-safe. +// Example: +// +// logger := New("app").Enable() +// logger.Fatal("Fatal error") // Output: [app] ERROR: Fatal error [stack=...], then exits +func (l *Logger) Fatal(args ...any) { + // check if suspended + if l.suspend { + return + } + + // Exit immediately if Error level is not enabled + if !l.shouldLog(lx.LevelError) { + os.Exit(1) + } + + l.log(lx.LevelError, lx.ClassText, concatSpaced(args...), nil, true) + os.Exit(1) +} + +// Fatalf logs a formatted message at Error level with a stack trace and exits the program. +// It delegates to Fatal and is thread-safe. +// Example: +// +// logger := New("app").Enable() +// logger.Fatalf("Fatal %s", "error") // Output: [app] ERROR: Fatal error [stack=...], then exits +func (l *Logger) Fatalf(format string, args ...any) { + // check if suspended + if l.suspend { + return + } + + l.Fatal(fmt.Sprintf(format, args...)) +} + +// Field starts a fluent chain for adding fields from a map, creating a FieldBuilder +// for type-safe field addition. It is thread-safe via the FieldBuilder’s logger. +// Example: +// +// logger := New("app").Enable() +// logger.Field(map[string]interface{}{"user": "alice"}).Info("Action") // Output: [app] INFO: Action [user=alice] +func (l *Logger) Field(fields map[string]interface{}) *FieldBuilder { + fb := &FieldBuilder{logger: l, fields: make(map[string]interface{})} + + // check if suspended + if l.suspend { + return fb + } + + // Copy fields from input map to FieldBuilder + for k, v := range fields { + fb.fields[k] = v + } + return fb +} + +// Fields starts a fluent chain for adding fields using variadic key-value pairs, +// creating a FieldBuilder. Non-string keys or uneven pairs add an error field. It is +// thread-safe via the FieldBuilder’s logger. +// Example: +// +// logger := New("app").Enable() +// logger.Fields("user", "alice").Info("Action") // Output: [app] INFO: Action [user=alice] +func (l *Logger) Fields(pairs ...any) *FieldBuilder { + fb := &FieldBuilder{logger: l, fields: make(map[string]interface{})} + + if l.suspend { + return fb + } + + // Process key-value pairs + for i := 0; i < len(pairs)-1; i += 2 { + if key, ok := pairs[i].(string); ok { + fb.fields[key] = pairs[i+1] + } else { + // Log error for non-string keys + fb.fields["error"] = fmt.Errorf("non-string key in Fields: %v", pairs[i]) + } + } + // Log error for uneven pairs + if len(pairs)%2 != 0 { + fb.fields["error"] = fmt.Errorf("uneven key-value pairs in Fields: [%v]", pairs[len(pairs)-1]) + } + return fb +} + +// GetContext returns the logger's context map of persistent key-value fields. It is +// thread-safe using a read lock. +// Example: +// +// logger := New("app").AddContext("user", "alice") +// ctx := logger.GetContext() // Returns map[string]interface{}{"user": "alice"} +func (l *Logger) GetContext() map[string]interface{} { + l.mu.RLock() + defer l.mu.RUnlock() + return l.context +} + +// GetHandler returns the logger's current handler for customization or inspection. +// The returned handler should not be modified concurrently with logger operations. +// Example: +// +// logger := New("app") +// handler := logger.GetHandler() // Returns the current handler (e.g., TextHandler) +func (l *Logger) GetHandler() lx.Handler { + return l.handler +} + +// GetLevel returns the minimum log level for the logger. It is thread-safe using a read lock. +// Example: +// +// logger := New("app").Level(lx.LevelWarn) +// if logger.GetLevel() == lx.LevelWarn { +// logger.Warn("Warning level set") // Output: [app] WARN: Warning level set +// } +func (l *Logger) GetLevel() lx.LevelType { + l.mu.RLock() + defer l.mu.RUnlock() + return l.level +} + +// GetPath returns the logger's current namespace path. It is thread-safe using a read lock. +// Example: +// +// logger := New("app").Namespace("sub") +// path := logger.GetPath() // Returns "app/sub" +func (l *Logger) GetPath() string { + l.mu.RLock() + defer l.mu.RUnlock() + return l.currentPath +} + +// GetSeparator returns the logger's namespace separator (e.g., "/"). It is thread-safe +// using a read lock. +// Example: +// +// logger := New("app").Separator(".") +// sep := logger.GetSeparator() // Returns "." +func (l *Logger) GetSeparator() string { + l.mu.RLock() + defer l.mu.RUnlock() + return l.separator +} + +// GetStyle returns the logger's namespace formatting style (FlatPath or NestedPath). +// It is thread-safe using a read lock. +// Example: +// +// logger := New("app").Style(lx.NestedPath) +// if logger.GetStyle() == lx.NestedPath { +// logger.Info("Nested style") // Output: [app]: INFO: Nested style +// } +func (l *Logger) GetStyle() lx.StyleType { + l.mu.RLock() + defer l.mu.RUnlock() + return l.style +} + +// Handler sets the handler for processing log entries, configuring the output destination +// and format (e.g., text, JSON). It is thread-safe using a write lock and returns the +// logger for chaining. +// Example: +// +// logger := New("app").Enable().Handler(lh.NewTextHandler(os.Stdout)) +// logger.Info("Log") // Output: [app] INFO: Log +func (l *Logger) Handler(handler lx.Handler) *Logger { + l.mu.Lock() + defer l.mu.Unlock() + l.handler = handler + return l +} + +// Indent sets the indentation level for log messages, adding two spaces per level. It is +// thread-safe using a write lock and returns the logger for chaining. +// Example: +// +// logger := New("app").Enable().Indent(2) +// logger.Info("Indented") // Output: [app] INFO: Indented +func (l *Logger) Indent(depth int) *Logger { + l.mu.Lock() + defer l.mu.Unlock() + l.indent = depth + return l +} + +// Info logs a message at Info level, formatting it and delegating to the internal log +// method. It is thread-safe. +// Example: +// +// logger := New("app").Enable().Style(lx.NestedPath) +// logger.Info("Started") // Output: [app]: INFO: Started +func (l *Logger) Info(args ...any) { + if l.suspend { + return + } + + if !l.shouldLog(lx.LevelInfo) { + return + } + + l.log(lx.LevelInfo, lx.ClassText, concatSpaced(args...), nil, false) +} + +// Infof logs a formatted message at Info level, delegating to Info. It is thread-safe. +// Example: +// +// logger := New("app").Enable().Style(lx.NestedPath) +// logger.Infof("Started %s", "now") // Output: [app]: INFO: Started now +func (l *Logger) Infof(format string, args ...any) { + if l.suspend { + return + } + + l.Info(fmt.Sprintf(format, args...)) +} + +// Len returns the total number of log entries sent to the handler, using atomic operations +// for thread safety. +// Example: +// +// logger := New("app").Enable() +// logger.Info("Test") +// count := logger.Len() // Returns 1 +func (l *Logger) Len() int64 { + return l.entries.Load() +} + +// Level sets the minimum log level, ignoring messages below it. It is thread-safe using +// a write lock and returns the logger for chaining. +// Example: +// +// logger := New("app").Enable().Level(lx.LevelWarn) +// logger.Info("Ignored") // No output +// logger.Warn("Logged") // Output: [app] WARN: Logged +func (l *Logger) Level(level lx.LevelType) *Logger { + l.mu.Lock() + defer l.mu.Unlock() + l.level = level + return l +} + +// Line adds vertical spacing (newlines) to the log output, defaulting to 1 if no arguments +// are provided. Multiple values are summed for total lines. It is thread-safe and returns +// the logger for chaining. +// Example: +// +// logger := New("app").Enable() +// logger.Line(2).Info("After 2 newlines") // Adds 2 blank lines before logging +// logger.Line().Error("After 1 newline") // Defaults to 1 +func (l *Logger) Line(lines ...int) *Logger { + line := 1 // Default to 1 newline + if len(lines) > 0 { + line = 0 + // Sum all provided line counts + for _, n := range lines { + line += n + } + // Ensure at least 1 line + if line < 1 { + line = 1 + } + } + l.log(lx.LevelNone, lx.ClassRaw, strings.Repeat(lx.Newline, line), nil, false) + return l +} + +// Mark logs the current file and line number where it's called, without any additional debug information. +// It's useful for tracing execution flow without the verbosity of Dbg. +// Example: +// +// logger.Mark() // *MARK*: [file.go:123] +func (l *Logger) Mark(name ...string) { + l.mark(2, name...) +} + +func (l *Logger) mark(skip int, names ...string) { + // Skip logging if Info level is not enabled + if !l.shouldLog(lx.LevelInfo) { + return + } + + // Get caller information (file, line) + _, file, line, ok := runtime.Caller(skip) + if !ok { + l.log(lx.LevelError, lx.ClassText, "Mark: Unable to parse runtime caller", nil, false) + return + } + + // Extract just the filename (without full path) + shortFile := file + if idx := strings.LastIndex(file, "/"); idx >= 0 { + shortFile = file[idx+1:] + } + + name := strings.Join(names, l.separator) + if name == "" { + name = "MARK" + } + + // Format as [filename:line] + out := fmt.Sprintf("[*%s*]: [%s:%d]\n", name, shortFile, line) + l.log(lx.LevelInfo, lx.ClassRaw, out, nil, false) +} + +// Measure benchmarks function execution, logging the duration at Info level with a +// "duration" field. It is thread-safe via Fields and log methods. +// Example: +// +// logger := New("app").Enable() +// duration := logger.Measure(func() { time.Sleep(time.Millisecond) }) +// // Output: [app] INFO: function executed [duration=~1ms] +func (l *Logger) Measure(fns ...func()) time.Duration { + start := time.Now() + // Execute all provided functions + for _, fn := range fns { + fn() + } + duration := time.Since(start) + l.Fields("duration", duration).Infof("function executed") + return duration +} + +// Namespace creates a child logger with a sub-namespace appended to the current path, +// inheriting the parent’s configuration but with an independent context. It is thread-safe +// using a read lock. +// Example: +// +// parent := New("parent").Enable() +// child := parent.Namespace("child") +// child.Info("Child log") // Output: [parent/child] INFO: Child log +func (l *Logger) Namespace(name string) *Logger { + if l.suspend { + return l + } + + l.mu.RLock() + defer l.mu.RUnlock() + + // Construct full namespace path + fullPath := name + if l.currentPath != "" { + fullPath = l.currentPath + l.separator + name + } + + // Create child logger with inherited configuration + return &Logger{ + enabled: l.enabled, + level: l.level, + namespaces: l.namespaces, + currentPath: fullPath, + context: make(map[string]interface{}), + style: l.style, + handler: l.handler, + middleware: l.middleware, + prefix: l.prefix, + indent: l.indent, + stackBufferSize: l.stackBufferSize, + separator: l.separator, + suspend: l.suspend, + } +} + +// NamespaceDisable disables logging for a namespace and its children, invalidating the +// namespace cache. It is thread-safe via lx.Namespace’s sync.Map and returns the logger +// for chaining. +// Example: +// +// logger := New("parent").Enable().NamespaceDisable("parent/child") +// logger.Namespace("child").Info("Ignored") // No output +func (l *Logger) NamespaceDisable(relativePath string) *Logger { + l.mu.RLock() + fullPath := l.joinPath(l.currentPath, relativePath) + l.mu.RUnlock() + + // Disable namespace in shared store + l.namespaces.Set(fullPath, false) + return l +} + +// NamespaceEnable enables logging for a namespace and its children, invalidating the +// namespace cache. It is thread-safe via lx.Namespace’s sync.Map and returns the logger +// for chaining. +// Example: +// +// logger := New("parent").Enable().NamespaceEnable("parent/child") +// logger.Namespace("child").Info("Log") // Output: [parent/child] INFO: Log +func (l *Logger) NamespaceEnable(relativePath string) *Logger { + l.mu.RLock() + fullPath := l.joinPath(l.currentPath, relativePath) + l.mu.RUnlock() + + // Enable namespace in shared store + l.namespaces.Set(fullPath, true) + return l +} + +// NamespaceEnabled checks if a namespace is enabled, considering parent namespaces and +// caching results for performance. It is thread-safe using a read lock. +// Example: +// +// logger := New("parent").Enable().NamespaceDisable("parent/child") +// enabled := logger.NamespaceEnabled("parent/child") // false +func (l *Logger) NamespaceEnabled(relativePath string) bool { + l.mu.RLock() + fullPath := l.joinPath(l.currentPath, relativePath) + separator := l.separator + if separator == "" { + separator = lx.Slash + } + instanceEnabled := l.enabled + l.mu.RUnlock() + + // Handle root path case + if fullPath == "" && relativePath == "" { + return instanceEnabled + } + + if fullPath != "" { + // Check namespace rules + isEnabledByNSRule, isDisabledByNSRule := l.namespaces.Enabled(fullPath, separator) + if isDisabledByNSRule { + return false + } + if isEnabledByNSRule { + return true + } + } + // Fall back to logger's enabled state + return instanceEnabled +} + +// Panic logs a message at Error level with a stack trace and triggers a panic. It is +// thread-safe. +// Example: +// +// logger := New("app").Enable() +// logger.Panic("Panic error") // Output: [app] ERROR: Panic error [stack=...], then panics +func (l *Logger) Panic(args ...any) { + // Build message by concatenating arguments with spaces + msg := concatSpaced(args...) + + if l.suspend { + panic(msg) + } + + // Panic immediately if Error level is not enabled + if !l.shouldLog(lx.LevelError) { + panic(msg) + } + + l.log(lx.LevelError, lx.ClassText, msg, nil, true) + panic(msg) +} + +// Panicf logs a formatted message at Error level with a stack trace and triggers a panic. +// It delegates to Panic and is thread-safe. +// Example: +// +// logger := New("app").Enable() +// logger.Panicf("Panic %s", "error") // Output: [app] ERROR: Panic error [stack=...], then panics +func (l *Logger) Panicf(format string, args ...any) { + l.Panic(fmt.Sprintf(format, args...)) +} + +// Prefix sets a prefix prepended to all log messages. It is thread-safe using a write +// lock and returns the logger for chaining. +// Example: +// +// logger := New("app").Enable().Prefix("APP: ") +// logger.Info("Started") // Output: [app] INFO: APP: Started +func (l *Logger) Prefix(prefix string) *Logger { + l.mu.Lock() + defer l.mu.Unlock() + l.prefix = prefix + return l +} + +// Print logs a message at Info level without format specifiers, minimizing allocations +// by concatenating arguments with spaces. It is thread-safe via the log method. +// Example: +// +// logger := New("app").Enable() +// logger.Print("message", "value") // Output: [app] INFO: message value +func (l *Logger) Print(args ...any) { + if l.suspend { + return + } + + // Skip logging if Info level is not enabled + if !l.shouldLog(lx.LevelInfo) { + return + } + l.log(lx.LevelNone, lx.ClassRaw, concatSpaced(args...), nil, false) +} + +// Println logs a message at Info level without format specifiers, minimizing allocations +// by concatenating arguments with spaces. It is thread-safe via the log method. +// Example: +// +// logger := New("app").Enable() +// logger.Println("message", "value") // Output: [app] INFO: message value +func (l *Logger) Println(args ...any) { + if l.suspend { + return + } + + // Skip logging if Info level is not enabled + if !l.shouldLog(lx.LevelInfo) { + return + } + l.log(lx.LevelNone, lx.ClassRaw, concatenate(lx.Space, nil, []any{lx.Newline}, args...), nil, false) +} + +// Printf logs a formatted message at Info level, delegating to Print. It is thread-safe. +// Example: +// +// logger := New("app").Enable() +// logger.Printf("Message %s", "value") // Output: [app] INFO: Message value +func (l *Logger) Printf(format string, args ...any) { + if l.suspend { + return + } + + l.Print(fmt.Sprintf(format, args...)) +} + +// Remove removes middleware by the reference returned from Use, delegating to the +// Middleware’s Remove method for thread-safe removal. +// Example: +// +// logger := New("app").Enable() +// mw := logger.Use(someMiddleware) +// logger.Remove(mw) // Removes middleware +func (l *Logger) Remove(m *Middleware) { + m.Remove() +} + +// Resume reactivates logging for the current logger after it has been suspended. +// It clears the suspend flag, allowing logs to be emitted if other conditions (e.g., level, namespace) +// are met. Thread-safe with a write lock. Returns the logger for method chaining. +// Example: +// +// logger := New("app").Enable().Suspend() +// logger.Resume() +// logger.Info("Resumed") // Output: [app] INFO: Resumed +func (l *Logger) Resume() *Logger { + l.mu.Lock() + defer l.mu.Unlock() + l.suspend = false // Clear suspend flag to resume logging + return l +} + +// Separator sets the namespace separator for grouping namespaces and log entries (e.g., "/" or "."). +// It is thread-safe using a write lock and returns the logger for chaining. +// Example: +// +// logger := New("app").Separator(".") +// logger.Namespace("sub").Info("Log") // Output: [app.sub] INFO: Log +func (l *Logger) Separator(separator string) *Logger { + l.mu.Lock() + defer l.mu.Unlock() + l.separator = separator + return l +} + +// Suspend temporarily deactivates logging for the current logger. +// It sets the suspend flag, suppressing all logs regardless of level or namespace until resumed. +// Thread-safe with a write lock. Returns the logger for method chaining. +// Example: +// +// logger := New("app").Enable() +// logger.Suspend() +// logger.Info("Ignored") // No output +func (l *Logger) Suspend() *Logger { + l.mu.Lock() + defer l.mu.Unlock() + l.suspend = true // Set suspend flag to pause logging + return l +} + +// Suspended returns whether the logger is currently suspended. +// It provides thread-safe read access to the suspend flag using a write lock. +// Example: +// +// logger := New("app").Enable().Suspend() +// if logger.Suspended() { +// fmt.Println("Logging is suspended") // Prints message +// } +func (l *Logger) Suspended() bool { + l.mu.Lock() + defer l.mu.Unlock() + return l.suspend // Return current suspend state +} + +// Stack logs messages at Error level with a stack trace for each provided argument. +// It is thread-safe and skips logging if Debug level is not enabled. +// Example: +// +// logger := New("app").Enable() +// logger.Stack("Critical error") // Output: [app] ERROR: Critical error [stack=...] +func (l *Logger) Stack(args ...any) { + if l.suspend { + return + } + + // Skip logging if Debug level is not enabled + if !l.shouldLog(lx.LevelDebug) { + return + } + + for _, arg := range args { + l.log(lx.LevelError, lx.ClassText, concat(arg), nil, true) + } +} + +// Stackf logs a formatted message at Error level with a stack trace, delegating to Stack. +// It is thread-safe. +// Example: +// +// logger := New("app").Enable() +// logger.Stackf("Critical %s", "error") // Output: [app] ERROR: Critical error [stack=...] +func (l *Logger) Stackf(format string, args ...any) { + if l.suspend { + return + } + + l.Stack(fmt.Sprintf(format, args...)) +} + +// StackSize sets the buffer size for stack trace capture in Stack, Fatal, and Panic methods. +// It is thread-safe using a write lock and returns the logger for chaining. +// Example: +// +// logger := New("app").Enable().StackSize(65536) +// logger.Stack("Error") // Captures up to 64KB stack trace +func (l *Logger) StackSize(size int) *Logger { + l.mu.Lock() + defer l.mu.Unlock() + if size > 0 { + l.stackBufferSize = size + } + return l +} + +// Style sets the namespace formatting style (FlatPath or NestedPath). FlatPath uses +// [parent/child], while NestedPath uses [parent]→[child]. It is thread-safe using a write +// lock and returns the logger for chaining. +// Example: +// +// logger := New("parent/child").Enable().Style(lx.NestedPath) +// logger.Info("Log") // Output: [parent]→[child]: INFO: Log +func (l *Logger) Style(style lx.StyleType) *Logger { + l.mu.Lock() + defer l.mu.Unlock() + l.style = style + return l +} + +// Timestamped enables or disables timestamp logging for the logger and optionally sets the timestamp format. +// It is thread-safe, using a write lock to ensure safe concurrent access. +// If the logger's handler supports the lx.Timestamper interface, the timestamp settings are applied. +// The method returns the logger instance to support method chaining. +// Parameters: +// +// enable: Boolean to enable or disable timestamp logging +// format: Optional string(s) to specify the timestamp format +func (l *Logger) Timestamped(enable bool, format ...string) *Logger { + l.mu.Lock() + defer l.mu.Unlock() + + if h, ok := l.handler.(lx.Timestamper); ok { + h.Timestamped(enable, format...) + } + return l +} + +// Use adds a middleware function to process log entries before they are handled, returning +// a Middleware handle for removal. Middleware returning a non-nil error stops the log. +// It is thread-safe using a write lock. +// Example: +// +// logger := New("app").Enable() +// mw := logger.Use(ll.FuncMiddleware(func(e *lx.Entry) error { +// if e.Level < lx.LevelWarn { +// return fmt.Errorf("level too low") +// } +// return nil +// })) +// logger.Info("Ignored") // No output +// mw.Remove() +// logger.Info("Now logged") // Output: [app] INFO: Now logged +func (l *Logger) Use(fn lx.Handler) *Middleware { + l.mu.Lock() + defer l.mu.Unlock() + + // Assign a unique ID to the middleware + id := len(l.middleware) + 1 + // Append middleware to the chain + l.middleware = append(l.middleware, Middleware{id: id, fn: fn}) + + return &Middleware{ + logger: l, + id: id, + } +} + +// Warn logs a message at Warn level, formatting it and delegating to the internal log +// method. It is thread-safe. +// Example: +// +// logger := New("app").Enable() +// logger.Warn("Warning") // Output: [app] WARN: Warning +func (l *Logger) Warn(args ...any) { + if l.suspend { + return + } + + // Skip logging if Warn level is not enabled + if !l.shouldLog(lx.LevelWarn) { + return + } + + l.log(lx.LevelWarn, lx.ClassText, concatSpaced(args...), nil, false) +} + +// Warnf logs a formatted message at Warn level, delegating to Warn. It is thread-safe. +// Example: +// +// logger := New("app").Enable() +// logger.Warnf("Warning %s", "issued") // Output: [app] WARN: Warning issued +func (l *Logger) Warnf(format string, args ...any) { + if l.suspend { + return + } + + l.Warn(fmt.Sprintf(format, args...)) +} + +// dbg is an internal helper for Dbg, logging debug information with source file and line +// number, extracting the calling line of code. It is thread-safe via the log method. +// Example (internal usage): +// +// logger.Dbg(x) // Calls dbg(2, x) +func (l *Logger) dbg(skip int, values ...interface{}) { + for _, exp := range values { + // Get caller information (file, line) + _, file, line, ok := runtime.Caller(skip) + if !ok { + l.log(lx.LevelError, lx.ClassText, "Dbg: Unable to parse runtime caller", nil, false) + return + } + + // Open source file + f, err := os.Open(file) + if err != nil { + l.log(lx.LevelError, lx.ClassText, "Dbg: Unable to open expected file", nil, false) + return + } + + // Scan file to find the line + scanner := bufio.NewScanner(f) + scanner.Split(bufio.ScanLines) + var out string + i := 1 + for scanner.Scan() { + if i == line { + // Extract expression between parentheses + v := scanner.Text()[strings.Index(scanner.Text(), "(")+1 : len(scanner.Text())-strings.Index(reverseString(scanner.Text()), ")")-1] + // Format output with file, line, expression, and value + out = fmt.Sprintf("[%s:%d] %s = %+v", file[len(file)-strings.Index(reverseString(file), "/"):], line, v, exp) + break + } + i++ + } + if err := scanner.Err(); err != nil { + l.log(lx.LevelError, lx.ClassText, err.Error(), nil, false) + return + } + // Log based on value type + switch exp.(type) { + case error: + l.log(lx.LevelError, lx.ClassText, out, nil, false) + default: + l.log(lx.LevelInfo, lx.ClassText, out, nil, false) + } + + f.Close() + } +} + +// joinPath joins a base path and a relative path using the logger's separator, handling +// empty base or relative paths. It is used internally for namespace path construction. +// Example (internal usage): +// +// logger.joinPath("parent", "child") // Returns "parent/child" +func (l *Logger) joinPath(base, relative string) string { + if base == "" { + return relative + } + if relative == "" { + return base + } + separator := l.separator + if separator == "" { + separator = lx.Slash // Default separator + } + return base + separator + relative +} + +// log is the internal method for processing a log entry, applying rate limiting, sampling, +// middleware, and context before passing to the handler. Middleware returning a non-nil +// error stops the log. It is thread-safe with read/write locks for configuration and stack +// trace buffer. +// Example (internal usage): +// +// logger := New("app").Enable() +// logger.Info("Test") // Calls log(lx.LevelInfo, "Test", nil, false) +func (l *Logger) log(level lx.LevelType, class lx.ClassType, msg string, fields map[string]interface{}, withStack bool) { + // Skip logging if level is not enabled + if !l.shouldLog(level) { + return + } + + var stack []byte + + // Capture stack trace if requested + if withStack { + l.mu.RLock() + buf := make([]byte, l.stackBufferSize) + l.mu.RUnlock() + n := runtime.Stack(buf, false) + if fields == nil { + fields = make(map[string]interface{}) + } + stack = buf[:n] + } + + l.mu.RLock() + defer l.mu.RUnlock() + + // Apply prefix and indentation to the message + var builder strings.Builder + if l.indent > 0 { + builder.WriteString(strings.Repeat(lx.DoubleSpace, l.indent)) + } + if l.prefix != "" { + builder.WriteString(l.prefix) + } + builder.WriteString(msg) + finalMsg := builder.String() + + // Create log entry + entry := &lx.Entry{ + Timestamp: time.Now(), + Level: level, + Message: finalMsg, + Namespace: l.currentPath, + Fields: fields, + Style: l.style, + Class: class, + Stack: stack, + } + + // Merge context fields, avoiding overwrites + if len(l.context) > 0 { + if entry.Fields == nil { + entry.Fields = make(map[string]interface{}) + } + for k, v := range l.context { + if _, exists := entry.Fields[k]; !exists { + entry.Fields[k] = v + } + } + } + + // Apply middleware, stopping if any returns an error + for _, mw := range l.middleware { + if err := mw.fn.Handle(entry); err != nil { + return + } + } + + // Pass to handler if set + if l.handler != nil { + _ = l.handler.Handle(entry) + l.entries.Add(1) + } +} + +// shouldLog determines if a log should be emitted based on enabled state, level, namespaces, +// sampling, and rate limits, caching namespace results for performance. It is thread-safe +// with a read lock. +// Example (internal usage): +// +// logger := New("app").Enable().Level(lx.LevelWarn) +// if logger.shouldLog(lx.LevelInfo) { // false +// // Log would be skipped +// } +func (l *Logger) shouldLog(level lx.LevelType) bool { + // Skip if global logging system is inactive + if !Active() { + return false + } + + // check for suspend mode + if l.suspend { + return false + } + + // Skip if log level is below minimum + if level > l.level { + return false + } + + separator := l.separator + if separator == "" { + separator = lx.Slash + } + + // Check namespace rules if path is set + if l.currentPath != "" { + isEnabledByNSRule, isDisabledByNSRule := l.namespaces.Enabled(l.currentPath, separator) + if isDisabledByNSRule { + return false + } + if isEnabledByNSRule { + return true + } + } + + // Fall back to logger's enabled state + if !l.enabled { + return false + } + + return true +} + +// WithHandler sets the handler for the logger as a functional option for configuring +// a new logger instance. +// Example: +// +// logger := New("app", WithHandler(lh.NewJSONHandler(os.Stdout))) +func WithHandler(handler lx.Handler) Option { + return func(l *Logger) { + l.handler = handler + } +} + +// WithTimestamped returns an Option that configures timestamp settings for the logger's existing handler. +// It enables or disables timestamp logging and optionally sets the timestamp format if the handler +// supports the lx.Timestamper interface. If no handler is set, the function has no effect. +// Parameters: +// +// enable: Boolean to enable or disable timestamp logging +// format: Optional string(s) to specify the timestamp format +func WithTimestamped(enable bool, format ...string) Option { + return func(l *Logger) { + if l.handler != nil { // Check if a handler is set + // Verify if the handler supports the lx.Timestamper interface + if h, ok := l.handler.(lx.Timestamper); ok { + h.Timestamped(enable, format...) // Apply timestamp settings to the handler + } + } + } +} + +// WithLevel sets the minimum log level for the logger as a functional option for +// configuring a new logger instance. +// Example: +// +// logger := New("app", WithLevel(lx.LevelWarn)) +func WithLevel(level lx.LevelType) Option { + return func(l *Logger) { + l.level = level + } +} + +// WithStyle sets the namespace formatting style for the logger as a functional option +// for configuring a new logger instance. +// Example: +// +// logger := New("app", WithStyle(lx.NestedPath)) +func WithStyle(style lx.StyleType) Option { + return func(l *Logger) { + l.style = style + } +} diff --git a/vendor/github.com/olekukonko/ll/lx/lx.go b/vendor/github.com/olekukonko/ll/lx/lx.go new file mode 100644 index 0000000..6466188 --- /dev/null +++ b/vendor/github.com/olekukonko/ll/lx/lx.go @@ -0,0 +1,164 @@ +package lx + +import ( + "time" +) + +// Formatting constants for log output. +// These constants define the characters used to format log messages, ensuring consistency +// across handlers (e.g., text, JSON, colorized). They are used to construct namespace paths, +// level indicators, and field separators in log entries. +const ( + Space = " " // Single space for separating elements (e.g., between level and message) + DoubleSpace = " " // Double space for indentation (e.g., for hierarchical output) + Slash = "/" // Separator for namespace paths (e.g., "parent/child") + Arrow = "→" // Arrow for NestedPath style namespaces (e.g., [parent]→[child]) + LeftBracket = "[" // Opening bracket for namespaces and fields (e.g., [app]) + RightBracket = "]" // Closing bracket for namespaces and fields (e.g., [app]) + Colon = ":" // Separator after namespace or level (e.g., [app]: INFO:) + Dot = "." // Separator for namespace paths (e.g., "parent.child") + Newline = "\n" // Newline for separating log entries or stack trace lines +) + +// DefaultEnabled defines the default logging state (disabled). +// It specifies whether logging is enabled by default for new Logger instances in the ll package. +// Set to false to prevent logging until explicitly enabled. +const ( + DefaultEnabled = false // Default state for new loggers (disabled) +) + +// Log level constants, ordered by increasing severity. +// These constants define the severity levels for log messages, used to filter logs based +// on the logger’s minimum level. They are ordered to allow comparison (e.g., LevelDebug < LevelWarn). +const ( + LevelNone LevelType = iota // Debug level for detailed diagnostic information + LevelInfo // Info level for general operational messages + LevelWarn // Warn level for warning conditions + LevelError // Error level for error conditions requiring attention + LevelDebug // None level for logs without a specific severity (e.g., raw output) +) + +// Log class constants, defining the type of log entry. +// These constants categorize log entries by their content or purpose, influencing how +// handlers process them (e.g., text, JSON, hex dump). +const ( + ClassText ClassType = iota // Text entries for standard log messages + ClassJSON // JSON entries for structured output + ClassDump // Dump entries for hex/ASCII dumps + ClassSpecial // Special entries for custom or non-standard logs + ClassRaw // Raw entries for unformatted output +) + +// Namespace style constants. +// These constants define how namespace paths are formatted in log output, affecting the +// visual representation of hierarchical namespaces. +const ( + FlatPath StyleType = iota // Formats namespaces as [parent/child] + NestedPath // Formats namespaces as [parent]→[child] +) + +// LevelType represents the severity of a log message. +// It is an integer type used to define log levels (Debug, Info, Warn, Error, None), with associated +// string representations for display in log output. +type LevelType int + +// String converts a LevelType to its string representation. +// It maps each level constant to a human-readable string, returning "UNKNOWN" for invalid levels. +// Used by handlers to display the log level in output. +// Example: +// +// var level lx.LevelType = lx.LevelInfo +// fmt.Println(level.String()) // Output: INFO +func (l LevelType) String() string { + switch l { + case LevelDebug: + return "DEBUG" + case LevelInfo: + return "INFO" + case LevelWarn: + return "WARN" + case LevelError: + return "ERROR" + case LevelNone: + return "NONE" + default: + return "UNKNOWN" + } +} + +// StyleType defines how namespace paths are formatted in log output. +// It is an integer type used to select between FlatPath ([parent/child]) and NestedPath +// ([parent]→[child]) styles, affecting how handlers render namespace hierarchies. +type StyleType int + +// Entry represents a single log entry passed to handlers. +// It encapsulates all information about a log message, including its timestamp, severity, +// content, namespace, metadata, and formatting style. Handlers process Entry instances +// to produce formatted output (e.g., text, JSON). The struct is immutable once created, +// ensuring thread-safety in handler processing. +type Entry struct { + Timestamp time.Time // Time the log was created + Level LevelType // Severity level of the log (Debug, Info, Warn, Error, None) + Message string // Log message content + Namespace string // Namespace path (e.g., "parent/child") + Fields map[string]interface{} // Additional key-value metadata (e.g., {"user": "alice"}) + Style StyleType // Namespace formatting style (FlatPath or NestedPath) + Error error // Associated error, if any (e.g., for error logs) + Class ClassType // Type of log entry (Text, JSON, Dump, Special, Raw) + Stack []byte // Stack trace data (if present) + Id int `json:"-"` // Unique ID for the entry, ignored in JSON output +} + +// Handler defines the interface for processing log entries. +// Implementations (e.g., TextHandler, JSONHandler) format and output log entries to various +// destinations (e.g., stdout, files). The Handle method returns an error if processing fails, +// allowing the logger to handle output failures gracefully. +// Example (simplified handler implementation): +// +// type MyHandler struct{} +// func (h *MyHandler) Handle(e *Entry) error { +// fmt.Printf("[%s] %s: %s\n", e.Namespace, e.Level.String(), e.Message) +// return nil +// } +type Handler interface { + Handle(e *Entry) error // Processes a log entry, returning any error +} + +// Timestamper defines an interface for handlers that support timestamp configuration. +// It includes a method to enable or disable timestamp logging and optionally set the timestamp format. +type Timestamper interface { + // Timestamped enables or disables timestamp logging and allows specifying an optional format. + // Parameters: + // enable: Boolean to enable or disable timestamp logging + // format: Optional string(s) to specify the timestamp format + Timestamped(enable bool, format ...string) +} + +// ClassType represents the type of a log entry. +// It is an integer type used to categorize log entries (Text, JSON, Dump, Special, Raw), +// influencing how handlers process and format them. +type ClassType int + +// String converts a ClassType to its string representation. +// It maps each class constant to a human-readable string, returning "UNKNOWN" for invalid classes. +// Used by handlers to indicate the entry type in output (e.g., JSON fields). +// Example: +// +// var class lx.ClassType = lx.ClassText +// fmt.Println(class.String()) // Output: TEST +func (t ClassType) String() string { + switch t { + case ClassText: + return "TEST" // Note: Likely a typo, should be "TEXT" + case ClassJSON: + return "JSON" + case ClassDump: + return "DUMP" + case ClassSpecial: + return "SPECIAL" + case ClassRaw: + return "RAW" + default: + return "UNKNOWN" + } +} diff --git a/vendor/github.com/olekukonko/ll/lx/ns.go b/vendor/github.com/olekukonko/ll/lx/ns.go new file mode 100644 index 0000000..5d30c93 --- /dev/null +++ b/vendor/github.com/olekukonko/ll/lx/ns.go @@ -0,0 +1,102 @@ +package lx + +import ( + "strings" + "sync" +) + +// namespaceRule stores the cached result of Enabled. +type namespaceRule struct { + isEnabledByRule bool + isDisabledByRule bool +} + +// Namespace manages thread-safe namespace enable/disable states with caching. +// The store holds explicit user-defined rules (path -> bool). +// The cache holds computed effective states for paths (path -> namespaceRule) +// based on hierarchical rules to optimize lookups. +type Namespace struct { + store sync.Map // path (string) -> rule (bool: true=enable, false=disable) + cache sync.Map // path (string) -> namespaceRule +} + +// Set defines an explicit enable/disable rule for a namespace path. +// It clears the cache to ensure subsequent lookups reflect the change. +func (ns *Namespace) Set(path string, enabled bool) { + ns.store.Store(path, enabled) + ns.clearCache() +} + +// Load retrieves an explicit rule from the store for a path. +// Returns the rule (true=enable, false=disable) and whether it exists. +// Does not consider hierarchy or caching. +func (ns *Namespace) Load(path string) (rule interface{}, found bool) { + return ns.store.Load(path) +} + +// Store directly sets a rule in the store, bypassing cache invalidation. +// Intended for internal use or sync.Map parity; prefer Set for standard use. +func (ns *Namespace) Store(path string, rule bool) { + ns.store.Store(path, rule) +} + +// clearCache clears the cache of Enabled results. +// Called by Set to ensure consistency after rule changes. +func (ns *Namespace) clearCache() { + ns.cache.Range(func(key, _ interface{}) bool { + ns.cache.Delete(key) + return true + }) +} + +// Enabled checks if a path is enabled by namespace rules, considering the most +// specific rule (path or closest prefix) in the store. Results are cached. +// Args: +// - path: Absolute namespace path to check. +// - separator: Character delimiting path segments (e.g., "/", "."). +// +// Returns: +// - isEnabledByRule: True if an explicit rule enables the path. +// - isDisabledByRule: True if an explicit rule disables the path. +// +// If both are false, no explicit rule applies to the path or its prefixes. +func (ns *Namespace) Enabled(path string, separator string) (isEnabledByRule bool, isDisabledByRule bool) { + if path == "" { // Root path has no explicit rule + return false, false + } + + // Check cache + if cachedValue, found := ns.cache.Load(path); found { + if state, ok := cachedValue.(namespaceRule); ok { + return state.isEnabledByRule, state.isDisabledByRule + } + ns.cache.Delete(path) // Remove invalid cache entry + } + + // Compute: Most specific rule wins + parts := strings.Split(path, separator) + computedIsEnabled := false + computedIsDisabled := false + + for i := len(parts); i >= 1; i-- { + currentPrefix := strings.Join(parts[:i], separator) + if val, ok := ns.store.Load(currentPrefix); ok { + if rule := val.(bool); rule { + computedIsEnabled = true + computedIsDisabled = false + } else { + computedIsEnabled = false + computedIsDisabled = true + } + break + } + } + + // Cache result, including (false, false) for no rule + ns.cache.Store(path, namespaceRule{ + isEnabledByRule: computedIsEnabled, + isDisabledByRule: computedIsDisabled, + }) + + return computedIsEnabled, computedIsDisabled +} diff --git a/vendor/github.com/olekukonko/ll/middleware.go b/vendor/github.com/olekukonko/ll/middleware.go new file mode 100644 index 0000000..694f75f --- /dev/null +++ b/vendor/github.com/olekukonko/ll/middleware.go @@ -0,0 +1,124 @@ +package ll + +import ( + "github.com/olekukonko/ll/lx" +) + +// Middleware represents a registered middleware and its operations in the logging pipeline. +// It holds an ID for identification, a reference to the parent logger, and the handler function +// that processes log entries. Middleware is used to transform or filter log entries before they +// are passed to the logger's output handler. +type Middleware struct { + id int // Unique identifier for the middleware + logger *Logger // Parent logger instance for context and logging operations + fn lx.Handler // Handler function that processes log entries +} + +// Remove unregisters the middleware from the logger’s middleware chain. +// It safely removes the middleware by its ID, ensuring thread-safety with a mutex lock. +// If the middleware or logger is nil, it returns early to prevent panics. +// Example usage: +// +// // Using a named middleware function +// mw := logger.Use(authMiddleware) +// defer mw.Remove() +// +// // Using an inline middleware +// mw = logger.Use(ll.Middle(func(e *lx.Entry) error { +// if e.Level < lx.LevelWarn { +// return fmt.Errorf("level too low") +// } +// return nil +// })) +// defer mw.Remove() +func (m *Middleware) Remove() { + // Check for nil middleware or logger to avoid panics + if m == nil || m.logger == nil { + return + } + // Acquire write lock to modify middleware slice + m.logger.mu.Lock() + defer m.logger.mu.Unlock() + // Iterate through middleware slice to find and remove matching ID + for i, entry := range m.logger.middleware { + if entry.id == m.id { + // Remove middleware by slicing out the matching entry + m.logger.middleware = append(m.logger.middleware[:i], m.logger.middleware[i+1:]...) + return + } + } +} + +// Logger returns the parent logger for optional chaining. +// This allows middleware to access the logger for additional operations, such as logging errors +// or creating derived loggers. It is useful for fluent API patterns. +// Example: +// +// mw := logger.Use(authMiddleware) +// mw.Logger().Info("Middleware registered") +func (m *Middleware) Logger() *Logger { + return m.logger +} + +// Error logs an error message at the Error level if the middleware blocks a log entry. +// It uses the parent logger to emit the error and returns the middleware for chaining. +// This is useful for debugging or auditing when middleware rejects a log. +// Example: +// +// mw := logger.Use(ll.Middle(func(e *lx.Entry) error { +// if e.Level < lx.LevelWarn { +// return fmt.Errorf("level too low") +// } +// return nil +// })) +// mw.Error("Rejected low-level log") +func (m *Middleware) Error(args ...any) *Middleware { + m.logger.Error(args...) + return m +} + +// Errorf logs an error message at the Error level if the middleware blocks a log entry. +// It uses the parent logger to emit the error and returns the middleware for chaining. +// This is useful for debugging or auditing when middleware rejects a log. +// Example: +// +// mw := logger.Use(ll.Middle(func(e *lx.Entry) error { +// if e.Level < lx.LevelWarn { +// return fmt.Errorf("level too low") +// } +// return nil +// })) +// mw.Errorf("Rejected low-level log") +func (m *Middleware) Errorf(format string, args ...any) *Middleware { + m.logger.Errorf(format, args...) + return m +} + +// middlewareFunc is a function adapter that implements the lx.Handler interface. +// It allows plain functions with the signature `func(*lx.Entry) error` to be used as middleware. +// The function should return nil to allow the log to proceed or a non-nil error to reject it, +// stopping the log from being emitted by the logger. +type middlewareFunc func(*lx.Entry) error + +// Handle implements the lx.Handler interface for middlewareFunc. +// It calls the underlying function with the log entry and returns its result. +// This enables seamless integration of function-based middleware into the logging pipeline. +func (mf middlewareFunc) Handle(e *lx.Entry) error { + return mf(e) +} + +// Middle creates a middleware handler from a function. +// It wraps a function with the signature `func(*lx.Entry) error` into a middlewareFunc, +// allowing it to be used in the logger’s middleware pipeline. A non-nil error returned by +// the function will stop the log from being emitted, ensuring precise control over logging. +// Example: +// +// logger.Use(ll.Middle(func(e *lx.Entry) error { +// if e.Level == lx.LevelDebug { +// return fmt.Errorf("debug logs disabled") +// } +// return nil +// })) +func Middle(fn func(*lx.Entry) error) lx.Handler { + return middlewareFunc(fn) +} diff --git a/vendor/github.com/olekukonko/tablewriter/.gitignore b/vendor/github.com/olekukonko/tablewriter/.gitignore index b66cec6..f79a287 100644 --- a/vendor/github.com/olekukonko/tablewriter/.gitignore +++ b/vendor/github.com/olekukonko/tablewriter/.gitignore @@ -1,15 +1,10 @@ -# Created by .ignore support plugin (hsz.mobi) -### Go template -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out +# folders +.idea +.vscode +/tmp +/lab +dev.sh +*csv2table +_test/ diff --git a/vendor/github.com/olekukonko/tablewriter/.travis.yml b/vendor/github.com/olekukonko/tablewriter/.travis.yml deleted file mode 100644 index 366d48a..0000000 --- a/vendor/github.com/olekukonko/tablewriter/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: go -arch: - - ppc64le - - amd64 -go: - - 1.3 - - 1.4 - - 1.5 - - 1.6 - - 1.7 - - 1.8 - - 1.9 - - "1.10" - - tip -jobs: - exclude : - - arch : ppc64le - go : - - 1.3 - - arch : ppc64le - go : - - 1.4 diff --git a/vendor/github.com/olekukonko/tablewriter/MIGRATION.md b/vendor/github.com/olekukonko/tablewriter/MIGRATION.md new file mode 100644 index 0000000..6500cd3 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/MIGRATION.md @@ -0,0 +1,3042 @@ +# Migration Guide: tablewriter v0.0.5 to v1.0.x +> **NOTE:** This document is work in progress, use with `caution`. This document is a comprehensive guide. For specific issues or advanced scenarios, please refer to the source code or open an issue. + +The `tablewriter` library has undergone a significant redesign between versions **v0.0.5** and **v1.0.x**, transitioning from a primarily method-driven API to a more robust, modular, and configuration-driven framework. This guide provides a detailed roadmap for migrating your v0.0.5 codebase to v1.0.x. It includes mappings of old methods to new approaches, practical examples, and explanations of new features. + +We believe these changes significantly improve the library's flexibility, maintainability, and power, enabling new features and making complex table configurations more manageable. + +## Why Migrate to v1.0.x? + +The v1.0.x redesign enhances `tablewriter`’s flexibility, maintainability, and feature set: +- **Extensibility**: Decoupled rendering supports diverse output formats (e.g., HTML, Markdown, CSV). +- **Robust Configuration**: Centralized `Config` struct and fluent builders ensure atomic, predictable setups. +- **Streaming Capability**: Dedicated API for row-by-row rendering, ideal for large or real-time datasets. +- **Type Safety**: Specific types (e.g., `tw.State`, `tw.Align`) reduce errors and improve clarity. +- **Consistent API**: Unified interface for intuitive usage across simple and complex use cases. +- **New Features**: Hierarchical merging, granular padding, table captions, and fixed column widths. + +These improvements make v1.0.x more powerful, but they require updating code to leverage the new configuration-driven framework and take advantage of advanced functionalities. + +## Key New Features in v1.0.x + +- **Fluent Configuration Builders**: `NewConfigBuilder()` enables chained, readable setups (`config.go:NewConfigBuilder`). +- **Centralized Configuration**: `Config` struct governs table behavior and data processing (`config.go:Config`). +- **Decoupled Renderer**: `tw.Renderer` interface with `tw.Rendition` for visual styling, allowing custom renderers (`tw/renderer.go`). +- **True Streaming Support**: `Start()`, `Append()`, `Close()` for incremental rendering (`stream.go`). +- **Hierarchical Cell Merging**: `tw.MergeHierarchical` for complex data structures (`tw/tw.go:MergeMode` constant, logic in `zoo.go`). +- **Granular Padding Control**: Per-side (`Top`, `Bottom`, `Left`, `Right`) and per-column padding (`tw/cell.go:CellPadding`, `tw/types.go:Padding`). +- **Enhanced Type System**: `tw.State`, `tw.Align`, `tw.Spot`, and others for clarity and safety (`tw/state.go`, `tw/types.go`). +- **Comprehensive Error Handling**: Methods like `Render()` and `Append()` return errors (`tablewriter.go`, `stream.go`). +- **Fixed Column Width System**: `Config.Widths` for precise column sizing, especially in streaming (`config.go:Config`, `tw/cell.go:CellWidth`). +- **Table Captioning**: Flexible placement and styling with `tw.Caption` (`tw/types.go:Caption`). +- **Advanced Data Processing**: Support for `tw.Formatter`, per-column filters, and stringer caching (`tw/cell.go:CellFilter`, `tablewriter.go:WithStringer`). + +## Core Philosophy Changes in v1.0.x + +Understanding these shifts is essential for a successful migration: + +1. **Configuration-Driven Approach**: + - **Old**: Relied on `table.SetXxx()` methods for incremental, stateful modifications to table properties. + - **New**: Table behavior is defined by a `tablewriter.Config` struct (`config.go:Config`), while visual styling is managed by a `tw.Rendition` struct (`tw/renderer.go:Rendition`). These are typically set at table creation using `NewTable()` with `Option` functions or via a fluent `ConfigBuilder`, ensuring atomic and predictable configuration changes. + +2. **Decoupled Rendering Engine**: + - **Old**: Rendering logic was tightly integrated into the `Table` struct, limiting output flexibility. + - **New**: The `tw.Renderer` interface (`tw/renderer.go:Renderer`) defines rendering logic, with `renderer.NewBlueprint()` as the default text-based renderer. The renderer’s appearance (e.g., borders, symbols) is controlled by `tw.Rendition`, enabling support for alternative formats like HTML or Markdown. + +3. **Unified Section Configuration**: + - **Old**: Headers, rows, and footers had separate, inconsistent configuration methods. + - **New**: `tw.CellConfig` (`tw/cell.go:CellConfig`) standardizes configuration across headers, rows, and footers, encompassing formatting (`tw.CellFormatting`), padding (`tw.CellPadding`), column widths (`tw.CellWidth`), alignments (`tw.CellAlignment`), and filters (`tw.CellFilter`). + +4. **Fluent Configuration Builders**: + - **Old**: Configuration was done via individual setters, often requiring multiple method calls. + - **New**: `tablewriter.NewConfigBuilder()` (`config.go:NewConfigBuilder`) provides a chained, fluent API for constructing `Config` objects, with nested builders for `Header()`, `Row()`, `Footer()`, `Alignment()`, `Behavior()`, and `ForColumn()` to simplify complex setups. + +5. **Explicit Streaming Mode**: + - **Old**: No dedicated streaming support; tables were rendered in batch mode. + - **New**: Streaming for row-by-row rendering is enabled via `Config.Stream.Enable` or `WithStreaming(tw.StreamConfig{Enable: true})` and managed with `Table.Start()`, `Table.Append()` (or `Table.Header()`, `Table.Footer()`), and `Table.Close()` (`stream.go`). This is ideal for large datasets or continuous output. + +6. **Enhanced Error Handling**: + - **Old**: Methods like `Render()` did not return errors, making error detection difficult. + - **New**: Key methods (`Render()`, `Start()`, `Close()`, `Append()`, `Bulk()`) return errors to promote robust error handling and improve application reliability (`tablewriter.go`, `stream.go`). + +7. **Richer Type System & `tw` Package**: + - **Old**: Used integer constants (e.g., `ALIGN_CENTER`) and booleans, leading to potential errors. + - **New**: The `tw` sub-package introduces type-safe constructs like `tw.State` (`tw/state.go`), `tw.Align` (`tw/types.go`), `tw.Position` (`tw/types.go`), and `tw.CellConfig` (`tw/cell.go`), replacing magic constants and enhancing code clarity. + +## Configuration Methods in v1.0.x + +v1.0.x offers four flexible methods to configure tables, catering to different use cases and complexity levels. Each method can be used independently or combined, providing versatility for both simple and advanced setups. + +1. **Using `WithConfig` Option**: + - **Description**: Pass a fully populated `tablewriter.Config` struct during `NewTable` initialization using the `WithConfig` option. + - **Use Case**: Ideal for predefined, reusable configurations that can be serialized or shared across multiple tables. + - **Pros**: Explicit, portable, and suitable for complex setups; allows complete control over all configuration aspects. + - **Cons**: Verbose for simple changes, requiring manual struct population. + - **Example**: + +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + cfg := tablewriter.Config{ + Header: tw.CellConfig{ + Alignment: tw.CellAlignment{Global: tw.AlignCenter}, + Formatting: tw.CellFormatting{AutoFormat: tw.On}, + }, + Row: tw.CellConfig{ + Alignment: tw.CellAlignment{Global: tw.AlignLeft}, + }, + MaxWidth: 80, + Behavior: tw.Behavior{TrimSpace: tw.On}, + } + table := tablewriter.NewTable(os.Stdout, tablewriter.WithConfig(cfg)) + table.Header("Name", "Status") + table.Append("Node1", "Ready") + table.Render() +} +``` +**Output**: + ``` +┌───────┬────────┐ +│ NAME │ STATUS │ +├───────┼────────┤ +│ Node1 │ Ready │ +└───────┴────────┘ + ``` + +2. **Using `Table.Configure` method**: + - **Description**: After creating a `Table` instance, use the `Configure` method with a function that modifies the table's `Config` struct. + - **Use Case**: Suitable for quick, ad-hoc tweaks post-initialization, especially for simple or dynamic adjustments. + - **Pros**: Straightforward for minor changes; no need for additional structs or builders if you already have a `Table` instance. + - **Cons**: Less readable for complex configurations compared to a builder; modifications are applied to an existing instance. + - **Example**: +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + table := tablewriter.NewTable(os.Stdout) + table.Configure(func(cfg *tablewriter.Config) { + cfg.Header.Alignment.Global = tw.AlignCenter + cfg.Row.Alignment.Global = tw.AlignLeft + }) + + table.Header("Name", "Status") + table.Append("Node1", "Ready") + table.Render() +} +``` +**Output**: Same as above. + +3. **Standalone `Option` Functions**: + - **Description**: Use `WithXxx` functions (e.g., `WithHeaderAlignment`, `WithDebug`) during `NewTable` initialization or via `table.Options()` to apply targeted settings. + - **Use Case**: Best for simple, specific configuration changes without needing a full `Config` struct. + - **Pros**: Concise, readable, and intuitive for common settings; ideal for minimal setups. + - **Cons**: Limited for complex, multi-faceted configurations; requires multiple options for extensive changes. + - **Example**: +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + table := tablewriter.NewTable(os.Stdout, + tablewriter.WithHeaderAlignment(tw.AlignCenter), + tablewriter.WithRowAlignment(tw.AlignLeft), + tablewriter.WithDebug(true), + ) + table.Header("Name", "Status") + table.Append("Node1", "Ready") + table.Render() +} +``` + **Output**: Same as above. + +4. **Fluent `ConfigBuilder`**: + - **Description**: Use `tablewriter.NewConfigBuilder()` to construct a `Config` struct through a chained, fluent API, then apply it with `WithConfig(builder.Build())`. + - **Use Case**: Optimal for complex, dynamic, or programmatically generated configurations requiring fine-grained control. + - **Pros**: Highly readable, maintainable, and expressive; supports nested builders for sections and columns. + - **Cons**: Slightly verbose; requires understanding builder methods and `Build()` call. + - **Example**: +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + cnfBuilder := tablewriter.NewConfigBuilder() + cnfBuilder.Header().Alignment().WithGlobal(tw.AlignCenter) + // Example of configuring a specific column (less emphasis on this for now) + // cnfBuilder.ForColumn(0).WithAlignment(tw.AlignLeft).Build() // Call Build() to return to ConfigBuilder + + table := tablewriter.NewTable(os.Stdout, tablewriter.WithConfig(cnfBuilder.Build())) + table.Header("Name", "Status") + table.Append("Node1", "Ready") + table.Render() +} +``` +**Output**: Same as above. + +**Best Practices**: +- Use `WithConfig` or `ConfigBuilder` for complex setups or reusable configurations. +- Opt for `Option` functions for simple, targeted changes. +- Use `Table.Configure` for direct modifications after table creation, but avoid changes during rendering. +- Combine methods as needed (e.g., `ConfigBuilder` for initial setup, `Option` functions for overrides). + +## Default Parameters in v1.0.x + +The `defaultConfig()` function (`config.go:defaultConfig`) establishes baseline settings for new tables, ensuring predictable behavior unless overridden. Below is a detailed table of default parameters, organized by configuration section, to help you understand the starting point for table behavior and appearance. + +| Section | Parameter | Default Value | Description | +|---------------|-------------------------------|-----------------------------------|-----------------------------------------------------------------------------| +| **Header** | `Alignment.Global` | `tw.AlignCenter` | Centers header text globally unless overridden by `PerColumn`. | +| Header | `Alignment.PerColumn` | `[]tw.Align{}` | Empty; falls back to `Global` unless specified. | +| Header | `Formatting.AutoFormat` | `tw.On` | Applies title case (e.g., "col_one" → "COL ONE") to header content. | +| Header | `Formatting.AutoWrap` | `tw.WrapTruncate` | Truncates long header text with "…" based on width constraints. | +| Header | `Formatting.MergeMode` | `tw.MergeNone` | Disables cell merging in headers by default. | +| Header | `Padding.Global` | `tw.PaddingDefault` (`" "`) | Adds one space on left and right of header cells. | +| Header | `Padding.PerColumn` | `[]tw.Padding{}` | Empty; falls back to `Global` unless specified. | +| Header | `ColMaxWidths.Global` | `0` (unlimited) | No maximum content width for header cells unless set. | +| Header | `ColMaxWidths.PerColumn` | `tw.NewMapper[int, int]()` | Empty map; no per-column content width limits unless specified. | +| Header | `Filter.Global` | `nil` | No global content transformation for header cells. | +| Header | `Filter.PerColumn` | `[]func(string) string{}` | No per-column content transformations unless specified. | +| **Row** | `Alignment.Global` | `tw.AlignLeft` | Left-aligns row text globally unless overridden by `PerColumn`. | +| Row | `Alignment.PerColumn` | `[]tw.Align{}` | Empty; falls back to `Global`. | +| Row | `Formatting.AutoFormat` | `tw.Off` | Disables auto-formatting (e.g., title case) for row content. | +| Row | `Formatting.AutoWrap` | `tw.WrapNormal` | Wraps long row text naturally at word boundaries based on width constraints.| +| Row | `Formatting.MergeMode` | `tw.MergeNone` | Disables cell merging in rows by default. | +| Row | `Padding.Global` | `tw.PaddingDefault` (`" "`) | Adds one space on left and right of row cells. | +| Row | `Padding.PerColumn` | `[]tw.Padding{}` | Empty; falls back to `Global`. | +| Row | `ColMaxWidths.Global` | `0` (unlimited) | No maximum content width for row cells. | +| Row | `ColMaxWidths.PerColumn` | `tw.NewMapper[int, int]()` | Empty map; no per-column content width limits. | +| Row | `Filter.Global` | `nil` | No global content transformation for row cells. | +| Row | `Filter.PerColumn` | `[]func(string) string{}` | No per-column content transformations. | +| **Footer** | `Alignment.Global` | `tw.AlignRight` | Right-aligns footer text globally unless overridden by `PerColumn`. | +| Footer | `Alignment.PerColumn` | `[]tw.Align{}` | Empty; falls back to `Global`. | +| Footer | `Formatting.AutoFormat` | `tw.Off` | Disables auto-formatting for footer content. | +| Footer | `Formatting.AutoWrap` | `tw.WrapNormal` | Wraps long footer text naturally. | +| Footer | `Formatting.MergeMode` | `tw.MergeNone` | Disables cell merging in footers. | +| Footer | `Padding.Global` | `tw.PaddingDefault` (`" "`) | Adds one space on left and right of footer cells. | +| Footer | `Padding.PerColumn` | `[]tw.Padding{}` | Empty; falls back to `Global`. | +| Footer | `ColMaxWidths.Global` | `0` (unlimited) | No maximum content width for footer cells. | +| Footer | `ColMaxWidths.PerColumn` | `tw.NewMapper[int, int]()` | Empty map; no per-column content width limits. | +| Footer | `Filter.Global` | `nil` | No global content transformation for footer cells. | +| Footer | `Filter.PerColumn` | `[]func(string) string{}` | No per-column content transformations. | +| **Global** | `MaxWidth` | `0` (unlimited) | No overall table width limit. | +| Global | `Behavior.AutoHide` | `tw.Off` | Displays empty columns (ignored in streaming). | +| Global | `Behavior.TrimSpace` | `tw.On` | Trims leading/trailing spaces from cell content. | +| Global | `Behavior.Header` | `tw.Control{Hide: tw.Off}` | Shows header if content is provided. | +| Global | `Behavior.Footer` | `tw.Control{Hide: tw.Off}` | Shows footer if content is provided. | +| Global | `Behavior.Compact` | `tw.Compact{Merge: tw.Off}` | No compact width optimization for merged cells. | +| Global | `Debug` | `false` | Disables debug logging. | +| Global | `Stream.Enable` | `false` | Disables streaming mode by default. | +| Global | `Widths.Global` | `0` (unlimited) | No fixed column width unless specified. | +| Global | `Widths.PerColumn` | `tw.NewMapper[int, int]()` | Empty map; no per-column fixed widths unless specified. | + +**Notes**: +- Defaults can be overridden using any configuration method. +- `tw.PaddingDefault` is `{Left: " ", Right: " "}` (`tw/preset.go`). +- Alignment within `tw.CellFormatting` is deprecated; `tw.CellAlignment` is preferred. `tw.AlignDefault` falls back to `Global` or `tw.AlignLeft` (`tw/types.go`). +- Streaming mode uses `Widths` for fixed column sizing (`stream.go`). + +## Renderer Types and Customization + +v1.0.x introduces a flexible rendering system via the `tw.Renderer` interface (`tw/renderer.go:Renderer`), allowing for both default text-based rendering and custom output formats. This decouples rendering logic from table data processing, enabling support for diverse formats like HTML, CSV, or JSON. + +### Default Renderer: `renderer.NewBlueprint` +- **Description**: `renderer.NewBlueprint()` creates a text-based renderer. Its visual styles are configured using `tw.Rendition`. +- **Use Case**: Standard terminal or text output with configurable borders, symbols, and separators. +- **Configuration**: Styled via `tw.Rendition`, which controls: + - `Borders`: Outer table borders (`tw.Border`) with `tw.State` for each side (`tw/renderer.go`). + - `Settings`: Internal lines (`tw.Lines`) and separators (`tw.Separators`) (`tw/renderer.go`). + - `Symbols`: Characters for drawing table lines and junctions (`tw.Symbols`) (`tw/symbols.go`). + - **Example**: +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" // Import the renderer package + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + table := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewBlueprint()), // Default Blueprint renderer + tablewriter.WithRendition(tw.Rendition{ // Apply custom rendition + Symbols: tw.NewSymbols(tw.StyleRounded), + Borders: tw.Border{Top: tw.On, Bottom: tw.On, Left: tw.On, Right: tw.On}, + Settings: tw.Settings{ + Separators: tw.Separators{BetweenRows: tw.On}, + Lines: tw.Lines{ShowHeaderLine: tw.On}, + }, + }), + ) + table.Header("Name", "Status") + table.Append("Node1", "Ready") + table.Render() +} +``` +**Output**: + ``` + ╭───────┬────────╮ + │ Name │ Status │ + ├───────┼────────┤ + │ Node1 │ Ready │ + ╰───────┴────────╯ + ``` + +### Custom Renderer Implementation +- **Description**: Implement the `tw.Renderer` interface to create custom output formats (e.g., HTML, CSV). +- **Use Case**: Non-text outputs, specialized formatting, or integration with other systems. +- **Interface Methods**: + - `Start(w io.Writer) error`: Initializes rendering. + - `Header(headers [][]string, ctx tw.Formatting)`: Renders header rows. + - `Row(row []string, ctx tw.Formatting)`: Renders a data row. + - `Footer(footers [][]string, ctx tw.Formatting)`: Renders footer rows. + - `Line(ctx tw.Formatting)`: Renders separator lines. + - `Close() error`: Finalizes rendering. + - `Config() tw.Rendition`: Returns renderer's current rendition configuration. + - `Logger(logger *ll.Logger)`: Sets logger for debugging. + - **Example (HTML Renderer)**: + +```go +package main + +import ( + "fmt" + "github.com/olekukonko/ll" // For logger type + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" + "io" + "os" +) + +// BasicHTMLRenderer implements tw.Renderer +type BasicHTMLRenderer struct { + writer io.Writer + config tw.Rendition // Store the rendition + logger *ll.Logger + err error +} + +func (r *BasicHTMLRenderer) Start(w io.Writer) error { + r.writer = w + _, r.err = r.writer.Write([]byte("\n")) + return r.err +} + +// Header expects [][]string for potentially multi-line headers +func (r *BasicHTMLRenderer) Header(headers [][]string, ctx tw.Formatting) { + if r.err != nil { return } + _, r.err = r.writer.Write([]byte(" \n")) + if r.err != nil { return } + // Iterate over cells from the context for the current line + for _, cellCtx := range ctx.Row.Current { + content := fmt.Sprintf(" \n", cellCtx.Data) + _, r.err = r.writer.Write([]byte(content)) + if r.err != nil { return } + } + _, r.err = r.writer.Write([]byte(" \n")) +} + +// Row expects []string for a single line row, but uses ctx for actual data +func (r *BasicHTMLRenderer) Row(row []string, ctx tw.Formatting) { // row param is less relevant here, ctx.Row.Current is key + if r.err != nil { return } + _, r.err = r.writer.Write([]byte(" \n")) + if r.err != nil { return } + for _, cellCtx := range ctx.Row.Current { + content := fmt.Sprintf(" \n", cellCtx.Data) + _, r.err = r.writer.Write([]byte(content)) + if r.err != nil { return } + } + _, r.err = r.writer.Write([]byte(" \n")) +} + +func (r *BasicHTMLRenderer) Footer(footers [][]string, ctx tw.Formatting) { + if r.err != nil { return } + // Similar to Header/Row, using ctx.Row.Current for the footer line data + // The footers [][]string param might be used if the renderer needs multi-line footer logic + r.Row(nil, ctx) // Reusing Row logic, passing nil for the direct row []string as ctx contains the data +} + +func (r *BasicHTMLRenderer) Line(ctx tw.Formatting) { /* No lines in basic HTML */ } + +func (r *BasicHTMLRenderer) Close() error { + if r.err != nil { + return r.err + } + _, r.err = r.writer.Write([]byte("
%s
%s
\n")) + return r.err +} + +func (r *BasicHTMLRenderer) Config() tw.Rendition { return r.config } +func (r *BasicHTMLRenderer) Logger(logger *ll.Logger) { r.logger = logger } + +func main() { + table := tablewriter.NewTable(os.Stdout, tablewriter.WithRenderer(&BasicHTMLRenderer{ + config: tw.Rendition{Symbols: tw.NewSymbols(tw.StyleASCII)}, // Provide a default Rendition + })) + table.Header("Name", "Status") + table.Append("Node1", "Ready") + table.Render() +} +``` +**Output**: +```html + + + + + + + + + +
NAMESTATUS
Node1Ready
+``` + +**Notes**: +- The `renderer.NewBlueprint()` is sufficient for most text-based use cases. +- Custom renderers require implementing all interface methods to handle table structure correctly. `tw.Formatting` (which includes `tw.RowContext`) provides cell content and metadata. + +## Function Mapping Table (v0.0.5 → v1.0.x) + +The following table maps v0.0.5 methods to their v1.0.x equivalents, ensuring a quick reference for migration. All deprecated methods are retained for compatibility but should be replaced with new APIs. + +| v0.0.5 Method | v1.0.x Equivalent(s) | Notes | +|-----------------------------------|--------------------------------------------------------------------------------------|----------------------------------------------------------------------| +| `NewWriter(w)` | `NewTable(w, opts...)` | `NewWriter` deprecated; wraps `NewTable` (`tablewriter.go`). | +| `SetHeader([]string)` | `Header(...any)` | Variadic or slice; supports any type (`tablewriter.go`). | +| `Append([]string)` | `Append(...any)` | Variadic, slice, or struct (`tablewriter.go`). | +| `AppendBulk([][]string)` | `Bulk([]any)` | Slice of rows; supports any type (`tablewriter.go`). | +| `SetFooter([]string)` | `Footer(...any)` | Variadic or slice; supports any type (`tablewriter.go`). | +| `Render()` | `Render()` (returns `error`) | Batch mode; streaming uses `Start/Close` (`tablewriter.go`). | +| `SetBorder(bool)` | `WithRendition(tw.Rendition{Borders: ...})` or `WithBorders(tw.Border)` (deprecated) | Use `tw.Border` (`deprecated.go`, `tw/renderer.go`). | +| `SetRowLine(bool)` | `WithRendition(tw.Rendition{Settings: {Separators: {BetweenRows: tw.On}}})` | `tw.Separators` (`tw/renderer.go`). | +| `SetHeaderLine(bool)` | `WithRendition(tw.Rendition{Settings: {Lines: {ShowHeaderLine: tw.On}}})` | `tw.Lines` (`tw/renderer.go`). | +| `SetColumnSeparator(string)` | `WithRendition(tw.Rendition{Symbols: ...})` or `WithSymbols(tw.Symbols)` (deprecated)| `tw.NewSymbols` or custom `tw.Symbols` (`tw/symbols.go`). | +| `SetCenterSeparator(string)` | `WithRendition(tw.Rendition{Symbols: ...})` or `WithSymbols(tw.Symbols)` (deprecated)| `tw.Symbols` (`tw/symbols.go`). | +| `SetRowSeparator(string)` | `WithRendition(tw.Rendition{Symbols: ...})` or `WithSymbols(tw.Symbols)` (deprecated)| `tw.Symbols` (`tw/symbols.go`). | +| `SetAlignment(int)` | `WithRowAlignment(tw.Align)` or `Config.Row.Alignment.Global` | `tw.Align` type (`config.go`). | +| `SetHeaderAlignment(int)` | `WithHeaderAlignment(tw.Align)` or `Config.Header.Alignment.Global` | `tw.Align` type (`config.go`). | +| `SetAutoFormatHeaders(bool)` | `WithHeaderAutoFormat(tw.State)` or `Config.Header.Formatting.AutoFormat` | `tw.State` (`config.go`). | +| `SetAutoWrapText(bool)` | `WithRowAutoWrap(int)` or `Config.Row.Formatting.AutoWrap` (uses `tw.Wrap...` const) | `tw.WrapNormal`, `tw.WrapTruncate`, etc. (`config.go`). | +| `SetAutoMergeCells(bool)` | `WithRowMergeMode(int)` or `Config.Row.Formatting.MergeMode` (uses `tw.Merge...` const) | Supports `Vertical`, `Hierarchical` (`config.go`). | +| `SetColMinWidth(col, w)` | `WithColumnWidths(tw.NewMapper[int,int]().Set(col, w))` or `Config.Widths.PerColumn` | `Config.Widths` for fixed widths (`config.go`). | +| `SetTablePadding(string)` | Use `Config.
.Padding.Global` with `tw.Padding` | No direct equivalent; manage via cell padding (`tw/cell.go`). | +| `SetDebug(bool)` | `WithDebug(bool)` or `Config.Debug` | Logs via `table.Debug()` (`config.go`). | +| `Clear()` | `Reset()` | Clears data and state (`tablewriter.go`). | +| `SetNoWhiteSpace(bool)` | `WithTrimSpace(tw.Off)` (if `true`) or `WithPadding(tw.PaddingNone)` | Manage via `Config.Behavior.TrimSpace` or padding (`config.go`). | +| `SetColumnColor(Colors)` | Embed ANSI codes in cell data, use `tw.Formatter`, or `Config.
.Filter` | Colors via data or filters (`tw/cell.go`). | +| `SetHeaderColor(Colors)` | Embed ANSI codes in cell data, use `tw.Formatter`, or `Config.Header.Filter` | Colors via data or filters (`tw/cell.go`). | +| `SetFooterColor(Colors)` | Embed ANSI codes in cell data, use `tw.Formatter`, or `Config.Footer.Filter` | Colors via data or filters (`tw/cell.go`). | + +**Notes**: +- Deprecated methods are in `deprecated.go` but should be replaced. +- `tw` package types (e.g., `tw.Align`, `tw.State`) are required for new APIs. +- Examples for each mapping are provided in the migration steps below. + +## Detailed Migration Steps: Initialization, Data Input, Rendering + +This section provides step-by-step guidance for migrating core table operations, with code examples and explanations to ensure clarity. Each step maps v0.0.5 methods to v1.0.x equivalents, highlighting changes, best practices, and potential pitfalls. + +### 1. Table Initialization +Initialization has shifted from `NewWriter` to `NewTable`, which supports flexible configuration via `Option` functions, `Config` structs, or `ConfigBuilder`. + +**Old (v0.0.5):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "os" +) + +func main() { + table := tablewriter.NewWriter(os.Stdout) + // ... use table + _ = table // Avoid "declared but not used" +} +``` + +**New (v1.0.x):** +```go +package main + +import ( + "fmt" // Added for FormattableEntry example + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" // Import renderer + "github.com/olekukonko/tablewriter/tw" + "os" + "strings" // Added for Formatter example +) + +func main() { + // Minimal Setup (Default Configuration) + tableMinimal := tablewriter.NewTable(os.Stdout) + _ = tableMinimal // Avoid "declared but not used" + + // Using Option Functions for Targeted Configuration + tableWithOptions := tablewriter.NewTable(os.Stdout, + tablewriter.WithHeaderAlignment(tw.AlignCenter), // Center header text + tablewriter.WithRowAlignment(tw.AlignLeft), // Left-align row text + tablewriter.WithDebug(true), // Enable debug logging + ) + _ = tableWithOptions // Avoid "declared but not used" + + // Using a Full Config Struct for Comprehensive Control + cfg := tablewriter.Config{ + Header: tw.CellConfig{ + Alignment: tw.CellAlignment{ + Global: tw.AlignCenter, + PerColumn: []tw.Align{tw.AlignLeft, tw.AlignRight}, // Column-specific alignment + }, + Formatting: tw.CellFormatting{AutoFormat: tw.On}, + }, + Row: tw.CellConfig{ + Alignment: tw.CellAlignment{Global: tw.AlignLeft}, + Formatting: tw.CellFormatting{AutoWrap: tw.WrapNormal}, + }, + Footer: tw.CellConfig{ + Alignment: tw.CellAlignment{Global: tw.AlignRight}, + }, + MaxWidth: 80, // Constrain total table width + Behavior: tw.Behavior{ + AutoHide: tw.Off, // Show empty columns + TrimSpace: tw.On, // Trim cell spaces + }, + Widths: tw.CellWidth{ + Global: 20, // Default fixed column width + PerColumn: tw.NewMapper[int, int]().Set(0, 15), // Column 0 fixed at 15 + }, + } + tableWithConfig := tablewriter.NewTable(os.Stdout, tablewriter.WithConfig(cfg)) + _ = tableWithConfig // Avoid "declared but not used" + + // Using ConfigBuilder for Fluent, Complex Configuration + builder := tablewriter.NewConfigBuilder(). + WithMaxWidth(80). + WithAutoHide(tw.Off). + WithTrimSpace(tw.On). + WithDebug(true). // Enable debug logging + Header(). + Alignment(). + WithGlobal(tw.AlignCenter). + Build(). // Returns *ConfigBuilder + Header(). + Formatting(). + WithAutoFormat(tw.On). + WithAutoWrap(tw.WrapTruncate). // Test truncation + WithMergeMode(tw.MergeNone). // Explicit merge mode + Build(). // Returns *HeaderConfigBuilder + Padding(). + WithGlobal(tw.Padding{Left: "[", Right: "]", Overwrite: true}). + Build(). // Returns *HeaderConfigBuilder + Build(). // Returns *ConfigBuilder + Row(). + Formatting(). + WithAutoFormat(tw.On). // Uppercase rows + Build(). // Returns *RowConfigBuilder + Build(). // Returns *ConfigBuilder + Row(). + Alignment(). + WithGlobal(tw.AlignLeft). + Build(). // Returns *ConfigBuilder + Build() // Finalize Config + + tableWithFluent := tablewriter.NewTable(os.Stdout, tablewriter.WithConfig(builder)) + _ = tableWithFluent // Avoid "declared but not used" +} +``` + +**Key Changes**: +- **Deprecation**: `NewWriter` is deprecated but retained for compatibility, internally calling `NewTable` (`tablewriter.go:NewWriter`). Transition to `NewTable` for new code. +- **Flexibility**: `NewTable` accepts an `io.Writer` and variadic `Option` functions (`tablewriter.go:NewTable`), enabling configuration via: + - `WithConfig(Config)`: Applies a complete `Config` struct (`config.go:WithConfig`). + - `WithRenderer(tw.Renderer)`: Sets a custom renderer, defaulting to `renderer.NewBlueprint()` (`tablewriter.go:WithRenderer`). + - `WithRendition(tw.Rendition)`: Configures visual styles for the renderer (`tablewriter.go:WithRendition`). + - `WithStreaming(tw.StreamConfig)`: Enables streaming mode (`tablewriter.go:WithStreaming`). + - Other `WithXxx` functions for specific settings (e.g., `WithHeaderAlignment`, `WithDebug`). +- **ConfigBuilder**: Provides a fluent API for complex setups; `Build()` finalizes the `Config` (`config.go:ConfigBuilder`). +- **Method Chaining in Builder**: Remember to call `Build()` on nested builders to return to the parent builder (e.g., `builder.Header().Alignment().WithGlobal(...).Build().Formatting()...`). + +**Migration Tips**: +- Replace `NewWriter` with `NewTable` and specify configurations explicitly. +- Use `ConfigBuilder` for complex setups or when readability is paramount. +- Apply `Option` functions for quick, targeted changes. +- Ensure `tw` package is imported for types like `tw.Align` and `tw.CellConfig`. +- Verify renderer settings if custom styling is needed, as `renderer.NewBlueprint()` is the default. + +**Potential Pitfalls**: +- **Unintended Defaults**: Without explicit configuration, `defaultConfig()` applies (see Default Parameters), which may differ from v0.0.5 behavior (e.g., `Header.Formatting.AutoFormat = tw.On`). +- **Renderer Absence**: If no renderer is set, `NewTable` defaults to `renderer.NewBlueprint()`; explicitly set for custom formats. +- **ConfigBuilder Errors**: Always call `Build()` at the end of a builder chain and on nested builders; omitting it can lead to incomplete configurations or runtime errors. +- **Concurrent Modification**: Avoid modifying `Table.config` (if using the `Configure` method or direct access) in concurrent scenarios or during rendering to prevent race conditions. + +### 2. Data Input +Data input methods in v1.0.x are more flexible, accepting `any` type for headers, rows, and footers, with robust conversion logic to handle strings, structs, and custom types. + +#### 2.1. Setting Headers +Headers define the table’s column labels and are typically the first data added. + +**Old (v0.0.5):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "os" +) + +func main() { + table := tablewriter.NewWriter(os.Stdout) + table.SetHeader([]string{"Name", "Sign", "Rating"}) + // ... +} +``` + +**New (v1.0.x):** +```go +package main + +import ( + "fmt" + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" // For tw.Formatter + "os" + "strings" +) + +// Struct with Formatter +type HeaderData struct { // Renamed to avoid conflict + Label string +} + +func (h HeaderData) Format() string { return strings.ToUpper(h.Label) } // Implements tw.Formatter + +func main() { + table := tablewriter.NewTable(os.Stdout) + + // Variadic Arguments (Preferred for Simplicity) + table.Header("Name", "Sign", "Rating") + + // Slice of Strings + // table.Header([]string{"Name", "Sign", "Rating"}) // Example, comment out if using variadic + + // Slice of Any Type (Flexible) + // table.Header([]any{"Name", "Sign", 123}) // Numbers converted to strings + + // Using Formatter + // table.Header(HeaderData{"name"}, HeaderData{"sign"}, HeaderData{"rating"}) // Outputs "NAME", "SIGN", "RATING" + + table.Append("Example", "Row", "Data") // Add some data to render + table.Render() +} +``` + +**Key Changes**: +- **Method**: `SetHeader([]string)` replaced by `Header(...any)` (`tablewriter.go:Header`). +- **Flexibility**: Accepts variadic arguments or a single slice; supports any type, not just strings. +- **Conversion**: Elements are processed by `processVariadic` (`zoo.go:processVariadic`) and converted to strings via `convertCellsToStrings` (`zoo.go:convertCellsToStrings`), supporting: + - Basic types (e.g., `string`, `int`, `float64`). + - `fmt.Stringer` implementations. + - `tw.Formatter` implementations (custom string conversion). + - Structs (exported fields as cells or single cell if `Stringer`/`Formatter`). +- **Streaming**: In streaming mode, `Header()` renders immediately via `streamRenderHeader` (`stream.go:streamRenderHeader`). +- **Formatting**: Headers are formatted per `Config.Header` settings (e.g., `AutoFormat`, `Alignment`) during rendering (`zoo.go:prepareContent`). + +**Migration Tips**: +- Replace `SetHeader` with `Header`, using variadic arguments for simplicity. +- Use slices for dynamic header lists or when passing from a variable. +- Implement `tw.Formatter` for custom header formatting (e.g., uppercase). +- Ensure header count matches expected columns to avoid width mismatches. +- In streaming mode, call `Header()` before rows, as it fixes column widths (`stream.go`). + +**Potential Pitfalls**: +- **Type Mismatch**: Non-string types are converted to strings; ensure desired formatting (e.g., use `tw.Formatter` for custom types). +- **Streaming Widths**: Headers influence column widths in streaming; set `Config.Widths` explicitly if specific widths are needed (`stream.go:streamCalculateWidths`). +- **Empty Headers**: Missing headers may cause rendering issues; provide placeholders (e.g., `""`) if needed. +- **AutoFormat**: Default `Header.Formatting.AutoFormat = tw.On` applies title case; disable with `WithHeaderAutoFormat(tw.Off)` if unwanted (`config.go`). + +#### 2.2. Appending Rows +Rows represent the table’s data entries, and v1.0.x enhances flexibility with support for varied input types. + +**Old (v0.0.5):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "os" +) + +func main() { + table := tablewriter.NewWriter(os.Stdout) + table.SetHeader([]string{"ColA", "ColB", "ColC"}) // Add header for context + table.Append([]string{"A", "The Good", "500"}) + table.Append([]string{"B", "The Very Bad", "288"}) + data := [][]string{ + {"C", "The Ugly", "120"}, + {"D", "The Gopher", "800"}, + } + table.AppendBulk(data) + table.Render() +} +``` + +**New (v1.0.x):** +```go +package main + +import ( + "fmt" + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" // For tw.Formatter + "log" + "os" +) + +// Struct for examples +type Entry struct { + ID string + Label string + Score int +} + +// Struct with Formatter +type FormattableEntry struct { + ID string + Label string + Score int +} + +func (e FormattableEntry) Format() string { return fmt.Sprintf("%s (%d)", e.Label, e.Score) } // Implements tw.Formatter + +func main() { + table := tablewriter.NewTable(os.Stdout) + table.Header("ID", "Description", "Value") // Header for context + + // Variadic Arguments (Single Row) + table.Append("A", "The Good", 500) // Numbers converted to strings + + // Slice of Any Type (Single Row) + table.Append([]any{"B", "The Very Bad", "288"}) + + // Struct with Fields + table.Append(Entry{ID: "C", Label: "The Ugly", Score: 120}) // Fields as cells + + // Struct with Formatter (will produce a single cell for this row based on Format()) + // To make it fit 3 columns, the formatter would need to produce a string that looks like 3 cells, or the table config would need to adapt. + // For this example, let's assume it's meant to be one wide cell, or adjust the header. + // For now, let's simplify and append it to a table with one header. + tableOneCol := tablewriter.NewTable(os.Stdout) + tableOneCol.Header("Formatted Entry") + tableOneCol.Append(FormattableEntry{ID: "D", Label: "The Gopher", Score: 800}) // Single cell "The Gopher (800)" + tableOneCol.Render() + fmt.Println("---") + + + // Re-initialize main table for Bulk example + table = tablewriter.NewTable(os.Stdout) + table.Header("ID", "Description", "Value") + + // Multiple Rows with Bulk + data := []any{ + []any{"E", "The Fast", 300}, + Entry{ID: "F", Label: "The Swift", Score: 400}, // Struct instance + // FormattableEntry{ID: "G", Label: "The Bold", Score: 500}, // Would also be one cell + } + if err := table.Bulk(data); err != nil { + log.Fatalf("Bulk append failed: %v", err) + } + table.Render() +} +``` + +**Key Changes**: +- **Method**: `Append([]string)` replaced by `Append(...any)`; `AppendBulk([][]string)` replaced by `Bulk([]any)` (`tablewriter.go`). +- **Input Flexibility**: `Append` accepts: + - Multiple arguments as cells of a single row. + - A single slice (e.g., `[]string`, `[]any`) as cells of a single row. + - A single struct, processed by `convertItemToCells` (`zoo.go`): + - Uses `tw.Formatter` or `fmt.Stringer` for single-cell output. + - Extracts exported fields as multiple cells otherwise. +- **Bulk Input**: `Bulk` accepts a slice where each element is a row (e.g., `[][]any`, `[]Entry`), processed by `appendSingle` (`zoo.go:appendSingle`). +- **Streaming**: Rows render immediately in streaming mode via `streamAppendRow` (`stream.go:streamAppendRow`). +- **Error Handling**: `Append` and `Bulk` return errors for invalid conversions or streaming issues (`tablewriter.go`). + +**Migration Tips**: +- Replace `Append([]string)` with `Append(...any)` for variadic input. +- Use `Bulk` for multiple rows, ensuring each element is a valid row representation. +- Implement `tw.Formatter` for custom struct formatting to control cell output. +- Match row cell count to headers to avoid alignment issues. +- In streaming mode, append rows after `Start()` and before `Close()` (`stream.go`). + +**Potential Pitfalls**: +- **Cell Count Mismatch**: Uneven row lengths may cause rendering errors; pad with empty strings (e.g., `""`) if needed. +- **Struct Conversion**: Unexported fields are ignored; ensure fields are public or use `Formatter`/`Stringer` (`zoo.go`). +- **Streaming Order**: Rows must be appended after headers in streaming to maintain width consistency (`stream.go`). +- **Error Ignored**: Always check `Bulk` errors, as invalid data can cause failures. + +#### 2.3. Setting Footers +Footers provide summary or closing data for the table, often aligned differently from rows. + +**Old (v0.0.5):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "os" +) + +func main() { + table := tablewriter.NewWriter(os.Stdout) + table.SetHeader([]string{"ColA", "ColB", "ColC", "ColD"}) // Add header for context + table.SetFooter([]string{"", "", "Total", "1408"}) + table.Render() +} +``` + +**New (v1.0.x):** +```go +package main + +import ( + "fmt" + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" // For tw.Formatter + "os" +) + +// Using Formatter +type FooterSummary struct { // Renamed to avoid conflict + Label string + Value float64 +} + +func (s FooterSummary) Format() string { return fmt.Sprintf("%s: %.2f", s.Label, s.Value) } // Implements tw.Formatter + +func main() { + table := tablewriter.NewTable(os.Stdout) + table.Header("ColA", "ColB", "ColC", "ColD") // Header for context + + // Variadic Arguments + table.Footer("", "", "Total", 1408) + + // Slice of Any Type + // table.Footer([]any{"", "", "Total", 1408.50}) + + table.Render() // Render this table + + fmt.Println("--- Another Table with Formatter Footer ---") + table2 := tablewriter.NewTable(os.Stdout) + table2.Header("Summary Info") // Single column header + // Using Formatter for a single cell footer + table2.Footer(FooterSummary{Label: "Grand Total", Value: 1408.50}) // Single cell: "Grand Total: 1408.50" + table2.Render() +} +``` + +**Key Changes**: +- **Method**: `SetFooter([]string)` replaced by `Footer(...any)` (`tablewriter.go:Footer`). +- **Input Flexibility**: Like `Header`, accepts variadic arguments, slices, or structs with `Formatter`/`Stringer` support (`zoo.go:processVariadic`). +- **Streaming**: Footers are buffered via `streamStoreFooter` and rendered during `Close()` (`stream.go:streamStoreFooter`, `stream.go:streamRenderFooter`). +- **Formatting**: Controlled by `Config.Footer` settings (e.g., `Alignment`, `AutoWrap`) (`zoo.go:prepareTableSection`). + +**Migration Tips**: +- Replace `SetFooter` with `Footer`, preferring variadic input for simplicity. +- Use `tw.Formatter` for custom footer formatting (e.g., formatted numbers). +- Ensure footer cell count matches headers/rows to maintain alignment. +- In streaming mode, call `Footer()` before `Close()` to include it in rendering. + +**Potential Pitfalls**: +- **Alignment Differences**: Default `Footer.Alignment.Global = tw.AlignRight` differs from rows (`tw.AlignLeft`); adjust if needed (`config.go`). +- **Streaming Timing**: Footers not rendered until `Close()`; ensure `Close()` is called (`stream.go`). +- **Empty Footers**: Missing footers may affect table appearance; use placeholders if needed. + +### 3. Rendering the Table +Rendering has been overhauled to support both batch and streaming modes, with mandatory error handling for robustness. + +**Old (v0.0.5):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "os" +) + +func main() { + table := tablewriter.NewWriter(os.Stdout) + table.SetHeader([]string{"Data"}) + table.Append([]string{"Example"}) + table.Render() +} +``` + +**New (v1.0.x) - Batch Mode:** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "log" + "os" +) + +func main() { + table := tablewriter.NewTable(os.Stdout) + table.Header("Data") + table.Append("Example") + if err := table.Render(); err != nil { + log.Fatalf("Table rendering failed: %v", err) + } +} +``` + +**New (v1.0.x) - Streaming Mode:** +```go +package main + +import ( + "fmt" + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" + "log" + "os" +) + +func main() { + tableStream := tablewriter.NewTable(os.Stdout, + tablewriter.WithConfig(tablewriter.Config{ + Stream: tw.StreamConfig{Enable: true}, + Widths: tw.CellWidth{ + Global: 12, // Fixed column width for streaming + PerColumn: tw.NewMapper[int, int]().Set(0, 15), // Column 0 at 15 + }, + }), + ) + // Alternative: Using WithStreaming Option + // tableStream := tablewriter.NewTable(os.Stdout, + // tablewriter.WithStreaming(tw.StreamConfig{Enable: true}), + // tablewriter.WithColumnMax(12), // Sets Config.Widths.Global + // ) + + if err := tableStream.Start(); err != nil { + log.Fatalf("Failed to start table stream: %v", err) + } + tableStream.Header("Column 1", "Column 2") + for i := 0; i < 3; i++ { + if err := tableStream.Append(fmt.Sprintf("Data %d-1", i), fmt.Sprintf("Data %d-2", i)); err != nil { + log.Printf("Failed to append row %d: %v", i, err) // Log and continue or handle differently + } + } + tableStream.Footer("End", "Summary") + if err := tableStream.Close(); err != nil { + log.Fatalf("Failed to close table stream: %v", err) + } +} +``` + +**Key Changes**: +- **Batch Mode**: + - `Render()` processes all data (headers, rows, footers) in one go (`tablewriter.go:render`). + - Calculates column widths dynamically based on content, `Config.Widths`, `ColMaxWidths`, and `MaxWidth` (`zoo.go:calculateAndNormalizeWidths`). + - Invokes renderer methods: `Start()`, `Header()`, `Row()`, `Footer()`, `Line()`, `Close()` (`tw/renderer.go`). + - Returns errors for invalid configurations or I/O issues. +- **Streaming Mode**: + - Enabled via `Config.Stream.Enable` or `WithStreaming(tw.StreamConfig{Enable: true})` (`tablewriter.go:WithStreaming`). + - `Start()` initializes the stream, fixing column widths based on `Config.Widths` or first data (header/row) (`stream.go:streamCalculateWidths`). + - `Header()`, `Append()` render immediately (`stream.go:streamRenderHeader`, `stream.go:streamAppendRow`). + - `Footer()` buffers data, rendered by `Close()` (`stream.go:streamStoreFooter`, `stream.go:streamRenderFooter`). + - `Close()` finalizes rendering with footer and borders (`stream.go:Close`). + - All methods return errors for robust handling. +- **Error Handling**: Mandatory error checks replace silent failures, improving reliability. + +**Migration Tips**: +- Replace `Render()` calls with error-checked versions in batch mode. +- For streaming, adopt `Start()`, `Append()`, `Close()` workflow, ensuring `Start()` precedes data input. +- Set `Config.Widths` for consistent column widths in streaming mode (`config.go`). +- Use `WithRendition` to customize visual output, as renderer settings are decoupled (`tablewriter.go`). +- Test rendering with small datasets to verify configuration before scaling. + +**Potential Pitfalls**: +- **Missing Error Checks**: Failing to check errors can miss rendering failures; always use `if err != nil`. +- **Streaming Widths**: Widths are fixed after `Start()`; inconsistent data may cause truncation (`stream.go`). +- **Renderer Misconfiguration**: Ensure `tw.Rendition` matches desired output style (`tw/renderer.go`). +- **Incomplete Streaming**: Forgetting `Close()` in streaming mode omits footer and final borders (`stream.go`). +- **Batch vs. Streaming**: Using `Render()` in streaming mode causes errors; use `Start()`/`Close()` instead (`tablewriter.go`). + + +## Styling and Appearance Configuration + +Styling in v1.0.x is split between `tablewriter.Config` for data processing (e.g., alignment, padding, wrapping) and `tw.Rendition` for visual rendering (e.g., borders, symbols, lines). This section details how to migrate v0.0.5 styling methods to v1.0.x, providing examples, best practices, and migration tips to maintain or enhance table appearance. + +### 4.1. Table Styles +Table styles define the visual structure through border and separator characters. In v0.0.5, styles were set via individual separator methods, whereas v1.0.x uses `tw.Rendition.Symbols` for a cohesive approach, offering predefined styles and custom symbol sets. + +**Available Table Styles**: +The `tw.Symbols` interface (`tw/symbols.go`) supports a variety of predefined styles, each tailored to specific use cases, as well as custom configurations for unique requirements. + +| Style Name | Use Case | Symbols Example | Recommended Context | +|----------------|-----------------------------------|-------------------------------------|-----------------------------------------| +| `StyleASCII` | Simple, terminal-friendly | `+`, `-`, `|` | Basic CLI output, minimal dependencies; ensures compatibility across all terminals, including older or non-Unicode systems. | +| `StyleLight` | Clean, lightweight borders | `┌`, `└`, `─`, `│` | Modern terminals, clean and professional aesthetics; suitable for most CLI applications requiring a modern look. | +| `StyleHeavy` | Thick, prominent borders | `┏`, `┗`, `━`, `┃` | High-visibility reports, dashboards, or logs; emphasizes table structure for critical data presentation. | +| `StyleDouble` | Double-line borders | `╔`, `╚`, `═`, `║` | Formal documents, structured data exports; visually distinct for presentations or printed outputs. | +| `StyleRounded` | Rounded corners, aesthetic | `╭`, `╰`, `─`, `│` | User-friendly CLI applications, reports; enhances visual appeal with smooth, rounded edges. | +| `StyleMarkdown`| Markdown-compatible | `|`, `-`, `:` | Documentation, GitHub READMEs, or Markdown-based platforms; ensures proper rendering in Markdown viewers. | +*Note: `StyleBold` was mentioned but not defined in the symbols code, `StyleHeavy` is similar.* + +**Old (v0.0.5):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "os" +) + +func main() { + table := tablewriter.NewWriter(os.Stdout) + // table.SetCenterSeparator("*") // Example, actual v0.0.5 method might vary + // table.SetColumnSeparator("!") + // table.SetRowSeparator("=") + // table.SetBorder(true) + table.SetHeader([]string{"Header1", "Header2"}) + table.Append([]string{"Cell1", "Cell2"}) + table.Render() +} +``` + +**New (v1.0.x):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + // Using a Predefined Style (Rounded Corners for Aesthetic Output) + tableStyled := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewBlueprint()), // Ensure renderer is set + tablewriter.WithRendition(tw.Rendition{ + Symbols: tw.NewSymbols(tw.StyleRounded), // Predefined rounded style + Borders: tw.Border{Top: tw.On, Bottom: tw.On, Left: tw.On, Right: tw.On}, + Settings: tw.Settings{ + Separators: tw.Separators{BetweenRows: tw.On}, // Lines between rows + }, + }), + ) + tableStyled.Header("Name", "Status") + tableStyled.Append("Node1", "Ready") + tableStyled.Render() + + // Using Fully Custom Symbols (Mimicking v0.0.5 Custom Separators) + mySymbols := tw.NewSymbolCustom("my-style"). // Fluent builder for custom symbols + WithCenter("*"). // Junction of lines + WithColumn("!"). // Vertical separator + WithRow("="). // Horizontal separator + WithTopLeft("/"). + WithTopMid("-"). + WithTopRight("\\"). + WithMidLeft("["). + WithMidRight("]"). // Corrected from duplicate WithMidRight("+") + // WithMidMid was not a method in SymbolCustom + WithBottomLeft("\\"). + WithBottomMid("_"). + WithBottomRight("/"). + WithHeaderLeft("("). + WithHeaderMid("-"). + WithHeaderRight(")") // Header-specific + tableCustomSymbols := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewBlueprint()), + tablewriter.WithRendition(tw.Rendition{ + Symbols: mySymbols, + Borders: tw.Border{Top: tw.On, Bottom: tw.On, Left: tw.On, Right: tw.On}, + }), + ) + tableCustomSymbols.Header("Name", "Status") + tableCustomSymbols.Append("Node1", "Ready") + tableCustomSymbols.Render() +} +``` + +**Output (Styled, Rounded):** +``` +╭───────┬────────╮ +│ NAME │ STATUS │ +├───────┼────────┤ +│ Node1 │ Ready │ +╰───────┴────────╯ +``` + +**Output (Custom Symbols):** +``` +/=======-========\ +! NAME ! STATUS ! +[=======*========] +! Node1 ! Ready ! +\=======_========/ +``` + +**Key Changes**: +- **Deprecated Methods**: `SetCenterSeparator`, `SetColumnSeparator`, `SetRowSeparator`, and `SetBorder` are deprecated and moved to `deprecated.go`. These are replaced by `tw.Rendition.Symbols` and `tw.Rendition.Borders` for a unified styling approach (`tablewriter.go`). +- **Symbol System**: The `tw.Symbols` interface defines all drawing characters used for table lines, junctions, and corners (`tw/symbols.go:Symbols`). + - `tw.NewSymbols(tw.BorderStyle)` provides predefined styles (e.g., `tw.StyleASCII`, `tw.StyleMarkdown`, `tw.StyleRounded`) for common use cases. (Note: `tw.Style` should be `tw.BorderStyle`) + - `tw.NewSymbolCustom(name string)` enables fully custom symbol sets via a fluent builder, allowing precise control over each character (e.g., `WithCenter`, `WithTopLeft`). +- **Renderer Dependency**: Styling requires a renderer, set via `WithRenderer`; the default is `renderer.NewBlueprint()` if not specified (`tablewriter.go:WithRenderer`). +- **Border Control**: `tw.Rendition.Borders` uses `tw.State` (`tw.On`, `tw.Off`) to enable or disable borders on each side (Top, Bottom, Left, Right) (`tw/renderer.go:Border`). +- **Extensibility**: Custom styles can be combined with custom renderers for non-text outputs, enhancing flexibility (`tw/renderer.go`). + +**Migration Tips**: +- Replace individual separator setters (`SetCenterSeparator`, etc.) with `tw.NewSymbols` for predefined styles or `tw.NewSymbolCustom` for custom designs to maintain or enhance v0.0.5 styling. +- Use `WithRendition` to apply `tw.Rendition` settings, ensuring a renderer is explicitly set to avoid default behavior (`tablewriter.go`). +- Test table styles in your target environment (e.g., terminal, Markdown viewer, or log file) to ensure compatibility with fonts and display capabilities. +- For Markdown-based outputs (e.g., GitHub READMEs), use `tw.StyleMarkdown` to ensure proper rendering in Markdown parsers (`tw/symbols.go`). +- Combine `tw.Rendition.Symbols` with `tw.Rendition.Borders` and `tw.Rendition.Settings` to replicate or improve v0.0.5’s border and line configurations (`tw/renderer.go`). +- Document custom symbol sets in code comments to aid maintenance, as they can be complex (`tw/symbols.go`). + +**Potential Pitfalls**: +- **Missing Renderer**: If `WithRenderer` is omitted, `NewTable` defaults to `renderer.NewBlueprint` with minimal styling, which may not match v0.0.5’s `SetBorder(true)` behavior; always specify for custom styles (`tablewriter.go`). +- **Incomplete Custom Symbols**: When using `tw.NewSymbolCustom`, failing to set all required symbols (e.g., `TopLeft`, `Center`, `HeaderLeft`) can cause rendering errors or inconsistent visuals; ensure all necessary characters are defined (`tw/symbols.go`). +- **Terminal Compatibility Issues**: Advanced styles like `StyleDouble` or `StyleHeavy` may not render correctly in older terminals or non-Unicode environments; use `StyleASCII` for maximum compatibility across platforms (`tw/symbols.go`). +- **Border and Symbol Mismatch**: Inconsistent `tw.Rendition.Borders` and `tw.Symbols` settings (e.g., enabling borders but using minimal symbols) can lead to visual artifacts; test with small tables to verify alignment (`tw/renderer.go`). +- **Markdown Rendering**: Non-Markdown styles (e.g., `StyleRounded`) may not render correctly in Markdown viewers; use `StyleMarkdown` for documentation or web-based outputs (`tw/symbols.go`). + +### 4.2. Borders and Separator Lines +Borders and internal lines define the table’s structural appearance, controlling the visibility of outer edges and internal divisions. In v0.0.5, these were set via specific methods, while v1.0.x uses `tw.Rendition` fields for a more integrated approach. + +**Old (v0.0.5):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "os" +) + +func main() { + table := tablewriter.NewWriter(os.Stdout) + // table.SetBorder(false) // Disable all outer borders + // table.SetRowLine(true) // Enable lines between data rows + // table.SetHeaderLine(true) // Enable line below header + table.SetHeader([]string{"Header1", "Header2"}) + table.Append([]string{"Cell1", "Cell2"}) + table.Render() +} +``` + +**New (v1.0.x):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + // Standard Bordered Table with Internal Lines + table := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewBlueprint()), + tablewriter.WithRendition(tw.Rendition{ + Borders: tw.Border{ // Outer table borders + Left: tw.On, + Right: tw.On, + Top: tw.On, + Bottom: tw.On, + }, + Settings: tw.Settings{ + Lines: tw.Lines{ // Major internal separator lines + ShowHeaderLine: tw.On, // Line after header + ShowFooterLine: tw.On, // Line before footer (if footer exists) + }, + Separators: tw.Separators{ // General row and column separators + BetweenRows: tw.On, // Horizontal lines between data rows + BetweenColumns: tw.On, // Vertical lines between columns + }, + }, + }), + ) + table.Header("Name", "Status") + table.Append("Node1", "Ready") + table.Render() + + // Borderless Table (kubectl-style, No Lines or Separators) + // Configure the table with a borderless, kubectl-style layout + config := tablewriter.NewConfigBuilder(). + Header(). + Padding(). + WithGlobal(tw.PaddingNone). // No header padding + Build(). + Alignment(). + WithGlobal(tw.AlignLeft). // Left-align header + Build(). + Row(). + Padding(). + WithGlobal(tw.PaddingNone). // No row padding + Build(). + Alignment(). + WithGlobal(tw.AlignLeft). // Left-align rows + Build(). + Footer(). + Padding(). + WithGlobal(tw.PaddingNone). // No footer padding + Build(). + Alignment(). + WithGlobal(tw.AlignLeft). // Left-align footer (if used) + Build(). + WithDebug(true). // Enable debug logging + Build() + + // Create borderless table + tableBorderless := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewBlueprint()), // Assumes valid renderer + tablewriter.WithRendition(tw.Rendition{ + Borders: tw.BorderNone, // No borders + Symbols: tw.NewSymbols(tw.StyleNone), // No border symbols + Settings: tw.Settings{ + Lines: tw.LinesNone, // No header/footer lines + Separators: tw.SeparatorsNone, // No row/column separators + }, + }), + tablewriter.WithConfig(config), + ) + + // Set headers and data + tableBorderless.Header("Name", "Status") + tableBorderless.Append("Node1", "Ready") + tableBorderless.Render() +} +``` + +**Output (Standard Bordered):** +``` +┌───────┬────────┐ +│ Name │ Status │ +├───────┼────────┤ +│ Node1 │ Ready │ +└───────┴────────┘ +``` + +**Output (Borderless):** +``` +NAME STATUS +Node1 Ready +``` + +**Key Changes**: +- **Deprecated Methods**: `SetBorder`, `SetRowLine`, and `SetHeaderLine` are deprecated and moved to `deprecated.go`. These are replaced by fields in `tw.Rendition` (`tw/renderer.go`): + - `Borders`: Controls outer table borders (`tw.Border`) with `tw.State` (`tw.On`, `tw.Off`) for each side (Top, Bottom, Left, Right). + - `Settings.Lines`: Manages major internal lines (`ShowHeaderLine` for header, `ShowFooterLine` for footer) (`tw.Lines`). + - `Settings.Separators`: Controls general separators between rows (`BetweenRows`) and columns (`BetweenColumns`) (`tw.Separators`). +- **Presets for Simplicity**: `tw.BorderNone`, `tw.LinesNone`, and `tw.SeparatorsNone` provide quick configurations for minimal or borderless tables (`tw/preset.go`). +- **Renderer Integration**: Border and line settings are applied via `WithRendition`, requiring a renderer to be set (`tablewriter.go:WithRendition`). +- **Granular Control**: Each border side and line type can be independently configured, offering greater flexibility than v0.0.5’s boolean toggles. +- **Dependency on Symbols**: The appearance of borders and lines depends on `tw.Rendition.Symbols`; ensure compatible symbol sets (`tw/symbols.go`). + +**Migration Tips**: +- Replace `SetBorder(false)` with `tw.Rendition.Borders = tw.BorderNone` to disable all outer borders (`tw/preset.go`). +- Use `tw.Rendition.Settings.Separators.BetweenRows = tw.On` to replicate `SetRowLine(true)`, ensuring row separators are visible (`tw/renderer.go`). +- Set `tw.Rendition.Settings.Lines.ShowHeaderLine = tw.On` to mimic `SetHeaderLine(true)` for a line below the header (`tw/renderer.go`). +- For kubectl-style borderless tables, combine `tw.BorderNone`, `tw.LinesNone`, `tw.SeparatorsNone`, and `WithPadding(tw.PaddingNone)` (applied via `ConfigBuilder` or `WithConfig`) to eliminate all lines and spacing (`tw/preset.go`, `config.go`). +- Test border and line configurations with small tables to verify visual consistency, especially when combining with custom `tw.Symbols`. +- Use `WithDebug(true)` to log rendering details if borders or lines appear incorrectly (`config.go`). + +**Potential Pitfalls**: +- **Separator Absence**: If `tw.Rendition.Settings.Separators.BetweenColumns` is `tw.Off` and borders are disabled, columns may lack visual separation; use `tw.CellPadding` or ensure content spacing (`tw/cell.go`). +- **Line and Border Conflicts**: Mismatched settings (e.g., enabling `ShowHeaderLine` but disabling `Borders.Top`) can cause uneven rendering; align `Borders`, `Lines`, and `Separators` settings (`tw/renderer.go`). +- **Renderer Dependency**: Border settings require a renderer; omitting `WithRenderer` defaults to `renderer.NewBlueprint` with minimal styling, which may not match v0.0.5 expectations (`tablewriter.go`). +- **Streaming Limitations**: In streaming mode, separator rendering is fixed after `Start()`; ensure `tw.Rendition` is set correctly before rendering begins (`stream.go`). +- **Symbol Mismatch**: Using minimal `tw.Symbols` (e.g., `StyleASCII`) with complex `Borders` settings may lead to visual artifacts; test with matching symbol sets (`tw/symbols.go`). + +### 4.3. Alignment +Alignment controls the positioning of text within table cells, now configurable per section (Header, Row, Footer) with both global and per-column options for greater precision. + +**Old (v0.0.5):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" // Assuming ALIGN_CENTER etc. were constants here + "os" +) + +const ( // Mocking v0.0.5 constants for example completeness + ALIGN_CENTER = 1 // Example values + ALIGN_LEFT = 2 +) + + +func main() { + table := tablewriter.NewWriter(os.Stdout) + // table.SetAlignment(ALIGN_CENTER) // Applied to data rows + // table.SetHeaderAlignment(ALIGN_LEFT) // Applied to header + // No specific footer alignment setter + table.SetHeader([]string{"Header1", "Header2"}) + table.Append([]string{"Cell1", "Cell2"}) + table.Render() +} +``` + +**New (v1.0.x):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + cfg := tablewriter.Config{ + Header: tw.CellConfig{ + Alignment: tw.CellAlignment{Global: tw.AlignLeft}, + }, + Row: tw.CellConfig{ + Alignment: tw.CellAlignment{ + Global: tw.AlignCenter, + PerColumn: []tw.Align{tw.AlignLeft, tw.AlignRight}, // Col 0 left, Col 1 right + }, + }, + Footer: tw.CellConfig{ + Alignment: tw.CellAlignment{Global: tw.AlignRight}, + }, + } + table := tablewriter.NewTable(os.Stdout, tablewriter.WithConfig(cfg)) + + table.Header("Name", "Status") + table.Append("Node1", "Ready") + table.Footer("", "Active") // Ensure footer has content to show alignment + table.Render() +} +``` + +**Output:** +``` +┌───────┬────────┐ +│ NAME │ STATUS │ +├───────┼────────┤ +│ Node1 │ Ready │ +├───────┼────────┤ +│ │ Active │ +└───────┴────────┘ +``` + +**Key Changes**: +- **Deprecated Methods**: `SetAlignment` and `SetHeaderAlignment` are replaced by `WithRowAlignment`, `WithHeaderAlignment`, `WithFooterAlignment`, or direct `Config` settings (`config.go`). These old methods are retained in `deprecated.go` for compatibility but should be migrated. +- **Alignment Structure**: Alignment is managed within `tw.CellConfig.Alignment` (`tw/cell.go:CellAlignment`), which includes: + - `Global`: A single `tw.Align` value applied to all cells in the section (`tw.AlignLeft`, `tw.AlignCenter`, `tw.AlignRight`, `tw.AlignNone`). + - `PerColumn`: A slice of `tw.Align` values for column-specific alignment, overriding `Global` for specified columns. +- **Footer Alignment**: v1.0.x introduces explicit footer alignment via `WithFooterAlignment` or `Config.Footer.Alignment`, addressing v0.0.5’s lack of footer-specific control (`config.go`). +- **Type Safety**: `tw.Align` string constants replace v0.0.5’s integer constants (e.g., `ALIGN_CENTER`), improving clarity and reducing errors (`tw/types.go`). +- **Builder Support**: `ConfigBuilder` provides `Alignment()` methods for each section. `ForColumn(idx).WithAlignment()` applies alignment to a specific column across all sections (`config.go:ConfigBuilder`, `config.go:ColumnConfigBuilder`). +- **Deprecated Fields**: `tw.CellConfig.ColumnAligns` (slice) and `tw.CellFormatting.Alignment` (single value) are supported for backward compatibility but should be migrated to `tw.CellAlignment.Global` and `tw.CellAlignment.PerColumn` (`tw/cell.go`). + +**Migration Tips**: +- Replace `SetAlignment(ALIGN_X)` with `WithRowAlignment(tw.AlignX)` or `Config.Row.Alignment.Global = tw.AlignX` to set row alignment (`config.go`). +- Use `WithHeaderAlignment(tw.AlignX)` for headers and `WithFooterAlignment(tw.AlignX)` for footers to maintain or adjust v0.0.5 behavior (`config.go`). +- Specify per-column alignments with `ConfigBuilder.Row().Alignment().WithPerColumn([]tw.Align{...})` or by setting `Config.Row.Alignment.PerColumn` for fine-grained control (`config.go`). +- Use `ConfigBuilder.ForColumn(idx).WithAlignment(tw.AlignX)` to apply consistent alignment to a specific column across all sections (Header, Row, Footer) (`config.go`). +- Verify alignment settings against defaults (`Header: tw.AlignCenter`, `Row: tw.AlignLeft`, `Footer: tw.AlignRight`) to ensure expected output (`config.go:defaultConfig`). +- Test alignment with varied cell content lengths to confirm readability, especially when combined with wrapping or padding settings (`zoo.go:prepareContent`). + +**Potential Pitfalls**: +- **Alignment Precedence**: `PerColumn` settings override `Global` within a section; ensure column-specific alignments are intentional (`tw/cell.go:CellAlignment`). +- **Deprecated Fields**: Relying on `ColumnAligns` or `tw.CellFormatting.Alignment` is temporary; migrate to `tw.CellAlignment` to avoid future issues (`tw/cell.go`). +- **Cell Count Mismatch**: Rows or footers with fewer cells than headers can cause alignment errors; pad with empty strings (`""`) to match column count (`zoo.go`). +- **Streaming Width Impact**: In streaming mode, alignment depends on fixed column widths set by `Config.Widths`; narrow widths may truncate content, misaligning text (`stream.go:streamCalculateWidths`). +- **Default Misalignment**: The default `Footer.Alignment.Global = tw.AlignRight` differs from rows (`tw.AlignLeft`); explicitly set `WithFooterAlignment` if consistency is needed (`config.go`). + +### 4.4. Auto-Formatting (Header Title Case) +Auto-formatting applies transformations like title case to cell content, primarily for headers to enhance readability, but it can be enabled for rows or footers in v1.0.x. + +**Old (v0.0.5):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "os" +) + +func main() { + table := tablewriter.NewWriter(os.Stdout) + // table.SetAutoFormatHeaders(true) // Default: true; applies title case to headers + table.SetHeader([]string{"col_one", "status_report"}) + table.Append([]string{"Node1", "Ready"}) + table.Render() +} +``` + +**New (v1.0.x):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + // Using Direct Config Struct to turn OFF default AutoFormat for Header + cfg := tablewriter.Config{ + Header: tw.CellConfig{Formatting: tw.CellFormatting{AutoFormat: tw.Off}}, // Turn OFF title case for headers + Row: tw.CellConfig{Formatting: tw.CellFormatting{AutoFormat: tw.Off}}, // No formatting for rows (default) + Footer: tw.CellConfig{Formatting: tw.CellFormatting{AutoFormat: tw.Off}}, // No formatting for footers (default) + } + tableNoAutoFormat := tablewriter.NewTable(os.Stdout, tablewriter.WithConfig(cfg)) + + tableNoAutoFormat.Header("col_one", "status_report") // Stays as "col_one", "status_report" + tableNoAutoFormat.Append("Node1", "Ready") + tableNoAutoFormat.Render() + + // Using Option Function for Headers (default is ON, this makes it explicit) + tableWithAutoFormat := tablewriter.NewTable(os.Stdout, + tablewriter.WithHeaderAutoFormat(tw.On), // Explicitly enable title case (default behavior) + ) + + tableWithAutoFormat.Header("col_one", "status_report") // Becomes "COL ONE", "STATUS REPORT" + tableWithAutoFormat.Append("Node1", "Ready") + tableWithAutoFormat.Render() +} +``` + +**Output:** +``` +┌─────────┬───────────────┐ +│ col_one │ status_report │ +├─────────┼───────────────┤ +│ Node1 │ Ready │ +└─────────┴───────────────┘ +┌─────────┬───────────────┐ +│ COL ONE │ STATUS REPORT │ +├─────────┼───────────────┤ +│ Node1 │ Ready │ +└─────────┴───────────────┘ +``` + +**Key Changes**: +- **Method**: `SetAutoFormatHeaders` is replaced by `Config.Header.Formatting.AutoFormat`, or equivalent builder methods (`config.go`). +- **Extended Scope**: Auto-formatting can now be applied to rows and footers via `Config.Row.Formatting.AutoFormat` and `Config.Footer.Formatting.AutoFormat`, unlike v0.0.5’s header-only support (`tw/cell.go`). +- **Type Safety**: `tw.State` (`tw.On`, `tw.Off`, `tw.Unknown`) controls formatting state, replacing boolean flags (`tw/state.go`). +- **Behavior**: When `tw.On`, the `tw.Title` function converts text to uppercase and replaces underscores and some periods with spaces (e.g., "col_one" → "COL ONE") (`tw/fn.go:Title`, `zoo.go:prepareContent`). +- **Defaults**: `Header.Formatting.AutoFormat = tw.On`, `Row.Formatting.AutoFormat = tw.Off`, `Footer.Formatting.AutoFormat = tw.Off` (`config.go:defaultConfig`). + +**Migration Tips**: +- To maintain v0.0.5’s default header title case behavior, no explicit action is needed as `WithHeaderAutoFormat(tw.On)` is the default. If you were using `SetAutoFormatHeaders(false)`, you'd use `WithHeaderAutoFormat(tw.Off)`. +- Explicitly set `WithRowAutoFormat(tw.Off)` or `WithFooterAutoFormat(tw.Off)` if you want to ensure rows and footers remain unformatted, as v1.0.x allows enabling formatting for these sections (`config.go`). +- Use `ConfigBuilder.Header().Formatting().WithAutoFormat(tw.State)` for precise control over formatting per section (`config.go`). +- Test header output with underscores or periods (e.g., "my_column") to verify title case transformation meets expectations. +- For custom formatting beyond title case (e.g., custom capitalization), use `tw.CellFilter` instead of `AutoFormat` (`tw/cell.go`). + +**Potential Pitfalls**: +- **Default Header Formatting**: `Header.Formatting.AutoFormat = tw.On` by default may unexpectedly alter header text (e.g., "col_one" → "COL ONE"); disable with `WithHeaderAutoFormat(tw.Off)` if raw headers are preferred (`config.go`). +- **Row/Footer Formatting**: Enabling `AutoFormat` for rows or footers (not default) applies title case, which may not suit data content; verify with `tw.Off` unless intended (`tw/cell.go`). +- **Filter Conflicts**: Combining `AutoFormat` with `tw.CellFilter` can lead to overlapping transformations; prioritize filters for complex formatting (`zoo.go:prepareContent`). +- **Performance Overhead**: Auto-formatting large datasets may add minor processing time; disable for performance-critical applications (`zoo.go`). + +### 4.5. Text Wrapping +Text wrapping determines how long cell content is handled within width constraints, offering more options in v1.0.x compared to v0.0.5’s binary toggle. + +**Old (v0.0.5):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "os" +) + +func main() { + table := tablewriter.NewWriter(os.Stdout) + // table.SetAutoWrapText(true) // Enable normal word wrapping + // table.SetAutoWrapText(false) // Disable wrapping + table.SetHeader([]string{"Long Header Text Example", "Status"}) + table.Append([]string{"This is some very long cell content that might wrap", "Ready"}) + table.Render() +} +``` + +**New (v1.0.x):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" // For tw.WrapNormal etc. + "os" +) + +func main() { + // Using Option Functions for Quick Wrapping Settings on a specific section (e.g., Row) + // To actually see wrapping, a MaxWidth for the table or columns is needed. + table := tablewriter.NewTable(os.Stdout, + tablewriter.WithRowAutoWrap(tw.WrapNormal), // Set row wrapping + tablewriter.WithHeaderAutoWrap(tw.WrapTruncate), // Header truncates (default) + tablewriter.WithMaxWidth(30), // Force wrapping by setting table max width + ) + table.Header("Long Header Text", "Status") + table.Append("This is a very long cell content", "Ready") + table.Footer("Summary", "Active") + table.Render() + + // For more fine-grained control (e.g., different wrapping for header, row, footer): + cfgBuilder := tablewriter.NewConfigBuilder() + cfgBuilder.Header().Formatting().WithAutoWrap(tw.WrapTruncate) // Header: Truncate + cfgBuilder.Row().Formatting().WithAutoWrap(tw.WrapNormal) // Row: Normal wrap + cfgBuilder.Footer().Formatting().WithAutoWrap(tw.WrapBreak) // Footer: Break words + cfgBuilder.WithMaxWidth(40) // Overall table width constraint + + tableFullCfg := tablewriter.NewTable(os.Stdout, tablewriter.WithConfig(cfgBuilder.Build())) + tableFullCfg.Header("Another Very Long Header Example That Will Be Truncated", "Info") + tableFullCfg.Append("This is an example of row content that should wrap normally based on available space.", "Detail") + tableFullCfg.Footer("FinalSummaryInformationThatMightBreakAcrossLines", "End") + tableFullCfg.Render() +} +``` + +**Output (tableOpt):** +``` +┌──────────────┬────────┐ +│ LONG HEADER… │ STATUS │ +├──────────────┼────────┤ +│ This is a │ Ready │ +│ very long │ │ +│ cell content │ │ +├──────────────┼────────┤ +│ Summary │ Active │ +└──────────────┴────────┘ +``` +*(Second table output will vary based on content and width)* + +**Key Changes**: +- **Method**: `SetAutoWrapText` is replaced by `Config.
.Formatting.AutoWrap` or specific `With
AutoWrap` options (`config.go`). +- **Wrapping Modes**: `int` constants for `AutoWrap` (e.g., `tw.WrapNone`, `tw.WrapNormal`, `tw.WrapTruncate`, `tw.WrapBreak`) replace v0.0.5’s binary toggle (`tw/tw.go`). +- **Section-Specific Control**: Wrapping is configurable per section (Header, Row, Footer), unlike v0.0.5’s global setting (`tw/cell.go`). +- **Defaults**: `Header: tw.WrapTruncate`, `Row: tw.WrapNormal`, `Footer: tw.WrapNormal` (`config.go:defaultConfig`). +- **Width Dependency**: Wrapping behavior relies on width constraints set by `Config.Widths` (fixed column widths), `Config.
.ColMaxWidths` (max content width), or `Config.MaxWidth` (total table width) (`zoo.go:calculateContentMaxWidth`, `zoo.go:prepareContent`). + +**Migration Tips**: +- Replace `SetAutoWrapText(true)` with `WithRowAutoWrap(tw.WrapNormal)` to maintain v0.0.5’s default wrapping for rows (`config.go`). +- Use `WithHeaderAutoWrap(tw.WrapTruncate)` to align with v1.0.x’s default header behavior, ensuring long headers are truncated (`config.go`). +- Set `Config.Widths` or `Config.MaxWidth` explicitly to enforce wrapping, as unconstrained widths may prevent wrapping (`config.go`). +- Use `ConfigBuilder.
().Formatting().WithAutoWrap(int_wrap_mode)` for precise control over wrapping per section (`config.go`). +- Test wrapping with varied content lengths (e.g., short and long text) to ensure readability and proper width allocation. +- Consider `tw.WrapNormal` for data rows to preserve content integrity, reserving `tw.WrapTruncate` for headers or footers (`tw/tw.go`). + +**Potential Pitfalls**: +- **Missing Width Constraints**: Without `Config.Widths`, `ColMaxWidths`, or `MaxWidth`, wrapping may not occur, leading to overflow; always define width limits for wrapping (`zoo.go`). +- **Streaming Width Impact**: In streaming mode, wrapping depends on fixed widths set at `Start()`; narrow widths may truncate content excessively (`stream.go:streamCalculateWidths`). +- **Truncation Data Loss**: `tw.WrapTruncate` may obscure critical data in rows; use `tw.WrapNormal` or wider columns to retain content (`tw/tw.go`). +- **Performance Overhead**: Wrapping large datasets with `tw.WrapNormal` or `tw.WrapBreak` can add processing time; optimize widths for performance-critical applications (`zoo.go:prepareContent`). +- **Inconsistent Section Wrapping**: Default wrapping differs (`Header: tw.WrapTruncate`, `Row/Footer: tw.WrapNormal`); align settings if uniform behavior is needed (`config.go`). + +### 4.6. Padding +Padding adds spacing within cells, enhancing readability and affecting cell width calculations. v1.0.x introduces granular, per-side padding, replacing v0.0.5’s single inter-column padding control. + +**Old (v0.0.5):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "os" +) + +func main() { + table := tablewriter.NewWriter(os.Stdout) + // table.SetTablePadding("\t") // Set inter-column space character when borders are off + // Default: single space within cells + table.SetHeader([]string{"Header1"}) + table.Append([]string{"Cell1"}) + table.Render() +} +``` + +**New (v1.0.x):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + // Using Direct Config Struct + cfg := tablewriter.Config{ + Header: tw.CellConfig{ + Padding: tw.CellPadding{ + Global: tw.Padding{Left: "[", Right: "]", Top: "-", Bottom: "-"}, // Padding for all header cells + PerColumn: []tw.Padding{ // Specific padding for header column 0 + {Left: ">>", Right: "<<", Top: "=", Bottom: "="}, // Overrides Global for column 0 + }, + }, + }, + Row: tw.CellConfig{ + Padding: tw.CellPadding{ + Global: tw.PaddingDefault, // One space left/right for all row cells + }, + }, + Footer: tw.CellConfig{ + Padding: tw.CellPadding{ + Global: tw.Padding{Top: "~", Bottom: "~"}, // Top/bottom padding for all footer cells + }, + }, + } + table := tablewriter.NewTable(os.Stdout, tablewriter.WithConfig(cfg)) + + table.Header("Name", "Status") // Two columns + table.Append("Node1", "Ready") + table.Footer("End", "Active") + table.Render() +} +``` + +**Output:** +``` +┌────────┬────────┐ +│========│[------]│ +│>>NAME<<│[STATUS]│ +│========│[------]│ +├────────┼────────┤ +│ Node1 │ Ready │ +│~~~~~~~~│~~~~~~~~│ +│End │Active │ +│~~~~~~~~│~~~~~~~~│ +└────────┴────────┘ +``` + +**Key Changes**: +- **No Direct Equivalent for `SetTablePadding`**: `SetTablePadding` controlled inter-column spacing when borders were off in v0.0.5; v1.0.x has no direct equivalent for *inter-column* spacing separate from cell padding. Inter-column visual separation is now primarily handled by `tw.Rendition.Settings.Separators.BetweenColumns` and the chosen `tw.Symbols`. +- **Granular Cell Padding**: `tw.CellPadding` (`tw/cell.go:CellPadding`) supports: + - `Global`: A `tw.Padding` struct with `Left`, `Right`, `Top`, `Bottom` strings and an `Overwrite` flag (`tw/types.go:Padding`). This padding is *inside* the cell. + - `PerColumn`: A slice of `tw.Padding` for column-specific padding, overriding `Global` for specified columns. +- **Per-Side Control**: `Top` and `Bottom` padding add extra lines *within* cells, unlike v0.0.5’s left/right-only spacing (`zoo.go:prepareContent`). +- **Defaults**: `tw.PaddingDefault` is `{Left: " ", Right: " "}` for all sections (applied inside cells); `Top` and `Bottom` are empty by default (`tw/preset.go`). +- **Width Impact**: Cell padding contributes to column widths, calculated in `Config.Widths` (`zoo.go:calculateAndNormalizeWidths`). +- **Presets**: `tw.PaddingNone` (`{Left: "", Right: "", Top: "", Bottom: "", Overwrite: true}`) removes padding for tight layouts (`tw/preset.go`). + +**Migration Tips**: +- To achieve spacing similar to `SetTablePadding("\t")` when borders are off, you would set cell padding: `WithPadding(tw.Padding{Left: "\t", Right: "\t"})`. If you truly mean space *between* columns and not *inside* cells, ensure `tw.Rendition.Settings.Separators.BetweenColumns` is `tw.On` and customize `tw.Symbols.Column()` if needed. +- Use `tw.PaddingNone` (e.g., via `ConfigBuilder.
().Padding().WithGlobal(tw.PaddingNone)`) for no cell padding. +- Set `Top` and `Bottom` padding for vertical spacing *within* cells, enhancing readability for multi-line content (`tw/types.go`). +- Use `ConfigBuilder.
().Padding().WithPerColumn` for column-specific padding to differentiate sections or columns (`config.go`). +- Test padding with varied content and widths to ensure proper alignment and spacing, especially with wrapping enabled (`zoo.go`). +- Combine padding with `Config.Widths` or `ColMaxWidths` to control total cell size (`config.go`). + +**Potential Pitfalls**: +- **Inter-Column Spacing vs. Cell Padding**: Be clear whether you want space *between* columns (separators) or *inside* cells (padding). `SetTablePadding` was ambiguous; v1.0.x distinguishes these. +- **Width Inflation**: Cell padding increases column widths, potentially exceeding `Config.MaxWidth` or causing truncation in streaming; adjust `Config.Widths` accordingly (`zoo.go`). +- **Top/Bottom Padding**: Non-empty `Top` or `Bottom` padding adds vertical lines *within* cells, increasing cell height; use sparingly for dense tables (`zoo.go:prepareContent`). +- **Streaming Constraints**: Padding is fixed in streaming mode after `Start()`; ensure `Config.Widths` accommodates padding (`stream.go`). +- **Default Padding**: `tw.PaddingDefault` adds spaces *inside* cells; set `tw.PaddingNone` for no internal cell padding (`tw/preset.go`). + +### 4.7. Column Widths (Fixed Widths and Max Content Widths) +Column width control in v1.0.x is more sophisticated, offering fixed widths, maximum content widths, and overall table width constraints, replacing v0.0.5’s limited `SetColMinWidth`. + +**Old (v0.0.5):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "os" +) + +func main() { + table := tablewriter.NewWriter(os.Stdout) + // table.SetColMinWidth(0, 10) // Set minimum width for column 0 + table.SetHeader([]string{"Header1", "Header2"}) + table.Append([]string{"Cell1-Content", "Cell2-Content"}) + table.Render() +} +``` + +**New (v1.0.x):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + // Direct Config for Width Control + cfg := tablewriter.Config{ + Widths: tw.CellWidth{ // Fixed total column widths (content + padding) + Global: 20, // Default fixed width for all columns + PerColumn: tw.NewMapper[int, int]().Set(0, 15), // Column 0 fixed at 15 + }, + Header: tw.CellConfig{ + ColMaxWidths: tw.CellWidth{ // Max content width (excluding padding) for header cells + Global: 15, // Max content width for all header cells + PerColumn: tw.NewMapper[int, int]().Set(0, 10), // Header Col 0 max content at 10 + }, + // Default header padding is " " on left/right, so content 10 + padding 2 = 12. + // If Widths.PerColumn[0] is 15, there's space. + }, + Row: tw.CellConfig{ + ColMaxWidths: tw.CellWidth{Global: 18}, // Max content width for row cells (18 + default padding 2 = 20) + }, + MaxWidth: 80, // Constrain total table width (optional, columns might shrink) + } + tableWithCfg := tablewriter.NewTable(os.Stdout, tablewriter.WithConfig(cfg)) + tableWithCfg.Header("Very Long Header Name", "Status Information") + tableWithCfg.Append("Some long content for the first column", "Ready") + tableWithCfg.Render() + + // Option Functions for Width Settings + tableWithOpts := tablewriter.NewTable(os.Stdout, + tablewriter.WithColumnMax(20), // Sets Config.Widths.Global (fixed total col width) + tablewriter.WithColumnWidths(tw.NewMapper[int, int]().Set(0, 15)), // Sets Config.Widths.PerColumn for col 0 + tablewriter.WithMaxWidth(80), // Sets Config.MaxWidth + // For max content width per section, you'd use WithHeaderConfig, WithRowConfig, etc. + // e.g., tablewriter.WithRowMaxWidth(18) // Sets Config.Row.ColMaxWidths.Global + ) + tableWithOpts.Header("Long Header", "Status") + tableWithOpts.Append("Long Content", "Ready") + tableWithOpts.Render() +} +``` + +**Output (tableWithCfg - illustrative, exact wrapping depends on content and full config):** +``` +┌───────────┬──────────────────┐ +│ VERY LONG │ STATUS INFORMAT… │ +│ HEADER NA…│ │ +├───────────┼──────────────────┤ +│ Some long │ Ready │ +│ content f…│ │ +└───────────┴──────────────────┘ +``` + +**Key Changes**: +- **Enhanced Width System**: v1.0.x introduces three levels of width control, replacing `SetColMinWidth` (`config.go`): + - **Config.Widths**: Sets fixed total widths (content + padding) for columns, applied globally or per-column (`tw.CellWidth`). + - `Global`: Default fixed width for all columns. + - `PerColumn`: `tw.Mapper[int, int]` for specific column widths. + - **Config.
.ColMaxWidths**: Sets maximum content widths (excluding padding) for a section (Header, Row, Footer) (`tw.CellWidth`). + - `Global`: Max content width for all cells in the section. + - `PerColumn`: `tw.Mapper[int, int]` for specific columns in the section. + - **Config.MaxWidth**: Constrains the total table width, shrinking columns proportionally if needed (`config.go`). +- **Streaming Support**: In streaming mode, `Config.Widths` fixes column widths at `Start()`; `ColMaxWidths` is used only for wrapping/truncation (`stream.go:streamCalculateWidths`). +- **Calculation Logic**: Widths are computed by `calculateAndNormalizeWidths` in batch mode and `streamCalculateWidths` in streaming mode, considering content, padding, and constraints (`zoo.go`, `stream.go`). +- **Deprecated Approach**: `SetColMinWidth` is replaced by `Config.Widths.PerColumn` or `Config.
.ColMaxWidths.PerColumn` for more precise control (`deprecated.go`). + +**Migration Tips**: +- Replace `SetColMinWidth(col, w)` with `WithColumnWidths(tw.NewMapper[int, int]().Set(col, w))` for fixed column widths or `Config.
.ColMaxWidths.PerColumn` for content width limits (`config.go`). +- Use `Config.Widths.Global` or `WithColumnMax(w)` to set a default fixed width for all columns, ensuring consistency (`tablewriter.go`). +- Apply `Config.MaxWidth` to constrain total table width, especially for wide datasets (`config.go`). +- Use `ConfigBuilder.ForColumn(idx).WithMaxWidth(w)` to set per-column content width limits across sections (`config.go`). *(Note: This sets it for Header, Row, and Footer)* +- In streaming mode, set `Config.Widths` before `Start()` to fix widths, avoiding content-based sizing (`stream.go`). +- Test width settings with varied content to ensure wrapping and truncation behave as expected (`zoo.go`). + +**Potential Pitfalls**: +- **Width Precedence**: `Config.Widths.PerColumn` overrides `Widths.Global`; `ColMaxWidths` applies *within* those fixed total widths for content wrapping/truncation (`zoo.go`). +- **Streaming Width Fixing**: Widths are locked after `Start()` in streaming; inconsistent data may cause truncation (`stream.go`). +- **Padding Impact**: Padding adds to total width when considering `Config.Widths`; account for `tw.CellPadding` when setting fixed column widths (`zoo.go`). +- **MaxWidth Shrinkage**: `Config.MaxWidth` may shrink columns unevenly; test with `MaxWidth` to avoid cramped layouts (`zoo.go`). +- **No Width Constraints**: Without `Widths` or `MaxWidth`, columns size to content, potentially causing overflow; define limits (`zoo.go`). + +### 4.8. Colors +Colors in v0.0.5 were applied via specific color-setting methods, while v1.0.x embeds ANSI escape codes in cell content or uses data-driven formatting for greater flexibility. + +**Old (v0.0.5):** +```go +package main +// Assuming tablewriter.Colors and color constants existed in v0.0.5 +// This is a mock representation as the actual v0.0.5 definitions are not provided. +// import "github.com/olekukonko/tablewriter" +// import "os" + +// type Colors []interface{} // Mock +// const ( +// Bold = 1; FgGreenColor = 2; FgRedColor = 3 // Mock constants +// ) + +func main() { + // table := tablewriter.NewWriter(os.Stdout) + // table.SetColumnColor( + // tablewriter.Colors{tablewriter.Bold, tablewriter.FgGreenColor}, // Column 0 + // tablewriter.Colors{tablewriter.FgRedColor}, // Column 1 + // ) + // table.SetHeader([]string{"Name", "Status"}) + // table.Append([]string{"Node1", "Ready"}) + // table.Render() +} +``` + +**New (v1.0.x):** +```go +package main + +import ( + "fmt" + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" // For tw.Formatter + "os" +) + +// Direct ANSI Code Embedding +const ( + Reset = "\033[0m" + Bold = "\033[1m" + FgGreen = "\033[32m" + FgRed = "\033[31m" +) + +// Using tw.Formatter for Custom Types +type Status string + +func (s Status) Format() string { // Implements tw.Formatter + color := FgGreen + if s == "Error" || s == "Inactive" { + color = FgRed + } + return color + string(s) + Reset +} + +func main() { + // Example 1: Direct ANSI embedding + tableDirectANSI := tablewriter.NewTable(os.Stdout, + tablewriter.WithHeaderAutoFormat(tw.Off), // Keep header text as is for coloring + ) + tableDirectANSI.Header(Bold+FgGreen+"Name"+Reset, Bold+FgRed+"Status"+Reset) + tableDirectANSI.Append([]any{"Node1", FgGreen + "Ready" + Reset}) + tableDirectANSI.Append([]any{"Node2", FgRed + "Error" + Reset}) + tableDirectANSI.Render() + + fmt.Println("\n--- Table with Formatter for Colors ---") + + // Example 2: Using tw.Formatter + tableFormatter := tablewriter.NewTable(os.Stdout) + tableFormatter.Header("Name", "Status") // AutoFormat will apply to "NAME", "STATUS" + tableFormatter.Append([]any{"Alice", Status("Active")}) + tableFormatter.Append([]any{"Bob", Status("Inactive")}) + tableFormatter.Render() + + fmt.Println("\n--- Table with CellFilter for Colors ---") + // Example 3: Using CellFilter + tableWithFilters := tablewriter.NewTable(os.Stdout, + tablewriter.WithConfig( + tablewriter.NewConfigBuilder(). + Row(). + Filter(). + WithPerColumn([]func(string) string{ + nil, // No filter for Item column + func(s string) string { // Status column: apply color + if s == "Ready" || s == "Active" { + return FgGreen + s + Reset + } + return FgRed + s + Reset + }, + }). + Build(). // Return to RowConfigBuilder + Build(). // Return to ConfigBuilder + Build(), // Finalize Config + ), + ) + tableWithFilters.Header("Item", "Availability") + tableWithFilters.Append("ItemA", "Ready") + tableWithFilters.Append("ItemB", "Unavailable") + tableWithFilters.Render() +} +``` + +**Output (Text Approximation, Colors Not Shown):** +``` +┌──────┬────────┐ +│ Name │ Status │ +├──────┼────────┤ +│Node1 │ Ready │ +│Node2 │ Error │ +└──────┴────────┘ + +--- Table with Formatter for Colors --- +┌───────┬──────────┐ +│ NAME │ STATUS │ +├───────┼──────────┤ +│ Alice │ Active │ +│ Bob │ Inactive │ +└───────┴──────────┘ + +--- Table with CellFilter for Colors --- +┌───────┬────────────┐ +│ ITEM │ AVAILABILI │ +│ │ TY │ +├───────┼────────────┤ +│ ItemA │ Ready │ +│ ItemB │ Unavailabl │ +│ │ e │ +└───────┴────────────┘ +``` + +**Key Changes**: +- **Removed Color Methods**: `SetColumnColor`, `SetHeaderColor`, and `SetFooterColor` are removed; colors are now applied by embedding ANSI escape codes in cell content or via data-driven mechanisms (`tablewriter.go`). +- **Flexible Coloring Options**: + - **Direct ANSI Codes**: Embed codes (e.g., `\033[32m` for green) in strings for manual control (`zoo.go:convertCellsToStrings`). + - **tw.Formatter**: Implement `Format() string` on custom types to control cell output, including colors (`tw/types.go:Formatter`). + - **tw.CellFilter**: Use `Config.
.Filter.Global` or `PerColumn` to apply transformations like coloring dynamically (`tw/cell.go:CellFilter`). +- **Width Handling**: `tw.DisplayWidth()` correctly calculates display width of ANSI-coded strings, ignoring escape sequences (`tw/fn.go:DisplayWidth`). +- **No Built-In Color Presets**: Unlike v0.0.5’s potential `tablewriter.Colors`, v1.0.x requires manual ANSI code management or external libraries for color constants. + +**Migration Tips**: +- Replace `SetColumnColor` with direct ANSI code embedding for simple cases (e.g., `FgGreen+"text"+Reset`) (`zoo.go`). +- Implement `tw.Formatter` on custom types for reusable, semantic color logic (e.g., `Status` type above) (`tw/types.go`). +- Use `ConfigBuilder.
().Filter().WithPerColumn` to apply color filters to specific columns, mimicking v0.0.5’s per-column coloring (`config.go`). +- Define ANSI constants in your codebase or use a library (e.g., `github.com/fatih/color`) to simplify color management. +- Test colored output in your target terminal to ensure ANSI codes render correctly. +- Combine filters with `AutoFormat` or wrapping for consistent styling (`zoo.go:prepareContent`). + +**Potential Pitfalls**: +- **Terminal Support**: Some terminals may not support ANSI codes, causing artifacts; test in your environment or provide a non-colored fallback. +- **Filter Overlap**: Combining `tw.CellFilter` with `AutoFormat` or other transformations can lead to unexpected results; prioritize filters for coloring (`zoo.go`). +- **Width Miscalculation**: Incorrect ANSI code handling (e.g., missing `Reset`) can skew width calculations; use `tw.DisplayWidth` (`tw/fn.go`). +- **Streaming Consistency**: In streaming mode, ensure color codes are applied consistently across rows to avoid visual discrepancies (`stream.go`). +- **Performance**: Applying filters to large datasets may add overhead; optimize filter logic for efficiency (`zoo.go`). + +## Advanced Features in v1.0.x + +v1.0.x introduces several advanced features that enhance table functionality beyond v0.0.5’s capabilities. This section covers cell merging, captions, filters, stringers, and performance optimizations, providing migration guidance and examples for leveraging these features. + +### 5. Cell Merging +Cell merging combines adjacent cells with identical content, improving readability for grouped data. v1.0.x expands merging options beyond v0.0.5’s horizontal merging. + +**Old (v0.0.5):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "os" +) + +func main() { + table := tablewriter.NewWriter(os.Stdout) + // table.SetAutoMergeCells(true) // Enable horizontal merging + table.SetHeader([]string{"Category", "Item", "Notes"}) + table.Append([]string{"Fruit", "Apple", "Red"}) + table.Append([]string{"Fruit", "Apple", "Green"}) // "Apple" might merge if SetAutoMergeCells was on + table.Render() +} +``` + +**New (v1.0.x):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + // Horizontal Merging (Similar to v0.0.5) + tableH := tablewriter.NewTable(os.Stdout, + tablewriter.WithConfig(tablewriter.Config{Row: tw.CellConfig{Formatting: tw.CellFormatting{MergeMode: tw.MergeHorizontal}}}), + tablewriter.WithRenderer(renderer.NewBlueprint(tw.Rendition{Symbols: tw.NewSymbols(tw.StyleASCII)})), // Specify renderer for symbols + ) + tableH.Header("Category", "Item", "Item", "Notes") // Note: Two "Item" headers for demo + tableH.Append("Fruit", "Apple", "Apple", "Red") // "Apple" cells merge + tableH.Render() + + // Vertical Merging + tableV := tablewriter.NewTable(os.Stdout, + tablewriter.WithConfig(tablewriter.Config{Row: tw.CellConfig{Formatting: tw.CellFormatting{MergeMode: tw.MergeVertical}}}), + tablewriter.WithRenderer(renderer.NewBlueprint(tw.Rendition{Symbols: tw.NewSymbols(tw.StyleASCII)})), + ) + tableV.Header("User", "Permission") + tableV.Append("Alice", "Read") + tableV.Append("Alice", "Write") // "Alice" cells merge vertically + tableV.Append("Bob", "Read") + tableV.Render() + + // Hierarchical Merging + tableHier := tablewriter.NewTable(os.Stdout, + tablewriter.WithConfig(tablewriter.Config{Row: tw.CellConfig{Formatting: tw.CellFormatting{MergeMode: tw.MergeHierarchical}}}), + tablewriter.WithRenderer(renderer.NewBlueprint(tw.Rendition{Symbols: tw.NewSymbols(tw.StyleASCII)})), + ) + tableHier.Header("Group", "SubGroup", "Item") + tableHier.Append("Tech", "CPU", "i7") + tableHier.Append("Tech", "CPU", "i9") // "Tech" and "CPU" merge + tableHier.Append("Tech", "RAM", "16GB") // "Tech" merges, "RAM" is new + tableHier.Append("Office", "CPU", "i5") // "Office" is new + tableHier.Render() +} +``` + +**Output (Horizontal):** +``` ++----------+-------+-------+-------+ +| CATEGORY | ITEM | ITEM | NOTES | ++----------+-------+-------+-------+ +| Fruit | Apple | Red | ++----------+---------------+-------+ +``` + +**Output (Vertical):** +``` ++-------+------------+ +| USER | PERMISSION | ++-------+------------+ +| Alice | Read | +| | Write | ++-------+------------+ +| Bob | Read | ++-------+------------+ +``` + +**Output (Hierarchical):** +``` ++---------+----------+------+ +| GROUP | SUBGROUP | ITEM | ++---------+----------+------+ +| Tech | CPU | i7 | +| | | i9 | +| +----------+------+ +| | RAM | 16GB | ++---------+----------+------+ +| Office | CPU | i5 | ++---------+----------+------+ +``` + +**Key Changes**: +- **Method**: `SetAutoMergeCells` is replaced by `WithRowMergeMode(int_merge_mode)` or `Config.Row.Formatting.MergeMode` (`config.go`). Uses `tw.Merge...` constants. +- **Merge Modes**: `tw.MergeMode` constants (`tw.MergeNone`, `tw.MergeHorizontal`, `tw.MergeVertical`, `tw.MergeHierarchical`) define behavior (`tw/tw.go`). +- **Section-Specific**: Merging can be applied to `Header`, `Row`, or `Footer` via `Config.
.Formatting.MergeMode` (`tw/cell.go`). +- **Processing**: Merging is handled during content preparation (`zoo.go:prepareWithMerges`, `zoo.go:applyVerticalMerges`, `zoo.go:applyHierarchicalMerges`). +- **Width Adjustment**: Horizontal merging adjusts column widths (`zoo.go:applyHorizontalMergeWidths`). +- **Renderer Support**: `tw.MergeState` in `tw.CellContext` ensures correct border drawing for merged cells (`tw/cell.go:CellContext`). +- **Streaming Limitation**: Streaming mode supports only simple horizontal merging due to fixed widths (`stream.go:streamAppendRow`). + +**Migration Tips**: +- Replace `SetAutoMergeCells(true)` with `WithRowMergeMode(tw.MergeHorizontal)` to maintain v0.0.5’s horizontal merging behavior (`config.go`). +- Use `tw.MergeVertical` for vertical grouping (e.g., repeated user names) or `tw.MergeHierarchical` for nested data structures (`tw/tw.go`). +- Apply merging to specific sections via `ConfigBuilder.
().Formatting().WithMergeMode(int_merge_mode)` (`config.go`). +- Test merging with sample data to verify visual output, especially for hierarchical merging with complex datasets. +- In streaming mode, ensure `Config.Widths` supports merged cell widths to avoid truncation (`stream.go`). +- Use `WithDebug(true)` to log merge processing for troubleshooting (`config.go`). + +**Potential Pitfalls**: +- **Streaming Restrictions**: Vertical and hierarchical merging are unsupported in streaming mode; use batch mode for these features (`stream.go`). +- **Width Misalignment**: Merged cells may require wider columns; adjust `Config.Widths` or `ColMaxWidths` (`zoo.go`). +- **Data Dependency**: Merging requires identical content; case or whitespace differences prevent merging (`zoo.go`). +- **Renderer Errors**: Incorrect `tw.MergeState` handling in custom renderers can break merged cell borders; test thoroughly (`tw/cell.go`). +- **Performance**: Hierarchical merging with large datasets may slow rendering; optimize data or limit merging (`zoo.go`). + +### 6. Table Captions +Captions add descriptive text above or below the table, a new feature in v1.0.x not present in v0.0.5. + +**Old (v0.0.5):** +```go +package main +// No direct caption support in v0.0.5. Users might have printed text manually. +// import "github.com/olekukonko/tablewriter" +// import "os" +// import "fmt" + +func main() { + // fmt.Println("Movie ratings.") // Manual caption + // table := tablewriter.NewWriter(os.Stdout) + // table.SetHeader([]string{"Name", "Sign", "Rating"}) + // table.Render() +} +``` + +**New (v1.0.x):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + table := tablewriter.NewTable(os.Stdout) + table.Caption(tw.Caption{ // tw/types.go:Caption + Text: "System Status Overview - A Very Long Caption Example To Demonstrate Wrapping Behavior", + Spot: tw.SpotTopCenter, // Placement: TopLeft, TopCenter, TopRight, BottomLeft, BottomCenter, BottomRight + Align: tw.AlignCenter, // Text alignment within caption width + Width: 30, // Fixed width for caption text wrapping; if 0, wraps to table width + }) + table.Header("Name", "Status") + table.Append("Node1", "Ready") + table.Append("SuperLongNodeNameHere", "ActiveNow") + table.Render() +} +``` + +**Output:** +``` + System Status Overview - A Very +Long Caption Example To Demonst… +┌─────────────────────┬──────────┐ +│ NAME │ STATUS │ +├─────────────────────┼──────────┤ +│ Node1 │ Ready │ +│ SuperLongNodeNameHe │ ActiveNo │ +│ re │ w │ +└─────────────────────┴──────────┘ +``` + +**Key Changes**: +- **New Feature**: `Table.Caption(tw.Caption)` introduces captions, absent in v0.0.5 (`tablewriter.go:Caption`). +- **Configuration**: `tw.Caption` (`tw/types.go:Caption`) includes: + - `Text`: Caption content. + - `Spot`: Placement (`tw.SpotTopLeft`, `tw.SpotBottomCenter`, etc.); defaults to `tw.SpotBottomCenter` if `tw.SpotNone`. + - `Align`: Text alignment (`tw.AlignLeft`, `tw.AlignCenter`, `tw.AlignRight`). + - `Width`: Optional fixed width for wrapping; defaults to table width. +- **Rendering**: Captions are rendered by `printTopBottomCaption` before or after the table based on `Spot` (`tablewriter.go:printTopBottomCaption`). +- **Streaming**: Captions are rendered during `Close()` in streaming mode if placed at the bottom (`stream.go`). + +**Migration Tips**: +- Add captions to enhance table context, especially for reports or documentation (`tw/types.go`). +- Use `tw.SpotTopCenter` for prominent placement above the table, aligning with common report formats. +- Set `Align` to match table aesthetics (e.g., `tw.AlignCenter` for balanced appearance). +- Specify `Width` for consistent wrapping, especially with long captions or narrow tables (`tablewriter.go`). +- Test caption placement and alignment with different table sizes to ensure readability. + +**Potential Pitfalls**: +- **Spot Default**: If `Spot` is `tw.SpotNone`, caption defaults to `tw.SpotBottomCenter`, which may surprise users expecting no caption (`tablewriter.go`). +- **Width Overflow**: Without `Width`, captions wrap to table width, potentially causing misalignment; set explicitly for control (`tw/types.go`). +- **Streaming Delay**: Bottom-placed captions in streaming mode appear only at `Close()`; ensure `Close()` is called (`stream.go`). +- **Alignment Confusion**: Caption `Align` is independent of table cell alignment; verify separately (`tw/cell.go`). + +### 7. Filters +Filters allow dynamic transformation of cell content during rendering, a new feature in v1.0.x for tasks like formatting, coloring, or sanitizing data. + +**Old (v0.0.5):** +```go +package main +// No direct support for cell content transformation in v0.0.5. +// Users would typically preprocess data before appending. +// import "github.com/olekukonko/tablewriter" +// import "os" +// import "strings" + +func main() { + // table := tablewriter.NewWriter(os.Stdout) + // table.SetHeader([]string{"Name", "Status"}) + // status := " Ready " + // preprocessedStatus := "Status: " + strings.TrimSpace(status) + // table.Append([]string{"Node1", preprocessedStatus}) + // table.Render() +} +``` + +**New (v1.0.x):** +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" // For tw.CellConfig etc. + "os" + "strings" +) + +func main() { + // Per-Column Filter for Specific Transformations + cfgBuilder := tablewriter.NewConfigBuilder() + cfgBuilder.Row().Filter().WithPerColumn([]func(string) string{ + nil, // No filter for Name column + func(s string) string { // Status column: prefix and trim + return "Status: " + strings.TrimSpace(s) + }, + }) + + tableWithFilter := tablewriter.NewTable(os.Stdout, tablewriter.WithConfig(cfgBuilder.Build())) + tableWithFilter.Header("Name", "Status") + tableWithFilter.Append("Node1", " Ready ") // Note the extra spaces + tableWithFilter.Append("Node2", "Pending") + tableWithFilter.Render() + + // Global filter example (applied to all cells in the Row section) + cfgGlobalFilter := tablewriter.NewConfigBuilder() + cfgGlobalFilter.Row().Filter().WithGlobal(func(s string) string { + return "[" + s + "]" // Wrap all row cells in brackets + }) + tableGlobalFilter := tablewriter.NewTable(os.Stdout, tablewriter.WithConfig(cfgGlobalFilter.Build())) + tableGlobalFilter.Header("Item", "Count") + tableGlobalFilter.Append("Apple", "5") + tableGlobalFilter.Render() +} +``` + +**Output (Per-Column Filter):** +``` +┌───────┬─────────────────┐ +│ NAME │ STATUS │ +├───────┼─────────────────┤ +│ Node1 │ Status: Ready │ +│ Node2 │ Status: Pending │ +└───────┴─────────────────┘ +``` + +**Output (Global Filter):** +``` +┌───────┬─────────┐ +│ ITEM │ COUNT │ +├───────┼─────────┤ +│[Apple]│ [5] │ +└───────┴─────────┘ +``` + +**Key Changes**: +- **New Feature**: `tw.CellFilter` (`tw/cell.go:CellFilter`) introduces: + - `Global`: A `func(s []string) []string` applied to entire rows (all cells in that row) of a section. + - `PerColumn`: A slice of `func(string) string` for column-specific transformations on individual cells. +- **Configuration**: Set via `Config.
.Filter` (`Header`, `Row`, `Footer`) using `ConfigBuilder` or direct `Config` (`config.go`). +- **Processing**: Filters are applied during content preparation, after `AutoFormat` but before rendering (`zoo.go:convertCellsToStrings` calls `prepareContent` which applies some transformations, filters are applied in `convertCellsToStrings` itself). +- **Use Cases**: Formatting (e.g., uppercase, prefixes), coloring (via ANSI codes), sanitization (e.g., removing sensitive data), or data normalization. + +**Migration Tips**: +- Use filters to replace manual content preprocessing in v0.0.5 (e.g., string manipulation before `Append`). +- Apply `Global` filters for uniform transformations across all cells of rows in a section (e.g., uppercasing all row data) (`tw/cell.go`). +- Use `PerColumn` filters for column-specific formatting (e.g., adding prefixes to status columns) (`config.go`). +- Combine filters with `tw.Formatter` for complex types or ANSI coloring for visual enhancements (`tw/cell.go`). +- Test filters with diverse inputs to ensure transformations preserve data integrity (`zoo.go`). + +**Potential Pitfalls**: +- **Filter Order**: Filters apply before some other transformations like padding and alignment; combining can lead to interactions. +- **Performance**: Complex filters on large datasets may slow rendering; optimize logic (`zoo.go`). +- **Nil Filters**: Unset filters (`nil`) are ignored, but incorrect indexing in `PerColumn` can skip columns (`tw/cell.go`). +- **Streaming Consistency**: Filters must be consistent in streaming mode, as widths are fixed at `Start()` (`stream.go`). + +### 8. Stringers and Caching +Stringers allow custom string conversion for data types, with v1.0.x adding caching for performance. + +**Old (v0.0.5):** +```go +package main +// v0.0.5 primarily relied on fmt.Stringer for custom types. +// import "fmt" +// import "github.com/olekukonko/tablewriter" +// import "os" + +// type MyCustomType struct { +// Value string +// } +// func (m MyCustomType) String() string { return "Formatted: " + m.Value } + +func main() { + // table := tablewriter.NewWriter(os.Stdout) + // table.SetHeader([]string{"Custom Data"}) + // table.Append([]string{MyCustomType{"test"}.String()}) // Manual call to String() + // table.Render() +} +``` + +**New (v1.0.x):** +```go +package main + +import ( + "fmt" + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" // For tw.Formatter + "os" + "strings" // For Person example +) + +// Example 1: Using WithStringer for general conversion +type CustomInt int + +func main() { + // Table with a general stringer (func(any) []string) + tableWithStringer := tablewriter.NewTable(os.Stdout, + tablewriter.WithStringer(func(v any) []string { // Must return []string + if ci, ok := v.(CustomInt); ok { + return []string{fmt.Sprintf("CustomInt Value: %d!", ci)} + } + return []string{fmt.Sprintf("Value: %v", v)} // Fallback + }), + tablewriter.WithDebug(true), // Enable caching if WithStringerCache() is also used + // tablewriter.WithStringerCache(), // Optional: enable caching + ) + tableWithStringer.Header("Data") + tableWithStringer.Append(123) + tableWithStringer.Append(CustomInt(456)) + tableWithStringer.Render() + + fmt.Println("\n--- Table with Type-Specific Stringer for Structs ---") + + // Example 2: Stringer for a specific struct type + type Person struct { + ID int + Name string + City string + } + + // Stringer for Person to produce 3 cells + personToStrings := func(p Person) []string { + return []string{ + fmt.Sprintf("ID: %d", p.ID), + p.Name, + strings.ToUpper(p.City), + } + } + + tablePersonStringer := tablewriter.NewTable(os.Stdout, + tablewriter.WithStringer(personToStrings), // Pass the type-specific function + ) + tablePersonStringer.Header("User ID", "Full Name", "Location") + tablePersonStringer.Append(Person{1, "Alice", "New York"}) + tablePersonStringer.Append(Person{2, "Bob", "London"}) + tablePersonStringer.Render() + + fmt.Println("\n--- Table with tw.Formatter ---") + // Example 3: Using tw.Formatter for types + type Product struct { + Name string + Price float64 + } + func (p Product) Format() string { // Implements tw.Formatter + return fmt.Sprintf("%s - $%.2f", p.Name, p.Price) + } + tableFormatter := tablewriter.NewTable(os.Stdout) + tableFormatter.Header("Product Details") + tableFormatter.Append(Product{"Laptop", 1200.99}) // Will use Format() + tableFormatter.Render() +} +``` + +**Output (Stringer Examples):** +``` +┌─────────────────────┐ +│ DATA │ +├─────────────────────┤ +│ Value: 123 │ +│ CustomInt Value: 456! │ +└─────────────────────┘ + +--- Table with Type-Specific Stringer for Structs --- +┌─────────┬───────────┬──────────┐ +│ USER ID │ FULL NAME │ LOCATION │ +├─────────┼───────────┼──────────┤ +│ ID: 1 │ Alice │ NEW YORK │ +│ ID: 2 │ Bob │ LONDON │ +└─────────┴───────────┴──────────┘ + +--- Table with tw.Formatter --- +┌─────────────────┐ +│ PRODUCT DETAILS │ +├─────────────────┤ +│ Laptop - $1200… │ +└─────────────────┘ +``` + +**Key Changes**: +- **Stringer Support**: `WithStringer(fn any)` sets a table-wide string conversion function. This function must have a signature like `func(SomeType) []string` or `func(any) []string`. It's used to convert an input item (e.g., a struct) into a slice of strings, where each string is a cell for the row (`tablewriter.go:WithStringer`). +- **Caching**: `WithStringerCache()` enables caching for the function provided via `WithStringer`, improving performance for repeated conversions of the same input type (`tablewriter.go:WithStringerCache`). +- **Formatter**: `tw.Formatter` interface (`Format() string`) allows types to define their own single-string representation for a cell. This is checked before `fmt.Stringer` (`tw/types.go:Formatter`). +- **Priority**: When converting an item to cell(s): + 1. `WithStringer` (if provided and compatible with the item's type). + 2. If not handled by `WithStringer`, or if `WithStringer` is not set: + * If the item is a struct that does *not* implement `tw.Formatter` or `fmt.Stringer`, its exported fields are reflected into multiple cells. + * If the item (or struct) implements `tw.Formatter` (`Format() string`), that's used for a single cell. + * Else, if it implements `fmt.Stringer` (`String() string`), that's used for a single cell. + * Else, default `fmt.Sprintf("%v", ...)` for a single cell. + (`zoo.go:convertCellsToStrings`, `zoo.go:convertItemToCells`) + +**Migration Tips**: +- For types that should produce a single cell with custom formatting, implement `tw.Formatter`. +- For types (especially structs) that should be expanded into multiple cells with custom logic, use `WithStringer` with a function like `func(MyType) []string`. +- If you have a general way to convert *any* type into a set of cells, use `WithStringer(func(any) []string)`. +- Enable `WithStringerCache` for large datasets with repetitive data types if using `WithStringer`. +- Test stringer/formatter output to ensure formatting meets expectations (`zoo.go`). + +**Potential Pitfalls**: +- **Cache Overhead**: `WithStringerCache` may increase memory usage for diverse data; disable for small tables or if not using `WithStringer` (`tablewriter.go`). +- **Stringer Signature**: The function passed to `WithStringer` *must* return `[]string`. A function returning `string` will lead to a warning and fallback behavior. +- **Formatter vs. Stringer Priority**: Be aware of the conversion priority if your types implement multiple interfaces or if you also use `WithStringer`. +- **Streaming**: Stringers/Formatters must produce consistent cell counts in streaming mode to maintain width alignment (`stream.go`). + +## Examples + +This section provides practical examples to demonstrate v1.0.x features, covering common and advanced use cases to aid migration. Each example includes code, output, and notes to illustrate functionality. + +### Example: Minimal Setup +A basic table with default settings, ideal for quick setups. + +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "os" +) + +func main() { + table := tablewriter.NewTable(os.Stdout) + table.Header("Name", "Status") + table.Append("Node1", "Ready") + table.Render() +} +``` + +**Output**: +``` +┌───────┬────────┐ +│ NAME │ STATUS │ +├───────┼────────┤ +│ Node1 │ Ready │ +└───────┴────────┘ +``` + +**Notes**: +- Uses default `renderer.NewBlueprint()` and `defaultConfig()` settings (`tablewriter.go`, `config.go`). +- `Header: tw.AlignCenter`, `Row: tw.AlignLeft` (`config.go:defaultConfig`). +- Simple replacement for v0.0.5’s `NewWriter` and `SetHeader`/`Append`. + +### Example: Streaming with Fixed Widths +Demonstrates streaming mode for real-time data output. + +```go +package main + +import ( + "fmt" + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" + "log" + "os" +) + +func main() { + table := tablewriter.NewTable(os.Stdout, + tablewriter.WithStreaming(tw.StreamConfig{Enable: true}), + tablewriter.WithColumnMax(10), // Sets Config.Widths.Global + ) + if err := table.Start(); err != nil { + log.Fatalf("Start failed: %v", err) + } + table.Header("Name", "Status") + for i := 0; i < 2; i++ { + err := table.Append(fmt.Sprintf("Node%d", i+1), "Ready") + if err != nil { + log.Printf("Append failed: %v", err) + } + } + if err := table.Close(); err != nil { + log.Fatalf("Close failed: %v", err) + } +} +``` + +**Output**: +``` +┌──────────┬──────────┐ +│ NAME │ STATUS │ +├──────────┼──────────┤ +│ Node1 │ Ready │ +│ Node2 │ Ready │ +└──────────┴──────────┘ +``` + +**Notes**: +- Streaming requires `Start()` and `Close()`; `Config.Widths` (here set via `WithColumnMax`) fixes widths (`stream.go`). +- Replaces v0.0.5’s batch rendering for real-time use cases. +- Ensure error handling for `Start()`, `Append()`, and `Close()`. + +### Example: Markdown-Style Table +Creates a Markdown-compatible table for documentation. + +```go +package main + +import ( + "fmt" + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" // Import renderer + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + // Example 1: Using Blueprint renderer with Markdown symbols + tableBlueprintMarkdown := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewBlueprint()), // Use Blueprint + tablewriter.WithRendition(tw.Rendition{ + Symbols: tw.NewSymbols(tw.StyleMarkdown), + Borders: tw.Border{Left: tw.On, Right: tw.On}, // Markdown needs left/right borders + }), + tablewriter.WithRowAlignment(tw.AlignLeft), // Common for Markdown + tablewriter.WithHeaderAlignment(tw.AlignCenter), // Center align headers + ) + tableBlueprintMarkdown.Header("Name", "Status") + tableBlueprintMarkdown.Append("Node1", "Ready") + tableBlueprintMarkdown.Append("Node2", "NotReady") + tableBlueprintMarkdown.Render() + + fmt.Println("\n--- Using dedicated Markdown Renderer (if one exists or is built) ---") + // Example 2: Assuming a dedicated Markdown renderer (hypothetical example) + // If a `renderer.NewMarkdown()` existed that directly outputs GitHub Flavored Markdown table syntax: + /* + tableDedicatedMarkdown := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewMarkdown()), // Hypothetical Markdown renderer + ) + tableDedicatedMarkdown.Header("Name", "Status") + tableDedicatedMarkdown.Append("Node1", "Ready") + tableDedicatedMarkdown.Append("Node2", "NotReady") + tableDedicatedMarkdown.Render() + */ + // Since `renderer.NewMarkdown()` isn't shown in the provided code, + // the first example (Blueprint with StyleMarkdown) is the current viable way. +} +``` + +**Output (Blueprint with StyleMarkdown):** +``` +| NAME | STATUS | +|--------|----------| +| Node1 | Ready | +| Node2 | NotReady | +``` + +**Notes**: +- `StyleMarkdown` ensures compatibility with Markdown parsers (`tw/symbols.go`). +- Left alignment for rows and center for headers is common for Markdown readability (`config.go`). +- Ideal for GitHub READMEs or documentation. +- A dedicated Markdown renderer (like the commented-out example) would typically handle alignment syntax (e.g., `|:---:|:---|`). With `Blueprint` and `StyleMarkdown`, alignment is visual within the text rather than Markdown syntax. + +### Example: ASCII-Style Table +Uses `StyleASCII` for maximum terminal compatibility. + +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + table := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewBlueprint()), + tablewriter.WithRendition(tw.Rendition{ + Symbols: tw.NewSymbols(tw.StyleASCII), + }), + tablewriter.WithRowAlignment(tw.AlignLeft), + ) + table.Header("ID", "Value") + table.Append("1", "Test") + table.Render() +} +``` + +**Output**: +``` ++----+-------+ +│ ID │ VALUE │ ++----+-------+ +│ 1 │ Test │ ++----+-------+ +``` + +**Notes**: +- `StyleASCII` is robust for all terminals (`tw/symbols.go`). +- Replaces v0.0.5’s default style with explicit configuration. + + +### Example: Kubectl-Style Output +Creates a borderless, minimal table similar to `kubectl` command output, emphasizing simplicity and readability. + +```go +package main + +import ( + "os" + "sync" + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" + "github.com/olekukonko/tablewriter/tw" +) + +var wg sync.WaitGroup + +func main() { + data := [][]any{ + {"node1.example.com", "Ready", "compute", "1.11"}, + {"node2.example.com", "Ready", "compute", "1.11"}, + {"node3.example.com", "Ready", "compute", "1.11"}, + {"node4.example.com", "NotReady", "compute", "1.11"}, + } + + table := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewBlueprint(tw.Rendition{ + Borders: tw.BorderNone, + Settings: tw.Settings{ + Separators: tw.SeparatorsNone, + Lines: tw.LinesNone, + }, + })), + tablewriter.WithConfig(tablewriter.Config{ + Header: tw.CellConfig{ + Formatting: tw.CellFormatting{Alignment: tw.AlignLeft}, + }, + Row: tw.CellConfig{ + Formatting: tw.CellFormatting{Alignment: tw.AlignLeft}, + Padding: tw.CellPadding{Global: tw.PaddingNone}, + }, + }), + ) + table.Header("Name", "Status", "Role", "Version") + table.Bulk(data) + table.Render() +} +``` + +**Output:** +``` +NAME STATUS ROLE VERSION +node1.example.com Ready compute 1.21.3 +node2.example.com Ready infra 1.21.3 +node3.example.com NotReady compute 1.20.7 +``` + +**Notes**: +- **Configuration**: Uses `tw.BorderNone`, `tw.LinesNone`, `tw.SeparatorsNone`, `tw.NewSymbols(tw.StyleNone)` and specific padding (`Padding{Right:" "}`) for a minimal, borderless layout. +- **Migration from v0.0.5**: Replaces `SetBorder(false)` and manual spacing with `tw.Rendition` and `Config` settings, achieving a cleaner kubectl-like output. +- **Key Features**: + - Left-aligned text for readability (`config.go`). + - `WithTrimSpace(tw.Off)` preserves spacing (`config.go`). + - `Bulk` efficiently adds multiple rows (`tablewriter.go`). + - Padding `Right: " "` is used to create space between columns as separators are off. +- **Best Practices**: Test in terminals to ensure spacing aligns with command-line aesthetics; use `WithDebug(true)` for layout issues (`config.go`). +- **Potential Issues**: Column widths are content-based. For very long content in one column and short in others, it might not look perfectly aligned like fixed-width CLI tools. `Config.Widths` could be used for more control if needed. + +### Example: Hierarchical Merging +Demonstrates hierarchical cell merging for nested data structures, a new feature in v1.0.x. + +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + data := [][]string{ + // Header row is separate + {"table\nwriter", "v0.0.1", "legacy"}, + {"table\nwriter", "v0.0.2", "legacy"}, + {"table\nwriter", "v0.0.2", "legacy"}, // Duplicate for testing merge + {"table\nwriter", "v0.0.2", "legacy"}, // Duplicate for testing merge + {"table\nwriter", "v0.0.5", "legacy"}, + {"table\nwriter", "v1.0.6", "latest"}, + } + + rendition := tw.Rendition{ + Symbols: tw.NewSymbols(tw.StyleLight), // Use light for clearer merge lines + Settings: tw.Settings{ + Separators: tw.Separators{BetweenRows: tw.On}, + Lines: tw.Lines{ShowHeaderLine: tw.On, ShowFooterLine: tw.On}, // Show header line + }, + Borders: tw.Border{Left:tw.On, Right:tw.On, Top:tw.On, Bottom:tw.On}, + } + + tableHier := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewBlueprint()), + tablewriter.WithRendition(rendition), + tablewriter.WithConfig(tablewriter.Config{ + Row: tw.CellConfig{ + Formatting: tw.CellFormatting{ + MergeMode: tw.MergeHierarchical, + // Alignment: tw.AlignCenter, // Default is Left, often better for hierarchical + AutoWrap: tw.WrapNormal, // Allow wrapping for "table\nwriter" + }, + }, + }), + ) + + tableHier.Header("Package", "Version", "Status") // Header + tableHier.Bulk(data) // Bulk data + tableHier.Render() + + // --- Vertical Merging Example for Contrast --- + tableVert := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewBlueprint()), + tablewriter.WithRendition(rendition), // Reuse same rendition + tablewriter.WithConfig(tablewriter.Config{ + Row: tw.CellConfig{ + Formatting: tw.CellFormatting{ + MergeMode: tw.MergeVertical, + AutoWrap: tw.WrapNormal, + }, + }, + }), + ) + tableVert.Header("Package", "Version", "Status") + tableVert.Bulk(data) + tableVert.Render() +} +``` + +**Output (Hierarchical):** +``` +┌─────────┬─────────┬────────┐ +│ PACKAGE │ VERSION │ STATUS │ +├─────────┼─────────┼────────┤ +│ table │ v0.0.1 │ legacy │ +│ writer │ │ │ +│ ├─────────┼────────┤ +│ │ v0.0.2 │ legacy │ +│ │ │ │ +│ │ │ │ +│ │ │ │ +│ │ │ │ +│ ├─────────┼────────┤ +│ │ v0.0.5 │ legacy │ +│ ├─────────┼────────┤ +│ │ v1.0.6 │ latest │ +└─────────┴─────────┴────────┘ +``` +**Output (Vertical):** +``` +┌─────────┬─────────┬────────┐ +│ PACKAGE │ VERSION │ STATUS │ +├─────────┼─────────┼────────┤ +│ table │ v0.0.1 │ legacy │ +│ writer │ │ │ +│ ├─────────┤ │ +│ │ v0.0.2 │ │ +│ │ │ │ +│ │ │ │ +│ │ │ │ +│ │ │ │ +│ ├─────────┤ │ +│ │ v0.0.5 │ │ +│ ├─────────┼────────┤ +│ │ v1.0.6 │ latest │ +└─────────┴─────────┴────────┘ +``` + +**Notes**: +- **Configuration**: Uses `tw.MergeHierarchical` to merge cells based on matching values in preceding columns (`tw/tw.go`). +- **Migration from v0.0.5**: Extends `SetAutoMergeCells(true)` (horizontal only) with hierarchical merging for complex data (`tablewriter.go`). +- **Key Features**: + - `StyleLight` for clear visuals (`tw/symbols.go`). + - `Bulk` for efficient data loading (`tablewriter.go`). +- **Best Practices**: Test merging with nested data; use batch mode, as streaming doesn’t support hierarchical merging (`stream.go`). +- **Potential Issues**: Ensure data is sorted appropriately for hierarchical merging to work as expected; mismatches prevent merging (`zoo.go`). `AutoWrap: tw.WrapNormal` helps with multi-line cell content like "table\nwriter". + +### Example: Colorized Table +Applies ANSI colors to highlight status values, replacing v0.0.5’s `SetColumnColor`. + +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" // For tw.State, tw.CellConfig etc. + "os" +) + +func main() { + const ( + FgGreen = "\033[32m" + FgRed = "\033[31m" + Reset = "\033[0m" + ) + + cfgBuilder := tablewriter.NewConfigBuilder() + cfgBuilder.Row().Filter().WithPerColumn([]func(string) string{ + nil, // No filter for Name + func(s string) string { // Color Status + if s == "Ready" { + return FgGreen + s + Reset + } + return FgRed + s + Reset + }, + }) + + table := tablewriter.NewTable(os.Stdout, tablewriter.WithConfig(cfgBuilder.Build())) + table.Header("Name", "Status") + table.Append("Node1", "Ready") + table.Append("Node2", "Error") + table.Render() +} +``` + +**Output (Text Approximation, Colors Not Shown):** +``` +┌───────┬────────┐ +│ NAME │ STATUS │ +├───────┼────────┤ +│ Node1 │ Ready │ +│ Node2 │ Error │ +└───────┴────────┘ +``` + +**Notes**: +- **Configuration**: Uses `tw.CellFilter` for per-column coloring, embedding ANSI codes (`tw/cell.go`). +- **Migration from v0.0.5**: Replaces `SetColumnColor` with dynamic filters (`tablewriter.go`). +- **Key Features**: Flexible color application; `tw.DisplayWidth` handles ANSI codes correctly (`tw/fn.go`). +- **Best Practices**: Test in ANSI-compatible terminals; use constants for code clarity. +- **Potential Issues**: Non-ANSI terminals may show artifacts; provide fallbacks (`tw/fn.go`). + +### Example: Vertical Merging +Shows vertical cell merging for repeated values in a column. (This example was very similar to the hierarchical one, so I'll ensure it's distinct by using simpler data). + +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + table := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewBlueprint()), // Default renderer + tablewriter.WithRendition(tw.Rendition{ + Symbols: tw.NewSymbols(tw.StyleLight), + Settings: tw.Settings{Separators: tw.Separators{BetweenRows: tw.On}}, + Borders: tw.Border{Left:tw.On, Right:tw.On, Top:tw.On, Bottom:tw.On}, + }), + tablewriter.WithConfig( + tablewriter.NewConfigBuilder(). + Row().Formatting().WithMergeMode(tw.MergeVertical).Build(). // Enable Vertical Merge + Build(), + ), + ) + table.Header("User", "Permission", "Target") + table.Append("Alice", "Read", "FileA") + table.Append("Alice", "Write", "FileA") // Alice and FileA will merge vertically + table.Append("Alice", "Read", "FileB") + table.Append("Bob", "Read", "FileA") + table.Append("Bob", "Read", "FileC") // Bob and Read will merge + table.Render() +} +``` + +**Output:** +``` +┌───────┬────────────┬────────┐ +│ USER │ PERMISSION │ TARGET │ +├───────┼────────────┼────────┤ +│ Alice │ Read │ FileA │ +│ │ │ │ +│ ├────────────┤ │ +│ │ Write │ │ +│ ├────────────┼────────┤ +│ │ Read │ FileB │ +├───────┼────────────┼────────┤ +│ Bob │ Read │ FileA │ +│ │ ├────────┤ +│ │ │ FileC │ +└───────┴────────────┴────────┘ +``` + +**Notes**: +- **Configuration**: `tw.MergeVertical` merges identical cells vertically (`tw/tw.go`). +- **Migration from v0.0.5**: Extends `SetAutoMergeCells` with vertical merging (`tablewriter.go`). +- **Key Features**: Enhances grouped data display; requires batch mode (`stream.go`). +- **Best Practices**: Sort data by the columns you intend to merge for best results; test with `StyleLight` for clarity (`tw/symbols.go`). +- **Potential Issues**: Streaming doesn’t support vertical merging; use batch mode (`stream.go`). + +### Example: Custom Renderer (CSV Output) +Implements a custom renderer for CSV output. + +```go +package main + +import ( + "fmt" + "github.com/olekukonko/ll" // For logger type + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" + "io" + "os" + "strings" // For CSV escaping +) + +// CSVRenderer implements tw.Renderer +type CSVRenderer struct { + writer io.Writer + config tw.Rendition // Store the rendition + logger *ll.Logger + err error +} + +func (r *CSVRenderer) Start(w io.Writer) error { + r.writer = w + return nil // No initial output for CSV typically +} + +func (r *CSVRenderer) escapeCSVCell(data string) string { + // Basic CSV escaping: double quotes if it contains comma, newline, or quote + if strings.ContainsAny(data, ",\"\n") { + return `"` + strings.ReplaceAll(data, `"`, `""`) + `"` + } + return data +} + +func (r *CSVRenderer) writeLine(cells map[int]tw.CellContext, numCols int) { + if r.err != nil { return } + var lineParts []string + // Need to iterate in column order for CSV + keys := make([]int, 0, len(cells)) + for k := range cells { + keys = append(keys, k) + } + // This simple sort works for int keys 0,1,2... + // For more complex scenarios, a proper sort might be needed if keys aren't sequential. + for i := 0; i < numCols; i++ { // Assume numCols reflects the intended max columns + if cellCtx, ok := cells[i]; ok { + lineParts = append(lineParts, r.escapeCSVCell(cellCtx.Data)) + } else { + lineParts = append(lineParts, "") // Empty cell if not present + } + } + _, r.err = r.writer.Write([]byte(strings.Join(lineParts, ",") + "\n")) +} + + +func (r *CSVRenderer) Header(headers [][]string, ctx tw.Formatting) { + // For CSV, usually only the first line of headers is relevant + // The ctx.Row.Current will contain the cells for the first line of the header being processed + r.writeLine(ctx.Row.Current, len(ctx.Row.Current)) +} + +func (r *CSVRenderer) Row(row []string, ctx tw.Formatting) { + // ctx.Row.Current contains the cells for the current row line + r.writeLine(ctx.Row.Current, len(ctx.Row.Current)) +} + +func (r *CSVRenderer) Footer(footers [][]string, ctx tw.Formatting) { + // Similar to Header/Row, using ctx.Row.Current for the footer line data + r.writeLine(ctx.Row.Current, len(ctx.Row.Current)) +} + +func (r *CSVRenderer) Line(ctx tw.Formatting) { /* No separator lines in CSV */ } + +func (r *CSVRenderer) Close() error { return r.err } + +func (r *CSVRenderer) Config() tw.Rendition { return r.config } +func (r *CSVRenderer) Logger(logger *ll.Logger) { r.logger = logger } + +func main() { + table := tablewriter.NewTable(os.Stdout, tablewriter.WithRenderer(&CSVRenderer{ + // config can be minimal for CSV as symbols/borders aren't used + config: tw.Rendition{}, + })) + table.Header("Name", "Status", "Notes, with comma") + table.Append("Node1", "Ready", "All systems \"go\"!") + table.Append("Node2", "Error", "Needs\nattention") + table.Footer("Summary", "2 Nodes", "Check logs") + table.Render() +} +``` + +**Output:** +```csv +Name,Status,"Notes, with comma" +Node1,Ready,"All systems ""go""!" +Node2,Error,"Needs +attention" +Summary,2 Nodes,Check logs +``` + +**Notes**: +- **Configuration**: Custom `CSVRenderer` implements `tw.Renderer` for CSV output (`tw/renderer.go`). +- **Migration from v0.0.5**: Extends v0.0.5’s text-only output with custom formats (`tablewriter.go`). +- **Key Features**: Handles basic CSV cell escaping; supports streaming if `Append` is called multiple times. `ctx.Row.Current` (map[int]tw.CellContext) is used to access cell data. +- **Best Practices**: Test with complex data (e.g., commas, quotes, newlines); implement all renderer methods. A more robust CSV renderer would use the `encoding/csv` package. +- **Potential Issues**: Custom renderers require careful error handling and correct interpretation of `tw.Formatting` and `tw.RowContext`. This example's `writeLine` assumes columns are 0-indexed and contiguous for simplicity. + +## Troubleshooting and Common Pitfalls + +This section addresses common migration issues with detailed solutions, covering 30+ scenarios to reduce support tickets. + +| Issue | Cause/Solution | +|-------------------------------------------|-------------------------------------------------------------------------------| +| No output from `Render()` | **Cause**: Missing `Start()`/`Close()` in streaming mode or invalid `io.Writer`. **Solution**: Ensure `Start()` and `Close()` are called in streaming; verify `io.Writer` (`stream.go`). | +| Incorrect column widths | **Cause**: Missing `Config.Widths` in streaming or content-based sizing. **Solution**: Set `Config.Widths` before `Start()`; use `WithColumnMax` (`stream.go`). | +| Merging not working | **Cause**: Streaming mode or mismatched data. **Solution**: Use batch mode for vertical/hierarchical merging; ensure identical content (`zoo.go`). | +| Alignment ignored | **Cause**: `PerColumn` overrides `Global`. **Solution**: Check `Config.Section.Alignment.PerColumn` settings or `ConfigBuilder` calls (`tw/cell.go`). | +| Padding affects widths | **Cause**: Padding included in `Config.Widths`. **Solution**: Adjust `Config.Widths` to account for `tw.CellPadding` (`zoo.go`). | +| Colors not rendering | **Cause**: Non-ANSI terminal or incorrect codes. **Solution**: Test in ANSI-compatible terminal; use `tw.DisplayWidth` (`tw/fn.go`). | +| Caption missing | **Cause**: `Close()` not called in streaming or incorrect `Spot`. **Solution**: Ensure `Close()`; verify `tw.Caption.Spot` (`tablewriter.go`). | +| Filters not applied | **Cause**: Incorrect `PerColumn` indexing or nil filters. **Solution**: Set filters correctly; test with sample data (`tw/cell.go`). | +| Stringer cache overhead | **Cause**: Large datasets with diverse types. **Solution**: Disable `WithStringerCache` for small tables if not using `WithStringer` or if types vary greatly (`tablewriter.go`). | +| Deprecated methods used | **Cause**: Using `WithBorders`, old `tablewriter.Behavior` constants. **Solution**: Migrate to `WithRendition`, `tw.Behavior` struct (`tablewriter.go`, `deprecated.go`). | +| Streaming footer missing | **Cause**: `Close()` not called. **Solution**: Always call `Close()` (`stream.go`). | +| Hierarchical merging fails | **Cause**: Unsorted data or streaming mode. **Solution**: Sort data; use batch mode (`zoo.go`). | +| Custom renderer errors | **Cause**: Incomplete method implementation or misinterpreting `tw.Formatting`. **Solution**: Implement all `tw.Renderer` methods; test thoroughly (`tw/renderer.go`). | +| Width overflow | **Cause**: No `MaxWidth` or wide content. **Solution**: Set `Config.MaxWidth` (`config.go`). | +| Truncated content | **Cause**: Narrow `Config.Widths` or `tw.WrapTruncate`. **Solution**: Widen columns or use `tw.WrapNormal` (`zoo.go`). | +| Debug logs absent | **Cause**: `Debug = false`. **Solution**: Enable `WithDebug(true)` (`config.go`). | +| Alignment mismatch across sections | **Cause**: Different defaults. **Solution**: Set uniform alignment options (e.g., via `ConfigBuilder.
.Alignment()`) (`config.go`). | +| ANSI code artifacts | **Cause**: Non-ANSI terminal. **Solution**: Provide non-colored fallback (`tw/fn.go`). | +| Slow rendering | **Cause**: Complex filters or merging. **Solution**: Optimize logic; limit merging (`zoo.go`). | +| Uneven cell counts | **Cause**: Mismatched rows/headers. **Solution**: Pad with `""` (`zoo.go`). | +| Border inconsistencies | **Cause**: Mismatched `Borders`/`Symbols`. **Solution**: Align settings (`tw/renderer.go`). | +| Streaming width issues | **Cause**: No `Config.Widths`. **Solution**: Set before `Start()` (`stream.go`). | +| Formatter ignored | **Cause**: `WithStringer` might take precedence if compatible. **Solution**: Review conversion priority; `tw.Formatter` is high-priority for single-item-to-single-cell conversion (`zoo.go`). | +| Caption misalignment | **Cause**: Incorrect `Width` or `Align`. **Solution**: Set `tw.Caption.Width`/`Align` (`tablewriter.go`). | +| Per-column padding errors | **Cause**: Incorrect indexing in `Padding.PerColumn`. **Solution**: Verify indices (`tw/cell.go`). | +| Vertical merging in streaming | **Cause**: Unsupported. **Solution**: Use batch mode (`stream.go`). | +| Filter performance | **Cause**: Complex logic. **Solution**: Simplify filters (`zoo.go`). | +| Custom symbols incomplete | **Cause**: Missing characters. **Solution**: Define all symbols (`tw/symbols.go`). | +| Table too wide | **Cause**: No `MaxWidth`. **Solution**: Set `Config.MaxWidth` (`config.go`). | +| Streaming errors | **Cause**: Missing `Start()`. **Solution**: Call `Start()` before data input (`stream.go`). | + +## Additional Notes + +- **Performance Optimization**: Enable `WithStringerCache` for repetitive data types when using `WithStringer`; optimize filters and merging for large datasets (`tablewriter.go`, `zoo.go`). +- **Debugging**: Use `WithDebug(true)` and `table.Debug()` to log configuration and rendering details; invaluable for troubleshooting (`config.go`). +- **Testing Resources**: The `tests/` directory contains examples of various configurations. +- **Community Support**: For advanced use cases or issues, consult the source code or open an issue on the `tablewriter` repository. +- **Future Considerations**: Deprecated methods in `deprecated.go` (e.g., `WithBorders`) are slated for removal in future releases; migrate promptly to ensure compatibility. + +This guide aims to cover all migration scenarios comprehensively. For highly specific or advanced use cases, refer to the source files (`config.go`, `tablewriter.go`, `stream.go`, `tw/*`) or engage with the `tablewriter` community for support. \ No newline at end of file diff --git a/vendor/github.com/olekukonko/tablewriter/README.md b/vendor/github.com/olekukonko/tablewriter/README.md index f06530d..f694340 100644 --- a/vendor/github.com/olekukonko/tablewriter/README.md +++ b/vendor/github.com/olekukonko/tablewriter/README.md @@ -1,431 +1,1064 @@ -ASCII Table Writer -========= +# TableWriter for Go -[![Build Status](https://travis-ci.org/olekukonko/tablewriter.png?branch=master)](https://travis-ci.org/olekukonko/tablewriter) -[![Total views](https://img.shields.io/sourcegraph/rrc/github.com/olekukonko/tablewriter.svg)](https://sourcegraph.com/github.com/olekukonko/tablewriter) -[![Godoc](https://godoc.org/github.com/olekukonko/tablewriter?status.svg)](https://godoc.org/github.com/olekukonko/tablewriter) +[![Go](https://github.com/olekukonko/tablewriter/actions/workflows/go.yml/badge.svg)](https://github.com/olekukonko/tablewriter/actions/workflows/go.yml) +[![Go Reference](https://pkg.go.dev/badge/github.com/olekukonko/tablewriter.svg)](https://pkg.go.dev/github.com/olekukonko/tablewriter) +[![Go Report Card](https://goreportcard.com/badge/github.com/olekukonko/tablewriter)](https://goreportcard.com/report/github.com/olekukonko/tablewriter) +[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) +[![Benchmarks](https://img.shields.io/badge/benchmarks-included-success)](README.md#benchmarks) -Generate ASCII table on the fly ... Installation is simple as +`tablewriter` is a Go library for generating **rich text-based tables** with support for multiple output formats, including ASCII, Unicode, Markdown, HTML, and colorized terminals. Perfect for CLI tools, logs, and web applications. - go get github.com/olekukonko/tablewriter +### Key Features +- **Multi-format rendering**: ASCII, Unicode, Markdown, HTML, ANSI-colored +- **Advanced styling**: Cell merging, alignment, padding, borders +- **Flexible input**: CSV, structs, slices, or streaming data +- **High performance**: Minimal allocations, buffer reuse +- **Modern features**: Generics support, hierarchical merging, real-time streaming + +--- + +### Installation + +#### Legacy Version (v0.0.5) +For use with legacy applications: +```bash +go get github.com/olekukonko/tablewriter@v0.0.5 +``` + +#### Latest Version +The latest stable version +```bash +go get github.com/olekukonko/tablewriter@v1.0.7 +``` + +**Warning:** Version `v1.0.0` contains missing functionality and should not be used. -#### Features -- Automatic Padding -- Support Multiple Lines -- Supports Alignment -- Support Custom Separators -- Automatic Alignment of numbers & percentage -- Write directly to http , file etc via `io.Writer` -- Read directly from CSV file -- Optional row line via `SetRowLine` -- Normalise table header -- Make CSV Headers optional -- Enable or disable table border -- Set custom footer support -- Optional identical cells merging -- Set custom caption -- Optional reflowing of paragraphs in multi-line cells. +> **Version Guidance** +> - Legacy: Use `v0.0.5` (stable) +> - New Features: Use `@latest` (includes generics, super fast streaming APIs) +> - Legacy Docs: See [README_LEGACY.md](README_LEGACY.md) -#### Example 1 - Basic +--- + +### Why TableWriter? +- **CLI Ready**: Instant compatibility with terminal outputs +- **Database Friendly**: Native support for `sql.Null*` types +- **Secure**: Auto-escaping for HTML/Markdown +- **Extensible**: Custom renderers and formatters + +--- + +### Quick Example ```go -data := [][]string{ - []string{"A", "The Good", "500"}, - []string{"B", "The Very very Bad Man", "288"}, - []string{"C", "The Ugly", "120"}, - []string{"D", "The Gopher", "800"}, -} +package main -table := tablewriter.NewWriter(os.Stdout) -table.SetHeader([]string{"Name", "Sign", "Rating"}) +import ( + "github.com/olekukonko/tablewriter" + "os" +) -for _, v := range data { - table.Append(v) -} -table.Render() // Send output -``` - -##### Output 1 -``` -+------+-----------------------+--------+ -| NAME | SIGN | RATING | -+------+-----------------------+--------+ -| A | The Good | 500 | -| B | The Very very Bad Man | 288 | -| C | The Ugly | 120 | -| D | The Gopher | 800 | -+------+-----------------------+--------+ -``` - -#### Example 2 - Without Border / Footer / Bulk Append -```go -data := [][]string{ - []string{"1/1/2014", "Domain name", "2233", "$10.98"}, - []string{"1/1/2014", "January Hosting", "2233", "$54.95"}, - []string{"1/4/2014", "February Hosting", "2233", "$51.00"}, - []string{"1/4/2014", "February Extra Bandwidth", "2233", "$30.00"}, -} - -table := tablewriter.NewWriter(os.Stdout) -table.SetHeader([]string{"Date", "Description", "CV2", "Amount"}) -table.SetFooter([]string{"", "", "Total", "$146.93"}) // Add Footer -table.SetBorder(false) // Set Border to false -table.AppendBulk(data) // Add Bulk Data -table.Render() -``` - -##### Output 2 -``` - - DATE | DESCRIPTION | CV2 | AMOUNT ------------+--------------------------+-------+---------- - 1/1/2014 | Domain name | 2233 | $10.98 - 1/1/2014 | January Hosting | 2233 | $54.95 - 1/4/2014 | February Hosting | 2233 | $51.00 - 1/4/2014 | February Extra Bandwidth | 2233 | $30.00 ------------+--------------------------+-------+---------- - TOTAL | $146 93 - --------+---------- - -``` - - -#### Example 3 - CSV -```go -table, _ := tablewriter.NewCSV(os.Stdout, "testdata/test_info.csv", true) -table.SetAlignment(tablewriter.ALIGN_LEFT) // Set Alignment -table.Render() -``` - -##### Output 3 -``` -+----------+--------------+------+-----+---------+----------------+ -| FIELD | TYPE | NULL | KEY | DEFAULT | EXTRA | -+----------+--------------+------+-----+---------+----------------+ -| user_id | smallint(5) | NO | PRI | NULL | auto_increment | -| username | varchar(10) | NO | | NULL | | -| password | varchar(100) | NO | | NULL | | -+----------+--------------+------+-----+---------+----------------+ -``` - -#### Example 4 - Custom Separator -```go -table, _ := tablewriter.NewCSV(os.Stdout, "testdata/test.csv", true) -table.SetRowLine(true) // Enable row line - -// Change table lines -table.SetCenterSeparator("*") -table.SetColumnSeparator("╪") -table.SetRowSeparator("-") - -table.SetAlignment(tablewriter.ALIGN_LEFT) -table.Render() -``` - -##### Output 4 -``` -*------------*-----------*---------* -╪ FIRST NAME ╪ LAST NAME ╪ SSN ╪ -*------------*-----------*---------* -╪ John ╪ Barry ╪ 123456 ╪ -*------------*-----------*---------* -╪ Kathy ╪ Smith ╪ 687987 ╪ -*------------*-----------*---------* -╪ Bob ╪ McCornick ╪ 3979870 ╪ -*------------*-----------*---------* -``` - -#### Example 5 - Markdown Format -```go -data := [][]string{ - []string{"1/1/2014", "Domain name", "2233", "$10.98"}, - []string{"1/1/2014", "January Hosting", "2233", "$54.95"}, - []string{"1/4/2014", "February Hosting", "2233", "$51.00"}, - []string{"1/4/2014", "February Extra Bandwidth", "2233", "$30.00"}, -} - -table := tablewriter.NewWriter(os.Stdout) -table.SetHeader([]string{"Date", "Description", "CV2", "Amount"}) -table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false}) -table.SetCenterSeparator("|") -table.AppendBulk(data) // Add Bulk Data -table.Render() -``` - -##### Output 5 -``` -| DATE | DESCRIPTION | CV2 | AMOUNT | -|----------|--------------------------|------|--------| -| 1/1/2014 | Domain name | 2233 | $10.98 | -| 1/1/2014 | January Hosting | 2233 | $54.95 | -| 1/4/2014 | February Hosting | 2233 | $51.00 | -| 1/4/2014 | February Extra Bandwidth | 2233 | $30.00 | -``` - -#### Example 6 - Identical cells merging -```go -data := [][]string{ - []string{"1/1/2014", "Domain name", "1234", "$10.98"}, - []string{"1/1/2014", "January Hosting", "2345", "$54.95"}, - []string{"1/4/2014", "February Hosting", "3456", "$51.00"}, - []string{"1/4/2014", "February Extra Bandwidth", "4567", "$30.00"}, -} - -table := tablewriter.NewWriter(os.Stdout) -table.SetHeader([]string{"Date", "Description", "CV2", "Amount"}) -table.SetFooter([]string{"", "", "Total", "$146.93"}) -table.SetAutoMergeCells(true) -table.SetRowLine(true) -table.AppendBulk(data) -table.Render() -``` - -##### Output 6 -``` -+----------+--------------------------+-------+---------+ -| DATE | DESCRIPTION | CV2 | AMOUNT | -+----------+--------------------------+-------+---------+ -| 1/1/2014 | Domain name | 1234 | $10.98 | -+ +--------------------------+-------+---------+ -| | January Hosting | 2345 | $54.95 | -+----------+--------------------------+-------+---------+ -| 1/4/2014 | February Hosting | 3456 | $51.00 | -+ +--------------------------+-------+---------+ -| | February Extra Bandwidth | 4567 | $30.00 | -+----------+--------------------------+-------+---------+ -| TOTAL | $146 93 | -+----------+--------------------------+-------+---------+ -``` - -#### Example 7 - Identical cells merging (specify the column index to merge) -```go -data := [][]string{ - []string{"1/1/2014", "Domain name", "1234", "$10.98"}, - []string{"1/1/2014", "January Hosting", "1234", "$10.98"}, - []string{"1/4/2014", "February Hosting", "3456", "$51.00"}, - []string{"1/4/2014", "February Extra Bandwidth", "4567", "$30.00"}, -} - -table := tablewriter.NewWriter(os.Stdout) -table.SetHeader([]string{"Date", "Description", "CV2", "Amount"}) -table.SetFooter([]string{"", "", "Total", "$146.93"}) -table.SetAutoMergeCellsByColumnIndex([]int{2, 3}) -table.SetRowLine(true) -table.AppendBulk(data) -table.Render() -``` - -##### Output 7 -``` -+----------+--------------------------+-------+---------+ -| DATE | DESCRIPTION | CV2 | AMOUNT | -+----------+--------------------------+-------+---------+ -| 1/1/2014 | Domain name | 1234 | $10.98 | -+----------+--------------------------+ + + -| 1/1/2014 | January Hosting | | | -+----------+--------------------------+-------+---------+ -| 1/4/2014 | February Hosting | 3456 | $51.00 | -+----------+--------------------------+-------+---------+ -| 1/4/2014 | February Extra Bandwidth | 4567 | $30.00 | -+----------+--------------------------+-------+---------+ -| TOTAL | $146.93 | -+----------+--------------------------+-------+---------+ -``` - - -#### Table with color -```go -data := [][]string{ - []string{"1/1/2014", "Domain name", "2233", "$10.98"}, - []string{"1/1/2014", "January Hosting", "2233", "$54.95"}, - []string{"1/4/2014", "February Hosting", "2233", "$51.00"}, - []string{"1/4/2014", "February Extra Bandwidth", "2233", "$30.00"}, -} - -table := tablewriter.NewWriter(os.Stdout) -table.SetHeader([]string{"Date", "Description", "CV2", "Amount"}) -table.SetFooter([]string{"", "", "Total", "$146.93"}) // Add Footer -table.SetBorder(false) // Set Border to false - -table.SetHeaderColor(tablewriter.Colors{tablewriter.Bold, tablewriter.BgGreenColor}, - tablewriter.Colors{tablewriter.FgHiRedColor, tablewriter.Bold, tablewriter.BgBlackColor}, - tablewriter.Colors{tablewriter.BgRedColor, tablewriter.FgWhiteColor}, - tablewriter.Colors{tablewriter.BgCyanColor, tablewriter.FgWhiteColor}) - -table.SetColumnColor(tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiBlackColor}, - tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiRedColor}, - tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiBlackColor}, - tablewriter.Colors{tablewriter.Bold, tablewriter.FgBlackColor}) - -table.SetFooterColor(tablewriter.Colors{}, tablewriter.Colors{}, - tablewriter.Colors{tablewriter.Bold}, - tablewriter.Colors{tablewriter.FgHiRedColor}) - -table.AppendBulk(data) -table.Render() -``` - -#### Table with color Output -![Table with Color](https://cloud.githubusercontent.com/assets/6460392/21101956/bbc7b356-c0a1-11e6-9f36-dba694746efc.png) - -#### Example - 8 Table Cells with Color - -Individual Cell Colors from `func Rich` take precedence over Column Colors - -```go -data := [][]string{ - []string{"Test1Merge", "HelloCol2 - 1", "HelloCol3 - 1", "HelloCol4 - 1"}, - []string{"Test1Merge", "HelloCol2 - 2", "HelloCol3 - 2", "HelloCol4 - 2"}, - []string{"Test1Merge", "HelloCol2 - 3", "HelloCol3 - 3", "HelloCol4 - 3"}, - []string{"Test2Merge", "HelloCol2 - 4", "HelloCol3 - 4", "HelloCol4 - 4"}, - []string{"Test2Merge", "HelloCol2 - 5", "HelloCol3 - 5", "HelloCol4 - 5"}, - []string{"Test2Merge", "HelloCol2 - 6", "HelloCol3 - 6", "HelloCol4 - 6"}, - []string{"Test2Merge", "HelloCol2 - 7", "HelloCol3 - 7", "HelloCol4 - 7"}, - []string{"Test3Merge", "HelloCol2 - 8", "HelloCol3 - 8", "HelloCol4 - 8"}, - []string{"Test3Merge", "HelloCol2 - 9", "HelloCol3 - 9", "HelloCol4 - 9"}, - []string{"Test3Merge", "HelloCol2 - 10", "HelloCol3 -10", "HelloCol4 - 10"}, -} - -table := tablewriter.NewWriter(os.Stdout) -table.SetHeader([]string{"Col1", "Col2", "Col3", "Col4"}) -table.SetFooter([]string{"", "", "Footer3", "Footer4"}) -table.SetBorder(false) - -table.SetHeaderColor(tablewriter.Colors{tablewriter.Bold, tablewriter.BgGreenColor}, - tablewriter.Colors{tablewriter.FgHiRedColor, tablewriter.Bold, tablewriter.BgBlackColor}, - tablewriter.Colors{tablewriter.BgRedColor, tablewriter.FgWhiteColor}, - tablewriter.Colors{tablewriter.BgCyanColor, tablewriter.FgWhiteColor}) - -table.SetColumnColor(tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiBlackColor}, - tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiRedColor}, - tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiBlackColor}, - tablewriter.Colors{tablewriter.Bold, tablewriter.FgBlackColor}) - -table.SetFooterColor(tablewriter.Colors{}, tablewriter.Colors{}, - tablewriter.Colors{tablewriter.Bold}, - tablewriter.Colors{tablewriter.FgHiRedColor}) - -colorData1 := []string{"TestCOLOR1Merge", "HelloCol2 - COLOR1", "HelloCol3 - COLOR1", "HelloCol4 - COLOR1"} -colorData2 := []string{"TestCOLOR2Merge", "HelloCol2 - COLOR2", "HelloCol3 - COLOR2", "HelloCol4 - COLOR2"} - -for i, row := range data { - if i == 4 { - table.Rich(colorData1, []tablewriter.Colors{tablewriter.Colors{}, tablewriter.Colors{tablewriter.Normal, tablewriter.FgCyanColor}, tablewriter.Colors{tablewriter.Bold, tablewriter.FgWhiteColor}, tablewriter.Colors{}}) - table.Rich(colorData2, []tablewriter.Colors{tablewriter.Colors{tablewriter.Normal, tablewriter.FgMagentaColor}, tablewriter.Colors{}, tablewriter.Colors{tablewriter.Bold, tablewriter.BgRedColor}, tablewriter.Colors{tablewriter.FgHiGreenColor, tablewriter.Italic, tablewriter.BgHiCyanColor}}) +func main() { + data := [][]string{ + {"Package", "Version", "Status"}, + {"tablewriter", "v0.0.5", "legacy"}, + {"tablewriter", "v1.0.7", "latest"}, } - table.Append(row) + + table := tablewriter.NewWriter(os.Stdout) + table.Header(data[0]) + table.Bulk(data[1:]) + table.Render() } - -table.SetAutoMergeCells(true) -table.Render() - +``` +**Output**: +``` +┌─────────────┬─────────┬────────┐ +│ PACKAGE │ VERSION │ STATUS │ +├─────────────┼─────────┼────────┤ +│ tablewriter │ v0.0.5 │ legacy │ +│ tablewriter │ v1.0.7 │ latest │ +└─────────────┴─────────┴────────┘ ``` -##### Table cells with color Output -![Table cells with Color](https://user-images.githubusercontent.com/9064687/63969376-bcd88d80-ca6f-11e9-9466-c3d954700b25.png) -#### Example 9 - Set table caption -```go -data := [][]string{ - []string{"A", "The Good", "500"}, - []string{"B", "The Very very Bad Man", "288"}, - []string{"C", "The Ugly", "120"}, - []string{"D", "The Gopher", "800"}, -} +## Detailed Usage -table := tablewriter.NewWriter(os.Stdout) -table.SetHeader([]string{"Name", "Sign", "Rating"}) -table.SetCaption(true, "Movie ratings.") +Create a table with `NewTable` or `NewWriter`, configure it using options or a `Config` struct, add data with `Append` or `Bulk`, and render to an `io.Writer`. Use renderers like `Blueprint` (ASCII), `HTML`, `Markdown`, `Colorized`, or `Ocean` (streaming). -for _, v := range data { - table.Append(v) -} -table.Render() // Send output -``` +## Examples -Note: Caption text will wrap with total width of rendered table. +### Basic Examples -##### Output 9 -``` -+------+-----------------------+--------+ -| NAME | SIGN | RATING | -+------+-----------------------+--------+ -| A | The Good | 500 | -| B | The Very very Bad Man | 288 | -| C | The Ugly | 120 | -| D | The Gopher | 800 | -+------+-----------------------+--------+ -Movie ratings. -``` +#### 1. Simple Tables -#### Example 10 - Set NoWhiteSpace and TablePadding option -```go -data := [][]string{ - {"node1.example.com", "Ready", "compute", "1.11"}, - {"node2.example.com", "Ready", "compute", "1.11"}, - {"node3.example.com", "Ready", "compute", "1.11"}, - {"node4.example.com", "NotReady", "compute", "1.11"}, -} +Create a basic table with headers and rows. -table := tablewriter.NewWriter(os.Stdout) -table.SetHeader([]string{"Name", "Status", "Role", "Version"}) -table.SetAutoWrapText(false) -table.SetAutoFormatHeaders(true) -table.SetHeaderAlignment(ALIGN_LEFT) -table.SetAlignment(ALIGN_LEFT) -table.SetCenterSeparator("") -table.SetColumnSeparator("") -table.SetRowSeparator("") -table.SetHeaderLine(false) -table.SetBorder(false) -table.SetTablePadding("\t") // pad with tabs -table.SetNoWhiteSpace(true) -table.AppendBulk(data) // Add Bulk Data -table.Render() -``` -##### Output 10 -``` -NAME STATUS ROLE VERSION -node1.example.com Ready compute 1.11 -node2.example.com Ready compute 1.11 -node3.example.com Ready compute 1.11 -node4.example.com NotReady compute 1.11 -``` - -#### Render table into a string - -Instead of rendering the table to `io.Stdout` you can also render it into a string. Go 1.10 introduced the `strings.Builder` type which implements the `io.Writer` interface and can therefore be used for this task. Example: +##### default ```go package main import ( - "strings" - "fmt" - - "github.com/olekukonko/tablewriter" + "fmt" + "github.com/olekukonko/tablewriter" + "os" ) +type Age int + +func (a Age) String() string { + return fmt.Sprintf("%d yrs", a) +} + func main() { - tableString := &strings.Builder{} - table := tablewriter.NewWriter(tableString) + data := [][]any{ + {"Alice", Age(25), "New York"}, + {"Bob", Age(30), "Boston"}, + } - /* - * Code to fill the table - */ - - table.Render() - - fmt.Println(tableString.String()) + table := tablewriter.NewTable(os.Stdout) + table.Header("Name", "Age", "City") + table.Bulk(data) + table.Render() } ``` -#### TODO -- ~~Import Directly from CSV~~ - `done` -- ~~Support for `SetFooter`~~ - `done` -- ~~Support for `SetBorder`~~ - `done` -- ~~Support table with uneven rows~~ - `done` -- ~~Support custom alignment~~ -- General Improvement & Optimisation -- `NewHTML` Parse table from HTML +**Output**: + +``` +┌───────┬────────┬──────────┐ +│ NAME │ AGE │ CITY │ +├───────┼────────┼──────────┤ +│ Alice │ 25 yrs │ New York │ +│ Bob │ 30 yrs │ Boston │ +└───────┴────────┴──────────┘ + +``` + + +##### with customization + + +```go +package main + +import ( + "fmt" + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +type Age int + +func (a Age) String() string { + return fmt.Sprintf("%d yrs", a) +} + +func main() { + data := [][]any{ + {"Alice", Age(25), "New York"}, + {"Bob", Age(30), "Boston"}, + } + + symbols := tw.NewSymbolCustom("Nature"). + WithRow("~"). + WithColumn("|"). + WithTopLeft("🌱"). + WithTopMid("🌿"). + WithTopRight("🌱"). + WithMidLeft("🍃"). + WithCenter("❀"). + WithMidRight("🍃"). + WithBottomLeft("🌻"). + WithBottomMid("🌾"). + WithBottomRight("🌻") + + table := tablewriter.NewTable(os.Stdout, tablewriter.WithRenderer(renderer.NewBlueprint(tw.Rendition{Symbols: symbols}))) + table.Header("Name", "Age", "City") + table.Bulk(data) + table.Render() +} +``` + +``` +🌱~~~~~~❀~~~~~~~~❀~~~~~~~~~🌱 +| NAME | AGE | CITY | +🍃~~~~~~❀~~~~~~~~❀~~~~~~~~~🍃 +| Alice | 25 yrs | New York | +| Bob | 30 yrs | Boston | +🌻~~~~~~❀~~~~~~~~❀~~~~~~~~~🌻 +``` + +See [symbols example](https://github.com/olekukonko/tablewriter/blob/master/_example/symbols/main.go) for more + +#### 2. Markdown Table + +Generate a Markdown table for documentation. + +```go +package main + +import ( + "fmt" + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" + "os" + "strings" + "unicode" +) + +type Name struct { + First string + Last string +} + +// this will be ignored since Format() is present +func (n Name) String() string { + return fmt.Sprintf("%s %s", n.First, n.Last) +} + +// Note: Format() overrides String() if both exist. +func (n Name) Format() string { + return fmt.Sprintf("%s %s", n.clean(n.First), n.clean(n.Last)) +} + +// clean ensures the first letter is capitalized and the rest are lowercase +func (n Name) clean(s string) string { + s = strings.TrimSpace(strings.ToLower(s)) + words := strings.Fields(s) + s = strings.Join(words, "") + + if s == "" { + return s + } + // Capitalize the first letter + runes := []rune(s) + runes[0] = unicode.ToUpper(runes[0]) + return string(runes) +} + +type Age int + +// Age int will be ignore and string will be used +func (a Age) String() string { + return fmt.Sprintf("%d yrs", a) +} + +func main() { + data := [][]any{ + {Name{"Al i CE", " Ma SK"}, Age(25), "New York"}, + {Name{"bOb", "mar le y"}, Age(30), "Boston"}, + } + + table := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewMarkdown()), + ) + + table.Header([]string{"Name", "Age", "City"}) + table.Bulk(data) + table.Render() +} +``` + +**Output**: + +``` +| NAME | AGE | CITY | +|:----------:|:------:|:--------:| +| Alice Mask | 25 yrs | New York | +| Bob Marley | 30 yrs | Boston | + + +``` + +#### 3. CSV Input + +Create a table from a CSV file with custom row alignment. + +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" + "log" + "os" +) + +func main() { + // Assuming "test.csv" contains: "First Name,Last Name,SSN\nJohn,Barry,123456\nKathy,Smith,687987" + table, err := tablewriter.NewCSV(os.Stdout, "test.csv", true) + if err != nil { + log.Fatalf("Error: %v", err) + } + + table.Configure(func(config *tablewriter.Config) { + config.Row.Alignment.Global = tw.AlignLeft + }) + table.Render() +} +``` + +**Output**: + +``` +┌────────────┬───────────┬─────────┐ +│ FIRST NAME │ LAST NAME │ SSN │ +├────────────┼───────────┼─────────┤ +│ John │ Barry │ 123456 │ +│ Kathy │ Smith │ 687987 │ +└────────────┴───────────┴─────────┘ +``` + +### Advanced Examples + +#### 4. Colorized Table with Long Values + +Create a colorized table with wrapped long values, per-column colors, and a styled footer (inspired by `TestColorizedLongValues` and `TestColorizedCustomColors`). + +```go +package main + +import ( + "github.com/fatih/color" + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + data := [][]string{ + {"1", "This is a very long description that needs wrapping for readability", "OK"}, + {"2", "Short description", "DONE"}, + {"3", "Another lengthy description requiring truncation or wrapping", "ERROR"}, + } + + // Configure colors: green headers, cyan/magenta rows, yellow footer + colorCfg := renderer.ColorizedConfig{ + Header: renderer.Tint{ + FG: renderer.Colors{color.FgGreen, color.Bold}, // Green bold headers + BG: renderer.Colors{color.BgHiWhite}, + }, + Column: renderer.Tint{ + FG: renderer.Colors{color.FgCyan}, // Default cyan for rows + Columns: []renderer.Tint{ + {FG: renderer.Colors{color.FgMagenta}}, // Magenta for column 0 + {}, // Inherit default (cyan) + {FG: renderer.Colors{color.FgHiRed}}, // High-intensity red for column 2 + }, + }, + Footer: renderer.Tint{ + FG: renderer.Colors{color.FgYellow, color.Bold}, // Yellow bold footer + Columns: []renderer.Tint{ + {}, // Inherit default + {FG: renderer.Colors{color.FgHiYellow}}, // High-intensity yellow for column 1 + {}, // Inherit default + }, + }, + Border: renderer.Tint{FG: renderer.Colors{color.FgWhite}}, // White borders + Separator: renderer.Tint{FG: renderer.Colors{color.FgWhite}}, // White separators + } + + table := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewColorized(colorCfg)), + tablewriter.WithConfig(tablewriter.Config{ + Row: tw.CellConfig{ + Formatting: tw.CellFormatting{AutoWrap: tw.WrapNormal}, // Wrap long content + Alignment: tw.CellAlignment{Global: tw.AlignLeft}, // Left-align rows + ColMaxWidths: tw.CellWidth{Global: 25}, + }, + Footer: tw.CellConfig{ + Alignment: tw.CellAlignment{Global: tw.AlignRight}, + }, + }), + ) + + table.Header([]string{"ID", "Description", "Status"}) + table.Bulk(data) + table.Footer([]string{"", "Total", "3"}) + table.Render() +} +``` + +**Output** (colors visible in ANSI-compatible terminals): + +![Colorized Table with Long Values](_readme/color_1.png "Title") + +#### 5. Streaming Table with Truncation + +Stream a table incrementally with truncation and a footer, simulating a real-time data feed (inspired by `TestOceanStreamTruncation` and `TestOceanStreamSlowOutput`). + +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" + "log" + "os" + "time" +) + +func main() { + table := tablewriter.NewTable(os.Stdout, tablewriter.WithStreaming(tw.StreamConfig{Enable: true})) + + // Start streaming + if err := table.Start(); err != nil { + log.Fatalf("Start failed: %v", err) + } + + defer table.Close() + + // Stream header + table.Header([]string{"ID", "Description", "Status"}) + + // Stream rows with simulated delay + data := [][]string{ + {"1", "This description is too long", "OK"}, + {"2", "Short desc", "DONE"}, + {"3", "Another long description here", "ERROR"}, + } + for _, row := range data { + table.Append(row) + time.Sleep(500 * time.Millisecond) // Simulate real-time data feed + } + + // Stream footer + table.Footer([]string{"", "Total", "3"}) +} +``` + +**Output** (appears incrementally): + +``` +┌────────┬───────────────┬──────────┐ +│ ID │ DESCRIPTION │ STATUS │ +├────────┼───────────────┼──────────┤ +│ 1 │ This │ OK │ +│ │ description │ │ +│ │ is too long │ │ +│ 2 │ Short desc │ DONE │ +│ 3 │ Another long │ ERROR │ +│ │ description │ │ +│ │ here │ │ +├────────┼───────────────┼──────────┤ +│ │ Total │ 3 │ +└────────┴───────────────┴──────────┘ +``` + +**Note**: Long descriptions are truncated with `…` due to fixed column widths. The output appears row-by-row, simulating a real-time feed. + +#### 6. Hierarchical Merging for Organizational Data + +Show hierarchical merging for a tree-like structure, such as an organizational hierarchy (inspired by `TestMergeHierarchicalUnicode`). + +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + data := [][]string{ + {"Engineering", "Backend", "API Team", "Alice"}, + {"Engineering", "Backend", "Database Team", "Bob"}, + {"Engineering", "Frontend", "UI Team", "Charlie"}, + {"Marketing", "Digital", "SEO Team", "Dave"}, + {"Marketing", "Digital", "Content Team", "Eve"}, + } + + table := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewBlueprint(tw.Rendition{ + Settings: tw.Settings{Separators: tw.Separators{BetweenRows: tw.On}}, + })), + tablewriter.WithConfig(tablewriter.Config{ + Header: tw.CellConfig{Alignment: tw.CellAlignment{Global: tw.AlignCenter}}, + Row: tw.CellConfig{ + Formatting: tw.CellFormatting{MergeMode: tw.MergeHierarchical}, + Alignment: tw.CellAlignment{Global: tw.AlignLeft}, + }, + }), + ) + table.Header([]string{"Department", "Division", "Team", "Lead"}) + table.Bulk(data) + table.Render() +} +``` + +**Output**: + +``` +┌────────────┬──────────┬──────────────┬────────┐ +│ DEPARTMENT │ DIVISION │ TEAM │ LEAD │ +├────────────┼──────────┼──────────────┼────────┤ +│ Engineering│ Backend │ API Team │ Alice │ +│ │ ├──────────────┼────────┤ +│ │ │ Database Team│ Bob │ +│ │ Frontend ├──────────────┼────────┤ +│ │ │ UI Team │ Charlie│ +├────────────┼──────────┼──────────────┼────────┤ +│ Marketing │ Digital │ SEO Team │ Dave │ +│ │ ├──────────────┼────────┤ +│ │ │ Content Team │ Eve │ +└────────────┴──────────┴──────────────┴────────┘ +``` + +**Note**: Hierarchical merging groups repeated values (e.g., "Engineering" spans multiple rows, "Backend" spans two teams), creating a tree-like structure. + +#### 7. Custom Padding with Merging + +Showcase custom padding and combined horizontal/vertical merging (inspired by `TestMergeWithPadding` in `merge_test.go`). + +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + data := [][]string{ + {"1/1/2014", "Domain name", "Successful", "Successful"}, + {"1/1/2014", "Domain name", "Pending", "Waiting"}, + {"1/1/2014", "Domain name", "Successful", "Rejected"}, + {"", "", "TOTAL", "$145.93"}, + } + + table := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewBlueprint(tw.Rendition{ + Settings: tw.Settings{Separators: tw.Separators{BetweenRows: tw.On}}, + })), + tablewriter.WithConfig(tablewriter.Config{ + Row: tw.CellConfig{ + Formatting: tw.CellFormatting{MergeMode: tw.MergeBoth}, + Alignment: tw.CellAlignment{PerColumn: []tw.Align{tw.Skip, tw.Skip, tw.AlignRight, tw.AlignLeft}}, + }, + + Footer: tw.CellConfig{ + Padding: tw.CellPadding{ + Global: tw.Padding{Left: "*", Right: "*"}, + PerColumn: []tw.Padding{{}, {}, {Bottom: "^"}, {Bottom: "^"}}, + }, + Alignment: tw.CellAlignment{PerColumn: []tw.Align{tw.Skip, tw.Skip, tw.AlignRight, tw.AlignLeft}}, + }, + }), + ) + table.Header([]string{"Date", "Description", "Status", "Conclusion"}) + table.Bulk(data) + table.Render() +} +``` + +**Output**: + +``` +┌──────────┬─────────────┬────────────┬────────────┐ +│ DATE │ DESCRIPTION │ STATUS │ CONCLUSION │ +├──────────┼─────────────┼────────────┴────────────┤ +│ 1/1/2014 │ Domain name │ Successful │ +│ │ ├────────────┬────────────┤ +│ │ │ Pending │ Waiting │ +│ │ ├────────────┼────────────┤ +│ │ │ Successful │ Rejected │ +├──────────┼─────────────┼────────────┼────────────┤ +│ │ │ TOTAL │ $145.93 │ +│ │ │^^^^^^^^^^^^│^^^^^^^^^^^^│ +└──────────┴─────────────┴────────────┴────────────┘ +``` + +#### 8. Nested Tables + +Create a table with nested sub-tables for complex layouts (inspired by `TestMasterClass` in `extra_test.go`). + +```go +package main + +import ( + "bytes" + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + // Helper to create a sub-table + createSubTable := func(s string) string { + var buf bytes.Buffer + table := tablewriter.NewTable(&buf, + tablewriter.WithRenderer(renderer.NewBlueprint(tw.Rendition{ + Borders: tw.BorderNone, + Symbols: tw.NewSymbols(tw.StyleASCII), + Settings: tw.Settings{ + Separators: tw.Separators{BetweenRows: tw.On}, + Lines: tw.Lines{ShowFooterLine: tw.On}, + }, + })), + tablewriter.WithConfig(tablewriter.Config{ + MaxWidth: 10, + Row: tw.CellConfig{Alignment: tw.CellAlignment{Global: tw.AlignCenter}}, + }), + ) + table.Append([]string{s, s}) + table.Append([]string{s, s}) + table.Render() + return buf.String() + } + + // Main table + table := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewBlueprint(tw.Rendition{ + Borders: tw.BorderNone, + Settings: tw.Settings{Separators: tw.Separators{BetweenColumns: tw.On}}, + })), + tablewriter.WithConfig(tablewriter.Config{ + MaxWidth: 30, + Row: tw.CellConfig{Alignment: tw.CellAlignment{Global: tw.AlignCenter}}, + }), + ) + table.Append([]string{createSubTable("A"), createSubTable("B")}) + table.Append([]string{createSubTable("C"), createSubTable("D")}) + table.Render() +} +``` + +**Output**: + +``` + A | A │ B | B + ---+--- │ ---+--- + A | A │ B | B + C | C │ D | D + ---+--- │ ---+--- + C | C │ D | D +``` + +#### 9. Structs with Database + +Render a table from a slice of structs, simulating a database query (inspired by `TestStructTableWithDB` in `struct_test.go`). + +```go +package main + +import ( + "fmt" + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +type Employee struct { + ID int + Name string + Age int + Department string + Salary float64 +} + +func employeeStringer(e interface{}) []string { + emp, ok := e.(Employee) + if !ok { + return []string{"Error: Invalid type"} + } + return []string{ + fmt.Sprintf("%d", emp.ID), + emp.Name, + fmt.Sprintf("%d", emp.Age), + emp.Department, + fmt.Sprintf("%.2f", emp.Salary), + } +} + +func main() { + employees := []Employee{ + {ID: 1, Name: "Alice Smith", Age: 28, Department: "Engineering", Salary: 75000.50}, + {ID: 2, Name: "Bob Johnson", Age: 34, Department: "Marketing", Salary: 62000.00}, + {ID: 3, Name: "Charlie Brown", Age: 45, Department: "HR", Salary: 80000.75}, + } + + table := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewBlueprint(tw.Rendition{ + Symbols: tw.NewSymbols(tw.StyleRounded), + })), + tablewriter.WithStringer(employeeStringer), + tablewriter.WithConfig(tablewriter.Config{ + Header: tw.CellConfig{ + Formatting: tw.CellFormatting{AutoFormat: tw.On}, + Alignment: tw.CellAlignment{Global: tw.AlignCenter}, + }, + Row: tw.CellConfig{Alignment: tw.CellAlignment{Global: tw.AlignLeft}}, + Footer: tw.CellConfig{Alignment: tw.CellAlignment{Global: tw.AlignRight}}, + }), + ) + table.Header([]string{"ID", "Name", "Age", "Department", "Salary"}) + + for _, emp := range employees { + table.Append(emp) + } + + totalSalary := 0.0 + for _, emp := range employees { + totalSalary += emp.Salary + } + table.Footer([]string{"", "", "", "Total", fmt.Sprintf("%.2f", totalSalary)}) + table.Render() +} +``` + +**Output**: + +``` +╭────┬───────────────┬─────┬─────────────┬───────────╮ +│ ID │ NAME │ AGE │ DEPARTMENT │ SALARY │ +├────┼───────────────┼─────┼─────────────┼───────────┤ +│ 1 │ Alice Smith │ 28 │ Engineering │ 75000.50 │ +│ 2 │ Bob Johnson │ 34 │ Marketing │ 62000.00 │ +│ 3 │ Charlie Brown │ 45 │ HR │ 80000.75 │ +├────┼───────────────┼─────┼─────────────┼───────────┤ +│ │ │ │ Total │ 217001.25 │ +╰────┴───────────────┴─────┴─────────────┴───────────╯ +``` + + +#### 10. Simple Html Table + + +```go +package main + +import ( + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" + "github.com/olekukonko/tablewriter/tw" + "os" +) + +func main() { + data := [][]string{ + {"North", "Q1 & Q2", "Q1 & Q2", "$2200.00"}, + {"South", "Q1", "Q1", "$1000.00"}, + {"South", "Q2", "Q2", "$1200.00"}, + } + + // Configure HTML with custom CSS classes and content escaping + htmlCfg := renderer.HTMLConfig{ + TableClass: "sales-table", + HeaderClass: "table-header", + BodyClass: "table-body", + FooterClass: "table-footer", + RowClass: "table-row", + HeaderRowClass: "header-row", + FooterRowClass: "footer-row", + EscapeContent: true, // Escape HTML characters (e.g., "&" to "&") + } + + table := tablewriter.NewTable(os.Stdout, + tablewriter.WithRenderer(renderer.NewHTML(htmlCfg)), + tablewriter.WithConfig(tablewriter.Config{ + Header: tw.CellConfig{ + Formatting: tw.CellFormatting{MergeMode: tw.MergeHorizontal}, // Merge identical header cells + Alignment: tw.CellAlignment{Global: tw.AlignCenter}, + }, + Row: tw.CellConfig{ + Formatting: tw.CellFormatting{MergeMode: tw.MergeHorizontal}, // Merge identical row cells + Alignment: tw.CellAlignment{Global: tw.AlignLeft}, + }, + Footer: tw.CellConfig{Alignment: tw.CellAlignment{Global: tw.AlignRight}}, + }), + ) + + table.Header([]string{"Region", "Quarter", "Quarter", "Sales"}) + table.Bulk(data) + table.Footer([]string{"", "", "Total", "$4400.00"}) + table.Render() +} +``` + +**Output**: + +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
REGIONQUARTERSALES
NorthQ1 & Q2$2200.00
SouthQ1$1000.00
SouthQ2$1200.00
+ +``` + +#### 11. SVG Support +```go +package main + +import ( + "fmt" + "github.com/olekukonko/ll" + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/renderer" + "os" +) + +type Age int + +func (a Age) String() string { + return fmt.Sprintf("%d yrs", a) +} + +func main() { + data := [][]any{ + {"Alice", Age(25), "New York"}, + {"Bob", Age(30), "Boston"}, + } + + file, err := os.OpenFile("out.svg", os.O_CREATE|os.O_WRONLY, 0644) + if err != nil { + ll.Fatal(err) + } + defer file.Close() + + table := tablewriter.NewTable(file, tablewriter.WithRenderer(renderer.NewSVG())) + table.Header("Name", "Age", "City") + table.Bulk(data) + table.Render() +} +``` + +```go + + + + NAME + + AGE + + CITY + + Alice + + 25 yrs + + New York + + Bob + + 30 yrs + + Boston + + + + + + + + + + + + +``` + +#### 12 Simple Application + + +```go +package main + +import ( + "fmt" + "github.com/olekukonko/tablewriter" + "github.com/olekukonko/tablewriter/tw" + "io/fs" + "os" + "path/filepath" + "strings" + "time" +) + +const ( + folder = "📁" + file = "📄" + baseDir = "../" + indentStr = " " +) + +func main() { + table := tablewriter.NewTable(os.Stdout, tablewriter.WithTrimSpace(tw.Off)) + table.Header([]string{"Tree", "Size", "Permissions", "Modified"}) + err := filepath.WalkDir(baseDir, func(path string, d fs.DirEntry, err error) error { + if err != nil { + return err + } + + if d.Name() == "." || d.Name() == ".." { + return nil + } + + // Calculate relative path depth + relPath, err := filepath.Rel(baseDir, path) + if err != nil { + return err + } + + depth := 0 + if relPath != "." { + depth = len(strings.Split(relPath, string(filepath.Separator))) - 1 + } + + indent := strings.Repeat(indentStr, depth) + + var name string + if d.IsDir() { + name = fmt.Sprintf("%s%s %s", indent, folder, d.Name()) + } else { + name = fmt.Sprintf("%s%s %s", indent, file, d.Name()) + } + + info, err := d.Info() + if err != nil { + return err + } + + table.Append([]string{ + name, + Size(info.Size()).String(), + info.Mode().String(), + Time(info.ModTime()).Format(), + }) + + return nil + }) + + if err != nil { + fmt.Fprintf(os.Stdout, "Error: %v\n", err) + return + } + + table.Render() +} + +const ( + KB = 1024 + MB = KB * 1024 + GB = MB * 1024 + TB = GB * 1024 +) + +type Size int64 + +func (s Size) String() string { + switch { + case s < KB: + return fmt.Sprintf("%d B", s) + case s < MB: + return fmt.Sprintf("%.2f KB", float64(s)/KB) + case s < GB: + return fmt.Sprintf("%.2f MB", float64(s)/MB) + case s < TB: + return fmt.Sprintf("%.2f GB", float64(s)/GB) + default: + return fmt.Sprintf("%.2f TB", float64(s)/TB) + } +} + +type Time time.Time + +func (t Time) Format() string { + now := time.Now() + diff := now.Sub(time.Time(t)) + + if diff.Seconds() < 60 { + return "just now" + } else if diff.Minutes() < 60 { + return fmt.Sprintf("%d minutes ago", int(diff.Minutes())) + } else if diff.Hours() < 24 { + return fmt.Sprintf("%d hours ago", int(diff.Hours())) + } else if diff.Hours() < 24*7 { + return fmt.Sprintf("%d days ago", int(diff.Hours()/24)) + } else { + return time.Time(t).Format("Jan 2, 2006") + } +} + +``` + +``` +┌──────────────────┬─────────┬─────────────┬──────────────┐ +│ TREE │ SIZE │ PERMISSIONS │ MODIFIED │ +├──────────────────┼─────────┼─────────────┼──────────────┤ +│ 📁 filetable │ 160 B │ drwxr-xr-x │ just now │ +│ 📄 main.go │ 2.19 KB │ -rw-r--r-- │ 22 hours ago │ +│ 📄 out.txt │ 0 B │ -rw-r--r-- │ just now │ +│ 📁 testdata │ 128 B │ drwxr-xr-x │ 1 days ago │ +│ 📄 a.txt │ 11 B │ -rw-r--r-- │ 1 days ago │ +│ 📄 b.txt │ 17 B │ -rw-r--r-- │ 1 days ago │ +│ 📁 symbols │ 128 B │ drwxr-xr-x │ just now │ +│ 📄 main.go │ 4.58 KB │ -rw-r--r-- │ 1 hours ago │ +│ 📄 out.txt │ 8.72 KB │ -rw-r--r-- │ just now │ +└──────────────────┴─────────┴─────────────┴──────────────┘ +``` + + +## Changes + +- `AutoFormat` changes See [#261](https://github.com/olekukonko/tablewriter/issues/261) + + +## Command-Line Tool + +The `csv2table` tool converts CSV files to ASCII tables. See `cmd/csv2table/csv2table.go` for details. + +Example usage: + +```bash +csv2table -f test.csv -h true -a left +``` + +## Contributing + +Contributions are welcome! Submit issues or pull requests to the [GitHub repository](https://github.com/olekukonko/tablewriter). + +## License + +MIT License. See the [LICENSE](LICENSE) file for details. \ No newline at end of file diff --git a/vendor/github.com/olekukonko/tablewriter/README_LEGACY.md b/vendor/github.com/olekukonko/tablewriter/README_LEGACY.md new file mode 100644 index 0000000..ed9b9c0 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/README_LEGACY.md @@ -0,0 +1,466 @@ +ASCII Table Writer +========= + +[![ci](https://github.com/olekukonko/tablewriter/workflows/ci/badge.svg?branch=master)](https://github.com/olekukonko/tablewriter/actions?query=workflow%3Aci) +[![Total views](https://img.shields.io/sourcegraph/rrc/github.com/olekukonko/tablewriter.svg)](https://sourcegraph.com/github.com/olekukonko/tablewriter) +[![Godoc](https://godoc.org/github.com/olekukonko/tablewriter?status.svg)](https://godoc.org/github.com/olekukonko/tablewriter) + + +## Important Notice: Modernization in Progress + +The `tablewriter` package is being modernized on the `prototype` branch with generics, streaming support, and a modular design, targeting `v0.2.0`. Until this is released: + +**For Production Use**: Use the stable version `v0.0.5`: +```bash + go get github.com/olekukonko/tablewriter@v0.0.5 +``` + +#### + +For Development Preview: Try the in-progress version (unstable) + +```bash +go get github.com/olekukonko/tablewriter@master +``` + +#### Features + +- Automatic Padding +- Support Multiple Lines +- Supports Alignment +- Support Custom Separators +- Automatic Alignment of numbers & percentage +- Write directly to http , file etc via `io.Writer` +- Read directly from CSV file +- Optional row line via `SetRowLine` +- Normalise table header +- Make CSV Headers optional +- Enable or disable table border +- Set custom footer support +- Optional identical cells merging +- Set custom caption +- Optional reflowing of paragraphs in multi-line cells. + +#### Example 1 - Basic + +```go +data := [][]string{ +[]string{"A", "The Good", "500"}, +[]string{"B", "The Very very Bad Man", "288"}, +[]string{"C", "The Ugly", "120"}, +[]string{"D", "The Gopher", "800"}, +} + +table := tablewriter.NewWriter(os.Stdout) +table.SetHeader([]string{"Name", "Sign", "Rating"}) + +for _, v := range data { +table.Append(v) +} +table.Render() // Send output +``` + +##### Output 1 + +``` ++------+-----------------------+--------+ +| NAME | SIGN | RATING | ++------+-----------------------+--------+ +| A | The Good | 500 | +| B | The Very very Bad Man | 288 | +| C | The Ugly | 120 | +| D | The Gopher | 800 | ++------+-----------------------+--------+ +``` + +#### Example 2 - Without Border / Footer / Bulk Append + +```go +data := [][]string{ +[]string{"1/1/2014", "Domain name", "2233", "$10.98"}, +[]string{"1/1/2014", "January Hosting", "2233", "$54.95"}, +[]string{"1/4/2014", "February Hosting", "2233", "$51.00"}, +[]string{"1/4/2014", "February Extra Bandwidth", "2233", "$30.00"}, +} + +table := tablewriter.NewWriter(os.Stdout) +table.SetHeader([]string{"Date", "Description", "CV2", "Amount"}) +table.SetFooter([]string{"", "", "Total", "$146.93"}) // Add Footer +table.EnableBorder(false) // Set Border to false +table.AppendBulk(data) // Add Bulk Data +table.Render() +``` + +##### Output 2 + +``` + + DATE | DESCRIPTION | CV2 | AMOUNT +-----------+--------------------------+-------+---------- + 1/1/2014 | Domain name | 2233 | $10.98 + 1/1/2014 | January Hosting | 2233 | $54.95 + 1/4/2014 | February Hosting | 2233 | $51.00 + 1/4/2014 | February Extra Bandwidth | 2233 | $30.00 +-----------+--------------------------+-------+---------- + TOTAL | $146 93 + --------+---------- + +``` + +#### Example 3 - CSV + +```go +table, _ := tablewriter.NewCSV(os.Stdout, "testdata/test_info.csv", true) +table.SetAlignment(tablewriter.ALIGN_LEFT) // Set Alignment +table.Render() +``` + +##### Output 3 + +``` ++----------+--------------+------+-----+---------+----------------+ +| FIELD | TYPE | NULL | KEY | DEFAULT | EXTRA | ++----------+--------------+------+-----+---------+----------------+ +| user_id | smallint(5) | NO | PRI | NULL | auto_increment | +| username | varchar(10) | NO | | NULL | | +| password | varchar(100) | NO | | NULL | | ++----------+--------------+------+-----+---------+----------------+ +``` + +#### Example 4 - Custom Separator + +```go +table, _ := tablewriter.NewCSV(os.Stdout, "testdata/test.csv", true) +table.SetRowLine(true) // Enable row line + +// Change table lines +table.SetCenterSeparator("*") +table.SetColumnSeparator("╪") +table.SetRowSeparator("-") + +table.SetAlignment(tablewriter.ALIGN_LEFT) +table.Render() +``` + +##### Output 4 + +``` +*------------*-----------*---------* +╪ FIRST NAME ╪ LAST NAME ╪ SSN ╪ +*------------*-----------*---------* +╪ John ╪ Barry ╪ 123456 ╪ +*------------*-----------*---------* +╪ Kathy ╪ Smith ╪ 687987 ╪ +*------------*-----------*---------* +╪ Bob ╪ McCornick ╪ 3979870 ╪ +*------------*-----------*---------* +``` + +#### Example 5 - Markdown Format + +```go +data := [][]string{ +[]string{"1/1/2014", "Domain name", "2233", "$10.98"}, +[]string{"1/1/2014", "January Hosting", "2233", "$54.95"}, +[]string{"1/4/2014", "February Hosting", "2233", "$51.00"}, +[]string{"1/4/2014", "February Extra Bandwidth", "2233", "$30.00"}, +} + +table := tablewriter.NewWriter(os.Stdout) +table.SetHeader([]string{"Date", "Description", "CV2", "Amount"}) +table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false}) +table.SetCenterSeparator("|") +table.AppendBulk(data) // Add Bulk Data +table.Render() +``` + +##### Output 5 + +``` +| DATE | DESCRIPTION | CV2 | AMOUNT | +|----------|--------------------------|------|--------| +| 1/1/2014 | Domain name | 2233 | $10.98 | +| 1/1/2014 | January Hosting | 2233 | $54.95 | +| 1/4/2014 | February Hosting | 2233 | $51.00 | +| 1/4/2014 | February Extra Bandwidth | 2233 | $30.00 | +``` + +#### Example 6 - Identical cells merging + +```go +data := [][]string{ +[]string{"1/1/2014", "Domain name", "1234", "$10.98"}, +[]string{"1/1/2014", "January Hosting", "2345", "$54.95"}, +[]string{"1/4/2014", "February Hosting", "3456", "$51.00"}, +[]string{"1/4/2014", "February Extra Bandwidth", "4567", "$30.00"}, +} + +table := tablewriter.NewWriter(os.Stdout) +table.SetHeader([]string{"Date", "Description", "CV2", "Amount"}) +table.SetFooter([]string{"", "", "Total", "$146.93"}) +table.SetAutoMergeCells(true) +table.SetRowLine(true) +table.AppendBulk(data) +table.Render() +``` + +##### Output 6 + +``` ++----------+--------------------------+-------+---------+ +| DATE | DESCRIPTION | CV2 | AMOUNT | ++----------+--------------------------+-------+---------+ +| 1/1/2014 | Domain name | 1234 | $10.98 | ++ +--------------------------+-------+---------+ +| | January Hosting | 2345 | $54.95 | ++----------+--------------------------+-------+---------+ +| 1/4/2014 | February Hosting | 3456 | $51.00 | ++ +--------------------------+-------+---------+ +| | February Extra Bandwidth | 4567 | $30.00 | ++----------+--------------------------+-------+---------+ +| TOTAL | $146 93 | ++----------+--------------------------+-------+---------+ +``` + +#### Example 7 - Identical cells merging (specify the column index to merge) + +```go +data := [][]string{ +[]string{"1/1/2014", "Domain name", "1234", "$10.98"}, +[]string{"1/1/2014", "January Hosting", "1234", "$10.98"}, +[]string{"1/4/2014", "February Hosting", "3456", "$51.00"}, +[]string{"1/4/2014", "February Extra Bandwidth", "4567", "$30.00"}, +} + +table := tablewriter.NewWriter(os.Stdout) +table.SetHeader([]string{"Date", "Description", "CV2", "Amount"}) +table.SetFooter([]string{"", "", "Total", "$146.93"}) +table.SetAutoMergeCellsByColumnIndex([]int{2, 3}) +table.SetRowLine(true) +table.AppendBulk(data) +table.Render() +``` + +##### Output 7 + +``` ++----------+--------------------------+-------+---------+ +| DATE | DESCRIPTION | CV2 | AMOUNT | ++----------+--------------------------+-------+---------+ +| 1/1/2014 | Domain name | 1234 | $10.98 | ++----------+--------------------------+ + + +| 1/1/2014 | January Hosting | | | ++----------+--------------------------+-------+---------+ +| 1/4/2014 | February Hosting | 3456 | $51.00 | ++----------+--------------------------+-------+---------+ +| 1/4/2014 | February Extra Bandwidth | 4567 | $30.00 | ++----------+--------------------------+-------+---------+ +| TOTAL | $146.93 | ++----------+--------------------------+-------+---------+ +``` + +#### Table with color + +```go +data := [][]string{ +[]string{"1/1/2014", "Domain name", "2233", "$10.98"}, +[]string{"1/1/2014", "January Hosting", "2233", "$54.95"}, +[]string{"1/4/2014", "February Hosting", "2233", "$51.00"}, +[]string{"1/4/2014", "February Extra Bandwidth", "2233", "$30.00"}, +} + +table := tablewriter.NewWriter(os.Stdout) +table.SetHeader([]string{"Date", "Description", "CV2", "Amount"}) +table.SetFooter([]string{"", "", "Total", "$146.93"}) // Add Footer +table.EnableBorder(false) // Set Border to false + +table.SetHeaderColor(tablewriter.Colors{tablewriter.Bold, tablewriter.BgGreenColor}, +tablewriter.Colors{tablewriter.FgHiRedColor, tablewriter.Bold, tablewriter.BgBlackColor}, +tablewriter.Colors{tablewriter.BgRedColor, tablewriter.FgWhiteColor}, +tablewriter.Colors{tablewriter.BgCyanColor, tablewriter.FgWhiteColor}) + +table.SetColumnColor(tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiBlackColor}, +tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiRedColor}, +tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiBlackColor}, +tablewriter.Colors{tablewriter.Bold, tablewriter.FgBlackColor}) + +table.SetFooterColor(tablewriter.Colors{}, tablewriter.Colors{}, +tablewriter.Colors{tablewriter.Bold}, +tablewriter.Colors{tablewriter.FgHiRedColor}) + +table.AppendBulk(data) +table.Render() +``` + +#### Table with color Output + +![Table with Color](https://cloud.githubusercontent.com/assets/6460392/21101956/bbc7b356-c0a1-11e6-9f36-dba694746efc.png) + +#### Example - 8 Table Cells with Color + +Individual Cell Colors from `func Rich` take precedence over Column Colors + +```go +data := [][]string{ +[]string{"Test1Merge", "HelloCol2 - 1", "HelloCol3 - 1", "HelloCol4 - 1"}, +[]string{"Test1Merge", "HelloCol2 - 2", "HelloCol3 - 2", "HelloCol4 - 2"}, +[]string{"Test1Merge", "HelloCol2 - 3", "HelloCol3 - 3", "HelloCol4 - 3"}, +[]string{"Test2Merge", "HelloCol2 - 4", "HelloCol3 - 4", "HelloCol4 - 4"}, +[]string{"Test2Merge", "HelloCol2 - 5", "HelloCol3 - 5", "HelloCol4 - 5"}, +[]string{"Test2Merge", "HelloCol2 - 6", "HelloCol3 - 6", "HelloCol4 - 6"}, +[]string{"Test2Merge", "HelloCol2 - 7", "HelloCol3 - 7", "HelloCol4 - 7"}, +[]string{"Test3Merge", "HelloCol2 - 8", "HelloCol3 - 8", "HelloCol4 - 8"}, +[]string{"Test3Merge", "HelloCol2 - 9", "HelloCol3 - 9", "HelloCol4 - 9"}, +[]string{"Test3Merge", "HelloCol2 - 10", "HelloCol3 -10", "HelloCol4 - 10"}, +} + +table := tablewriter.NewWriter(os.Stdout) +table.SetHeader([]string{"Col1", "Col2", "Col3", "Col4"}) +table.SetFooter([]string{"", "", "Footer3", "Footer4"}) +table.EnableBorder(false) + +table.SetHeaderColor(tablewriter.Colors{tablewriter.Bold, tablewriter.BgGreenColor}, +tablewriter.Colors{tablewriter.FgHiRedColor, tablewriter.Bold, tablewriter.BgBlackColor}, +tablewriter.Colors{tablewriter.BgRedColor, tablewriter.FgWhiteColor}, +tablewriter.Colors{tablewriter.BgCyanColor, tablewriter.FgWhiteColor}) + +table.SetColumnColor(tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiBlackColor}, +tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiRedColor}, +tablewriter.Colors{tablewriter.Bold, tablewriter.FgHiBlackColor}, +tablewriter.Colors{tablewriter.Bold, tablewriter.FgBlackColor}) + +table.SetFooterColor(tablewriter.Colors{}, tablewriter.Colors{}, +tablewriter.Colors{tablewriter.Bold}, +tablewriter.Colors{tablewriter.FgHiRedColor}) + +colorData1 := []string{"TestCOLOR1Merge", "HelloCol2 - COLOR1", "HelloCol3 - COLOR1", "HelloCol4 - COLOR1"} +colorData2 := []string{"TestCOLOR2Merge", "HelloCol2 - COLOR2", "HelloCol3 - COLOR2", "HelloCol4 - COLOR2"} + +for i, row := range data { +if i == 4 { +table.Rich(colorData1, []tablewriter.Colors{tablewriter.Colors{}, tablewriter.Colors{tablewriter.Normal, tablewriter.FgCyanColor}, tablewriter.Colors{tablewriter.Bold, tablewriter.FgWhiteColor}, tablewriter.Colors{}}) +table.Rich(colorData2, []tablewriter.Colors{tablewriter.Colors{tablewriter.Normal, tablewriter.FgMagentaColor}, tablewriter.Colors{}, tablewriter.Colors{tablewriter.Bold, tablewriter.BgRedColor}, tablewriter.Colors{tablewriter.FgHiGreenColor, tablewriter.Italic, tablewriter.BgHiCyanColor}}) +} +table.Append(row) +} + +table.SetAutoMergeCells(true) +table.Render() + +``` + +##### Table cells with color Output + +![Table cells with Color](https://user-images.githubusercontent.com/9064687/63969376-bcd88d80-ca6f-11e9-9466-c3d954700b25.png) + +#### Example 9 - Set table caption + +```go +data := [][]string{ +[]string{"A", "The Good", "500"}, +[]string{"B", "The Very very Bad Man", "288"}, +[]string{"C", "The Ugly", "120"}, +[]string{"D", "The Gopher", "800"}, +} + +table := tablewriter.NewWriter(os.Stdout) +table.SetHeader([]string{"Name", "Sign", "Rating"}) +table.SetCaption(true, "Movie ratings.") + +for _, v := range data { +table.Append(v) +} +table.Render() // Send output +``` + +Note: Caption text will wrap with total width of rendered table. + +##### Output 9 + +``` ++------+-----------------------+--------+ +| NAME | SIGN | RATING | ++------+-----------------------+--------+ +| A | The Good | 500 | +| B | The Very very Bad Man | 288 | +| C | The Ugly | 120 | +| D | The Gopher | 800 | ++------+-----------------------+--------+ +Movie ratings. +``` + +#### Example 10 - Set NoWhiteSpace and TablePadding option + +```go +data := [][]string{ +{"node1.example.com", "Ready", "compute", "1.11"}, +{"node2.example.com", "Ready", "compute", "1.11"}, +{"node3.example.com", "Ready", "compute", "1.11"}, +{"node4.example.com", "NotReady", "compute", "1.11"}, +} + +table := tablewriter.NewWriter(os.Stdout) +table.SetHeader([]string{"Name", "Status", "Role", "Version"}) +table.SetAutoWrapText(false) +table.SetAutoFormatHeaders(true) +table.SetHeaderAlignment(tablewriter.ALIGN_LEFT) +table.SetAlignment(tablewriter.ALIGN_LEFT) +table.SetCenterSeparator("") +table.SetColumnSeparator("") +table.SetRowSeparator("") +table.SetHeaderLine(false) +table.EnableBorder(false) +table.SetTablePadding("\t") // pad with tabs +table.SetNoWhiteSpace(true) +table.AppendBulk(data) // Add Bulk Data +table.Render() +``` + +##### Output 10 + +``` +NAME STATUS ROLE VERSION +node1.example.com Ready compute 1.11 +node2.example.com Ready compute 1.11 +node3.example.com Ready compute 1.11 +node4.example.com NotReady compute 1.11 +``` + +#### Render table into a string + +Instead of rendering the table to `io.Stdout` you can also render it into a string. Go 1.10 introduced the +`strings.Builder` type which implements the `io.Writer` interface and can therefore be used for this task. Example: + +```go +package main + +import ( + "strings" + "fmt" + + "github.com/olekukonko/tablewriter" +) + +func main() { + tableString := &strings.Builder{} + table := tablewriter.NewWriter(tableString) + + /* + * Code to fill the table + */ + + table.Render() + + fmt.Println(tableString.String()) +} +``` + +#### TODO + +- ~~Import Directly from CSV~~ - `done` +- ~~Support for `SetFooter`~~ - `done` +- ~~Support for `SetBorder`~~ - `done` +- ~~Support table with uneven rows~~ - `done` +- ~~Support custom alignment~~ +- General Improvement & Optimisation +- `NewHTML` Parse table from HTML diff --git a/vendor/github.com/olekukonko/tablewriter/config.go b/vendor/github.com/olekukonko/tablewriter/config.go new file mode 100644 index 0000000..94094f1 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/config.go @@ -0,0 +1,960 @@ +package tablewriter + +import ( + "github.com/olekukonko/tablewriter/tw" +) + +// Config represents the table configuration +type Config struct { + MaxWidth int + Header tw.CellConfig + Row tw.CellConfig + Footer tw.CellConfig + Debug bool + Stream tw.StreamConfig + Behavior tw.Behavior + Widths tw.CellWidth +} + +// ConfigBuilder provides a fluent interface for building Config +type ConfigBuilder struct { + config Config +} + +// NewConfigBuilder creates a new ConfigBuilder with defaults +func NewConfigBuilder() *ConfigBuilder { + return &ConfigBuilder{ + config: defaultConfig(), + } +} + +// Build returns the built Config +func (b *ConfigBuilder) Build() Config { + return b.config +} + +// Header returns a HeaderConfigBuilder for header configuration +func (b *ConfigBuilder) Header() *HeaderConfigBuilder { + return &HeaderConfigBuilder{ + parent: b, + config: &b.config.Header, + } +} + +// Row returns a RowConfigBuilder for row configuration +func (b *ConfigBuilder) Row() *RowConfigBuilder { + return &RowConfigBuilder{ + parent: b, + config: &b.config.Row, + } +} + +// Footer returns a FooterConfigBuilder for footer configuration +func (b *ConfigBuilder) Footer() *FooterConfigBuilder { + return &FooterConfigBuilder{ + parent: b, + config: &b.config.Footer, + } +} + +// Behavior returns a BehaviorConfigBuilder for behavior configuration +func (b *ConfigBuilder) Behavior() *BehaviorConfigBuilder { + return &BehaviorConfigBuilder{ + parent: b, + config: &b.config.Behavior, + } +} + +// ForColumn returns a ColumnConfigBuilder for column-specific configuration +func (b *ConfigBuilder) ForColumn(col int) *ColumnConfigBuilder { + return &ColumnConfigBuilder{ + parent: b, + col: col, + } +} + +// WithTrimSpace enables or disables automatic trimming of leading/trailing spaces. +// Ignored in streaming mode. +func (b *ConfigBuilder) WithTrimSpace(state tw.State) *ConfigBuilder { + b.config.Behavior.TrimSpace = state + return b +} + +// WithDebug enables/disables debug logging +func (b *ConfigBuilder) WithDebug(debug bool) *ConfigBuilder { + b.config.Debug = debug + return b +} + +// WithAutoHide enables or disables automatic hiding of empty columns (ignored in streaming mode). +func (b *ConfigBuilder) WithAutoHide(state tw.State) *ConfigBuilder { + b.config.Behavior.AutoHide = state + return b +} + +// WithFooterAlignment sets the text alignment for all footer cells. +// Invalid alignments are ignored. +func (b *ConfigBuilder) WithFooterAlignment(align tw.Align) *ConfigBuilder { + if align != tw.AlignLeft && align != tw.AlignRight && align != tw.AlignCenter && align != tw.AlignNone { + return b + } + b.config.Footer.Alignment.Global = align + return b +} + +// WithFooterAutoFormat enables or disables automatic formatting (e.g., title case) for footer cells. +func (b *ConfigBuilder) WithFooterAutoFormat(autoFormat tw.State) *ConfigBuilder { + b.config.Footer.Formatting.AutoFormat = autoFormat + return b +} + +// WithFooterAutoWrap sets the wrapping behavior for footer cells (e.g., truncate, normal, break). +// Invalid wrap modes are ignored. +func (b *ConfigBuilder) WithFooterAutoWrap(autoWrap int) *ConfigBuilder { + if autoWrap < tw.WrapNone || autoWrap > tw.WrapBreak { + return b + } + b.config.Footer.Formatting.AutoWrap = autoWrap + return b +} + +// WithFooterGlobalPadding sets the global padding for all footer cells. +func (b *ConfigBuilder) WithFooterGlobalPadding(padding tw.Padding) *ConfigBuilder { + b.config.Footer.Padding.Global = padding + return b +} + +// WithFooterMaxWidth sets the maximum content width for footer cells. +// Negative values are ignored. +func (b *ConfigBuilder) WithFooterMaxWidth(maxWidth int) *ConfigBuilder { + if maxWidth < 0 { + return b + } + b.config.Footer.ColMaxWidths.Global = maxWidth + return b +} + +// WithFooterMergeMode sets the merge behavior for footer cells (e.g., horizontal, hierarchical). +// Invalid merge modes are ignored. +func (b *ConfigBuilder) WithFooterMergeMode(mergeMode int) *ConfigBuilder { + if mergeMode < tw.MergeNone || mergeMode > tw.MergeHierarchical { + return b + } + b.config.Footer.Formatting.MergeMode = mergeMode + return b +} + +// WithHeaderAlignment sets the text alignment for all header cells. +// Invalid alignments are ignored. +func (b *ConfigBuilder) WithHeaderAlignment(align tw.Align) *ConfigBuilder { + if align != tw.AlignLeft && align != tw.AlignRight && align != tw.AlignCenter && align != tw.AlignNone { + return b + } + b.config.Header.Alignment.Global = align + return b +} + +// WithHeaderAutoFormat enables or disables automatic formatting (e.g., title case) for header cells. +func (b *ConfigBuilder) WithHeaderAutoFormat(autoFormat tw.State) *ConfigBuilder { + b.config.Header.Formatting.AutoFormat = autoFormat + return b +} + +// WithHeaderAutoWrap sets the wrapping behavior for header cells (e.g., truncate, normal). +// Invalid wrap modes are ignored. +func (b *ConfigBuilder) WithHeaderAutoWrap(autoWrap int) *ConfigBuilder { + if autoWrap < tw.WrapNone || autoWrap > tw.WrapBreak { + return b + } + b.config.Header.Formatting.AutoWrap = autoWrap + return b +} + +// WithHeaderGlobalPadding sets the global padding for all header cells. +func (b *ConfigBuilder) WithHeaderGlobalPadding(padding tw.Padding) *ConfigBuilder { + b.config.Header.Padding.Global = padding + return b +} + +// WithHeaderMaxWidth sets the maximum content width for header cells. +// Negative values are ignored. +func (b *ConfigBuilder) WithHeaderMaxWidth(maxWidth int) *ConfigBuilder { + if maxWidth < 0 { + return b + } + b.config.Header.ColMaxWidths.Global = maxWidth + return b +} + +// WithHeaderMergeMode sets the merge behavior for header cells (e.g., horizontal, vertical). +// Invalid merge modes are ignored. +func (b *ConfigBuilder) WithHeaderMergeMode(mergeMode int) *ConfigBuilder { + if mergeMode < tw.MergeNone || mergeMode > tw.MergeHierarchical { + return b + } + b.config.Header.Formatting.MergeMode = mergeMode + return b +} + +// WithMaxWidth sets the maximum width for the entire table (0 means unlimited). +// Negative values are treated as 0. +func (b *ConfigBuilder) WithMaxWidth(width int) *ConfigBuilder { + if width < 0 { + b.config.MaxWidth = 0 + } else { + b.config.MaxWidth = width + } + return b +} + +// WithRowAlignment sets the text alignment for all row cells. +// Invalid alignments are ignored. +func (b *ConfigBuilder) WithRowAlignment(align tw.Align) *ConfigBuilder { + if align != tw.AlignLeft && align != tw.AlignRight && align != tw.AlignCenter && align != tw.AlignNone { + return b + } + b.config.Row.Alignment.Global = align + return b +} + +// WithRowAutoFormat enables or disables automatic formatting for row cells. +func (b *ConfigBuilder) WithRowAutoFormat(autoFormat tw.State) *ConfigBuilder { + b.config.Row.Formatting.AutoFormat = autoFormat + return b +} + +// WithRowAutoWrap sets the wrapping behavior for row cells (e.g., truncate, normal). +// Invalid wrap modes are ignored. +func (b *ConfigBuilder) WithRowAutoWrap(autoWrap int) *ConfigBuilder { + if autoWrap < tw.WrapNone || autoWrap > tw.WrapBreak { + return b + } + b.config.Row.Formatting.AutoWrap = autoWrap + return b +} + +// WithRowGlobalPadding sets the global padding for all row cells. +func (b *ConfigBuilder) WithRowGlobalPadding(padding tw.Padding) *ConfigBuilder { + b.config.Row.Padding.Global = padding + return b +} + +// WithRowMaxWidth sets the maximum content width for row cells. +// Negative values are ignored. +func (b *ConfigBuilder) WithRowMaxWidth(maxWidth int) *ConfigBuilder { + if maxWidth < 0 { + return b + } + b.config.Row.ColMaxWidths.Global = maxWidth + return b +} + +// WithRowMergeMode sets the merge behavior for row cells (e.g., horizontal, hierarchical). +// Invalid merge modes are ignored. +func (b *ConfigBuilder) WithRowMergeMode(mergeMode int) *ConfigBuilder { + if mergeMode < tw.MergeNone || mergeMode > tw.MergeHierarchical { + return b + } + b.config.Row.Formatting.MergeMode = mergeMode + return b +} + +// HeaderConfigBuilder configures header settings +type HeaderConfigBuilder struct { + parent *ConfigBuilder + config *tw.CellConfig +} + +// Build returns the parent ConfigBuilder +func (h *HeaderConfigBuilder) Build() *ConfigBuilder { + return h.parent +} + +// Alignment returns an AlignmentConfigBuilder for header alignment +func (h *HeaderConfigBuilder) Alignment() *AlignmentConfigBuilder { + return &AlignmentConfigBuilder{ + parent: h.parent, + config: &h.config.Alignment, + section: "header", + } +} + +// Formatting returns a HeaderFormattingBuilder for header formatting +func (h *HeaderConfigBuilder) Formatting() *HeaderFormattingBuilder { + return &HeaderFormattingBuilder{ + parent: h, + config: &h.config.Formatting, + section: "header", + } +} + +// Padding returns a HeaderPaddingBuilder for header padding +func (h *HeaderConfigBuilder) Padding() *HeaderPaddingBuilder { + return &HeaderPaddingBuilder{ + parent: h, + config: &h.config.Padding, + section: "header", + } +} + +// Filter returns a HeaderFilterBuilder for header filtering +func (h *HeaderConfigBuilder) Filter() *HeaderFilterBuilder { + return &HeaderFilterBuilder{ + parent: h, + config: &h.config.Filter, + section: "header", + } +} + +// Callbacks returns a HeaderCallbacksBuilder for header callbacks +func (h *HeaderConfigBuilder) Callbacks() *HeaderCallbacksBuilder { + return &HeaderCallbacksBuilder{ + parent: h, + config: &h.config.Callbacks, + section: "header", + } +} + +// RowConfigBuilder configures row settings +type RowConfigBuilder struct { + parent *ConfigBuilder + config *tw.CellConfig +} + +// Build returns the parent ConfigBuilder +func (r *RowConfigBuilder) Build() *ConfigBuilder { + return r.parent +} + +// Alignment returns an AlignmentConfigBuilder for row alignment +func (r *RowConfigBuilder) Alignment() *AlignmentConfigBuilder { + return &AlignmentConfigBuilder{ + parent: r.parent, + config: &r.config.Alignment, + section: "row", + } +} + +// Formatting returns a RowFormattingBuilder for row formatting +func (r *RowConfigBuilder) Formatting() *RowFormattingBuilder { + return &RowFormattingBuilder{ + parent: r, + config: &r.config.Formatting, + section: "row", + } +} + +// Padding returns a RowPaddingBuilder for row padding +func (r *RowConfigBuilder) Padding() *RowPaddingBuilder { + return &RowPaddingBuilder{ + parent: r, + config: &r.config.Padding, + section: "row", + } +} + +// Filter returns a RowFilterBuilder for row filtering +func (r *RowConfigBuilder) Filter() *RowFilterBuilder { + return &RowFilterBuilder{ + parent: r, + config: &r.config.Filter, + section: "row", + } +} + +// Callbacks returns a RowCallbacksBuilder for row callbacks +func (r *RowConfigBuilder) Callbacks() *RowCallbacksBuilder { + return &RowCallbacksBuilder{ + parent: r, + config: &r.config.Callbacks, + section: "row", + } +} + +// FooterConfigBuilder configures footer settings +type FooterConfigBuilder struct { + parent *ConfigBuilder + config *tw.CellConfig +} + +// Build returns the parent ConfigBuilder +func (f *FooterConfigBuilder) Build() *ConfigBuilder { + return f.parent +} + +// Alignment returns an AlignmentConfigBuilder for footer alignment +func (f *FooterConfigBuilder) Alignment() *AlignmentConfigBuilder { + return &AlignmentConfigBuilder{ + parent: f.parent, + config: &f.config.Alignment, + section: "footer", + } +} + +// Formatting returns a FooterFormattingBuilder for footer formatting +func (f *FooterConfigBuilder) Formatting() *FooterFormattingBuilder { + return &FooterFormattingBuilder{ + parent: f, + config: &f.config.Formatting, + section: "footer", + } +} + +// Padding returns a FooterPaddingBuilder for footer padding +func (f *FooterConfigBuilder) Padding() *FooterPaddingBuilder { + return &FooterPaddingBuilder{ + parent: f, + config: &f.config.Padding, + section: "footer", + } +} + +// Filter returns a FooterFilterBuilder for footer filtering +func (f *FooterConfigBuilder) Filter() *FooterFilterBuilder { + return &FooterFilterBuilder{ + parent: f, + config: &f.config.Filter, + section: "footer", + } +} + +// Callbacks returns a FooterCallbacksBuilder for footer callbacks +func (f *FooterConfigBuilder) Callbacks() *FooterCallbacksBuilder { + return &FooterCallbacksBuilder{ + parent: f, + config: &f.config.Callbacks, + section: "footer", + } +} + +// AlignmentConfigBuilder configures alignment settings +type AlignmentConfigBuilder struct { + parent *ConfigBuilder + config *tw.CellAlignment + section string +} + +// Build returns the parent ConfigBuilder +func (a *AlignmentConfigBuilder) Build() *ConfigBuilder { + return a.parent +} + +// WithGlobal sets global alignment +func (a *AlignmentConfigBuilder) WithGlobal(align tw.Align) *AlignmentConfigBuilder { + if err := align.Validate(); err == nil { + a.config.Global = align + } + return a +} + +// WithPerColumn sets per-column alignments +func (a *AlignmentConfigBuilder) WithPerColumn(alignments []tw.Align) *AlignmentConfigBuilder { + if len(alignments) > 0 { + a.config.PerColumn = alignments + } + return a +} + +// HeaderFormattingBuilder configures header formatting +type HeaderFormattingBuilder struct { + parent *HeaderConfigBuilder + config *tw.CellFormatting + section string +} + +// Build returns the parent HeaderConfigBuilder +func (hf *HeaderFormattingBuilder) Build() *HeaderConfigBuilder { + return hf.parent +} + +// WithAutoFormat enables/disables auto formatting +func (hf *HeaderFormattingBuilder) WithAutoFormat(autoFormat tw.State) *HeaderFormattingBuilder { + hf.config.AutoFormat = autoFormat + return hf +} + +// WithAutoWrap sets auto wrap mode +func (hf *HeaderFormattingBuilder) WithAutoWrap(autoWrap int) *HeaderFormattingBuilder { + if autoWrap >= tw.WrapNone && autoWrap <= tw.WrapBreak { + hf.config.AutoWrap = autoWrap + } + return hf +} + +// WithMergeMode sets merge mode +func (hf *HeaderFormattingBuilder) WithMergeMode(mergeMode int) *HeaderFormattingBuilder { + if mergeMode >= tw.MergeNone && mergeMode <= tw.MergeHierarchical { + hf.config.MergeMode = mergeMode + } + return hf +} + +// RowFormattingBuilder configures row formatting +type RowFormattingBuilder struct { + parent *RowConfigBuilder + config *tw.CellFormatting + section string +} + +// Build returns the parent RowConfigBuilder +func (rf *RowFormattingBuilder) Build() *RowConfigBuilder { + return rf.parent +} + +// WithAutoFormat enables/disables auto formatting +func (rf *RowFormattingBuilder) WithAutoFormat(autoFormat tw.State) *RowFormattingBuilder { + rf.config.AutoFormat = autoFormat + return rf +} + +// WithAutoWrap sets auto wrap mode +func (rf *RowFormattingBuilder) WithAutoWrap(autoWrap int) *RowFormattingBuilder { + if autoWrap >= tw.WrapNone && autoWrap <= tw.WrapBreak { + rf.config.AutoWrap = autoWrap + } + return rf +} + +// WithMergeMode sets merge mode +func (rf *RowFormattingBuilder) WithMergeMode(mergeMode int) *RowFormattingBuilder { + if mergeMode >= tw.MergeNone && mergeMode <= tw.MergeHierarchical { + rf.config.MergeMode = mergeMode + } + return rf +} + +// FooterFormattingBuilder configures footer formatting +type FooterFormattingBuilder struct { + parent *FooterConfigBuilder + config *tw.CellFormatting + section string +} + +// Build returns the parent FooterConfigBuilder +func (ff *FooterFormattingBuilder) Build() *FooterConfigBuilder { + return ff.parent +} + +// WithAutoFormat enables/disables auto formatting +func (ff *FooterFormattingBuilder) WithAutoFormat(autoFormat tw.State) *FooterFormattingBuilder { + ff.config.AutoFormat = autoFormat + return ff +} + +// WithAutoWrap sets auto wrap mode +func (ff *FooterFormattingBuilder) WithAutoWrap(autoWrap int) *FooterFormattingBuilder { + if autoWrap >= tw.WrapNone && autoWrap <= tw.WrapBreak { + ff.config.AutoWrap = autoWrap + } + return ff +} + +// WithMergeMode sets merge mode +func (ff *FooterFormattingBuilder) WithMergeMode(mergeMode int) *FooterFormattingBuilder { + if mergeMode >= tw.MergeNone && mergeMode <= tw.MergeHierarchical { + ff.config.MergeMode = mergeMode + } + return ff +} + +// HeaderPaddingBuilder configures header padding +type HeaderPaddingBuilder struct { + parent *HeaderConfigBuilder + config *tw.CellPadding + section string +} + +// Build returns the parent HeaderConfigBuilder +func (hp *HeaderPaddingBuilder) Build() *HeaderConfigBuilder { + return hp.parent +} + +// WithGlobal sets global padding +func (hp *HeaderPaddingBuilder) WithGlobal(padding tw.Padding) *HeaderPaddingBuilder { + hp.config.Global = padding + return hp +} + +// WithPerColumn sets per-column padding +func (hp *HeaderPaddingBuilder) WithPerColumn(padding []tw.Padding) *HeaderPaddingBuilder { + hp.config.PerColumn = padding + return hp +} + +// AddColumnPadding adds padding for a specific column in the header +func (hp *HeaderPaddingBuilder) AddColumnPadding(padding tw.Padding) *HeaderPaddingBuilder { + hp.config.PerColumn = append(hp.config.PerColumn, padding) + return hp +} + +// RowPaddingBuilder configures row padding +type RowPaddingBuilder struct { + parent *RowConfigBuilder + config *tw.CellPadding + section string +} + +// Build returns the parent RowConfigBuilder +func (rp *RowPaddingBuilder) Build() *RowConfigBuilder { + return rp.parent +} + +// WithGlobal sets global padding +func (rp *RowPaddingBuilder) WithGlobal(padding tw.Padding) *RowPaddingBuilder { + rp.config.Global = padding + return rp +} + +// WithPerColumn sets per-column padding +func (rp *RowPaddingBuilder) WithPerColumn(padding []tw.Padding) *RowPaddingBuilder { + rp.config.PerColumn = padding + return rp +} + +// AddColumnPadding adds padding for a specific column in the rows +func (rp *RowPaddingBuilder) AddColumnPadding(padding tw.Padding) *RowPaddingBuilder { + rp.config.PerColumn = append(rp.config.PerColumn, padding) + return rp +} + +// FooterPaddingBuilder configures footer padding +type FooterPaddingBuilder struct { + parent *FooterConfigBuilder + config *tw.CellPadding + section string +} + +// Build returns the parent FooterConfigBuilder +func (fp *FooterPaddingBuilder) Build() *FooterConfigBuilder { + return fp.parent +} + +// WithGlobal sets global padding +func (fp *FooterPaddingBuilder) WithGlobal(padding tw.Padding) *FooterPaddingBuilder { + fp.config.Global = padding + return fp +} + +// WithPerColumn sets per-column padding +func (fp *FooterPaddingBuilder) WithPerColumn(padding []tw.Padding) *FooterPaddingBuilder { + fp.config.PerColumn = padding + return fp +} + +// AddColumnPadding adds padding for a specific column in the footer +func (fp *FooterPaddingBuilder) AddColumnPadding(padding tw.Padding) *FooterPaddingBuilder { + fp.config.PerColumn = append(fp.config.PerColumn, padding) + return fp +} + +// BehaviorConfigBuilder configures behavior settings +type BehaviorConfigBuilder struct { + parent *ConfigBuilder + config *tw.Behavior +} + +// Build returns the parent ConfigBuilder +func (bb *BehaviorConfigBuilder) Build() *ConfigBuilder { + return bb.parent +} + +// WithAutoHide enables/disables auto-hide +func (bb *BehaviorConfigBuilder) WithAutoHide(state tw.State) *BehaviorConfigBuilder { + bb.config.AutoHide = state + return bb +} + +// WithTrimSpace enables/disables trim space +func (bb *BehaviorConfigBuilder) WithTrimSpace(state tw.State) *BehaviorConfigBuilder { + bb.config.TrimSpace = state + return bb +} + +// WithHeaderHide enables/disables header visibility +func (bb *BehaviorConfigBuilder) WithHeaderHide(state tw.State) *BehaviorConfigBuilder { + bb.config.Header.Hide = state + return bb +} + +// WithFooterHide enables/disables footer visibility +func (bb *BehaviorConfigBuilder) WithFooterHide(state tw.State) *BehaviorConfigBuilder { + bb.config.Footer.Hide = state + return bb +} + +// WithCompactMerge enables/disables compact width optimization for merged cells +func (bb *BehaviorConfigBuilder) WithCompactMerge(state tw.State) *BehaviorConfigBuilder { + bb.config.Compact.Merge = state + return bb +} + +// ColumnConfigBuilder configures column-specific settings +type ColumnConfigBuilder struct { + parent *ConfigBuilder + col int +} + +// Build returns the parent ConfigBuilder +func (c *ColumnConfigBuilder) Build() *ConfigBuilder { + return c.parent +} + +// WithAlignment sets alignment for the column +func (c *ColumnConfigBuilder) WithAlignment(align tw.Align) *ColumnConfigBuilder { + if err := align.Validate(); err == nil { + // Ensure slices are large enough + if len(c.parent.config.Header.Alignment.PerColumn) <= c.col { + newAligns := make([]tw.Align, c.col+1) + copy(newAligns, c.parent.config.Header.Alignment.PerColumn) + c.parent.config.Header.Alignment.PerColumn = newAligns + } + c.parent.config.Header.Alignment.PerColumn[c.col] = align + + if len(c.parent.config.Row.Alignment.PerColumn) <= c.col { + newAligns := make([]tw.Align, c.col+1) + copy(newAligns, c.parent.config.Row.Alignment.PerColumn) + c.parent.config.Row.Alignment.PerColumn = newAligns + } + c.parent.config.Row.Alignment.PerColumn[c.col] = align + + if len(c.parent.config.Footer.Alignment.PerColumn) <= c.col { + newAligns := make([]tw.Align, c.col+1) + copy(newAligns, c.parent.config.Footer.Alignment.PerColumn) + c.parent.config.Footer.Alignment.PerColumn = newAligns + } + c.parent.config.Footer.Alignment.PerColumn[c.col] = align + } + return c +} + +// WithMaxWidth sets max width for the column +func (c *ColumnConfigBuilder) WithMaxWidth(width int) *ColumnConfigBuilder { + if width >= 0 { + // Initialize maps if needed + if c.parent.config.Header.ColMaxWidths.PerColumn == nil { + c.parent.config.Header.ColMaxWidths.PerColumn = make(tw.Mapper[int, int]) + c.parent.config.Row.ColMaxWidths.PerColumn = make(tw.Mapper[int, int]) + c.parent.config.Footer.ColMaxWidths.PerColumn = make(tw.Mapper[int, int]) + } + c.parent.config.Header.ColMaxWidths.PerColumn[c.col] = width + c.parent.config.Row.ColMaxWidths.PerColumn[c.col] = width + c.parent.config.Footer.ColMaxWidths.PerColumn[c.col] = width + } + return c +} + +// HeaderFilterBuilder configures header filtering +type HeaderFilterBuilder struct { + parent *HeaderConfigBuilder + config *tw.CellFilter + section string +} + +// Build returns the parent HeaderConfigBuilder +func (hf *HeaderFilterBuilder) Build() *HeaderConfigBuilder { + return hf.parent +} + +// WithGlobal sets the global filter function for the header +func (hf *HeaderFilterBuilder) WithGlobal(filter func([]string) []string) *HeaderFilterBuilder { + if filter != nil { + hf.config.Global = filter + } + return hf +} + +// WithPerColumn sets per-column filter functions for the header +func (hf *HeaderFilterBuilder) WithPerColumn(filters []func(string) string) *HeaderFilterBuilder { + if len(filters) > 0 { + hf.config.PerColumn = filters + } + return hf +} + +// AddColumnFilter adds a filter function for a specific column in the header +func (hf *HeaderFilterBuilder) AddColumnFilter(filter func(string) string) *HeaderFilterBuilder { + if filter != nil { + hf.config.PerColumn = append(hf.config.PerColumn, filter) + } + return hf +} + +// RowFilterBuilder configures row filtering +type RowFilterBuilder struct { + parent *RowConfigBuilder + config *tw.CellFilter + section string +} + +// Build returns the parent RowConfigBuilder +func (rf *RowFilterBuilder) Build() *RowConfigBuilder { + return rf.parent +} + +// WithGlobal sets the global filter function for the rows +func (rf *RowFilterBuilder) WithGlobal(filter func([]string) []string) *RowFilterBuilder { + if filter != nil { + rf.config.Global = filter + } + return rf +} + +// WithPerColumn sets per-column filter functions for the rows +func (rf *RowFilterBuilder) WithPerColumn(filters []func(string) string) *RowFilterBuilder { + if len(filters) > 0 { + rf.config.PerColumn = filters + } + return rf +} + +// AddColumnFilter adds a filter function for a specific column in the rows +func (rf *RowFilterBuilder) AddColumnFilter(filter func(string) string) *RowFilterBuilder { + if filter != nil { + rf.config.PerColumn = append(rf.config.PerColumn, filter) + } + return rf +} + +// FooterFilterBuilder configures footer filtering +type FooterFilterBuilder struct { + parent *FooterConfigBuilder + config *tw.CellFilter + section string +} + +// Build returns the parent FooterConfigBuilder +func (ff *FooterFilterBuilder) Build() *FooterConfigBuilder { + return ff.parent +} + +// WithGlobal sets the global filter function for the footer +func (ff *FooterFilterBuilder) WithGlobal(filter func([]string) []string) *FooterFilterBuilder { + if filter != nil { + ff.config.Global = filter + } + return ff +} + +// WithPerColumn sets per-column filter functions for the footer +func (ff *FooterFilterBuilder) WithPerColumn(filters []func(string) string) *FooterFilterBuilder { + if len(filters) > 0 { + ff.config.PerColumn = filters + } + return ff +} + +// AddColumnFilter adds a filter function for a specific column in the footer +func (ff *FooterFilterBuilder) AddColumnFilter(filter func(string) string) *FooterFilterBuilder { + if filter != nil { + ff.config.PerColumn = append(ff.config.PerColumn, filter) + } + return ff +} + +// HeaderCallbacksBuilder configures header callbacks +type HeaderCallbacksBuilder struct { + parent *HeaderConfigBuilder + config *tw.CellCallbacks + section string +} + +// Build returns the parent HeaderConfigBuilder +func (hc *HeaderCallbacksBuilder) Build() *HeaderConfigBuilder { + return hc.parent +} + +// WithGlobal sets the global callback function for the header +func (hc *HeaderCallbacksBuilder) WithGlobal(callback func()) *HeaderCallbacksBuilder { + if callback != nil { + hc.config.Global = callback + } + return hc +} + +// WithPerColumn sets per-column callback functions for the header +func (hc *HeaderCallbacksBuilder) WithPerColumn(callbacks []func()) *HeaderCallbacksBuilder { + if len(callbacks) > 0 { + hc.config.PerColumn = callbacks + } + return hc +} + +// AddColumnCallback adds a callback function for a specific column in the header +func (hc *HeaderCallbacksBuilder) AddColumnCallback(callback func()) *HeaderCallbacksBuilder { + if callback != nil { + hc.config.PerColumn = append(hc.config.PerColumn, callback) + } + return hc +} + +// RowCallbacksBuilder configures row callbacks +type RowCallbacksBuilder struct { + parent *RowConfigBuilder + config *tw.CellCallbacks + section string +} + +// Build returns the parent RowConfigBuilder +func (rc *RowCallbacksBuilder) Build() *RowConfigBuilder { + return rc.parent +} + +// WithGlobal sets the global callback function for the rows +func (rc *RowCallbacksBuilder) WithGlobal(callback func()) *RowCallbacksBuilder { + if callback != nil { + rc.config.Global = callback + } + return rc +} + +// WithPerColumn sets per-column callback functions for the rows +func (rc *RowCallbacksBuilder) WithPerColumn(callbacks []func()) *RowCallbacksBuilder { + if len(callbacks) > 0 { + rc.config.PerColumn = callbacks + } + return rc +} + +// AddColumnCallback adds a callback function for a specific column in the rows +func (rc *RowCallbacksBuilder) AddColumnCallback(callback func()) *RowCallbacksBuilder { + if callback != nil { + rc.config.PerColumn = append(rc.config.PerColumn, callback) + } + return rc +} + +// FooterCallbacksBuilder configures footer callbacks +type FooterCallbacksBuilder struct { + parent *FooterConfigBuilder + config *tw.CellCallbacks + section string +} + +// Build returns the parent FooterConfigBuilder +func (fc *FooterCallbacksBuilder) Build() *FooterConfigBuilder { + return fc.parent +} + +// WithGlobal sets the global callback function for the footer +func (fc *FooterCallbacksBuilder) WithGlobal(callback func()) *FooterCallbacksBuilder { + if callback != nil { + fc.config.Global = callback + } + return fc +} + +// WithPerColumn sets per-column callback functions for the footer +func (fc *FooterCallbacksBuilder) WithPerColumn(callbacks []func()) *FooterCallbacksBuilder { + if len(callbacks) > 0 { + fc.config.PerColumn = callbacks + } + return fc +} + +// AddColumnCallback adds a callback function for a specific column in the footer +func (fc *FooterCallbacksBuilder) AddColumnCallback(callback func()) *FooterCallbacksBuilder { + if callback != nil { + fc.config.PerColumn = append(fc.config.PerColumn, callback) + } + return fc +} diff --git a/vendor/github.com/olekukonko/tablewriter/csv.go b/vendor/github.com/olekukonko/tablewriter/csv.go index 9887830..0426320 100644 --- a/vendor/github.com/olekukonko/tablewriter/csv.go +++ b/vendor/github.com/olekukonko/tablewriter/csv.go @@ -1,10 +1,3 @@ -// Copyright 2014 Oleku Konko All rights reserved. -// Use of this source code is governed by a MIT -// license that can be found in the LICENSE file. - -// This module is a Table Writer API for the Go Programming Language. -// The protocols were written in pure Go and works on windows and unix systems - package tablewriter import ( @@ -13,40 +6,89 @@ import ( "os" ) -// Start A new table by importing from a CSV file +// NewCSV Start A new table by importing from a CSV file // Takes io.Writer and csv File name -func NewCSV(writer io.Writer, fileName string, hasHeader bool) (*Table, error) { +func NewCSV(writer io.Writer, fileName string, hasHeader bool, opts ...Option) (*Table, error) { + // Open the CSV file file, err := os.Open(fileName) if err != nil { - return &Table{}, err + // Log implicitly handled by NewTable if logger is configured via opts + return nil, err // Return nil *Table on error } - defer file.Close() + defer file.Close() // Ensure file is closed + + // Create a CSV reader csvReader := csv.NewReader(file) - t, err := NewCSVReader(writer, csvReader, hasHeader) - return t, err + + // Delegate to NewCSVReader, passing through the options + return NewCSVReader(writer, csvReader, hasHeader, opts...) } -// Start a New Table Writer with csv.Reader +// NewCSVReader Start a New Table Writer with csv.Reader // This enables customisation such as reader.Comma = ';' // See http://golang.org/src/pkg/encoding/csv/reader.go?s=3213:3671#L94 -func NewCSVReader(writer io.Writer, csvReader *csv.Reader, hasHeader bool) (*Table, error) { - t := NewWriter(writer) +func NewCSVReader(writer io.Writer, csvReader *csv.Reader, hasHeader bool, opts ...Option) (*Table, error) { + // Create a new table instance using the modern API and provided options. + // Options configure the table's appearance and behavior (renderer, borders, etc.). + t := NewTable(writer, opts...) // Logger setup happens here if WithLogger/WithDebug is passed + + // Process header row if specified if hasHeader { - // Read the first row headers, err := csvReader.Read() if err != nil { - return &Table{}, err + // Handle EOF specifically: means the CSV was empty or contained only an empty header line. + if err == io.EOF { + t.logger.Debug("NewCSVReader: CSV empty or only header found (EOF after header read attempt).") + // Return the table configured by opts, but without data/header. + // It's ready for Render() which will likely output nothing or just borders if configured. + return t, nil + } + // Log other read errors + t.logger.Errorf("NewCSVReader: Error reading CSV header: %v", err) + return nil, err // Return nil *Table on critical read error + } + + // Check if the read header is genuinely empty (e.g., a blank line in the CSV) + isEmptyHeader := true + for _, h := range headers { + if h != "" { + isEmptyHeader = false + break + } + } + + if !isEmptyHeader { + t.Header(headers) // Use the Table method to set the header data + t.logger.Debugf("NewCSVReader: Header set from CSV: %v", headers) + } else { + t.logger.Debug("NewCSVReader: Read an empty header line, skipping setting table header.") } - t.SetHeader(headers) } + + // Process data rows + rowCount := 0 for { record, err := csvReader.Read() if err == io.EOF { - break - } else if err != nil { - return &Table{}, err + break // Reached the end of the CSV data } - t.Append(record) + if err != nil { + // Log other read errors during data processing + t.logger.Errorf("NewCSVReader: Error reading CSV record: %v", err) + return nil, err // Return nil *Table on critical read error + } + + // Append the record to the table's internal buffer (for batch rendering). + // The Table.Append method handles conversion and storage. + if appendErr := t.Append(record); appendErr != nil { + t.logger.Errorf("NewCSVReader: Error appending record #%d: %v", rowCount+1, appendErr) + // Decide if append error is fatal. For now, let's treat it as fatal. + return nil, appendErr + } + rowCount++ } + t.logger.Debugf("NewCSVReader: Finished reading CSV. Appended %d data rows.", rowCount) + + // Return the configured and populated table instance, ready for Render() call. return t, nil } diff --git a/vendor/github.com/olekukonko/tablewriter/deprecated.go b/vendor/github.com/olekukonko/tablewriter/deprecated.go new file mode 100644 index 0000000..b61d507 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/deprecated.go @@ -0,0 +1,218 @@ +package tablewriter + +import "github.com/olekukonko/tablewriter/tw" + +// WithBorders configures the table's border settings by updating the renderer's border configuration. +// This function is deprecated and will be removed in a future version. +// +// Deprecated: Use [WithRendition] to configure border settings for renderers that support +// [tw.Renditioning], or update the renderer's [tw.RenderConfig] directly via its Config() method. +// This function has no effect if no renderer is set on the table. +// +// Example migration: +// +// // Old (deprecated) +// table.Options(WithBorders(tw.Border{Top: true, Bottom: true})) +// // New (recommended) +// table.Options(WithRendition(tw.Rendition{Borders: tw.Border{Top: true, Bottom: true}})) +// +// Parameters: +// - borders: The [tw.Border] configuration to apply to the renderer's borders. +// +// Returns: +// +// An [Option] that updates the renderer's border settings if a renderer is set. +// Logs a debug message if debugging is enabled and a renderer is present. +func WithBorders(borders tw.Border) Option { + return func(target *Table) { + if target.renderer != nil { + cfg := target.renderer.Config() + cfg.Borders = borders + if target.logger != nil { + target.logger.Debugf("Option: WithBorders applied to Table: %+v", borders) + } + } + } +} + +// Behavior is an alias for [tw.Behavior] to configure table behavior settings. +// This type is deprecated and will be removed in a future version. +// +// Deprecated: Use [tw.Behavior] directly to configure settings such as auto-hiding empty +// columns, trimming spaces, or controlling header/footer visibility. +// +// Example migration: +// +// // Old (deprecated) +// var b tablewriter.Behavior = tablewriter.Behavior{AutoHide: tw.On} +// // New (recommended) +// var b tw.Behavior = tw.Behavior{AutoHide: tw.On} +type Behavior tw.Behavior + +// Settings is an alias for [tw.Settings] to configure renderer settings. +// This type is deprecated and will be removed in a future version. +// +// Deprecated: Use [tw.Settings] directly to configure renderer settings, such as +// separators and line styles. +// +// Example migration: +// +// // Old (deprecated) +// var s tablewriter.Settings = tablewriter.Settings{Separator: "|"} +// // New (recommended) +// var s tw.Settings = tw.Settings{Separator: "|"} +type Settings tw.Settings + +// WithRendererSettings updates the renderer's settings, such as separators and line styles. +// This function is deprecated and will be removed in a future version. +// +// Deprecated: Use [WithRendition] to update renderer settings for renderers that implement +// [tw.Renditioning], or configure the renderer's [tw.Settings] directly via its +// [tw.Renderer.Config] method. This function has no effect if no renderer is set. +// +// Example migration: +// +// // Old (deprecated) +// table.Options(WithRendererSettings(tw.Settings{Separator: "|"})) +// // New (recommended) +// table.Options(WithRendition(tw.Rendition{Settings: tw.Settings{Separator: "|"}})) +// +// Parameters: +// - settings: The [tw.Settings] configuration to apply to the renderer. +// +// Returns: +// +// An [Option] that updates the renderer's settings if a renderer is set. +// Logs a debug message if debugging is enabled and a renderer is present. +func WithRendererSettings(settings tw.Settings) Option { + return func(target *Table) { + if target.renderer != nil { + cfg := target.renderer.Config() + cfg.Settings = settings + if target.logger != nil { + target.logger.Debugf("Option: WithRendererSettings applied to Table: %+v", settings) + } + } + } +} + +// WithAlignment sets the text alignment for footer cells within the formatting configuration. +// This method is deprecated and will be removed in the next version. +// +// Deprecated: Use [FooterConfigBuilder.Alignment] with [AlignmentConfigBuilder.WithGlobal] +// or [AlignmentConfigBuilder.WithPerColumn] to configure footer alignments. +// Alternatively, apply a complete [tw.CellAlignment] configuration using +// [WithFooterAlignmentConfig]. +// +// Example migration: +// +// // Old (deprecated) +// builder.Footer().Formatting().WithAlignment(tw.AlignRight) +// // New (recommended) +// builder.Footer().Alignment().WithGlobal(tw.AlignRight) +// // Or +// table.Options(WithFooterAlignmentConfig(tw.CellAlignment{Global: tw.AlignRight})) +// +// Parameters: +// - align: The [tw.Align] value to set for footer cells. Valid values are +// [tw.AlignLeft], [tw.AlignRight], [tw.AlignCenter], and [tw.AlignNone]. +// Invalid alignments are ignored. +// +// Returns: +// +// The [FooterFormattingBuilder] instance for method chaining. +func (ff *FooterFormattingBuilder) WithAlignment(align tw.Align) *FooterFormattingBuilder { + if align != tw.AlignLeft && align != tw.AlignRight && align != tw.AlignCenter && align != tw.AlignNone { + return ff + } + ff.config.Alignment = align + return ff +} + +// WithAlignment sets the text alignment for header cells within the formatting configuration. +// This method is deprecated and will be removed in the next version. +// +// Deprecated: Use [HeaderConfigBuilder.Alignment] with [AlignmentConfigBuilder.WithGlobal] +// or [AlignmentConfigBuilder.WithPerColumn] to configure header alignments. +// Alternatively, apply a complete [tw.CellAlignment] configuration using +// [WithHeaderAlignmentConfig]. +// +// Example migration: +// +// // Old (deprecated) +// builder.Header().Formatting().WithAlignment(tw.AlignCenter) +// // New (recommended) +// builder.Header().Alignment().WithGlobal(tw.AlignCenter) +// // Or +// table.Options(WithHeaderAlignmentConfig(tw.CellAlignment{Global: tw.AlignCenter})) +// +// Parameters: +// - align: The [tw.Align] value to set for header cells. Valid values are +// [tw.AlignLeft], [tw.AlignRight], [tw.AlignCenter], and [tw.AlignNone]. +// Invalid alignments are ignored. +// +// Returns: +// +// The [HeaderFormattingBuilder] instance for method chaining. +func (hf *HeaderFormattingBuilder) WithAlignment(align tw.Align) *HeaderFormattingBuilder { + if align != tw.AlignLeft && align != tw.AlignRight && align != tw.AlignCenter && align != tw.AlignNone { + return hf + } + hf.config.Alignment = align + return hf +} + +// WithAlignment sets the text alignment for row cells within the formatting configuration. +// This method is deprecated and will be removed in the next version. +// +// Deprecated: Use [RowConfigBuilder.Alignment] with [AlignmentConfigBuilder.WithGlobal] +// or [AlignmentConfigBuilder.WithPerColumn] to configure row alignments. +// Alternatively, apply a complete [tw.CellAlignment] configuration using +// [WithRowAlignmentConfig]. +// +// Example migration: +// +// // Old (deprecated) +// builder.Row().Formatting().WithAlignment(tw.AlignLeft) +// // New (recommended) +// builder.Row().Alignment().WithGlobal(tw.AlignLeft) +// // Or +// table.Options(WithRowAlignmentConfig(tw.CellAlignment{Global: tw.AlignLeft})) +// +// Parameters: +// - align: The [tw.Align] value to set for row cells. Valid values are +// [tw.AlignLeft], [tw.AlignRight], [tw.AlignCenter], and [tw.AlignNone]. +// Invalid alignments are ignored. +// +// Returns: +// +// The [RowFormattingBuilder] instance for method chaining. +func (rf *RowFormattingBuilder) WithAlignment(align tw.Align) *RowFormattingBuilder { + if align != tw.AlignLeft && align != tw.AlignRight && align != tw.AlignCenter && align != tw.AlignNone { + return rf + } + rf.config.Alignment = align + return rf +} + +// WithTableMax sets the maximum width of the entire table in characters. +// Negative values are ignored, and the change is logged if debugging is enabled. +// The width constrains the table's rendering, potentially causing text wrapping or truncation +// based on the configuration's wrapping settings (e.g., tw.WrapTruncate). +// If debug logging is enabled via WithDebug(true), the applied width is logged. +// +// Deprecated: Use WithMaxWidth instead, which provides the same functionality with a clearer name +// and consistent naming across the package. For example: +// +// tablewriter.NewTable(os.Stdout, tablewriter.WithMaxWidth(80)) +func WithTableMax(width int) Option { + return func(target *Table) { + if width < 0 { + return + } + target.config.MaxWidth = width + if target.logger != nil { + target.logger.Debugf("Option: WithTableMax applied to Table: %v", width) + } + } +} diff --git a/vendor/github.com/olekukonko/tablewriter/option.go b/vendor/github.com/olekukonko/tablewriter/option.go new file mode 100644 index 0000000..1302462 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/option.go @@ -0,0 +1,859 @@ +package tablewriter + +import ( + "github.com/olekukonko/ll" + "github.com/olekukonko/tablewriter/tw" + "reflect" +) + +// Option defines a function type for configuring a Table instance. +type Option func(target *Table) + +// WithAutoHide enables or disables automatic hiding of columns with empty data rows. +// Logs the change if debugging is enabled. +func WithAutoHide(state tw.State) Option { + return func(target *Table) { + target.config.Behavior.AutoHide = state + if target.logger != nil { + target.logger.Debugf("Option: WithAutoHide applied to Table: %v", state) + } + } +} + +// WithColumnMax sets a global maximum column width for the table in streaming mode. +// Negative values are ignored, and the change is logged if debugging is enabled. +func WithColumnMax(width int) Option { + return func(target *Table) { + if width < 0 { + return + } + target.config.Widths.Global = width + if target.logger != nil { + target.logger.Debugf("Option: WithColumnMax applied to Table: %v", width) + } + } +} + +// WithMaxWidth sets a global maximum table width for the table. +// Negative values are ignored, and the change is logged if debugging is enabled. +func WithMaxWidth(width int) Option { + return func(target *Table) { + if width < 0 { + return + } + target.config.MaxWidth = width + if target.logger != nil { + target.logger.Debugf("Option: WithTableMax applied to Table: %v", width) + } + } +} + +// WithWidths sets per-column widths for the table. +// Negative widths are removed, and the change is logged if debugging is enabled. +func WithWidths(width tw.CellWidth) Option { + return func(target *Table) { + target.config.Widths = width + if target.logger != nil { + target.logger.Debugf("Option: WithColumnWidths applied to Table: %v", width) + } + } +} + +// WithColumnWidths sets per-column widths for the table. +// Negative widths are removed, and the change is logged if debugging is enabled. +func WithColumnWidths(widths tw.Mapper[int, int]) Option { + return func(target *Table) { + for k, v := range widths { + if v < 0 { + delete(widths, k) + } + } + target.config.Widths.PerColumn = widths + if target.logger != nil { + target.logger.Debugf("Option: WithColumnWidths applied to Table: %v", widths) + } + } +} + +// WithConfig applies a custom configuration to the table by merging it with the default configuration. +func WithConfig(cfg Config) Option { + return func(target *Table) { + target.config = mergeConfig(defaultConfig(), cfg) + } +} + +// WithDebug enables or disables debug logging and adjusts the logger level accordingly. +// Logs the change if debugging is enabled. +func WithDebug(debug bool) Option { + return func(target *Table) { + target.config.Debug = debug + } +} + +// WithFooter sets the table footers by calling the Footer method. +func WithFooter(footers []string) Option { + return func(target *Table) { + target.Footer(footers) + } +} + +// WithFooterConfig applies a full footer configuration to the table. +// Logs the change if debugging is enabled. +func WithFooterConfig(config tw.CellConfig) Option { + return func(target *Table) { + target.config.Footer = config + if target.logger != nil { + target.logger.Debug("Option: WithFooterConfig applied to Table.") + } + } +} + +// WithFooterAlignmentConfig applies a footer alignment configuration to the table. +// Logs the change if debugging is enabled. +func WithFooterAlignmentConfig(alignment tw.CellAlignment) Option { + return func(target *Table) { + target.config.Footer.Alignment = alignment + if target.logger != nil { + target.logger.Debugf("Option: WithFooterAlignmentConfig applied to Table: %+v", alignment) + } + } +} + +// WithFooterMergeMode sets the merge mode for footer cells. +// Invalid merge modes are ignored, and the change is logged if debugging is enabled. +func WithFooterMergeMode(mergeMode int) Option { + return func(target *Table) { + if mergeMode < tw.MergeNone || mergeMode > tw.MergeHierarchical { + return + } + target.config.Footer.Formatting.MergeMode = mergeMode + if target.logger != nil { + target.logger.Debugf("Option: WithFooterMergeMode applied to Table: %v", mergeMode) + } + } +} + +// WithFooterAutoWrap sets the wrapping behavior for footer cells. +// Invalid wrap modes are ignored, and the change is logged if debugging is enabled. +func WithFooterAutoWrap(wrap int) Option { + return func(target *Table) { + if wrap < tw.WrapNone || wrap > tw.WrapBreak { + return + } + target.config.Footer.Formatting.AutoWrap = wrap + if target.logger != nil { + target.logger.Debugf("Option: WithFooterAutoWrap applied to Table: %v", wrap) + } + } +} + +// WithFooterFilter sets the filter configuration for footer cells. +// Logs the change if debugging is enabled. +func WithFooterFilter(filter tw.CellFilter) Option { + return func(target *Table) { + target.config.Footer.Filter = filter + if target.logger != nil { + target.logger.Debug("Option: WithFooterFilter applied to Table.") + } + } +} + +// WithFooterCallbacks sets the callback configuration for footer cells. +// Logs the change if debugging is enabled. +func WithFooterCallbacks(callbacks tw.CellCallbacks) Option { + return func(target *Table) { + target.config.Footer.Callbacks = callbacks + if target.logger != nil { + target.logger.Debug("Option: WithFooterCallbacks applied to Table.") + } + } +} + +// WithFooterPaddingPerColumn sets per-column padding for footer cells. +// Logs the change if debugging is enabled. +func WithFooterPaddingPerColumn(padding []tw.Padding) Option { + return func(target *Table) { + target.config.Footer.Padding.PerColumn = padding + if target.logger != nil { + target.logger.Debugf("Option: WithFooterPaddingPerColumn applied to Table: %+v", padding) + } + } +} + +// WithFooterMaxWidth sets the maximum content width for footer cells. +// Negative values are ignored, and the change is logged if debugging is enabled. +func WithFooterMaxWidth(maxWidth int) Option { + return func(target *Table) { + if maxWidth < 0 { + return + } + target.config.Footer.ColMaxWidths.Global = maxWidth + if target.logger != nil { + target.logger.Debugf("Option: WithFooterMaxWidth applied to Table: %v", maxWidth) + } + } +} + +// WithHeader sets the table headers by calling the Header method. +func WithHeader(headers []string) Option { + return func(target *Table) { + target.Header(headers) + } +} + +// WithHeaderAlignment sets the text alignment for header cells. +// Invalid alignments are ignored, and the change is logged if debugging is enabled. +func WithHeaderAlignment(align tw.Align) Option { + return func(target *Table) { + if align != tw.AlignLeft && align != tw.AlignRight && align != tw.AlignCenter && align != tw.AlignNone { + return + } + target.config.Header.Alignment.Global = align + if target.logger != nil { + target.logger.Debugf("Option: WithHeaderAlignment applied to Table: %v", align) + } + } +} + +// WithHeaderAutoWrap sets the wrapping behavior for header cells. +// Invalid wrap modes are ignored, and the change is logged if debugging is enabled. +func WithHeaderAutoWrap(wrap int) Option { + return func(target *Table) { + if wrap < tw.WrapNone || wrap > tw.WrapBreak { + return + } + target.config.Header.Formatting.AutoWrap = wrap + if target.logger != nil { + target.logger.Debugf("Option: WithHeaderAutoWrap applied to Table: %v", wrap) + } + } +} + +// WithHeaderMergeMode sets the merge mode for header cells. +// Invalid merge modes are ignored, and the change is logged if debugging is enabled. +func WithHeaderMergeMode(mergeMode int) Option { + return func(target *Table) { + if mergeMode < tw.MergeNone || mergeMode > tw.MergeHierarchical { + return + } + target.config.Header.Formatting.MergeMode = mergeMode + if target.logger != nil { + target.logger.Debugf("Option: WithHeaderMergeMode applied to Table: %v", mergeMode) + } + } +} + +// WithHeaderFilter sets the filter configuration for header cells. +// Logs the change if debugging is enabled. +func WithHeaderFilter(filter tw.CellFilter) Option { + return func(target *Table) { + target.config.Header.Filter = filter + if target.logger != nil { + target.logger.Debug("Option: WithHeaderFilter applied to Table.") + } + } +} + +// WithHeaderCallbacks sets the callback configuration for header cells. +// Logs the change if debugging is enabled. +func WithHeaderCallbacks(callbacks tw.CellCallbacks) Option { + return func(target *Table) { + target.config.Header.Callbacks = callbacks + if target.logger != nil { + target.logger.Debug("Option: WithHeaderCallbacks applied to Table.") + } + } +} + +// WithHeaderPaddingPerColumn sets per-column padding for header cells. +// Logs the change if debugging is enabled. +func WithHeaderPaddingPerColumn(padding []tw.Padding) Option { + return func(target *Table) { + target.config.Header.Padding.PerColumn = padding + if target.logger != nil { + target.logger.Debugf("Option: WithHeaderPaddingPerColumn applied to Table: %+v", padding) + } + } +} + +// WithHeaderMaxWidth sets the maximum content width for header cells. +// Negative values are ignored, and the change is logged if debugging is enabled. +func WithHeaderMaxWidth(maxWidth int) Option { + return func(target *Table) { + if maxWidth < 0 { + return + } + target.config.Header.ColMaxWidths.Global = maxWidth + if target.logger != nil { + target.logger.Debugf("Option: WithHeaderMaxWidth applied to Table: %v", maxWidth) + } + } +} + +// WithRowAlignment sets the text alignment for row cells. +// Invalid alignments are ignored, and the change is logged if debugging is enabled. +func WithRowAlignment(align tw.Align) Option { + return func(target *Table) { + if err := align.Validate(); err != nil { + return + } + target.config.Row.Alignment.Global = align + if target.logger != nil { + target.logger.Debugf("Option: WithRowAlignment applied to Table: %v", align) + } + } +} + +// WithRowAutoWrap sets the wrapping behavior for row cells. +// Invalid wrap modes are ignored, and the change is logged if debugging is enabled. +func WithRowAutoWrap(wrap int) Option { + return func(target *Table) { + if wrap < tw.WrapNone || wrap > tw.WrapBreak { + return + } + target.config.Row.Formatting.AutoWrap = wrap + if target.logger != nil { + target.logger.Debugf("Option: WithRowAutoWrap applied to Table: %v", wrap) + } + } +} + +// WithRowMergeMode sets the merge mode for row cells. +// Invalid merge modes are ignored, and the change is logged if debugging is enabled. +func WithRowMergeMode(mergeMode int) Option { + return func(target *Table) { + if mergeMode < tw.MergeNone || mergeMode > tw.MergeHierarchical { + return + } + target.config.Row.Formatting.MergeMode = mergeMode + if target.logger != nil { + target.logger.Debugf("Option: WithRowMergeMode applied to Table: %v", mergeMode) + } + } +} + +// WithRowFilter sets the filter configuration for row cells. +// Logs the change if debugging is enabled. +func WithRowFilter(filter tw.CellFilter) Option { + return func(target *Table) { + target.config.Row.Filter = filter + if target.logger != nil { + target.logger.Debug("Option: WithRowFilter applied to Table.") + } + } +} + +// WithRowCallbacks sets the callback configuration for row cells. +// Logs the change if debugging is enabled. +func WithRowCallbacks(callbacks tw.CellCallbacks) Option { + return func(target *Table) { + target.config.Row.Callbacks = callbacks + if target.logger != nil { + target.logger.Debug("Option: WithRowCallbacks applied to Table.") + } + } +} + +// WithRowPaddingPerColumn sets per-column padding for row cells. +// Logs the change if debugging is enabled. +func WithRowPaddingPerColumn(padding []tw.Padding) Option { + return func(target *Table) { + target.config.Row.Padding.PerColumn = padding + if target.logger != nil { + target.logger.Debugf("Option: WithRowPaddingPerColumn applied to Table: %+v", padding) + } + } +} + +// WithHeaderAlignmentConfig applies a header alignment configuration to the table. +// Logs the change if debugging is enabled. +func WithHeaderAlignmentConfig(alignment tw.CellAlignment) Option { + return func(target *Table) { + target.config.Header.Alignment = alignment + if target.logger != nil { + target.logger.Debugf("Option: WithHeaderAlignmentConfig applied to Table: %+v", alignment) + } + } +} + +// WithHeaderConfig applies a full header configuration to the table. +// Logs the change if debugging is enabled. +func WithHeaderConfig(config tw.CellConfig) Option { + return func(target *Table) { + target.config.Header = config + if target.logger != nil { + target.logger.Debug("Option: WithHeaderConfig applied to Table.") + } + } +} + +// WithLogger sets a custom logger for the table and updates the renderer if present. +// Logs the change if debugging is enabled. +func WithLogger(logger *ll.Logger) Option { + return func(target *Table) { + target.logger = logger + if target.logger != nil { + target.logger.Debug("Option: WithLogger applied to Table.") + if target.renderer != nil { + target.renderer.Logger(target.logger) + } + } + } +} + +// WithRenderer sets a custom renderer for the table and attaches the logger if present. +// Logs the change if debugging is enabled. +func WithRenderer(f tw.Renderer) Option { + return func(target *Table) { + target.renderer = f + if target.logger != nil { + target.logger.Debugf("Option: WithRenderer applied to Table: %T", f) + f.Logger(target.logger) + } + } +} + +// WithRowConfig applies a full row configuration to the table. +// Logs the change if debugging is enabled. +func WithRowConfig(config tw.CellConfig) Option { + return func(target *Table) { + target.config.Row = config + if target.logger != nil { + target.logger.Debug("Option: WithRowConfig applied to Table.") + } + } +} + +// WithRowAlignmentConfig applies a row alignment configuration to the table. +// Logs the change if debugging is enabled. +func WithRowAlignmentConfig(alignment tw.CellAlignment) Option { + return func(target *Table) { + target.config.Row.Alignment = alignment + if target.logger != nil { + target.logger.Debugf("Option: WithRowAlignmentConfig applied to Table: %+v", alignment) + } + } +} + +// WithRowMaxWidth sets the maximum content width for row cells. +// Negative values are ignored, and the change is logged if debugging is enabled. +func WithRowMaxWidth(maxWidth int) Option { + return func(target *Table) { + if maxWidth < 0 { + return + } + target.config.Row.ColMaxWidths.Global = maxWidth + if target.logger != nil { + target.logger.Debugf("Option: WithRowMaxWidth applied to Table: %v", maxWidth) + } + } +} + +// WithStreaming applies a streaming configuration to the table by merging it with the existing configuration. +// Logs the change if debugging is enabled. +func WithStreaming(c tw.StreamConfig) Option { + return func(target *Table) { + target.config.Stream = mergeStreamConfig(target.config.Stream, c) + if target.logger != nil { + target.logger.Debug("Option: WithStreaming applied to Table.") + } + } +} + +// WithStringer sets a custom stringer function for converting row data and clears the stringer cache. +// Logs the change if debugging is enabled. +func WithStringer(stringer interface{}) Option { + return func(t *Table) { + t.stringer = stringer + t.stringerCacheMu.Lock() + t.stringerCache = make(map[reflect.Type]reflect.Value) + t.stringerCacheMu.Unlock() + if t.logger != nil { + t.logger.Debug("Stringer updated, cache cleared") + } + } +} + +// WithStringerCache enables caching for the stringer function. +// Logs the change if debugging is enabled. +func WithStringerCache() Option { + return func(t *Table) { + t.stringerCacheEnabled = true + if t.logger != nil { + t.logger.Debug("Option: WithStringerCache enabled") + } + } +} + +// WithTrimSpace sets whether leading and trailing spaces are automatically trimmed. +// Logs the change if debugging is enabled. +func WithTrimSpace(state tw.State) Option { + return func(target *Table) { + target.config.Behavior.TrimSpace = state + if target.logger != nil { + target.logger.Debugf("Option: WithTrimSpace applied to Table: %v", state) + } + } +} + +// WithHeaderAutoFormat enables or disables automatic formatting for header cells. +// Logs the change if debugging is enabled. +func WithHeaderAutoFormat(state tw.State) Option { + return func(target *Table) { + target.config.Header.Formatting.AutoFormat = state + if target.logger != nil { + target.logger.Debugf("Option: WithHeaderAutoFormat applied to Table: %v", state) + } + } +} + +// WithFooterAutoFormat enables or disables automatic formatting for footer cells. +// Logs the change if debugging is enabled. +func WithFooterAutoFormat(state tw.State) Option { + return func(target *Table) { + target.config.Footer.Formatting.AutoFormat = state + if target.logger != nil { + target.logger.Debugf("Option: WithFooterAutoFormat applied to Table: %v", state) + } + } +} + +// WithRowAutoFormat enables or disables automatic formatting for row cells. +// Logs the change if debugging is enabled. +func WithRowAutoFormat(state tw.State) Option { + return func(target *Table) { + target.config.Row.Formatting.AutoFormat = state + if target.logger != nil { + target.logger.Debugf("Option: WithRowAutoFormat applied to Table: %v", state) + } + } +} + +// WithHeaderControl sets the control behavior for the table header. +// Logs the change if debugging is enabled. +func WithHeaderControl(control tw.Control) Option { + return func(target *Table) { + target.config.Behavior.Header = control + if target.logger != nil { + target.logger.Debugf("Option: WithHeaderControl applied to Table: %v", control) + } + } +} + +// WithFooterControl sets the control behavior for the table footer. +// Logs the change if debugging is enabled. +func WithFooterControl(control tw.Control) Option { + return func(target *Table) { + target.config.Behavior.Footer = control + if target.logger != nil { + target.logger.Debugf("Option: WithFooterControl applied to Table: %v", control) + } + } +} + +// WithAlignment sets the default column alignment for the header, rows, and footer. +// Logs the change if debugging is enabled. +func WithAlignment(alignment tw.Alignment) Option { + return func(target *Table) { + target.config.Header.Alignment.PerColumn = alignment + target.config.Row.Alignment.PerColumn = alignment + target.config.Footer.Alignment.PerColumn = alignment + if target.logger != nil { + target.logger.Debugf("Option: WithAlignment applied to Table: %+v", alignment) + } + } +} + +// WithBehavior applies a behavior configuration to the table. +// Logs the change if debugging is enabled. +func WithBehavior(behavior tw.Behavior) Option { + return func(target *Table) { + target.config.Behavior = behavior + if target.logger != nil { + target.logger.Debugf("Option: WithBehavior applied to Table: %+v", behavior) + } + } +} + +// WithPadding sets the global padding for the header, rows, and footer. +// Logs the change if debugging is enabled. +func WithPadding(padding tw.Padding) Option { + return func(target *Table) { + target.config.Header.Padding.Global = padding + target.config.Row.Padding.Global = padding + target.config.Footer.Padding.Global = padding + if target.logger != nil { + target.logger.Debugf("Option: WithPadding applied to Table: %+v", padding) + } + } +} + +// WithRendition allows updating the active renderer's rendition configuration +// by merging the provided rendition. +// If the renderer does not implement tw.Renditioning, a warning is logged. +// Logs the change if debugging is enabled. +func WithRendition(rendition tw.Rendition) Option { + return func(target *Table) { + if target.renderer == nil { + if target.logger != nil { + target.logger.Warn("Option: WithRendition: No renderer set on table.") + } + return + } + if ru, ok := target.renderer.(tw.Renditioning); ok { + ru.Rendition(rendition) + if target.logger != nil { + target.logger.Debugf("Option: WithRendition: Applied to renderer via Renditioning.SetRendition(): %+v", rendition) + } + } else { + if target.logger != nil { + target.logger.Warnf("Option: WithRendition: Current renderer type %T does not implement tw.Renditioning. Rendition may not be applied as expected.", target.renderer) + } + } + } +} + +// WithSymbols sets the symbols used for drawing table borders and separators. +// The symbols are applied to the table's renderer configuration, if a renderer is set. +// If no renderer is set (target.renderer is nil), this option has no effect. . +func WithSymbols(symbols tw.Symbols) Option { + return func(target *Table) { + if target.renderer != nil { + cfg := target.renderer.Config() + cfg.Symbols = symbols + + if ru, ok := target.renderer.(tw.Renditioning); ok { + ru.Rendition(cfg) + if target.logger != nil { + target.logger.Debugf("Option: WithRendition: Applied to renderer via Renditioning.SetRendition(): %+v", cfg) + } + } else { + if target.logger != nil { + target.logger.Warnf("Option: WithRendition: Current renderer type %T does not implement tw.Renditioning. Rendition may not be applied as expected.", target.renderer) + } + } + } + } +} + +// defaultConfig returns a default Config with sensible settings for headers, rows, footers, and behavior. +func defaultConfig() Config { + return Config{ + MaxWidth: 0, + Header: tw.CellConfig{ + Formatting: tw.CellFormatting{ + AutoWrap: tw.WrapTruncate, + AutoFormat: tw.On, + MergeMode: tw.MergeNone, + }, + Padding: tw.CellPadding{ + Global: tw.PaddingDefault, + }, + Alignment: tw.CellAlignment{ + Global: tw.AlignCenter, + PerColumn: []tw.Align{}, + }, + }, + Row: tw.CellConfig{ + Formatting: tw.CellFormatting{ + AutoWrap: tw.WrapNormal, + AutoFormat: tw.Off, + MergeMode: tw.MergeNone, + }, + Padding: tw.CellPadding{ + Global: tw.PaddingDefault, + }, + Alignment: tw.CellAlignment{ + Global: tw.AlignLeft, + PerColumn: []tw.Align{}, + }, + }, + Footer: tw.CellConfig{ + Formatting: tw.CellFormatting{ + AutoWrap: tw.WrapNormal, + AutoFormat: tw.Off, + MergeMode: tw.MergeNone, + }, + Padding: tw.CellPadding{ + Global: tw.PaddingDefault, + }, + Alignment: tw.CellAlignment{ + Global: tw.AlignRight, + PerColumn: []tw.Align{}, + }, + }, + Stream: tw.StreamConfig{}, + Debug: false, + Behavior: tw.Behavior{ + AutoHide: tw.Off, + TrimSpace: tw.On, + }, + } +} + +// mergeCellConfig merges a source CellConfig into a destination CellConfig, prioritizing non-default source values. +// It handles deep merging for complex fields like padding and callbacks. +func mergeCellConfig(dst, src tw.CellConfig) tw.CellConfig { + if src.Formatting.Alignment != tw.Empty { + dst.Formatting.Alignment = src.Formatting.Alignment + } + + if src.Formatting.AutoWrap != 0 { + dst.Formatting.AutoWrap = src.Formatting.AutoWrap + } + if src.ColMaxWidths.Global != 0 { + dst.ColMaxWidths.Global = src.ColMaxWidths.Global + } + if src.Formatting.MergeMode != 0 { + dst.Formatting.MergeMode = src.Formatting.MergeMode + } + + dst.Formatting.AutoFormat = src.Formatting.AutoFormat + + if src.Padding.Global.Paddable() { + dst.Padding.Global = src.Padding.Global + } + + if len(src.Padding.PerColumn) > 0 { + if dst.Padding.PerColumn == nil { + dst.Padding.PerColumn = make([]tw.Padding, len(src.Padding.PerColumn)) + } else if len(src.Padding.PerColumn) > len(dst.Padding.PerColumn) { + dst.Padding.PerColumn = append(dst.Padding.PerColumn, make([]tw.Padding, len(src.Padding.PerColumn)-len(dst.Padding.PerColumn))...) + } + for i, pad := range src.Padding.PerColumn { + if pad.Paddable() { + dst.Padding.PerColumn[i] = pad + } + } + } + if src.Callbacks.Global != nil { + dst.Callbacks.Global = src.Callbacks.Global + } + if len(src.Callbacks.PerColumn) > 0 { + if dst.Callbacks.PerColumn == nil { + dst.Callbacks.PerColumn = make([]func(), len(src.Callbacks.PerColumn)) + } else if len(src.Callbacks.PerColumn) > len(dst.Callbacks.PerColumn) { + dst.Callbacks.PerColumn = append(dst.Callbacks.PerColumn, make([]func(), len(src.Callbacks.PerColumn)-len(dst.Callbacks.PerColumn))...) + } + for i, cb := range src.Callbacks.PerColumn { + if cb != nil { + dst.Callbacks.PerColumn[i] = cb + } + } + } + if src.Filter.Global != nil { + dst.Filter.Global = src.Filter.Global + } + if len(src.Filter.PerColumn) > 0 { + if dst.Filter.PerColumn == nil { + dst.Filter.PerColumn = make([]func(string) string, len(src.Filter.PerColumn)) + } else if len(src.Filter.PerColumn) > len(dst.Filter.PerColumn) { + dst.Filter.PerColumn = append(dst.Filter.PerColumn, make([]func(string) string, len(src.Filter.PerColumn)-len(dst.Filter.PerColumn))...) + } + for i, filter := range src.Filter.PerColumn { + if filter != nil { + dst.Filter.PerColumn[i] = filter + } + } + } + + // Merge Alignment + if src.Alignment.Global != tw.Empty { + dst.Alignment.Global = src.Alignment.Global + } + + if len(src.Alignment.PerColumn) > 0 { + if dst.Alignment.PerColumn == nil { + dst.Alignment.PerColumn = make([]tw.Align, len(src.Alignment.PerColumn)) + } else if len(src.Alignment.PerColumn) > len(dst.Alignment.PerColumn) { + dst.Alignment.PerColumn = append(dst.Alignment.PerColumn, make([]tw.Align, len(src.Alignment.PerColumn)-len(dst.Alignment.PerColumn))...) + } + for i, align := range src.Alignment.PerColumn { + if align != tw.Skip { + dst.Alignment.PerColumn[i] = align + } + } + } + + if len(src.ColumnAligns) > 0 { + if dst.ColumnAligns == nil { + dst.ColumnAligns = make([]tw.Align, len(src.ColumnAligns)) + } else if len(src.ColumnAligns) > len(dst.ColumnAligns) { + dst.ColumnAligns = append(dst.ColumnAligns, make([]tw.Align, len(src.ColumnAligns)-len(dst.ColumnAligns))...) + } + for i, align := range src.ColumnAligns { + if align != tw.Skip { + dst.ColumnAligns[i] = align + } + } + } + + if len(src.ColMaxWidths.PerColumn) > 0 { + if dst.ColMaxWidths.PerColumn == nil { + dst.ColMaxWidths.PerColumn = make(map[int]int) + } + for k, v := range src.ColMaxWidths.PerColumn { + if v != 0 { + dst.ColMaxWidths.PerColumn[k] = v + } + } + } + return dst +} + +// mergeConfig merges a source Config into a destination Config, prioritizing non-default source values. +// It performs deep merging for complex types like Header, Row, Footer, and Stream. +func mergeConfig(dst, src Config) Config { + if src.MaxWidth != 0 { + dst.MaxWidth = src.MaxWidth + } + + dst.Debug = src.Debug || dst.Debug + dst.Behavior.AutoHide = src.Behavior.AutoHide + dst.Behavior.TrimSpace = src.Behavior.TrimSpace + dst.Behavior.Compact = src.Behavior.Compact + dst.Behavior.Header = src.Behavior.Header + dst.Behavior.Footer = src.Behavior.Footer + + if src.Widths.Global != 0 { + dst.Widths.Global = src.Widths.Global + } + if len(src.Widths.PerColumn) > 0 { + if dst.Widths.PerColumn == nil { + dst.Widths.PerColumn = make(map[int]int) + } + for k, v := range src.Widths.PerColumn { + if v != 0 { + dst.Widths.PerColumn[k] = v + } + } + } + + dst.Header = mergeCellConfig(dst.Header, src.Header) + dst.Row = mergeCellConfig(dst.Row, src.Row) + dst.Footer = mergeCellConfig(dst.Footer, src.Footer) + dst.Stream = mergeStreamConfig(dst.Stream, src.Stream) + + return dst +} + +// mergeStreamConfig merges a source StreamConfig into a destination StreamConfig, prioritizing non-default source values. +func mergeStreamConfig(dst, src tw.StreamConfig) tw.StreamConfig { + if src.Enable { + dst.Enable = true + } + return dst +} + +// padLine pads a line to the specified column count by appending empty strings as needed. +func padLine(line []string, numCols int) []string { + if len(line) >= numCols { + return line + } + padded := make([]string, numCols) + copy(padded, line) + for i := len(line); i < numCols; i++ { + padded[i] = tw.Empty + } + return padded +} diff --git a/vendor/github.com/olekukonko/tablewriter/pkg/twwarp/wrap.go b/vendor/github.com/olekukonko/tablewriter/pkg/twwarp/wrap.go new file mode 100644 index 0000000..f32f054 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/pkg/twwarp/wrap.go @@ -0,0 +1,234 @@ +// Copyright 2014 Oleku Konko All rights reserved. +// Use of this source code is governed by a MIT +// license that can be found in the LICENSE file. + +// This module is a Table Writer API for the Go Programming Language. +// The protocols were written in pure Go and works on windows and unix systems + +package twwarp + +import ( + "github.com/rivo/uniseg" + "math" + "strings" + "unicode" + + "github.com/mattn/go-runewidth" +) + +const ( + nl = "\n" + sp = " " +) + +const defaultPenalty = 1e5 + +func SplitWords(s string) []string { + words := make([]string, 0, len(s)/5) + var wordBegin int + wordPending := false + for i, c := range s { + if unicode.IsSpace(c) { + if wordPending { + words = append(words, s[wordBegin:i]) + wordPending = false + } + continue + } + if !wordPending { + wordBegin = i + wordPending = true + } + } + if wordPending { + words = append(words, s[wordBegin:]) + } + return words +} + +// WrapString wraps s into a paragraph of lines of length lim, with minimal +// raggedness. +func WrapString(s string, lim int) ([]string, int) { + if s == sp { + return []string{sp}, lim + } + words := SplitWords(s) + if len(words) == 0 { + return []string{""}, lim + } + var lines []string + max := 0 + for _, v := range words { + max = runewidth.StringWidth(v) + if max > lim { + lim = max + } + } + for _, line := range WrapWords(words, 1, lim, defaultPenalty) { + lines = append(lines, strings.Join(line, sp)) + } + return lines, lim +} + +// WrapStringWithSpaces wraps a string into lines of a specified display width while preserving +// leading and trailing spaces. It splits the input string into words, condenses internal multiple +// spaces to a single space, and wraps the content to fit within the given width limit, measured +// using Unicode-aware display width. The function is used in the logging library to format log +// messages for consistent output. It returns the wrapped lines as a slice of strings and the +// adjusted width limit, which may increase if a single word exceeds the input limit. Thread-safe +// as it does not modify shared state. +func WrapStringWithSpaces(s string, lim int) ([]string, int) { + if len(s) == 0 { + return []string{""}, lim + } + if strings.TrimSpace(s) == "" { // All spaces + if runewidth.StringWidth(s) <= lim { + return []string{s}, runewidth.StringWidth(s) + } + // For very long all-space strings, "wrap" by truncating to the limit. + if lim > 0 { + // Use our new helper function to get a substring of the correct display width + substring, _ := stringToDisplayWidth(s, lim) + return []string{substring}, lim + } + return []string{""}, lim + } + + var leadingSpaces, trailingSpaces, coreContent string + firstNonSpace := strings.IndexFunc(s, func(r rune) bool { return !unicode.IsSpace(r) }) + // firstNonSpace will not be -1 due to TrimSpace check above. + leadingSpaces = s[:firstNonSpace] + lastNonSpace := strings.LastIndexFunc(s, func(r rune) bool { return !unicode.IsSpace(r) }) + trailingSpaces = s[lastNonSpace+1:] + coreContent = s[firstNonSpace : lastNonSpace+1] + + if coreContent == "" { + return []string{leadingSpaces + trailingSpaces}, lim + } + + words := SplitWords(coreContent) + if len(words) == 0 { + return []string{leadingSpaces + trailingSpaces}, lim + } + + var lines []string + currentLim := lim + + maxCoreWordWidth := 0 + for _, v := range words { + w := runewidth.StringWidth(v) + if w > maxCoreWordWidth { + maxCoreWordWidth = w + } + } + + if maxCoreWordWidth > currentLim { + currentLim = maxCoreWordWidth + } + + wrappedWordLines := WrapWords(words, 1, currentLim, defaultPenalty) + + for i, lineWords := range wrappedWordLines { + joinedLine := strings.Join(lineWords, sp) + finalLine := leadingSpaces + joinedLine + if i == len(wrappedWordLines)-1 { // Last line + finalLine += trailingSpaces + } + lines = append(lines, finalLine) + } + return lines, currentLim +} + +// stringToDisplayWidth returns a substring of s that has a display width +// as close as possible to, but not exceeding, targetWidth. +// It returns the substring and its actual display width. +func stringToDisplayWidth(s string, targetWidth int) (substring string, actualWidth int) { + if targetWidth <= 0 { + return "", 0 + } + + var currentWidth int + var endIndex int // Tracks the byte index in the original string + + g := uniseg.NewGraphemes(s) + for g.Next() { + grapheme := g.Str() + graphemeWidth := runewidth.StringWidth(grapheme) // Get width of the current grapheme cluster + + if currentWidth+graphemeWidth > targetWidth { + // Adding this grapheme would exceed the target width + break + } + + currentWidth += graphemeWidth + // Get the end byte position of the current grapheme cluster + _, e := g.Positions() + endIndex = e + } + return s[:endIndex], currentWidth +} + +// WrapWords is the low-level line-breaking algorithm, useful if you need more +// control over the details of the text wrapping process. For most uses, +// WrapString will be sufficient and more convenient. +// +// WrapWords splits a list of words into lines with minimal "raggedness", +// treating each rune as one unit, accounting for spc units between adjacent +// words on each line, and attempting to limit lines to lim units. Raggedness +// is the total error over all lines, where error is the square of the +// difference of the length of the line and lim. Too-long lines (which only +// happen when a single word is longer than lim units) have pen penalty units +// added to the error. +func WrapWords(words []string, spc, lim, pen int) [][]string { + n := len(words) + if n == 0 { + return nil + } + lengths := make([]int, n) + for i := 0; i < n; i++ { + lengths[i] = runewidth.StringWidth(words[i]) + } + nbrk := make([]int, n) + cost := make([]int, n) + for i := range cost { + cost[i] = math.MaxInt32 + } + remainderLen := lengths[n-1] + for i := n - 1; i >= 0; i-- { + if i < n-1 { + remainderLen += spc + lengths[i] + } + if remainderLen <= lim { + cost[i] = 0 + nbrk[i] = n + continue + } + phraseLen := lengths[i] + for j := i + 1; j < n; j++ { + if j > i+1 { + phraseLen += spc + lengths[j-1] + } + d := lim - phraseLen + c := d*d + cost[j] + if phraseLen > lim { + c += pen // too-long lines get a worse penalty + } + if c < cost[i] { + cost[i] = c + nbrk[i] = j + } + } + } + var lines [][]string + i := 0 + for i < n { + lines = append(lines, words[i:nbrk[i]]) + i = nbrk[i] + } + return lines +} + +// getLines decomposes a multiline string into a slice of strings. +func getLines(s string) []string { + return strings.Split(s, nl) +} diff --git a/vendor/github.com/olekukonko/tablewriter/renderer/blueprint.go b/vendor/github.com/olekukonko/tablewriter/renderer/blueprint.go new file mode 100644 index 0000000..355b3af --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/renderer/blueprint.go @@ -0,0 +1,578 @@ +package renderer + +import ( + "github.com/olekukonko/ll" + "io" + "strings" + + "github.com/olekukonko/tablewriter/tw" +) + +// Blueprint implements a primary table rendering engine with customizable borders and alignments. +type Blueprint struct { + config tw.Rendition // Rendering configuration for table borders and symbols + logger *ll.Logger // Logger for debug trace messages + w io.Writer +} + +// NewBlueprint creates a new Blueprint instance with optional custom configurations. +func NewBlueprint(configs ...tw.Rendition) *Blueprint { + // Initialize with default configuration + cfg := defaultBlueprint() + if len(configs) > 0 { + userCfg := configs[0] + // Override default borders if provided + if userCfg.Borders.Left != 0 { + cfg.Borders.Left = userCfg.Borders.Left + } + if userCfg.Borders.Right != 0 { + cfg.Borders.Right = userCfg.Borders.Right + } + if userCfg.Borders.Top != 0 { + cfg.Borders.Top = userCfg.Borders.Top + } + if userCfg.Borders.Bottom != 0 { + cfg.Borders.Bottom = userCfg.Borders.Bottom + } + // Override symbols if provided + if userCfg.Symbols != nil { + cfg.Symbols = userCfg.Symbols + } + + // Merge user settings with default settings + cfg.Settings = mergeSettings(cfg.Settings, userCfg.Settings) + } + return &Blueprint{config: cfg} +} + +// Close performs cleanup (no-op in this implementation). +func (f *Blueprint) Close() error { + f.logger.Debug("Blueprint.Close() called (no-op).") + return nil +} + +// Config returns the renderer's current configuration. +func (f *Blueprint) Config() tw.Rendition { + return f.config +} + +// Footer renders the table footer section with configured formatting. +func (f *Blueprint) Footer(footers [][]string, ctx tw.Formatting) { + f.logger.Debugf("Starting Footer render: IsSubRow=%v, Location=%v, Pos=%s", ctx.IsSubRow, ctx.Row.Location, ctx.Row.Position) + // Render the footer line + f.renderLine(ctx) + f.logger.Debug("Completed Footer render") +} + +// Header renders the table header section with configured formatting. +func (f *Blueprint) Header(headers [][]string, ctx tw.Formatting) { + f.logger.Debugf("Starting Header render: IsSubRow=%v, Location=%v, Pos=%s, lines=%d, widths=%v", + ctx.IsSubRow, ctx.Row.Location, ctx.Row.Position, len(ctx.Row.Current), ctx.Row.Widths) + // Render the header line + f.renderLine(ctx) + f.logger.Debug("Completed Header render") +} + +// Line renders a full horizontal row line with junctions and segments. +func (f *Blueprint) Line(ctx tw.Formatting) { + // Initialize junction renderer + jr := NewJunction(JunctionContext{ + Symbols: f.config.Symbols, + Ctx: ctx, + ColIdx: 0, + Logger: f.logger, + BorderTint: Tint{}, + SeparatorTint: Tint{}, + }) + + var line strings.Builder + totalLineWidth := 0 // Track total display width + // Get sorted column indices + sortedKeys := ctx.Row.Widths.SortedKeys() + numCols := 0 + if len(sortedKeys) > 0 { + numCols = sortedKeys[len(sortedKeys)-1] + 1 + } + + // Handle empty row case + if numCols == 0 { + prefix := tw.Empty + suffix := tw.Empty + if f.config.Borders.Left.Enabled() { + prefix = jr.RenderLeft() + } + if f.config.Borders.Right.Enabled() { + suffix = jr.RenderRight(-1) + } + if prefix != tw.Empty || suffix != tw.Empty { + line.WriteString(prefix + suffix + tw.NewLine) + totalLineWidth = tw.DisplayWidth(prefix) + tw.DisplayWidth(suffix) + f.w.Write([]byte(line.String())) + } + f.logger.Debugf("Line: Handled empty row/widths case (total width %d)", totalLineWidth) + return + } + + // Calculate target total width based on data rows + targetTotalWidth := 0 + for _, colIdx := range sortedKeys { + targetTotalWidth += ctx.Row.Widths.Get(colIdx) + } + if f.config.Borders.Left.Enabled() { + targetTotalWidth += tw.DisplayWidth(f.config.Symbols.Column()) + } + if f.config.Borders.Right.Enabled() { + targetTotalWidth += tw.DisplayWidth(f.config.Symbols.Column()) + } + if f.config.Settings.Separators.BetweenColumns.Enabled() && len(sortedKeys) > 1 { + targetTotalWidth += tw.DisplayWidth(f.config.Symbols.Column()) * (len(sortedKeys) - 1) + } + + // Add left border if enabled + leftBorderWidth := 0 + if f.config.Borders.Left.Enabled() { + leftBorder := jr.RenderLeft() + line.WriteString(leftBorder) + leftBorderWidth = tw.DisplayWidth(leftBorder) + totalLineWidth += leftBorderWidth + f.logger.Debugf("Line: Left border='%s' (f.width %d)", leftBorder, leftBorderWidth) + } + + visibleColIndices := make([]int, 0) + // Calculate visible columns + for _, colIdx := range sortedKeys { + colWidth := ctx.Row.Widths.Get(colIdx) + if colWidth > 0 { + visibleColIndices = append(visibleColIndices, colIdx) + } + } + + f.logger.Debugf("Line: sortedKeys=%v, Widths=%v, visibleColIndices=%v, targetTotalWidth=%d", sortedKeys, ctx.Row.Widths, visibleColIndices, targetTotalWidth) + // Render each column segment + for keyIndex, currentColIdx := range visibleColIndices { + jr.colIdx = currentColIdx + segment := jr.GetSegment() + colWidth := ctx.Row.Widths.Get(currentColIdx) + // Adjust colWidth to account for wider borders + adjustedColWidth := colWidth + if f.config.Borders.Left.Enabled() && keyIndex == 0 { + adjustedColWidth -= leftBorderWidth - tw.DisplayWidth(f.config.Symbols.Column()) + } + if f.config.Borders.Right.Enabled() && keyIndex == len(visibleColIndices)-1 { + rightBorderWidth := tw.DisplayWidth(jr.RenderRight(currentColIdx)) + adjustedColWidth -= rightBorderWidth - tw.DisplayWidth(f.config.Symbols.Column()) + } + if adjustedColWidth < 0 { + adjustedColWidth = 0 + } + f.logger.Debugf("Line: colIdx=%d, segment='%s', adjusted colWidth=%d", currentColIdx, segment, adjustedColWidth) + if segment == tw.Empty { + spaces := strings.Repeat(tw.Space, adjustedColWidth) + line.WriteString(spaces) + totalLineWidth += adjustedColWidth + f.logger.Debugf("Line: Rendered spaces='%s' (f.width %d) for col %d", spaces, adjustedColWidth, currentColIdx) + } else { + segmentWidth := tw.DisplayWidth(segment) + if segmentWidth == 0 { + segmentWidth = 1 // Avoid division by zero + f.logger.Warnf("Line: Segment='%s' has zero width, using 1", segment) + } + // Calculate how many full segments fit + repeat := adjustedColWidth / segmentWidth + if repeat < 1 && adjustedColWidth > 0 { + repeat = 1 + } + repeatedSegment := strings.Repeat(segment, repeat) + actualWidth := tw.DisplayWidth(repeatedSegment) + if actualWidth > adjustedColWidth { + // Truncate if too long + repeatedSegment = tw.TruncateString(repeatedSegment, adjustedColWidth) + actualWidth = tw.DisplayWidth(repeatedSegment) + f.logger.Debugf("Line: Truncated segment='%s' to width %d", repeatedSegment, actualWidth) + } else if actualWidth < adjustedColWidth { + // Pad with segment character to match adjustedColWidth + remainingWidth := adjustedColWidth - actualWidth + for i := 0; i < remainingWidth/segmentWidth; i++ { + repeatedSegment += segment + } + actualWidth = tw.DisplayWidth(repeatedSegment) + if actualWidth < adjustedColWidth { + repeatedSegment = tw.PadRight(repeatedSegment, tw.Space, adjustedColWidth) + actualWidth = adjustedColWidth + f.logger.Debugf("Line: Padded segment with spaces='%s' to width %d", repeatedSegment, actualWidth) + } + f.logger.Debugf("Line: Padded segment='%s' to width %d", repeatedSegment, actualWidth) + } + line.WriteString(repeatedSegment) + totalLineWidth += actualWidth + f.logger.Debugf("Line: Rendered segment='%s' (f.width %d) for col %d", repeatedSegment, actualWidth, currentColIdx) + } + + // Add junction between columns if not the last column + isLast := keyIndex == len(visibleColIndices)-1 + if !isLast && f.config.Settings.Separators.BetweenColumns.Enabled() { + nextColIdx := visibleColIndices[keyIndex+1] + junction := jr.RenderJunction(currentColIdx, nextColIdx) + // Use center symbol (❀) or column separator (|) to match data rows + if tw.DisplayWidth(junction) != tw.DisplayWidth(f.config.Symbols.Column()) { + junction = f.config.Symbols.Center() + if tw.DisplayWidth(junction) != tw.DisplayWidth(f.config.Symbols.Column()) { + junction = f.config.Symbols.Column() + } + } + junctionWidth := tw.DisplayWidth(junction) + line.WriteString(junction) + totalLineWidth += junctionWidth + f.logger.Debugf("Line: Junction between %d and %d: '%s' (f.width %d)", currentColIdx, nextColIdx, junction, junctionWidth) + } + } + + // Add right border + rightBorderWidth := 0 + if f.config.Borders.Right.Enabled() && len(visibleColIndices) > 0 { + lastIdx := visibleColIndices[len(visibleColIndices)-1] + rightBorder := jr.RenderRight(lastIdx) + rightBorderWidth = tw.DisplayWidth(rightBorder) + line.WriteString(rightBorder) + totalLineWidth += rightBorderWidth + f.logger.Debugf("Line: Right border='%s' (f.width %d)", rightBorder, rightBorderWidth) + } + + // Write the final line + line.WriteString(tw.NewLine) + f.w.Write([]byte(line.String())) + f.logger.Debugf("Line rendered: '%s' (total width %d, target %d)", strings.TrimSuffix(line.String(), tw.NewLine), totalLineWidth, targetTotalWidth) +} + +// Logger sets the logger for the Blueprint instance. +func (f *Blueprint) Logger(logger *ll.Logger) { + f.logger = logger.Namespace("blueprint") +} + +// Row renders a table data row with configured formatting. +func (f *Blueprint) Row(row []string, ctx tw.Formatting) { + f.logger.Debugf("Starting Row render: IsSubRow=%v, Location=%v, Pos=%s, hasFooter=%v", + ctx.IsSubRow, ctx.Row.Location, ctx.Row.Position, ctx.HasFooter) + + // Render the row line + f.renderLine(ctx) + f.logger.Debug("Completed Row render") +} + +// Start initializes the rendering process (no-op in this implementation). +func (f *Blueprint) Start(w io.Writer) error { + f.w = w + f.logger.Debug("Blueprint.Start() called (no-op).") + return nil +} + +// formatCell formats a cell's content with specified width, padding, and alignment, returning an empty string if width is non-positive. +func (f *Blueprint) formatCell(content string, width int, padding tw.Padding, align tw.Align) string { + if width <= 0 { + return tw.Empty + } + + f.logger.Debugf("Formatting cell: content='%s', width=%d, align=%s, padding={L:'%s' R:'%s'}", + content, width, align, padding.Left, padding.Right) + + // Calculate display width of content + runeWidth := tw.DisplayWidth(content) + + // Set default padding characters + leftPadChar := padding.Left + rightPadChar := padding.Right + + //if f.config.Settings.Cushion.Enabled() || f.config.Settings.Cushion.Default() { + // if leftPadChar == tw.Empty { + // leftPadChar = tw.Space + // } + // if rightPadChar == tw.Empty { + // rightPadChar = tw.Space + // } + //} + + // Calculate padding widths + padLeftWidth := tw.DisplayWidth(leftPadChar) + padRightWidth := tw.DisplayWidth(rightPadChar) + + // Calculate available width for content + availableContentWidth := width - padLeftWidth - padRightWidth + if availableContentWidth < 0 { + availableContentWidth = 0 + } + f.logger.Debugf("Available content width: %d", availableContentWidth) + + // Truncate content if it exceeds available width + if runeWidth > availableContentWidth { + content = tw.TruncateString(content, availableContentWidth) + runeWidth = tw.DisplayWidth(content) + f.logger.Debugf("Truncated content to fit %d: '%s' (new width %d)", availableContentWidth, content, runeWidth) + } + + // Calculate total padding needed + totalPaddingWidth := width - runeWidth + if totalPaddingWidth < 0 { + totalPaddingWidth = 0 + } + f.logger.Debugf("Total padding width: %d", totalPaddingWidth) + + var result strings.Builder + var leftPaddingWidth, rightPaddingWidth int + + // Apply alignment and padding + switch align { + case tw.AlignLeft: + result.WriteString(leftPadChar) + result.WriteString(content) + rightPaddingWidth = totalPaddingWidth - padLeftWidth + if rightPaddingWidth > 0 { + result.WriteString(tw.PadRight(tw.Empty, rightPadChar, rightPaddingWidth)) + f.logger.Debugf("Applied right padding: '%s' for %d width", rightPadChar, rightPaddingWidth) + } + case tw.AlignRight: + leftPaddingWidth = totalPaddingWidth - padRightWidth + if leftPaddingWidth > 0 { + result.WriteString(tw.PadLeft(tw.Empty, leftPadChar, leftPaddingWidth)) + f.logger.Debugf("Applied left padding: '%s' for %d width", leftPadChar, leftPaddingWidth) + } + result.WriteString(content) + result.WriteString(rightPadChar) + case tw.AlignCenter: + leftPaddingWidth = (totalPaddingWidth-padLeftWidth-padRightWidth)/2 + padLeftWidth + rightPaddingWidth = totalPaddingWidth - leftPaddingWidth + if leftPaddingWidth > padLeftWidth { + result.WriteString(tw.PadLeft(tw.Empty, leftPadChar, leftPaddingWidth-padLeftWidth)) + f.logger.Debugf("Applied left centering padding: '%s' for %d width", leftPadChar, leftPaddingWidth-padLeftWidth) + } + result.WriteString(leftPadChar) + result.WriteString(content) + result.WriteString(rightPadChar) + if rightPaddingWidth > padRightWidth { + result.WriteString(tw.PadRight(tw.Empty, rightPadChar, rightPaddingWidth-padRightWidth)) + f.logger.Debugf("Applied right centering padding: '%s' for %d width", rightPadChar, rightPaddingWidth-padRightWidth) + } + default: + // Default to left alignment + result.WriteString(leftPadChar) + result.WriteString(content) + rightPaddingWidth = totalPaddingWidth - padLeftWidth + if rightPaddingWidth > 0 { + result.WriteString(tw.PadRight(tw.Empty, rightPadChar, rightPaddingWidth)) + f.logger.Debugf("Applied right padding: '%s' for %d width", rightPadChar, rightPaddingWidth) + } + } + + output := result.String() + finalWidth := tw.DisplayWidth(output) + // Adjust output to match target width + if finalWidth > width { + output = tw.TruncateString(output, width) + f.logger.Debugf("formatCell: Truncated output to width %d", width) + } else if finalWidth < width { + output = tw.PadRight(output, tw.Space, width) + f.logger.Debugf("formatCell: Padded output to meet width %d", width) + } + + // Log warning if final width doesn't match target + if f.logger.Enabled() && tw.DisplayWidth(output) != width { + f.logger.Debugf("formatCell Warning: Final width %d does not match target %d for result '%s'", + tw.DisplayWidth(output), width, output) + } + + f.logger.Debugf("Formatted cell final result: '%s' (target width %d)", output, width) + return output +} + +// renderLine renders a single line (header, row, or footer) with borders, separators, and merge handling. +func (f *Blueprint) renderLine(ctx tw.Formatting) { + // Get sorted column indices + sortedKeys := ctx.Row.Widths.SortedKeys() + numCols := 0 + if len(sortedKeys) > 0 { + numCols = sortedKeys[len(sortedKeys)-1] + 1 + } + + // Set column separator and borders + columnSeparator := f.config.Symbols.Column() + prefix := tw.Empty + if f.config.Borders.Left.Enabled() { + prefix = columnSeparator + } + suffix := tw.Empty + if f.config.Borders.Right.Enabled() { + suffix = columnSeparator + } + + var output strings.Builder + totalLineWidth := 0 // Track total display width + if prefix != tw.Empty { + output.WriteString(prefix) + totalLineWidth += tw.DisplayWidth(prefix) + f.logger.Debugf("renderLine: Prefix='%s' (f.width %d)", prefix, tw.DisplayWidth(prefix)) + } + + colIndex := 0 + separatorDisplayWidth := 0 + if f.config.Settings.Separators.BetweenColumns.Enabled() { + separatorDisplayWidth = tw.DisplayWidth(columnSeparator) + } + + // Process each column + for colIndex < numCols { + visualWidth := ctx.Row.Widths.Get(colIndex) + cellCtx, ok := ctx.Row.Current[colIndex] + isHMergeStart := ok && cellCtx.Merge.Horizontal.Present && cellCtx.Merge.Horizontal.Start + if visualWidth == 0 && !isHMergeStart { + f.logger.Debugf("renderLine: Skipping col %d (zero width, not HMerge start)", colIndex) + colIndex++ + continue + } + + // Determine if a separator is needed + shouldAddSeparator := false + if colIndex > 0 && f.config.Settings.Separators.BetweenColumns.Enabled() { + prevWidth := ctx.Row.Widths.Get(colIndex - 1) + prevCellCtx, prevOk := ctx.Row.Current[colIndex-1] + prevIsHMergeEnd := prevOk && prevCellCtx.Merge.Horizontal.Present && prevCellCtx.Merge.Horizontal.End + if (prevWidth > 0 || prevIsHMergeEnd) && (!ok || !(cellCtx.Merge.Horizontal.Present && !cellCtx.Merge.Horizontal.Start)) { + shouldAddSeparator = true + } + } + if shouldAddSeparator { + output.WriteString(columnSeparator) + totalLineWidth += separatorDisplayWidth + f.logger.Debugf("renderLine: Added separator '%s' before col %d (f.width %d)", columnSeparator, colIndex, separatorDisplayWidth) + } else if colIndex > 0 { + f.logger.Debugf("renderLine: Skipped separator before col %d due to zero-width prev col or HMerge continuation", colIndex) + } + + // Handle merged cells + span := 1 + if isHMergeStart { + span = cellCtx.Merge.Horizontal.Span + if ctx.Row.Position == tw.Row { + dynamicTotalWidth := 0 + for k := 0; k < span && colIndex+k < numCols; k++ { + normWidth := ctx.NormalizedWidths.Get(colIndex + k) + if normWidth < 0 { + normWidth = 0 + } + dynamicTotalWidth += normWidth + if k > 0 && separatorDisplayWidth > 0 && ctx.NormalizedWidths.Get(colIndex+k) > 0 { + dynamicTotalWidth += separatorDisplayWidth + } + } + visualWidth = dynamicTotalWidth + f.logger.Debugf("renderLine: Row HMerge col %d, span %d, dynamic visualWidth %d", colIndex, span, visualWidth) + } else { + visualWidth = ctx.Row.Widths.Get(colIndex) + f.logger.Debugf("renderLine: H/F HMerge col %d, span %d, pre-adjusted visualWidth %d", colIndex, span, visualWidth) + } + } else { + visualWidth = ctx.Row.Widths.Get(colIndex) + f.logger.Debugf("renderLine: Regular col %d, visualWidth %d", colIndex, visualWidth) + } + if visualWidth < 0 { + visualWidth = 0 + } + + // Skip processing for non-start merged cells + if ok && cellCtx.Merge.Horizontal.Present && !cellCtx.Merge.Horizontal.Start { + f.logger.Debugf("renderLine: Skipping col %d processing (part of HMerge)", colIndex) + colIndex++ + continue + } + + // Handle empty cell context + if !ok { + if visualWidth > 0 { + spaces := strings.Repeat(tw.Space, visualWidth) + output.WriteString(spaces) + totalLineWidth += visualWidth + f.logger.Debugf("renderLine: No cell context for col %d, writing %d spaces (f.width %d)", colIndex, visualWidth, visualWidth) + } else { + f.logger.Debugf("renderLine: No cell context for col %d, visualWidth is 0, writing nothing", colIndex) + } + colIndex += span + continue + } + + // Set cell padding and alignment + padding := cellCtx.Padding + align := cellCtx.Align + if align == tw.AlignNone { + if ctx.Row.Position == tw.Header { + align = tw.AlignCenter + } else if ctx.Row.Position == tw.Footer { + align = tw.AlignRight + } else { + align = tw.AlignLeft + } + f.logger.Debugf("renderLine: col %d (data: '%s') using renderer default align '%s' for position %s.", colIndex, cellCtx.Data, align, ctx.Row.Position) + } else if align == tw.Skip { + if ctx.Row.Position == tw.Header { + align = tw.AlignCenter + } else if ctx.Row.Position == tw.Footer { + align = tw.AlignRight + } else { + align = tw.AlignLeft + } + f.logger.Debugf("renderLine: col %d (data: '%s') cellCtx.Align was Skip/empty, falling back to basic default '%s'.", colIndex, cellCtx.Data, align) + } + + isTotalPattern := false + + // Override alignment for footer merged cells + if (ctx.Row.Position == tw.Footer && isHMergeStart) || isTotalPattern { + if align != tw.AlignRight { + f.logger.Debugf("renderLine: Applying AlignRight HMerge/TOTAL override for Footer col %d. Original/default align was: %s", colIndex, align) + align = tw.AlignRight + } + } + + // Handle vertical/hierarchical merges + cellData := cellCtx.Data + if (cellCtx.Merge.Vertical.Present && !cellCtx.Merge.Vertical.Start) || + (cellCtx.Merge.Hierarchical.Present && !cellCtx.Merge.Hierarchical.Start) { + cellData = tw.Empty + f.logger.Debugf("renderLine: Blanked data for col %d (non-start V/Hierarchical)", colIndex) + } + + // Format and render the cell + formattedCell := f.formatCell(cellData, visualWidth, padding, align) + if len(formattedCell) > 0 { + output.WriteString(formattedCell) + cellWidth := tw.DisplayWidth(formattedCell) + totalLineWidth += cellWidth + f.logger.Debugf("renderLine: Rendered col %d, formattedCell='%s' (f.width %d), totalLineWidth=%d", colIndex, formattedCell, cellWidth, totalLineWidth) + } + + // Log rendering details + if isHMergeStart { + f.logger.Debugf("renderLine: Rendered HMerge START col %d (span %d, visualWidth %d, align %v): '%s'", + colIndex, span, visualWidth, align, formattedCell) + } else { + f.logger.Debugf("renderLine: Rendered regular col %d (visualWidth %d, align %v): '%s'", + colIndex, visualWidth, align, formattedCell) + } + colIndex += span + } + + // Add suffix and adjust total width + if output.Len() > len(prefix) || f.config.Borders.Right.Enabled() { + output.WriteString(suffix) + totalLineWidth += tw.DisplayWidth(suffix) + f.logger.Debugf("renderLine: Suffix='%s' (f.width %d)", suffix, tw.DisplayWidth(suffix)) + } + output.WriteString(tw.NewLine) + f.w.Write([]byte(output.String())) + f.logger.Debugf("renderLine: Final rendered line: '%s' (total width %d)", strings.TrimSuffix(output.String(), tw.NewLine), totalLineWidth) +} + +func (f *Blueprint) Rendition(config tw.Rendition) { + f.config = mergeRendition(f.config, config) + f.logger.Debugf("Blueprint.Rendition updated. New internal config: %+v", f.config) +} + +// Ensure Blueprint implements tw.Renditioning +var _ tw.Renditioning = (*Blueprint)(nil) diff --git a/vendor/github.com/olekukonko/tablewriter/renderer/colorized.go b/vendor/github.com/olekukonko/tablewriter/renderer/colorized.go new file mode 100644 index 0000000..2f4a086 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/renderer/colorized.go @@ -0,0 +1,719 @@ +package renderer + +import ( + "github.com/fatih/color" + "github.com/olekukonko/ll" + "github.com/olekukonko/ll/lh" + "io" + "strings" + + "github.com/olekukonko/tablewriter/tw" +) + +// ColorizedConfig holds configuration for the Colorized table renderer. +type ColorizedConfig struct { + Borders tw.Border // Border visibility settings + Settings tw.Settings // Rendering behavior settings (e.g., separators, whitespace) + Header Tint // Colors for header cells + Column Tint // Colors for row cells + Footer Tint // Colors for footer cells + Border Tint // Colors for borders and lines + Separator Tint // Colors for column separators + Symbols tw.Symbols // Symbols for table drawing (e.g., corners, lines) +} + +// Colors is a slice of color attributes for use with fatih/color, such as color.FgWhite or color.Bold. +type Colors []color.Attribute + +// Tint defines foreground and background color settings for table elements, with optional per-column overrides. +type Tint struct { + FG Colors // Foreground color attributes + BG Colors // Background color attributes + Columns []Tint // Per-column color settings +} + +// Apply applies the Tint's foreground and background colors to the given text, returning the text unchanged if no colors are set. +func (t Tint) Apply(text string) string { + if len(t.FG) == 0 && len(t.BG) == 0 { + return text + } + // Combine foreground and background colors + combinedColors := append(t.FG, t.BG...) + // Create a color function and apply it to the text + c := color.New(combinedColors...).SprintFunc() + return c(text) +} + +// Colorized renders colored ASCII tables with customizable borders, colors, and alignments. +type Colorized struct { + config ColorizedConfig // Renderer configuration + trace []string // Debug trace messages + newLine string // Newline character + defaultAlign map[tw.Position]tw.Align // Default alignments for header, row, and footer + logger *ll.Logger // Logger for debug messages + w io.Writer +} + +// NewColorized creates a Colorized renderer with the specified configuration, falling back to defaults if none provided. +// Only the first config is used if multiple are passed. +func NewColorized(configs ...ColorizedConfig) *Colorized { + // Initialize with default configuration + baseCfg := defaultColorized() + + if len(configs) > 0 { + userCfg := configs[0] + + // Override border settings if provided + if userCfg.Borders.Left != 0 { + baseCfg.Borders.Left = userCfg.Borders.Left + } + if userCfg.Borders.Right != 0 { + baseCfg.Borders.Right = userCfg.Borders.Right + } + if userCfg.Borders.Top != 0 { + baseCfg.Borders.Top = userCfg.Borders.Top + } + if userCfg.Borders.Bottom != 0 { + baseCfg.Borders.Bottom = userCfg.Borders.Bottom + } + + // Merge separator and line settings + baseCfg.Settings.Separators = mergeSeparators(baseCfg.Settings.Separators, userCfg.Settings.Separators) + baseCfg.Settings.Lines = mergeLines(baseCfg.Settings.Lines, userCfg.Settings.Lines) + + // Override compact mode if specified + if userCfg.Settings.CompactMode != 0 { + baseCfg.Settings.CompactMode = userCfg.Settings.CompactMode + } + + // Override color settings for various table elements + if len(userCfg.Header.FG) > 0 || len(userCfg.Header.BG) > 0 || userCfg.Header.Columns != nil { + baseCfg.Header = userCfg.Header + } + if len(userCfg.Column.FG) > 0 || len(userCfg.Column.BG) > 0 || userCfg.Column.Columns != nil { + baseCfg.Column = userCfg.Column + } + if len(userCfg.Footer.FG) > 0 || len(userCfg.Footer.BG) > 0 || userCfg.Footer.Columns != nil { + baseCfg.Footer = userCfg.Footer + } + if len(userCfg.Border.FG) > 0 || len(userCfg.Border.BG) > 0 || userCfg.Border.Columns != nil { + baseCfg.Border = userCfg.Border + } + if len(userCfg.Separator.FG) > 0 || len(userCfg.Separator.BG) > 0 || userCfg.Separator.Columns != nil { + baseCfg.Separator = userCfg.Separator + } + + // Override symbols if provided + if userCfg.Symbols != nil { + baseCfg.Symbols = userCfg.Symbols + } + } + + cfg := baseCfg + // Ensure symbols are initialized + if cfg.Symbols == nil { + cfg.Symbols = tw.NewSymbols(tw.StyleLight) + } + + // Initialize the Colorized renderer + f := &Colorized{ + config: cfg, + newLine: tw.NewLine, + defaultAlign: map[tw.Position]tw.Align{ + tw.Header: tw.AlignCenter, + tw.Row: tw.AlignLeft, + tw.Footer: tw.AlignRight, + }, + logger: ll.New("colorized", ll.WithHandler(lh.NewMemoryHandler())), + } + // Log initialization details + f.logger.Debugf("Initialized Colorized renderer with symbols: Center=%q, Row=%q, Column=%q", f.config.Symbols.Center(), f.config.Symbols.Row(), f.config.Symbols.Column()) + f.logger.Debugf("Final ColorizedConfig.Settings.Lines: %+v", f.config.Settings.Lines) + f.logger.Debugf("Final ColorizedConfig.Borders: %+v", f.config.Borders) + return f +} + +// Close performs cleanup (no-op in this implementation). +func (c *Colorized) Close() error { + c.logger.Debug("Colorized.Close() called (no-op).") + return nil +} + +// Config returns the renderer's configuration as a Rendition. +func (c *Colorized) Config() tw.Rendition { + return tw.Rendition{ + Borders: c.config.Borders, + Settings: c.config.Settings, + Symbols: c.config.Symbols, + Streaming: true, + } +} + +// Debug returns the accumulated debug trace messages. +func (c *Colorized) Debug() []string { + return c.trace +} + +// Footer renders the table footer with configured colors and formatting. +func (c *Colorized) Footer(footers [][]string, ctx tw.Formatting) { + c.logger.Debugf("Starting Footer render: IsSubRow=%v, Location=%v, Pos=%s", + ctx.IsSubRow, ctx.Row.Location, ctx.Row.Position) + + // Check if there are footers to render + if len(footers) == 0 || len(footers[0]) == 0 { + c.logger.Debug("Footer: No footers to render") + return + } + + // Render the footer line + c.renderLine(ctx, footers[0], c.config.Footer) + c.logger.Debug("Completed Footer render") +} + +// Header renders the table header with configured colors and formatting. +func (c *Colorized) Header(headers [][]string, ctx tw.Formatting) { + c.logger.Debugf("Starting Header render: IsSubRow=%v, Location=%v, Pos=%s, lines=%d, widths=%v", + ctx.IsSubRow, ctx.Row.Location, ctx.Row.Position, len(headers), ctx.Row.Widths) + + // Check if there are headers to render + if len(headers) == 0 || len(headers[0]) == 0 { + c.logger.Debug("Header: No headers to render") + return + } + + // Render the header line + c.renderLine(ctx, headers[0], c.config.Header) + c.logger.Debug("Completed Header render") +} + +// Line renders a horizontal row line with colored junctions and segments, skipping zero-width columns. +func (c *Colorized) Line(ctx tw.Formatting) { + c.logger.Debugf("Line: Starting with Level=%v, Location=%v, IsSubRow=%v, Widths=%v", ctx.Level, ctx.Row.Location, ctx.IsSubRow, ctx.Row.Widths) + + // Initialize junction renderer + jr := NewJunction(JunctionContext{ + Symbols: c.config.Symbols, + Ctx: ctx, + ColIdx: 0, + BorderTint: c.config.Border, + SeparatorTint: c.config.Separator, + Logger: c.logger, + }) + + var line strings.Builder + + // Get sorted column indices and filter out zero-width columns + allSortedKeys := ctx.Row.Widths.SortedKeys() + effectiveKeys := []int{} + keyWidthMap := make(map[int]int) + + for _, k := range allSortedKeys { + width := ctx.Row.Widths.Get(k) + keyWidthMap[k] = width + if width > 0 { + effectiveKeys = append(effectiveKeys, k) + } + } + c.logger.Debugf("Line: All keys=%v, Effective keys (width>0)=%v", allSortedKeys, effectiveKeys) + + // Handle case with no effective columns + if len(effectiveKeys) == 0 { + prefix := tw.Empty + suffix := tw.Empty + if c.config.Borders.Left.Enabled() { + prefix = jr.RenderLeft() + } + if c.config.Borders.Right.Enabled() { + originalLastColIdx := -1 + if len(allSortedKeys) > 0 { + originalLastColIdx = allSortedKeys[len(allSortedKeys)-1] + } + suffix = jr.RenderRight(originalLastColIdx) + } + if prefix != tw.Empty || suffix != tw.Empty { + line.WriteString(prefix + suffix + tw.NewLine) + c.w.Write([]byte(line.String())) + } + c.logger.Debug("Line: Handled empty row/widths case (no effective keys)") + return + } + + // Add left border if enabled + if c.config.Borders.Left.Enabled() { + line.WriteString(jr.RenderLeft()) + } + + // Render segments for each effective column + for keyIndex, currentColIdx := range effectiveKeys { + jr.colIdx = currentColIdx + segment := jr.GetSegment() + colWidth := keyWidthMap[currentColIdx] + c.logger.Debugf("Line: Drawing segment for Effective colIdx=%d, segment='%s', width=%d", currentColIdx, segment, colWidth) + + if segment == tw.Empty { + line.WriteString(strings.Repeat(tw.Space, colWidth)) + } else { + // Calculate how many times to repeat the segment + segmentWidth := tw.DisplayWidth(segment) + if segmentWidth <= 0 { + segmentWidth = 1 + } + repeat := 0 + if colWidth > 0 && segmentWidth > 0 { + repeat = colWidth / segmentWidth + } + drawnSegment := strings.Repeat(segment, repeat) + line.WriteString(drawnSegment) + + // Adjust for width discrepancies + actualDrawnWidth := tw.DisplayWidth(drawnSegment) + if actualDrawnWidth < colWidth { + missingWidth := colWidth - actualDrawnWidth + spaces := strings.Repeat(tw.Space, missingWidth) + if len(c.config.Border.BG) > 0 { + line.WriteString(Tint{BG: c.config.Border.BG}.Apply(spaces)) + } else { + line.WriteString(spaces) + } + c.logger.Debugf("Line: colIdx=%d corrected segment width, added %d spaces", currentColIdx, missingWidth) + } else if actualDrawnWidth > colWidth { + c.logger.Debugf("Line: WARNING colIdx=%d segment draw width %d > target %d", currentColIdx, actualDrawnWidth, colWidth) + } + } + + // Add junction between columns if not the last visible column + isLastVisible := keyIndex == len(effectiveKeys)-1 + if !isLastVisible && c.config.Settings.Separators.BetweenColumns.Enabled() { + nextVisibleColIdx := effectiveKeys[keyIndex+1] + originalPrecedingCol := -1 + foundCurrent := false + for _, k := range allSortedKeys { + if k == currentColIdx { + foundCurrent = true + } + if foundCurrent && k < nextVisibleColIdx { + originalPrecedingCol = k + } + if k >= nextVisibleColIdx { + break + } + } + + if originalPrecedingCol != -1 { + jr.colIdx = originalPrecedingCol + junction := jr.RenderJunction(originalPrecedingCol, nextVisibleColIdx) + c.logger.Debugf("Line: Junction between visible %d (orig preceding %d) and next visible %d: '%s'", currentColIdx, originalPrecedingCol, nextVisibleColIdx, junction) + line.WriteString(junction) + } else { + c.logger.Debugf("Line: Could not determine original preceding column for junction before visible %d", nextVisibleColIdx) + line.WriteString(c.config.Separator.Apply(jr.sym.Center())) + } + } + } + + // Add right border if enabled + if c.config.Borders.Right.Enabled() { + originalLastColIdx := -1 + if len(allSortedKeys) > 0 { + originalLastColIdx = allSortedKeys[len(allSortedKeys)-1] + } + jr.colIdx = originalLastColIdx + line.WriteString(jr.RenderRight(originalLastColIdx)) + } + + // Write the final line + line.WriteString(c.newLine) + c.w.Write([]byte(line.String())) + c.logger.Debugf("Line rendered: %s", strings.TrimSuffix(line.String(), c.newLine)) +} + +// Logger sets the logger for the Colorized instance. +func (c *Colorized) Logger(logger *ll.Logger) { + c.logger = logger.Namespace("colorized") +} + +// Reset clears the renderer's internal state, including debug traces. +func (c *Colorized) Reset() { + c.trace = nil + c.logger.Debugf("Reset: Cleared debug trace") +} + +// Row renders a table data row with configured colors and formatting. +func (c *Colorized) Row(row []string, ctx tw.Formatting) { + c.logger.Debugf("Starting Row render: IsSubRow=%v, Location=%v, Pos=%s, hasFooter=%v", + ctx.IsSubRow, ctx.Row.Location, ctx.Row.Position, ctx.HasFooter) + + // Check if there is data to render + if len(row) == 0 { + c.logger.Debugf("Row: No data to render") + return + } + + // Render the row line + c.renderLine(ctx, row, c.config.Column) + c.logger.Debugf("Completed Row render") +} + +// Start initializes the rendering process (no-op in this implementation). +func (c *Colorized) Start(w io.Writer) error { + c.w = w + c.logger.Debugf("Colorized.Start() called (no-op).") + return nil +} + +// formatCell formats a cell's content with color, width, padding, and alignment, handling whitespace trimming and truncation. +func (c *Colorized) formatCell(content string, width int, padding tw.Padding, align tw.Align, tint Tint) string { + c.logger.Debugf("Formatting cell: content='%s', width=%d, align=%s, paddingL='%s', paddingR='%s', tintFG=%v, tintBG=%v", + content, width, align, padding.Left, padding.Right, tint.FG, tint.BG) + + // Return empty string if width is non-positive + if width <= 0 { + c.logger.Debugf("formatCell: width %d <= 0, returning empty string", width) + return tw.Empty + } + + // Calculate visual width of content + contentVisualWidth := tw.DisplayWidth(content) + + // Set default padding characters + padLeftCharStr := padding.Left + if padLeftCharStr == tw.Empty { + padLeftCharStr = tw.Space + } + padRightCharStr := padding.Right + if padRightCharStr == tw.Empty { + padRightCharStr = tw.Space + } + + // Calculate padding widths + definedPadLeftWidth := tw.DisplayWidth(padLeftCharStr) + definedPadRightWidth := tw.DisplayWidth(padRightCharStr) + // Calculate available width for content and alignment + availableForContentAndAlign := width - definedPadLeftWidth - definedPadRightWidth + if availableForContentAndAlign < 0 { + availableForContentAndAlign = 0 + } + + // Truncate content if it exceeds available width + if contentVisualWidth > availableForContentAndAlign { + content = tw.TruncateString(content, availableForContentAndAlign) + contentVisualWidth = tw.DisplayWidth(content) + c.logger.Debugf("Truncated content to fit %d: '%s' (new width %d)", availableForContentAndAlign, content, contentVisualWidth) + } + + // Calculate remaining space for alignment + remainingSpaceForAlignment := availableForContentAndAlign - contentVisualWidth + if remainingSpaceForAlignment < 0 { + remainingSpaceForAlignment = 0 + } + + // Apply alignment padding + leftAlignmentPadSpaces := tw.Empty + rightAlignmentPadSpaces := tw.Empty + switch align { + case tw.AlignLeft: + rightAlignmentPadSpaces = strings.Repeat(tw.Space, remainingSpaceForAlignment) + case tw.AlignRight: + leftAlignmentPadSpaces = strings.Repeat(tw.Space, remainingSpaceForAlignment) + case tw.AlignCenter: + leftSpacesCount := remainingSpaceForAlignment / 2 + rightSpacesCount := remainingSpaceForAlignment - leftSpacesCount + leftAlignmentPadSpaces = strings.Repeat(tw.Space, leftSpacesCount) + rightAlignmentPadSpaces = strings.Repeat(tw.Space, rightSpacesCount) + default: + // Default to left alignment + rightAlignmentPadSpaces = strings.Repeat(tw.Space, remainingSpaceForAlignment) + } + + // Apply colors to content and padding + coloredContent := tint.Apply(content) + coloredPadLeft := padLeftCharStr + coloredPadRight := padRightCharStr + coloredAlignPadLeft := leftAlignmentPadSpaces + coloredAlignPadRight := rightAlignmentPadSpaces + + if len(tint.BG) > 0 { + bgTint := Tint{BG: tint.BG} + // Apply foreground color to non-space padding if foreground is defined + if len(tint.FG) > 0 && padLeftCharStr != tw.Space { + coloredPadLeft = tint.Apply(padLeftCharStr) + } else { + coloredPadLeft = bgTint.Apply(padLeftCharStr) + } + if len(tint.FG) > 0 && padRightCharStr != tw.Space { + coloredPadRight = tint.Apply(padRightCharStr) + } else { + coloredPadRight = bgTint.Apply(padRightCharStr) + } + // Apply background color to alignment padding + if leftAlignmentPadSpaces != tw.Empty { + coloredAlignPadLeft = bgTint.Apply(leftAlignmentPadSpaces) + } + if rightAlignmentPadSpaces != tw.Empty { + coloredAlignPadRight = bgTint.Apply(rightAlignmentPadSpaces) + } + } else if len(tint.FG) > 0 { + // Apply foreground color to non-space padding + if padLeftCharStr != tw.Space { + coloredPadLeft = tint.Apply(padLeftCharStr) + } + if padRightCharStr != tw.Space { + coloredPadRight = tint.Apply(padRightCharStr) + } + } + + // Build final cell string + var sb strings.Builder + sb.WriteString(coloredPadLeft) + sb.WriteString(coloredAlignPadLeft) + sb.WriteString(coloredContent) + sb.WriteString(coloredAlignPadRight) + sb.WriteString(coloredPadRight) + output := sb.String() + + // Adjust output width if necessary + currentVisualWidth := tw.DisplayWidth(output) + if currentVisualWidth != width { + c.logger.Debugf("formatCell MISMATCH: content='%s', target_w=%d. Calculated parts width = %d. String: '%s'", + content, width, currentVisualWidth, output) + if currentVisualWidth > width { + output = tw.TruncateString(output, width) + } else { + paddingSpacesStr := strings.Repeat(tw.Space, width-currentVisualWidth) + if len(tint.BG) > 0 { + output += Tint{BG: tint.BG}.Apply(paddingSpacesStr) + } else { + output += paddingSpacesStr + } + } + c.logger.Debugf("formatCell Post-Correction: Target %d, New Visual width %d. Output: '%s'", width, tw.DisplayWidth(output), output) + } + + c.logger.Debugf("Formatted cell final result: '%s' (target width %d, display width %d)", output, width, tw.DisplayWidth(output)) + return output +} + +// renderLine renders a single line (header, row, or footer) with colors, handling merges and separators. +func (c *Colorized) renderLine(ctx tw.Formatting, line []string, tint Tint) { + // Determine number of columns + numCols := 0 + if len(ctx.Row.Current) > 0 { + maxKey := -1 + for k := range ctx.Row.Current { + if k > maxKey { + maxKey = k + } + } + numCols = maxKey + 1 + } else { + maxKey := -1 + for k := range ctx.Row.Widths { + if k > maxKey { + maxKey = k + } + } + numCols = maxKey + 1 + } + + var output strings.Builder + + // Add left border if enabled + prefix := tw.Empty + if c.config.Borders.Left.Enabled() { + prefix = c.config.Border.Apply(c.config.Symbols.Column()) + } + output.WriteString(prefix) + + // Set up separator + separatorDisplayWidth := 0 + separatorString := tw.Empty + if c.config.Settings.Separators.BetweenColumns.Enabled() { + separatorString = c.config.Separator.Apply(c.config.Symbols.Column()) + separatorDisplayWidth = tw.DisplayWidth(c.config.Symbols.Column()) + } + + // Process each column + for i := 0; i < numCols; { + // Determine if a separator is needed + shouldAddSeparator := false + if i > 0 && c.config.Settings.Separators.BetweenColumns.Enabled() { + cellCtx, ok := ctx.Row.Current[i] + if !ok || !(cellCtx.Merge.Horizontal.Present && !cellCtx.Merge.Horizontal.Start) { + shouldAddSeparator = true + } + } + if shouldAddSeparator { + output.WriteString(separatorString) + c.logger.Debugf("renderLine: Added separator '%s' before col %d", separatorString, i) + } else if i > 0 { + c.logger.Debugf("renderLine: Skipped separator before col %d due to HMerge continuation", i) + } + + // Get cell context, use default if not present + cellCtx, ok := ctx.Row.Current[i] + if !ok { + cellCtx = tw.CellContext{ + Data: tw.Empty, + Align: c.defaultAlign[ctx.Row.Position], + Padding: tw.Padding{Left: tw.Space, Right: tw.Space}, + Width: ctx.Row.Widths.Get(i), + Merge: tw.MergeState{}, + } + } + + // Handle merged cells + visualWidth := 0 + span := 1 + isHMergeStart := ok && cellCtx.Merge.Horizontal.Present && cellCtx.Merge.Horizontal.Start + + if isHMergeStart { + span = cellCtx.Merge.Horizontal.Span + if ctx.Row.Position == tw.Row { + // Calculate dynamic width for row merges + dynamicTotalWidth := 0 + for k := 0; k < span && i+k < numCols; k++ { + colToSum := i + k + normWidth := ctx.NormalizedWidths.Get(colToSum) + if normWidth < 0 { + normWidth = 0 + } + dynamicTotalWidth += normWidth + if k > 0 && separatorDisplayWidth > 0 { + dynamicTotalWidth += separatorDisplayWidth + } + } + visualWidth = dynamicTotalWidth + c.logger.Debugf("renderLine: Row HMerge col %d, span %d, dynamic visualWidth %d", i, span, visualWidth) + } else { + visualWidth = ctx.Row.Widths.Get(i) + c.logger.Debugf("renderLine: H/F HMerge col %d, span %d, pre-adjusted visualWidth %d", i, span, visualWidth) + } + } else { + visualWidth = ctx.Row.Widths.Get(i) + c.logger.Debugf("renderLine: Regular col %d, visualWidth %d", i, visualWidth) + } + if visualWidth < 0 { + visualWidth = 0 + } + + // Skip processing for non-start merged cells + if ok && cellCtx.Merge.Horizontal.Present && !cellCtx.Merge.Horizontal.Start { + c.logger.Debugf("renderLine: Skipping col %d processing (part of HMerge)", i) + i++ + continue + } + + // Handle empty cell context with non-zero width + if !ok && visualWidth > 0 { + spaces := strings.Repeat(tw.Space, visualWidth) + if len(tint.BG) > 0 { + output.WriteString(Tint{BG: tint.BG}.Apply(spaces)) + } else { + output.WriteString(spaces) + } + c.logger.Debugf("renderLine: No cell context for col %d, writing %d spaces", i, visualWidth) + i += span + continue + } + + // Set cell alignment + padding := cellCtx.Padding + align := cellCtx.Align + if align == tw.AlignNone { + align = c.defaultAlign[ctx.Row.Position] + c.logger.Debugf("renderLine: col %d using default renderer align '%s' for position %s because cellCtx.Align was AlignNone", i, align, ctx.Row.Position) + } + + // Detect and handle TOTAL pattern + isTotalPattern := false + if i == 0 && isHMergeStart && cellCtx.Merge.Horizontal.Span >= 3 && strings.TrimSpace(cellCtx.Data) == "TOTAL" { + isTotalPattern = true + c.logger.Debugf("renderLine: Detected 'TOTAL' HMerge pattern at col 0") + } + // Override alignment for footer merges or TOTAL pattern + if (ctx.Row.Position == tw.Footer && isHMergeStart) || isTotalPattern { + if align != tw.AlignRight { + c.logger.Debugf("renderLine: Applying AlignRight override for Footer HMerge/TOTAL pattern at col %d. Original/default align was: %s", i, align) + align = tw.AlignRight + } + } + + // Handle vertical/hierarchical merges + content := cellCtx.Data + if (cellCtx.Merge.Vertical.Present && !cellCtx.Merge.Vertical.Start) || + (cellCtx.Merge.Hierarchical.Present && !cellCtx.Merge.Hierarchical.Start) { + content = tw.Empty + c.logger.Debugf("renderLine: Blanked data for col %d (non-start V/Hierarchical)", i) + } + + // Apply per-column tint if available + cellTint := tint + if i < len(tint.Columns) { + columnTint := tint.Columns[i] + if len(columnTint.FG) > 0 || len(columnTint.BG) > 0 { + cellTint = columnTint + } + } + + // Format and render the cell + formattedCell := c.formatCell(content, visualWidth, padding, align, cellTint) + if len(formattedCell) > 0 { + output.WriteString(formattedCell) + } else if visualWidth == 0 && isHMergeStart { + c.logger.Debugf("renderLine: Rendered HMerge START col %d resulted in 0 visual width, wrote nothing.", i) + } else if visualWidth == 0 { + c.logger.Debugf("renderLine: Rendered regular col %d resulted in 0 visual width, wrote nothing.", i) + } + + // Log rendering details + if isHMergeStart { + c.logger.Debugf("renderLine: Rendered HMerge START col %d (span %d, visualWidth %d, align %s): '%s'", + i, span, visualWidth, align, formattedCell) + } else { + c.logger.Debugf("renderLine: Rendered regular col %d (visualWidth %d, align %s): '%s'", + i, visualWidth, align, formattedCell) + } + + i += span + } + + // Add right border if enabled + suffix := tw.Empty + if c.config.Borders.Right.Enabled() { + suffix = c.config.Border.Apply(c.config.Symbols.Column()) + } + output.WriteString(suffix) + + // Write the final line + output.WriteString(c.newLine) + c.w.Write([]byte(output.String())) + c.logger.Debugf("renderLine: Final rendered line: %s", strings.TrimSuffix(output.String(), c.newLine)) +} + +// Rendition updates the parts of ColorizedConfig that correspond to tw.Rendition +// by merging the provided newRendition. Color-specific Tints are not modified. +func (c *Colorized) Rendition(newRendition tw.Rendition) { // Method name matches interface + c.logger.Debug("Colorized.Rendition called. Current B/Sym/Set: B:%+v, Sym:%T, S:%+v. Override: %+v", + c.config.Borders, c.config.Symbols, c.config.Settings, newRendition) + + currentRenditionPart := tw.Rendition{ + Borders: c.config.Borders, + Symbols: c.config.Symbols, + Settings: c.config.Settings, + } + + mergedRenditionPart := mergeRendition(currentRenditionPart, newRendition) + + c.config.Borders = mergedRenditionPart.Borders + c.config.Symbols = mergedRenditionPart.Symbols + if c.config.Symbols == nil { + c.config.Symbols = tw.NewSymbols(tw.StyleLight) + } + c.config.Settings = mergedRenditionPart.Settings + + c.logger.Debugf("Colorized.Rendition updated. New B/Sym/Set: B:%+v, Sym:%T, S:%+v", + c.config.Borders, c.config.Symbols, c.config.Settings) +} + +// Ensure Colorized implements tw.Renditioning +var _ tw.Renditioning = (*Colorized)(nil) diff --git a/vendor/github.com/olekukonko/tablewriter/renderer/fn.go b/vendor/github.com/olekukonko/tablewriter/renderer/fn.go new file mode 100644 index 0000000..3bda04f --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/renderer/fn.go @@ -0,0 +1,236 @@ +package renderer + +import ( + "fmt" + "github.com/fatih/color" + "github.com/olekukonko/tablewriter/tw" +) + +// defaultBlueprint returns a default Rendition for ASCII table rendering with borders and light symbols. +func defaultBlueprint() tw.Rendition { + return tw.Rendition{ + Borders: tw.Border{ + Left: tw.On, + Right: tw.On, + Top: tw.On, + Bottom: tw.On, + }, + Settings: tw.Settings{ + Separators: tw.Separators{ + ShowHeader: tw.On, + ShowFooter: tw.On, + BetweenRows: tw.Off, + BetweenColumns: tw.On, + }, + Lines: tw.Lines{ + ShowTop: tw.On, + ShowBottom: tw.On, + ShowHeaderLine: tw.On, + ShowFooterLine: tw.On, + }, + CompactMode: tw.Off, + // Cushion: tw.On, + }, + Symbols: tw.NewSymbols(tw.StyleLight), + Streaming: true, + } +} + +// defaultColorized returns a default ColorizedConfig optimized for dark terminal backgrounds with colored headers, rows, and borders. +func defaultColorized() ColorizedConfig { + return ColorizedConfig{ + Borders: tw.Border{Left: tw.On, Right: tw.On, Top: tw.On, Bottom: tw.On}, + Settings: tw.Settings{ + Separators: tw.Separators{ + ShowHeader: tw.On, + ShowFooter: tw.On, + BetweenRows: tw.Off, + BetweenColumns: tw.On, + }, + Lines: tw.Lines{ + ShowTop: tw.On, + ShowBottom: tw.On, + ShowHeaderLine: tw.On, + ShowFooterLine: tw.On, + }, + + CompactMode: tw.Off, + }, + Header: Tint{ + FG: Colors{color.FgWhite, color.Bold}, + BG: Colors{color.BgBlack}, + }, + Column: Tint{ + FG: Colors{color.FgCyan}, + BG: Colors{color.BgBlack}, + }, + Footer: Tint{ + FG: Colors{color.FgYellow}, + BG: Colors{color.BgBlack}, + }, + Border: Tint{ + FG: Colors{color.FgWhite}, + BG: Colors{color.BgBlack}, + }, + Separator: Tint{ + FG: Colors{color.FgWhite}, + BG: Colors{color.BgBlack}, + }, + Symbols: tw.NewSymbols(tw.StyleLight), + } +} + +// defaultOceanRendererConfig returns a base tw.Rendition for the Ocean renderer. +func defaultOceanRendererConfig() tw.Rendition { + + return tw.Rendition{ + Borders: tw.Border{ + Left: tw.On, Right: tw.On, Top: tw.On, Bottom: tw.On, + }, + Settings: tw.Settings{ + Separators: tw.Separators{ + ShowHeader: tw.On, + ShowFooter: tw.Off, + BetweenRows: tw.Off, + BetweenColumns: tw.On, + }, + Lines: tw.Lines{ + ShowTop: tw.On, + ShowBottom: tw.On, + ShowHeaderLine: tw.On, + ShowFooterLine: tw.Off, + }, + + CompactMode: tw.Off, + }, + Symbols: tw.NewSymbols(tw.StyleDefault), + Streaming: true, + } +} + +// getHTMLStyle remains the same +func getHTMLStyle(align tw.Align) string { + styleContent := tw.Empty + switch align { + case tw.AlignRight: + styleContent = "text-align: right;" + case tw.AlignCenter: + styleContent = "text-align: center;" + case tw.AlignLeft: + styleContent = "text-align: left;" + } + if styleContent != tw.Empty { + return fmt.Sprintf(` style="%s"`, styleContent) + } + return tw.Empty +} + +// mergeLines combines default and override line settings, preserving defaults for unset (zero) overrides. +func mergeLines(defaults, overrides tw.Lines) tw.Lines { + if overrides.ShowTop != 0 { + defaults.ShowTop = overrides.ShowTop + } + if overrides.ShowBottom != 0 { + defaults.ShowBottom = overrides.ShowBottom + } + if overrides.ShowHeaderLine != 0 { + defaults.ShowHeaderLine = overrides.ShowHeaderLine + } + if overrides.ShowFooterLine != 0 { + defaults.ShowFooterLine = overrides.ShowFooterLine + } + return defaults +} + +// mergeSeparators combines default and override separator settings, preserving defaults for unset (zero) overrides. +func mergeSeparators(defaults, overrides tw.Separators) tw.Separators { + if overrides.ShowHeader != 0 { + defaults.ShowHeader = overrides.ShowHeader + } + if overrides.ShowFooter != 0 { + defaults.ShowFooter = overrides.ShowFooter + } + if overrides.BetweenRows != 0 { + defaults.BetweenRows = overrides.BetweenRows + } + if overrides.BetweenColumns != 0 { + defaults.BetweenColumns = overrides.BetweenColumns + } + return defaults +} + +// mergeSettings combines default and override settings, preserving defaults for unset (zero) overrides. +func mergeSettings(defaults, overrides tw.Settings) tw.Settings { + if overrides.Separators.ShowHeader != tw.Unknown { + defaults.Separators.ShowHeader = overrides.Separators.ShowHeader + } + if overrides.Separators.ShowFooter != tw.Unknown { + defaults.Separators.ShowFooter = overrides.Separators.ShowFooter + } + if overrides.Separators.BetweenRows != tw.Unknown { + defaults.Separators.BetweenRows = overrides.Separators.BetweenRows + } + if overrides.Separators.BetweenColumns != tw.Unknown { + defaults.Separators.BetweenColumns = overrides.Separators.BetweenColumns + } + if overrides.Lines.ShowTop != tw.Unknown { + defaults.Lines.ShowTop = overrides.Lines.ShowTop + } + if overrides.Lines.ShowBottom != tw.Unknown { + defaults.Lines.ShowBottom = overrides.Lines.ShowBottom + } + if overrides.Lines.ShowHeaderLine != tw.Unknown { + defaults.Lines.ShowHeaderLine = overrides.Lines.ShowHeaderLine + } + if overrides.Lines.ShowFooterLine != tw.Unknown { + defaults.Lines.ShowFooterLine = overrides.Lines.ShowFooterLine + } + + if overrides.CompactMode != tw.Unknown { + defaults.CompactMode = overrides.CompactMode + } + + //if overrides.Cushion != tw.Unknown { + // defaults.Cushion = overrides.Cushion + //} + + return defaults +} + +// MergeRendition merges the 'override' rendition into the 'current' rendition. +// It only updates fields in 'current' if they are explicitly set (non-zero/non-nil) in 'override'. +// This allows for partial updates to a renderer's configuration. +func mergeRendition(current, override tw.Rendition) tw.Rendition { + // Merge Borders: Only update if override border states are explicitly set (not 0). + // A tw.State's zero value is 0, which is distinct from tw.On (1) or tw.Off (-1). + // So, if override.Borders.Left is 0, it means "not specified", so we keep current. + if override.Borders.Left != 0 { + current.Borders.Left = override.Borders.Left + } + if override.Borders.Right != 0 { + current.Borders.Right = override.Borders.Right + } + if override.Borders.Top != 0 { + current.Borders.Top = override.Borders.Top + } + if override.Borders.Bottom != 0 { + current.Borders.Bottom = override.Borders.Bottom + } + + // Merge Symbols: Only update if override.Symbols is not nil. + if override.Symbols != nil { + current.Symbols = override.Symbols + } + + // Merge Settings: Use the existing mergeSettings for granular control. + // mergeSettings already handles preserving defaults for unset (zero) overrides. + current.Settings = mergeSettings(current.Settings, override.Settings) + + // Streaming flag: typically set at renderer creation, but can be overridden if needed. + // For now, let's assume it's not commonly changed post-creation by a generic rendition merge. + // If override provides a different streaming capability, it might indicate a fundamental + // change that a simple merge shouldn't handle without more context. + // current.Streaming = override.Streaming // Or keep current.Streaming + + return current +} diff --git a/vendor/github.com/olekukonko/tablewriter/renderer/html.go b/vendor/github.com/olekukonko/tablewriter/renderer/html.go new file mode 100644 index 0000000..71c0cf5 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/renderer/html.go @@ -0,0 +1,440 @@ +package renderer + +import ( + "errors" + "fmt" + "github.com/olekukonko/ll" + "html" + "io" + "strings" + + "github.com/olekukonko/tablewriter/tw" +) + +// HTMLConfig defines settings for the HTML table renderer. +type HTMLConfig struct { + EscapeContent bool // Whether to escape cell content + AddLinesTag bool // Whether to wrap multiline content in tags + TableClass string // CSS class for + HeaderClass string // CSS class for + BodyClass string // CSS class for + FooterClass string // CSS class for + RowClass string // CSS class for in body + HeaderRowClass string // CSS class for in header + FooterRowClass string // CSS class for in footer +} + +// HTML renders tables in HTML format with customizable classes and content handling. +type HTML struct { + config HTMLConfig // Renderer configuration + w io.Writer // Output w + trace []string // Debug trace messages + debug bool // Enables debug logging + tableStarted bool // Tracks if
tag is open + tbodyStarted bool // Tracks if tag is open + tfootStarted bool // Tracks if tag is open + vMergeTrack map[int]int // Tracks vertical merge spans by column index + logger *ll.Logger +} + +// NewHTML initializes an HTML renderer with the given w, debug setting, and optional configuration. +// It panics if the w is nil and applies defaults for unset config fields. +// Update: see https://github.com/olekukonko/tablewriter/issues/258 +func NewHTML(configs ...HTMLConfig) *HTML { + cfg := HTMLConfig{ + EscapeContent: true, + AddLinesTag: false, + } + if len(configs) > 0 { + userCfg := configs[0] + cfg.EscapeContent = userCfg.EscapeContent + cfg.AddLinesTag = userCfg.AddLinesTag + cfg.TableClass = userCfg.TableClass + cfg.HeaderClass = userCfg.HeaderClass + cfg.BodyClass = userCfg.BodyClass + cfg.FooterClass = userCfg.FooterClass + cfg.RowClass = userCfg.RowClass + cfg.HeaderRowClass = userCfg.HeaderRowClass + cfg.FooterRowClass = userCfg.FooterRowClass + } + return &HTML{ + config: cfg, + vMergeTrack: make(map[int]int), + tableStarted: false, + tbodyStarted: false, + tfootStarted: false, + } +} + +func (h *HTML) Logger(logger *ll.Logger) { + h.logger = logger +} + +// Config returns a Rendition representation of the current configuration. +func (h *HTML) Config() tw.Rendition { + return tw.Rendition{ + Borders: tw.BorderNone, + Symbols: tw.NewSymbols(tw.StyleNone), + Settings: tw.Settings{}, + Streaming: false, + } +} + +// debugLog appends a formatted message to the debug trace if debugging is enabled. +//func (h *HTML) debugLog(format string, a ...interface{}) { +// if h.debug { +// msg := fmt.Sprintf(format, a...) +// h.trace = append(h.trace, fmt.Sprintf("[HTML] %s", msg)) +// } +//} + +// Debug returns the accumulated debug trace messages. +func (h *HTML) Debug() []string { + return h.trace +} + +// Start begins the HTML table rendering by opening the
tag. +func (h *HTML) Start(w io.Writer) error { + h.w = w + h.Reset() + h.logger.Debug("HTML.Start() called.") + + classAttr := tw.Empty + if h.config.TableClass != tw.Empty { + classAttr = fmt.Sprintf(` class="%s"`, h.config.TableClass) + } + h.logger.Debugf("Writing opening tag", classAttr) + _, err := fmt.Fprintf(h.w, "\n", classAttr) + if err != nil { + return err + } + h.tableStarted = true + return nil +} + +// closePreviousSection closes any open or sections. +func (h *HTML) closePreviousSection() { + if h.tbodyStarted { + h.logger.Debug("Closing tag") + fmt.Fprintln(h.w, "") + h.tbodyStarted = false + } + if h.tfootStarted { + h.logger.Debug("Closing tag") + fmt.Fprintln(h.w, "") + h.tfootStarted = false + } +} + +// Header renders the section with header rows, supporting horizontal merges. +func (h *HTML) Header(headers [][]string, ctx tw.Formatting) { + if !h.tableStarted { + h.logger.Debug("WARN: Header called before Start") + return + } + if len(headers) == 0 || len(headers[0]) == 0 { + h.logger.Debug("Header: No headers") + return + } + + h.closePreviousSection() + classAttr := tw.Empty + if h.config.HeaderClass != tw.Empty { + classAttr = fmt.Sprintf(` class="%s"`, h.config.HeaderClass) + } + fmt.Fprintf(h.w, "\n", classAttr) + + headerRow := headers[0] + numCols := 0 + if len(ctx.Row.Current) > 0 { + maxKey := -1 + for k := range ctx.Row.Current { + if k > maxKey { + maxKey = k + } + } + numCols = maxKey + 1 + } else if len(headerRow) > 0 { + numCols = len(headerRow) + } + + indent := " " + rowClassAttr := tw.Empty + if h.config.HeaderRowClass != tw.Empty { + rowClassAttr = fmt.Sprintf(` class="%s"`, h.config.HeaderRowClass) + } + fmt.Fprintf(h.w, "%s", indent, rowClassAttr) + + renderedCols := 0 + for colIdx := 0; renderedCols < numCols && colIdx < numCols; { + // Skip columns consumed by vertical merges + if remainingSpan, merging := h.vMergeTrack[colIdx]; merging && remainingSpan > 1 { + h.logger.Debugf("Header: Skipping col %d due to vmerge", colIdx) + h.vMergeTrack[colIdx]-- + if h.vMergeTrack[colIdx] <= 1 { + delete(h.vMergeTrack, colIdx) + } + colIdx++ + continue + } + + // Render cell + cellCtx, ok := ctx.Row.Current[colIdx] + if !ok { + cellCtx = tw.CellContext{Align: tw.AlignCenter} + } + originalContent := tw.Empty + if colIdx < len(headerRow) { + originalContent = headerRow[colIdx] + } + + tag, attributes, processedContent := h.renderRowCell(originalContent, cellCtx, true, colIdx) + fmt.Fprintf(h.w, "<%s%s>%s", tag, attributes, processedContent, tag) + renderedCols++ + + // Handle horizontal merges + hSpan := 1 + if cellCtx.Merge.Horizontal.Present && cellCtx.Merge.Horizontal.Start { + hSpan = cellCtx.Merge.Horizontal.Span + renderedCols += (hSpan - 1) + } + colIdx += hSpan + } + fmt.Fprintf(h.w, "\n") + fmt.Fprintln(h.w, "") +} + +// Row renders a element within , supporting horizontal and vertical merges. +func (h *HTML) Row(row []string, ctx tw.Formatting) { + if !h.tableStarted { + h.logger.Debug("WARN: Row called before Start") + return + } + + if !h.tbodyStarted { + h.closePreviousSection() + classAttr := tw.Empty + if h.config.BodyClass != tw.Empty { + classAttr = fmt.Sprintf(` class="%s"`, h.config.BodyClass) + } + h.logger.Debugf("Writing opening tag", classAttr) + fmt.Fprintf(h.w, "\n", classAttr) + h.tbodyStarted = true + } + + h.logger.Debugf("Rendering row data: %v", row) + numCols := 0 + if len(ctx.Row.Current) > 0 { + maxKey := -1 + for k := range ctx.Row.Current { + if k > maxKey { + maxKey = k + } + } + numCols = maxKey + 1 + } else if len(row) > 0 { + numCols = len(row) + } + + indent := " " + rowClassAttr := tw.Empty + if h.config.RowClass != tw.Empty { + rowClassAttr = fmt.Sprintf(` class="%s"`, h.config.RowClass) + } + fmt.Fprintf(h.w, "%s", indent, rowClassAttr) + + renderedCols := 0 + for colIdx := 0; renderedCols < numCols && colIdx < numCols; { + // Skip columns consumed by vertical merges + if remainingSpan, merging := h.vMergeTrack[colIdx]; merging && remainingSpan > 1 { + h.logger.Debugf("Row: Skipping render for col %d due to vertical merge (remaining %d)", colIdx, remainingSpan-1) + h.vMergeTrack[colIdx]-- + if h.vMergeTrack[colIdx] <= 1 { + delete(h.vMergeTrack, colIdx) + } + colIdx++ + continue + } + + // Render cell + cellCtx, ok := ctx.Row.Current[colIdx] + if !ok { + cellCtx = tw.CellContext{Align: tw.AlignLeft} + } + originalContent := tw.Empty + if colIdx < len(row) { + originalContent = row[colIdx] + } + + tag, attributes, processedContent := h.renderRowCell(originalContent, cellCtx, false, colIdx) + fmt.Fprintf(h.w, "<%s%s>%s", tag, attributes, processedContent, tag) + renderedCols++ + + // Handle horizontal merges + hSpan := 1 + if cellCtx.Merge.Horizontal.Present && cellCtx.Merge.Horizontal.Start { + hSpan = cellCtx.Merge.Horizontal.Span + renderedCols += (hSpan - 1) + } + colIdx += hSpan + } + fmt.Fprintf(h.w, "\n") +} + +// Footer renders the section with footer rows, supporting horizontal merges. +func (h *HTML) Footer(footers [][]string, ctx tw.Formatting) { + if !h.tableStarted { + h.logger.Debug("WARN: Footer called before Start") + return + } + if len(footers) == 0 || len(footers[0]) == 0 { + h.logger.Debug("Footer: No footers") + return + } + + h.closePreviousSection() + classAttr := tw.Empty + if h.config.FooterClass != tw.Empty { + classAttr = fmt.Sprintf(` class="%s"`, h.config.FooterClass) + } + fmt.Fprintf(h.w, "\n", classAttr) + h.tfootStarted = true + + footerRow := footers[0] + numCols := 0 + if len(ctx.Row.Current) > 0 { + maxKey := -1 + for k := range ctx.Row.Current { + if k > maxKey { + maxKey = k + } + } + numCols = maxKey + 1 + } else if len(footerRow) > 0 { + numCols = len(footerRow) + } + + indent := " " + rowClassAttr := tw.Empty + if h.config.FooterRowClass != tw.Empty { + rowClassAttr = fmt.Sprintf(` class="%s"`, h.config.FooterRowClass) + } + fmt.Fprintf(h.w, "%s", indent, rowClassAttr) + + renderedCols := 0 + for colIdx := 0; renderedCols < numCols && colIdx < numCols; { + cellCtx, ok := ctx.Row.Current[colIdx] + if !ok { + cellCtx = tw.CellContext{Align: tw.AlignRight} + } + originalContent := tw.Empty + if colIdx < len(footerRow) { + originalContent = footerRow[colIdx] + } + + tag, attributes, processedContent := h.renderRowCell(originalContent, cellCtx, false, colIdx) + fmt.Fprintf(h.w, "<%s%s>%s", tag, attributes, processedContent, tag) + renderedCols++ + + hSpan := 1 + if cellCtx.Merge.Horizontal.Present && cellCtx.Merge.Horizontal.Start { + hSpan = cellCtx.Merge.Horizontal.Span + renderedCols += (hSpan - 1) + } + colIdx += hSpan + } + fmt.Fprintf(h.w, "\n") + fmt.Fprintln(h.w, "") + h.tfootStarted = false +} + +// renderRowCell generates HTML for a single cell, handling content escaping, merges, and alignment. +func (h *HTML) renderRowCell(originalContent string, cellCtx tw.CellContext, isHeader bool, colIdx int) (tag, attributes, processedContent string) { + tag = "td" + if isHeader { + tag = "th" + } + + // Process content + processedContent = originalContent + containsNewline := strings.Contains(originalContent, "\n") + + if h.config.EscapeContent { + if containsNewline { + const newlinePlaceholder = "[[--HTML_RENDERER_BR_PLACEHOLDER--]]" + tempContent := strings.ReplaceAll(originalContent, "\n", newlinePlaceholder) + escapedContent := html.EscapeString(tempContent) + processedContent = strings.ReplaceAll(escapedContent, newlinePlaceholder, "
") + } else { + processedContent = html.EscapeString(originalContent) + } + } else if containsNewline { + processedContent = strings.ReplaceAll(originalContent, "\n", "
") + } + + if containsNewline && h.config.AddLinesTag { + processedContent = "" + processedContent + "" + } + + // Build attributes + var attrBuilder strings.Builder + merge := cellCtx.Merge + + if merge.Horizontal.Present && merge.Horizontal.Start && merge.Horizontal.Span > 1 { + fmt.Fprintf(&attrBuilder, ` colspan="%d"`, merge.Horizontal.Span) + } + + vSpan := 0 + if !isHeader { + if merge.Vertical.Present && merge.Vertical.Start { + vSpan = merge.Vertical.Span + } else if merge.Hierarchical.Present && merge.Hierarchical.Start { + vSpan = merge.Hierarchical.Span + } + if vSpan > 1 { + fmt.Fprintf(&attrBuilder, ` rowspan="%d"`, vSpan) + h.vMergeTrack[colIdx] = vSpan + h.logger.Debugf("renderRowCell: Tracking rowspan=%d for col %d", vSpan, colIdx) + } + } + + if style := getHTMLStyle(cellCtx.Align); style != tw.Empty { + attrBuilder.WriteString(style) + } + attributes = attrBuilder.String() + return +} + +// Line is a no-op for HTML rendering, as structural lines are handled by tags. +func (h *HTML) Line(ctx tw.Formatting) {} + +// Reset clears the renderer's internal state, including debug traces and merge tracking. +func (h *HTML) Reset() { + h.logger.Debug("HTML.Reset() called.") + h.tableStarted = false + h.tbodyStarted = false + h.tfootStarted = false + h.vMergeTrack = make(map[int]int) + h.trace = nil +} + +// Close ensures all open HTML tags (
, , ) are properly closed. +func (h *HTML) Close() error { + if h.w == nil { + return errors.New("HTML Renderer Close called on nil internal w") + } + + if h.tableStarted { + h.logger.Debug("HTML.Close() called.") + h.closePreviousSection() + h.logger.Debug("Closing
tag.") + _, err := fmt.Fprintln(h.w, "
") + h.tableStarted = false + h.tbodyStarted = false + h.tfootStarted = false + h.vMergeTrack = make(map[int]int) + return err + } + h.logger.Debug("HTML.Close() called, but table was not started (no-op).") + return nil +} diff --git a/vendor/github.com/olekukonko/tablewriter/renderer/junction.go b/vendor/github.com/olekukonko/tablewriter/renderer/junction.go new file mode 100644 index 0000000..0c684f1 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/renderer/junction.go @@ -0,0 +1,273 @@ +package renderer + +import ( + "github.com/olekukonko/ll" + "github.com/olekukonko/tablewriter/tw" +) + +// Junction handles rendering of table junction points (corners, intersections) with color support. +type Junction struct { + sym tw.Symbols // Symbols used for rendering junctions and lines + ctx tw.Formatting // Current table formatting context + colIdx int // Index of the column being processed + debugging bool // Enables debug logging + borderTint Tint // Colors for border symbols + separatorTint Tint // Colors for separator symbols + logger *ll.Logger +} + +type JunctionContext struct { + Symbols tw.Symbols + Ctx tw.Formatting + ColIdx int + Logger *ll.Logger + BorderTint Tint + SeparatorTint Tint +} + +// NewJunction initializes a Junction with the given symbols, context, and tints. +// If debug is nil, a no-op debug function is used. +func NewJunction(ctx JunctionContext) *Junction { + return &Junction{ + sym: ctx.Symbols, + ctx: ctx.Ctx, + colIdx: ctx.ColIdx, + logger: ctx.Logger.Namespace("junction"), + borderTint: ctx.BorderTint, + separatorTint: ctx.SeparatorTint, + } +} + +// getMergeState retrieves the merge state for a specific column in a row, returning an empty state if not found. +func (jr *Junction) getMergeState(row map[int]tw.CellContext, colIdx int) tw.MergeState { + if row == nil || colIdx < 0 { + return tw.MergeState{} + } + return row[colIdx].Merge +} + +// GetSegment determines whether to render a colored horizontal line or an empty space based on merge states. +func (jr *Junction) GetSegment() string { + currentMerge := jr.getMergeState(jr.ctx.Row.Current, jr.colIdx) + nextMerge := jr.getMergeState(jr.ctx.Row.Next, jr.colIdx) + + vPassThruStrict := (currentMerge.Vertical.Present && nextMerge.Vertical.Present && !currentMerge.Vertical.End && !nextMerge.Vertical.Start) || + (currentMerge.Hierarchical.Present && nextMerge.Hierarchical.Present && !currentMerge.Hierarchical.End && !nextMerge.Hierarchical.Start) + + if vPassThruStrict { + jr.logger.Debugf("GetSegment col %d: VPassThruStrict=%v -> Empty segment", jr.colIdx, vPassThruStrict) + return tw.Empty + } + symbol := jr.sym.Row() + coloredSymbol := jr.borderTint.Apply(symbol) + jr.logger.Debugf("GetSegment col %d: VPassThruStrict=%v -> Colored row symbol '%s'", jr.colIdx, vPassThruStrict, coloredSymbol) + return coloredSymbol +} + +// RenderLeft selects and colors the leftmost junction symbol for the current row line based on position and merges. +func (jr *Junction) RenderLeft() string { + mergeAbove := jr.getMergeState(jr.ctx.Row.Current, 0) + mergeBelow := jr.getMergeState(jr.ctx.Row.Next, 0) + + jr.logger.Debugf("RenderLeft: Level=%v, Location=%v, Previous=%v", jr.ctx.Level, jr.ctx.Row.Location, jr.ctx.Row.Previous) + + isTopBorder := (jr.ctx.Level == tw.LevelHeader && jr.ctx.Row.Location == tw.LocationFirst) || + (jr.ctx.Level == tw.LevelBody && jr.ctx.Row.Location == tw.LocationFirst && jr.ctx.Row.Previous == nil) + if isTopBorder { + symbol := jr.sym.TopLeft() + return jr.borderTint.Apply(symbol) + } + + isBottom := jr.ctx.Level == tw.LevelBody && jr.ctx.Row.Location == tw.LocationEnd && !jr.ctx.HasFooter + isFooter := jr.ctx.Level == tw.LevelFooter && jr.ctx.Row.Location == tw.LocationEnd + if isBottom || isFooter { + symbol := jr.sym.BottomLeft() + return jr.borderTint.Apply(symbol) + } + + isVPassThruStrict := (mergeAbove.Vertical.Present && mergeBelow.Vertical.Present && !mergeAbove.Vertical.End && !mergeBelow.Vertical.Start) || + (mergeAbove.Hierarchical.Present && mergeBelow.Hierarchical.Present && !mergeAbove.Hierarchical.End && !mergeBelow.Hierarchical.Start) + if isVPassThruStrict { + symbol := jr.sym.Column() + return jr.separatorTint.Apply(symbol) + } + + symbol := jr.sym.MidLeft() + return jr.borderTint.Apply(symbol) +} + +// RenderRight selects and colors the rightmost junction symbol for the row line based on position, merges, and last column index. +func (jr *Junction) RenderRight(lastColIdx int) string { + jr.logger.Debugf("RenderRight: lastColIdx=%d, Level=%v, Location=%v, Previous=%v", lastColIdx, jr.ctx.Level, jr.ctx.Row.Location, jr.ctx.Row.Previous) + + if lastColIdx < 0 { + switch jr.ctx.Level { + case tw.LevelHeader: + symbol := jr.sym.TopRight() + return jr.borderTint.Apply(symbol) + case tw.LevelFooter: + symbol := jr.sym.BottomRight() + return jr.borderTint.Apply(symbol) + default: + if jr.ctx.Row.Location == tw.LocationFirst { + symbol := jr.sym.TopRight() + return jr.borderTint.Apply(symbol) + } + if jr.ctx.Row.Location == tw.LocationEnd { + symbol := jr.sym.BottomRight() + return jr.borderTint.Apply(symbol) + } + symbol := jr.sym.MidRight() + return jr.borderTint.Apply(symbol) + } + } + + mergeAbove := jr.getMergeState(jr.ctx.Row.Current, lastColIdx) + mergeBelow := jr.getMergeState(jr.ctx.Row.Next, lastColIdx) + + isTopBorder := (jr.ctx.Level == tw.LevelHeader && jr.ctx.Row.Location == tw.LocationFirst) || + (jr.ctx.Level == tw.LevelBody && jr.ctx.Row.Location == tw.LocationFirst && jr.ctx.Row.Previous == nil) + if isTopBorder { + symbol := jr.sym.TopRight() + return jr.borderTint.Apply(symbol) + } + + isBottom := jr.ctx.Level == tw.LevelBody && jr.ctx.Row.Location == tw.LocationEnd && !jr.ctx.HasFooter + isFooter := jr.ctx.Level == tw.LevelFooter && jr.ctx.Row.Location == tw.LocationEnd + if isBottom || isFooter { + symbol := jr.sym.BottomRight() + return jr.borderTint.Apply(symbol) + } + + isVPassThruStrict := (mergeAbove.Vertical.Present && mergeBelow.Vertical.Present && !mergeAbove.Vertical.End && !mergeBelow.Vertical.Start) || + (mergeAbove.Hierarchical.Present && mergeBelow.Hierarchical.Present && !mergeAbove.Hierarchical.End && !mergeBelow.Hierarchical.Start) + if isVPassThruStrict { + symbol := jr.sym.Column() + return jr.separatorTint.Apply(symbol) + } + + symbol := jr.sym.MidRight() + return jr.borderTint.Apply(symbol) +} + +// RenderJunction selects and colors the junction symbol between two adjacent columns based on merge states and table position. +func (jr *Junction) RenderJunction(leftColIdx, rightColIdx int) string { + mergeCurrentL := jr.getMergeState(jr.ctx.Row.Current, leftColIdx) + mergeCurrentR := jr.getMergeState(jr.ctx.Row.Current, rightColIdx) + mergeNextL := jr.getMergeState(jr.ctx.Row.Next, leftColIdx) + mergeNextR := jr.getMergeState(jr.ctx.Row.Next, rightColIdx) + + isSpannedCurrent := mergeCurrentL.Horizontal.Present && !mergeCurrentL.Horizontal.End + isSpannedNext := mergeNextL.Horizontal.Present && !mergeNextL.Horizontal.End + + vPassThruLStrict := (mergeCurrentL.Vertical.Present && mergeNextL.Vertical.Present && !mergeCurrentL.Vertical.End && !mergeNextL.Vertical.Start) || + (mergeCurrentL.Hierarchical.Present && mergeNextL.Hierarchical.Present && !mergeCurrentL.Hierarchical.End && !mergeNextL.Hierarchical.Start) + vPassThruRStrict := (mergeCurrentR.Vertical.Present && mergeNextR.Vertical.Present && !mergeCurrentR.Vertical.End && !mergeNextR.Vertical.Start) || + (mergeCurrentR.Hierarchical.Present && mergeNextR.Hierarchical.Present && !mergeCurrentR.Hierarchical.End && !mergeNextR.Hierarchical.Start) + + isTop := (jr.ctx.Level == tw.LevelHeader && jr.ctx.Row.Location == tw.LocationFirst) || + (jr.ctx.Level == tw.LevelBody && jr.ctx.Row.Location == tw.LocationFirst && len(jr.ctx.Row.Previous) == 0) + isBottom := (jr.ctx.Level == tw.LevelFooter && jr.ctx.Row.Location == tw.LocationEnd) || + (jr.ctx.Level == tw.LevelBody && jr.ctx.Row.Location == tw.LocationEnd && !jr.ctx.HasFooter) + isPreFooter := jr.ctx.Level == tw.LevelFooter && (jr.ctx.Row.Position == tw.Row || jr.ctx.Row.Position == tw.Header) + + if isTop { + if isSpannedNext { + symbol := jr.sym.Row() + return jr.borderTint.Apply(symbol) + } + symbol := jr.sym.TopMid() + return jr.borderTint.Apply(symbol) + } + + if isBottom { + if vPassThruLStrict && vPassThruRStrict { + symbol := jr.sym.Column() + return jr.separatorTint.Apply(symbol) + } + if vPassThruLStrict { + symbol := jr.sym.MidLeft() + return jr.borderTint.Apply(symbol) + } + if vPassThruRStrict { + symbol := jr.sym.MidRight() + return jr.borderTint.Apply(symbol) + } + if isSpannedCurrent { + symbol := jr.sym.Row() + return jr.borderTint.Apply(symbol) + } + symbol := jr.sym.BottomMid() + return jr.borderTint.Apply(symbol) + } + + if isPreFooter { + if vPassThruLStrict && vPassThruRStrict { + symbol := jr.sym.Column() + return jr.separatorTint.Apply(symbol) + } + if vPassThruLStrict { + symbol := jr.sym.MidLeft() + return jr.borderTint.Apply(symbol) + } + if vPassThruRStrict { + symbol := jr.sym.MidRight() + return jr.borderTint.Apply(symbol) + } + if mergeCurrentL.Horizontal.Present { + if !mergeCurrentL.Horizontal.End && mergeCurrentR.Horizontal.Present && !mergeCurrentR.Horizontal.End { + jr.logger.Debugf("Footer separator: H-merge continues from col %d to %d (mid-span), using BottomMid", leftColIdx, rightColIdx) + symbol := jr.sym.BottomMid() + return jr.borderTint.Apply(symbol) + } + if !mergeCurrentL.Horizontal.End && mergeCurrentR.Horizontal.Present && mergeCurrentR.Horizontal.End { + jr.logger.Debugf("Footer separator: H-merge ends at col %d, using BottomMid", rightColIdx) + symbol := jr.sym.BottomMid() + return jr.borderTint.Apply(symbol) + } + if mergeCurrentL.Horizontal.End && !mergeCurrentR.Horizontal.Present { + jr.logger.Debugf("Footer separator: H-merge ends at col %d, next col %d not merged, using Center", leftColIdx, rightColIdx) + symbol := jr.sym.Center() + return jr.borderTint.Apply(symbol) + } + } + if isSpannedNext { + symbol := jr.sym.BottomMid() + return jr.borderTint.Apply(symbol) + } + if isSpannedCurrent { + symbol := jr.sym.TopMid() + return jr.borderTint.Apply(symbol) + } + symbol := jr.sym.Center() + return jr.borderTint.Apply(symbol) + } + + if vPassThruLStrict && vPassThruRStrict { + symbol := jr.sym.Column() + return jr.separatorTint.Apply(symbol) + } + if vPassThruLStrict { + symbol := jr.sym.MidLeft() + return jr.borderTint.Apply(symbol) + } + if vPassThruRStrict { + symbol := jr.sym.MidRight() + return jr.borderTint.Apply(symbol) + } + if isSpannedCurrent && isSpannedNext { + symbol := jr.sym.Row() + return jr.borderTint.Apply(symbol) + } + if isSpannedCurrent { + symbol := jr.sym.TopMid() + return jr.borderTint.Apply(symbol) + } + if isSpannedNext { + symbol := jr.sym.BottomMid() + return jr.borderTint.Apply(symbol) + } + + symbol := jr.sym.Center() + return jr.borderTint.Apply(symbol) +} diff --git a/vendor/github.com/olekukonko/tablewriter/renderer/markdown.go b/vendor/github.com/olekukonko/tablewriter/renderer/markdown.go new file mode 100644 index 0000000..525e633 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/renderer/markdown.go @@ -0,0 +1,418 @@ +package renderer + +import ( + "github.com/olekukonko/ll" + "io" + "strings" + + "github.com/olekukonko/tablewriter/tw" +) + +// Markdown renders tables in Markdown format with customizable settings. +type Markdown struct { + config tw.Rendition // Rendering configuration + logger *ll.Logger // Debug trace messages + alignment tw.Alignment // alias of []tw.Align + w io.Writer +} + +// NewMarkdown initializes a Markdown renderer with defaults tailored for Markdown (e.g., pipes, header separator). +// Only the first config is used if multiple are provided. +func NewMarkdown(configs ...tw.Rendition) *Markdown { + cfg := defaultBlueprint() + // Configure Markdown-specific defaults + cfg.Symbols = tw.NewSymbols(tw.StyleMarkdown) + cfg.Borders = tw.Border{Left: tw.On, Right: tw.On, Top: tw.Off, Bottom: tw.Off} + cfg.Settings.Separators.BetweenColumns = tw.On + cfg.Settings.Separators.BetweenRows = tw.Off + cfg.Settings.Lines.ShowHeaderLine = tw.On + cfg.Settings.Lines.ShowTop = tw.Off + cfg.Settings.Lines.ShowBottom = tw.Off + cfg.Settings.Lines.ShowFooterLine = tw.Off + // cfg.Settings.TrimWhitespace = tw.On + + // Apply user overrides + if len(configs) > 0 { + cfg = mergeMarkdownConfig(cfg, configs[0]) + } + return &Markdown{config: cfg} +} + +// mergeMarkdownConfig combines user-provided config with Markdown defaults, enforcing Markdown-specific settings. +func mergeMarkdownConfig(defaults, overrides tw.Rendition) tw.Rendition { + if overrides.Borders.Left != 0 { + defaults.Borders.Left = overrides.Borders.Left + } + if overrides.Borders.Right != 0 { + defaults.Borders.Right = overrides.Borders.Right + } + if overrides.Symbols != nil { + defaults.Symbols = overrides.Symbols + } + defaults.Settings = mergeSettings(defaults.Settings, overrides.Settings) + // Enforce Markdown requirements + defaults.Settings.Lines.ShowHeaderLine = tw.On + defaults.Settings.Separators.BetweenColumns = tw.On + // defaults.Settings.TrimWhitespace = tw.On + return defaults +} + +func (m *Markdown) Logger(logger *ll.Logger) { + m.logger = logger.Namespace("markdown") +} + +// Config returns the renderer's current configuration. +func (m *Markdown) Config() tw.Rendition { + return m.config +} + +// Header renders the Markdown table header and its separator line. +func (m *Markdown) Header(headers [][]string, ctx tw.Formatting) { + m.resolveAlignment(ctx) + if len(headers) == 0 || len(headers[0]) == 0 { + m.logger.Debug("Header: No headers to render") + return + } + m.logger.Debugf("Rendering header with %d lines, widths=%v, current=%v, next=%v", len(headers), ctx.Row.Widths, ctx.Row.Current, ctx.Row.Next) + + // Render header content + m.renderMarkdownLine(headers[0], ctx, false) + + // Render separator if enabled + if m.config.Settings.Lines.ShowHeaderLine.Enabled() { + sepCtx := ctx + sepCtx.Row.Widths = ctx.Row.Widths + sepCtx.Row.Current = ctx.Row.Current + sepCtx.Row.Previous = ctx.Row.Current + sepCtx.IsSubRow = true + m.renderMarkdownLine(nil, sepCtx, true) + } +} + +// Row renders a Markdown table data row. +func (m *Markdown) Row(row []string, ctx tw.Formatting) { + m.resolveAlignment(ctx) + m.logger.Debugf("Rendering row with data=%v, widths=%v, previous=%v, current=%v, next=%v", row, ctx.Row.Widths, ctx.Row.Previous, ctx.Row.Current, ctx.Row.Next) + m.renderMarkdownLine(row, ctx, false) + +} + +// Footer renders the Markdown table footer. +func (m *Markdown) Footer(footers [][]string, ctx tw.Formatting) { + m.resolveAlignment(ctx) + if len(footers) == 0 || len(footers[0]) == 0 { + m.logger.Debug("Footer: No footers to render") + return + } + m.logger.Debugf("Rendering footer with %d lines, widths=%v, previous=%v, current=%v, next=%v", + len(footers), ctx.Row.Widths, ctx.Row.Previous, ctx.Row.Current, ctx.Row.Next) + m.renderMarkdownLine(footers[0], ctx, false) +} + +// Line is a no-op for Markdown, as only the header separator is rendered (handled by Header). +func (m *Markdown) Line(ctx tw.Formatting) { + m.logger.Debugf("Line: Generic Line call received (pos: %s, loc: %s). Markdown ignores these.", ctx.Row.Position, ctx.Row.Location) +} + +// Reset clears the renderer's internal state, including debug traces. +func (m *Markdown) Reset() { + m.logger.Info("Reset: Cleared debug trace") +} + +func (m *Markdown) Start(w io.Writer) error { + m.w = w + m.logger.Warn("Markdown.Start() called (no-op).") + return nil +} + +func (m *Markdown) Close() error { + m.logger.Warn("Markdown.Close() called (no-op).") + return nil +} + +func (m *Markdown) resolveAlignment(ctx tw.Formatting) tw.Alignment { + if len(m.alignment) != 0 { + return m.alignment + } + + // get total columns + total := len(ctx.Row.Current) + + // build default alignment + for i := 0; i < total; i++ { + m.alignment = append(m.alignment, tw.AlignNone) // Default to AlignNone + } + + // add per column alignment if it exists + for i := 0; i < total; i++ { + m.alignment[i] = ctx.Row.Current[i].Align + } + + m.logger.Debugf(" → Align Resolved %s", m.alignment) + return m.alignment +} + +// formatCell formats a Markdown cell's content with padding and alignment, ensuring at least 3 characters wide. +func (m *Markdown) formatCell(content string, width int, align tw.Align, padding tw.Padding) string { + //if m.config.Settings.TrimWhitespace.Enabled() { + // content = strings.TrimSpace(content) + //} + contentVisualWidth := tw.DisplayWidth(content) + + // Use specified padding characters or default to spaces + padLeftChar := padding.Left + if padLeftChar == tw.Empty { + padLeftChar = tw.Space + } + padRightChar := padding.Right + if padRightChar == tw.Empty { + padRightChar = tw.Space + } + + // Calculate padding widths + padLeftCharWidth := tw.DisplayWidth(padLeftChar) + padRightCharWidth := tw.DisplayWidth(padRightChar) + minWidth := tw.Max(3, contentVisualWidth+padLeftCharWidth+padRightCharWidth) + targetWidth := tw.Max(width, minWidth) + + // Calculate padding + totalPaddingNeeded := targetWidth - contentVisualWidth + if totalPaddingNeeded < 0 { + totalPaddingNeeded = 0 + } + + var leftPadStr, rightPadStr string + switch align { + case tw.AlignRight: + leftPadCount := tw.Max(0, totalPaddingNeeded-padRightCharWidth) + rightPadCount := totalPaddingNeeded - leftPadCount + leftPadStr = strings.Repeat(padLeftChar, leftPadCount) + rightPadStr = strings.Repeat(padRightChar, rightPadCount) + case tw.AlignCenter: + leftPadCount := totalPaddingNeeded / 2 + rightPadCount := totalPaddingNeeded - leftPadCount + if leftPadCount < padLeftCharWidth && totalPaddingNeeded >= padLeftCharWidth+padRightCharWidth { + leftPadCount = padLeftCharWidth + rightPadCount = totalPaddingNeeded - leftPadCount + } + if rightPadCount < padRightCharWidth && totalPaddingNeeded >= padLeftCharWidth+padRightCharWidth { + rightPadCount = padRightCharWidth + leftPadCount = totalPaddingNeeded - rightPadCount + } + leftPadStr = strings.Repeat(padLeftChar, leftPadCount) + rightPadStr = strings.Repeat(padRightChar, rightPadCount) + default: // AlignLeft + rightPadCount := tw.Max(0, totalPaddingNeeded-padLeftCharWidth) + leftPadCount := totalPaddingNeeded - rightPadCount + leftPadStr = strings.Repeat(padLeftChar, leftPadCount) + rightPadStr = strings.Repeat(padRightChar, rightPadCount) + } + + // Build result + result := leftPadStr + content + rightPadStr + + // Adjust width if needed + finalWidth := tw.DisplayWidth(result) + if finalWidth != targetWidth { + m.logger.Debugf("Markdown formatCell MISMATCH: content='%s', target_w=%d, paddingL='%s', paddingR='%s', align=%s -> result='%s', result_w=%d", + content, targetWidth, padding.Left, padding.Right, align, result, finalWidth) + adjNeeded := targetWidth - finalWidth + if adjNeeded > 0 { + adjStr := strings.Repeat(tw.Space, adjNeeded) + if align == tw.AlignRight { + result = adjStr + result + } else if align == tw.AlignCenter { + leftAdj := adjNeeded / 2 + rightAdj := adjNeeded - leftAdj + result = strings.Repeat(tw.Space, leftAdj) + result + strings.Repeat(tw.Space, rightAdj) + } else { + result += adjStr + } + } else { + result = tw.TruncateString(result, targetWidth) + } + m.logger.Debugf("Markdown formatCell Corrected: target_w=%d, result='%s', new_w=%d", targetWidth, result, tw.DisplayWidth(result)) + } + + m.logger.Debugf("Markdown formatCell: content='%s', width=%d, align=%s, paddingL='%s', paddingR='%s' -> '%s' (target %d)", + content, width, align, padding.Left, padding.Right, result, targetWidth) + return result +} + +// formatSeparator generates a Markdown separator (e.g., `---`, `:--`, `:-:`) with alignment indicators. +func (m *Markdown) formatSeparator(width int, align tw.Align) string { + targetWidth := tw.Max(3, width) + var sb strings.Builder + + switch align { + case tw.AlignLeft: + sb.WriteRune(':') + sb.WriteString(strings.Repeat("-", targetWidth-1)) + case tw.AlignRight: + sb.WriteString(strings.Repeat("-", targetWidth-1)) + sb.WriteRune(':') + case tw.AlignCenter: + sb.WriteRune(':') + sb.WriteString(strings.Repeat("-", targetWidth-2)) + sb.WriteRune(':') + case tw.AlignNone: + sb.WriteString(strings.Repeat("-", targetWidth)) + default: + sb.WriteString(strings.Repeat("-", targetWidth)) // Fallback + } + + result := sb.String() + currentLen := tw.DisplayWidth(result) + if currentLen < targetWidth { + result += strings.Repeat("-", targetWidth-currentLen) + } else if currentLen > targetWidth { + result = tw.TruncateString(result, targetWidth) + } + + m.logger.Debugf("Markdown formatSeparator: width=%d, align=%s -> '%s'", width, align, result) + return result +} + +// renderMarkdownLine renders a single Markdown line (header, row, footer, or separator) with pipes and alignment. +func (m *Markdown) renderMarkdownLine(line []string, ctx tw.Formatting, isHeaderSep bool) { + numCols := 0 + if len(ctx.Row.Widths) > 0 { + maxKey := -1 + for k := range ctx.Row.Widths { + if k > maxKey { + maxKey = k + } + } + numCols = maxKey + 1 + } else if len(ctx.Row.Current) > 0 { + maxKey := -1 + for k := range ctx.Row.Current { + if k > maxKey { + maxKey = k + } + } + numCols = maxKey + 1 + } else if len(line) > 0 && !isHeaderSep { + numCols = len(line) + } + + if numCols == 0 && !isHeaderSep { + m.logger.Debug("renderMarkdownLine: Skipping line with zero columns.") + return + } + + var output strings.Builder + prefix := m.config.Symbols.Column() + if m.config.Borders.Left == tw.Off { + prefix = tw.Empty + } + suffix := m.config.Symbols.Column() + if m.config.Borders.Right == tw.Off { + suffix = tw.Empty + } + separator := m.config.Symbols.Column() + output.WriteString(prefix) + + colIndex := 0 + separatorWidth := tw.DisplayWidth(separator) + + for colIndex < numCols { + cellCtx, ok := ctx.Row.Current[colIndex] + align := m.alignment[colIndex] + + defaultPadding := tw.Padding{Left: tw.Space, Right: tw.Space} + if !ok { + cellCtx = tw.CellContext{ + Data: tw.Empty, Align: align, Padding: defaultPadding, + Width: ctx.Row.Widths.Get(colIndex), Merge: tw.MergeState{}, + } + } else if !cellCtx.Padding.Paddable() { + cellCtx.Padding = defaultPadding + } + + // Add separator + isContinuation := ok && cellCtx.Merge.Horizontal.Present && !cellCtx.Merge.Horizontal.Start + if colIndex > 0 && !isContinuation { + output.WriteString(separator) + m.logger.Debugf("renderMarkdownLine: Added separator '%s' before col %d", separator, colIndex) + } + + // Calculate width and span + span := 1 + visualWidth := 0 + isHMergeStart := ok && cellCtx.Merge.Horizontal.Present && cellCtx.Merge.Horizontal.Start + if isHMergeStart { + span = cellCtx.Merge.Horizontal.Span + totalWidth := 0 + for k := 0; k < span && colIndex+k < numCols; k++ { + colWidth := ctx.NormalizedWidths.Get(colIndex + k) + if colWidth < 0 { + colWidth = 0 + } + totalWidth += colWidth + if k > 0 && separatorWidth > 0 { + totalWidth += separatorWidth + } + } + visualWidth = totalWidth + m.logger.Debugf("renderMarkdownLine: HMerge col %d, span %d, visualWidth %d", colIndex, span, visualWidth) + } else { + visualWidth = ctx.Row.Widths.Get(colIndex) + m.logger.Debugf("renderMarkdownLine: Regular col %d, visualWidth %d", colIndex, visualWidth) + } + if visualWidth < 0 { + visualWidth = 0 + } + + // Render segment + if isContinuation { + m.logger.Debugf("renderMarkdownLine: Skipping col %d (HMerge continuation)", colIndex) + } else { + var formattedSegment string + if isHeaderSep { + // Use header's alignment from ctx.Row.Previous + headerAlign := align + if headerCellCtx, headerOK := ctx.Row.Previous[colIndex]; headerOK { + headerAlign = headerCellCtx.Align + // Preserve tw.AlignNone for separator + if headerAlign != tw.AlignNone && (headerAlign == tw.Empty || headerAlign == tw.Skip) { + headerAlign = tw.AlignCenter + } + } + formattedSegment = m.formatSeparator(visualWidth, headerAlign) + } else { + content := tw.Empty + if colIndex < len(line) { + content = line[colIndex] + } + // For rows, use the header's alignment if specified + rowAlign := align + if headerCellCtx, headerOK := ctx.Row.Previous[colIndex]; headerOK && isHeaderSep == false { + if headerCellCtx.Align != tw.AlignNone && headerCellCtx.Align != tw.Empty { + rowAlign = headerCellCtx.Align + } + } + if rowAlign == tw.AlignNone || rowAlign == tw.Empty { + if ctx.Row.Position == tw.Header { + rowAlign = tw.AlignCenter + } else if ctx.Row.Position == tw.Footer { + rowAlign = tw.AlignRight + } else { + rowAlign = tw.AlignLeft + } + m.logger.Debugf("renderMarkdownLine: Col %d using default align '%s'", colIndex, rowAlign) + } + formattedSegment = m.formatCell(content, visualWidth, rowAlign, cellCtx.Padding) + } + output.WriteString(formattedSegment) + m.logger.Debugf("renderMarkdownLine: Wrote col %d (span %d, width %d): '%s'", colIndex, span, visualWidth, formattedSegment) + } + + colIndex += span + } + + output.WriteString(suffix) + output.WriteString(tw.NewLine) + m.w.Write([]byte(output.String())) + m.logger.Debugf("renderMarkdownLine: Final line: %s", strings.TrimSuffix(output.String(), tw.NewLine)) +} diff --git a/vendor/github.com/olekukonko/tablewriter/renderer/ocean.go b/vendor/github.com/olekukonko/tablewriter/renderer/ocean.go new file mode 100644 index 0000000..58a6c9d --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/renderer/ocean.go @@ -0,0 +1,505 @@ +package renderer + +import ( + "io" + "strings" + + "github.com/olekukonko/ll" + "github.com/olekukonko/tablewriter/tw" +) + +// OceanConfig defines configuration specific to the Ocean renderer. +type OceanConfig struct { +} + +// Ocean is a streaming table renderer that writes ASCII tables. +type Ocean struct { + config tw.Rendition + oceanConfig OceanConfig + fixedWidths tw.Mapper[int, int] + widthsFinalized bool + tableOutputStarted bool + headerContentRendered bool // True if actual header *content* has been rendered by Ocean.Header + logger *ll.Logger + w io.Writer +} + +func NewOcean(oceanConfig ...OceanConfig) *Ocean { + cfg := defaultOceanRendererConfig() + oCfg := OceanConfig{} + if len(oceanConfig) > 0 { + // Apply user-provided OceanConfig if necessary + } + r := &Ocean{ + config: cfg, + oceanConfig: oCfg, + fixedWidths: tw.NewMapper[int, int](), + logger: ll.New("ocean"), + } + r.resetState() + return r +} + +func (o *Ocean) resetState() { + o.fixedWidths = tw.NewMapper[int, int]() + o.widthsFinalized = false + o.tableOutputStarted = false + o.headerContentRendered = false + o.logger.Debug("State reset.") +} + +func (o *Ocean) Logger(logger *ll.Logger) { + o.logger = logger.Namespace("ocean") +} + +func (o *Ocean) Config() tw.Rendition { + return o.config +} + +func (o *Ocean) tryFinalizeWidths(ctx tw.Formatting) { + if o.widthsFinalized { + return + } + if ctx.Row.Widths != nil && ctx.Row.Widths.Len() > 0 { + o.fixedWidths = ctx.Row.Widths.Clone() + o.widthsFinalized = true + o.logger.Debugf("Widths finalized from context: %v", o.fixedWidths) + } else { + o.logger.Warn("Attempted to finalize widths, but no width data in context.") + } +} + +func (o *Ocean) Start(w io.Writer) error { + o.w = w + o.logger.Debug("Start() called.") + o.resetState() + // Top border is drawn by the first component (Header or Row) that has widths + // OR by an explicit Line() call from table.go's batch renderer. + return nil +} + +// renderTopBorderIfNeeded is called by Header or Row if it's the first to render +// and tableOutputStarted is false. +func (o *Ocean) renderTopBorderIfNeeded(currentPosition tw.Position, ctx tw.Formatting) { + if !o.tableOutputStarted && o.widthsFinalized { + // This renderer's config for Top border + if o.config.Borders.Top.Enabled() && o.config.Settings.Lines.ShowTop.Enabled() { + o.logger.Debugf("Ocean itself rendering top border (triggered by %s)", currentPosition) + lineCtx := tw.Formatting{ // Construct specific context for this line + Row: tw.RowContext{ + Widths: o.fixedWidths, + Location: tw.LocationFirst, + Position: currentPosition, + Next: ctx.Row.Current, // The actual first content is "Next" to the top border + }, + Level: tw.LevelHeader, + } + o.Line(lineCtx) + o.tableOutputStarted = true + } + } +} + +func (o *Ocean) Header(headers [][]string, ctx tw.Formatting) { + o.logger.Debugf("Ocean.Header called: IsSubRow=%v, Location=%v, NumLines=%d", ctx.IsSubRow, ctx.Row.Location, len(headers)) + + if !o.widthsFinalized { + o.tryFinalizeWidths(ctx) + } + // The batch renderer (table.go/renderHeader) will call Line() for the top border + // and for the header separator if its main config t.config says so. + // So, Ocean.Header should *not* draw these itself when in batch mode. + // For true streaming, table.go's streamRenderHeader would make these Line() calls. + + // Decision: Ocean.Header *only* renders header content. + // Lines (top border, header separator) are managed by the caller (batch or stream logic in table.go). + + if !o.widthsFinalized { + o.logger.Error("Ocean.Header: Cannot render content, widths are not finalized.") + // o.headerContentRendered = true; // No, content wasn't rendered. + return + } + + if len(headers) > 0 && len(headers[0]) > 0 { + for i, headerLineData := range headers { + currentLineCtx := ctx + currentLineCtx.Row.Widths = o.fixedWidths + if i > 0 { + currentLineCtx.IsSubRow = true + } + o.renderContentLine(currentLineCtx, headerLineData) + o.tableOutputStarted = true // Content was written + } + o.headerContentRendered = true + } else { + o.logger.Debug("Ocean.Header: No actual header content lines to render.") + // If header is empty, table.go's renderHeader might still call Line() for the separator. + // o.headerContentRendered remains false if no content. + } + // DO NOT draw the header separator line here. Let table.go's renderHeader or streamRenderHeader call o.Line(). +} + +func (o *Ocean) Row(row []string, ctx tw.Formatting) { + o.logger.Debugf("Ocean.Row called: IsSubRow=%v, Location=%v, DataItems=%d", ctx.IsSubRow, ctx.Row.Location, len(row)) + + if !o.widthsFinalized { + o.tryFinalizeWidths(ctx) + } + // Top border / header separator logic: + // If this is the very first output, table.go's batch renderHeader (or streamRenderHeader) + // should have already called Line() for top border and header separator. + // If Header() was called but rendered no content, table.go's renderHeader would still call Line() for the separator. + // If Header() was never called by table.go (e.g. streaming rows directly after Start()), + // then table.go's streamAppendRow needs to handle initial lines. + + // Decision: Ocean.Row *only* renders row content. + + if !o.widthsFinalized { + o.logger.Error("Ocean.Row: Cannot render content, widths are not finalized.") + return + } + + ctx.Row.Widths = o.fixedWidths + o.renderContentLine(ctx, row) + o.tableOutputStarted = true +} + +func (o *Ocean) Footer(footers [][]string, ctx tw.Formatting) { + o.logger.Debugf("Ocean.Footer called: IsSubRow=%v, Location=%v, NumLines=%d", ctx.IsSubRow, ctx.Row.Location, len(footers)) + + if !o.widthsFinalized { + o.tryFinalizeWidths(ctx) + o.logger.Warn("Ocean.Footer: Widths finalized at Footer stage (unusual).") + } + // Separator line before footer: + // This should be handled by table.go's renderFooter or streamRenderFooter calling o.Line(). + + // Decision: Ocean.Footer *only* renders footer content. + + if !o.widthsFinalized { + o.logger.Error("Ocean.Footer: Cannot render content, widths are not finalized.") + return + } + + if len(footers) > 0 && len(footers[0]) > 0 { + for i, footerLineData := range footers { + currentLineCtx := ctx + currentLineCtx.Row.Widths = o.fixedWidths + if i > 0 { + currentLineCtx.IsSubRow = true + } + o.renderContentLine(currentLineCtx, footerLineData) + o.tableOutputStarted = true + } + } else { + o.logger.Debug("Ocean.Footer: No actual footer content lines to render.") + } + // DO NOT draw the bottom border here. Let table.go's main Close or batch renderFooter call o.Line(). +} + +func (o *Ocean) Line(ctx tw.Formatting) { + // This method is now called EXTERNALLY by table.go's batch or stream logic + // to draw all horizontal lines (top border, header sep, footer sep, bottom border). + if !o.widthsFinalized { + // If Line is called before widths are known (e.g. table.go's batch renderHeader trying to draw top border) + // we must try to finalize widths from this context. + o.tryFinalizeWidths(ctx) + if !o.widthsFinalized { + o.logger.Error("Ocean.Line: Called but widths could not be finalized. Skipping line rendering.") + return + } + } + // Ensure Line uses the consistent fixedWidths for drawing + ctx.Row.Widths = o.fixedWidths + + o.logger.Debugf("Ocean.Line DRAWING: Level=%v, Loc=%s, Pos=%s, IsSubRow=%t, WidthsLen=%d", ctx.Level, ctx.Row.Location, ctx.Row.Position, ctx.IsSubRow, ctx.Row.Widths.Len()) + + jr := NewJunction(JunctionContext{ + Symbols: o.config.Symbols, + Ctx: ctx, + ColIdx: 0, + Logger: o.logger, + BorderTint: Tint{}, + SeparatorTint: Tint{}, + }) + + var line strings.Builder + sortedColIndices := o.fixedWidths.SortedKeys() + + if len(sortedColIndices) == 0 { + drewEmptyBorders := false + if o.config.Borders.Left.Enabled() { + line.WriteString(jr.RenderLeft()) + drewEmptyBorders = true + } + if o.config.Borders.Right.Enabled() { + line.WriteString(jr.RenderRight(-1)) + drewEmptyBorders = true + } + if drewEmptyBorders { + line.WriteString(tw.NewLine) + o.w.Write([]byte(line.String())) + o.logger.Debug("Line: Drew empty table borders based on Line call.") + } else { + o.logger.Debug("Line: Handled empty table case (no columns, no borders).") + } + o.tableOutputStarted = drewEmptyBorders // A line counts as output + return + } + + if o.config.Borders.Left.Enabled() { + line.WriteString(jr.RenderLeft()) + } + + for i, colIdx := range sortedColIndices { + jr.colIdx = colIdx + segmentChar := jr.GetSegment() + colVisualWidth := o.fixedWidths.Get(colIdx) + + if colVisualWidth <= 0 { + // Still need to consider separators after zero-width columns + } else { + if segmentChar == tw.Empty { + segmentChar = o.config.Symbols.Row() + } + segmentDisplayWidth := tw.DisplayWidth(segmentChar) + if segmentDisplayWidth <= 0 { + segmentDisplayWidth = 1 + } + + repeatCount := 0 + if colVisualWidth > 0 { + repeatCount = colVisualWidth / segmentDisplayWidth + if repeatCount == 0 { + repeatCount = 1 + } + } + line.WriteString(strings.Repeat(segmentChar, repeatCount)) + } + + if i < len(sortedColIndices)-1 && o.config.Settings.Separators.BetweenColumns.Enabled() { + nextColIdx := sortedColIndices[i+1] + line.WriteString(jr.RenderJunction(colIdx, nextColIdx)) + } + } + + if o.config.Borders.Right.Enabled() { + lastColIdx := sortedColIndices[len(sortedColIndices)-1] + line.WriteString(jr.RenderRight(lastColIdx)) + } + + line.WriteString(tw.NewLine) + o.w.Write([]byte(line.String())) + o.tableOutputStarted = true + o.logger.Debugf("Line rendered by explicit call: %s", strings.TrimSuffix(line.String(), tw.NewLine)) +} + +func (o *Ocean) Close() error { + o.logger.Debug("Ocean.Close() called.") + // The actual bottom border drawing is expected to be handled by table.go's + // batch render logic (renderFooter) or stream logic (streamRenderBottomBorder) + // by making an explicit call to o.Line() with the correct context. + // Ocean.Close() itself does not draw the bottom border to avoid duplication. + + // Only reset state. + o.resetState() + return nil +} + +func (o *Ocean) renderContentLine(ctx tw.Formatting, lineData []string) { + if !o.widthsFinalized || o.fixedWidths.Len() == 0 { + o.logger.Error("renderContentLine: Cannot render, fixedWidths not set or empty.") + return + } + + var output strings.Builder + if o.config.Borders.Left.Enabled() { + output.WriteString(o.config.Symbols.Column()) + } + + sortedColIndices := o.fixedWidths.SortedKeys() + + for i, colIdx := range sortedColIndices { + cellVisualWidth := o.fixedWidths.Get(colIdx) + cellContent := tw.Empty + align := tw.AlignDefault + padding := tw.Padding{Left: tw.Space, Right: tw.Space} + + switch ctx.Row.Position { + case tw.Header: + align = tw.AlignCenter + case tw.Footer: + align = tw.AlignRight + default: + align = tw.AlignLeft + } + + cellCtx, hasCellCtx := ctx.Row.Current[colIdx] + if hasCellCtx { + cellContent = cellCtx.Data + if cellCtx.Align.Validate() == nil && cellCtx.Align != tw.AlignNone { + align = cellCtx.Align + } + if cellCtx.Padding.Paddable() { + padding = cellCtx.Padding + } + } else if colIdx < len(lineData) { + cellContent = lineData[colIdx] + } + + actualCellWidthToRender := cellVisualWidth + isHMergeContinuation := false + + if hasCellCtx && cellCtx.Merge.Horizontal.Present { + if cellCtx.Merge.Horizontal.Start { + hSpan := cellCtx.Merge.Horizontal.Span + if hSpan <= 0 { + hSpan = 1 + } + + currentMergeTotalRenderWidth := 0 + for k := 0; k < hSpan; k++ { + idxInMergeSpan := colIdx + k + // Check if idxInMergeSpan is a defined column in fixedWidths + foundInFixedWidths := false + for _, sortedCIdx_inner := range sortedColIndices { + if sortedCIdx_inner == idxInMergeSpan { + currentMergeTotalRenderWidth += o.fixedWidths.Get(idxInMergeSpan) + foundInFixedWidths = true + break + } + } + if !foundInFixedWidths && idxInMergeSpan <= sortedColIndices[len(sortedColIndices)-1] { + o.logger.Debugf("Col %d in HMerge span not found in fixedWidths, assuming 0-width contribution.", idxInMergeSpan) + } + + if k < hSpan-1 && o.config.Settings.Separators.BetweenColumns.Enabled() { + currentMergeTotalRenderWidth += tw.DisplayWidth(o.config.Symbols.Column()) + } + } + actualCellWidthToRender = currentMergeTotalRenderWidth + } else { + isHMergeContinuation = true + } + } + + if isHMergeContinuation { + o.logger.Debugf("renderContentLine: Col %d is HMerge continuation, skipping content render.", colIdx) + // The separator logic below needs to handle this correctly. + // If the *previous* column was the start of a merge that spans *this* column, + // then the separator after the previous column should have been suppressed. + } else if actualCellWidthToRender > 0 { + formattedCell := o.formatCellContent(cellContent, actualCellWidthToRender, padding, align) + output.WriteString(formattedCell) + } else { + o.logger.Debugf("renderContentLine: col %d has 0 render width, writing no content.", colIdx) + } + + // Add column separator if: + // 1. It's not the last column in sortedColIndices + // 2. Separators are enabled + // 3. This cell is NOT a horizontal merge start that spans over the next column. + if i < len(sortedColIndices)-1 && o.config.Settings.Separators.BetweenColumns.Enabled() { + shouldAddSeparator := true + if hasCellCtx && cellCtx.Merge.Horizontal.Present && cellCtx.Merge.Horizontal.Start { + // If this merge start spans beyond the current colIdx into the next sortedColIndex + if colIdx+cellCtx.Merge.Horizontal.Span > sortedColIndices[i+1] { + shouldAddSeparator = false // Separator is part of the merged cell's width + o.logger.Debugf("renderContentLine: Suppressed separator after HMerge col %d.", colIdx) + } + } + if shouldAddSeparator { + output.WriteString(o.config.Symbols.Column()) + } + } + } + + if o.config.Borders.Right.Enabled() { + output.WriteString(o.config.Symbols.Column()) + } + + output.WriteString(tw.NewLine) + o.w.Write([]byte(output.String())) + o.logger.Debugf("Content line rendered: %s", strings.TrimSuffix(output.String(), tw.NewLine)) +} + +func (o *Ocean) formatCellContent(content string, cellVisualWidth int, padding tw.Padding, align tw.Align) string { + if cellVisualWidth <= 0 { + return tw.Empty + } + + contentDisplayWidth := tw.DisplayWidth(content) + + padLeftChar := padding.Left + if padLeftChar == tw.Empty { + padLeftChar = tw.Space + } + padRightChar := padding.Right + if padRightChar == tw.Empty { + padRightChar = tw.Space + } + + padLeftDisplayWidth := tw.DisplayWidth(padLeftChar) + padRightDisplayWidth := tw.DisplayWidth(padRightChar) + + spaceForContentAndAlignment := cellVisualWidth - padLeftDisplayWidth - padRightDisplayWidth + if spaceForContentAndAlignment < 0 { + spaceForContentAndAlignment = 0 + } + + if contentDisplayWidth > spaceForContentAndAlignment { + content = tw.TruncateString(content, spaceForContentAndAlignment) + contentDisplayWidth = tw.DisplayWidth(content) + } + + remainingSpace := spaceForContentAndAlignment - contentDisplayWidth + if remainingSpace < 0 { + remainingSpace = 0 + } + + var PL, PR string + switch align { + case tw.AlignRight: + PL = strings.Repeat(tw.Space, remainingSpace) + case tw.AlignCenter: + leftSpaces := remainingSpace / 2 + rightSpaces := remainingSpace - leftSpaces + PL = strings.Repeat(tw.Space, leftSpaces) + PR = strings.Repeat(tw.Space, rightSpaces) + default: + PR = strings.Repeat(tw.Space, remainingSpace) + } + + var sb strings.Builder + sb.WriteString(padLeftChar) + sb.WriteString(PL) + sb.WriteString(content) + sb.WriteString(PR) + sb.WriteString(padRightChar) + + currentFormattedWidth := tw.DisplayWidth(sb.String()) + if currentFormattedWidth < cellVisualWidth { + if align == tw.AlignRight { + prefixSpaces := strings.Repeat(tw.Space, cellVisualWidth-currentFormattedWidth) + finalStr := prefixSpaces + sb.String() + sb.Reset() + sb.WriteString(finalStr) + } else { + sb.WriteString(strings.Repeat(tw.Space, cellVisualWidth-currentFormattedWidth)) + } + } else if currentFormattedWidth > cellVisualWidth { + tempStr := sb.String() + sb.Reset() + sb.WriteString(tw.TruncateString(tempStr, cellVisualWidth)) + o.logger.Warnf("formatCellContent: Final string '%s' (width %d) exceeded target %d. Force truncated.", tempStr, currentFormattedWidth, cellVisualWidth) + } + return sb.String() +} + +func (o *Ocean) Rendition(config tw.Rendition) { + o.config = mergeRendition(o.config, config) + o.logger.Debugf("Blueprint.Rendition updated. New internal config: %+v", o.config) +} + +// Ensure Blueprint implements tw.Renditioning +var _ tw.Renditioning = (*Ocean)(nil) diff --git a/vendor/github.com/olekukonko/tablewriter/renderer/svg.go b/vendor/github.com/olekukonko/tablewriter/renderer/svg.go new file mode 100644 index 0000000..013e8b8 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/renderer/svg.go @@ -0,0 +1,702 @@ +package renderer + +import ( + "fmt" + "github.com/olekukonko/ll" + "html" + "io" + "strings" + + "github.com/olekukonko/tablewriter/tw" +) + +// SVGConfig holds configuration for the SVG renderer. +// Fields include font, colors, padding, and merge rendering options. +// Used to customize SVG output appearance and behavior. +type SVGConfig struct { + FontFamily string // e.g., "Arial, sans-serif" + FontSize float64 // Base font size in SVG units + LineHeightFactor float64 // Factor for line height (e.g., 1.2) + Padding float64 // Padding inside cells + StrokeWidth float64 // Line width for borders + StrokeColor string // Color for strokes (e.g., "black") + HeaderBG string // Background color for header + RowBG string // Background color for rows + RowAltBG string // Alternating row background color + FooterBG string // Background color for footer + HeaderColor string // Text color for header + RowColor string // Text color for rows + FooterColor string // Text color for footer + ApproxCharWidthFactor float64 // Char width relative to FontSize + MinColWidth float64 // Minimum column width + RenderTWConfigOverrides bool // Override SVG alignments with tablewriter + Debug bool // Enable debug logging + ScaleFactor float64 // Scaling factor for SVG +} + +// SVG implements tw.Renderer for SVG output. +// Manages SVG element generation and merge tracking. +type SVG struct { + config SVGConfig + trace []string + + allVisualLineData [][][]string // [section][line][cell] + allVisualLineCtx [][]tw.Formatting // [section][line]Formatting + + maxCols int + calculatedColWidths []float64 + svgElements strings.Builder + currentY float64 + dataRowCounter int + vMergeTrack map[int]int // Tracks vertical merge spans + numVisualRowsDrawn int + logger *ll.Logger + w io.Writer +} + +const ( + sectionTypeHeader = 0 + sectionTypeRow = 1 + sectionTypeFooter = 2 +) + +// NewSVG creates a new SVG renderer with configuration. +// Parameter configs provides optional SVGConfig; defaults used if empty. +// Returns a configured SVG instance. +func NewSVG(configs ...SVGConfig) *SVG { + cfg := SVGConfig{ + FontFamily: "sans-serif", + FontSize: 12.0, + LineHeightFactor: 1.4, + Padding: 5.0, + StrokeWidth: 1.0, + StrokeColor: "black", + HeaderBG: "#F0F0F0", + RowBG: "white", + RowAltBG: "#F9F9F9", + FooterBG: "#F0F0F0", + HeaderColor: "black", + RowColor: "black", + FooterColor: "black", + ApproxCharWidthFactor: 0.6, + MinColWidth: 30.0, + ScaleFactor: 1.0, + RenderTWConfigOverrides: true, + Debug: false, + } + if len(configs) > 0 { + userCfg := configs[0] + if userCfg.FontFamily != tw.Empty { + cfg.FontFamily = userCfg.FontFamily + } + if userCfg.FontSize > 0 { + cfg.FontSize = userCfg.FontSize + } + if userCfg.LineHeightFactor > 0 { + cfg.LineHeightFactor = userCfg.LineHeightFactor + } + if userCfg.Padding >= 0 { + cfg.Padding = userCfg.Padding + } + if userCfg.StrokeWidth > 0 { + cfg.StrokeWidth = userCfg.StrokeWidth + } + if userCfg.StrokeColor != tw.Empty { + cfg.StrokeColor = userCfg.StrokeColor + } + if userCfg.HeaderBG != tw.Empty { + cfg.HeaderBG = userCfg.HeaderBG + } + if userCfg.RowBG != tw.Empty { + cfg.RowBG = userCfg.RowBG + } + cfg.RowAltBG = userCfg.RowAltBG + if userCfg.FooterBG != tw.Empty { + cfg.FooterBG = userCfg.FooterBG + } + if userCfg.HeaderColor != tw.Empty { + cfg.HeaderColor = userCfg.HeaderColor + } + if userCfg.RowColor != tw.Empty { + cfg.RowColor = userCfg.RowColor + } + if userCfg.FooterColor != tw.Empty { + cfg.FooterColor = userCfg.FooterColor + } + if userCfg.ApproxCharWidthFactor > 0 { + cfg.ApproxCharWidthFactor = userCfg.ApproxCharWidthFactor + } + if userCfg.MinColWidth >= 0 { + cfg.MinColWidth = userCfg.MinColWidth + } + cfg.RenderTWConfigOverrides = userCfg.RenderTWConfigOverrides + cfg.Debug = userCfg.Debug + } + r := &SVG{ + config: cfg, + trace: make([]string, 0, 50), + allVisualLineData: make([][][]string, 3), + allVisualLineCtx: make([][]tw.Formatting, 3), + vMergeTrack: make(map[int]int), + } + for i := 0; i < 3; i++ { + r.allVisualLineData[i] = make([][]string, 0) + r.allVisualLineCtx[i] = make([]tw.Formatting, 0) + } + return r +} + +// calculateAllColumnWidths computes column widths based on content and merges. +// Uses content length and merge spans; handles horizontal merges by distributing width. +func (s *SVG) calculateAllColumnWidths() { + s.debug("Calculating column widths") + tempMaxCols := 0 + for sectionIdx := 0; sectionIdx < 3; sectionIdx++ { + for lineIdx, lineCtx := range s.allVisualLineCtx[sectionIdx] { + if lineCtx.Row.Current != nil { + visualColCount := 0 + for colIdx := 0; colIdx < len(lineCtx.Row.Current); { + cellCtx := lineCtx.Row.Current[colIdx] + if cellCtx.Merge.Horizontal.Present && !cellCtx.Merge.Horizontal.Start { + colIdx++ // Skip non-start merged cells + continue + } + visualColCount++ + span := 1 + if cellCtx.Merge.Horizontal.Present && cellCtx.Merge.Horizontal.Start { + span = cellCtx.Merge.Horizontal.Span + if span <= 0 { + span = 1 + } + } + colIdx += span + } + s.debug("Section %d, line %d: Visual columns = %d", sectionIdx, lineIdx, visualColCount) + if visualColCount > tempMaxCols { + tempMaxCols = visualColCount + } + } else if lineIdx < len(s.allVisualLineData[sectionIdx]) { + if rawDataLen := len(s.allVisualLineData[sectionIdx][lineIdx]); rawDataLen > tempMaxCols { + tempMaxCols = rawDataLen + } + } + } + } + s.maxCols = tempMaxCols + s.debug("Max columns: %d", s.maxCols) + if s.maxCols == 0 { + s.calculatedColWidths = []float64{} + return + } + s.calculatedColWidths = make([]float64, s.maxCols) + for i := range s.calculatedColWidths { + s.calculatedColWidths[i] = s.config.MinColWidth + } + + // Structure to track max width for each merge group + type mergeKey struct { + startCol int + span int + } + maxMergeWidths := make(map[mergeKey]float64) + + processSectionForWidth := func(sectionIdx int) { + for lineIdx, visualLineData := range s.allVisualLineData[sectionIdx] { + if lineIdx >= len(s.allVisualLineCtx[sectionIdx]) { + s.debug("Warning: Missing context for section %d line %d", sectionIdx, lineIdx) + continue + } + lineCtx := s.allVisualLineCtx[sectionIdx][lineIdx] + currentTableCol := 0 + currentVisualCol := 0 + for currentVisualCol < len(visualLineData) && currentTableCol < s.maxCols { + cellContent := visualLineData[currentVisualCol] + cellCtx := tw.CellContext{} + if lineCtx.Row.Current != nil { + if c, ok := lineCtx.Row.Current[currentTableCol]; ok { + cellCtx = c + } + } + hSpan := 1 + if cellCtx.Merge.Horizontal.Present { + if cellCtx.Merge.Horizontal.Start { + hSpan = cellCtx.Merge.Horizontal.Span + if hSpan <= 0 { + hSpan = 1 + } + } else { + currentTableCol++ + continue + } + } + textPixelWidth := s.estimateTextWidth(cellContent) + contentAndPaddingWidth := textPixelWidth + (2 * s.config.Padding) + if hSpan == 1 { + if currentTableCol < len(s.calculatedColWidths) && contentAndPaddingWidth > s.calculatedColWidths[currentTableCol] { + s.calculatedColWidths[currentTableCol] = contentAndPaddingWidth + } + } else { + totalMergedWidth := contentAndPaddingWidth + (float64(hSpan-1) * s.config.Padding * 2) + if totalMergedWidth < s.config.MinColWidth*float64(hSpan) { + totalMergedWidth = s.config.MinColWidth * float64(hSpan) + } + if currentTableCol < len(s.calculatedColWidths) { + key := mergeKey{currentTableCol, hSpan} + if currentWidth, ok := maxMergeWidths[key]; ok { + if totalMergedWidth > currentWidth { + maxMergeWidths[key] = totalMergedWidth + } + } else { + maxMergeWidths[key] = totalMergedWidth + } + s.debug("Horizontal merge at col %d, span %d: Total width %.2f", currentTableCol, hSpan, totalMergedWidth) + } + } + currentTableCol += hSpan + currentVisualCol++ + } + } + } + processSectionForWidth(sectionTypeHeader) + processSectionForWidth(sectionTypeRow) + processSectionForWidth(sectionTypeFooter) + + // Apply maximum widths for merged cells + for key, width := range maxMergeWidths { + s.calculatedColWidths[key.startCol] = width + for i := 1; i < key.span && (key.startCol+i) < len(s.calculatedColWidths); i++ { + s.calculatedColWidths[key.startCol+i] = 0 + } + } + + for i := range s.calculatedColWidths { + if s.calculatedColWidths[i] < s.config.MinColWidth && s.calculatedColWidths[i] != 0 { + s.calculatedColWidths[i] = s.config.MinColWidth + } + } + s.debug("Column widths: %v", s.calculatedColWidths) +} + +// Close finalizes SVG rendering and writes output. +// Parameter w is the output w. +// Returns an error if writing fails. +func (s *SVG) Close() error { + s.debug("Finalizing SVG output") + s.calculateAllColumnWidths() + s.renderBufferedData() + if s.numVisualRowsDrawn == 0 && s.maxCols == 0 { + fmt.Fprintf(s.w, ``, s.config.StrokeWidth*2, s.config.StrokeWidth*2) + return nil + } + totalWidth := s.config.StrokeWidth + if len(s.calculatedColWidths) > 0 { + for _, cw := range s.calculatedColWidths { + colWidth := cw + if colWidth <= 0 { + colWidth = s.config.MinColWidth + } + totalWidth += colWidth + s.config.StrokeWidth + } + } else if s.maxCols > 0 { + for i := 0; i < s.maxCols; i++ { + totalWidth += s.config.MinColWidth + s.config.StrokeWidth + } + } else { + totalWidth = s.config.StrokeWidth * 2 + } + totalHeight := s.currentY + singleVisualRowHeight := s.config.FontSize*s.config.LineHeightFactor + (2 * s.config.Padding) + if s.numVisualRowsDrawn == 0 { + if s.maxCols > 0 { + totalHeight = s.config.StrokeWidth + singleVisualRowHeight + s.config.StrokeWidth + } else { + totalHeight = s.config.StrokeWidth * 2 + } + } + fmt.Fprintf(s.w, ``, + totalWidth, totalHeight, html.EscapeString(s.config.FontFamily), s.config.FontSize) + fmt.Fprintln(s.w) + fmt.Fprintln(s.w, "") + if _, err := io.WriteString(s.w, s.svgElements.String()); err != nil { + fmt.Fprintln(s.w, ``) + return fmt.Errorf("failed to write SVG elements: %w", err) + } + if s.maxCols > 0 || s.numVisualRowsDrawn > 0 { + fmt.Fprintf(s.w, ` `, + html.EscapeString(s.config.StrokeColor), s.config.StrokeWidth) + fmt.Fprintln(s.w) + yPos := s.config.StrokeWidth / 2.0 + borderRowsToDraw := s.numVisualRowsDrawn + if borderRowsToDraw == 0 && s.maxCols > 0 { + borderRowsToDraw = 1 + } + lineStartX := s.config.StrokeWidth / 2.0 + lineEndX := s.config.StrokeWidth / 2.0 + for _, width := range s.calculatedColWidths { + lineEndX += width + s.config.StrokeWidth + } + for i := 0; i <= borderRowsToDraw; i++ { + fmt.Fprintf(s.w, ` %s`, + lineStartX, yPos, lineEndX, yPos, "\n") + if i < borderRowsToDraw { + yPos += singleVisualRowHeight + s.config.StrokeWidth + } + } + xPos := s.config.StrokeWidth / 2.0 + borderLineStartY := s.config.StrokeWidth / 2.0 + borderLineEndY := totalHeight - (s.config.StrokeWidth / 2.0) + for visualColIdx := 0; visualColIdx <= s.maxCols; visualColIdx++ { + fmt.Fprintf(s.w, ` %s`, + xPos, borderLineStartY, xPos, borderLineEndY, "\n") + if visualColIdx < s.maxCols { + colWidth := s.config.MinColWidth + if visualColIdx < len(s.calculatedColWidths) && s.calculatedColWidths[visualColIdx] > 0 { + colWidth = s.calculatedColWidths[visualColIdx] + } + xPos += colWidth + s.config.StrokeWidth + } + } + fmt.Fprintln(s.w, " ") + } + fmt.Fprintln(s.w, ``) + return nil +} + +// Config returns the renderer's configuration. +// No parameters are required. +// Returns a Rendition with border and debug settings. +func (s *SVG) Config() tw.Rendition { + return tw.Rendition{ + Borders: tw.Border{Left: tw.On, Right: tw.On, Top: tw.On, Bottom: tw.On}, + Settings: tw.Settings{}, + Streaming: false, + } +} + +// Debug returns the renderer's debug trace. +// No parameters are required. +// Returns a slice of debug messages. +func (s *SVG) Debug() []string { + return s.trace +} + +// estimateTextWidth estimates text width in SVG units. +// Parameter text is the input string to measure. +// Returns the estimated width based on font size and char factor. +func (s *SVG) estimateTextWidth(text string) float64 { + runeCount := float64(len([]rune(text))) + return runeCount * s.config.FontSize * s.config.ApproxCharWidthFactor +} + +// Footer buffers footer lines for SVG rendering. +// Parameters include w (w), footers (lines), and ctx (formatting). +// No return value; stores data for later rendering. +func (s *SVG) Footer(footers [][]string, ctx tw.Formatting) { + s.debug("Buffering %d footer lines", len(footers)) + for i, line := range footers { + currentCtx := ctx + currentCtx.IsSubRow = (i > 0) + s.storeVisualLine(sectionTypeFooter, line, currentCtx) + } +} + +// getSVGAnchorFromTW maps tablewriter alignment to SVG text-anchor. +// Parameter align is the tablewriter alignment setting. +// Returns the corresponding SVG text-anchor value or empty string. +func (s *SVG) getSVGAnchorFromTW(align tw.Align) string { + switch align { + case tw.AlignLeft: + return "start" + case tw.AlignCenter: + return "middle" + case tw.AlignRight: + return "end" + case tw.AlignNone, tw.Skip: + return tw.Empty + } + return tw.Empty +} + +// Header buffers header lines for SVG rendering. +// Parameters include w (w), headers (lines), and ctx (formatting). +// No return value; stores data for later rendering. +func (s *SVG) Header(headers [][]string, ctx tw.Formatting) { + s.debug("Buffering %d header lines", len(headers)) + for i, line := range headers { + currentCtx := ctx + currentCtx.IsSubRow = i > 0 + s.storeVisualLine(sectionTypeHeader, line, currentCtx) + } +} + +// Line handles border rendering (ignored in SVG renderer). +// Parameters include w (w) and ctx (formatting). +// No return value; SVG borders are drawn in Close. +func (s *SVG) Line(ctx tw.Formatting) { + s.debug("Line rendering ignored") +} + +// padLineSVG pads a line to the specified column count. +// Parameters include line (input strings) and numCols (target length). +// Returns the padded line with empty strings as needed. +func padLineSVG(line []string, numCols int) []string { + if numCols <= 0 { + return []string{} + } + currentLen := len(line) + if currentLen == numCols { + return line + } + if currentLen > numCols { + return line[:numCols] + } + padded := make([]string, numCols) + copy(padded, line) + return padded +} + +// renderBufferedData renders all buffered lines to SVG elements. +// No parameters are required. +// No return value; populates svgElements buffer. +func (s *SVG) renderBufferedData() { + s.debug("Rendering buffered data") + s.currentY = s.config.StrokeWidth + s.dataRowCounter = 0 + s.vMergeTrack = make(map[int]int) + s.numVisualRowsDrawn = 0 + renderSection := func(sectionIdx int, position tw.Position) { + for visualLineIdx, visualLineData := range s.allVisualLineData[sectionIdx] { + if visualLineIdx >= len(s.allVisualLineCtx[sectionIdx]) { + s.debug("Error: Missing context for section %d line %d", sectionIdx, visualLineIdx) + continue + } + s.renderVisualLine(visualLineData, s.allVisualLineCtx[sectionIdx][visualLineIdx], position) + } + } + renderSection(sectionTypeHeader, tw.Header) + renderSection(sectionTypeRow, tw.Row) + renderSection(sectionTypeFooter, tw.Footer) +} + +// renderVisualLine renders a single visual line as SVG elements. +// Parameters include lineData (cell content), ctx (formatting), and position (section type). +// No return value; handles horizontal and vertical merges. +func (s *SVG) renderVisualLine(visualLineData []string, ctx tw.Formatting, position tw.Position) { + if s.maxCols == 0 || len(s.calculatedColWidths) == 0 { + s.debug("Skipping line rendering: maxCols=%d, widths=%d", s.maxCols, len(s.calculatedColWidths)) + return + } + s.numVisualRowsDrawn++ + s.debug("Rendering visual row %d", s.numVisualRowsDrawn) + singleVisualRowHeight := s.config.FontSize*s.config.LineHeightFactor + (2 * s.config.Padding) + bgColor := tw.Empty + textColor := tw.Empty + defaultTextAnchor := "start" + switch position { + case tw.Header: + bgColor = s.config.HeaderBG + textColor = s.config.HeaderColor + defaultTextAnchor = "middle" + case tw.Footer: + bgColor = s.config.FooterBG + textColor = s.config.FooterColor + defaultTextAnchor = "end" + default: + textColor = s.config.RowColor + if !ctx.IsSubRow { + if s.config.RowAltBG != tw.Empty && s.dataRowCounter%2 != 0 { + bgColor = s.config.RowAltBG + } else { + bgColor = s.config.RowBG + } + s.dataRowCounter++ + } else { + parentDataRowStripeIndex := s.dataRowCounter - 1 + if parentDataRowStripeIndex < 0 { + parentDataRowStripeIndex = 0 + } + if s.config.RowAltBG != tw.Empty && parentDataRowStripeIndex%2 != 0 { + bgColor = s.config.RowAltBG + } else { + bgColor = s.config.RowBG + } + } + } + currentX := s.config.StrokeWidth + currentVisualCellIdx := 0 + for tableColIdx := 0; tableColIdx < s.maxCols; { + if tableColIdx >= len(s.calculatedColWidths) { + s.debug("Table Col %d out of bounds for widths", tableColIdx) + tableColIdx++ + continue + } + if remainingVSpan, isMerging := s.vMergeTrack[tableColIdx]; isMerging && remainingVSpan > 1 { + s.vMergeTrack[tableColIdx]-- + if s.vMergeTrack[tableColIdx] <= 1 { + delete(s.vMergeTrack, tableColIdx) + } + currentX += s.calculatedColWidths[tableColIdx] + s.config.StrokeWidth + tableColIdx++ + continue + } + cellContentFromVisualLine := tw.Empty + if currentVisualCellIdx < len(visualLineData) { + cellContentFromVisualLine = visualLineData[currentVisualCellIdx] + } + cellCtx := tw.CellContext{} + if ctx.Row.Current != nil { + if c, ok := ctx.Row.Current[tableColIdx]; ok { + cellCtx = c + } + } + textToRender := cellContentFromVisualLine + if cellCtx.Data != tw.Empty { + if !((cellCtx.Merge.Vertical.Present && !cellCtx.Merge.Vertical.Start) || (cellCtx.Merge.Hierarchical.Present && !cellCtx.Merge.Hierarchical.Start)) { + textToRender = cellCtx.Data + } else { + textToRender = tw.Empty + } + } else if (cellCtx.Merge.Vertical.Present && !cellCtx.Merge.Vertical.Start) || (cellCtx.Merge.Hierarchical.Present && !cellCtx.Merge.Hierarchical.Start) { + textToRender = tw.Empty + } + hSpan := 1 + if cellCtx.Merge.Horizontal.Present { + if cellCtx.Merge.Horizontal.Start { + hSpan = cellCtx.Merge.Horizontal.Span + if hSpan <= 0 { + hSpan = 1 + } + } else { + currentX += s.calculatedColWidths[tableColIdx] + s.config.StrokeWidth + tableColIdx++ + continue + } + } + vSpan := 1 + isVSpanStart := false + if cellCtx.Merge.Vertical.Present && cellCtx.Merge.Vertical.Start { + vSpan = cellCtx.Merge.Vertical.Span + isVSpanStart = true + } else if cellCtx.Merge.Hierarchical.Present && cellCtx.Merge.Hierarchical.Start { + vSpan = cellCtx.Merge.Hierarchical.Span + isVSpanStart = true + } + if vSpan <= 0 { + vSpan = 1 + } + rectWidth := 0.0 + for hs := 0; hs < hSpan && (tableColIdx+hs) < s.maxCols; hs++ { + if (tableColIdx + hs) < len(s.calculatedColWidths) { + rectWidth += s.calculatedColWidths[tableColIdx+hs] + } else { + rectWidth += s.config.MinColWidth + } + } + if hSpan > 1 { + rectWidth += float64(hSpan-1) * s.config.StrokeWidth + } + if rectWidth <= 0 { + tableColIdx += hSpan + if hSpan > 0 { + currentVisualCellIdx++ + } + continue + } + rectHeight := singleVisualRowHeight + if isVSpanStart && vSpan > 1 { + rectHeight = float64(vSpan)*singleVisualRowHeight + float64(vSpan-1)*s.config.StrokeWidth + for hs := 0; hs < hSpan && (tableColIdx+hs) < s.maxCols; hs++ { + s.vMergeTrack[tableColIdx+hs] = vSpan + } + s.debug("Vertical merge at col %d, span %d, height %.2f", tableColIdx, vSpan, rectHeight) + } else if remainingVSpan, isMerging := s.vMergeTrack[tableColIdx]; isMerging && remainingVSpan > 1 { + rectHeight = singleVisualRowHeight + textToRender = tw.Empty + } + fmt.Fprintf(&s.svgElements, ` %s`, + currentX, s.currentY, rectWidth, rectHeight, html.EscapeString(bgColor), "\n") + cellTextAnchor := defaultTextAnchor + if s.config.RenderTWConfigOverrides { + if al := s.getSVGAnchorFromTW(cellCtx.Align); al != tw.Empty { + cellTextAnchor = al + } + } + textX := currentX + s.config.Padding + if cellTextAnchor == "middle" { + textX = currentX + s.config.Padding + (rectWidth-2*s.config.Padding)/2.0 + } else if cellTextAnchor == "end" { + textX = currentX + rectWidth - s.config.Padding + } + textY := s.currentY + rectHeight/2.0 + escapedCell := html.EscapeString(textToRender) + fmt.Fprintf(&s.svgElements, ` %s%s`, + textX, textY, html.EscapeString(textColor), cellTextAnchor, escapedCell, "\n") + currentX += rectWidth + s.config.StrokeWidth + tableColIdx += hSpan + currentVisualCellIdx++ + } + s.currentY += singleVisualRowHeight + s.config.StrokeWidth +} + +// Reset clears the renderer's internal state. +// No parameters are required. +// No return value; prepares for new rendering. +func (s *SVG) Reset() { + s.debug("Resetting state") + s.trace = make([]string, 0, 50) + for i := 0; i < 3; i++ { + s.allVisualLineData[i] = s.allVisualLineData[i][:0] + s.allVisualLineCtx[i] = s.allVisualLineCtx[i][:0] + } + s.maxCols = 0 + s.calculatedColWidths = nil + s.svgElements.Reset() + s.currentY = 0 + s.dataRowCounter = 0 + s.vMergeTrack = make(map[int]int) + s.numVisualRowsDrawn = 0 +} + +// Row buffers a row line for SVG rendering. +// Parameters include w (w), rowLine (cells), and ctx (formatting). +// No return value; stores data for later rendering. +func (s *SVG) Row(rowLine []string, ctx tw.Formatting) { + s.debug("Buffering row line, IsSubRow: %v", ctx.IsSubRow) + s.storeVisualLine(sectionTypeRow, rowLine, ctx) +} + +func (s *SVG) Logger(logger *ll.Logger) { + s.logger = logger.Namespace("svg") +} + +// Start initializes SVG rendering. +// Parameter w is the output w. +// Returns nil; prepares internal state. +func (s *SVG) Start(w io.Writer) error { + s.w = w + s.debug("Starting SVG rendering") + s.Reset() + return nil +} + +// debug logs a message if debugging is enabled. +// Parameters include format string and variadic arguments. +// No return value; appends to trace. +func (s *SVG) debug(format string, a ...interface{}) { + if s.config.Debug { + msg := fmt.Sprintf(format, a...) + s.trace = append(s.trace, fmt.Sprintf("[SVG] %s", msg)) + } +} + +// storeVisualLine stores a visual line for rendering. +// Parameters include sectionIdx, lineData (cells), and ctx (formatting). +// No return value; buffers data and context. +func (s *SVG) storeVisualLine(sectionIdx int, lineData []string, ctx tw.Formatting) { + copiedLineData := make([]string, len(lineData)) + copy(copiedLineData, lineData) + s.allVisualLineData[sectionIdx] = append(s.allVisualLineData[sectionIdx], copiedLineData) + s.allVisualLineCtx[sectionIdx] = append(s.allVisualLineCtx[sectionIdx], ctx) + hasCurrent := ctx.Row.Current != nil + s.debug("Stored line in section %d, has context: %v", sectionIdx, hasCurrent) +} diff --git a/vendor/github.com/olekukonko/tablewriter/stream.go b/vendor/github.com/olekukonko/tablewriter/stream.go new file mode 100644 index 0000000..1b230d0 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/stream.go @@ -0,0 +1,1150 @@ +package tablewriter + +import ( + "fmt" + "github.com/olekukonko/errors" + "github.com/olekukonko/tablewriter/tw" + "math" +) + +// Close finalizes the table stream. +// It requires the stream to be started (by calling NewStreamTable). +// It calls the renderer's Close method to render final elements (like the bottom border) and close the stream. +func (t *Table) Close() error { + t.logger.Debug("Close() called. Finalizing stream.") + + // Ensure stream was actually started and enabled + if !t.config.Stream.Enable || !t.hasPrinted { + t.logger.Warn("Close() called but streaming not enabled or not started. Ignoring Close() actions.") + // If renderer has a Close method that should always be called, consider that. + // For Blueprint, Close is a no-op, so returning early is fine. + // If we always call renderer.Close(), ensure it's safe if renderer.Start() wasn't called. + // Let's only call renderer.Close if stream was started. + if t.hasPrinted && t.renderer != nil { // Check if renderer is not nil for safety + t.renderer.Close() // Still call renderer's close for cleanup + } + t.hasPrinted = false // Reset flag + return nil + } + + // Render stored footer if any + if len(t.streamFooterLines) > 0 { + t.logger.Debug("Close(): Rendering stored footer.") + if err := t.streamRenderFooter(t.streamFooterLines); err != nil { + t.logger.Errorf("Close(): Failed to render stream footer: %v", err) + // Continue to try and close renderer and render bottom border + } + } + + // Render the final table bottom border + t.logger.Debug("Close(): Rendering stream bottom border.") + if err := t.streamRenderBottomBorder(); err != nil { + t.logger.Errorf("Close(): Failed to render stream bottom border: %v", err) + // Continue to try and close renderer + } + + // Call the underlying renderer's Close method + err := t.renderer.Close() + if err != nil { + t.logger.Errorf("Renderer.Close() failed: %v", err) + } + + // Reset streaming state + t.hasPrinted = false + t.headerRendered = false + t.firstRowRendered = false + t.lastRenderedLineContent = nil + t.lastRenderedMergeState = nil + t.lastRenderedPosition = "" + t.streamFooterLines = nil + // t.streamWidths should persist if we want to make multiple Start/Close calls on same config? + // For now, let's assume Start re-evaluates. If widths are from StreamConfig, they'd be reused. + // If derived, they'd be re-derived. Let's clear for true reset. + t.streamWidths = tw.NewMapper[int, int]() + t.streamNumCols = 0 + // t.streamRowCounter = 0 // Removed this field + + t.logger.Debug("Stream ended. hasPrinted = false.") + return err // Return error from renderer.Close or other significant errors +} + +// Start initializes the table stream. +// In this streaming model, renderer.Start() is primarily called in NewStreamTable. +// This method serves as a safeguard or point for adding pre-rendering logic. +// Start initializes the table stream. +// It is the entry point for streaming mode. +// Requires t.config.Stream.Enable to be true. +// Returns an error if streaming is disabled or the renderer does not support streaming, +// or if called multiple times on the same stream. +func (t *Table) Start() error { + t.ensureInitialized() // Ensures basic setup like loggers + + if !t.config.Stream.Enable { + // Start() should only be called when streaming is explicitly enabled. + // Otherwise, the user should call Render() for batch mode. + t.logger.Warn("Start() called but streaming is disabled. Call Render() instead for batch mode.") + return errors.New("start() called but streaming is disabled") + } + + if !t.renderer.Config().Streaming { + // Check if the configured renderer actually supports streaming. + t.logger.Error("Configured renderer does not support streaming.") + return fmt.Errorf("renderer does not support streaming") + } + + //t.renderer.Start(t.writer) + //t.renderer.Logger(t.logger) + + if t.hasPrinted { + // Prevent calling Start() multiple times on the same stream instance. + t.logger.Warn("Start() called multiple times for the same table stream. Ignoring subsequent calls.") + return nil + } + + t.logger.Debug("Starting table stream.") + + // Initialize/reset streaming state flags and buffers + t.headerRendered = false + t.firstRowRendered = false + t.lastRenderedLineContent = nil + t.lastRenderedPosition = "" // Reset last rendered position + t.streamFooterLines = nil // Reset footer buffer + t.streamNumCols = 0 // Reset derived column count + + // Calculate initial fixed widths if provided in StreamConfig.Widths + // These widths will be used for all subsequent rendering in streaming mode. + if t.config.Widths.PerColumn != nil && t.config.Widths.PerColumn.Len() > 0 { + // Use per-column stream widths if set + t.logger.Debugf("Using per-column stream widths from StreamConfig: %v", t.config.Widths.PerColumn) + t.streamWidths = t.config.Widths.PerColumn.Clone() + // Determine numCols from the highest index in PerColumn map + maxColIdx := -1 + t.streamWidths.Each(func(col int, width int) { + if col > maxColIdx { + maxColIdx = col + } + // Ensure configured widths are reasonable (>0 becomes >=1, <0 becomes 0) + if width > 0 && width < 1 { + t.streamWidths.Set(col, 1) + } else if width < 0 { + t.streamWidths.Set(col, 0) // Negative width means hide column + } + }) + if maxColIdx >= 0 { + t.streamNumCols = maxColIdx + 1 + t.logger.Debugf("Derived streamNumCols from PerColumn widths: %d", t.streamNumCols) + } else { + // PerColumn map exists but is empty? Or all negative widths? Assume 0 columns for now. + t.streamNumCols = 0 + t.logger.Debugf("PerColumn widths map is effectively empty or contains only negative values, streamNumCols = 0.") + } + + } else if t.config.Widths.Global > 0 { + // Global width is set, but we don't know the number of columns yet. + // Defer applying global width until the first data (Header or first Row) arrives. + // Store a placeholder or flag indicating global width should be used. + // The simple way for now: Keep streamWidths empty, signal the global width preference. + // The width calculation function called later will need to check StreamConfig.Widths.Global + // if streamWidths is empty. + t.logger.Debugf("Global stream width %d set in StreamConfig. Will derive numCols from first data.", t.config.Widths.Global) + t.streamWidths = tw.NewMapper[int, int]() // Initialize as empty, will be populated later + // Note: No need to store Global width value here, it's available in t.config.Stream.Widths.Global + + } else { + // No explicit stream widths in config. They will be calculated from the first data (Header or first Row). + t.logger.Debug("No explicit stream widths configured in StreamConfig. Will derive from first data.") + t.streamWidths = tw.NewMapper[int, int]() // Initialize as empty, will be populated later + t.streamNumCols = 0 // NumCols will be determined by first data + } + + // Log warnings if incompatible features are enabled in streaming config + // Vertical/Hierarchical merges require processing all rows together. + if t.config.Header.Formatting.MergeMode&(tw.MergeVertical|tw.MergeHierarchical) != 0 { + t.logger.Warnf("Vertical or Hierarchical merge modes enabled on Header config (%d) but are unsupported in streaming mode. Only Horizontal merge will be considered.", t.config.Header.Formatting.MergeMode) + } + if t.config.Row.Formatting.MergeMode&(tw.MergeVertical|tw.MergeHierarchical) != 0 { + t.logger.Warnf("Vertical or Hierarchical merge modes enabled on Row config (%d) but are unsupported in streaming mode. Only Horizontal merge will be considered.", t.config.Row.Formatting.MergeMode) + } + if t.config.Footer.Formatting.MergeMode&(tw.MergeVertical|tw.MergeHierarchical) != 0 { + t.logger.Warnf("Vertical or Hierarchical merge modes enabled on Footer config (%d) but are unsupported in streaming mode. Only Horizontal merge will be considered.", t.config.Footer.Formatting.MergeMode) + } + // AutoHide requires processing all row data to find empty columns. + if t.config.Behavior.AutoHide.Enabled() { + t.logger.Warn("AutoHide is enabled in config but is ignored in streaming mode.") + } + + // Call the renderer's start method for the stream. + err := t.renderer.Start(t.writer) + if err == nil { + t.hasPrinted = true // Mark as started successfully only if renderer.Start works + t.logger.Debug("Renderer.Start() succeeded. Table stream initiated.") + } else { + // Reset state if renderer.Start fails + t.hasPrinted = false + t.headerRendered = false + t.firstRowRendered = false + t.lastRenderedLineContent = nil + t.lastRenderedPosition = "" + t.streamFooterLines = nil + t.streamWidths = tw.NewMapper[int, int]() // Clear any widths that might have been set + t.streamNumCols = 0 + t.logger.Errorf("Renderer.Start() failed: %v. Streaming initialization failed.", err) + } + return err +} + +// streamAppendRow processes and renders a single row in streaming mode. +// It calculates/uses fixed stream widths, processes content, renders separators and lines, +// and updates streaming state. +// It assumes Start() has already been called and t.hasPrinted is true. +func (t *Table) streamAppendRow(row interface{}) error { + t.logger.Debugf("streamAppendRow called with row: %v (type: %T)", row, row) + + if !t.config.Stream.Enable { + return errors.New("streaming mode is disabled") + } + + rawCellsSlice, err := t.convertCellsToStrings(row, t.config.Row) + if err != nil { + t.logger.Errorf("streamAppendRow: Failed to convert row to strings: %v", err) + return fmt.Errorf("failed to convert row to strings: %w", err) + } + + if len(rawCellsSlice) == 0 { + t.logger.Debug("streamAppendRow: No raw cells after conversion, skipping row rendering.") + if !t.firstRowRendered { + t.firstRowRendered = true + t.logger.Debug("streamAppendRow: Marked first row rendered (empty content after processing).") + } + return nil + } + + if err := t.ensureStreamWidthsCalculated(rawCellsSlice, t.config.Row); err != nil { + return err + } + + if t.streamNumCols > 0 && len(rawCellsSlice) != t.streamNumCols { + t.logger.Warnf("streamAppendRow: Input row column count (%d) != stream column count (%d). Padding/Truncating.", len(rawCellsSlice), t.streamNumCols) + if len(rawCellsSlice) < t.streamNumCols { + paddedCells := make([]string, t.streamNumCols) + copy(paddedCells, rawCellsSlice) + for i := len(rawCellsSlice); i < t.streamNumCols; i++ { + paddedCells[i] = tw.Empty + } + rawCellsSlice = paddedCells + } else { + rawCellsSlice = rawCellsSlice[:t.streamNumCols] + } + } + + if t.streamNumCols == 0 { + t.logger.Warn("streamAppendRow: streamNumCols is 0. Cannot render row.") + return errors.New("cannot render row, column count is zero and could not be determined") + } + + _, rowMerges, _ := t.prepareWithMerges([][]string{rawCellsSlice}, t.config.Row, tw.Row) + processedRowLines := t.prepareContent(rawCellsSlice, t.config.Row) + t.logger.Debugf("streamAppendRow: Processed row lines: %d lines", len(processedRowLines)) + + f := t.renderer + cfg := t.renderer.Config() + + if !t.headerRendered && !t.firstRowRendered && t.lastRenderedPosition == "" { + if cfg.Borders.Top.Enabled() && cfg.Settings.Lines.ShowTop.Enabled() { + t.logger.Debug("streamAppendRow: Rendering table top border (first element is a row).") + var nextCellsCtx map[int]tw.CellContext + if len(processedRowLines) > 0 { + firstRowLineResp := t.streamBuildCellContexts( + tw.Row, 0, 0, processedRowLines, rowMerges, t.config.Row, + ) + nextCellsCtx = firstRowLineResp.cells + } + f.Line(tw.Formatting{ + Row: tw.RowContext{ + Widths: t.streamWidths, + ColMaxWidths: tw.CellWidth{PerColumn: t.streamWidths}, + Next: nextCellsCtx, + Position: tw.Row, + Location: tw.LocationFirst, + }, + Level: tw.LevelHeader, + IsSubRow: false, + + NormalizedWidths: t.streamWidths, + }) + t.logger.Debug("streamAppendRow: Top border rendered.") + } + } + + shouldDrawHeaderRowSeparator := t.headerRendered && !t.firstRowRendered && cfg.Settings.Lines.ShowHeaderLine.Enabled() + shouldDrawRowRowSeparator := t.firstRowRendered && cfg.Settings.Separators.BetweenRows.Enabled() + + firstCellForLog := "" + if len(rawCellsSlice) > 0 { + firstCellForLog = rawCellsSlice[0] + } + t.logger.Debugf("streamAppendRow: Separator Pre-Check for row starting with '%s': headerRendered=%v, firstRowRendered=%v, ShowHeaderLine=%v, BetweenRows=%v, lastRenderedPos=%q", + firstCellForLog, t.headerRendered, t.firstRowRendered, cfg.Settings.Lines.ShowHeaderLine.Enabled(), + cfg.Settings.Separators.BetweenRows.Enabled(), t.lastRenderedPosition) + t.logger.Debugf("streamAppendRow: Separator Decision Flags for row starting with '%s': shouldDrawHeaderRowSeparator=%v, shouldDrawRowRowSeparator=%v", + firstCellForLog, shouldDrawHeaderRowSeparator, shouldDrawRowRowSeparator) + + if (shouldDrawHeaderRowSeparator || shouldDrawRowRowSeparator) && t.lastRenderedPosition != tw.Position("separator") { + t.logger.Debugf("streamAppendRow: Rendering separator line for row starting with '%s'.", firstCellForLog) + prevCellsCtx := t.streamRenderedMergeState(t.lastRenderedLineContent, t.lastRenderedMergeState) + var nextCellsCtx map[int]tw.CellContext + if len(processedRowLines) > 0 { + firstRowLineResp := t.streamBuildCellContexts(tw.Row, 0, 0, processedRowLines, rowMerges, t.config.Row) + nextCellsCtx = firstRowLineResp.cells + } + f.Line(tw.Formatting{ + Row: tw.RowContext{ + Widths: t.streamWidths, + ColMaxWidths: tw.CellWidth{PerColumn: t.streamWidths}, + Current: prevCellsCtx, + Previous: nil, + Next: nextCellsCtx, + Position: tw.Row, + Location: tw.LocationMiddle, + }, + Level: tw.LevelBody, + IsSubRow: false, + + NormalizedWidths: t.streamWidths, + }) + t.lastRenderedPosition = tw.Position("separator") + t.lastRenderedLineContent = nil + t.lastRenderedMergeState = nil + t.logger.Debug("streamAppendRow: Separator line rendered. Updated lastRenderedPosition to 'separator'.") + } else { + details := "" + if !(shouldDrawHeaderRowSeparator || shouldDrawRowRowSeparator) { + details = "neither header/row nor row/row separator was flagged true" + } else if t.lastRenderedPosition == tw.Position("separator") { + details = "lastRenderedPosition is already 'separator'" + } else { + details = "an unexpected combination of conditions" + } + t.logger.Debugf("streamAppendRow: Separator not drawn for row '%s' because %s.", firstCellForLog, details) + } + + if len(processedRowLines) == 0 { + t.logger.Debugf("streamAppendRow: No processed row lines to render for row starting with '%s'.", firstCellForLog) + if !t.firstRowRendered { + t.firstRowRendered = true + t.logger.Debugf("streamAppendRow: Marked first row rendered (empty content after processing).") + } + return nil + } + + totalRowLines := len(processedRowLines) + for i := 0; i < totalRowLines; i++ { + resp := t.streamBuildCellContexts(tw.Row, 0, i, processedRowLines, rowMerges, t.config.Row) + t.logger.Debug("streamAppendRow: Rendering row line %d/%d with location %v for row starting with '%s'.", i, totalRowLines, resp.location, firstCellForLog) + f.Row(resp.cellsContent, tw.Formatting{ + Row: tw.RowContext{ + Widths: t.streamWidths, + ColMaxWidths: tw.CellWidth{PerColumn: t.streamWidths}, + Current: resp.cells, + Previous: resp.prevCells, + Next: resp.nextCells, + Position: tw.Row, + Location: resp.location, + }, + Level: tw.LevelBody, + IsSubRow: i > 0, + + NormalizedWidths: t.streamWidths, + HasFooter: len(t.streamFooterLines) > 0, + }) + t.lastRenderedLineContent = resp.cellsContent + t.lastRenderedMergeState = make(map[int]tw.MergeState) + for colIdx, cellCtx := range resp.cells { + t.lastRenderedMergeState[colIdx] = cellCtx.Merge + } + t.lastRenderedPosition = tw.Row + } + + if !t.firstRowRendered { + t.firstRowRendered = true + t.logger.Debug("streamAppendRow: Marked first row rendered (after processing content).") + } + + t.logger.Debug("streamAppendRow: Row processing completed for row starting with '%s'.", firstCellForLog) + return nil +} + +// streamBuildCellContexts creates CellContext objects for a given line in streaming mode. +// Parameters: +// - position: The section being processed (Header, Row, Footer). +// - rowIdx: The row index within its section (always 0 for Header/Footer, row number for Row). +// - lineIdx: The line index within the processed lines for this block. +// - processedLines: All multi-lines for the current row/header/footer block. +// - sectionMerges: Merge states for the section or row (map[int]tw.MergeState). +// - sectionConfig: The CellConfig for this section (Header, Row, Footer). +// Returns a renderMergeResponse with Current, Previous, Next cells, cellsContent, and the determined Location. +func (t *Table) streamBuildCellContexts( + position tw.Position, + rowIdx, lineIdx int, + processedLines [][]string, + sectionMerges map[int]tw.MergeState, + sectionConfig tw.CellConfig, +) renderMergeResponse { + t.logger.Debug("streamBuildCellContexts: Building contexts for position=%s, rowIdx=%d, lineIdx=%d", position, rowIdx, lineIdx) + resp := renderMergeResponse{ + cells: make(map[int]tw.CellContext), + prevCells: nil, + nextCells: nil, + cellsContent: make([]string, t.streamNumCols), + location: tw.LocationMiddle, + } + + if t.streamWidths == nil || t.streamWidths.Len() == 0 || t.streamNumCols == 0 { + t.logger.Warn("streamBuildCellContexts: streamWidths is not set or streamNumCols is 0. Returning empty contexts.") + return resp + } + + currentLineContent := make([]string, t.streamNumCols) + if lineIdx >= 0 && lineIdx < len(processedLines) { + currentLineContent = padLine(processedLines[lineIdx], t.streamNumCols) + } else { + t.logger.Warnf("streamBuildCellContexts: lineIdx %d out of bounds for processedLines (len %d) at position %s, rowIdx %d. Using empty line.", lineIdx, len(processedLines), position, rowIdx) + for j := range currentLineContent { + currentLineContent[j] = tw.Empty + } + } + resp.cellsContent = currentLineContent + + colAligns := t.buildAligns(sectionConfig) + colPadding := t.buildPadding(sectionConfig.Padding) + resp.cells = t.buildCoreCellContexts(currentLineContent, sectionMerges, t.streamWidths, colAligns, colPadding, t.streamNumCols) + + if t.lastRenderedLineContent != nil && t.lastRenderedPosition.Validate() == nil { + resp.prevCells = t.streamRenderedMergeState(t.lastRenderedLineContent, t.lastRenderedMergeState) + } + + totalLinesInBlock := len(processedLines) + if lineIdx < totalLinesInBlock-1 { + resp.nextCells = make(map[int]tw.CellContext) + nextLineContent := padLine(processedLines[lineIdx+1], t.streamNumCols) + nextCells := t.buildCoreCellContexts(nextLineContent, sectionMerges, t.streamWidths, colAligns, colPadding, t.streamNumCols) + for j := 0; j < t.streamNumCols; j++ { + resp.nextCells[j] = nextCells[j] + } + } + + isFirstLineOfBlock := (lineIdx == 0) + if isFirstLineOfBlock && (t.lastRenderedLineContent == nil || t.lastRenderedPosition != position) { + resp.location = tw.LocationFirst + } + + t.logger.Debug("streamBuildCellContexts: Position %s, Row %d, Line %d/%d. Location: %v. Prev Pos: %v. Has Prev: %v.", + position, rowIdx, lineIdx, totalLinesInBlock, resp.location, t.lastRenderedPosition, t.lastRenderedLineContent != nil) + return resp +} + +// streamCalculateWidths determines the fixed column widths for streaming mode. +// It prioritizes widths from StreamConfig.Widths.PerColumn, then StreamConfig.Widths.Global, +// then derives from the provided sample data lines. +// It populates t.streamWidths and t.streamNumCols if they are currently empty. +// The sampleDataLines should be the *raw* input lines (e.g., []string for Header/Footer, or the first row's []string cells for Row). +// The paddingConfig should be the CellPadding config relevant to the sample data (Header/Row/Footer). +// Returns the determined number of columns. +// This function should only be called when t.streamWidths is currently empty. +func (t *Table) streamCalculateWidths(sampling []string, config tw.CellConfig) int { + if t.streamWidths != nil && t.streamWidths.Len() > 0 { + t.logger.Debug("streamCalculateWidths: Called when streaming widths are already set (%d columns). Reusing existing.", t.streamNumCols) + return t.streamNumCols + } + + t.logger.Debug("streamCalculateWidths: Calculating streaming widths. Sample data cells: %d. Using section config: %+v", len(sampling), config.Formatting) + + determinedNumCols := 0 + if t.config.Widths.PerColumn != nil && t.config.Widths.PerColumn.Len() > 0 { + maxColIdx := -1 + t.config.Widths.PerColumn.Each(func(col int, width int) { + if col > maxColIdx { + maxColIdx = col + } + }) + determinedNumCols = maxColIdx + 1 + t.logger.Debug("streamCalculateWidths: Determined numCols (%d) from StreamConfig.Widths.PerColumn", determinedNumCols) + } else if len(sampling) > 0 { + determinedNumCols = len(sampling) + t.logger.Debug("streamCalculateWidths: Determined numCols (%d) from sample data length", determinedNumCols) + } else { + t.logger.Debug("streamCalculateWidths: Cannot determine numCols (no PerColumn config, no sample data)") + t.streamNumCols = 0 + t.streamWidths = tw.NewMapper[int, int]() + return 0 + } + + t.streamNumCols = determinedNumCols + t.streamWidths = tw.NewMapper[int, int]() + + // Use padding and autowrap from the provided config + paddingForWidthCalc := config.Padding + autoWrapForWidthCalc := config.Formatting.AutoWrap + + if t.config.Widths.PerColumn != nil && t.config.Widths.PerColumn.Len() > 0 { + t.logger.Debug("streamCalculateWidths: Using widths from StreamConfig.Widths.PerColumn") + for i := 0; i < t.streamNumCols; i++ { + width, ok := t.config.Widths.PerColumn.OK(i) + if !ok { + width = 0 + } + if width > 0 && width < 1 { + width = 1 + } else if width < 0 { + width = 0 + } + t.streamWidths.Set(i, width) + } + } else { + // No PerColumn config, derive from sampling intelligently + t.logger.Debug("streamCalculateWidths: Intelligently deriving widths from sample data content and padding.") + tempRequiredWidths := tw.NewMapper[int, int]() // Widths from updateWidths (content + padding) + if len(sampling) > 0 { + // updateWidths calculates: DisplayWidth(content) + padLeft + padRight + t.updateWidths(sampling, tempRequiredWidths, paddingForWidthCalc) + } + + ellipsisWidthBuffer := 0 + if autoWrapForWidthCalc == tw.WrapTruncate { + ellipsisWidthBuffer = tw.DisplayWidth(tw.CharEllipsis) + } + varianceBuffer := 2 // Your suggested variance + minTotalColWidth := tw.MinimumColumnWidth + // Example: if t.config.Stream.MinAutoColumnWidth > 0 { minTotalColWidth = t.config.Stream.MinAutoColumnWidth } + + for i := 0; i < t.streamNumCols; i++ { + // baseCellWidth (content_width + padding_width) comes from tempRequiredWidths.Get(i) + // We need to deconstruct it to apply logic to content_width first. + + sampleContent := "" + if i < len(sampling) { + sampleContent = t.Trimmer(sampling[i]) + } + sampleContentDisplayWidth := tw.DisplayWidth(sampleContent) + + colPad := paddingForWidthCalc.Global + if i < len(paddingForWidthCalc.PerColumn) && paddingForWidthCalc.PerColumn[i].Paddable() { + colPad = paddingForWidthCalc.PerColumn[i] + } + currentPadLWidth := tw.DisplayWidth(colPad.Left) + currentPadRWidth := tw.DisplayWidth(colPad.Right) + currentTotalPaddingWidth := currentPadLWidth + currentPadRWidth + + // Start with the target content width logic + targetContentWidth := sampleContentDisplayWidth + if autoWrapForWidthCalc == tw.WrapTruncate { + // If content is short, ensure it's at least wide enough for an ellipsis + if targetContentWidth < ellipsisWidthBuffer { + targetContentWidth = ellipsisWidthBuffer + } + } + targetContentWidth += varianceBuffer // Add variance + + // Now calculate the total cell width based on this buffered content target + padding + calculatedWidth := targetContentWidth + currentTotalPaddingWidth + + // Apply an absolute minimum total column width + if calculatedWidth > 0 && calculatedWidth < minTotalColWidth { + t.logger.Debug("streamCalculateWidths: Col %d, InitialCalcW=%d (ContentTarget=%d + Pad=%d) is less than MinTotalW=%d. Adjusting to MinTotalW.", + i, calculatedWidth, targetContentWidth, currentTotalPaddingWidth, minTotalColWidth) + calculatedWidth = minTotalColWidth + } else if calculatedWidth <= 0 && sampleContentDisplayWidth > 0 { // If content exists but calc width is 0 (e.g. large negative variance) + // Ensure at least min width or content + padding + buffers + fallbackWidth := sampleContentDisplayWidth + currentTotalPaddingWidth + if autoWrapForWidthCalc == tw.WrapTruncate { + fallbackWidth += ellipsisWidthBuffer + } + fallbackWidth += varianceBuffer + calculatedWidth = tw.Max(minTotalColWidth, fallbackWidth) + if calculatedWidth <= 0 && (currentTotalPaddingWidth+1) > 0 { // last resort if all else is zero + calculatedWidth = currentTotalPaddingWidth + 1 + } else if calculatedWidth <= 0 { + calculatedWidth = 1 // absolute last resort + } + + t.logger.Debug("streamCalculateWidths: Col %d, CalculatedW was <=0 despite content. Adjusted to %d.", i, calculatedWidth) + } else if calculatedWidth <= 0 && sampleContentDisplayWidth == 0 { + // Column is truly empty in sample and buffers didn't make it positive, or minTotalColWidth is 0. + // Keep width 0 (it will be hidden by renderer if all content is empty for this col) + // Or, if we want empty columns to have a minimum presence (even if just padding): + // calculatedWidth = currentTotalPaddingWidth // This would make it just wide enough for padding + // For now, let truly empty sample + no min width result in 0. + calculatedWidth = 0 // Explicitly set to 0 if it ended up non-positive and no content + } + + t.streamWidths.Set(i, calculatedWidth) + t.logger.Debug("streamCalculateWidths: Col %d, SampleContentW=%d, PadW=%d, EllipsisBufIfTruncate=%d, VarianceBuf=%d -> FinalTotalColW=%d", + i, sampleContentDisplayWidth, currentTotalPaddingWidth, ellipsisWidthBuffer, varianceBuffer, calculatedWidth) + } + } + + // Apply Global Constraint (if t.config.Stream.Widths.Global > 0) + if t.config.Widths.Global > 0 && t.streamNumCols > 0 { + t.logger.Debug("streamCalculateWidths: Applying global stream width constraint %d", t.config.Widths.Global) + currentTotalColumnWidthsSum := 0 + t.streamWidths.Each(func(_ int, w int) { + currentTotalColumnWidthsSum += w + }) + + separatorWidth := 0 + if t.renderer != nil { + rendererConfig := t.renderer.Config() + if rendererConfig.Settings.Separators.BetweenColumns.Enabled() { + separatorWidth = tw.DisplayWidth(rendererConfig.Symbols.Column()) + } + } else { + separatorWidth = 1 // Default if renderer not available yet + } + + totalWidthIncludingSeparators := currentTotalColumnWidthsSum + if t.streamNumCols > 1 { + totalWidthIncludingSeparators += (t.streamNumCols - 1) * separatorWidth + } + + if t.config.Widths.Global < totalWidthIncludingSeparators && totalWidthIncludingSeparators > 0 { // Added check for total > 0 + t.logger.Debug("streamCalculateWidths: Total calculated width (%d incl separators) exceeds global stream width (%d). Shrinking.", totalWidthIncludingSeparators, t.config.Widths.Global) + + // Target sum for column widths only (global limit - total separator width) + targetSumForColumnWidths := t.config.Widths.Global + if t.streamNumCols > 1 { + targetSumForColumnWidths -= (t.streamNumCols - 1) * separatorWidth + } + if targetSumForColumnWidths < t.streamNumCols && t.streamNumCols > 0 { // Ensure at least 1 per column if possible + targetSumForColumnWidths = t.streamNumCols + } else if targetSumForColumnWidths < 0 { + targetSumForColumnWidths = 0 + } + + scaleFactor := float64(targetSumForColumnWidths) / float64(currentTotalColumnWidthsSum) + if currentTotalColumnWidthsSum <= 0 { + scaleFactor = 0 + } // Avoid division by zero or negative scale + + adjustedSum := 0 + for i := 0; i < t.streamNumCols; i++ { + originalColWidth := t.streamWidths.Get(i) + if originalColWidth == 0 { + continue + } // Don't scale hidden columns + + scaledWidth := 0 + if scaleFactor > 0 { + scaledWidth = int(math.Round(float64(originalColWidth) * scaleFactor)) + } + + if scaledWidth < 1 && originalColWidth > 0 { // Ensure at least 1 if original had width and scaling made it too small + scaledWidth = 1 + } else if scaledWidth < 0 { // Should not happen with math.Round on positive*positive + scaledWidth = 0 + } + t.streamWidths.Set(i, scaledWidth) + adjustedSum += scaledWidth + } + + // Distribute rounding errors to meet targetSumForColumnWidths + remainingSpace := targetSumForColumnWidths - adjustedSum + t.logger.Debug("streamCalculateWidths: Scaling complete. TargetSum=%d, AchievedSum=%d, RemSpace=%d", targetSumForColumnWidths, adjustedSum, remainingSpace) + // Distribute remainingSpace (positive or negative) among non-zero width columns + if remainingSpace != 0 && t.streamNumCols > 0 { + colsToAdjust := []int{} + t.streamWidths.Each(func(col int, w int) { + if w > 0 { // Only consider columns that currently have width + colsToAdjust = append(colsToAdjust, col) + } + }) + if len(colsToAdjust) > 0 { + for i := 0; i < int(math.Abs(float64(remainingSpace))); i++ { + colIdx := colsToAdjust[i%len(colsToAdjust)] + currentColWidth := t.streamWidths.Get(colIdx) + if remainingSpace > 0 { + t.streamWidths.Set(colIdx, currentColWidth+1) + } else if remainingSpace < 0 && currentColWidth > 1 { // Don't reduce below 1 + t.streamWidths.Set(colIdx, currentColWidth-1) + } + } + } + } + t.logger.Debug("streamCalculateWidths: Widths after scaling and distribution: %v", t.streamWidths) + } else { + t.logger.Debug("streamCalculateWidths: Total calculated width (%d) fits global stream width (%d). No scaling needed.", totalWidthIncludingSeparators, t.config.Widths.Global) + } + } + + // Final sanitization + t.streamWidths.Each(func(col int, width int) { + if width < 0 { + t.streamWidths.Set(col, 0) + } + }) + + t.logger.Debug("streamCalculateWidths: Final derived stream widths after all adjustments (%d columns): %v", t.streamNumCols, t.streamWidths) + return t.streamNumCols +} + +// streamRenderBottomBorder renders the bottom border of the table in streaming mode. +// It uses the fixed streamWidths and the last rendered content to create the border context. +// It assumes Start() has been called and t.hasPrinted is true. +// Returns an error if rendering fails. +func (t *Table) streamRenderBottomBorder() error { + if t.streamWidths == nil || t.streamWidths.Len() == 0 { + t.logger.Debug("streamRenderBottomBorder: No stream widths available, skipping bottom border.") + return nil + } + + cfg := t.renderer.Config() + if !cfg.Borders.Bottom.Enabled() || !cfg.Settings.Lines.ShowBottom.Enabled() { + t.logger.Debug("streamRenderBottomBorder: Bottom border disabled in config, skipping.") + return nil + } + + // The bottom border's "Current" context is the last rendered content line + currentCells := make(map[int]tw.CellContext) + if t.lastRenderedLineContent != nil { + // Use a helper to convert last rendered state to cell contexts + currentCells = t.streamRenderedMergeState(t.lastRenderedLineContent, t.lastRenderedMergeState) + } else { + // No content was ever rendered, but we might still want a bottom border if a top border was drawn. + // Create empty cell contexts. + for i := 0; i < t.streamNumCols; i++ { + currentCells[i] = tw.CellContext{Width: t.streamWidths.Get(i)} + } + t.logger.Debug("streamRenderBottomBorder: No previous content line, creating empty context for bottom border.") + } + + f := t.renderer + f.Line(tw.Formatting{ + Row: tw.RowContext{ + Widths: t.streamWidths, + ColMaxWidths: tw.CellWidth{PerColumn: t.streamWidths}, + Current: currentCells, // Context of the line *above* the bottom border + Previous: nil, // No line before this, relative to the border itself (or use lastRendered's previous?) + Next: nil, // No line after the bottom border + Position: t.lastRenderedPosition, // Position of the content above the border (Row or Footer) + Location: tw.LocationEnd, // This is the absolute end + }, + Level: tw.LevelFooter, // Bottom border is LevelFooter + IsSubRow: false, + + NormalizedWidths: t.streamWidths, + }) + t.logger.Debug("streamRenderBottomBorder: Bottom border rendered.") + return nil +} + +// streamRenderFooter renders the stored footer lines in streaming mode. +// It's called by Close(). It renders the Row/Footer separator line first. +// It assumes Start() has been called and t.hasPrinted is true. +// Returns an error if rendering fails. +func (t *Table) streamRenderFooter(processedFooterLines [][]string) error { + t.logger.Debug("streamRenderFooter: Rendering %d processed footer lines.", len(processedFooterLines)) + + if t.streamWidths == nil || t.streamWidths.Len() == 0 || t.streamNumCols == 0 { + t.logger.Warn("streamRenderFooter: No stream widths or columns defined. Cannot render footer.") + return errors.New("cannot render stream footer without defined column widths") + } + + if len(processedFooterLines) == 0 { + t.logger.Debug("streamRenderFooter: No footer lines to render.") + return nil + } + + f := t.renderer + cfg := t.renderer.Config() + + // Render Row/Footer or Header/Footer Separator Line + // This separator is drawn if ShowFooterLine is enabled AND there was content before the footer. + // The last rendered position (t.lastRenderedPosition) should be Row or Header or "separator". + if (t.lastRenderedPosition == tw.Row || t.lastRenderedPosition == tw.Header || t.lastRenderedPosition == tw.Position("separator")) && + cfg.Settings.Lines.ShowFooterLine.Enabled() { + + t.logger.Debug("streamRenderFooter: Rendering Row/Footer or Header/Footer separator line.") + + // Previous context is the last line rendered before this footer + prevCells := t.streamRenderedMergeState(t.lastRenderedLineContent, t.lastRenderedMergeState) + + // Next context is the first line of this footer + var nextCells map[int]tw.CellContext = nil + if len(processedFooterLines) > 0 { + // Need merge states for the footer section. + // Since footer is processed once and stored, detect merges on its raw input once. + // This requires access to the *original* raw footer strings passed to Footer(). + // For simplicity now, assume no complex horizontal merges in footer for this separator line context. + // A better approach: streamStoreFooter should also calculate and store footerMerges. + // For now, create nextCells without specific merge info for the separator line. + // Or, call prepareWithMerges on the *stored processed* lines, which might be okay for simple cases. + // Let's pass nil for sectionMerges to streamBuildCellContexts for this specific Next context. + // It will result in default (no-merge) states. + + // For now, let's build nextCells manually for the separator line context + nextCells = make(map[int]tw.CellContext) + firstFooterLineContent := padLine(processedFooterLines[0], t.streamNumCols) + // Footer merges should be calculated in streamStoreFooter and stored if needed. + // For now, assume no merges for this 'Next' context. + for j := 0; j < t.streamNumCols; j++ { + nextCells[j] = tw.CellContext{Data: firstFooterLineContent[j], Width: t.streamWidths.Get(j)} + } + } + + separatorLevel := tw.LevelFooter // Line before footer section is LevelFooter + separatorPosition := tw.Footer // Positioned relative to the footer it precedes + separatorLocation := tw.LocationMiddle + + f.Line(tw.Formatting{ + Row: tw.RowContext{ + Widths: t.streamWidths, + ColMaxWidths: tw.CellWidth{PerColumn: t.streamWidths}, + Current: prevCells, // Context of line above separator + Previous: nil, // No line before Current in this specific context + Next: nextCells, // Context of line below separator (first footer line) + Position: separatorPosition, + Location: separatorLocation, + }, + Level: separatorLevel, + IsSubRow: false, + + NormalizedWidths: t.streamWidths, + }) + t.lastRenderedPosition = tw.Position("separator") // Update state + t.lastRenderedLineContent = nil + t.lastRenderedMergeState = nil + t.logger.Debug("streamRenderFooter: Footer separator line rendered.") + } + // End Render Separator Line + + // Detect horizontal merges for the footer section based on its (assumed stored) raw input. + // This is tricky because streamStoreFooter gets []string, but prepareWithMerges expects [][]string. + // For simplicity, if complex merges are needed in footer, streamStoreFooter should + // have received raw data, called prepareWithMerges, and stored those merges. + // For now, assume no complex horizontal merges in footer or pass nil for sectionMerges. + // Let's assume footerMerges were calculated and stored as `t.streamFooterMerges map[int]tw.MergeState` + // by `streamStoreFooter`. For this example, we'll pass nil, meaning no merges. + var footerMerges map[int]tw.MergeState = nil // Placeholder + + totalFooterLines := len(processedFooterLines) + for i := 0; i < totalFooterLines; i++ { + resp := t.streamBuildCellContexts( + tw.Footer, + 0, // Row index within Footer (always 0) + i, // Line index + processedFooterLines, + footerMerges, // Pass footer-specific merges if calculated and stored + t.config.Footer, + ) + + // Special Location logic for the *very last line* of the table if this footer line is it. + // This is complex because bottom border might follow. + // Let streamBuildCellContexts handle LocationFirst/Middle for now. + // streamRenderBottomBorder will handle the final LocationEnd for its line. + // If this footer line is the last content and no bottom border, *it* should be LocationEnd. + + // If this is the last line of the last content block (footer), and no bottom border will be drawn, + // its Location should be End. + isLastLineOfTableContent := (i == totalFooterLines-1) && + !(cfg.Borders.Bottom.Enabled() && cfg.Settings.Lines.ShowBottom.Enabled()) + if isLastLineOfTableContent { + resp.location = tw.LocationEnd + t.logger.Debug("streamRenderFooter: Setting LocationEnd for last footer line as no bottom border will follow.") + } + + f.Footer([][]string{resp.cellsContent}, tw.Formatting{ + Row: tw.RowContext{ + Widths: t.streamWidths, + ColMaxWidths: tw.CellWidth{PerColumn: t.streamWidths}, + Current: resp.cells, + Previous: resp.prevCells, + Next: resp.nextCells, // Next is nil if last line of footer block + Position: tw.Footer, + Location: resp.location, + }, + Level: tw.LevelFooter, + IsSubRow: (i > 0), + + NormalizedWidths: t.streamWidths, + }) + + t.lastRenderedLineContent = resp.cellsContent + t.lastRenderedMergeState = make(map[int]tw.MergeState) + for colIdx, cellCtx := range resp.cells { + t.lastRenderedMergeState[colIdx] = cellCtx.Merge + } + t.lastRenderedPosition = tw.Footer + } + + t.logger.Debug("streamRenderFooter: Footer content rendering completed.") + return nil +} + +// streamRenderHeader processes and renders the header section in streaming mode. +// It calculates/uses fixed stream widths, processes content, renders borders/lines, +// and updates streaming state. +// It assumes Start() has already been called and t.hasPrinted is true. +func (t *Table) streamRenderHeader(headers []string) error { + t.logger.Debug("streamRenderHeader called with headers: %v", headers) + + if !t.config.Stream.Enable { + return errors.New("streaming mode is disabled") + } + + if t.headerRendered { + t.logger.Warn("streamRenderHeader called but header already rendered. Ignoring.") + return nil + } + + if err := t.ensureStreamWidthsCalculated(headers, t.config.Header); err != nil { + return err + } + + _, headerMerges, _ := t.prepareWithMerges([][]string{headers}, t.config.Header, tw.Header) + processedHeaderLines := t.prepareContent(headers, t.config.Header) + t.logger.Debug("streamRenderHeader: Processed header lines: %d", len(processedHeaderLines)) + + if t.streamNumCols > 0 { + t.headerRendered = true + } + if len(processedHeaderLines) == 0 && t.streamNumCols == 0 { + t.logger.Debug("streamRenderHeader: No header content and no columns determined.") + return nil + } + + f := t.renderer + cfg := t.renderer.Config() + + if t.lastRenderedPosition == "" && cfg.Borders.Top.Enabled() && cfg.Settings.Lines.ShowTop.Enabled() { + t.logger.Debug("streamRenderHeader: Rendering table top border.") + var nextCellsCtx map[int]tw.CellContext + if len(processedHeaderLines) > 0 { + firstHeaderLineResp := t.streamBuildCellContexts( + tw.Header, 0, 0, processedHeaderLines, headerMerges, t.config.Header, + ) + nextCellsCtx = firstHeaderLineResp.cells + } + f.Line(tw.Formatting{ + Row: tw.RowContext{ + Widths: t.streamWidths, + ColMaxWidths: tw.CellWidth{PerColumn: t.streamWidths}, + Next: nextCellsCtx, + Position: tw.Header, + Location: tw.LocationFirst, + }, + Level: tw.LevelHeader, + IsSubRow: false, + + NormalizedWidths: t.streamWidths, + }) + t.logger.Debug("streamRenderHeader: Top border rendered.") + } + + hasTopPadding := t.config.Header.Padding.Global.Top != tw.Empty + if hasTopPadding { + resp := t.streamBuildCellContexts(tw.Header, 0, -1, nil, headerMerges, t.config.Header) + resp.cellsContent = t.buildPaddingLineContents(t.config.Header.Padding.Global.Top, t.streamWidths, t.streamNumCols, headerMerges) + resp.location = tw.LocationFirst + t.logger.Debug("streamRenderHeader: Rendering header top padding line: %v (loc: %v)", resp.cellsContent, resp.location) + f.Header([][]string{resp.cellsContent}, tw.Formatting{ + Row: tw.RowContext{ + Widths: t.streamWidths, + ColMaxWidths: tw.CellWidth{PerColumn: t.streamWidths}, + Current: resp.cells, + Previous: resp.prevCells, + Next: resp.nextCells, + Position: tw.Header, + Location: resp.location, + }, + Level: tw.LevelHeader, + IsSubRow: true, + + NormalizedWidths: t.streamWidths, + }) + t.lastRenderedLineContent = resp.cellsContent + t.lastRenderedMergeState = make(map[int]tw.MergeState) + for colIdx, cellCtx := range resp.cells { + t.lastRenderedMergeState[colIdx] = cellCtx.Merge + } + t.lastRenderedPosition = tw.Header + } + + totalHeaderLines := len(processedHeaderLines) + for i := 0; i < totalHeaderLines; i++ { + resp := t.streamBuildCellContexts(tw.Header, 0, i, processedHeaderLines, headerMerges, t.config.Header) + t.logger.Debug("streamRenderHeader: Rendering header content line %d/%d with location %v", i, totalHeaderLines, resp.location) + f.Header([][]string{resp.cellsContent}, tw.Formatting{ + Row: tw.RowContext{ + Widths: t.streamWidths, + ColMaxWidths: tw.CellWidth{PerColumn: t.streamWidths}, + Current: resp.cells, + Previous: resp.prevCells, + Next: resp.nextCells, + Position: tw.Header, + Location: resp.location, + }, + Level: tw.LevelHeader, + IsSubRow: i > 0, + + NormalizedWidths: t.streamWidths, + }) + t.lastRenderedLineContent = resp.cellsContent + t.lastRenderedMergeState = make(map[int]tw.MergeState) + for colIdx, cellCtx := range resp.cells { + t.lastRenderedMergeState[colIdx] = cellCtx.Merge + } + t.lastRenderedPosition = tw.Header + } + + hasBottomPadding := t.config.Header.Padding.Global.Bottom != tw.Empty + if hasBottomPadding { + resp := t.streamBuildCellContexts(tw.Header, 0, totalHeaderLines, nil, headerMerges, t.config.Header) + resp.cellsContent = t.buildPaddingLineContents(t.config.Header.Padding.Global.Bottom, t.streamWidths, t.streamNumCols, headerMerges) + resp.location = tw.LocationEnd + t.logger.Debug("streamRenderHeader: Rendering header bottom padding line: %v (loc: %v)", resp.cellsContent, resp.location) + f.Header([][]string{resp.cellsContent}, tw.Formatting{ + Row: tw.RowContext{ + Widths: t.streamWidths, + ColMaxWidths: tw.CellWidth{PerColumn: t.streamWidths}, + Current: resp.cells, + Previous: resp.prevCells, + Next: resp.nextCells, + Position: tw.Header, + Location: resp.location, + }, + Level: tw.LevelHeader, + IsSubRow: true, + + NormalizedWidths: t.streamWidths, + }) + t.lastRenderedLineContent = resp.cellsContent + t.lastRenderedMergeState = make(map[int]tw.MergeState) + for colIdx, cellCtx := range resp.cells { + t.lastRenderedMergeState[colIdx] = cellCtx.Merge + } + t.lastRenderedPosition = tw.Header + } + + if cfg.Settings.Lines.ShowHeaderLine.Enabled() && (t.firstRowRendered || len(t.streamFooterLines) > 0) { + t.logger.Debug("streamRenderHeader: Rendering header separator line.") + resp := t.streamBuildCellContexts(tw.Header, 0, totalHeaderLines-1, processedHeaderLines, headerMerges, t.config.Header) + f.Line(tw.Formatting{ + Row: tw.RowContext{ + Widths: t.streamWidths, + ColMaxWidths: tw.CellWidth{PerColumn: t.streamWidths}, + Current: resp.cells, + Previous: resp.prevCells, + Next: nil, + Position: tw.Header, + Location: tw.LocationMiddle, + }, + Level: tw.LevelBody, + IsSubRow: false, + + NormalizedWidths: t.streamWidths, + }) + t.lastRenderedPosition = tw.Position("separator") + t.lastRenderedLineContent = nil + t.lastRenderedMergeState = nil + } + + t.logger.Debug("streamRenderHeader: Header content rendering completed.") + return nil +} + +// streamRenderedMergeState converts the stored last rendered line content +// and its merge states into a map of CellContext, suitable for providing +// context (e.g., "Current" or "Previous") to the renderer. +// It uses the fixed streamWidths. +func (t *Table) streamRenderedMergeState( + lineContent []string, + lineMergeStates map[int]tw.MergeState, +) map[int]tw.CellContext { + cells := make(map[int]tw.CellContext) + if t.streamWidths == nil || t.streamWidths.Len() == 0 || t.streamNumCols == 0 { + t.logger.Warn("streamRenderedMergeState: streamWidths not set or streamNumCols is 0. Returning empty cell contexts.") + return cells + } + + // Ensure lineContent is padded to streamNumCols if it's not nil + var paddedLineContent []string + if lineContent != nil { + paddedLineContent = padLine(lineContent, t.streamNumCols) + } else { + // If lineContent is nil (e.g. after a separator), create an empty padded line + paddedLineContent = make([]string, t.streamNumCols) + for i := range paddedLineContent { + paddedLineContent[i] = tw.Empty + } + } + + for j := 0; j < t.streamNumCols; j++ { + cellData := paddedLineContent[j] + colWidth := t.streamWidths.Get(j) + mergeState := tw.MergeState{} // Default to no merge + + if lineMergeStates != nil { + if state, ok := lineMergeStates[j]; ok { + mergeState = state + } + } + + // For context purposes (like Previous or Current for a border line), + // Align and Padding are often less critical than Data, Width, and Merge. + // We can use default/empty Align and Padding here. + cells[j] = tw.CellContext{ + Data: cellData, + Align: tw.AlignDefault, // Or tw.AlignNone if preferred for context-only cells + Padding: tw.Padding{}, // Empty padding + Width: colWidth, + Merge: mergeState, + } + } + return cells +} + +// streamStoreFooter processes the footer content and stores it for later rendering by Close() +// in streaming mode. It ensures stream widths are calculated if not already set. +func (t *Table) streamStoreFooter(footers []string) error { + t.logger.Debug("streamStoreFooter called with footers: %v", footers) + + if !t.config.Stream.Enable { + return errors.New("streaming mode is disabled") + } + + if len(footers) == 0 { + t.logger.Debug("streamStoreFooter: Empty footer cells, storing empty footer lines.") + t.streamFooterLines = [][]string{} + return nil + } + + if err := t.ensureStreamWidthsCalculated(footers, t.config.Footer); err != nil { + t.logger.Warnf("streamStoreFooter: Failed to determine column count from footer data: %v", err) + t.streamFooterLines = [][]string{} + return nil + } + + if t.streamNumCols > 0 && len(footers) != t.streamNumCols { + t.logger.Warnf("streamStoreFooter: Input footer column count (%d) does not match fixed stream column count (%d). Padding/Truncating input footers.", len(footers), t.streamNumCols) + if len(footers) < t.streamNumCols { + paddedFooters := make([]string, t.streamNumCols) + copy(paddedFooters, footers) + for i := len(footers); i < t.streamNumCols; i++ { + paddedFooters[i] = tw.Empty + } + footers = paddedFooters + } else { + footers = footers[:t.streamNumCols] + } + } + + if t.streamNumCols == 0 { + t.logger.Warn("streamStoreFooter: streamNumCols is 0, cannot process/store footer lines meaningfully.") + t.streamFooterLines = [][]string{} + return nil + } + + t.streamFooterLines = t.prepareContent(footers, t.config.Footer) + t.logger.Debug("streamStoreFooter: Processed and stored footer lines: %d lines. Content: %v", len(t.streamFooterLines), t.streamFooterLines) + + return nil +} diff --git a/vendor/github.com/olekukonko/tablewriter/table.go b/vendor/github.com/olekukonko/tablewriter/table.go deleted file mode 100644 index f913149..0000000 --- a/vendor/github.com/olekukonko/tablewriter/table.go +++ /dev/null @@ -1,967 +0,0 @@ -// Copyright 2014 Oleku Konko All rights reserved. -// Use of this source code is governed by a MIT -// license that can be found in the LICENSE file. - -// This module is a Table Writer API for the Go Programming Language. -// The protocols were written in pure Go and works on windows and unix systems - -// Create & Generate text based table -package tablewriter - -import ( - "bytes" - "fmt" - "io" - "regexp" - "strings" -) - -const ( - MAX_ROW_WIDTH = 30 -) - -const ( - CENTER = "+" - ROW = "-" - COLUMN = "|" - SPACE = " " - NEWLINE = "\n" -) - -const ( - ALIGN_DEFAULT = iota - ALIGN_CENTER - ALIGN_RIGHT - ALIGN_LEFT -) - -var ( - decimal = regexp.MustCompile(`^-?(?:\d{1,3}(?:,\d{3})*|\d+)(?:\.\d+)?$`) - percent = regexp.MustCompile(`^-?\d+\.?\d*$%$`) -) - -type Border struct { - Left bool - Right bool - Top bool - Bottom bool -} - -type Table struct { - out io.Writer - rows [][]string - lines [][][]string - cs map[int]int - rs map[int]int - headers [][]string - footers [][]string - caption bool - captionText string - autoFmt bool - autoWrap bool - reflowText bool - mW int - pCenter string - pRow string - pColumn string - tColumn int - tRow int - hAlign int - fAlign int - align int - newLine string - rowLine bool - autoMergeCells bool - columnsToAutoMergeCells map[int]bool - noWhiteSpace bool - tablePadding string - hdrLine bool - borders Border - colSize int - headerParams []string - columnsParams []string - footerParams []string - columnsAlign []int -} - -// Start New Table -// Take io.Writer Directly -func NewWriter(writer io.Writer) *Table { - t := &Table{ - out: writer, - rows: [][]string{}, - lines: [][][]string{}, - cs: make(map[int]int), - rs: make(map[int]int), - headers: [][]string{}, - footers: [][]string{}, - caption: false, - captionText: "Table caption.", - autoFmt: true, - autoWrap: true, - reflowText: true, - mW: MAX_ROW_WIDTH, - pCenter: CENTER, - pRow: ROW, - pColumn: COLUMN, - tColumn: -1, - tRow: -1, - hAlign: ALIGN_DEFAULT, - fAlign: ALIGN_DEFAULT, - align: ALIGN_DEFAULT, - newLine: NEWLINE, - rowLine: false, - hdrLine: true, - borders: Border{Left: true, Right: true, Bottom: true, Top: true}, - colSize: -1, - headerParams: []string{}, - columnsParams: []string{}, - footerParams: []string{}, - columnsAlign: []int{}} - return t -} - -// Render table output -func (t *Table) Render() { - if t.borders.Top { - t.printLine(true) - } - t.printHeading() - if t.autoMergeCells { - t.printRowsMergeCells() - } else { - t.printRows() - } - if !t.rowLine && t.borders.Bottom { - t.printLine(true) - } - t.printFooter() - - if t.caption { - t.printCaption() - } -} - -const ( - headerRowIdx = -1 - footerRowIdx = -2 -) - -// Set table header -func (t *Table) SetHeader(keys []string) { - t.colSize = len(keys) - for i, v := range keys { - lines := t.parseDimension(v, i, headerRowIdx) - t.headers = append(t.headers, lines) - } -} - -// Set table Footer -func (t *Table) SetFooter(keys []string) { - //t.colSize = len(keys) - for i, v := range keys { - lines := t.parseDimension(v, i, footerRowIdx) - t.footers = append(t.footers, lines) - } -} - -// Set table Caption -func (t *Table) SetCaption(caption bool, captionText ...string) { - t.caption = caption - if len(captionText) == 1 { - t.captionText = captionText[0] - } -} - -// Turn header autoformatting on/off. Default is on (true). -func (t *Table) SetAutoFormatHeaders(auto bool) { - t.autoFmt = auto -} - -// Turn automatic multiline text adjustment on/off. Default is on (true). -func (t *Table) SetAutoWrapText(auto bool) { - t.autoWrap = auto -} - -// Turn automatic reflowing of multiline text when rewrapping. Default is on (true). -func (t *Table) SetReflowDuringAutoWrap(auto bool) { - t.reflowText = auto -} - -// Set the Default column width -func (t *Table) SetColWidth(width int) { - t.mW = width -} - -// Set the minimal width for a column -func (t *Table) SetColMinWidth(column int, width int) { - t.cs[column] = width -} - -// Set the Column Separator -func (t *Table) SetColumnSeparator(sep string) { - t.pColumn = sep -} - -// Set the Row Separator -func (t *Table) SetRowSeparator(sep string) { - t.pRow = sep -} - -// Set the center Separator -func (t *Table) SetCenterSeparator(sep string) { - t.pCenter = sep -} - -// Set Header Alignment -func (t *Table) SetHeaderAlignment(hAlign int) { - t.hAlign = hAlign -} - -// Set Footer Alignment -func (t *Table) SetFooterAlignment(fAlign int) { - t.fAlign = fAlign -} - -// Set Table Alignment -func (t *Table) SetAlignment(align int) { - t.align = align -} - -// Set No White Space -func (t *Table) SetNoWhiteSpace(allow bool) { - t.noWhiteSpace = allow -} - -// Set Table Padding -func (t *Table) SetTablePadding(padding string) { - t.tablePadding = padding -} - -func (t *Table) SetColumnAlignment(keys []int) { - for _, v := range keys { - switch v { - case ALIGN_CENTER: - break - case ALIGN_LEFT: - break - case ALIGN_RIGHT: - break - default: - v = ALIGN_DEFAULT - } - t.columnsAlign = append(t.columnsAlign, v) - } -} - -// Set New Line -func (t *Table) SetNewLine(nl string) { - t.newLine = nl -} - -// Set Header Line -// This would enable / disable a line after the header -func (t *Table) SetHeaderLine(line bool) { - t.hdrLine = line -} - -// Set Row Line -// This would enable / disable a line on each row of the table -func (t *Table) SetRowLine(line bool) { - t.rowLine = line -} - -// Set Auto Merge Cells -// This would enable / disable the merge of cells with identical values -func (t *Table) SetAutoMergeCells(auto bool) { - t.autoMergeCells = auto -} - -// Set Auto Merge Cells By Column Index -// This would enable / disable the merge of cells with identical values for specific columns -// If cols is empty, it is the same as `SetAutoMergeCells(true)`. -func (t *Table) SetAutoMergeCellsByColumnIndex(cols []int) { - t.autoMergeCells = true - - if len(cols) > 0 { - m := make(map[int]bool) - for _, col := range cols { - m[col] = true - } - t.columnsToAutoMergeCells = m - } -} - -// Set Table Border -// This would enable / disable line around the table -func (t *Table) SetBorder(border bool) { - t.SetBorders(Border{border, border, border, border}) -} - -func (t *Table) SetBorders(border Border) { - t.borders = border -} - -// Append row to table -func (t *Table) Append(row []string) { - rowSize := len(t.headers) - if rowSize > t.colSize { - t.colSize = rowSize - } - - n := len(t.lines) - line := [][]string{} - for i, v := range row { - - // Detect string width - // Detect String height - // Break strings into words - out := t.parseDimension(v, i, n) - - // Append broken words - line = append(line, out) - } - t.lines = append(t.lines, line) -} - -// Append row to table with color attributes -func (t *Table) Rich(row []string, colors []Colors) { - rowSize := len(t.headers) - if rowSize > t.colSize { - t.colSize = rowSize - } - - n := len(t.lines) - line := [][]string{} - for i, v := range row { - - // Detect string width - // Detect String height - // Break strings into words - out := t.parseDimension(v, i, n) - - if len(colors) > i { - color := colors[i] - out[0] = format(out[0], color) - } - - // Append broken words - line = append(line, out) - } - t.lines = append(t.lines, line) -} - -// Allow Support for Bulk Append -// Eliminates repeated for loops -func (t *Table) AppendBulk(rows [][]string) { - for _, row := range rows { - t.Append(row) - } -} - -// NumLines to get the number of lines -func (t *Table) NumLines() int { - return len(t.lines) -} - -// Clear rows -func (t *Table) ClearRows() { - t.lines = [][][]string{} -} - -// Clear footer -func (t *Table) ClearFooter() { - t.footers = [][]string{} -} - -// Center based on position and border. -func (t *Table) center(i int) string { - if i == -1 && !t.borders.Left { - return t.pRow - } - - if i == len(t.cs)-1 && !t.borders.Right { - return t.pRow - } - - return t.pCenter -} - -// Print line based on row width -func (t *Table) printLine(nl bool) { - fmt.Fprint(t.out, t.center(-1)) - for i := 0; i < len(t.cs); i++ { - v := t.cs[i] - fmt.Fprintf(t.out, "%s%s%s%s", - t.pRow, - strings.Repeat(string(t.pRow), v), - t.pRow, - t.center(i)) - } - if nl { - fmt.Fprint(t.out, t.newLine) - } -} - -// Print line based on row width with our without cell separator -func (t *Table) printLineOptionalCellSeparators(nl bool, displayCellSeparator []bool) { - fmt.Fprint(t.out, t.pCenter) - for i := 0; i < len(t.cs); i++ { - v := t.cs[i] - if i > len(displayCellSeparator) || displayCellSeparator[i] { - // Display the cell separator - fmt.Fprintf(t.out, "%s%s%s%s", - t.pRow, - strings.Repeat(string(t.pRow), v), - t.pRow, - t.pCenter) - } else { - // Don't display the cell separator for this cell - fmt.Fprintf(t.out, "%s%s", - strings.Repeat(" ", v+2), - t.pCenter) - } - } - if nl { - fmt.Fprint(t.out, t.newLine) - } -} - -// Return the PadRight function if align is left, PadLeft if align is right, -// and Pad by default -func pad(align int) func(string, string, int) string { - padFunc := Pad - switch align { - case ALIGN_LEFT: - padFunc = PadRight - case ALIGN_RIGHT: - padFunc = PadLeft - } - return padFunc -} - -// Print heading information -func (t *Table) printHeading() { - // Check if headers is available - if len(t.headers) < 1 { - return - } - - // Identify last column - end := len(t.cs) - 1 - - // Get pad function - padFunc := pad(t.hAlign) - - // Checking for ANSI escape sequences for header - is_esc_seq := false - if len(t.headerParams) > 0 { - is_esc_seq = true - } - - // Maximum height. - max := t.rs[headerRowIdx] - - // Print Heading - for x := 0; x < max; x++ { - // Check if border is set - // Replace with space if not set - if !t.noWhiteSpace { - fmt.Fprint(t.out, ConditionString(t.borders.Left, t.pColumn, SPACE)) - } - - for y := 0; y <= end; y++ { - v := t.cs[y] - h := "" - - if y < len(t.headers) && x < len(t.headers[y]) { - h = t.headers[y][x] - } - if t.autoFmt { - h = Title(h) - } - pad := ConditionString((y == end && !t.borders.Left), SPACE, t.pColumn) - if t.noWhiteSpace { - pad = ConditionString((y == end && !t.borders.Left), SPACE, t.tablePadding) - } - if is_esc_seq { - if !t.noWhiteSpace { - fmt.Fprintf(t.out, " %s %s", - format(padFunc(h, SPACE, v), - t.headerParams[y]), pad) - } else { - fmt.Fprintf(t.out, "%s %s", - format(padFunc(h, SPACE, v), - t.headerParams[y]), pad) - } - } else { - if !t.noWhiteSpace { - fmt.Fprintf(t.out, " %s %s", - padFunc(h, SPACE, v), - pad) - } else { - // the spaces between breaks the kube formatting - fmt.Fprintf(t.out, "%s%s", - padFunc(h, SPACE, v), - pad) - } - } - } - // Next line - fmt.Fprint(t.out, t.newLine) - } - if t.hdrLine { - t.printLine(true) - } -} - -// Print heading information -func (t *Table) printFooter() { - // Check if headers is available - if len(t.footers) < 1 { - return - } - - // Only print line if border is not set - if !t.borders.Bottom { - t.printLine(true) - } - - // Identify last column - end := len(t.cs) - 1 - - // Get pad function - padFunc := pad(t.fAlign) - - // Checking for ANSI escape sequences for header - is_esc_seq := false - if len(t.footerParams) > 0 { - is_esc_seq = true - } - - // Maximum height. - max := t.rs[footerRowIdx] - - // Print Footer - erasePad := make([]bool, len(t.footers)) - for x := 0; x < max; x++ { - // Check if border is set - // Replace with space if not set - fmt.Fprint(t.out, ConditionString(t.borders.Bottom, t.pColumn, SPACE)) - - for y := 0; y <= end; y++ { - v := t.cs[y] - f := "" - if y < len(t.footers) && x < len(t.footers[y]) { - f = t.footers[y][x] - } - if t.autoFmt { - f = Title(f) - } - pad := ConditionString((y == end && !t.borders.Top), SPACE, t.pColumn) - - if erasePad[y] || (x == 0 && len(f) == 0) { - pad = SPACE - erasePad[y] = true - } - - if is_esc_seq { - fmt.Fprintf(t.out, " %s %s", - format(padFunc(f, SPACE, v), - t.footerParams[y]), pad) - } else { - fmt.Fprintf(t.out, " %s %s", - padFunc(f, SPACE, v), - pad) - } - - //fmt.Fprintf(t.out, " %s %s", - // padFunc(f, SPACE, v), - // pad) - } - // Next line - fmt.Fprint(t.out, t.newLine) - //t.printLine(true) - } - - hasPrinted := false - - for i := 0; i <= end; i++ { - v := t.cs[i] - pad := t.pRow - center := t.pCenter - length := len(t.footers[i][0]) - - if length > 0 { - hasPrinted = true - } - - // Set center to be space if length is 0 - if length == 0 && !t.borders.Right { - center = SPACE - } - - // Print first junction - if i == 0 { - if length > 0 && !t.borders.Left { - center = t.pRow - } - fmt.Fprint(t.out, center) - } - - // Pad With space of length is 0 - if length == 0 { - pad = SPACE - } - // Ignore left space as it has printed before - if hasPrinted || t.borders.Left { - pad = t.pRow - center = t.pCenter - } - - // Change Center end position - if center != SPACE { - if i == end && !t.borders.Right { - center = t.pRow - } - } - - // Change Center start position - if center == SPACE { - if i < end && len(t.footers[i+1][0]) != 0 { - if !t.borders.Left { - center = t.pRow - } else { - center = t.pCenter - } - } - } - - // Print the footer - fmt.Fprintf(t.out, "%s%s%s%s", - pad, - strings.Repeat(string(pad), v), - pad, - center) - - } - - fmt.Fprint(t.out, t.newLine) -} - -// Print caption text -func (t Table) printCaption() { - width := t.getTableWidth() - paragraph, _ := WrapString(t.captionText, width) - for linecount := 0; linecount < len(paragraph); linecount++ { - fmt.Fprintln(t.out, paragraph[linecount]) - } -} - -// Calculate the total number of characters in a row -func (t Table) getTableWidth() int { - var chars int - for _, v := range t.cs { - chars += v - } - - // Add chars, spaces, seperators to calculate the total width of the table. - // ncols := t.colSize - // spaces := ncols * 2 - // seps := ncols + 1 - - return (chars + (3 * t.colSize) + 2) -} - -func (t Table) printRows() { - for i, lines := range t.lines { - t.printRow(lines, i) - } -} - -func (t *Table) fillAlignment(num int) { - if len(t.columnsAlign) < num { - t.columnsAlign = make([]int, num) - for i := range t.columnsAlign { - t.columnsAlign[i] = t.align - } - } -} - -// Print Row Information -// Adjust column alignment based on type - -func (t *Table) printRow(columns [][]string, rowIdx int) { - // Get Maximum Height - max := t.rs[rowIdx] - total := len(columns) - - // TODO Fix uneven col size - // if total < t.colSize { - // for n := t.colSize - total; n < t.colSize ; n++ { - // columns = append(columns, []string{SPACE}) - // t.cs[n] = t.mW - // } - //} - - // Pad Each Height - pads := []int{} - - // Checking for ANSI escape sequences for columns - is_esc_seq := false - if len(t.columnsParams) > 0 { - is_esc_seq = true - } - t.fillAlignment(total) - - for i, line := range columns { - length := len(line) - pad := max - length - pads = append(pads, pad) - for n := 0; n < pad; n++ { - columns[i] = append(columns[i], " ") - } - } - //fmt.Println(max, "\n") - for x := 0; x < max; x++ { - for y := 0; y < total; y++ { - - // Check if border is set - if !t.noWhiteSpace { - fmt.Fprint(t.out, ConditionString((!t.borders.Left && y == 0), SPACE, t.pColumn)) - fmt.Fprintf(t.out, SPACE) - } - - str := columns[y][x] - - // Embedding escape sequence with column value - if is_esc_seq { - str = format(str, t.columnsParams[y]) - } - - // This would print alignment - // Default alignment would use multiple configuration - switch t.columnsAlign[y] { - case ALIGN_CENTER: // - fmt.Fprintf(t.out, "%s", Pad(str, SPACE, t.cs[y])) - case ALIGN_RIGHT: - fmt.Fprintf(t.out, "%s", PadLeft(str, SPACE, t.cs[y])) - case ALIGN_LEFT: - fmt.Fprintf(t.out, "%s", PadRight(str, SPACE, t.cs[y])) - default: - if decimal.MatchString(strings.TrimSpace(str)) || percent.MatchString(strings.TrimSpace(str)) { - fmt.Fprintf(t.out, "%s", PadLeft(str, SPACE, t.cs[y])) - } else { - fmt.Fprintf(t.out, "%s", PadRight(str, SPACE, t.cs[y])) - - // TODO Custom alignment per column - //if max == 1 || pads[y] > 0 { - // fmt.Fprintf(t.out, "%s", Pad(str, SPACE, t.cs[y])) - //} else { - // fmt.Fprintf(t.out, "%s", PadRight(str, SPACE, t.cs[y])) - //} - - } - } - if !t.noWhiteSpace { - fmt.Fprintf(t.out, SPACE) - } else { - fmt.Fprintf(t.out, t.tablePadding) - } - } - // Check if border is set - // Replace with space if not set - if !t.noWhiteSpace { - fmt.Fprint(t.out, ConditionString(t.borders.Left, t.pColumn, SPACE)) - } - fmt.Fprint(t.out, t.newLine) - } - - if t.rowLine { - t.printLine(true) - } -} - -// Print the rows of the table and merge the cells that are identical -func (t *Table) printRowsMergeCells() { - var previousLine []string - var displayCellBorder []bool - var tmpWriter bytes.Buffer - for i, lines := range t.lines { - // We store the display of the current line in a tmp writer, as we need to know which border needs to be print above - previousLine, displayCellBorder = t.printRowMergeCells(&tmpWriter, lines, i, previousLine) - if i > 0 { //We don't need to print borders above first line - if t.rowLine { - t.printLineOptionalCellSeparators(true, displayCellBorder) - } - } - tmpWriter.WriteTo(t.out) - } - //Print the end of the table - if t.rowLine { - t.printLine(true) - } -} - -// Print Row Information to a writer and merge identical cells. -// Adjust column alignment based on type - -func (t *Table) printRowMergeCells(writer io.Writer, columns [][]string, rowIdx int, previousLine []string) ([]string, []bool) { - // Get Maximum Height - max := t.rs[rowIdx] - total := len(columns) - - // Pad Each Height - pads := []int{} - - // Checking for ANSI escape sequences for columns - is_esc_seq := false - if len(t.columnsParams) > 0 { - is_esc_seq = true - } - for i, line := range columns { - length := len(line) - pad := max - length - pads = append(pads, pad) - for n := 0; n < pad; n++ { - columns[i] = append(columns[i], " ") - } - } - - var displayCellBorder []bool - t.fillAlignment(total) - for x := 0; x < max; x++ { - for y := 0; y < total; y++ { - - // Check if border is set - fmt.Fprint(writer, ConditionString((!t.borders.Left && y == 0), SPACE, t.pColumn)) - - fmt.Fprintf(writer, SPACE) - - str := columns[y][x] - - // Embedding escape sequence with column value - if is_esc_seq { - str = format(str, t.columnsParams[y]) - } - - if t.autoMergeCells { - var mergeCell bool - if t.columnsToAutoMergeCells != nil { - // Check to see if the column index is in columnsToAutoMergeCells. - if t.columnsToAutoMergeCells[y] { - mergeCell = true - } - } else { - // columnsToAutoMergeCells was not set. - mergeCell = true - } - //Store the full line to merge mutli-lines cells - fullLine := strings.TrimRight(strings.Join(columns[y], " "), " ") - if len(previousLine) > y && fullLine == previousLine[y] && fullLine != "" && mergeCell { - // If this cell is identical to the one above but not empty, we don't display the border and keep the cell empty. - displayCellBorder = append(displayCellBorder, false) - str = "" - } else { - // First line or different content, keep the content and print the cell border - displayCellBorder = append(displayCellBorder, true) - } - } - - // This would print alignment - // Default alignment would use multiple configuration - switch t.columnsAlign[y] { - case ALIGN_CENTER: // - fmt.Fprintf(writer, "%s", Pad(str, SPACE, t.cs[y])) - case ALIGN_RIGHT: - fmt.Fprintf(writer, "%s", PadLeft(str, SPACE, t.cs[y])) - case ALIGN_LEFT: - fmt.Fprintf(writer, "%s", PadRight(str, SPACE, t.cs[y])) - default: - if decimal.MatchString(strings.TrimSpace(str)) || percent.MatchString(strings.TrimSpace(str)) { - fmt.Fprintf(writer, "%s", PadLeft(str, SPACE, t.cs[y])) - } else { - fmt.Fprintf(writer, "%s", PadRight(str, SPACE, t.cs[y])) - } - } - fmt.Fprintf(writer, SPACE) - } - // Check if border is set - // Replace with space if not set - fmt.Fprint(writer, ConditionString(t.borders.Left, t.pColumn, SPACE)) - fmt.Fprint(writer, t.newLine) - } - - //The new previous line is the current one - previousLine = make([]string, total) - for y := 0; y < total; y++ { - previousLine[y] = strings.TrimRight(strings.Join(columns[y], " "), " ") //Store the full line for multi-lines cells - } - //Returns the newly added line and wether or not a border should be displayed above. - return previousLine, displayCellBorder -} - -func (t *Table) parseDimension(str string, colKey, rowKey int) []string { - var ( - raw []string - maxWidth int - ) - - raw = getLines(str) - maxWidth = 0 - for _, line := range raw { - if w := DisplayWidth(line); w > maxWidth { - maxWidth = w - } - } - - // If wrapping, ensure that all paragraphs in the cell fit in the - // specified width. - if t.autoWrap { - // If there's a maximum allowed width for wrapping, use that. - if maxWidth > t.mW { - maxWidth = t.mW - } - - // In the process of doing so, we need to recompute maxWidth. This - // is because perhaps a word in the cell is longer than the - // allowed maximum width in t.mW. - newMaxWidth := maxWidth - newRaw := make([]string, 0, len(raw)) - - if t.reflowText { - // Make a single paragraph of everything. - raw = []string{strings.Join(raw, " ")} - } - for i, para := range raw { - paraLines, _ := WrapString(para, maxWidth) - for _, line := range paraLines { - if w := DisplayWidth(line); w > newMaxWidth { - newMaxWidth = w - } - } - if i > 0 { - newRaw = append(newRaw, " ") - } - newRaw = append(newRaw, paraLines...) - } - raw = newRaw - maxWidth = newMaxWidth - } - - // Store the new known maximum width. - v, ok := t.cs[colKey] - if !ok || v < maxWidth || v == 0 { - t.cs[colKey] = maxWidth - } - - // Remember the number of lines for the row printer. - h := len(raw) - v, ok = t.rs[rowKey] - - if !ok || v < h || v == 0 { - t.rs[rowKey] = h - } - //fmt.Printf("Raw %+v %d\n", raw, len(raw)) - return raw -} diff --git a/vendor/github.com/olekukonko/tablewriter/table_with_color.go b/vendor/github.com/olekukonko/tablewriter/table_with_color.go deleted file mode 100644 index ae7a364..0000000 --- a/vendor/github.com/olekukonko/tablewriter/table_with_color.go +++ /dev/null @@ -1,136 +0,0 @@ -package tablewriter - -import ( - "fmt" - "strconv" - "strings" -) - -const ESC = "\033" -const SEP = ";" - -const ( - BgBlackColor int = iota + 40 - BgRedColor - BgGreenColor - BgYellowColor - BgBlueColor - BgMagentaColor - BgCyanColor - BgWhiteColor -) - -const ( - FgBlackColor int = iota + 30 - FgRedColor - FgGreenColor - FgYellowColor - FgBlueColor - FgMagentaColor - FgCyanColor - FgWhiteColor -) - -const ( - BgHiBlackColor int = iota + 100 - BgHiRedColor - BgHiGreenColor - BgHiYellowColor - BgHiBlueColor - BgHiMagentaColor - BgHiCyanColor - BgHiWhiteColor -) - -const ( - FgHiBlackColor int = iota + 90 - FgHiRedColor - FgHiGreenColor - FgHiYellowColor - FgHiBlueColor - FgHiMagentaColor - FgHiCyanColor - FgHiWhiteColor -) - -const ( - Normal = 0 - Bold = 1 - UnderlineSingle = 4 - Italic -) - -type Colors []int - -func startFormat(seq string) string { - return fmt.Sprintf("%s[%sm", ESC, seq) -} - -func stopFormat() string { - return fmt.Sprintf("%s[%dm", ESC, Normal) -} - -// Making the SGR (Select Graphic Rendition) sequence. -func makeSequence(codes []int) string { - codesInString := []string{} - for _, code := range codes { - codesInString = append(codesInString, strconv.Itoa(code)) - } - return strings.Join(codesInString, SEP) -} - -// Adding ANSI escape sequences before and after string -func format(s string, codes interface{}) string { - var seq string - - switch v := codes.(type) { - - case string: - seq = v - case []int: - seq = makeSequence(v) - case Colors: - seq = makeSequence(v) - default: - return s - } - - if len(seq) == 0 { - return s - } - return startFormat(seq) + s + stopFormat() -} - -// Adding header colors (ANSI codes) -func (t *Table) SetHeaderColor(colors ...Colors) { - if t.colSize != len(colors) { - panic("Number of header colors must be equal to number of headers.") - } - for i := 0; i < len(colors); i++ { - t.headerParams = append(t.headerParams, makeSequence(colors[i])) - } -} - -// Adding column colors (ANSI codes) -func (t *Table) SetColumnColor(colors ...Colors) { - if t.colSize != len(colors) { - panic("Number of column colors must be equal to number of headers.") - } - for i := 0; i < len(colors); i++ { - t.columnsParams = append(t.columnsParams, makeSequence(colors[i])) - } -} - -// Adding column colors (ANSI codes) -func (t *Table) SetFooterColor(colors ...Colors) { - if len(t.footers) != len(colors) { - panic("Number of footer colors must be equal to number of footer.") - } - for i := 0; i < len(colors); i++ { - t.footerParams = append(t.footerParams, makeSequence(colors[i])) - } -} - -func Color(colors ...int) []int { - return colors -} diff --git a/vendor/github.com/olekukonko/tablewriter/tablewriter.go b/vendor/github.com/olekukonko/tablewriter/tablewriter.go new file mode 100644 index 0000000..4eca55d --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/tablewriter.go @@ -0,0 +1,2206 @@ +package tablewriter + +import ( + "bytes" + "fmt" + "github.com/olekukonko/errors" + "github.com/olekukonko/ll" + "github.com/olekukonko/ll/lh" + "github.com/olekukonko/tablewriter/pkg/twwarp" + "github.com/olekukonko/tablewriter/renderer" + "github.com/olekukonko/tablewriter/tw" + "io" + "math" + "reflect" + "strings" + "sync" +) + +// Table represents a table instance with content and rendering capabilities. +type Table struct { + writer io.Writer // Destination for table output + rows [][][]string // Row data, supporting multi-line cells + headers [][]string // Header content + footers [][]string // Footer content + headerWidths tw.Mapper[int, int] // Computed widths for header columns + rowWidths tw.Mapper[int, int] // Computed widths for row columns + footerWidths tw.Mapper[int, int] // Computed widths for footer columns + renderer tw.Renderer // Engine for rendering the table + config Config // Table configuration settings + stringer any // Function to convert rows to strings + newLine string // Newline character (e.g., "\n") + hasPrinted bool // Indicates if the table has been rendered + logger *ll.Logger // Debug trace log + trace *bytes.Buffer // Debug trace log + + // Caption fields + caption tw.Caption + + // streaming + streamWidths tw.Mapper[int, int] // Fixed column widths for streaming mode, calculated once + streamFooterLines [][]string // Processed footer lines for streaming, stored until Close(). + headerRendered bool // Tracks if header has been rendered in streaming mode + firstRowRendered bool // Tracks if the first data row has been rendered in streaming mode + lastRenderedLineContent []string // Content of the very last line rendered (for Previous context in streaming) + lastRenderedMergeState tw.Mapper[int, tw.MergeState] // Merge state of the very last line rendered (for Previous context in streaming) + lastRenderedPosition tw.Position // Position (Header/Row/Footer/Separator) of the last line rendered (for Previous context in streaming) + streamNumCols int // The derived number of columns in streaming mode + streamRowCounter int // Counter for rows rendered in streaming mode (0-indexed logical rows) + + // cache + stringerCache map[reflect.Type]reflect.Value // Cache for stringer reflection + stringerCacheMu sync.RWMutex // Mutex for thread-safe cache access + stringerCacheEnabled bool // Flag to enable/disable caching + + batchRenderNumCols int + isBatchRenderNumColsSet bool +} + +// renderContext holds the core state for rendering the table. +type renderContext struct { + table *Table // Reference to the table instance + renderer tw.Renderer // Renderer instance + cfg tw.Rendition // Renderer configuration + numCols int // Total number of columns + headerLines [][]string // Processed header lines + rowLines [][][]string // Processed row lines + footerLines [][]string // Processed footer lines + widths tw.Mapper[tw.Position, tw.Mapper[int, int]] // Widths per section + footerPrepared bool // Tracks if footer is prepared + emptyColumns []bool // Tracks which original columns are empty (true if empty) + visibleColCount int // Count of columns that are NOT empty + logger *ll.Logger // Debug trace log +} + +// mergeContext holds state related to cell merging. +type mergeContext struct { + headerMerges map[int]tw.MergeState // Merge states for header columns + rowMerges []map[int]tw.MergeState // Merge states for each row + footerMerges map[int]tw.MergeState // Merge states for footer columns + horzMerges map[tw.Position]map[int]bool // Tracks horizontal merges (unused) +} + +// helperContext holds additional data for rendering helpers. +type helperContext struct { + position tw.Position // Section being processed (Header, Row, Footer) + rowIdx int // Row index within section + lineIdx int // Line index within row + location tw.Location // Boundary location (First, Middle, End) + line []string // Current line content +} + +// renderMergeResponse holds cell context data from rendering operations. +type renderMergeResponse struct { + cells map[int]tw.CellContext // Current line cells + prevCells map[int]tw.CellContext // Previous line cells + nextCells map[int]tw.CellContext // Next line cells + location tw.Location // Determined Location for this line + cellsContent []string +} + +// NewTable creates a new table instance with specified writer and options. +// Parameters include writer for output and optional configuration options. +// Returns a pointer to the initialized Table instance. +func NewTable(w io.Writer, opts ...Option) *Table { + t := &Table{ + writer: w, + headerWidths: tw.NewMapper[int, int](), + rowWidths: tw.NewMapper[int, int](), + footerWidths: tw.NewMapper[int, int](), + renderer: renderer.NewBlueprint(), + config: defaultConfig(), + newLine: tw.NewLine, + trace: &bytes.Buffer{}, + + // Streaming + streamWidths: tw.NewMapper[int, int](), // Initialize empty mapper for streaming widths + lastRenderedMergeState: tw.NewMapper[int, tw.MergeState](), + headerRendered: false, + firstRowRendered: false, + lastRenderedPosition: "", + streamNumCols: 0, + streamRowCounter: 0, + + // Cache + stringerCache: make(map[reflect.Type]reflect.Value), + stringerCacheEnabled: false, // Disabled by default + } + + // set Options + t.Options(opts...) + + t.logger.Infof("Table initialized with %d options", len(opts)) + return t +} + +// NewWriter creates a new table with default settings for backward compatibility. +// It logs the creation if debugging is enabled. +func NewWriter(w io.Writer) *Table { + t := NewTable(w) + if t.logger != nil { + t.logger.Debug("NewWriter created buffered Table") + } + return t +} + +// Caption sets the table caption (legacy method). +// Defaults to BottomCenter alignment, wrapping to table width. +// Use SetCaptionOptions for more control. +func (t *Table) Caption(caption tw.Caption) *Table { // This is the one we modified + originalSpot := caption.Spot + originalAlign := caption.Align + + if caption.Spot == tw.SpotNone { + caption.Spot = tw.SpotBottomCenter + t.logger.Debugf("[Table.Caption] Input Spot was SpotNone, defaulting Spot to SpotBottomCenter (%d)", caption.Spot) + } + + if caption.Align == "" || caption.Align == tw.AlignDefault || caption.Align == tw.AlignNone { + switch caption.Spot { + case tw.SpotTopLeft, tw.SpotBottomLeft: + caption.Align = tw.AlignLeft + case tw.SpotTopRight, tw.SpotBottomRight: + caption.Align = tw.AlignRight + default: + caption.Align = tw.AlignCenter + } + t.logger.Debugf("[Table.Caption] Input Align was empty/default, defaulting Align to %s for Spot %d", caption.Align, caption.Spot) + } + + t.caption = caption // t.caption on the struct is now updated. + t.logger.Debugf("Caption method called: Input(Spot:%v, Align:%q), Final(Spot:%v, Align:%q), Text:'%.20s', MaxWidth:%d", + originalSpot, originalAlign, t.caption.Spot, t.caption.Align, t.caption.Text, t.caption.Width) + return t +} + +// Append adds data to the current row being built for the table. +// This method always contributes to a single logical row in the table. +// To add multiple distinct rows, call Append multiple times (once for each row's data) +// or use the Bulk() method if providing a slice where each element is a row. +func (t *Table) Append(rows ...interface{}) error { // rows is already []interface{} + t.ensureInitialized() + + if t.config.Stream.Enable && t.hasPrinted { + t.logger.Debugf("Append() called in streaming mode with %d items for a single row", len(rows)) + var rowItemForStream interface{} + if len(rows) == 1 { + rowItemForStream = rows[0] + } else { + rowItemForStream = rows // Pass the slice of items if multiple args + } + if err := t.streamAppendRow(rowItemForStream); err != nil { + t.logger.Errorf("Error rendering streaming row: %v", err) + return fmt.Errorf("failed to stream append row: %w", err) + } + return nil + } + + //Batch Mode Logic + t.logger.Debugf("Append (Batch) received %d arguments: %v", len(rows), rows) + + var cellsSource interface{} + if len(rows) == 1 { + cellsSource = rows[0] + t.logger.Debug("Append (Batch): Single argument provided. Treating it as the source for row cells.") + } else { + cellsSource = rows // 'rows' is []interface{} containing all arguments + t.logger.Debug("Append (Batch): Multiple arguments provided. Treating them directly as cells for one row.") + } + + if err := t.appendSingle(cellsSource); err != nil { + t.logger.Errorf("Append (Batch) failed for cellsSource %v: %v", cellsSource, err) + return err + } + + t.logger.Debugf("Append (Batch) completed for one row, total rows in table: %d", len(t.rows)) + return nil +} + +// Bulk adds multiple rows from a slice to the table (legacy method). +// Parameter rows must be a slice compatible with stringer or []string. +// Returns an error if the input is invalid or appending fails. +func (t *Table) Bulk(rows interface{}) error { + t.logger.Debug("Starting Bulk operation") + rv := reflect.ValueOf(rows) + if rv.Kind() != reflect.Slice { + err := errors.Newf("Bulk expects a slice, got %T", rows) + t.logger.Debugf("Bulk error: %v", err) + return err + } + for i := 0; i < rv.Len(); i++ { + row := rv.Index(i).Interface() + t.logger.Debugf("Processing bulk row %d: %v", i, row) + if err := t.appendSingle(row); err != nil { + t.logger.Debugf("Bulk append failed at index %d: %v", i, err) + return err + } + } + t.logger.Debugf("Bulk completed, processed %d rows", rv.Len()) + return nil +} + +// Config returns the current table configuration. +// No parameters are required. +// Returns the Config struct with current settings. +func (t *Table) Config() Config { + return t.config +} + +// Configure updates the table's configuration using a provided function. +// Parameter fn is a function that modifies the Config struct. +// Returns the Table instance for method chaining. +func (t *Table) Configure(fn func(cfg *Config)) *Table { + fn(&t.config) // Let the user modify the config directly + // Handle any immediate side-effects of config changes, e.g., logger state + if t.config.Debug { + t.logger.Enable() + t.logger.Resume() // in case it was suspended + } else { + t.logger.Disable() + t.logger.Suspend() // suspend totally, especially because of tight loops + } + t.logger.Debugf("Configure complete. New t.config: %+v", t.config) + return t +} + +// Debug retrieves the accumulated debug trace logs. +// No parameters are required. +// Returns a slice of debug messages including renderer logs. +func (t *Table) Debug() *bytes.Buffer { + return t.trace +} + +// Header sets the table's header content, padding to match column count. +// Parameter elements is a slice of strings for header content. +// No return value. +// In streaming mode, this processes and renders the header immediately. +func (t *Table) Header(elements ...any) { + t.ensureInitialized() + t.logger.Debugf("Header() method called with raw variadic elements: %v (len %d). Streaming: %v, Started: %v", elements, len(elements), t.config.Stream.Enable, t.hasPrinted) + + // just forget + if t.config.Behavior.Header.Hide.Enabled() { + return + } + + // add come common default + if t.config.Header.Formatting.AutoFormat == tw.Unknown { + t.config.Header.Formatting.AutoFormat = tw.On + } + + if t.config.Stream.Enable && t.hasPrinted { + // Streaming Path + actualCellsToProcess := t.processVariadic(elements) + headersAsStrings, err := t.convertCellsToStrings(actualCellsToProcess, t.config.Header) + if err != nil { + t.logger.Errorf("Header(): Failed to convert header elements to strings for streaming: %v", err) + headersAsStrings = []string{} // Use empty on error + } + errStream := t.streamRenderHeader(headersAsStrings) // streamRenderHeader handles padding to streamNumCols internally + if errStream != nil { + t.logger.Errorf("Error rendering streaming header: %v", errStream) + } + return + } + + // Batch Path + processedElements := t.processVariadic(elements) + t.logger.Debugf("Header() (Batch): Effective cells to process: %v", processedElements) + + headersAsStrings, err := t.convertCellsToStrings(processedElements, t.config.Header) + if err != nil { + t.logger.Errorf("Header() (Batch): Failed to convert to strings: %v", err) + t.headers = [][]string{} // Set to empty on error + return + } + + // prepareContent uses t.config.Header for AutoFormat and MaxWidth constraints. + // It processes based on the number of columns in headersAsStrings. + preparedHeaderLines := t.prepareContent(headersAsStrings, t.config.Header) + t.headers = preparedHeaderLines // Store directly. Padding to t.maxColumns() will happen in prepareContexts. + + t.logger.Debugf("Header set (batch mode), lines stored: %d. First line if exists: %v", len(t.headers), func() []string { + if len(t.headers) > 0 { + return t.headers[0] + } else { + return nil + } + }()) +} + +// Footer sets the table's footer content, padding to match column count. +// Parameter footers is a slice of strings for footer content. +// No return value. +// Footer sets the table's footer content. +// Parameter footers is a slice of strings for footer content. +// In streaming mode, this processes and stores the footer for rendering by Close(). +func (t *Table) Footer(elements ...any) { + t.ensureInitialized() + t.logger.Debugf("Footer() method called with raw variadic elements: %v (len %d). Streaming: %v, Started: %v", elements, len(elements), t.config.Stream.Enable, t.hasPrinted) + + // just forget + if t.config.Behavior.Footer.Hide.Enabled() { + return + } + + if t.config.Stream.Enable && t.hasPrinted { + // Streaming Path + actualCellsToProcess := t.processVariadic(elements) + footersAsStrings, err := t.convertCellsToStrings(actualCellsToProcess, t.config.Footer) + if err != nil { + t.logger.Errorf("Footer(): Failed to convert footer elements to strings for streaming: %v", err) + footersAsStrings = []string{} // Use empty on error + } + errStream := t.streamStoreFooter(footersAsStrings) // streamStoreFooter handles padding to streamNumCols internally + if errStream != nil { + t.logger.Errorf("Error processing streaming footer: %v", errStream) + } + return + } + + // Batch Path + processedElements := t.processVariadic(elements) + t.logger.Debugf("Footer() (Batch): Effective cells to process: %v", processedElements) + + footersAsStrings, err := t.convertCellsToStrings(processedElements, t.config.Footer) + if err != nil { + t.logger.Errorf("Footer() (Batch): Failed to convert to strings: %v", err) + t.footers = [][]string{} // Set to empty on error + return + } + + preparedFooterLines := t.prepareContent(footersAsStrings, t.config.Footer) + t.footers = preparedFooterLines // Store directly. Padding to t.maxColumns() will happen in prepareContexts. + + t.logger.Debugf("Footer set (batch mode), lines stored: %d. First line if exists: %v", + len(t.footers), func() []string { + if len(t.footers) > 0 { + return t.footers[0] + } else { + return nil + } + }()) +} + +// Options updates the table's Options using a provided function. +// Parameter opts is a function that modifies the Table struct. +// Returns the Table instance for method chaining. +func (t *Table) Options(opts ...Option) *Table { + + // add logger + if t.logger == nil { + t.logger = ll.New("table").Handler(lh.NewTextHandler(t.trace)) + } + + // loop through options + for _, opt := range opts { + opt(t) + } + + // force debugging mode if set + // This should be move away form WithDebug + if t.config.Debug == true { + t.logger.Enable() + t.logger.Resume() + } else { + t.logger.Disable() + t.logger.Suspend() + } + + // help resolve from deprecation + //if t.config.Stream.Enable { + // t.config.Widths = t.config.Stream.Widths + //} + + // send logger to renderer + // this will overwrite the default logger + t.renderer.Logger(t.logger) + return t +} + +// Reset clears all data (headers, rows, footers, caption) and rendering state +// from the table, allowing the Table instance to be reused for a new table +// with the same configuration and writer. +// It does NOT reset the configuration itself (set by NewTable options or Configure) +// or the underlying io.Writer. +func (t *Table) Reset() { + t.logger.Debug("Reset() called. Clearing table data and render state.") + + // Clear data slices + t.rows = nil // Or t.rows = make([][][]string, 0) + t.headers = nil // Or t.headers = make([][]string, 0) + t.footers = nil // Or t.footers = make([][]string, 0) + + // Reset width mappers (important for recalculating widths for the new table) + t.headerWidths = tw.NewMapper[int, int]() + t.rowWidths = tw.NewMapper[int, int]() + t.footerWidths = tw.NewMapper[int, int]() + + // Reset caption + t.caption = tw.Caption{} // Reset to zero value + + // Reset rendering state flags + t.hasPrinted = false // Critical for allowing Render() or stream Start() again + + // Reset streaming-specific state + // (Important if the table was used in streaming mode and might be reused in batch or another stream) + t.streamWidths = tw.NewMapper[int, int]() + t.streamFooterLines = nil + t.headerRendered = false + t.firstRowRendered = false + t.lastRenderedLineContent = nil + t.lastRenderedMergeState = tw.NewMapper[int, tw.MergeState]() // Re-initialize + t.lastRenderedPosition = "" + t.streamNumCols = 0 + t.streamRowCounter = 0 + + // The stringer and its cache are part of the table's configuration, + if t.stringerCacheEnabled { + t.stringerCacheMu.Lock() + t.stringerCache = make(map[reflect.Type]reflect.Value) + t.stringerCacheMu.Unlock() + t.logger.Debug("Reset(): Stringer cache cleared.") + } + + // If the renderer has its own state that needs resetting after a table is done, + // this would be the place to call a renderer.Reset() method if it existed. + // Most current renderers are stateless per render call or reset in their Start/Close. + // For instance, HTML and SVG renderers have their own Reset method. + // It might be good practice to call it if available. + if r, ok := t.renderer.(interface{ Reset() }); ok { + t.logger.Debug("Reset(): Calling Reset() on the current renderer.") + r.Reset() + } + + t.logger.Info("Table instance has been reset.") +} + +// Render triggers the table rendering process to the configured writer. +// No parameters are required. +// Returns an error if rendering fails. +func (t *Table) Render() error { + return t.render() +} + +// Trimmer trims whitespace from a string based on the Table’s configuration. +// It conditionally applies strings.TrimSpace to the input string if the TrimSpace behavior +// is enabled in t.config.Behavior, otherwise returning the string unchanged. This method +// is used in the logging library to format strings for tabular output, ensuring consistent +// display in log messages. Thread-safe as it only reads configuration and operates on the +// input string. +func (t *Table) Trimmer(str string) string { + if t.config.Behavior.TrimSpace.Enabled() { + return strings.TrimSpace(str) + } + return str +} + +// appendSingle adds a single row to the table's row data. +// Parameter row is the data to append, converted via stringer if needed. +// Returns an error if conversion or appending fails. +func (t *Table) appendSingle(row interface{}) error { + t.ensureInitialized() // Already here + + if t.config.Stream.Enable && t.hasPrinted { // If streaming is active + t.logger.Debugf("appendSingle: Dispatching to streamAppendRow for row: %v", row) + return t.streamAppendRow(row) // Call the streaming render function + } + // Existing batch logic: + t.logger.Debugf("appendSingle: Processing for batch mode, row: %v", row) + // toStringLines now uses the new convertCellsToStrings internally, then prepareContent. + // This is fine for batch. + lines, err := t.toStringLines(row, t.config.Row) + if err != nil { + t.logger.Debugf("Error in toStringLines (batch mode): %v", err) + return err + } + t.rows = append(t.rows, lines) // Add to batch storage + t.logger.Debugf("Row appended to batch t.rows, total batch rows: %d", len(t.rows)) + return nil +} + +// buildAligns constructs a map of column alignments from configuration. +// Parameter config provides alignment settings for the section. +// Returns a map of column indices to alignment settings. +func (t *Table) buildAligns(config tw.CellConfig) map[int]tw.Align { + // Start with global alignment, preferring deprecated Formatting.Alignment + effectiveGlobalAlign := config.Formatting.Alignment + if effectiveGlobalAlign == tw.Empty || effectiveGlobalAlign == tw.Skip { + effectiveGlobalAlign = config.Alignment.Global + if config.Formatting.Alignment != tw.Empty && config.Formatting.Alignment != tw.Skip { + t.logger.Warnf("Using deprecated CellFormatting.Alignment (%s). Migrate to CellConfig.Alignment.Global.", config.Formatting.Alignment) + } + } + + // Use per-column alignments, preferring deprecated ColumnAligns + effectivePerColumn := config.ColumnAligns + if len(effectivePerColumn) == 0 && len(config.Alignment.PerColumn) > 0 { + effectivePerColumn = make([]tw.Align, len(config.Alignment.PerColumn)) + copy(effectivePerColumn, config.Alignment.PerColumn) + if len(config.ColumnAligns) > 0 { + t.logger.Warnf("Using deprecated CellConfig.ColumnAligns (%v). Migrate to CellConfig.Alignment.PerColumn.", config.ColumnAligns) + } + } + + // Log input for debugging + t.logger.Debugf("buildAligns INPUT: deprecated Formatting.Alignment=%s, deprecated ColumnAligns=%v, config.Alignment.Global=%s, config.Alignment.PerColumn=%v", + config.Formatting.Alignment, config.ColumnAligns, config.Alignment.Global, config.Alignment.PerColumn) + + numColsToUse := t.getNumColsToUse() + colAlignsResult := make(map[int]tw.Align) + for i := 0; i < numColsToUse; i++ { + currentAlign := effectiveGlobalAlign + if i < len(effectivePerColumn) && effectivePerColumn[i] != tw.Empty && effectivePerColumn[i] != tw.Skip { + currentAlign = effectivePerColumn[i] + } + // Skip validation here; rely on rendering to handle invalid alignments + colAlignsResult[i] = currentAlign + } + + t.logger.Debugf("Aligns built: %v (length %d)", colAlignsResult, len(colAlignsResult)) + return colAlignsResult +} + +// buildPadding constructs a map of column padding settings from configuration. +// Parameter padding provides padding settings for the section. +// Returns a map of column indices to padding settings. +func (t *Table) buildPadding(padding tw.CellPadding) map[int]tw.Padding { + numColsToUse := t.getNumColsToUse() + colPadding := make(map[int]tw.Padding) + for i := 0; i < numColsToUse; i++ { + if i < len(padding.PerColumn) && padding.PerColumn[i].Paddable() { + colPadding[i] = padding.PerColumn[i] + } else { + colPadding[i] = padding.Global + } + } + t.logger.Debugf("Padding built: %v (length %d)", colPadding, len(colPadding)) + return colPadding +} + +// ensureInitialized initializes required fields before use. +// No parameters are required. +// No return value. +func (t *Table) ensureInitialized() { + if t.headerWidths == nil { + t.headerWidths = tw.NewMapper[int, int]() + } + if t.rowWidths == nil { + t.rowWidths = tw.NewMapper[int, int]() + } + if t.footerWidths == nil { + t.footerWidths = tw.NewMapper[int, int]() + } + if t.renderer == nil { + t.renderer = renderer.NewBlueprint() + } + t.logger.Debug("ensureInitialized called") +} + +// finalizeHierarchicalMergeBlock sets Span and End for hierarchical merges. +// Parameters include ctx, mctx, col, startRow, and endRow. +// No return value. +func (t *Table) finalizeHierarchicalMergeBlock(ctx *renderContext, mctx *mergeContext, col, startRow, endRow int) { + if endRow < startRow { + ctx.logger.Debugf("Hierarchical merge FINALIZE WARNING: Invalid block col %d, start %d > end %d", col, startRow, endRow) + return + } + if startRow < 0 || endRow < 0 { + ctx.logger.Debugf("Hierarchical merge FINALIZE WARNING: Negative row indices col %d, start %d, end %d", col, startRow, endRow) + return + } + requiredLen := endRow + 1 + if requiredLen > len(mctx.rowMerges) { + ctx.logger.Debugf("Hierarchical merge FINALIZE WARNING: rowMerges slice too short (len %d) for endRow %d", len(mctx.rowMerges), endRow) + return + } + if mctx.rowMerges[startRow] == nil { + mctx.rowMerges[startRow] = make(map[int]tw.MergeState) + } + if mctx.rowMerges[endRow] == nil { + mctx.rowMerges[endRow] = make(map[int]tw.MergeState) + } + + finalSpan := (endRow - startRow) + 1 + ctx.logger.Debugf("Finalizing H-merge block: col=%d, startRow=%d, endRow=%d, span=%d", col, startRow, endRow, finalSpan) + + startState := mctx.rowMerges[startRow][col] + if startState.Hierarchical.Present && startState.Hierarchical.Start { + startState.Hierarchical.Span = finalSpan + startState.Hierarchical.End = finalSpan == 1 + mctx.rowMerges[startRow][col] = startState + ctx.logger.Debugf(" -> Updated start state: %+v", startState.Hierarchical) + } else { + ctx.logger.Debugf("Hierarchical merge FINALIZE WARNING: col %d, startRow %d was not marked as Present/Start? Current state: %+v. Attempting recovery.", col, startRow, startState.Hierarchical) + startState.Hierarchical.Present = true + startState.Hierarchical.Start = true + startState.Hierarchical.Span = finalSpan + startState.Hierarchical.End = (finalSpan == 1) + mctx.rowMerges[startRow][col] = startState + } + + if endRow > startRow { + endState := mctx.rowMerges[endRow][col] + if endState.Hierarchical.Present && !endState.Hierarchical.Start { + endState.Hierarchical.End = true + endState.Hierarchical.Span = finalSpan + mctx.rowMerges[endRow][col] = endState + ctx.logger.Debugf(" -> Updated end state: %+v", endState.Hierarchical) + } else { + ctx.logger.Debugf("Hierarchical merge FINALIZE WARNING: col %d, endRow %d was not marked as Present/Continuation? Current state: %+v. Attempting recovery.", col, endRow, endState.Hierarchical) + endState.Hierarchical.Present = true + endState.Hierarchical.Start = false + endState.Hierarchical.End = true + endState.Hierarchical.Span = finalSpan + mctx.rowMerges[endRow][col] = endState + } + } else { + ctx.logger.Debugf(" -> Span is 1, startRow is also endRow.") + } +} + +// getLevel maps a position to its rendering level. +// Parameter position specifies the section (Header, Row, Footer). +// Returns the corresponding tw.Level (Header, Body, Footer). +func (t *Table) getLevel(position tw.Position) tw.Level { + switch position { + case tw.Header: + return tw.LevelHeader + case tw.Row: + return tw.LevelBody + case tw.Footer: + return tw.LevelFooter + default: + return tw.LevelBody + } +} + +// hasFooterElements checks if the footer has renderable elements. +// No parameters are required. +// Returns true if footer has content or padding, false otherwise. +func (t *Table) hasFooterElements() bool { + hasContent := len(t.footers) > 0 + hasTopPadding := t.config.Footer.Padding.Global.Top != tw.Empty + hasBottomPaddingConfig := t.config.Footer.Padding.Global.Bottom != tw.Empty || t.hasPerColumnBottomPadding() + return hasContent || hasTopPadding || hasBottomPaddingConfig +} + +// hasPerColumnBottomPadding checks for per-column bottom padding in footer. +// No parameters are required. +// Returns true if any per-column bottom padding is defined. +func (t *Table) hasPerColumnBottomPadding() bool { + if t.config.Footer.Padding.PerColumn == nil { + return false + } + for _, pad := range t.config.Footer.Padding.PerColumn { + if pad.Bottom != tw.Empty { + return true + } + } + return false +} + +// Logger retrieves the table's logger instance. +// No parameters are required. +// Returns the ll.Logger instance used for debug tracing. +func (t *Table) Logger() *ll.Logger { + return t.logger +} + +// Renderer retrieves the current renderer instance used by the table. +// No parameters are required. +// Returns the tw.Renderer interface instance. +func (t *Table) Renderer() tw.Renderer { + t.logger.Debug("Renderer requested") + return t.renderer +} + +// maxColumns calculates the maximum column count across sections. +// No parameters are required. +// Returns the highest number of columns found. +func (t *Table) maxColumns() int { + m := 0 + if len(t.headers) > 0 && len(t.headers[0]) > m { + m = len(t.headers[0]) + } + for _, row := range t.rows { + if len(row) > 0 && len(row[0]) > m { + m = len(row[0]) + } + } + if len(t.footers) > 0 && len(t.footers[0]) > m { + m = len(t.footers[0]) + } + t.logger.Debugf("Max columns: %d", m) + return m +} + +// printTopBottomCaption prints the table's caption at the specified top or bottom position. +// It wraps the caption text to fit the table width or a user-defined width, aligns it according +// to the specified alignment, and writes it to the provided writer. If the caption text is empty +// or the spot is invalid, it logs the issue and returns without printing. The function handles +// wrapping errors by falling back to splitting on newlines or using the original text. +func (t *Table) printTopBottomCaption(w io.Writer, actualTableWidth int) { + t.logger.Debugf("[printCaption Entry] Text=%q, Spot=%v (type %T), Align=%q, UserWidth=%d, ActualTableWidth=%d", + t.caption.Text, t.caption.Spot, t.caption.Spot, t.caption.Align, t.caption.Width, actualTableWidth) + + currentCaptionSpot := t.caption.Spot + isValidSpot := currentCaptionSpot >= tw.SpotTopLeft && currentCaptionSpot <= tw.SpotBottomRight + if t.caption.Text == "" || !isValidSpot { + t.logger.Debugf("[printCaption] Aborting: Text empty OR Spot invalid...") + return + } + + var captionWrapWidth int + if t.caption.Width > 0 { + captionWrapWidth = t.caption.Width + t.logger.Debugf("[printCaption] Using user-defined caption.Width %d for wrapping.", captionWrapWidth) + } else if actualTableWidth <= 4 { + captionWrapWidth = tw.DisplayWidth(t.caption.Text) + t.logger.Debugf("[printCaption] Empty table, no user caption.Width: Using natural caption width %d.", captionWrapWidth) + } else { + captionWrapWidth = actualTableWidth + t.logger.Debugf("[printCaption] Non-empty table, no user caption.Width: Using actualTableWidth %d for wrapping.", actualTableWidth) + } + + if captionWrapWidth <= 0 { + captionWrapWidth = 10 + t.logger.Warnf("[printCaption] captionWrapWidth was %d (<=0). Setting to minimum %d.", captionWrapWidth, 10) + } + t.logger.Debugf("[printCaption] Final captionWrapWidth to be used by twwarp: %d", captionWrapWidth) + + wrappedCaptionLines, count := twwarp.WrapString(t.caption.Text, captionWrapWidth) + if count == 0 { + t.logger.Errorf("[printCaption] Error from twwarp.WrapString (width %d): %v. Text: %q", captionWrapWidth, count, t.caption.Text) + if strings.Contains(t.caption.Text, "\n") { + wrappedCaptionLines = strings.Split(t.caption.Text, "\n") + } else { + wrappedCaptionLines = []string{t.caption.Text} + } + t.logger.Debugf("[printCaption] Fallback: using %d lines from original text.", len(wrappedCaptionLines)) + } + + if len(wrappedCaptionLines) == 0 && t.caption.Text != "" { + t.logger.Warn("[printCaption] Wrapping resulted in zero lines for non-empty text. Using fallback.") + if strings.Contains(t.caption.Text, "\n") { + wrappedCaptionLines = strings.Split(t.caption.Text, "\n") + } else { + wrappedCaptionLines = []string{t.caption.Text} + } + } else if t.caption.Text != "" { + t.logger.Debugf("[printCaption] Wrapped caption into %d lines: %v", len(wrappedCaptionLines), wrappedCaptionLines) + } + + paddingTargetWidth := actualTableWidth + if t.caption.Width > 0 { + paddingTargetWidth = t.caption.Width + } else if actualTableWidth <= 4 { + paddingTargetWidth = captionWrapWidth + } + t.logger.Debugf("[printCaption] Final paddingTargetWidth for tw.Pad: %d", paddingTargetWidth) + + for i, line := range wrappedCaptionLines { + align := t.caption.Align + if align == "" || align == tw.AlignDefault || align == tw.AlignNone { + switch t.caption.Spot { + case tw.SpotTopLeft, tw.SpotBottomLeft: + align = tw.AlignLeft + case tw.SpotTopRight, tw.SpotBottomRight: + align = tw.AlignRight + default: + align = tw.AlignCenter + } + t.logger.Debugf("[printCaption] Line %d: Alignment defaulted to %s based on Spot %v", i, align, t.caption.Spot) + } + paddedLine := tw.Pad(line, " ", paddingTargetWidth, align) + t.logger.Debugf("[printCaption] Printing line %d: InputLine=%q, Align=%s, PaddingTargetWidth=%d, PaddedLine=%q", + i, line, align, paddingTargetWidth, paddedLine) + w.Write([]byte(paddedLine)) + w.Write([]byte(tw.NewLine)) + } + + t.logger.Debugf("[printCaption] Finished printing all caption lines.") +} + +// prepareContent processes cell content with formatting and wrapping. +// Parameters include cells to process and config for formatting rules. +// Returns a slice of string slices representing processed lines. +func (t *Table) prepareContent(cells []string, config tw.CellConfig) [][]string { + isStreaming := t.config.Stream.Enable && t.hasPrinted + t.logger.Debugf("prepareContent: Processing cells=%v (streaming: %v)", cells, isStreaming) + initialInputCellCount := len(cells) + result := make([][]string, 0) + + effectiveNumCols := initialInputCellCount + if isStreaming { + if t.streamNumCols > 0 { + effectiveNumCols = t.streamNumCols + t.logger.Debugf("prepareContent: Streaming mode, using fixed streamNumCols: %d", effectiveNumCols) + if len(cells) != effectiveNumCols { + t.logger.Warnf("prepareContent: Streaming mode, input cell count (%d) does not match streamNumCols (%d). Input cells will be padded/truncated.", len(cells), effectiveNumCols) + if len(cells) < effectiveNumCols { + paddedCells := make([]string, effectiveNumCols) + copy(paddedCells, cells) + for i := len(cells); i < effectiveNumCols; i++ { + paddedCells[i] = tw.Empty + } + cells = paddedCells + } else if len(cells) > effectiveNumCols { + cells = cells[:effectiveNumCols] + } + } + } else { + t.logger.Warnf("prepareContent: Streaming mode enabled but streamNumCols is 0. Using input cell count %d. Stream widths may not be available.", effectiveNumCols) + } + } + + if t.config.MaxWidth > 0 && !t.config.Widths.Constrained() { + if effectiveNumCols > 0 { + derivedSectionGlobalMaxWidth := int(math.Floor(float64(t.config.MaxWidth) / float64(effectiveNumCols))) + config.ColMaxWidths.Global = derivedSectionGlobalMaxWidth + t.logger.Debugf("prepareContent: Table MaxWidth %d active and t.config.Widths not constrained. "+ + "Derived section ColMaxWidths.Global: %d for %d columns. This will be used by calculateContentMaxWidth if no higher priority constraints exist.", + t.config.MaxWidth, config.ColMaxWidths.Global, effectiveNumCols) + } + } + + for i := 0; i < effectiveNumCols; i++ { + cellContent := "" + if i < len(cells) { + cellContent = cells[i] + } else { + cellContent = tw.Empty + } + + cellContent = t.Trimmer(cellContent) + + colPad := config.Padding.Global + if i < len(config.Padding.PerColumn) && config.Padding.PerColumn[i].Paddable() { + colPad = config.Padding.PerColumn[i] + } + + padLeftWidth := tw.DisplayWidth(colPad.Left) + padRightWidth := tw.DisplayWidth(colPad.Right) + + effectiveContentMaxWidth := t.calculateContentMaxWidth(i, config, padLeftWidth, padRightWidth, isStreaming) + + if config.Formatting.AutoFormat.Enabled() { + cellContent = tw.Title(strings.Join(tw.SplitCamelCase(cellContent), tw.Space)) + } + + lines := strings.Split(cellContent, "\n") + finalLinesForCell := make([]string, 0) + for _, line := range lines { + if effectiveContentMaxWidth > 0 { + switch config.Formatting.AutoWrap { + case tw.WrapNormal: + var wrapped []string + if t.config.Behavior.TrimSpace.Enabled() { + wrapped, _ = twwarp.WrapString(line, effectiveContentMaxWidth) + } else { + wrapped, _ = twwarp.WrapStringWithSpaces(line, effectiveContentMaxWidth) + } + finalLinesForCell = append(finalLinesForCell, wrapped...) + case tw.WrapTruncate: + if tw.DisplayWidth(line) > effectiveContentMaxWidth { + ellipsisWidth := tw.DisplayWidth(tw.CharEllipsis) + if effectiveContentMaxWidth >= ellipsisWidth { + finalLinesForCell = append(finalLinesForCell, tw.TruncateString(line, effectiveContentMaxWidth-ellipsisWidth, tw.CharEllipsis)) + } else { + finalLinesForCell = append(finalLinesForCell, tw.TruncateString(line, effectiveContentMaxWidth, "")) + } + } else { + finalLinesForCell = append(finalLinesForCell, line) + } + case tw.WrapBreak: + wrapped := make([]string, 0) + currentLine := line + breakCharWidth := tw.DisplayWidth(tw.CharBreak) + for tw.DisplayWidth(currentLine) > effectiveContentMaxWidth { + targetWidth := effectiveContentMaxWidth - breakCharWidth + if targetWidth < 0 { + targetWidth = 0 + } + breakPoint := tw.BreakPoint(currentLine, targetWidth) + runes := []rune(currentLine) + if breakPoint <= 0 || breakPoint > len(runes) { + t.logger.Warnf("prepareContent: WrapBreak - Invalid BreakPoint %d for line '%s' at width %d. Attempting manual break.", breakPoint, currentLine, targetWidth) + actualBreakRuneCount := 0 + tempWidth := 0 + for charIdx, r := range runes { + runeStr := string(r) + rw := tw.DisplayWidth(runeStr) + if tempWidth+rw > targetWidth && charIdx > 0 { + break + } + tempWidth += rw + actualBreakRuneCount = charIdx + 1 + if tempWidth >= targetWidth && charIdx == 0 { + break + } + } + if actualBreakRuneCount == 0 && len(runes) > 0 { + actualBreakRuneCount = 1 + } + if actualBreakRuneCount > 0 && actualBreakRuneCount <= len(runes) { + wrapped = append(wrapped, string(runes[:actualBreakRuneCount])+tw.CharBreak) + currentLine = string(runes[actualBreakRuneCount:]) + } else { + t.logger.Warnf("prepareContent: WrapBreak - Cannot break line '%s'. Adding as is.", currentLine) + wrapped = append(wrapped, currentLine) + currentLine = "" + break + } + } else { + wrapped = append(wrapped, string(runes[:breakPoint])+tw.CharBreak) + currentLine = string(runes[breakPoint:]) + } + } + if tw.DisplayWidth(currentLine) > 0 { + wrapped = append(wrapped, currentLine) + } + if len(wrapped) == 0 && tw.DisplayWidth(line) > 0 && len(finalLinesForCell) == 0 { + finalLinesForCell = append(finalLinesForCell, line) + } else { + finalLinesForCell = append(finalLinesForCell, wrapped...) + } + default: + finalLinesForCell = append(finalLinesForCell, line) + } + } else { + finalLinesForCell = append(finalLinesForCell, line) + } + } + + for len(result) < len(finalLinesForCell) { + newRow := make([]string, effectiveNumCols) + for j := range newRow { + newRow[j] = tw.Empty + } + result = append(result, newRow) + } + + for j := 0; j < len(result); j++ { + cellLineContent := tw.Empty + if j < len(finalLinesForCell) { + cellLineContent = finalLinesForCell[j] + } + if i < len(result[j]) { + result[j][i] = cellLineContent + } else { + t.logger.Warnf("prepareContent: Column index %d out of bounds (%d) during result matrix population. EffectiveNumCols: %d. This indicates a logic error.", + i, len(result[j]), effectiveNumCols) + } + } + } + + t.logger.Debugf("prepareContent: Content prepared, result %d lines.", len(result)) + return result +} + +// prepareContexts initializes rendering and merge contexts. +// No parameters are required. +// Returns renderContext, mergeContext, and an error if initialization fails. +func (t *Table) prepareContexts() (*renderContext, *mergeContext, error) { + numOriginalCols := t.maxColumns() + t.logger.Debugf("prepareContexts: Original number of columns: %d", numOriginalCols) + + ctx := &renderContext{ + table: t, + renderer: t.renderer, + cfg: t.renderer.Config(), + numCols: numOriginalCols, + widths: map[tw.Position]tw.Mapper[int, int]{ + tw.Header: tw.NewMapper[int, int](), + tw.Row: tw.NewMapper[int, int](), + tw.Footer: tw.NewMapper[int, int](), + }, + logger: t.logger, + } + + isEmpty, visibleCount := t.getEmptyColumnInfo(numOriginalCols) + ctx.emptyColumns = isEmpty + ctx.visibleColCount = visibleCount + + mctx := &mergeContext{ + headerMerges: make(map[int]tw.MergeState), + rowMerges: make([]map[int]tw.MergeState, len(t.rows)), + footerMerges: make(map[int]tw.MergeState), + horzMerges: make(map[tw.Position]map[int]bool), + } + for i := range mctx.rowMerges { + mctx.rowMerges[i] = make(map[int]tw.MergeState) + } + + ctx.headerLines = t.headers + ctx.rowLines = t.rows + ctx.footerLines = t.footers + + if err := t.calculateAndNormalizeWidths(ctx); err != nil { + t.logger.Debugf("Error during initial width calculation: %v", err) + return nil, nil, err + } + t.logger.Debugf("Initial normalized widths (before hiding): H=%v, R=%v, F=%v", + ctx.widths[tw.Header], ctx.widths[tw.Row], ctx.widths[tw.Footer]) + + preparedHeaderLines, headerMerges, _ := t.prepareWithMerges(ctx.headerLines, t.config.Header, tw.Header) + ctx.headerLines = preparedHeaderLines + mctx.headerMerges = headerMerges + + processedRowLines := make([][][]string, len(ctx.rowLines)) + for i, row := range ctx.rowLines { + if mctx.rowMerges[i] == nil { + mctx.rowMerges[i] = make(map[int]tw.MergeState) + } + processedRowLines[i], mctx.rowMerges[i], _ = t.prepareWithMerges(row, t.config.Row, tw.Row) + } + ctx.rowLines = processedRowLines + + t.applyHorizontalMergeWidths(tw.Header, ctx, mctx.headerMerges) + + if t.config.Row.Formatting.MergeMode&tw.MergeVertical != 0 { + t.applyVerticalMerges(ctx, mctx) + } + if t.config.Row.Formatting.MergeMode&tw.MergeHierarchical != 0 { + t.applyHierarchicalMerges(ctx, mctx) + } + + t.prepareFooter(ctx, mctx) + t.logger.Debugf("Footer prepared. Widths before hiding: H=%v, R=%v, F=%v", + ctx.widths[tw.Header], ctx.widths[tw.Row], ctx.widths[tw.Footer]) + + if t.config.Behavior.AutoHide.Enabled() { + t.logger.Debugf("Applying AutoHide: Adjusting widths for empty columns.") + if ctx.emptyColumns == nil { + t.logger.Debugf("Warning: ctx.emptyColumns is nil during width adjustment.") + } else if len(ctx.emptyColumns) != ctx.numCols { + t.logger.Debugf("Warning: Length mismatch between emptyColumns (%d) and numCols (%d). Skipping adjustment.", len(ctx.emptyColumns), ctx.numCols) + } else { + for colIdx := 0; colIdx < ctx.numCols; colIdx++ { + if ctx.emptyColumns[colIdx] { + t.logger.Debugf("AutoHide: Hiding column %d by setting width to 0.", colIdx) + ctx.widths[tw.Header].Set(colIdx, 0) + ctx.widths[tw.Row].Set(colIdx, 0) + ctx.widths[tw.Footer].Set(colIdx, 0) + } + } + t.logger.Debugf("Widths after AutoHide adjustment: H=%v, R=%v, F=%v", + ctx.widths[tw.Header], ctx.widths[tw.Row], ctx.widths[tw.Footer]) + } + } else { + t.logger.Debugf("AutoHide is disabled, skipping width adjustment.") + } + t.logger.Debugf("prepareContexts completed all stages.") + return ctx, mctx, nil +} + +// prepareFooter processes footer content and applies merges. +// Parameters ctx and mctx hold rendering and merge state. +// No return value. +func (t *Table) prepareFooter(ctx *renderContext, mctx *mergeContext) { + if len(t.footers) == 0 { + ctx.logger.Debugf("Skipping footer preparation - no footer data") + if ctx.widths[tw.Footer] == nil { + ctx.widths[tw.Footer] = tw.NewMapper[int, int]() + } + numCols := ctx.numCols + for i := 0; i < numCols; i++ { + ctx.widths[tw.Footer].Set(i, ctx.widths[tw.Row].Get(i)) + } + t.logger.Debug("Initialized empty footer widths based on row widths: %v", ctx.widths[tw.Footer]) + ctx.footerPrepared = true + return + } + + t.logger.Debugf("Preparing footer with merge mode: %d", t.config.Footer.Formatting.MergeMode) + preparedLines, mergeStates, _ := t.prepareWithMerges(t.footers, t.config.Footer, tw.Footer) + t.footers = preparedLines + mctx.footerMerges = mergeStates + ctx.footerLines = t.footers + t.logger.Debugf("Base footer widths (normalized from rows/header): %v", ctx.widths[tw.Footer]) + t.applyHorizontalMergeWidths(tw.Footer, ctx, mctx.footerMerges) + ctx.footerPrepared = true + t.logger.Debugf("Footer preparation completed. Final footer widths: %v", ctx.widths[tw.Footer]) +} + +// prepareWithMerges processes content and detects horizontal merges. +// Parameters include content, config, and position (Header, Row, Footer). +// Returns processed lines, merge states, and horizontal merge map. +func (t *Table) prepareWithMerges(content [][]string, config tw.CellConfig, position tw.Position) ([][]string, map[int]tw.MergeState, map[int]bool) { + t.logger.Debugf("PrepareWithMerges START: position=%s, mergeMode=%d", position, config.Formatting.MergeMode) + if len(content) == 0 { + t.logger.Debugf("PrepareWithMerges END: No content.") + return content, nil, nil + } + + numCols := 0 + if len(content) > 0 && len(content[0]) > 0 { // Assumes content[0] exists and has items + numCols = len(content[0]) + } else { // Fallback if first line is empty or content is empty + for _, line := range content { // Find max columns from any line + if len(line) > numCols { + numCols = len(line) + } + } + if numCols == 0 { // If still 0, try table-wide max (batch mode context) + numCols = t.maxColumns() + } + } + + if numCols == 0 { + t.logger.Debugf("PrepareWithMerges END: numCols is zero.") + return content, nil, nil + } + + horzMergeMap := make(map[int]bool) // Tracks if a column is part of any horizontal merge for this logical row + mergeMap := make(map[int]tw.MergeState) // Final merge states for this logical row + + // Ensure all lines in 'content' are padded to numCols for consistent processing + // This result is what will be modified and returned. + result := make([][]string, len(content)) + for i := range content { + result[i] = padLine(content[i], numCols) + } + + if config.Formatting.MergeMode&tw.MergeHorizontal != 0 { + t.logger.Debugf("Checking for horizontal merges (logical cell comparison) for %d visual lines, %d columns", len(content), numCols) + + // Special handling for footer lead merge (often for "TOTAL" spanning empty cells) + // This logic only applies if it's a footer and typically to the first (often only) visual line. + if position == tw.Footer && len(content) > 0 { + lineIdx := 0 // Assume footer lead merge applies to the first visual line primarily + originalLine := padLine(content[lineIdx], numCols) // Use original content for decision + currentLineResult := result[lineIdx] // Modify the result line + + firstContentIdx := -1 + var firstContent string + for c := 0; c < numCols; c++ { + if c >= len(originalLine) { + break + } + trimmedVal := t.Trimmer(originalLine[c]) + + if trimmedVal != "" && trimmedVal != "-" { // "-" is often a placeholder not to merge over + firstContentIdx = c + firstContent = originalLine[c] // Store the raw content for placement + break + } else if trimmedVal == "-" { // Stop if we hit a hard non-mergeable placeholder + break + } + } + + if firstContentIdx > 0 { // If content starts after the first column + span := firstContentIdx + 1 // Merge from col 0 up to and including firstContentIdx + startCol := 0 + + allEmptyBefore := true + for c := 0; c < firstContentIdx; c++ { + originalLine[c] = t.Trimmer(originalLine[c]) + if c >= len(originalLine) || originalLine[c] != "" { + allEmptyBefore = false + break + } + } + + if allEmptyBefore { + t.logger.Debugf("Footer lead-merge applied line %d: content '%s' from col %d moved to col %d, span %d", + lineIdx, firstContent, firstContentIdx, startCol, span) + + if startCol < len(currentLineResult) { + currentLineResult[startCol] = firstContent // Place the original content + } + for k := startCol + 1; k < startCol+span; k++ { // Clear out other cells in the span + if k < len(currentLineResult) { + currentLineResult[k] = tw.Empty + } + } + + // Update mergeMap for all visual lines of this logical row + for visualLine := 0; visualLine < len(result); visualLine++ { + // Only apply the data move to the line where it was detected, + // but the merge state should apply to the logical cell (all its visual lines). + if visualLine != lineIdx { // For other visual lines, just clear the cells in the span + if startCol < len(result[visualLine]) { + result[visualLine][startCol] = tw.Empty // Typically empty for other lines in a lead merge + } + for k := startCol + 1; k < startCol+span; k++ { + if k < len(result[visualLine]) { + result[visualLine][k] = tw.Empty + } + } + } + } + + // Set merge state for the starting column + startState := mergeMap[startCol] + startState.Horizontal = tw.MergeStateOption{Present: true, Span: span, Start: true, End: (span == 1)} + mergeMap[startCol] = startState + horzMergeMap[startCol] = true // Mark this column as processed by a merge + + // Set merge state for subsequent columns in the span + for k := startCol + 1; k < startCol+span; k++ { + colState := mergeMap[k] + colState.Horizontal = tw.MergeStateOption{Present: true, Span: span, Start: false, End: k == startCol+span-1} + mergeMap[k] = colState + horzMergeMap[k] = true // Mark as processed + } + } + } + } + + // Standard horizontal merge logic based on full logical cell content + col := 0 + for col < numCols { + if horzMergeMap[col] { // If already part of a footer lead-merge, skip + col++ + continue + } + + // Get full content of logical cell 'col' + var currentLogicalCellContentBuilder strings.Builder + for lineIdx := 0; lineIdx < len(content); lineIdx++ { + if col < len(content[lineIdx]) { + currentLogicalCellContentBuilder.WriteString(content[lineIdx][col]) + } + } + + currentLogicalCellTrimmed := t.Trimmer(currentLogicalCellContentBuilder.String()) + if currentLogicalCellTrimmed == "" || currentLogicalCellTrimmed == "-" { + col++ + continue + } + + span := 1 + for nextCol := col + 1; nextCol < numCols; nextCol++ { + if horzMergeMap[nextCol] { // Don't merge into an already merged (e.g. footer lead) column + break + } + var nextLogicalCellContentBuilder strings.Builder + for lineIdx := 0; lineIdx < len(content); lineIdx++ { + if nextCol < len(content[lineIdx]) { + nextLogicalCellContentBuilder.WriteString(content[lineIdx][nextCol]) + } + } + + nextLogicalCellTrimmed := t.Trimmer(nextLogicalCellContentBuilder.String()) + if currentLogicalCellTrimmed == nextLogicalCellTrimmed && nextLogicalCellTrimmed != "-" { + span++ + } else { + break + } + } + + if span > 1 { + t.logger.Debugf("Standard horizontal merge (logical cell): startCol %d, span %d for content '%s'", col, span, currentLogicalCellTrimmed) + startState := mergeMap[col] + startState.Horizontal = tw.MergeStateOption{Present: true, Span: span, Start: true, End: (span == 1)} + mergeMap[col] = startState + horzMergeMap[col] = true + + // For all visual lines, clear out the content of the merged-over cells + for lineIdx := 0; lineIdx < len(result); lineIdx++ { + for k := col + 1; k < col+span; k++ { + if k < len(result[lineIdx]) { + result[lineIdx][k] = tw.Empty + } + } + } + + // Set merge state for subsequent columns in the span + for k := col + 1; k < col+span; k++ { + colState := mergeMap[k] + colState.Horizontal = tw.MergeStateOption{Present: true, Span: span, Start: false, End: k == col+span-1} + mergeMap[k] = colState + horzMergeMap[k] = true + } + col += span + } else { + col++ + } + } + } + + t.logger.Debugf("PrepareWithMerges END: position=%s, lines=%d, mergeMapH: %v", position, len(result), func() map[int]tw.MergeStateOption { + m := make(map[int]tw.MergeStateOption) + for k, v := range mergeMap { + m[k] = v.Horizontal + } + return m + }()) + return result, mergeMap, horzMergeMap +} + +// render generates the table output using the configured renderer. +// No parameters are required. +// Returns an error if rendering fails in any section. +func (t *Table) render() error { + + t.ensureInitialized() + + if t.config.Stream.Enable { + t.logger.Warn("Render() called in streaming mode. Use Start/Append/Close methods instead.") + return errors.New("render called in streaming mode; use Start/Append/Close") + } + + // Calculate and cache numCols for THIS batch render pass + t.batchRenderNumCols = t.maxColumns() // Calculate ONCE + t.isBatchRenderNumColsSet = true // Mark the cache as active for this render pass + t.logger.Debugf("Render(): Set batchRenderNumCols to %d and isBatchRenderNumColsSet to true.", t.batchRenderNumCols) + + defer func() { + t.isBatchRenderNumColsSet = false + // t.batchRenderNumCols = 0; // Optional: reset to 0, or leave as is. + // Since isBatchRenderNumColsSet is false, its value won't be used by getNumColsToUse. + t.logger.Debugf("Render(): Cleared isBatchRenderNumColsSet to false (batchRenderNumCols was %d).", t.batchRenderNumCols) + }() + + hasCaption := t.caption.Text != "" && t.caption.Spot != tw.SpotNone + isTopOrBottomCaption := hasCaption && + (t.caption.Spot >= tw.SpotTopLeft && t.caption.Spot <= tw.SpotBottomRight) + + var tableStringBuffer *strings.Builder + targetWriter := t.writer + originalWriter := t.writer // Save original writer for restoration if needed + + if isTopOrBottomCaption { + tableStringBuffer = &strings.Builder{} + targetWriter = tableStringBuffer + t.logger.Debugf("Top/Bottom caption detected. Rendering table core to buffer first.") + } else { + t.logger.Debugf("No caption detected. Rendering table core directly to writer.") + } + + //Render Table Core + t.writer = targetWriter + ctx, mctx, err := t.prepareContexts() + if err != nil { + t.writer = originalWriter + t.logger.Errorf("prepareContexts failed: %v", err) + return fmt.Errorf("failed to prepare table contexts: %w", err) + } + + if err := ctx.renderer.Start(t.writer); err != nil { + t.writer = originalWriter + t.logger.Errorf("Renderer Start() error: %v", err) + return fmt.Errorf("renderer start failed: %w", err) + } + + renderError := false + var firstRenderErr error + renderFuncs := []func(*renderContext, *mergeContext) error{ + t.renderHeader, + t.renderRow, + t.renderFooter, + } + for i, renderFn := range renderFuncs { + sectionName := []string{"Header", "Row", "Footer"}[i] + if renderErr := renderFn(ctx, mctx); renderErr != nil { + t.logger.Errorf("Renderer section error (%s): %v", sectionName, renderErr) + if !renderError { + firstRenderErr = fmt.Errorf("failed to render %s section: %w", sectionName, renderErr) + } + renderError = true + break + } + } + + if closeErr := ctx.renderer.Close(); closeErr != nil { + t.logger.Errorf("Renderer Close() error: %v", closeErr) + if !renderError { + firstRenderErr = fmt.Errorf("renderer close failed: %w", closeErr) + } + renderError = true + } + + t.writer = originalWriter // Restore original writer + + if renderError { + return firstRenderErr // Return error from core rendering if any + } + + //Caption Handling & Final Output --- + if isTopOrBottomCaption { + renderedTableContent := tableStringBuffer.String() + t.logger.Debugf("[Render] Table core buffer length: %d", len(renderedTableContent)) + + // Check if the buffer is empty AND borders are enabled + shouldHaveBorders := t.renderer != nil && (t.renderer.Config().Borders.Top.Enabled() || t.renderer.Config().Borders.Bottom.Enabled()) + if len(renderedTableContent) == 0 && shouldHaveBorders { + var sb strings.Builder + if t.renderer.Config().Borders.Top.Enabled() { + sb.WriteString("+--+") + sb.WriteString(t.newLine) + } + if t.renderer.Config().Borders.Bottom.Enabled() { + sb.WriteString("+--+") + } + renderedTableContent = sb.String() + t.logger.Warnf("[Render] Table buffer was empty despite enabled borders. Manually generated minimal output: %q", renderedTableContent) + } + + actualTableWidth := 0 + trimmedBuffer := strings.TrimRight(renderedTableContent, "\r\n \t") + for _, line := range strings.Split(trimmedBuffer, "\n") { + w := tw.DisplayWidth(line) + if w > actualTableWidth { + actualTableWidth = w + } + } + t.logger.Debugf("[Render] Calculated actual table width: %d (from content: %q)", actualTableWidth, renderedTableContent) + + isTopCaption := t.caption.Spot >= tw.SpotTopLeft && t.caption.Spot <= tw.SpotTopRight + + if isTopCaption { + t.logger.Debugf("[Render] Printing Top Caption.") + t.printTopBottomCaption(t.writer, actualTableWidth) + } + + if len(renderedTableContent) > 0 { + t.logger.Debugf("[Render] Printing table content (length %d) to final writer.", len(renderedTableContent)) + t.writer.Write([]byte(renderedTableContent)) + if !isTopCaption && t.caption.Text != "" && !strings.HasSuffix(renderedTableContent, t.newLine) { + t.writer.Write([]byte(tw.NewLine)) + t.logger.Debugf("[Render] Added trailing newline after table content before bottom caption.") + } + } else { + t.logger.Debugf("[Render] No table content (original buffer or generated) to print.") + } + + if !isTopCaption { + t.logger.Debugf("[Render] Calling printTopBottomCaption for Bottom Caption. Width: %d", actualTableWidth) + t.printTopBottomCaption(t.writer, actualTableWidth) + t.logger.Debugf("[Render] Returned from printTopBottomCaption for Bottom Caption.") + } + } + + t.hasPrinted = true + t.logger.Info("Render() completed.") + return nil // Success +} + +// renderFooter renders the table's footer section with borders and padding. +// Parameters ctx and mctx hold rendering and merge state. +// Returns an error if rendering fails. +func (t *Table) renderFooter(ctx *renderContext, mctx *mergeContext) error { + if !ctx.footerPrepared { + t.prepareFooter(ctx, mctx) + } + + f := ctx.renderer + cfg := ctx.cfg + + hasContent := len(ctx.footerLines) > 0 + hasTopPadding := t.config.Footer.Padding.Global.Top != tw.Empty + hasBottomPaddingConfig := t.config.Footer.Padding.Global.Bottom != tw.Empty || t.hasPerColumnBottomPadding() + hasAnyFooterElement := hasContent || hasTopPadding || hasBottomPaddingConfig + + if !hasAnyFooterElement { + hasContentAbove := len(ctx.rowLines) > 0 || len(ctx.headerLines) > 0 + if hasContentAbove && cfg.Borders.Bottom.Enabled() && cfg.Settings.Lines.ShowBottom.Enabled() { + ctx.logger.Debugf("Footer is empty, rendering table bottom border based on last row/header") + var lastLineAboveCtx *helperContext + var lastLineAligns map[int]tw.Align + var lastLinePadding map[int]tw.Padding + + if len(ctx.rowLines) > 0 { + lastRowIdx := len(ctx.rowLines) - 1 + lastRowLineIdx := -1 + var lastRowLine []string + if lastRowIdx >= 0 && len(ctx.rowLines[lastRowIdx]) > 0 { + lastRowLineIdx = len(ctx.rowLines[lastRowIdx]) - 1 + lastRowLine = padLine(ctx.rowLines[lastRowIdx][lastRowLineIdx], ctx.numCols) + } else { + lastRowLine = make([]string, ctx.numCols) + } + lastLineAboveCtx = &helperContext{ + position: tw.Row, + rowIdx: lastRowIdx, + lineIdx: lastRowLineIdx, + line: lastRowLine, + location: tw.LocationEnd, + } + lastLineAligns = t.buildAligns(t.config.Row) + lastLinePadding = t.buildPadding(t.config.Row.Padding) + } else { + lastHeaderLineIdx := -1 + var lastHeaderLine []string + if len(ctx.headerLines) > 0 { + lastHeaderLineIdx = len(ctx.headerLines) - 1 + lastHeaderLine = padLine(ctx.headerLines[lastHeaderLineIdx], ctx.numCols) + } else { + lastHeaderLine = make([]string, ctx.numCols) + } + lastLineAboveCtx = &helperContext{ + position: tw.Header, + rowIdx: 0, + lineIdx: lastHeaderLineIdx, + line: lastHeaderLine, + location: tw.LocationEnd, + } + lastLineAligns = t.buildAligns(t.config.Header) + lastLinePadding = t.buildPadding(t.config.Header.Padding) + } + + resp := t.buildCellContexts(ctx, mctx, lastLineAboveCtx, lastLineAligns, lastLinePadding) + ctx.logger.Debugf("Bottom border: Using Widths=%v", ctx.widths[tw.Row]) + f.Line(tw.Formatting{ + Row: tw.RowContext{ + Widths: ctx.widths[tw.Row], + Current: resp.cells, + Previous: resp.prevCells, + Position: lastLineAboveCtx.position, + Location: tw.LocationEnd, + ColMaxWidths: t.getColMaxWidths(tw.Footer), + }, + Level: tw.LevelFooter, + IsSubRow: false, + }) + } else { + ctx.logger.Debugf("Footer is empty and no content above or borders disabled, skipping footer render") + } + return nil + } + + ctx.logger.Debugf("Rendering footer section (has elements)") + hasContentAbove := len(ctx.rowLines) > 0 || len(ctx.headerLines) > 0 + colAligns := t.buildAligns(t.config.Footer) + colPadding := t.buildPadding(t.config.Footer.Padding) + hctx := &helperContext{position: tw.Footer} + // Declare paddingLineContentForContext with a default value + paddingLineContentForContext := make([]string, ctx.numCols) + + if hasContentAbove && cfg.Settings.Lines.ShowFooterLine.Enabled() && !hasTopPadding && len(ctx.footerLines) > 0 { + ctx.logger.Debugf("Rendering footer separator line") + var lastLineAboveCtx *helperContext + var lastLineAligns map[int]tw.Align + var lastLinePadding map[int]tw.Padding + var lastLinePosition tw.Position + + if len(ctx.rowLines) > 0 { + lastRowIdx := len(ctx.rowLines) - 1 + lastRowLineIdx := -1 + var lastRowLine []string + if lastRowIdx >= 0 && len(ctx.rowLines[lastRowIdx]) > 0 { + lastRowLineIdx = len(ctx.rowLines[lastRowIdx]) - 1 + lastRowLine = padLine(ctx.rowLines[lastRowIdx][lastRowLineIdx], ctx.numCols) + } else { + lastRowLine = make([]string, ctx.numCols) + } + lastLineAboveCtx = &helperContext{ + position: tw.Row, + rowIdx: lastRowIdx, + lineIdx: lastRowLineIdx, + line: lastRowLine, + location: tw.LocationMiddle, + } + lastLineAligns = t.buildAligns(t.config.Row) + lastLinePadding = t.buildPadding(t.config.Row.Padding) + lastLinePosition = tw.Row + } else { + lastHeaderLineIdx := -1 + var lastHeaderLine []string + if len(ctx.headerLines) > 0 { + lastHeaderLineIdx = len(ctx.headerLines) - 1 + lastHeaderLine = padLine(ctx.headerLines[lastHeaderLineIdx], ctx.numCols) + } else { + lastHeaderLine = make([]string, ctx.numCols) + } + lastLineAboveCtx = &helperContext{ + position: tw.Header, + rowIdx: 0, + lineIdx: lastHeaderLineIdx, + line: lastHeaderLine, + location: tw.LocationMiddle, + } + lastLineAligns = t.buildAligns(t.config.Header) + lastLinePadding = t.buildPadding(t.config.Header.Padding) + lastLinePosition = tw.Header + } + + resp := t.buildCellContexts(ctx, mctx, lastLineAboveCtx, lastLineAligns, lastLinePadding) + var nextCells map[int]tw.CellContext + if hasContent { + nextCells = make(map[int]tw.CellContext) + for j, cellData := range padLine(ctx.footerLines[0], ctx.numCols) { + mergeState := tw.MergeState{} + if mctx.footerMerges != nil { + mergeState = mctx.footerMerges[j] + } + nextCells[j] = tw.CellContext{Data: cellData, Merge: mergeState, Width: ctx.widths[tw.Footer].Get(j)} + } + } + ctx.logger.Debugf("Footer separator: Using Widths=%v", ctx.widths[tw.Row]) + f.Line(tw.Formatting{ + Row: tw.RowContext{ + Widths: ctx.widths[tw.Row], + Current: resp.cells, + Previous: resp.prevCells, + Next: nextCells, + Position: lastLinePosition, + Location: tw.LocationMiddle, + ColMaxWidths: t.getColMaxWidths(tw.Footer), + }, + Level: tw.LevelFooter, + IsSubRow: false, + HasFooter: true, + }) + } + + if hasTopPadding { + hctx.rowIdx = 0 + hctx.lineIdx = -1 + if !(hasContentAbove && cfg.Settings.Lines.ShowFooterLine.Enabled()) { + hctx.location = tw.LocationFirst + } else { + hctx.location = tw.LocationMiddle + } + hctx.line = t.buildPaddingLineContents(t.config.Footer.Padding.Global.Top, ctx.widths[tw.Footer], ctx.numCols, mctx.footerMerges) + ctx.logger.Debugf("Calling renderPadding for Footer Top Padding line: %v (loc: %v)", hctx.line, hctx.location) + if err := t.renderPadding(ctx, mctx, hctx, t.config.Footer.Padding.Global.Top); err != nil { + return err + } + } + + lastRenderedLineIdx := -2 + if hasTopPadding { + lastRenderedLineIdx = -1 + } + for i, line := range ctx.footerLines { + hctx.rowIdx = 0 + hctx.lineIdx = i + hctx.line = padLine(line, ctx.numCols) + isFirstContentLine := i == 0 + isLastContentLine := i == len(ctx.footerLines)-1 + if isFirstContentLine && !hasTopPadding && !(hasContentAbove && cfg.Settings.Lines.ShowFooterLine.Enabled()) { + hctx.location = tw.LocationFirst + } else if isLastContentLine && !hasBottomPaddingConfig { + hctx.location = tw.LocationEnd + } else { + hctx.location = tw.LocationMiddle + } + ctx.logger.Debugf("Rendering footer content line %d with location %v", i, hctx.location) + if err := t.renderLine(ctx, mctx, hctx, colAligns, colPadding); err != nil { + return err + } + lastRenderedLineIdx = i + } + + if hasBottomPaddingConfig { + paddingLineContentForContext = make([]string, ctx.numCols) + formattedPaddingCells := make([]string, ctx.numCols) + var representativePadChar string = " " + ctx.logger.Debugf("Constructing Footer Bottom Padding line content strings") + for j := 0; j < ctx.numCols; j++ { + colWd := ctx.widths[tw.Footer].Get(j) + mergeState := tw.MergeState{} + if mctx.footerMerges != nil { + if state, ok := mctx.footerMerges[j]; ok { + mergeState = state + } + } + if mergeState.Horizontal.Present && !mergeState.Horizontal.Start { + paddingLineContentForContext[j] = "" + formattedPaddingCells[j] = "" + continue + } + padChar := " " + if j < len(t.config.Footer.Padding.PerColumn) && t.config.Footer.Padding.PerColumn[j].Bottom != tw.Empty { + padChar = t.config.Footer.Padding.PerColumn[j].Bottom + } else if t.config.Footer.Padding.Global.Bottom != tw.Empty { + padChar = t.config.Footer.Padding.Global.Bottom + } + paddingLineContentForContext[j] = padChar + if j == 0 || representativePadChar == " " { + representativePadChar = padChar + } + padWidth := tw.DisplayWidth(padChar) + if padWidth < 1 { + padWidth = 1 + } + repeatCount := 0 + if colWd > 0 && padWidth > 0 { + repeatCount = colWd / padWidth + } + if colWd > 0 && repeatCount < 1 && padChar != " " { + repeatCount = 1 + } + if colWd == 0 { + repeatCount = 0 + } + rawPaddingContent := strings.Repeat(padChar, repeatCount) + currentWd := tw.DisplayWidth(rawPaddingContent) + if currentWd < colWd { + rawPaddingContent += strings.Repeat(" ", colWd-currentWd) + } + if currentWd > colWd && colWd > 0 { + rawPaddingContent = tw.TruncateString(rawPaddingContent, colWd) + } + if colWd == 0 { + rawPaddingContent = "" + } + formattedPaddingCells[j] = rawPaddingContent + } + ctx.logger.Debugf("Manually rendering Footer Bottom Padding line (char like '%s')", representativePadChar) + var paddingLineOutput strings.Builder + if cfg.Borders.Left.Enabled() { + paddingLineOutput.WriteString(cfg.Symbols.Column()) + } + for colIdx := 0; colIdx < ctx.numCols; { + if colIdx > 0 && cfg.Settings.Separators.BetweenColumns.Enabled() { + shouldAddSeparator := true + if prevMergeState, ok := mctx.footerMerges[colIdx-1]; ok { + if prevMergeState.Horizontal.Present && !prevMergeState.Horizontal.End { + shouldAddSeparator = false + } + } + if shouldAddSeparator { + paddingLineOutput.WriteString(cfg.Symbols.Column()) + } + } + if colIdx < len(formattedPaddingCells) { + paddingLineOutput.WriteString(formattedPaddingCells[colIdx]) + } + currentMergeState := tw.MergeState{} + if mctx.footerMerges != nil { + if state, ok := mctx.footerMerges[colIdx]; ok { + currentMergeState = state + } + } + if currentMergeState.Horizontal.Present && currentMergeState.Horizontal.Start { + colIdx += currentMergeState.Horizontal.Span + } else { + colIdx++ + } + } + if cfg.Borders.Right.Enabled() { + paddingLineOutput.WriteString(cfg.Symbols.Column()) + } + paddingLineOutput.WriteString(t.newLine) + t.writer.Write([]byte(paddingLineOutput.String())) + ctx.logger.Debugf("Manually rendered Footer Bottom Padding line: %s", strings.TrimSuffix(paddingLineOutput.String(), t.newLine)) + hctx.rowIdx = 0 + hctx.lineIdx = len(ctx.footerLines) + hctx.line = paddingLineContentForContext + hctx.location = tw.LocationEnd + lastRenderedLineIdx = hctx.lineIdx + } + + if cfg.Borders.Bottom.Enabled() && cfg.Settings.Lines.ShowBottom.Enabled() { + ctx.logger.Debugf("Rendering final table bottom border") + if lastRenderedLineIdx == len(ctx.footerLines) { + hctx.rowIdx = 0 + hctx.lineIdx = lastRenderedLineIdx + hctx.line = paddingLineContentForContext + hctx.location = tw.LocationEnd + ctx.logger.Debugf("Setting border context based on bottom padding line") + } else if lastRenderedLineIdx >= 0 { + hctx.rowIdx = 0 + hctx.lineIdx = lastRenderedLineIdx + hctx.line = padLine(ctx.footerLines[hctx.lineIdx], ctx.numCols) + hctx.location = tw.LocationEnd + ctx.logger.Debugf("Setting border context based on last content line idx %d", hctx.lineIdx) + } else if lastRenderedLineIdx == -1 { + hctx.rowIdx = 0 + hctx.lineIdx = -1 + hctx.line = paddingLineContentForContext + hctx.location = tw.LocationEnd + ctx.logger.Debugf("Setting border context based on top padding line") + } else { + hctx.rowIdx = 0 + hctx.lineIdx = -2 + hctx.line = make([]string, ctx.numCols) + hctx.location = tw.LocationEnd + ctx.logger.Debugf("Warning: Cannot determine context for bottom border") + } + resp := t.buildCellContexts(ctx, mctx, hctx, colAligns, colPadding) + ctx.logger.Debugf("Bottom border: Using Widths=%v", ctx.widths[tw.Row]) + f.Line(tw.Formatting{ + Row: tw.RowContext{ + Widths: ctx.widths[tw.Row], + Current: resp.cells, + Previous: resp.prevCells, + Position: tw.Footer, + Location: tw.LocationEnd, + ColMaxWidths: t.getColMaxWidths(tw.Footer), + }, + Level: tw.LevelFooter, + IsSubRow: false, + }) + } + + return nil +} + +// renderHeader renders the table's header section with borders and padding. +// Parameters ctx and mctx hold rendering and merge state. +// Returns an error if rendering fails. +func (t *Table) renderHeader(ctx *renderContext, mctx *mergeContext) error { + if len(ctx.headerLines) == 0 { + return nil + } + ctx.logger.Debug("Rendering header section") + + f := ctx.renderer + cfg := ctx.cfg + colAligns := t.buildAligns(t.config.Header) + colPadding := t.buildPadding(t.config.Header.Padding) + hctx := &helperContext{position: tw.Header} + + if cfg.Borders.Top.Enabled() && cfg.Settings.Lines.ShowTop.Enabled() { + ctx.logger.Debug("Rendering table top border") + nextCells := make(map[int]tw.CellContext) + if len(ctx.headerLines) > 0 { + for j, cell := range ctx.headerLines[0] { + nextCells[j] = tw.CellContext{Data: cell, Merge: mctx.headerMerges[j]} + } + } + f.Line(tw.Formatting{ + Row: tw.RowContext{ + Widths: ctx.widths[tw.Header], + Next: nextCells, + Position: tw.Header, + Location: tw.LocationFirst, + }, + Level: tw.LevelHeader, + IsSubRow: false, + }) + } + + if t.config.Header.Padding.Global.Top != tw.Empty { + hctx.location = tw.LocationFirst + hctx.line = t.buildPaddingLineContents(t.config.Header.Padding.Global.Top, ctx.widths[tw.Header], ctx.numCols, mctx.headerMerges) + if err := t.renderPadding(ctx, mctx, hctx, t.config.Header.Padding.Global.Top); err != nil { + return err + } + } + + for i, line := range ctx.headerLines { + hctx.rowIdx = 0 + hctx.lineIdx = i + hctx.line = padLine(line, ctx.numCols) + hctx.location = t.determineLocation(i, len(ctx.headerLines), t.config.Header.Padding.Global.Top, t.config.Header.Padding.Global.Bottom) + + if t.config.Header.Callbacks.Global != nil { + ctx.logger.Debug("Executing global header callback for line %d", i) + t.config.Header.Callbacks.Global() + } + for colIdx, cb := range t.config.Header.Callbacks.PerColumn { + if colIdx < ctx.numCols && cb != nil { + ctx.logger.Debug("Executing per-column header callback for line %d, col %d", i, colIdx) + cb() + } + } + + if err := t.renderLine(ctx, mctx, hctx, colAligns, colPadding); err != nil { + return err + } + } + + if t.config.Header.Padding.Global.Bottom != tw.Empty { + hctx.location = tw.LocationEnd + hctx.line = t.buildPaddingLineContents(t.config.Header.Padding.Global.Bottom, ctx.widths[tw.Header], ctx.numCols, mctx.headerMerges) + if err := t.renderPadding(ctx, mctx, hctx, t.config.Header.Padding.Global.Bottom); err != nil { + return err + } + } + + if cfg.Settings.Lines.ShowHeaderLine.Enabled() && (len(ctx.rowLines) > 0 || len(ctx.footerLines) > 0) { + ctx.logger.Debug("Rendering header separator line") + resp := t.buildCellContexts(ctx, mctx, hctx, colAligns, colPadding) + + var nextSectionCells map[int]tw.CellContext + var nextSectionWidths tw.Mapper[int, int] + + if len(ctx.rowLines) > 0 { + nextSectionWidths = ctx.widths[tw.Row] + rowColAligns := t.buildAligns(t.config.Row) + rowColPadding := t.buildPadding(t.config.Row.Padding) + firstRowHctx := &helperContext{ + position: tw.Row, + rowIdx: 0, + lineIdx: 0, + } + if len(ctx.rowLines[0]) > 0 { + firstRowHctx.line = padLine(ctx.rowLines[0][0], ctx.numCols) + } else { + firstRowHctx.line = make([]string, ctx.numCols) + } + firstRowResp := t.buildCellContexts(ctx, mctx, firstRowHctx, rowColAligns, rowColPadding) + nextSectionCells = firstRowResp.cells + } else if len(ctx.footerLines) > 0 { + nextSectionWidths = ctx.widths[tw.Row] + footerColAligns := t.buildAligns(t.config.Footer) + footerColPadding := t.buildPadding(t.config.Footer.Padding) + firstFooterHctx := &helperContext{ + position: tw.Footer, + rowIdx: 0, + lineIdx: 0, + } + if len(ctx.footerLines) > 0 { + firstFooterHctx.line = padLine(ctx.footerLines[0], ctx.numCols) + } else { + firstFooterHctx.line = make([]string, ctx.numCols) + } + firstFooterResp := t.buildCellContexts(ctx, mctx, firstFooterHctx, footerColAligns, footerColPadding) + nextSectionCells = firstFooterResp.cells + } else { + nextSectionWidths = ctx.widths[tw.Header] + nextSectionCells = nil + } + + f.Line(tw.Formatting{ + Row: tw.RowContext{ + Widths: nextSectionWidths, + Current: resp.cells, + Previous: resp.prevCells, + Next: nextSectionCells, + Position: tw.Header, + Location: tw.LocationMiddle, + }, + Level: tw.LevelBody, + IsSubRow: false, + }) + } + return nil +} + +// renderLine renders a single line with callbacks and normalized widths. +// Parameters include ctx, mctx, hctx, aligns, and padding for rendering. +// Returns an error if rendering fails. +func (t *Table) renderLine(ctx *renderContext, mctx *mergeContext, hctx *helperContext, aligns map[int]tw.Align, padding map[int]tw.Padding) error { + resp := t.buildCellContexts(ctx, mctx, hctx, aligns, padding) + f := ctx.renderer + + isPaddingLine := false + sectionConfig := t.config.Row + switch hctx.position { + case tw.Header: + sectionConfig = t.config.Header + isPaddingLine = (hctx.lineIdx == -1 && sectionConfig.Padding.Global.Top != tw.Empty) || + (hctx.lineIdx == len(ctx.headerLines) && sectionConfig.Padding.Global.Bottom != tw.Empty) + case tw.Footer: + sectionConfig = t.config.Footer + isPaddingLine = (hctx.lineIdx == -1 && sectionConfig.Padding.Global.Top != tw.Empty) || + (hctx.lineIdx == len(ctx.footerLines) && (sectionConfig.Padding.Global.Bottom != tw.Empty || t.hasPerColumnBottomPadding())) + case tw.Row: + if hctx.rowIdx >= 0 && hctx.rowIdx < len(ctx.rowLines) { + isPaddingLine = (hctx.lineIdx == -1 && sectionConfig.Padding.Global.Top != tw.Empty) || + (hctx.lineIdx == len(ctx.rowLines[hctx.rowIdx]) && sectionConfig.Padding.Global.Bottom != tw.Empty) + } + } + + sectionWidths := ctx.widths[hctx.position] + normalizedWidths := ctx.widths[tw.Row] + + formatting := tw.Formatting{ + Row: tw.RowContext{ + Widths: sectionWidths, + ColMaxWidths: t.getColMaxWidths(hctx.position), + Current: resp.cells, + Previous: resp.prevCells, + Next: resp.nextCells, + Position: hctx.position, + Location: hctx.location, + }, + Level: t.getLevel(hctx.position), + IsSubRow: hctx.lineIdx > 0 || isPaddingLine, + NormalizedWidths: normalizedWidths, + } + + if hctx.position == tw.Row { + formatting.HasFooter = len(ctx.footerLines) > 0 + } + + switch hctx.position { + case tw.Header: + f.Header([][]string{hctx.line}, formatting) + case tw.Row: + f.Row(hctx.line, formatting) + case tw.Footer: + f.Footer([][]string{hctx.line}, formatting) + } + return nil +} + +// renderPadding renders padding lines for a section. +// Parameters include ctx, mctx, hctx, and padChar for padding content. +// Returns an error if rendering fails. +func (t *Table) renderPadding(ctx *renderContext, mctx *mergeContext, hctx *helperContext, padChar string) error { + ctx.logger.Debug("Rendering padding line for %s (using char like '%s')", hctx.position, padChar) + + colAligns := t.buildAligns(t.config.Row) + colPadding := t.buildPadding(t.config.Row.Padding) + + switch hctx.position { + case tw.Header: + colAligns = t.buildAligns(t.config.Header) + colPadding = t.buildPadding(t.config.Header.Padding) + case tw.Footer: + colAligns = t.buildAligns(t.config.Footer) + colPadding = t.buildPadding(t.config.Footer.Padding) + } + + return t.renderLine(ctx, mctx, hctx, colAligns, colPadding) +} + +// renderRow renders the table's row section with borders and padding. +// Parameters ctx and mctx hold rendering and merge state. +// Returns an error if rendering fails. +func (t *Table) renderRow(ctx *renderContext, mctx *mergeContext) error { + if len(ctx.rowLines) == 0 { + return nil + } + ctx.logger.Debugf("Rendering row section (total rows: %d)", len(ctx.rowLines)) + + f := ctx.renderer + cfg := ctx.cfg + colAligns := t.buildAligns(t.config.Row) + colPadding := t.buildPadding(t.config.Row.Padding) + hctx := &helperContext{position: tw.Row} + + footerIsEmptyOrNonExistent := !t.hasFooterElements() + if len(ctx.headerLines) == 0 && footerIsEmptyOrNonExistent && cfg.Borders.Top.Enabled() && cfg.Settings.Lines.ShowTop.Enabled() { + ctx.logger.Debug("Rendering table top border (rows only table)") + nextCells := make(map[int]tw.CellContext) + if len(ctx.rowLines) > 0 && len(ctx.rowLines[0]) > 0 && len(mctx.rowMerges) > 0 { + firstLine := ctx.rowLines[0][0] + firstMerges := mctx.rowMerges[0] + for j, cell := range padLine(firstLine, ctx.numCols) { + mergeState := tw.MergeState{} + if firstMerges != nil { + mergeState = firstMerges[j] + } + nextCells[j] = tw.CellContext{Data: cell, Merge: mergeState, Width: ctx.widths[tw.Row].Get(j)} + } + } + f.Line(tw.Formatting{ + Row: tw.RowContext{ + Widths: ctx.widths[tw.Row], + Next: nextCells, + Position: tw.Row, + Location: tw.LocationFirst, + }, + Level: tw.LevelHeader, + IsSubRow: false, + }) + } + + for i, lines := range ctx.rowLines { + rowHasTopPadding := t.config.Row.Padding.Global.Top != tw.Empty + if rowHasTopPadding { + hctx.rowIdx = i + hctx.lineIdx = -1 + if i == 0 && len(ctx.headerLines) == 0 { + hctx.location = tw.LocationFirst + } else { + hctx.location = tw.LocationMiddle + } + hctx.line = t.buildPaddingLineContents(t.config.Row.Padding.Global.Top, ctx.widths[tw.Row], ctx.numCols, mctx.rowMerges[i]) + ctx.logger.Debug("Calling renderPadding for Row Top Padding (row %d): %v (loc: %v)", i, hctx.line, hctx.location) + if err := t.renderPadding(ctx, mctx, hctx, t.config.Row.Padding.Global.Top); err != nil { + return err + } + } + + footerExists := t.hasFooterElements() + rowHasBottomPadding := t.config.Row.Padding.Global.Bottom != tw.Empty + isLastRow := i == len(ctx.rowLines)-1 + + for j, visualLineData := range lines { + hctx.rowIdx = i + hctx.lineIdx = j + hctx.line = padLine(visualLineData, ctx.numCols) + + if j > 0 { + visualLineHasActualContent := false + for kCellIdx, cellContentInVisualLine := range hctx.line { + if t.Trimmer(cellContentInVisualLine) != "" { + visualLineHasActualContent = true + ctx.logger.Debug("Visual line [%d][%d] has content in cell %d: '%s'. Not skipping.", i, j, kCellIdx, cellContentInVisualLine) + break + } + } + + if !visualLineHasActualContent { + ctx.logger.Debug("Skipping visual line [%d][%d] as it's entirely blank after trimming. Line: %q", i, j, hctx.line) + continue + } + } + + isFirstRow := i == 0 + isLastLineOfRow := j == len(lines)-1 + + if isFirstRow && j == 0 && !rowHasTopPadding && len(ctx.headerLines) == 0 { + hctx.location = tw.LocationFirst + } else if isLastRow && isLastLineOfRow && !rowHasBottomPadding && !footerExists { + hctx.location = tw.LocationEnd + } else { + hctx.location = tw.LocationMiddle + } + + ctx.logger.Debugf("Rendering row %d line %d with location %v. Content: %q", i, j, hctx.location, hctx.line) + if err := t.renderLine(ctx, mctx, hctx, colAligns, colPadding); err != nil { + return err + } + } + + if rowHasBottomPadding { + hctx.rowIdx = i + hctx.lineIdx = len(lines) + if isLastRow && !footerExists { + hctx.location = tw.LocationEnd + } else { + hctx.location = tw.LocationMiddle + } + hctx.line = t.buildPaddingLineContents(t.config.Row.Padding.Global.Bottom, ctx.widths[tw.Row], ctx.numCols, mctx.rowMerges[i]) + ctx.logger.Debug("Calling renderPadding for Row Bottom Padding (row %d): %v (loc: %v)", i, hctx.line, hctx.location) + if err := t.renderPadding(ctx, mctx, hctx, t.config.Row.Padding.Global.Bottom); err != nil { + return err + } + } + + if cfg.Settings.Separators.BetweenRows.Enabled() && !isLastRow { + ctx.logger.Debug("Rendering between-rows separator after logical row %d", i) + respCurrent := t.buildCellContexts(ctx, mctx, hctx, colAligns, colPadding) + + var nextCellsForSeparator map[int]tw.CellContext = nil + nextRowIdx := i + 1 + if nextRowIdx < len(ctx.rowLines) && nextRowIdx < len(mctx.rowMerges) { + hctxNext := &helperContext{position: tw.Row, rowIdx: nextRowIdx, location: tw.LocationMiddle} + nextRowActualLines := ctx.rowLines[nextRowIdx] + nextRowMerges := mctx.rowMerges[nextRowIdx] + + if t.config.Row.Padding.Global.Top != tw.Empty { + hctxNext.lineIdx = -1 + hctxNext.line = t.buildPaddingLineContents(t.config.Row.Padding.Global.Top, ctx.widths[tw.Row], ctx.numCols, nextRowMerges) + } else if len(nextRowActualLines) > 0 { + hctxNext.lineIdx = 0 + hctxNext.line = padLine(nextRowActualLines[0], ctx.numCols) + } else { + hctxNext.lineIdx = 0 + hctxNext.line = make([]string, ctx.numCols) + } + respNext := t.buildCellContexts(ctx, mctx, hctxNext, colAligns, colPadding) + nextCellsForSeparator = respNext.cells + } else { + ctx.logger.Debug("Separator context: No next logical row for separator after row %d.", i) + } + + f.Line(tw.Formatting{ + Row: tw.RowContext{ + Widths: ctx.widths[tw.Row], + Current: respCurrent.cells, + Previous: respCurrent.prevCells, + Next: nextCellsForSeparator, + Position: tw.Row, + Location: tw.LocationMiddle, + ColMaxWidths: t.getColMaxWidths(tw.Row), + }, + Level: tw.LevelBody, + IsSubRow: false, + HasFooter: footerExists, + }) + } + } + return nil +} diff --git a/vendor/github.com/olekukonko/tablewriter/tw/cell.go b/vendor/github.com/olekukonko/tablewriter/tw/cell.go new file mode 100644 index 0000000..0547f01 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/tw/cell.go @@ -0,0 +1,64 @@ +package tw + +// CellFormatting holds formatting options for table cells. +type CellFormatting struct { + AutoWrap int // Wrapping behavior (e.g., WrapTruncate, WrapNormal) + MergeMode int // Bitmask for merge behavior (e.g., MergeHorizontal, MergeVertical) + + // Changed form bool to State + // See https://github.com/olekukonko/tablewriter/issues/261 + AutoFormat State // Enables automatic formatting (e.g., title case for headers) + + // Deprecated: kept for compatibility + // will be removed soon + Alignment Align // Text alignment within the cell (e.g., Left, Right, Center) + +} + +// CellPadding defines padding settings for table cells. +type CellPadding struct { + Global Padding // Default padding applied to all cells + PerColumn []Padding // Column-specific padding overrides +} + +// CellFilter defines filtering functions for cell content. +type CellFilter struct { + Global func([]string) []string // Processes the entire row + PerColumn []func(string) string // Processes individual cells by column +} + +// CellCallbacks holds callback functions for cell processing. +// Note: These are currently placeholders and not fully implemented. +type CellCallbacks struct { + Global func() // Global callback applied to all cells + PerColumn []func() // Column-specific callbacks +} + +// CellAlignment defines alignment settings for table cells. +type CellAlignment struct { + Global Align // Default alignment applied to all cells + PerColumn []Align // Column-specific alignment overrides +} + +// CellConfig combines formatting, padding, and callback settings for a table section. +type CellConfig struct { + Formatting CellFormatting // Cell formatting options + Padding CellPadding // Padding configuration + Callbacks CellCallbacks // Callback functions (unused) + Filter CellFilter // Function to filter cell content (renamed from Filter Filter) + Alignment CellAlignment // Alignment configuration for cells + ColMaxWidths CellWidth // Per-column maximum width overrides + + // Deprecated: use Alignment.PerColumn instead. Will be removed in a future version. + // will be removed soon + ColumnAligns []Align // Per-column alignment overrides +} + +type CellWidth struct { + Global int + PerColumn Mapper[int, int] +} + +func (c CellWidth) Constrained() bool { + return c.Global > 0 || c.PerColumn.Len() > 0 +} diff --git a/vendor/github.com/olekukonko/tablewriter/tw/deprecated.go b/vendor/github.com/olekukonko/tablewriter/tw/deprecated.go new file mode 100644 index 0000000..3325765 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/tw/deprecated.go @@ -0,0 +1,137 @@ +package tw + +// Deprecated: SymbolASCII is deprecated; use Glyphs with StyleASCII instead. +// this will be removed soon +type SymbolASCII struct{} + +// SymbolASCII symbol methods +func (s *SymbolASCII) Name() string { return StyleNameASCII.String() } +func (s *SymbolASCII) Center() string { return "+" } +func (s *SymbolASCII) Row() string { return "-" } +func (s *SymbolASCII) Column() string { return "|" } +func (s *SymbolASCII) TopLeft() string { return "+" } +func (s *SymbolASCII) TopMid() string { return "+" } +func (s *SymbolASCII) TopRight() string { return "+" } +func (s *SymbolASCII) MidLeft() string { return "+" } +func (s *SymbolASCII) MidRight() string { return "+" } +func (s *SymbolASCII) BottomLeft() string { return "+" } +func (s *SymbolASCII) BottomMid() string { return "+" } +func (s *SymbolASCII) BottomRight() string { return "+" } +func (s *SymbolASCII) HeaderLeft() string { return "+" } +func (s *SymbolASCII) HeaderMid() string { return "+" } +func (s *SymbolASCII) HeaderRight() string { return "+" } + +// Deprecated: SymbolUnicode is deprecated; use Glyphs with appropriate styles (e.g., StyleLight, StyleHeavy) instead. +// this will be removed soon +type SymbolUnicode struct { + row string + column string + center string + corners [9]string // [topLeft, topMid, topRight, midLeft, center, midRight, bottomLeft, bottomMid, bottomRight] +} + +// SymbolUnicode symbol methods +func (s *SymbolUnicode) Name() string { return "unicode" } +func (s *SymbolUnicode) Center() string { return s.center } +func (s *SymbolUnicode) Row() string { return s.row } +func (s *SymbolUnicode) Column() string { return s.column } +func (s *SymbolUnicode) TopLeft() string { return s.corners[0] } +func (s *SymbolUnicode) TopMid() string { return s.corners[1] } +func (s *SymbolUnicode) TopRight() string { return s.corners[2] } +func (s *SymbolUnicode) MidLeft() string { return s.corners[3] } +func (s *SymbolUnicode) MidRight() string { return s.corners[5] } +func (s *SymbolUnicode) BottomLeft() string { return s.corners[6] } +func (s *SymbolUnicode) BottomMid() string { return s.corners[7] } +func (s *SymbolUnicode) BottomRight() string { return s.corners[8] } +func (s *SymbolUnicode) HeaderLeft() string { return s.MidLeft() } +func (s *SymbolUnicode) HeaderMid() string { return s.Center() } +func (s *SymbolUnicode) HeaderRight() string { return s.MidRight() } + +// Deprecated: SymbolMarkdown is deprecated; use Glyphs with StyleMarkdown instead. +// this will be removed soon +type SymbolMarkdown struct{} + +// SymbolMarkdown symbol methods +func (s *SymbolMarkdown) Name() string { return StyleNameMarkdown.String() } +func (s *SymbolMarkdown) Center() string { return "|" } +func (s *SymbolMarkdown) Row() string { return "-" } +func (s *SymbolMarkdown) Column() string { return "|" } +func (s *SymbolMarkdown) TopLeft() string { return "" } +func (s *SymbolMarkdown) TopMid() string { return "" } +func (s *SymbolMarkdown) TopRight() string { return "" } +func (s *SymbolMarkdown) MidLeft() string { return "|" } +func (s *SymbolMarkdown) MidRight() string { return "|" } +func (s *SymbolMarkdown) BottomLeft() string { return "" } +func (s *SymbolMarkdown) BottomMid() string { return "" } +func (s *SymbolMarkdown) BottomRight() string { return "" } +func (s *SymbolMarkdown) HeaderLeft() string { return "|" } +func (s *SymbolMarkdown) HeaderMid() string { return "|" } +func (s *SymbolMarkdown) HeaderRight() string { return "|" } + +// Deprecated: SymbolNothing is deprecated; use Glyphs with StyleNone instead. +// this will be removed soon +type SymbolNothing struct{} + +// SymbolNothing symbol methods +func (s *SymbolNothing) Name() string { return StyleNameNothing.String() } +func (s *SymbolNothing) Center() string { return "" } +func (s *SymbolNothing) Row() string { return "" } +func (s *SymbolNothing) Column() string { return "" } +func (s *SymbolNothing) TopLeft() string { return "" } +func (s *SymbolNothing) TopMid() string { return "" } +func (s *SymbolNothing) TopRight() string { return "" } +func (s *SymbolNothing) MidLeft() string { return "" } +func (s *SymbolNothing) MidRight() string { return "" } +func (s *SymbolNothing) BottomLeft() string { return "" } +func (s *SymbolNothing) BottomMid() string { return "" } +func (s *SymbolNothing) BottomRight() string { return "" } +func (s *SymbolNothing) HeaderLeft() string { return "" } +func (s *SymbolNothing) HeaderMid() string { return "" } +func (s *SymbolNothing) HeaderRight() string { return "" } + +// Deprecated: SymbolGraphical is deprecated; use Glyphs with StyleGraphical instead. +// this will be removed soon +type SymbolGraphical struct{} + +// SymbolGraphical symbol methods +func (s *SymbolGraphical) Name() string { return StyleNameGraphical.String() } +func (s *SymbolGraphical) Center() string { return "🟧" } // Orange square (matches mid junctions) +func (s *SymbolGraphical) Row() string { return "🟥" } // Red square (matches corners) +func (s *SymbolGraphical) Column() string { return "🟦" } // Blue square (vertical line) +func (s *SymbolGraphical) TopLeft() string { return "🟥" } // Top-left corner +func (s *SymbolGraphical) TopMid() string { return "🔳" } // Top junction +func (s *SymbolGraphical) TopRight() string { return "🟥" } // Top-right corner +func (s *SymbolGraphical) MidLeft() string { return "🟧" } // Left junction +func (s *SymbolGraphical) MidRight() string { return "🟧" } // Right junction +func (s *SymbolGraphical) BottomLeft() string { return "🟥" } // Bottom-left corner +func (s *SymbolGraphical) BottomMid() string { return "🔳" } // Bottom junction +func (s *SymbolGraphical) BottomRight() string { return "🟥" } // Bottom-right corner +func (s *SymbolGraphical) HeaderLeft() string { return "🟧" } // Header left (matches mid junctions) +func (s *SymbolGraphical) HeaderMid() string { return "🟧" } // Header middle (matches mid junctions) +func (s *SymbolGraphical) HeaderRight() string { return "🟧" } // Header right (matches mid junctions) + +// Deprecated: SymbolMerger is deprecated; use Glyphs with StyleMerger instead. +// this will be removed soon +type SymbolMerger struct { + row string + column string + center string + corners [9]string // [TL, TM, TR, ML, CenterIdx(unused), MR, BL, BM, BR] +} + +// SymbolMerger symbol methods +func (s *SymbolMerger) Name() string { return StyleNameMerger.String() } +func (s *SymbolMerger) Center() string { return s.center } // Main crossing symbol +func (s *SymbolMerger) Row() string { return s.row } +func (s *SymbolMerger) Column() string { return s.column } +func (s *SymbolMerger) TopLeft() string { return s.corners[0] } +func (s *SymbolMerger) TopMid() string { return s.corners[1] } // LevelHeader junction +func (s *SymbolMerger) TopRight() string { return s.corners[2] } +func (s *SymbolMerger) MidLeft() string { return s.corners[3] } // Left junction +func (s *SymbolMerger) MidRight() string { return s.corners[5] } // Right junction +func (s *SymbolMerger) BottomLeft() string { return s.corners[6] } +func (s *SymbolMerger) BottomMid() string { return s.corners[7] } // LevelFooter junction +func (s *SymbolMerger) BottomRight() string { return s.corners[8] } +func (s *SymbolMerger) HeaderLeft() string { return s.MidLeft() } +func (s *SymbolMerger) HeaderMid() string { return s.Center() } +func (s *SymbolMerger) HeaderRight() string { return s.MidRight() } diff --git a/vendor/github.com/olekukonko/tablewriter/tw/fn.go b/vendor/github.com/olekukonko/tablewriter/tw/fn.go new file mode 100644 index 0000000..9610b27 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/tw/fn.go @@ -0,0 +1,363 @@ +// Package tw provides utility functions for text formatting, width calculation, and string manipulation +// specifically tailored for table rendering, including handling ANSI escape codes and Unicode text. +package tw + +import ( + "bytes" // For buffering string output + "github.com/mattn/go-runewidth" // For calculating display width of Unicode characters + "math" // For mathematical operations like ceiling + "regexp" // For regular expression handling of ANSI codes + "strconv" // For string-to-number conversions + "strings" // For string manipulation utilities + "unicode" // For Unicode character classification + "unicode/utf8" // For UTF-8 rune handling +) + +// ansi is a compiled regex pattern used to strip ANSI escape codes. +// These codes are used in terminal output for styling and are invisible in rendered text. +var ansi = CompileANSIFilter() + +// CompileANSIFilter constructs and compiles a regex for matching ANSI sequences. +// It supports both control sequences (CSI) and operating system commands (OSC) like hyperlinks. +func CompileANSIFilter() *regexp.Regexp { + var regESC = "\x1b" // ASCII escape character + var regBEL = "\x07" // ASCII bell character + + // ANSI string terminator: either ESC+\ or BEL + var regST = "(" + regexp.QuoteMeta(regESC+"\\") + "|" + regexp.QuoteMeta(regBEL) + ")" + // Control Sequence Introducer (CSI): ESC[ followed by parameters and a final byte + var regCSI = regexp.QuoteMeta(regESC+"[") + "[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]" + // Operating System Command (OSC): ESC] followed by arbitrary content until a terminator + var regOSC = regexp.QuoteMeta(regESC+"]") + ".*?" + regST + + // Combine CSI and OSC patterns into a single regex + return regexp.MustCompile("(" + regCSI + "|" + regOSC + ")") +} + +// DisplayWidth calculates the visual width of a string, excluding ANSI escape sequences. +// It uses go-runewidth to handle Unicode characters correctly. +func DisplayWidth(str string) int { + // Strip ANSI codes before calculating width to avoid counting invisible characters + return runewidth.StringWidth(ansi.ReplaceAllLiteralString(str, "")) +} + +// TruncateString shortens a string to a specified maximum display width while preserving ANSI color codes. +// An optional suffix (e.g., "...") is appended if truncation occurs. +func TruncateString(s string, maxWidth int, suffix ...string) string { + // If maxWidth is 0 or negative, return an empty string + if maxWidth <= 0 { + return "" + } + + // Join suffix slices into a single string and calculate its display width + suffixStr := strings.Join(suffix, " ") + suffixDisplayWidth := 0 + if len(suffixStr) > 0 { + // Strip ANSI from suffix for accurate width calculation + suffixDisplayWidth = runewidth.StringWidth(ansi.ReplaceAllLiteralString(suffixStr, "")) + } + + // Check if the string (without ANSI) plus suffix fits within maxWidth + strippedS := ansi.ReplaceAllLiteralString(s, "") + if runewidth.StringWidth(strippedS)+suffixDisplayWidth <= maxWidth { + // If it fits, return the original string (with ANSI) plus suffix + return s + suffixStr + } + + // Handle edge case: maxWidth is too small for even the suffix + if maxWidth < suffixDisplayWidth { + // Try truncating the string without suffix + return TruncateString(s, maxWidth) // Recursive call without suffix + } + // Handle edge case: maxWidth exactly equals suffix width + if maxWidth == suffixDisplayWidth { + if runewidth.StringWidth(strippedS) > 0 { + // If there's content, it's fully truncated; return suffix + return suffixStr + } + return "" // No content and no space for content; return empty string + } + + // Calculate the maximum width available for the content (excluding suffix) + targetContentDisplayWidth := maxWidth - suffixDisplayWidth + + var contentBuf bytes.Buffer // Buffer for building truncated content + var currentContentDisplayWidth int // Tracks display width of content + var ansiSeqBuf bytes.Buffer // Buffer for collecting ANSI sequences + inAnsiSequence := false // Tracks if we're inside an ANSI sequence + + // Iterate over runes to build content while respecting maxWidth + for _, r := range s { + if r == '\x1b' { // Start of ANSI escape sequence + if inAnsiSequence { + // Unexpected new ESC; flush existing sequence + contentBuf.Write(ansiSeqBuf.Bytes()) + ansiSeqBuf.Reset() + } + inAnsiSequence = true + ansiSeqBuf.WriteRune(r) + } else if inAnsiSequence { + ansiSeqBuf.WriteRune(r) + // Detect end of common ANSI sequences (e.g., SGR 'm' or CSI terminators) + if r == 'm' || (ansiSeqBuf.Len() > 2 && ansiSeqBuf.Bytes()[1] == '[' && r >= '@' && r <= '~') { + inAnsiSequence = false + contentBuf.Write(ansiSeqBuf.Bytes()) // Append completed sequence + ansiSeqBuf.Reset() + } else if ansiSeqBuf.Len() > 128 { // Prevent buffer overflow for malformed sequences + inAnsiSequence = false + contentBuf.Write(ansiSeqBuf.Bytes()) + ansiSeqBuf.Reset() + } + } else { + // Handle displayable characters + runeDisplayWidth := runewidth.RuneWidth(r) + if currentContentDisplayWidth+runeDisplayWidth > targetContentDisplayWidth { + // Adding this rune would exceed the content width; stop here + break + } + contentBuf.WriteRune(r) + currentContentDisplayWidth += runeDisplayWidth + } + } + + // Append any unterminated ANSI sequence + if ansiSeqBuf.Len() > 0 { + contentBuf.Write(ansiSeqBuf.Bytes()) + } + + finalContent := contentBuf.String() + + // Append suffix if content was truncated or if suffix is provided and content exists + if runewidth.StringWidth(ansi.ReplaceAllLiteralString(finalContent, "")) < runewidth.StringWidth(strippedS) { + // Content was truncated; append suffix + return finalContent + suffixStr + } else if len(suffixStr) > 0 && len(finalContent) > 0 { + // No truncation but suffix exists; append it + return finalContent + suffixStr + } else if len(suffixStr) > 0 && len(strippedS) == 0 { + // Original string was empty; return suffix + return suffixStr + } + + // Return content as is (with preserved ANSI codes) + return finalContent +} + +// Title normalizes and uppercases a label string for use in headers. +// It replaces underscores and certain dots with spaces and trims whitespace. +func Title(name string) string { + origLen := len(name) + rs := []rune(name) + for i, r := range rs { + switch r { + case '_': + rs[i] = ' ' // Replace underscores with spaces + case '.': + // Replace dots with spaces unless they are between numeric or space characters + if (i != 0 && !IsIsNumericOrSpace(rs[i-1])) || (i != len(rs)-1 && !IsIsNumericOrSpace(rs[i+1])) { + rs[i] = ' ' + } + } + } + name = string(rs) + name = strings.TrimSpace(name) + // If the input was non-empty but trimmed to empty, return a single space + if len(name) == 0 && origLen > 0 { + name = " " + } + // Convert to uppercase for header formatting + return strings.ToUpper(name) +} + +// PadCenter centers a string within a specified width using a padding character. +// Extra padding is split between left and right, with slight preference to left if uneven. +func PadCenter(s, pad string, width int) string { + gap := width - DisplayWidth(s) + if gap > 0 { + // Calculate left and right padding; ceil ensures left gets extra if gap is odd + gapLeft := int(math.Ceil(float64(gap) / 2)) + gapRight := gap - gapLeft + return strings.Repeat(pad, gapLeft) + s + strings.Repeat(pad, gapRight) + } + // If no padding needed or string is too wide, return as is + return s +} + +// PadRight left-aligns a string within a specified width, filling remaining space on the right with padding. +func PadRight(s, pad string, width int) string { + gap := width - DisplayWidth(s) + if gap > 0 { + // Append padding to the right + return s + strings.Repeat(pad, gap) + } + // If no padding needed or string is too wide, return as is + return s +} + +// PadLeft right-aligns a string within a specified width, filling remaining space on the left with padding. +func PadLeft(s, pad string, width int) string { + gap := width - DisplayWidth(s) + if gap > 0 { + // Prepend padding to the left + return strings.Repeat(pad, gap) + s + } + // If no padding needed or string is too wide, return as is + return s +} + +// Pad aligns a string within a specified width using a padding character. +// It truncates if the string is wider than the target width. +func Pad(s string, padChar string, totalWidth int, alignment Align) string { + sDisplayWidth := DisplayWidth(s) + if sDisplayWidth > totalWidth { + return TruncateString(s, totalWidth) // Only truncate if necessary + } + switch alignment { + case AlignLeft: + return PadRight(s, padChar, totalWidth) + case AlignRight: + return PadLeft(s, padChar, totalWidth) + case AlignCenter: + return PadCenter(s, padChar, totalWidth) + default: + return PadRight(s, padChar, totalWidth) + } +} + +// IsIsNumericOrSpace checks if a rune is a digit or space character. +// Used in formatting logic to determine safe character replacements. +func IsIsNumericOrSpace(r rune) bool { + return ('0' <= r && r <= '9') || r == ' ' +} + +// IsNumeric checks if a string represents a valid integer or floating-point number. +func IsNumeric(s string) bool { + s = strings.TrimSpace(s) + if s == "" { + return false + } + // Try parsing as integer first + if _, err := strconv.Atoi(s); err == nil { + return true + } + // Then try parsing as float + _, err := strconv.ParseFloat(s, 64) + return err == nil +} + +// SplitCamelCase splits a camelCase or PascalCase or snake_case string into separate words. +// It detects transitions between uppercase, lowercase, digits, and other characters. +func SplitCamelCase(src string) (entries []string) { + // Validate UTF-8 input; return as single entry if invalid + if !utf8.ValidString(src) { + return []string{src} + } + entries = []string{} + var runes [][]rune + lastClass := 0 + class := 0 + // Classify each rune into categories: lowercase (1), uppercase (2), digit (3), other (4) + for _, r := range src { + switch { + case unicode.IsLower(r): + class = 1 + case unicode.IsUpper(r): + class = 2 + case unicode.IsDigit(r): + class = 3 + default: + class = 4 + } + // Group consecutive runes of the same class together + if class == lastClass { + runes[len(runes)-1] = append(runes[len(runes)-1], r) + } else { + runes = append(runes, []rune{r}) + } + lastClass = class + } + // Adjust for cases where an uppercase letter is followed by lowercase (e.g., CamelCase) + for i := 0; i < len(runes)-1; i++ { + if unicode.IsUpper(runes[i][0]) && unicode.IsLower(runes[i+1][0]) { + // Move the last uppercase rune to the next group for proper word splitting + runes[i+1] = append([]rune{runes[i][len(runes[i])-1]}, runes[i+1]...) + runes[i] = runes[i][:len(runes[i])-1] + } + } + // Convert rune groups to strings, excluding empty, underscore or whitespace-only groups + for _, s := range runes { + str := string(s) + if len(s) > 0 && strings.TrimSpace(str) != "" && str != "_" { + entries = append(entries, str) + } + } + return +} + +// Or provides a ternary-like operation for strings, returning 'valid' if cond is true, else 'inValid'. +func Or(cond bool, valid, inValid string) string { + if cond { + return valid + } + return inValid +} + +// Max returns the greater of two integers. +func Max(a, b int) int { + if a > b { + return a + } + return b +} + +// Min returns the smaller of two integers. +func Min(a, b int) int { + if a < b { + return a + } + return b +} + +// BreakPoint finds the rune index where the display width of a string first exceeds the specified limit. +// It returns the number of runes if the entire string fits, or 0 if nothing fits. +func BreakPoint(s string, limit int) int { + // If limit is 0 or negative, nothing can fit + if limit <= 0 { + return 0 + } + // Empty string has a breakpoint of 0 + if s == "" { + return 0 + } + + currentWidth := 0 + runeCount := 0 + // Iterate over runes, accumulating display width + for _, r := range s { + runeWidth := DisplayWidth(string(r)) // Calculate width of individual rune + if currentWidth+runeWidth > limit { + // Adding this rune would exceed the limit; breakpoint is before this rune + if currentWidth == 0 { + // First rune is too wide; allow breaking after it if limit > 0 + if runeWidth > limit && limit > 0 { + return 1 + } + return 0 + } + return runeCount + } + currentWidth += runeWidth + runeCount++ + } + + // Entire string fits within the limit + return runeCount +} + +func MakeAlign(l int, align Align) Alignment { + aa := make(Alignment, l) + for i := 0; i < l; i++ { + aa[i] = align + } + return aa +} diff --git a/vendor/github.com/olekukonko/tablewriter/tw/mapper.go b/vendor/github.com/olekukonko/tablewriter/tw/mapper.go new file mode 100644 index 0000000..8d81444 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/tw/mapper.go @@ -0,0 +1,220 @@ +package tw + +import ( + "fmt" + "sort" +) + +// KeyValuePair represents a single key-value pair from a Mapper. +type KeyValuePair[K comparable, V any] struct { + Key K + Value V +} + +// Mapper is a generic map type with comparable keys and any value type. +// It provides type-safe operations on maps with additional convenience methods. +type Mapper[K comparable, V any] map[K]V + +// NewMapper creates and returns a new initialized Mapper. +func NewMapper[K comparable, V any]() Mapper[K, V] { + return make(Mapper[K, V]) +} + +// Get returns the value associated with the key. +// If the key doesn't exist or the map is nil, it returns the zero value for the value type. +func (m Mapper[K, V]) Get(key K) V { + if m == nil { + var zero V + return zero + } + return m[key] +} + +// OK returns the value associated with the key and a boolean indicating whether the key exists. +func (m Mapper[K, V]) OK(key K) (V, bool) { + if m == nil { + var zero V + return zero, false + } + val, ok := m[key] + return val, ok +} + +// Set sets the value for the specified key. +// Does nothing if the map is nil. +func (m Mapper[K, V]) Set(key K, value V) Mapper[K, V] { + if m != nil { + m[key] = value + } + return m +} + +// Delete removes the specified key from the map. +// Does nothing if the key doesn't exist or the map is nil. +func (m Mapper[K, V]) Delete(key K) Mapper[K, V] { + if m != nil { + delete(m, key) + } + return m +} + +// Has returns true if the key exists in the map, false otherwise. +func (m Mapper[K, V]) Has(key K) bool { + if m == nil { + return false + } + _, exists := m[key] + return exists +} + +// Len returns the number of elements in the map. +// Returns 0 if the map is nil. +func (m Mapper[K, V]) Len() int { + if m == nil { + return 0 + } + return len(m) +} + +// Keys returns a slice containing all keys in the map. +// Returns nil if the map is nil or empty. +func (m Mapper[K, V]) Keys() []K { + if m == nil { + return nil + } + keys := make([]K, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + return keys +} + +func (m Mapper[K, V]) Clear() { + if m == nil { + return + } + for k := range m { + delete(m, k) + } +} + +// Values returns a slice containing all values in the map. +// Returns nil if the map is nil or empty. +func (m Mapper[K, V]) Values() []V { + if m == nil { + return nil + } + values := make([]V, 0, len(m)) + for _, v := range m { + values = append(values, v) + } + return values +} + +// Each iterates over each key-value pair in the map and calls the provided function. +// Does nothing if the map is nil. +func (m Mapper[K, V]) Each(fn func(K, V)) { + if m != nil { + for k, v := range m { + fn(k, v) + } + } +} + +// Filter returns a new Mapper containing only the key-value pairs that satisfy the predicate. +func (m Mapper[K, V]) Filter(fn func(K, V) bool) Mapper[K, V] { + result := NewMapper[K, V]() + if m != nil { + for k, v := range m { + if fn(k, v) { + result[k] = v + } + } + } + return result +} + +// MapValues returns a new Mapper with the same keys but values transformed by the provided function. +func (m Mapper[K, V]) MapValues(fn func(V) V) Mapper[K, V] { + result := NewMapper[K, V]() + if m != nil { + for k, v := range m { + result[k] = fn(v) + } + } + return result +} + +// Clone returns a shallow copy of the Mapper. +func (m Mapper[K, V]) Clone() Mapper[K, V] { + result := NewMapper[K, V]() + if m != nil { + for k, v := range m { + result[k] = v + } + } + return result +} + +// Slicer converts the Mapper to a Slicer of key-value pairs. +func (m Mapper[K, V]) Slicer() Slicer[KeyValuePair[K, V]] { + if m == nil { + return nil + } + result := make(Slicer[KeyValuePair[K, V]], 0, len(m)) + for k, v := range m { + result = append(result, KeyValuePair[K, V]{Key: k, Value: v}) + } + return result +} + +func (m Mapper[K, V]) SortedKeys() []K { + keys := make([]K, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + + sort.Slice(keys, func(i, j int) bool { + a, b := any(keys[i]), any(keys[j]) + + switch va := a.(type) { + case int: + if vb, ok := b.(int); ok { + return va < vb + } + case int32: + if vb, ok := b.(int32); ok { + return va < vb + } + case int64: + if vb, ok := b.(int64); ok { + return va < vb + } + case uint: + if vb, ok := b.(uint); ok { + return va < vb + } + case uint64: + if vb, ok := b.(uint64); ok { + return va < vb + } + case float32: + if vb, ok := b.(float32); ok { + return va < vb + } + case float64: + if vb, ok := b.(float64); ok { + return va < vb + } + case string: + if vb, ok := b.(string); ok { + return va < vb + } + } + + // fallback to string comparison + return fmt.Sprintf("%v", a) < fmt.Sprintf("%v", b) + }) + + return keys +} diff --git a/vendor/github.com/olekukonko/tablewriter/tw/preset.go b/vendor/github.com/olekukonko/tablewriter/tw/preset.go new file mode 100644 index 0000000..acadc25 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/tw/preset.go @@ -0,0 +1,18 @@ +package tw + +// BorderNone defines a border configuration with all sides disabled. +var ( + // PaddingNone represents explicitly empty padding (no spacing on any side) + // Equivalent to Padding{Overwrite: true} + PaddingNone = Padding{Left: Empty, Right: Empty, Top: Empty, Bottom: Empty, Overwrite: true} + BorderNone = Border{Left: Off, Right: Off, Top: Off, Bottom: Off} + LinesNone = Lines{ShowTop: Off, ShowBottom: Off, ShowHeaderLine: Off, ShowFooterLine: Off} + SeparatorsNone = Separators{ShowHeader: Off, ShowFooter: Off, BetweenRows: Off, BetweenColumns: Off} +) + +var ( + + // PaddingDefault represents standard single-space padding on left/right + // Equivalent to Padding{Left: " ", Right: " ", Overwrite: true} + PaddingDefault = Padding{Left: " ", Right: " ", Overwrite: true} +) diff --git a/vendor/github.com/olekukonko/tablewriter/tw/renderer.go b/vendor/github.com/olekukonko/tablewriter/tw/renderer.go new file mode 100644 index 0000000..6caf05e --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/tw/renderer.go @@ -0,0 +1,125 @@ +package tw + +import ( + "github.com/olekukonko/ll" + "io" +) + +// Renderer defines the interface for rendering tables to an io.Writer. +// Implementations must handle headers, rows, footers, and separator lines. +type Renderer interface { + Start(w io.Writer) error + Header(headers [][]string, ctx Formatting) // Renders table header + Row(row []string, ctx Formatting) // Renders a single row + Footer(footers [][]string, ctx Formatting) // Renders table footer + Line(ctx Formatting) // Renders separator line + Config() Rendition // Returns renderer config + Close() error // Gets Rendition form Blueprint + Logger(logger *ll.Logger) // send logger to renderers +} + +// Rendition holds the configuration for the default renderer. +type Rendition struct { + Borders Border // Border visibility settings + Symbols Symbols // Symbols used for table drawing + Settings Settings // Rendering behavior settings + Streaming bool +} + +// Renditioning has a method to update its rendition. +// Let's define an optional interface for this. +type Renditioning interface { + Rendition(r Rendition) +} + +// Formatting encapsulates the complete formatting context for a table row. +// It provides all necessary information to render a row correctly within the table structure. +type Formatting struct { + Row RowContext // Detailed configuration for the row and its cells + Level Level // Hierarchical level (Header, Body, Footer) affecting line drawing + HasFooter bool // Indicates if the table includes a footer section + IsSubRow bool // Marks this as a continuation or padding line in multi-line rows + NormalizedWidths Mapper[int, int] +} + +// CellContext defines the properties and formatting state of an individual table cell. +type CellContext struct { + Data string // Content to be displayed in the cell, provided by the caller + Align Align // Text alignment within the cell (Left, Right, Center, Skip) + Padding Padding // Padding characters surrounding the cell content + Width int // Suggested width (often overridden by Row.Widths) + Merge MergeState // Details about cell spanning across rows or columns +} + +// MergeState captures how a cell merges across different directions. +type MergeState struct { + Vertical MergeStateOption // Properties for vertical merging (across rows) + Horizontal MergeStateOption // Properties for horizontal merging (across columns) + Hierarchical MergeStateOption // Properties for nested/hierarchical merging +} + +// MergeStateOption represents common attributes for merging in a specific direction. +type MergeStateOption struct { + Present bool // True if this merge direction is active + Span int // Number of cells this merge spans + Start bool // True if this cell is the starting point of the merge + End bool // True if this cell is the ending point of the merge +} + +// RowContext manages layout properties and relationships for a row and its columns. +// It maintains state about the current row and its neighbors for proper rendering. +type RowContext struct { + Position Position // Section of the table (Header, Row, Footer) + Location Location // Boundary position (First, Middle, End) + Current map[int]CellContext // Cells in this row, indexed by column + Previous map[int]CellContext // Cells from the row above; nil if none + Next map[int]CellContext // Cells from the row below; nil if none + Widths Mapper[int, int] // Computed widths for each column + ColMaxWidths CellWidth // Maximum allowed width per column +} + +func (r RowContext) GetCell(col int) CellContext { + return r.Current[col] +} + +// Separators controls the visibility of separators in the table. +type Separators struct { + ShowHeader State // Controls header separator visibility + ShowFooter State // Controls footer separator visibility + BetweenRows State // Determines if lines appear between rows + BetweenColumns State // Determines if separators appear between columns +} + +// Lines manages the visibility of table boundary lines. +type Lines struct { + ShowTop State // Top border visibility + ShowBottom State // Bottom border visibility + ShowHeaderLine State // Header separator line visibility + ShowFooterLine State // Footer separator line visibility +} + +// Settings holds configuration preferences for rendering behavior. +type Settings struct { + Separators Separators // Separator visibility settings + Lines Lines // Line visibility settings + CompactMode State // Reserved for future compact rendering (unused) + // Cushion State +} + +// Border defines the visibility states of table borders. +type Border struct { + Left State // Left border visibility + Right State // Right border visibility + Top State // Top border visibility + Bottom State // Bottom border visibility + Overwrite bool +} + +type StreamConfig struct { + Enable bool + + // Deprecated: Use top-level Config.Widths for streaming width control. + // This field will be removed in a future version. It will be respected if + // Config.Widths is not set and this field is. + Widths CellWidth +} diff --git a/vendor/github.com/olekukonko/tablewriter/tw/slicer.go b/vendor/github.com/olekukonko/tablewriter/tw/slicer.go new file mode 100644 index 0000000..34d2463 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/tw/slicer.go @@ -0,0 +1,147 @@ +package tw + +// Slicer is a generic slice type that provides additional methods for slice manipulation. +type Slicer[T any] []T + +// NewSlicer creates and returns a new initialized Slicer. +func NewSlicer[T any]() Slicer[T] { + return make(Slicer[T], 0) +} + +// Get returns the element at the specified index. +// Returns the zero value if the index is out of bounds or the slice is nil. +func (s Slicer[T]) Get(index int) T { + if s == nil || index < 0 || index >= len(s) { + var zero T + return zero + } + return s[index] +} + +// GetOK returns the element at the specified index and a boolean indicating whether the index was valid. +func (s Slicer[T]) GetOK(index int) (T, bool) { + if s == nil || index < 0 || index >= len(s) { + var zero T + return zero, false + } + return s[index], true +} + +// Append appends elements to the slice and returns the new slice. +func (s Slicer[T]) Append(elements ...T) Slicer[T] { + return append(s, elements...) +} + +// Prepend adds elements to the beginning of the slice and returns the new slice. +func (s Slicer[T]) Prepend(elements ...T) Slicer[T] { + return append(elements, s...) +} + +// Len returns the number of elements in the slice. +// Returns 0 if the slice is nil. +func (s Slicer[T]) Len() int { + if s == nil { + return 0 + } + return len(s) +} + +// IsEmpty returns true if the slice is nil or has zero elements. +func (s Slicer[T]) IsEmpty() bool { + return s.Len() == 0 +} + +// Has returns true if the index exists in the slice. +func (s Slicer[T]) Has(index int) bool { + return index >= 0 && index < s.Len() +} + +// First returns the first element of the slice, or the zero value if empty. +func (s Slicer[T]) First() T { + return s.Get(0) +} + +// Last returns the last element of the slice, or the zero value if empty. +func (s Slicer[T]) Last() T { + return s.Get(s.Len() - 1) +} + +// Each iterates over each element in the slice and calls the provided function. +// Does nothing if the slice is nil. +func (s Slicer[T]) Each(fn func(T)) { + if s != nil { + for _, v := range s { + fn(v) + } + } +} + +// Filter returns a new Slicer containing only elements that satisfy the predicate. +func (s Slicer[T]) Filter(fn func(T) bool) Slicer[T] { + result := NewSlicer[T]() + if s != nil { + for _, v := range s { + if fn(v) { + result = result.Append(v) + } + } + } + return result +} + +// Map returns a new Slicer with each element transformed by the provided function. +func (s Slicer[T]) Map(fn func(T) T) Slicer[T] { + result := NewSlicer[T]() + if s != nil { + for _, v := range s { + result = result.Append(fn(v)) + } + } + return result +} + +// Contains returns true if the slice contains an element that satisfies the predicate. +func (s Slicer[T]) Contains(fn func(T) bool) bool { + if s != nil { + for _, v := range s { + if fn(v) { + return true + } + } + } + return false +} + +// Find returns the first element that satisfies the predicate, along with a boolean indicating if it was found. +func (s Slicer[T]) Find(fn func(T) bool) (T, bool) { + if s != nil { + for _, v := range s { + if fn(v) { + return v, true + } + } + } + var zero T + return zero, false +} + +// Clone returns a shallow copy of the Slicer. +func (s Slicer[T]) Clone() Slicer[T] { + result := NewSlicer[T]() + if s != nil { + result = append(result, s...) + } + return result +} + +// SlicerToMapper converts a Slicer of KeyValuePair to a Mapper. +func SlicerToMapper[K comparable, V any](s Slicer[KeyValuePair[K, V]]) Mapper[K, V] { + result := make(Mapper[K, V]) + if s == nil { + return result + } + for _, pair := range s { + result[pair.Key] = pair.Value + } + return result +} diff --git a/vendor/github.com/olekukonko/tablewriter/tw/state.go b/vendor/github.com/olekukonko/tablewriter/tw/state.go new file mode 100644 index 0000000..7e48509 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/tw/state.go @@ -0,0 +1,51 @@ +package tw + +// State represents an on/off state +type State int + +// Public: Methods for State type + +// Enabled checks if the state is on +func (o State) Enabled() bool { return o == Success } + +// Default checks if the state is unknown +func (o State) Default() bool { return o == Unknown } + +// Disabled checks if the state is off +func (o State) Disabled() bool { return o == Fail } + +// Toggle switches the state between on and off +func (o State) Toggle() State { + if o == Fail { + return Success + } + return Fail +} + +// Cond executes a condition if the state is enabled +func (o State) Cond(c func() bool) bool { + if o.Enabled() { + return c() + } + return false +} + +// Or returns this state if enabled, else the provided state +func (o State) Or(c State) State { + if o.Enabled() { + return o + } + return c +} + +// String returns the string representation of the state +func (o State) String() string { + if o.Enabled() { + return "on" + } + + if o.Disabled() { + return "off" + } + return "undefined" +} diff --git a/vendor/github.com/olekukonko/tablewriter/tw/symbols.go b/vendor/github.com/olekukonko/tablewriter/tw/symbols.go new file mode 100644 index 0000000..3ee87fc --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/tw/symbols.go @@ -0,0 +1,1012 @@ +package tw + +import "fmt" + +// Symbols defines the interface for table border symbols +type Symbols interface { + // Name returns the style name + Name() string + + // Basic component symbols + Center() string // Junction symbol (where lines cross) + Row() string // Horizontal line symbol + Column() string // Vertical line symbol + + // Corner and junction symbols + TopLeft() string // LevelHeader-left corner + TopMid() string // LevelHeader junction + TopRight() string // LevelHeader-right corner + MidLeft() string // Left junction + MidRight() string // Right junction + BottomLeft() string // LevelFooter-left corner + BottomMid() string // LevelFooter junction + BottomRight() string // LevelFooter-right corner + + // Optional header-specific symbols + HeaderLeft() string + HeaderMid() string + HeaderRight() string +} + +// BorderStyle defines different border styling options +type BorderStyle int + +// Border style constants +const ( + StyleNone BorderStyle = iota + StyleASCII + StyleLight + StyleHeavy + StyleDouble + StyleDoubleLong + StyleLightHeavy + StyleHeavyLight + StyleLightDouble + StyleDoubleLight + StyleRounded + StyleMarkdown + StyleGraphical + StyleMerger + StyleDefault + StyleDotted + StyleArrow + StyleStarry + StyleHearts + StyleCircuit // Renamed from StyleTech + StyleNature + StyleArtistic + Style8Bit + StyleChaos + StyleDots + StyleBlocks + StyleZen + StyleVintage + StyleSketch + StyleArrowDouble + StyleCelestial + StyleCyber + StyleRunic + StyleIndustrial + StyleInk + StyleArcade + StyleBlossom + StyleFrosted + StyleMosaic + StyleUFO + StyleSteampunk + StyleGalaxy + StyleJazz + StylePuzzle + StyleHypno +) + +// StyleName defines names for border styles +type StyleName string + +func (s StyleName) String() string { + return string(s) +} + +const ( + StyleNameNothing StyleName = "nothing" + StyleNameASCII StyleName = "ascii" + StyleNameLight StyleName = "light" + StyleNameHeavy StyleName = "heavy" + StyleNameDouble StyleName = "double" + StyleNameDoubleLong StyleName = "doublelong" + StyleNameLightHeavy StyleName = "lightheavy" + StyleNameHeavyLight StyleName = "heavylight" + StyleNameLightDouble StyleName = "lightdouble" + StyleNameDoubleLight StyleName = "doublelight" + StyleNameRounded StyleName = "rounded" + StyleNameMarkdown StyleName = "markdown" + StyleNameGraphical StyleName = "graphical" + StyleNameMerger StyleName = "merger" + StyleNameDotted StyleName = "dotted" + StyleNameArrow StyleName = "arrow" + StyleNameStarry StyleName = "starry" + StyleNameHearts StyleName = "hearts" + StyleNameCircuit StyleName = "circuit" // Renamed from Tech + StyleNameNature StyleName = "nature" + StyleNameArtistic StyleName = "artistic" + StyleName8Bit StyleName = "8bit" + StyleNameChaos StyleName = "chaos" + StyleNameDots StyleName = "dots" + StyleNameBlocks StyleName = "blocks" + StyleNameZen StyleName = "zen" + StyleNameVintage StyleName = "vintage" + StyleNameSketch StyleName = "sketch" + StyleNameArrowDouble StyleName = "arrowdouble" + StyleNameCelestial StyleName = "celestial" + StyleNameCyber StyleName = "cyber" + StyleNameRunic StyleName = "runic" + StyleNameIndustrial StyleName = "industrial" + StyleNameInk StyleName = "ink" + StyleNameArcade StyleName = "arcade" + StyleNameBlossom StyleName = "blossom" + StyleNameFrosted StyleName = "frosted" + StyleNameMosaic StyleName = "mosaic" + StyleNameUFO StyleName = "ufo" + StyleNameSteampunk StyleName = "steampunk" + StyleNameGalaxy StyleName = "galaxy" + StyleNameJazz StyleName = "jazz" + StyleNamePuzzle StyleName = "puzzle" + StyleNameHypno StyleName = "hypno" +) + +// Styles maps BorderStyle to StyleName +var Styles = map[BorderStyle]StyleName{ + StyleNone: StyleNameNothing, + StyleASCII: StyleNameASCII, + StyleLight: StyleNameLight, + StyleHeavy: StyleNameHeavy, + StyleDouble: StyleNameDouble, + StyleDoubleLong: StyleNameDoubleLong, + StyleLightHeavy: StyleNameLightHeavy, + StyleHeavyLight: StyleNameHeavyLight, + StyleLightDouble: StyleNameLightDouble, + StyleDoubleLight: StyleNameDoubleLight, + StyleRounded: StyleNameRounded, + StyleMarkdown: StyleNameMarkdown, + StyleGraphical: StyleNameGraphical, + StyleMerger: StyleNameMerger, + StyleDefault: StyleNameLight, + StyleDotted: StyleNameDotted, + StyleArrow: StyleNameArrow, + StyleStarry: StyleNameStarry, + StyleHearts: StyleNameHearts, + StyleCircuit: StyleNameCircuit, + StyleNature: StyleNameNature, + StyleArtistic: StyleNameArtistic, + Style8Bit: StyleName8Bit, + StyleChaos: StyleNameChaos, + StyleDots: StyleNameDots, + StyleBlocks: StyleNameBlocks, + StyleZen: StyleNameZen, + StyleVintage: StyleNameVintage, + StyleSketch: StyleNameSketch, + StyleArrowDouble: StyleNameArrowDouble, + StyleCelestial: StyleNameCelestial, + StyleCyber: StyleNameCyber, + StyleRunic: StyleNameRunic, + StyleIndustrial: StyleNameIndustrial, + StyleInk: StyleNameInk, + StyleArcade: StyleNameArcade, + StyleBlossom: StyleNameBlossom, + StyleFrosted: StyleNameFrosted, + StyleMosaic: StyleNameMosaic, + StyleUFO: StyleNameUFO, + StyleSteampunk: StyleNameSteampunk, + StyleGalaxy: StyleNameGalaxy, + StyleJazz: StyleNameJazz, + StylePuzzle: StyleNamePuzzle, + StyleHypno: StyleNameHypno, +} + +// String returns the string representation of a border style +func (s BorderStyle) String() string { + return [...]string{ + "None", + "ASCII", + "Light", + "Heavy", + "Double", + "DoubleLong", + "LightHeavy", + "HeavyLight", + "LightDouble", + "DoubleLight", + "Rounded", + "Markdown", + "Graphical", + "Merger", + "Default", + "Dotted", + "Arrow", + "Starry", + "Hearts", + "Circuit", + "Nature", + "Artistic", + "8Bit", + "Chaos", + "Dots", + "Blocks", + "Zen", + "Vintage", + "Sketch", + "ArrowDouble", + "Celestial", + "Cyber", + "Runic", + "Industrial", + "Ink", + "Arcade", + "Blossom", + "Frosted", + "Mosaic", + "UFO", + "Steampunk", + "Galaxy", + "Jazz", + "Puzzle", + "Hypno", + }[s] +} + +// NewSymbols creates a new Symbols instance with the specified style +func NewSymbols(style BorderStyle) Symbols { + switch style { + case StyleASCII: + return &Glyphs{ + name: StyleNameASCII, + row: "-", + column: "|", + center: "+", + corners: [9]string{ + "+", "+", "+", + "+", "+", "+", + "+", "+", "+", + }, + headerLeft: "+", + headerMid: "+", + headerRight: "+", + } + case StyleLight, StyleDefault: + return &Glyphs{ + name: StyleNameLight, + row: "─", + column: "│", + center: "┼", + corners: [9]string{ + "┌", "┬", "┐", + "├", "┼", "┤", + "└", "┴", "┘", + }, + headerLeft: "├", + headerMid: "┼", + headerRight: "┤", + } + case StyleHeavy: + return &Glyphs{ + name: StyleNameHeavy, + row: "━", + column: "┃", + center: "╋", + corners: [9]string{ + "┏", "┳", "┓", + "┣", "╋", "┫", + "┗", "┻", "┛", + }, + headerLeft: "┣", + headerMid: "╋", + headerRight: "┫", + } + case StyleDouble: + return &Glyphs{ + name: StyleNameDouble, + row: "═", + column: "║", + center: "╬", + corners: [9]string{ + "╔", "╦", "╗", + "╠", "╬", "╣", + "╚", "╩", "╝", + }, + headerLeft: "╠", + headerMid: "╬", + headerRight: "╣", + } + case StyleDoubleLong: + return &Glyphs{ + name: StyleNameDoubleLong, + row: "═╡═", + column: "╞", + center: "╪", + corners: [9]string{ + "╔═╡", "═╤═", "╡═╗", + "╟ ", "╪ ", " ╢", + "╚═╡", "═╧═", "╡═╝", + }, + headerLeft: "╟═╡", + headerMid: "╪═╡", + headerRight: "╡═╢", + } + case StyleLightHeavy: + return &Glyphs{ + name: StyleNameLightHeavy, + row: "─", + column: "┃", + center: "╂", + corners: [9]string{ + "┍", "┯", "┑", + "┝", "╂", "┥", + "┕", "┷", "┙", + }, + headerLeft: "┝", + headerMid: "╂", + headerRight: "┥", + } + case StyleHeavyLight: + return &Glyphs{ + name: StyleNameHeavyLight, + row: "━", + column: "│", + center: "┿", + corners: [9]string{ + "┎", "┰", "┒", + "┠", "┿", "┨", + "┖", "┸", "┚", + }, + headerLeft: "┠", + headerMid: "┿", + headerRight: "┨", + } + case StyleLightDouble: + return &Glyphs{ + name: StyleNameLightDouble, + row: "─", + column: "║", + center: "╫", + corners: [9]string{ + "╓", "╥", "╖", + "╟", "╫", "╢", + "╙", "╨", "╜", + }, + headerLeft: "╟", + headerMid: "╫", + headerRight: "╢", + } + case StyleDoubleLight: + return &Glyphs{ + name: StyleNameDoubleLight, + row: "═", + column: "│", + center: "╪", + corners: [9]string{ + "╒", "╤", "╕", + "╞", "╪", "╡", + "╘", "╧", "╛", + }, + headerLeft: "╞", + headerMid: "╪", + headerRight: "╡", + } + case StyleRounded: + return &Glyphs{ + name: StyleNameRounded, + row: "─", + column: "│", + center: "┼", + corners: [9]string{ + "╭", "┬", "╮", + "├", "┼", "┤", + "╰", "┴", "╯", + }, + headerLeft: "├", + headerMid: "┼", + headerRight: "┤", + } + case StyleMarkdown: + return &Glyphs{ + name: StyleNameMarkdown, + row: "-", + column: "|", + center: "|", + corners: [9]string{ + "", "", "", + "|", "|", "|", + "", "", "", + }, + headerLeft: "|", + headerMid: "|", + headerRight: "|", + } + case StyleGraphical: + return &Glyphs{ + name: StyleNameGraphical, + row: "┄┄", + column: "┆", + center: "╂", + corners: [9]string{ + "┌┄", "┄┄", "┄┐", + "┆ ", "╂ ", " ┆", + "└┄", "┄┄", "┄┘", + }, + headerLeft: "├┄", + headerMid: "╂┄", + headerRight: "┄┤", + } + case StyleMerger: + return &Glyphs{ + name: StyleNameMerger, + row: "─", + column: "│", + center: "+", + corners: [9]string{ + "┌", "┬", "┐", + "├", "┼", "┤", + "└", "┴", "┘", + }, + headerLeft: "├", + headerMid: "+", + headerRight: "┤", + } + case StyleDotted: + return &Glyphs{ + name: StyleNameDotted, + row: "·", + column: ":", + center: "+", + corners: [9]string{ + ".", "·", ".", + ":", "+", ":", + "'", "·", "'", + }, + headerLeft: ":", + headerMid: "+", + headerRight: ":", + } + case StyleArrow: + return &Glyphs{ + name: StyleNameArrow, + row: "→", + column: "↓", + center: "↔", + corners: [9]string{ + "↗", "↑", "↖", + "→", "↔", "←", + "↘", "↓", "↙", + }, + headerLeft: "→", + headerMid: "↔", + headerRight: "←", + } + case StyleStarry: + return &Glyphs{ + name: StyleNameStarry, + row: "★", + column: "☆", + center: "✶", + corners: [9]string{ + "✧", "✯", "✧", + "✦", "✶", "✦", + "✧", "✯", "✧", + }, + headerLeft: "✦", + headerMid: "✶", + headerRight: "✦", + } + case StyleHearts: + return &Glyphs{ + name: StyleNameHearts, + row: "♥", + column: "❤", + center: "✚", + corners: [9]string{ + "❥", "♡", "❥", + "❣", "✚", "❣", + "❦", "♡", "❦", + }, + headerLeft: "❣", + headerMid: "✚", + headerRight: "❣", + } + case StyleCircuit: + return &Glyphs{ + name: StyleNameCircuit, + row: "=", + column: "||", + center: "<>", + corners: [9]string{ + "/*", "##", "*/", + "//", "<>", "\\", + "\\*", "##", "*/", + }, + headerLeft: "//", + headerMid: "<>", + headerRight: "\\", + } + case StyleNature: + return &Glyphs{ + name: StyleNameNature, + row: "~", + column: "|", + center: "❀", + corners: [9]string{ + "🌱", "🌿", "🌱", + "🍃", "❀", "🍃", + "🌻", "🌾", "🌻", + }, + headerLeft: "🍃", + headerMid: "❀", + headerRight: "🍃", + } + case StyleArtistic: + return &Glyphs{ + name: StyleNameArtistic, + row: "▬", + column: "▐", + center: "⬔", + corners: [9]string{ + "◈", "◊", "◈", + "◀", "⬔", "▶", + "◭", "▣", "◮", + }, + headerLeft: "◀", + headerMid: "⬔", + headerRight: "▶", + } + case Style8Bit: + return &Glyphs{ + name: StyleName8Bit, + row: "■", + column: "█", + center: "♦", + corners: [9]string{ + "╔", "▲", "╗", + "◄", "♦", "►", + "╚", "▼", "╝", + }, + headerLeft: "◄", + headerMid: "♦", + headerRight: "►", + } + case StyleChaos: + return &Glyphs{ + name: StyleNameChaos, + row: "≈", + column: "§", + center: "☯", + corners: [9]string{ + "⌘", "∞", "⌥", + "⚡", "☯", "♞", + "⌂", "∆", "◊", + }, + headerLeft: "⚡", + headerMid: "☯", + headerRight: "♞", + } + case StyleDots: + return &Glyphs{ + name: StyleNameDots, + row: "·", + column: " ", + center: "·", + corners: [9]string{ + "·", "·", "·", + " ", "·", " ", + "·", "·", "·", + }, + headerLeft: " ", + headerMid: "·", + headerRight: " ", + } + case StyleBlocks: + return &Glyphs{ + name: StyleNameBlocks, + row: "▀", + column: "█", + center: "█", + corners: [9]string{ + "▛", "▀", "▜", + "▌", "█", "▐", + "▙", "▄", "▟", + }, + headerLeft: "▌", + headerMid: "█", + headerRight: "▐", + } + case StyleZen: + return &Glyphs{ + name: StyleNameZen, + row: "~", + column: " ", + center: "☯", + corners: [9]string{ + " ", "♨", " ", + " ", "☯", " ", + " ", "♨", " ", + }, + headerLeft: " ", + headerMid: "☯", + headerRight: " ", + } + case StyleVintage: + return &Glyphs{ + name: StyleNameVintage, + row: "────", + column: " ⁜ ", + center: " ✠ ", + corners: [9]string{ + "╔══", "══╤", "══╗", + " ⁜ ", " ✠ ", " ⁜ ", + "╚══", "══╧", "══╝", + }, + headerLeft: " ├─", + headerMid: "─✠─", + headerRight: "─┤ ", + } + case StyleSketch: + return &Glyphs{ + name: StyleNameSketch, + row: "~~", + column: "/", + center: "+", + corners: [9]string{ + " .", "~~", ". ", + "/ ", "+ ", " \\", + " '", "~~", "` ", + }, + headerLeft: "/~", + headerMid: "+~", + headerRight: "~\\", + } + case StyleArrowDouble: + return &Glyphs{ + name: StyleNameArrowDouble, + row: "»»", + column: "⫸", + center: "✿", + corners: [9]string{ + "⌜»", "»»", "»⌝", + "⫸ ", "✿ ", " ⫷", + "⌞»", "»»", "»⌟", + }, + headerLeft: "⫸»", + headerMid: "✿»", + headerRight: "»⫷", + } + case StyleCelestial: + return &Glyphs{ + name: StyleNameCelestial, + row: "✦✧", + column: "☽", + center: "☀", + corners: [9]string{ + "✧✦", "✦✧", "✦✧", + "☽ ", "☀ ", " ☾", + "✧✦", "✦✧", "✦✧", + }, + headerLeft: "☽✦", + headerMid: "☀✧", + headerRight: "✦☾", + } + case StyleCyber: + return &Glyphs{ + name: StyleNameCyber, + row: "═╦═", + column: "║", + center: "╬", + corners: [9]string{ + "╔╦═", "╦═╦", "═╦╗", + "║ ", "╬ ", " ║", + "╚╩═", "╩═╩", "═╩╝", + }, + headerLeft: "╠╦═", + headerMid: "╬═╦", + headerRight: "═╦╣", + } + case StyleRunic: + return &Glyphs{ + name: StyleNameRunic, + row: "ᛖᛖᛖ", + column: "ᛟ", + center: "ᛞ", + corners: [9]string{ + "ᛏᛖᛖ", "ᛖᛖᛖ", "ᛖᛖᛏ", + "ᛟ ", "ᛞ ", " ᛟ", + "ᛗᛖᛖ", "ᛖᛖᛖ", "ᛖᛖᛗ", + }, + headerLeft: "ᛟᛖᛖ", + headerMid: "ᛞᛖᛖ", + headerRight: "ᛖᛖᛟ", + } + case StyleIndustrial: + return &Glyphs{ + name: StyleNameIndustrial, + row: "━╋━", + column: "┃", + center: "╋", + corners: [9]string{ + "┏╋━", "╋━╋", "━╋┓", + "┃ ", "╋ ", " ┃", + "┗╋━", "╋━╋", "━╋┛", + }, + headerLeft: "┣╋━", + headerMid: "╋━╋", + headerRight: "━╋┫", + } + case StyleInk: + return &Glyphs{ + name: StyleNameInk, + row: "﹌", + column: "︱", + center: "✒", + corners: [9]string{ + "﹏", "﹌", "﹏", + "︱ ", "✒ ", " ︱", + "﹋", "﹌", "﹋", + }, + headerLeft: "︱﹌", + headerMid: "✒﹌", + headerRight: "﹌︱", + } + case StyleArcade: + return &Glyphs{ + name: StyleNameArcade, + row: "■□", + column: "▐", + center: "◉", + corners: [9]string{ + "▞■", "■□", "□▚", + "▐ ", "◉ ", " ▐", + "▚■", "■□", "□▞", + }, + headerLeft: "▐■", + headerMid: "◉□", + headerRight: "■▐", + } + case StyleBlossom: + return &Glyphs{ + name: StyleNameBlossom, + row: "🌸", + column: "🌿", + center: "✿", + corners: [9]string{ + "🌷", "🌸", "🌷", + "🌿", "✿", "🌿", + "🌱", "🌸", "🌱", + }, + headerLeft: "🌿🌸", + headerMid: "✿🌸", + headerRight: "🌸🌿", + } + case StyleFrosted: + return &Glyphs{ + name: StyleNameFrosted, + row: "░▒░", + column: "▓", + center: "◍", + corners: [9]string{ + "◌░▒", "░▒░", "▒░◌", + "▓ ", "◍ ", " ▓", + "◌░▒", "░▒░", "▒░◌", + }, + headerLeft: "▓░▒", + headerMid: "◍▒░", + headerRight: "░▒▓", + } + case StyleMosaic: + return &Glyphs{ + name: StyleNameMosaic, + row: "▰▱", + column: "⧉", + center: "⬖", + corners: [9]string{ + "⧠▰", "▰▱", "▱⧠", + "⧉ ", "⬖ ", " ⧉", + "⧅▰", "▰▱", "▱⧅", + }, + headerLeft: "⧉▰", + headerMid: "⬖▱", + headerRight: "▰⧉", + } + case StyleUFO: + return &Glyphs{ + name: StyleNameUFO, + row: "⊚⊚", + column: "☽", + center: "☢", + corners: [9]string{ + "⌖⊚", "⊚⊚", "⊚⌖", + "☽ ", "☢ ", " ☽", + "⌗⊚", "⊚⊚", "⊚⌗", + }, + headerLeft: "☽⊚", + headerMid: "☢⊚", + headerRight: "⊚☽", + } + case StyleSteampunk: + return &Glyphs{ + name: StyleNameSteampunk, + row: "═⚙═", + column: "⛓️", + center: "⚔️", + corners: [9]string{ + "🜂⚙═", "═⚙═", "═⚙🜂", + "⛓️ ", "⚔️ ", " ⛓️", + "🜄⚙═", "═⚙═", "═⚙🜄", + }, + headerLeft: "⛓️⚙═", + headerMid: "⚔️═⚙", + headerRight: "═⚙⛓️", + } + case StyleGalaxy: + return &Glyphs{ + name: StyleNameGalaxy, + row: "≋≋", + column: "♆", + center: "☄️", + corners: [9]string{ + "⌇≋", "≋≋", "≋⌇", + "♆ ", "☄️ ", " ♆", + "⌇≋", "≋≋", "≋⌇", + }, + headerLeft: "♆≋", + headerMid: "☄️≋", + headerRight: "≋♆", + } + case StyleJazz: + return &Glyphs{ + name: StyleNameJazz, + row: "♬♬", + column: "▷", + center: "★", + corners: [9]string{ + "♔♬", "♬♬", "♬♔", + "▷ ", "★ ", " ◁", + "♕♬", "♬♬", "♬♕", + }, + headerLeft: "▷♬", + headerMid: "★♬", + headerRight: "♬◁", + } + case StylePuzzle: + return &Glyphs{ + name: StyleNamePuzzle, + row: "▣▣", + column: "◫", + center: "✚", + corners: [9]string{ + "◩▣", "▣▣", "▣◪", + "◫ ", "✚ ", " ◫", + "◧▣", "▣▣", "▣◨", + }, + headerLeft: "◫▣", + headerMid: "✚▣", + headerRight: "▣◫", + } + case StyleHypno: + return &Glyphs{ + name: StyleNameHypno, + row: "◜◝", + column: "꩜", + center: "⃰", + corners: [9]string{ + "◟◜", "◜◝", "◝◞", + "꩜ ", "⃰ ", " ꩜", + "◟◜", "◜◝", "◝◞", + }, + headerLeft: "꩜◜", + headerMid: "⃰◝", + headerRight: "◜꩜", + } + default: + return &Glyphs{ + name: StyleNameNothing, + row: "", + column: "", + center: "", + corners: [9]string{ + "", "", "", + "", "", "", + "", "", "", + }, + headerLeft: "", + headerMid: "", + headerRight: "", + } + } +} + +// SymbolCustom implements the Symbols interface with fully configurable symbols +type SymbolCustom struct { + name string + center string + row string + column string + topLeft string + topMid string + topRight string + midLeft string + midRight string + bottomLeft string + bottomMid string + bottomRight string + headerLeft string + headerMid string + headerRight string +} + +// NewSymbolCustom creates a new customizable border style +func NewSymbolCustom(name string) *SymbolCustom { + return &SymbolCustom{ + name: name, + center: "+", + row: "-", + column: "|", + } +} + +// Implement all Symbols interface methods +func (c *SymbolCustom) Name() string { return c.name } +func (c *SymbolCustom) Center() string { return c.center } +func (c *SymbolCustom) Row() string { return c.row } +func (c *SymbolCustom) Column() string { return c.column } +func (c *SymbolCustom) TopLeft() string { return c.topLeft } +func (c *SymbolCustom) TopMid() string { return c.topMid } +func (c *SymbolCustom) TopRight() string { return c.topRight } +func (c *SymbolCustom) MidLeft() string { return c.midLeft } +func (c *SymbolCustom) MidRight() string { return c.midRight } +func (c *SymbolCustom) BottomLeft() string { return c.bottomLeft } +func (c *SymbolCustom) BottomMid() string { return c.bottomMid } +func (c *SymbolCustom) BottomRight() string { return c.bottomRight } +func (c *SymbolCustom) HeaderLeft() string { return c.headerLeft } +func (c *SymbolCustom) HeaderMid() string { return c.headerMid } +func (c *SymbolCustom) HeaderRight() string { return c.headerRight } + +// Builder methods for fluent configuration +func (c *SymbolCustom) WithCenter(s string) *SymbolCustom { c.center = s; return c } +func (c *SymbolCustom) WithRow(s string) *SymbolCustom { c.row = s; return c } +func (c *SymbolCustom) WithColumn(s string) *SymbolCustom { c.column = s; return c } +func (c *SymbolCustom) WithTopLeft(s string) *SymbolCustom { c.topLeft = s; return c } +func (c *SymbolCustom) WithTopMid(s string) *SymbolCustom { c.topMid = s; return c } +func (c *SymbolCustom) WithTopRight(s string) *SymbolCustom { c.topRight = s; return c } +func (c *SymbolCustom) WithMidLeft(s string) *SymbolCustom { c.midLeft = s; return c } +func (c *SymbolCustom) WithMidRight(s string) *SymbolCustom { c.midRight = s; return c } +func (c *SymbolCustom) WithBottomLeft(s string) *SymbolCustom { c.bottomLeft = s; return c } +func (c *SymbolCustom) WithBottomMid(s string) *SymbolCustom { c.bottomMid = s; return c } +func (c *SymbolCustom) WithBottomRight(s string) *SymbolCustom { c.bottomRight = s; return c } +func (c *SymbolCustom) WithHeaderLeft(s string) *SymbolCustom { c.headerLeft = s; return c } +func (c *SymbolCustom) WithHeaderMid(s string) *SymbolCustom { c.headerMid = s; return c } +func (c *SymbolCustom) WithHeaderRight(s string) *SymbolCustom { c.headerRight = s; return c } + +// Preview renders a small sample table to visualize the border style +func (s *SymbolCustom) Preview() string { + return fmt.Sprintf( + "%s%s%s\n%s %s %s\n%s%s%s", + s.TopLeft(), s.Row(), s.TopRight(), + s.Column(), s.Center(), s.Column(), + s.BottomLeft(), s.Row(), s.BottomRight(), + ) +} + +// Glyphs provides fully independent border symbols with a corners array +type Glyphs struct { + name StyleName + row string + column string + center string + corners [9]string // [TopLeft, TopMid, TopRight, MidLeft, Center, MidRight, BottomLeft, BottomMid, BottomRight] + headerLeft string + headerMid string + headerRight string +} + +// Glyphs symbol methods +func (s *Glyphs) Name() string { return s.name.String() } +func (s *Glyphs) Center() string { return s.center } +func (s *Glyphs) Row() string { return s.row } +func (s *Glyphs) Column() string { return s.column } +func (s *Glyphs) TopLeft() string { return s.corners[0] } +func (s *Glyphs) TopMid() string { return s.corners[1] } +func (s *Glyphs) TopRight() string { return s.corners[2] } +func (s *Glyphs) MidLeft() string { return s.corners[3] } +func (s *Glyphs) MidRight() string { return s.corners[5] } +func (s *Glyphs) BottomLeft() string { return s.corners[6] } +func (s *Glyphs) BottomMid() string { return s.corners[7] } +func (s *Glyphs) BottomRight() string { return s.corners[8] } +func (s *Glyphs) HeaderLeft() string { return s.headerLeft } +func (s *Glyphs) HeaderMid() string { return s.headerMid } +func (s *Glyphs) HeaderRight() string { return s.headerRight } + +// Preview renders a small sample table to visualize the border style +func (s *Glyphs) Preview() string { + return fmt.Sprintf( + "%s%s%s\n%s %s %s\n%s%s%s", + s.TopLeft(), s.Row(), s.TopRight(), + s.Column(), s.Center(), s.Column(), + s.BottomLeft(), s.Row(), s.BottomRight(), + ) +} diff --git a/vendor/github.com/olekukonko/tablewriter/tw/tw.go b/vendor/github.com/olekukonko/tablewriter/tw/tw.go new file mode 100644 index 0000000..020de74 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/tw/tw.go @@ -0,0 +1,107 @@ +package tw + +// Operation Status Constants +// Used to indicate the success or failure of operations +const ( + Pending = 0 // Operation failed + Fail = -1 // Operation failed + Success = 1 // Operation succeeded + + MinimumColumnWidth = 8 +) + +const ( + Empty = "" + Skip = "" + Space = " " + NewLine = "\n" + Column = ":" + Dash = "-" +) + +// Feature State Constants +// Represents enabled/disabled states for features +const ( + Unknown State = Pending // Feature is enabled + On State = Success // Feature is enabled + Off State = Fail // Feature is disabled +) + +// Table Alignment Constants +// Defines text alignment options for table content +const ( + AlignNone Align = "none" // Center-aligned text + AlignCenter Align = "center" // Center-aligned text + AlignRight Align = "right" // Right-aligned text + AlignLeft Align = "left" // Left-aligned text + AlignDefault = AlignLeft // Left-aligned text +) + +const ( + Header Position = "header" // Table header section + Row Position = "row" // Table row section + Footer Position = "footer" // Table footer section +) + +const ( + LevelHeader Level = iota // Topmost line position + LevelBody // LevelBody line position + LevelFooter // LevelFooter line position +) + +const ( + LocationFirst Location = "first" // Topmost line position + LocationMiddle Location = "middle" // LevelBody line position + LocationEnd Location = "end" // LevelFooter line position +) + +const ( + SectionHeader = "heder" + SectionRow = "row" + SectionFooter = "footer" +) + +// Text Wrapping Constants +// Defines text wrapping behavior in table cells +const ( + WrapNone = iota // No wrapping + WrapNormal // Standard word wrapping + WrapTruncate // Truncate text with ellipsis + WrapBreak // Break words to fit +) + +// Cell Merge Constants +// Specifies cell merging behavior in tables + +const ( + MergeNone = iota // No merging + MergeVertical // Merge cells vertically + MergeHorizontal // Merge cells horizontally + MergeBoth // Merge both vertically and horizontally + MergeHierarchical // Hierarchical merging +) + +// Special Character Constants +// Defines special characters used in formatting +const ( + CharEllipsis = "…" // Ellipsis character for truncation + CharBreak = "↩" // Break character for wrapping +) + +type Spot int + +const ( + SpotNone Spot = iota + SpotTopLeft + SpotTopCenter + SpotTopRight + SpotBottomLeft + SpotBottomCenter // Default for legacy SetCaption + SpotBottomRight + SpotLeftTop + SpotLeftCenter + SpotLeftBottom + SpotRightTop + SpotRightCenter + SpotRIghtBottom +) diff --git a/vendor/github.com/olekukonko/tablewriter/tw/types.go b/vendor/github.com/olekukonko/tablewriter/tw/types.go new file mode 100644 index 0000000..29a1862 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/tw/types.go @@ -0,0 +1,199 @@ +// Package tw defines types and constants for table formatting and configuration, +// including validation logic for various table properties. +package tw + +import ( + "fmt" + "github.com/olekukonko/errors" + "strings" +) // Custom error handling library + +// Position defines where formatting applies in the table (e.g., header, footer, or rows). +type Position string + +// Validate checks if the Position is one of the allowed values: Header, Footer, or Row. +func (pos Position) Validate() error { + switch pos { + case Header, Footer, Row: + return nil // Valid position + } + // Return an error for any unrecognized position + return errors.New("invalid position") +} + +// Filter defines a function type for processing cell content. +// It takes a slice of strings (representing cell data) and returns a processed slice. +type Filter func([]string) []string + +// Formatter defines an interface for types that can format themselves into a string. +// Used for custom formatting of table cell content. +type Formatter interface { + Format() string // Returns the formatted string representation +} + +// Align specifies the text alignment within a table cell. +type Align string + +// Validate checks if the Align is one of the allowed values: None, Center, Left, or Right. +func (a Align) Validate() error { + switch a { + case AlignNone, AlignCenter, AlignLeft, AlignRight: + return nil // Valid alignment + } + // Return an error for any unrecognized alignment + return errors.New("invalid align") +} + +type Alignment []Align + +func (a Alignment) String() string { + var str strings.Builder + for i, a := range a { + if i > 0 { + str.WriteString("; ") + } + str.WriteString(fmt.Sprint(i)) + str.WriteString("=") + str.WriteString(string(a)) + } + return str.String() +} + +func (a Alignment) Add(aligns ...Align) Alignment { + aa := make(Alignment, len(aligns)) + copy(aa, aligns) + return aa +} + +func (a Alignment) Set(col int, align Align) Alignment { + if col >= 0 && col < len(a) { + a[col] = align + } + return a +} + +// Copy creates a new independent copy of the Alignment +func (a Alignment) Copy() Alignment { + aa := make(Alignment, len(a)) + copy(aa, a) + return aa +} + +// Level indicates the vertical position of a line in the table (e.g., header, body, or footer). +type Level int + +// Validate checks if the Level is one of the allowed values: Header, Body, or Footer. +func (l Level) Validate() error { + switch l { + case LevelHeader, LevelBody, LevelFooter: + return nil // Valid level + } + // Return an error for any unrecognized level + return errors.New("invalid level") +} + +// Location specifies the horizontal position of a cell or column within a table row. +type Location string + +// Validate checks if the Location is one of the allowed values: First, Middle, or End. +func (l Location) Validate() error { + switch l { + case LocationFirst, LocationMiddle, LocationEnd: + return nil // Valid location + } + // Return an error for any unrecognized location + return errors.New("invalid location") +} + +type Caption struct { + Text string + Spot Spot + Align Align + Width int +} + +func (c Caption) WithText(text string) Caption { + c.Text = text + return c +} + +func (c Caption) WithSpot(spot Spot) Caption { + c.Spot = spot + return c +} + +func (c Caption) WithAlign(align Align) Caption { + c.Align = align + return c +} + +func (c Caption) WithWidth(width int) Caption { + c.Width = width + return c +} + +type Control struct { + Hide State +} + +// Compact configures compact width optimization for merged cells. +type Compact struct { + Merge State // Merge enables compact width calculation during cell merging, optimizing space allocation. +} + +// Behavior defines settings that control table rendering behaviors, such as column visibility and content formatting. +type Behavior struct { + AutoHide State // AutoHide determines whether empty columns are hidden. Ignored in streaming mode. + TrimSpace State // TrimSpace enables trimming of leading and trailing spaces from cell content. + + Header Control // Header specifies control settings for the table header. + Footer Control // Footer specifies control settings for the table footer. + + // Compact enables optimized width calculation for merged cells, such as in horizontal merges, + // by systematically determining the most efficient width instead of scaling by the number of columns. + Compact Compact +} + +// Padding defines the spacing characters around cell content in all four directions. +// A zero-value Padding struct will use the table's default padding unless Overwrite is true. +type Padding struct { + Left string + Right string + Top string + Bottom string + + // Overwrite forces tablewriter to use this padding configuration exactly as specified, + // even when empty. When false (default), empty Padding fields will inherit defaults. + // + // For explicit no-padding, use the PaddingNone constant instead of setting Overwrite. + Overwrite bool +} + +// Common padding configurations for convenience + +// Equals reports whether two Padding configurations are identical in all fields. +// This includes comparing the Overwrite flag as part of the equality check. +func (p Padding) Equals(padding Padding) bool { + return p.Left == padding.Left && + p.Right == padding.Right && + p.Top == padding.Top && + p.Bottom == padding.Bottom && + p.Overwrite == padding.Overwrite +} + +// Empty reports whether all padding strings are empty (all fields == ""). +// Note that an Empty padding may still take effect if Overwrite is true. +func (p Padding) Empty() bool { + return p.Left == "" && p.Right == "" && p.Top == "" && p.Bottom == "" +} + +// Paddable reports whether this Padding configuration should override existing padding. +// Returns true if either: +// - Any padding string is non-empty (!p.Empty()) +// - Overwrite flag is true (even with all strings empty) +// +// This is used internally during configuration merging to determine whether to +// apply the padding settings. +func (p Padding) Paddable() bool { + return !p.Empty() || p.Overwrite +} diff --git a/vendor/github.com/olekukonko/tablewriter/util.go b/vendor/github.com/olekukonko/tablewriter/util.go deleted file mode 100644 index 380e7ab..0000000 --- a/vendor/github.com/olekukonko/tablewriter/util.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2014 Oleku Konko All rights reserved. -// Use of this source code is governed by a MIT -// license that can be found in the LICENSE file. - -// This module is a Table Writer API for the Go Programming Language. -// The protocols were written in pure Go and works on windows and unix systems - -package tablewriter - -import ( - "math" - "regexp" - "strings" - - "github.com/mattn/go-runewidth" -) - -var ansi = regexp.MustCompile("\033\\[(?:[0-9]{1,3}(?:;[0-9]{1,3})*)?[m|K]") - -func DisplayWidth(str string) int { - return runewidth.StringWidth(ansi.ReplaceAllLiteralString(str, "")) -} - -// Simple Condition for string -// Returns value based on condition -func ConditionString(cond bool, valid, inValid string) string { - if cond { - return valid - } - return inValid -} - -func isNumOrSpace(r rune) bool { - return ('0' <= r && r <= '9') || r == ' ' -} - -// Format Table Header -// Replace _ , . and spaces -func Title(name string) string { - origLen := len(name) - rs := []rune(name) - for i, r := range rs { - switch r { - case '_': - rs[i] = ' ' - case '.': - // ignore floating number 0.0 - if (i != 0 && !isNumOrSpace(rs[i-1])) || (i != len(rs)-1 && !isNumOrSpace(rs[i+1])) { - rs[i] = ' ' - } - } - } - name = string(rs) - name = strings.TrimSpace(name) - if len(name) == 0 && origLen > 0 { - // Keep at least one character. This is important to preserve - // empty lines in multi-line headers/footers. - name = " " - } - return strings.ToUpper(name) -} - -// Pad String -// Attempts to place string in the center -func Pad(s, pad string, width int) string { - gap := width - DisplayWidth(s) - if gap > 0 { - gapLeft := int(math.Ceil(float64(gap / 2))) - gapRight := gap - gapLeft - return strings.Repeat(string(pad), gapLeft) + s + strings.Repeat(string(pad), gapRight) - } - return s -} - -// Pad String Right position -// This would place string at the left side of the screen -func PadRight(s, pad string, width int) string { - gap := width - DisplayWidth(s) - if gap > 0 { - return s + strings.Repeat(string(pad), gap) - } - return s -} - -// Pad String Left position -// This would place string at the right side of the screen -func PadLeft(s, pad string, width int) string { - gap := width - DisplayWidth(s) - if gap > 0 { - return strings.Repeat(string(pad), gap) + s - } - return s -} diff --git a/vendor/github.com/olekukonko/tablewriter/wrap.go b/vendor/github.com/olekukonko/tablewriter/wrap.go deleted file mode 100644 index a092ee1..0000000 --- a/vendor/github.com/olekukonko/tablewriter/wrap.go +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2014 Oleku Konko All rights reserved. -// Use of this source code is governed by a MIT -// license that can be found in the LICENSE file. - -// This module is a Table Writer API for the Go Programming Language. -// The protocols were written in pure Go and works on windows and unix systems - -package tablewriter - -import ( - "math" - "strings" - - "github.com/mattn/go-runewidth" -) - -var ( - nl = "\n" - sp = " " -) - -const defaultPenalty = 1e5 - -// Wrap wraps s into a paragraph of lines of length lim, with minimal -// raggedness. -func WrapString(s string, lim int) ([]string, int) { - words := strings.Split(strings.Replace(s, nl, sp, -1), sp) - var lines []string - max := 0 - for _, v := range words { - max = runewidth.StringWidth(v) - if max > lim { - lim = max - } - } - for _, line := range WrapWords(words, 1, lim, defaultPenalty) { - lines = append(lines, strings.Join(line, sp)) - } - return lines, lim -} - -// WrapWords is the low-level line-breaking algorithm, useful if you need more -// control over the details of the text wrapping process. For most uses, -// WrapString will be sufficient and more convenient. -// -// WrapWords splits a list of words into lines with minimal "raggedness", -// treating each rune as one unit, accounting for spc units between adjacent -// words on each line, and attempting to limit lines to lim units. Raggedness -// is the total error over all lines, where error is the square of the -// difference of the length of the line and lim. Too-long lines (which only -// happen when a single word is longer than lim units) have pen penalty units -// added to the error. -func WrapWords(words []string, spc, lim, pen int) [][]string { - n := len(words) - - length := make([][]int, n) - for i := 0; i < n; i++ { - length[i] = make([]int, n) - length[i][i] = runewidth.StringWidth(words[i]) - for j := i + 1; j < n; j++ { - length[i][j] = length[i][j-1] + spc + runewidth.StringWidth(words[j]) - } - } - nbrk := make([]int, n) - cost := make([]int, n) - for i := range cost { - cost[i] = math.MaxInt32 - } - for i := n - 1; i >= 0; i-- { - if length[i][n-1] <= lim { - cost[i] = 0 - nbrk[i] = n - } else { - for j := i + 1; j < n; j++ { - d := lim - length[i][j-1] - c := d*d + cost[j] - if length[i][j-1] > lim { - c += pen // too-long lines get a worse penalty - } - if c < cost[i] { - cost[i] = c - nbrk[i] = j - } - } - } - } - var lines [][]string - i := 0 - for i < n { - lines = append(lines, words[i:nbrk[i]]) - i = nbrk[i] - } - return lines -} - -// getLines decomposes a multiline string into a slice of strings. -func getLines(s string) []string { - return strings.Split(s, nl) -} diff --git a/vendor/github.com/olekukonko/tablewriter/zoo.go b/vendor/github.com/olekukonko/tablewriter/zoo.go new file mode 100644 index 0000000..04a0c15 --- /dev/null +++ b/vendor/github.com/olekukonko/tablewriter/zoo.go @@ -0,0 +1,1695 @@ +package tablewriter + +import ( + "database/sql" + "fmt" + "github.com/olekukonko/errors" + "github.com/olekukonko/tablewriter/tw" + "io" + "math" + "reflect" + "strconv" + "strings" +) + +// applyHierarchicalMerges applies hierarchical merges to row content. +// Parameters ctx and mctx hold rendering and merge state. +// No return value. +func (t *Table) applyHierarchicalMerges(ctx *renderContext, mctx *mergeContext) { + ctx.logger.Debug("Applying hierarchical merges (left-to-right vertical flow - snapshot comparison)") + if len(ctx.rowLines) <= 1 { + ctx.logger.Debug("Skipping hierarchical merges - less than 2 rows") + return + } + numCols := ctx.numCols + + originalRowLines := make([][][]string, len(ctx.rowLines)) + for i, row := range ctx.rowLines { + originalRowLines[i] = make([][]string, len(row)) + for j, line := range row { + originalRowLines[i][j] = make([]string, len(line)) + copy(originalRowLines[i][j], line) + } + } + ctx.logger.Debug("Created snapshot of original row data for hierarchical merge comparison.") + + hMergeStartRow := make(map[int]int) + + for r := 1; r < len(ctx.rowLines); r++ { + leftCellContinuedHierarchical := false + + for c := 0; c < numCols; c++ { + if mctx.rowMerges[r] == nil { + mctx.rowMerges[r] = make(map[int]tw.MergeState) + } + if mctx.rowMerges[r-1] == nil { + mctx.rowMerges[r-1] = make(map[int]tw.MergeState) + } + + canCompare := r > 0 && + len(originalRowLines[r]) > 0 && + len(originalRowLines[r-1]) > 0 + + if !canCompare { + currentState := mctx.rowMerges[r][c] + currentState.Hierarchical = tw.MergeStateOption{} + mctx.rowMerges[r][c] = currentState + ctx.logger.Debugf("HCompare Skipped: r=%d, c=%d - Insufficient data in snapshot", r, c) + leftCellContinuedHierarchical = false + continue + } + + // Join all lines of the cell for comparison + var currentVal, aboveVal string + for _, line := range originalRowLines[r] { + if c < len(line) { + currentVal += line[c] + } + } + for _, line := range originalRowLines[r-1] { + if c < len(line) { + aboveVal += line[c] + } + } + + currentVal = t.Trimmer(currentVal) + aboveVal = t.Trimmer(aboveVal) + + currentState := mctx.rowMerges[r][c] + prevStateAbove := mctx.rowMerges[r-1][c] + + valuesMatch := currentVal == aboveVal && currentVal != "" && currentVal != "-" + hierarchyAllowed := c == 0 || leftCellContinuedHierarchical + shouldContinue := valuesMatch && hierarchyAllowed + + ctx.logger.Debugf("HCompare: r=%d, c=%d; current='%s', above='%s'; match=%v; leftCont=%v; shouldCont=%v", + r, c, currentVal, aboveVal, valuesMatch, leftCellContinuedHierarchical, shouldContinue) + + if shouldContinue { + currentState.Hierarchical.Present = true + currentState.Hierarchical.Start = false + + if prevStateAbove.Hierarchical.Present && !prevStateAbove.Hierarchical.End { + startRow, ok := hMergeStartRow[c] + if !ok { + ctx.logger.Debugf("Hierarchical merge WARNING: Recovering lost start row at r=%d, c=%d. Assuming r-1 was start.", r, c) + startRow = r - 1 + hMergeStartRow[c] = startRow + startState := mctx.rowMerges[startRow][c] + startState.Hierarchical.Present = true + startState.Hierarchical.Start = true + startState.Hierarchical.End = false + mctx.rowMerges[startRow][c] = startState + } + ctx.logger.Debugf("Hierarchical merge CONTINUED row %d, col %d. Block previously started row %d", r, c, startRow) + } else { + startRow := r - 1 + hMergeStartRow[c] = startRow + startState := mctx.rowMerges[startRow][c] + startState.Hierarchical.Present = true + startState.Hierarchical.Start = true + startState.Hierarchical.End = false + mctx.rowMerges[startRow][c] = startState + ctx.logger.Debugf("Hierarchical merge START detected for block ending at or after row %d, col %d (started at row %d)", r, c, startRow) + } + + for lineIdx := range ctx.rowLines[r] { + if c < len(ctx.rowLines[r][lineIdx]) { + ctx.rowLines[r][lineIdx][c] = tw.Empty + } + } + + leftCellContinuedHierarchical = true + } else { + currentState.Hierarchical = tw.MergeStateOption{} + + if startRow, ok := hMergeStartRow[c]; ok { + t.finalizeHierarchicalMergeBlock(ctx, mctx, c, startRow, r-1) + delete(hMergeStartRow, c) + } + + leftCellContinuedHierarchical = false + } + + mctx.rowMerges[r][c] = currentState + } + } + + lastRowIdx := len(ctx.rowLines) - 1 + if lastRowIdx >= 0 { + for c, startRow := range hMergeStartRow { + t.finalizeHierarchicalMergeBlock(ctx, mctx, c, startRow, lastRowIdx) + } + } + ctx.logger.Debug("Hierarchical merge processing completed") +} + +// applyHorizontalMergeWidths adjusts column widths for horizontal merges. +// Parameters include position, ctx for rendering, and mergeStates for merges. +// No return value. +func (t *Table) applyHorizontalMergeWidths(position tw.Position, ctx *renderContext, mergeStates map[int]tw.MergeState) { + if mergeStates == nil { + t.logger.Debugf("applyHorizontalMergeWidths: Skipping %s - no merge states", position) + return + } + t.logger.Debugf("applyHorizontalMergeWidths: Applying HMerge width recalc for %s", position) + + numCols := ctx.numCols + targetWidthsMap := ctx.widths[position] + originalNormalizedWidths := tw.NewMapper[int, int]() + for i := 0; i < numCols; i++ { + originalNormalizedWidths.Set(i, targetWidthsMap.Get(i)) + } + + separatorWidth := 0 + if t.renderer != nil { + rendererConfig := t.renderer.Config() + if rendererConfig.Settings.Separators.BetweenColumns.Enabled() { + separatorWidth = tw.DisplayWidth(rendererConfig.Symbols.Column()) + } + } + + processedCols := make(map[int]bool) + + for col := 0; col < numCols; col++ { + if processedCols[col] { + continue + } + + state, exists := mergeStates[col] + if !exists { + continue + } + + if state.Horizontal.Present && state.Horizontal.Start { + totalWidth := 0 + span := state.Horizontal.Span + t.logger.Debugf(" -> HMerge detected: startCol=%d, span=%d, separatorWidth=%d", col, span, separatorWidth) + + for i := 0; i < span && (col+i) < numCols; i++ { + currentColIndex := col + i + normalizedWidth := originalNormalizedWidths.Get(currentColIndex) + totalWidth += normalizedWidth + t.logger.Debugf(" -> col %d: adding normalized width %d", currentColIndex, normalizedWidth) + + if i > 0 && separatorWidth > 0 { + totalWidth += separatorWidth + t.logger.Debugf(" -> col %d: adding separator width %d", currentColIndex, separatorWidth) + } + } + + targetWidthsMap.Set(col, totalWidth) + t.logger.Debugf(" -> Set %s col %d width to %d (merged)", position, col, totalWidth) + processedCols[col] = true + + for i := 1; i < span && (col+i) < numCols; i++ { + targetWidthsMap.Set(col+i, 0) + t.logger.Debugf(" -> Set %s col %d width to 0 (part of merge)", position, col+i) + processedCols[col+i] = true + } + } + } + ctx.logger.Debugf("applyHorizontalMergeWidths: Final widths for %s: %v", position, targetWidthsMap) +} + +// applyVerticalMerges applies vertical merges to row content. +// Parameters ctx and mctx hold rendering and merge state. +// No return value. +func (t *Table) applyVerticalMerges(ctx *renderContext, mctx *mergeContext) { + ctx.logger.Debugf("Applying vertical merges across %d rows", len(ctx.rowLines)) + numCols := ctx.numCols + + mergeStartRow := make(map[int]int) + mergeStartContent := make(map[int]string) + + for i := 0; i < len(ctx.rowLines); i++ { + if i >= len(mctx.rowMerges) { + newRowMerges := make([]map[int]tw.MergeState, i+1) + copy(newRowMerges, mctx.rowMerges) + for k := len(mctx.rowMerges); k <= i; k++ { + newRowMerges[k] = make(map[int]tw.MergeState) + } + mctx.rowMerges = newRowMerges + ctx.logger.Debugf("Extended rowMerges to index %d", i) + } else if mctx.rowMerges[i] == nil { + mctx.rowMerges[i] = make(map[int]tw.MergeState) + } + + if len(ctx.rowLines[i]) == 0 { + continue + } + currentLineContent := ctx.rowLines[i] + + for col := 0; col < numCols; col++ { + // Join all lines of the cell to compare full content + var currentVal strings.Builder + for _, line := range currentLineContent { + if col < len(line) { + currentVal.WriteString(line[col]) + } + } + + currentValStr := t.Trimmer(currentVal.String()) + + startRow, ongoingMerge := mergeStartRow[col] + startContent := mergeStartContent[col] + mergeState := mctx.rowMerges[i][col] + + if ongoingMerge && currentValStr == startContent && currentValStr != "" { + mergeState.Vertical = tw.MergeStateOption{ + Present: true, + Span: 0, + Start: false, + End: false, + } + mctx.rowMerges[i][col] = mergeState + for lineIdx := range ctx.rowLines[i] { + if col < len(ctx.rowLines[i][lineIdx]) { + ctx.rowLines[i][lineIdx][col] = tw.Empty + } + } + ctx.logger.Debugf("Vertical merge continued at row %d, col %d", i, col) + } else { + if ongoingMerge { + endedRow := i - 1 + if endedRow >= 0 && endedRow >= startRow { + startState := mctx.rowMerges[startRow][col] + startState.Vertical.Span = (endedRow - startRow) + 1 + startState.Vertical.End = startState.Vertical.Span == 1 + mctx.rowMerges[startRow][col] = startState + + endState := mctx.rowMerges[endedRow][col] + endState.Vertical.End = true + endState.Vertical.Span = startState.Vertical.Span + mctx.rowMerges[endedRow][col] = endState + ctx.logger.Debugf("Vertical merge ended at row %d, col %d, span %d", endedRow, col, startState.Vertical.Span) + } + delete(mergeStartRow, col) + delete(mergeStartContent, col) + } + + if currentValStr != "" { + mergeState.Vertical = tw.MergeStateOption{ + Present: true, + Span: 1, + Start: true, + End: false, + } + mctx.rowMerges[i][col] = mergeState + mergeStartRow[col] = i + mergeStartContent[col] = currentValStr + ctx.logger.Debugf("Vertical merge started at row %d, col %d", i, col) + } else if !mergeState.Horizontal.Present { + mergeState.Vertical = tw.MergeStateOption{} + mctx.rowMerges[i][col] = mergeState + } + } + } + } + + lastRowIdx := len(ctx.rowLines) - 1 + if lastRowIdx >= 0 { + for col, startRow := range mergeStartRow { + startState := mctx.rowMerges[startRow][col] + finalSpan := (lastRowIdx - startRow) + 1 + startState.Vertical.Span = finalSpan + startState.Vertical.End = finalSpan == 1 + mctx.rowMerges[startRow][col] = startState + + endState := mctx.rowMerges[lastRowIdx][col] + endState.Vertical.Present = true + endState.Vertical.End = true + endState.Vertical.Span = finalSpan + if startRow != lastRowIdx { + endState.Vertical.Start = false + } + mctx.rowMerges[lastRowIdx][col] = endState + ctx.logger.Debugf("Vertical merge finalized at row %d, col %d, span %d", lastRowIdx, col, finalSpan) + } + } + ctx.logger.Debug("Vertical merges completed") +} + +// buildAdjacentCells constructs cell contexts for adjacent lines. +// Parameters include ctx, mctx, hctx, and direction (-1 for prev, +1 for next). +// Returns a map of column indices to CellContext for the adjacent line. +func (t *Table) buildAdjacentCells(ctx *renderContext, mctx *mergeContext, hctx *helperContext, direction int) map[int]tw.CellContext { + adjCells := make(map[int]tw.CellContext) + var adjLine []string + var adjMerges map[int]tw.MergeState + found := false + adjPosition := hctx.position // Assume adjacent line is in the same section initially + + switch hctx.position { + case tw.Header: + targetLineIdx := hctx.lineIdx + direction + if direction < 0 { // Previous + if targetLineIdx >= 0 && targetLineIdx < len(ctx.headerLines) { + adjLine = ctx.headerLines[targetLineIdx] + adjMerges = mctx.headerMerges + found = true + } + } else { // Next + if targetLineIdx < len(ctx.headerLines) { + adjLine = ctx.headerLines[targetLineIdx] + adjMerges = mctx.headerMerges + found = true + } else if len(ctx.rowLines) > 0 && len(ctx.rowLines[0]) > 0 && len(mctx.rowMerges) > 0 { + adjLine = ctx.rowLines[0][0] + adjMerges = mctx.rowMerges[0] + adjPosition = tw.Row + found = true + } else if len(ctx.footerLines) > 0 { + adjLine = ctx.footerLines[0] + adjMerges = mctx.footerMerges + adjPosition = tw.Footer + found = true + } + } + case tw.Row: + targetLineIdx := hctx.lineIdx + direction + if hctx.rowIdx < 0 || hctx.rowIdx >= len(ctx.rowLines) || hctx.rowIdx >= len(mctx.rowMerges) { + t.logger.Debugf("Warning: Invalid row index %d in buildAdjacentCells", hctx.rowIdx) + return nil + } + currentRowLines := ctx.rowLines[hctx.rowIdx] + currentMerges := mctx.rowMerges[hctx.rowIdx] + + if direction < 0 { // Previous + if targetLineIdx >= 0 && targetLineIdx < len(currentRowLines) { + adjLine = currentRowLines[targetLineIdx] + adjMerges = currentMerges + found = true + } else if targetLineIdx < 0 { + targetRowIdx := hctx.rowIdx - 1 + if targetRowIdx >= 0 && targetRowIdx < len(ctx.rowLines) && targetRowIdx < len(mctx.rowMerges) { + prevRowLines := ctx.rowLines[targetRowIdx] + if len(prevRowLines) > 0 { + adjLine = prevRowLines[len(prevRowLines)-1] + adjMerges = mctx.rowMerges[targetRowIdx] + found = true + } + } else if len(ctx.headerLines) > 0 { + adjLine = ctx.headerLines[len(ctx.headerLines)-1] + adjMerges = mctx.headerMerges + adjPosition = tw.Header + found = true + } + } + } else { // Next + if targetLineIdx >= 0 && targetLineIdx < len(currentRowLines) { + adjLine = currentRowLines[targetLineIdx] + adjMerges = currentMerges + found = true + } else if targetLineIdx >= len(currentRowLines) { + targetRowIdx := hctx.rowIdx + 1 + if targetRowIdx < len(ctx.rowLines) && targetRowIdx < len(mctx.rowMerges) && len(ctx.rowLines[targetRowIdx]) > 0 { + adjLine = ctx.rowLines[targetRowIdx][0] + adjMerges = mctx.rowMerges[targetRowIdx] + found = true + } else if len(ctx.footerLines) > 0 { + adjLine = ctx.footerLines[0] + adjMerges = mctx.footerMerges + adjPosition = tw.Footer + found = true + } + } + } + case tw.Footer: + targetLineIdx := hctx.lineIdx + direction + if direction < 0 { // Previous + if targetLineIdx >= 0 && targetLineIdx < len(ctx.footerLines) { + adjLine = ctx.footerLines[targetLineIdx] + adjMerges = mctx.footerMerges + found = true + } else if targetLineIdx < 0 { + if len(ctx.rowLines) > 0 { + lastRowIdx := len(ctx.rowLines) - 1 + if lastRowIdx < len(mctx.rowMerges) && len(ctx.rowLines[lastRowIdx]) > 0 { + lastRowLines := ctx.rowLines[lastRowIdx] + adjLine = lastRowLines[len(lastRowLines)-1] + adjMerges = mctx.rowMerges[lastRowIdx] + adjPosition = tw.Row + found = true + } + } else if len(ctx.headerLines) > 0 { + adjLine = ctx.headerLines[len(ctx.headerLines)-1] + adjMerges = mctx.headerMerges + adjPosition = tw.Header + found = true + } + } + } else { // Next + if targetLineIdx >= 0 && targetLineIdx < len(ctx.footerLines) { + adjLine = ctx.footerLines[targetLineIdx] + adjMerges = mctx.footerMerges + found = true + } + } + } + + if !found { + return nil + } + + if adjMerges == nil { + adjMerges = make(map[int]tw.MergeState) + t.logger.Debugf("Warning: adjMerges was nil in buildAdjacentCells despite found=true") + } + + paddedAdjLine := padLine(adjLine, ctx.numCols) + + for j := 0; j < ctx.numCols; j++ { + mergeState := adjMerges[j] + cellData := paddedAdjLine[j] + finalAdjColWidth := ctx.widths[adjPosition].Get(j) + + adjCells[j] = tw.CellContext{ + Data: cellData, + Merge: mergeState, + Width: finalAdjColWidth, + } + } + return adjCells +} + +// buildCellContexts creates CellContext objects for a given line in batch mode. +// Parameters include ctx, mctx, hctx, aligns, and padding for rendering. +// Returns a renderMergeResponse with current, previous, and next cell contexts. +func (t *Table) buildCellContexts(ctx *renderContext, mctx *mergeContext, hctx *helperContext, aligns map[int]tw.Align, padding map[int]tw.Padding) renderMergeResponse { + t.logger.Debugf("buildCellContexts: Building contexts for position=%s, rowIdx=%d, lineIdx=%d", hctx.position, hctx.rowIdx, hctx.lineIdx) + var merges map[int]tw.MergeState + switch hctx.position { + case tw.Header: + merges = mctx.headerMerges + case tw.Row: + if hctx.rowIdx >= 0 && hctx.rowIdx < len(mctx.rowMerges) && mctx.rowMerges[hctx.rowIdx] != nil { + merges = mctx.rowMerges[hctx.rowIdx] + } else { + merges = make(map[int]tw.MergeState) + t.logger.Warnf("buildCellContexts: Invalid row index %d or nil merges for row", hctx.rowIdx) + } + case tw.Footer: + merges = mctx.footerMerges + default: + merges = make(map[int]tw.MergeState) + t.logger.Warnf("buildCellContexts: Invalid position '%s'", hctx.position) + } + + cells := t.buildCoreCellContexts(hctx.line, merges, ctx.widths[hctx.position], aligns, padding, ctx.numCols) + return renderMergeResponse{ + cells: cells, + prevCells: t.buildAdjacentCells(ctx, mctx, hctx, -1), + nextCells: t.buildAdjacentCells(ctx, mctx, hctx, +1), + location: hctx.location, + } +} + +// buildCoreCellContexts constructs CellContext objects for a single line, shared between batch and streaming modes. +// Parameters: +// - line: The content of the current line (padded to numCols). +// - merges: Merge states for the line's columns (map[int]tw.MergeState). +// - widths: Column widths (tw.Mapper[int, int]). +// - aligns: Column alignments (map[int]tw.Align). +// - padding: Column padding settings (map[int]tw.Padding). +// - numCols: Number of columns to process. +// Returns a map of column indices to CellContext for the current line. +func (t *Table) buildCoreCellContexts(line []string, merges map[int]tw.MergeState, widths tw.Mapper[int, int], aligns map[int]tw.Align, padding map[int]tw.Padding, numCols int) map[int]tw.CellContext { + cells := make(map[int]tw.CellContext) + paddedLine := padLine(line, numCols) + for j := 0; j < numCols; j++ { + cellData := paddedLine[j] + mergeState := tw.MergeState{} + if merges != nil { + if state, ok := merges[j]; ok { + mergeState = state + } + } + cells[j] = tw.CellContext{ + Data: cellData, + Align: aligns[j], + Padding: padding[j], + Width: widths.Get(j), + Merge: mergeState, + } + } + t.logger.Debugf("buildCoreCellContexts: Built cell contexts for %d columns", numCols) + return cells +} + +// buildPaddingLineContents constructs a padding line for a given section, respecting column widths and horizontal merges. +// It generates a []string where each element is the padding content for a column, using the specified padChar. +func (t *Table) buildPaddingLineContents(padChar string, widths tw.Mapper[int, int], numCols int, merges map[int]tw.MergeState) []string { + line := make([]string, numCols) + padWidth := tw.DisplayWidth(padChar) + if padWidth < 1 { + padWidth = 1 + } + for j := 0; j < numCols; j++ { + mergeState := tw.MergeState{} + if merges != nil { + if state, ok := merges[j]; ok { + mergeState = state + } + } + if mergeState.Horizontal.Present && !mergeState.Horizontal.Start { + line[j] = tw.Empty + continue + } + colWd := widths.Get(j) + repeatCount := 0 + if colWd > 0 && padWidth > 0 { + repeatCount = colWd / padWidth + } + if colWd > 0 && repeatCount < 1 { + repeatCount = 1 + } + content := strings.Repeat(padChar, repeatCount) + line[j] = content + } + if t.logger.Enabled() { + t.logger.Debugf("Built padding line with char '%s' for %d columns", padChar, numCols) + } + return line +} + +// calculateAndNormalizeWidths computes and normalizes column widths. +// Parameter ctx holds rendering state with width maps. +// Returns an error if width calculation fails. +func (t *Table) calculateAndNormalizeWidths(ctx *renderContext) error { + ctx.logger.Debugf("calculateAndNormalizeWidths: Computing and normalizing widths for %d columns. Compact: %v", + ctx.numCols, t.config.Behavior.Compact.Merge.Enabled()) + + // Initialize width maps + //t.headerWidths = tw.NewMapper[int, int]() + //t.rowWidths = tw.NewMapper[int, int]() + //t.footerWidths = tw.NewMapper[int, int]() + + // Compute content-based widths for each section + for _, lines := range ctx.headerLines { + t.updateWidths(lines, t.headerWidths, t.config.Header.Padding) + } + rowWidthCache := make([]tw.Mapper[int, int], len(ctx.rowLines)) + for i, row := range ctx.rowLines { + rowWidthCache[i] = tw.NewMapper[int, int]() + for _, line := range row { + t.updateWidths(line, rowWidthCache[i], t.config.Row.Padding) + for col, width := range rowWidthCache[i] { + currentMax, _ := t.rowWidths.OK(col) + if width > currentMax { + t.rowWidths.Set(col, width) + } + } + } + } + for _, lines := range ctx.footerLines { + t.updateWidths(lines, t.footerWidths, t.config.Footer.Padding) + } + ctx.logger.Debugf("Content-based widths: header=%v, row=%v, footer=%v", t.headerWidths, t.rowWidths, t.footerWidths) + + // Analyze header merges for optimization + var headerMergeSpans map[int]int + if t.config.Header.Formatting.MergeMode&tw.MergeHorizontal != 0 && len(ctx.headerLines) > 0 { + headerMergeSpans = make(map[int]int) + visitedCols := make(map[int]bool) + firstHeaderLine := ctx.headerLines[0] + if len(firstHeaderLine) > 0 { + for i := 0; i < len(firstHeaderLine); { + if visitedCols[i] { + i++ + continue + } + var currentLogicalCellContentBuilder strings.Builder + for _, hLine := range ctx.headerLines { + if i < len(hLine) { + currentLogicalCellContentBuilder.WriteString(hLine[i]) + } + } + currentHeaderCellContent := t.Trimmer(currentLogicalCellContentBuilder.String()) + span := 1 + for j := i + 1; j < len(firstHeaderLine); j++ { + var nextLogicalCellContentBuilder strings.Builder + for _, hLine := range ctx.headerLines { + if j < len(hLine) { + nextLogicalCellContentBuilder.WriteString(hLine[j]) + } + } + nextHeaderCellContent := t.Trimmer(nextLogicalCellContentBuilder.String()) + if currentHeaderCellContent == nextHeaderCellContent && currentHeaderCellContent != "" && currentHeaderCellContent != "-" { + span++ + } else { + break + } + } + if span > 1 { + headerMergeSpans[i] = span + for k := 0; k < span; k++ { + visitedCols[i+k] = true + } + } + i += span + } + } + if len(headerMergeSpans) > 0 { + ctx.logger.Debugf("Header merge spans: %v", headerMergeSpans) + } + } + + // Determine natural column widths + naturalColumnWidths := tw.NewMapper[int, int]() + for i := 0; i < ctx.numCols; i++ { + width := 0 + if colWidth, ok := t.config.Widths.PerColumn.OK(i); ok && colWidth >= 0 { + width = colWidth + ctx.logger.Debugf("Col %d width from Config.Widths.PerColumn: %d", i, width) + } else { + maxRowFooterWidth := tw.Max(t.rowWidths.Get(i), t.footerWidths.Get(i)) + headerCellOriginalWidth := t.headerWidths.Get(i) + if t.config.Behavior.Compact.Merge.Enabled() && + t.config.Header.Formatting.MergeMode&tw.MergeHorizontal != 0 && + headerMergeSpans != nil { + isColInHeaderMerge := false + for startCol, span := range headerMergeSpans { + if i >= startCol && i < startCol+span { + isColInHeaderMerge = true + break + } + } + if isColInHeaderMerge { + width = maxRowFooterWidth + if width == 0 && headerCellOriginalWidth > 0 { + width = headerCellOriginalWidth + } + ctx.logger.Debugf("Col %d (in merge) width: %d (row/footer: %d, header: %d)", i, width, maxRowFooterWidth, headerCellOriginalWidth) + } else { + width = tw.Max(headerCellOriginalWidth, maxRowFooterWidth) + ctx.logger.Debugf("Col %d (not in merge) width: %d", i, width) + } + } else { + width = tw.Max(tw.Max(headerCellOriginalWidth, t.rowWidths.Get(i)), t.footerWidths.Get(i)) + ctx.logger.Debugf("Col %d width (no merge): %d", i, width) + } + if width == 0 && (headerCellOriginalWidth > 0 || t.rowWidths.Get(i) > 0 || t.footerWidths.Get(i) > 0) { + width = tw.Max(tw.Max(headerCellOriginalWidth, t.rowWidths.Get(i)), t.footerWidths.Get(i)) + } + if width == 0 { + width = 1 + } + } + naturalColumnWidths.Set(i, width) + } + ctx.logger.Debugf("Natural column widths: %v", naturalColumnWidths) + + // Expand columns for merged header content if needed + workingWidths := naturalColumnWidths.Clone() + if t.config.Header.Formatting.MergeMode&tw.MergeHorizontal != 0 && headerMergeSpans != nil { + if span, isOneBigMerge := headerMergeSpans[0]; isOneBigMerge && span == ctx.numCols && ctx.numCols > 0 { + var firstHeaderCellLogicalContentBuilder strings.Builder + for _, hLine := range ctx.headerLines { + if 0 < len(hLine) { + firstHeaderCellLogicalContentBuilder.WriteString(hLine[0]) + } + } + mergedContentString := t.Trimmer(firstHeaderCellLogicalContentBuilder.String()) + headerCellPadding := t.config.Header.Padding.Global + if 0 < len(t.config.Header.Padding.PerColumn) && t.config.Header.Padding.PerColumn[0].Paddable() { + headerCellPadding = t.config.Header.Padding.PerColumn[0] + } + actualMergedHeaderContentPhysicalWidth := tw.DisplayWidth(mergedContentString) + + tw.DisplayWidth(headerCellPadding.Left) + + tw.DisplayWidth(headerCellPadding.Right) + currentSumOfColumnWidths := 0 + workingWidths.Each(func(_ int, w int) { currentSumOfColumnWidths += w }) + numSeparatorsInFullSpan := 0 + if ctx.numCols > 1 { + if t.renderer != nil && t.renderer.Config().Settings.Separators.BetweenColumns.Enabled() { + numSeparatorsInFullSpan = (ctx.numCols - 1) * tw.DisplayWidth(t.renderer.Config().Symbols.Column()) + } + } + totalCurrentSpanPhysicalWidth := currentSumOfColumnWidths + numSeparatorsInFullSpan + if actualMergedHeaderContentPhysicalWidth > totalCurrentSpanPhysicalWidth { + ctx.logger.Debugf("Merged header content '%s' (width %d) exceeds total width %d. Expanding.", + mergedContentString, actualMergedHeaderContentPhysicalWidth, totalCurrentSpanPhysicalWidth) + shortfall := actualMergedHeaderContentPhysicalWidth - totalCurrentSpanPhysicalWidth + numNonZeroCols := 0 + workingWidths.Each(func(_ int, w int) { + if w > 0 { + numNonZeroCols++ + } + }) + if numNonZeroCols == 0 && ctx.numCols > 0 { + numNonZeroCols = ctx.numCols + } + if numNonZeroCols > 0 && shortfall > 0 { + extraPerColumn := int(math.Ceil(float64(shortfall) / float64(numNonZeroCols))) + finalSumAfterExpansion := 0 + workingWidths.Each(func(colIdx int, currentW int) { + if currentW > 0 || (numNonZeroCols == ctx.numCols && ctx.numCols > 0) { + newWidth := currentW + extraPerColumn + workingWidths.Set(colIdx, newWidth) + finalSumAfterExpansion += newWidth + ctx.logger.Debugf("Col %d expanded by %d to %d", colIdx, extraPerColumn, newWidth) + } else { + finalSumAfterExpansion += currentW + } + }) + overDistributed := (finalSumAfterExpansion + numSeparatorsInFullSpan) - actualMergedHeaderContentPhysicalWidth + if overDistributed > 0 { + ctx.logger.Debugf("Correcting over-distribution of %d", overDistributed) + // Sort columns for deterministic reduction + sortedCols := workingWidths.SortedKeys() + for i := 0; i < overDistributed; i++ { + // Reduce from highest-indexed column + for j := len(sortedCols) - 1; j >= 0; j-- { + col := sortedCols[j] + if workingWidths.Get(col) > 1 && naturalColumnWidths.Get(col) < workingWidths.Get(col) { + workingWidths.Set(col, workingWidths.Get(col)-1) + ctx.logger.Debugf("Reduced col %d by 1 to %d", col, workingWidths.Get(col)) + break + } + } + } + } + } + } + } + } + ctx.logger.Debugf("Widths after merged header expansion: %v", workingWidths) + + // Apply global width constraint + finalWidths := workingWidths.Clone() + if t.config.Widths.Global > 0 { + ctx.logger.Debugf("Applying global width constraint: %d", t.config.Widths.Global) + currentSumOfFinalColWidths := 0 + finalWidths.Each(func(_ int, w int) { currentSumOfFinalColWidths += w }) + numSeparators := 0 + if ctx.numCols > 1 && t.renderer != nil && t.renderer.Config().Settings.Separators.BetweenColumns.Enabled() { + numSeparators = (ctx.numCols - 1) * tw.DisplayWidth(t.renderer.Config().Symbols.Column()) + } + totalCurrentTablePhysicalWidth := currentSumOfFinalColWidths + numSeparators + if totalCurrentTablePhysicalWidth > t.config.Widths.Global { + ctx.logger.Debugf("Table width %d exceeds global limit %d. Shrinking.", totalCurrentTablePhysicalWidth, t.config.Widths.Global) + targetTotalColumnContentWidth := t.config.Widths.Global - numSeparators + if targetTotalColumnContentWidth < 0 { + targetTotalColumnContentWidth = 0 + } + if ctx.numCols > 0 && targetTotalColumnContentWidth < ctx.numCols { + targetTotalColumnContentWidth = ctx.numCols + } + hardMinimums := tw.NewMapper[int, int]() + sumOfHardMinimums := 0 + isHeaderContentHardToWrap := !(t.config.Header.Formatting.AutoWrap == tw.WrapNormal || t.config.Header.Formatting.AutoWrap == tw.WrapBreak) + for i := 0; i < ctx.numCols; i++ { + minW := 1 + if isHeaderContentHardToWrap && len(ctx.headerLines) > 0 { + headerColNaturalWidthWithPadding := t.headerWidths.Get(i) + if headerColNaturalWidthWithPadding > minW { + minW = headerColNaturalWidthWithPadding + } + } + hardMinimums.Set(i, minW) + sumOfHardMinimums += minW + } + ctx.logger.Debugf("Hard minimums: %v (sum: %d)", hardMinimums, sumOfHardMinimums) + if targetTotalColumnContentWidth < sumOfHardMinimums && sumOfHardMinimums > 0 { + ctx.logger.Warnf("Target width %d below minimums %d. Scaling.", targetTotalColumnContentWidth, sumOfHardMinimums) + scaleFactorMin := float64(targetTotalColumnContentWidth) / float64(sumOfHardMinimums) + if scaleFactorMin < 0 { + scaleFactorMin = 0 + } + tempSum := 0 + scaledHardMinimums := tw.NewMapper[int, int]() + hardMinimums.Each(func(colIdx int, currentMinW int) { + scaledMinW := int(math.Round(float64(currentMinW) * scaleFactorMin)) + if scaledMinW < 1 && targetTotalColumnContentWidth > 0 { + scaledMinW = 1 + } else if scaledMinW < 0 { + scaledMinW = 0 + } + scaledHardMinimums.Set(colIdx, scaledMinW) + tempSum += scaledMinW + }) + errorDiffMin := targetTotalColumnContentWidth - tempSum + if errorDiffMin != 0 && scaledHardMinimums.Len() > 0 { + sortedKeys := scaledHardMinimums.SortedKeys() + for i := 0; i < int(math.Abs(float64(errorDiffMin))); i++ { + keyToAdjust := sortedKeys[i%len(sortedKeys)] + val := scaledHardMinimums.Get(keyToAdjust) + adj := 1 + if errorDiffMin < 0 { + adj = -1 + } + if val+adj >= 1 || (val+adj == 0 && targetTotalColumnContentWidth == 0) { + scaledHardMinimums.Set(keyToAdjust, val+adj) + } else if adj > 0 { + scaledHardMinimums.Set(keyToAdjust, val+adj) + } + } + } + finalWidths = scaledHardMinimums.Clone() + ctx.logger.Debugf("Scaled minimums: %v", finalWidths) + } else { + finalWidths = hardMinimums.Clone() + widthAllocatedByMinimums := sumOfHardMinimums + remainingWidthToDistribute := targetTotalColumnContentWidth - widthAllocatedByMinimums + ctx.logger.Debugf("Target: %d, minimums: %d, remaining: %d", targetTotalColumnContentWidth, widthAllocatedByMinimums, remainingWidthToDistribute) + if remainingWidthToDistribute > 0 { + sumOfFlexiblePotentialBase := 0 + flexibleColsOriginalWidths := tw.NewMapper[int, int]() + for i := 0; i < ctx.numCols; i++ { + naturalW := workingWidths.Get(i) + minW := hardMinimums.Get(i) + if naturalW > minW { + sumOfFlexiblePotentialBase += (naturalW - minW) + flexibleColsOriginalWidths.Set(i, naturalW) + } + } + ctx.logger.Debugf("Flexible potential: %d, flexible widths: %v", sumOfFlexiblePotentialBase, flexibleColsOriginalWidths) + if sumOfFlexiblePotentialBase > 0 { + distributedExtraSum := 0 + sortedFlexKeys := flexibleColsOriginalWidths.SortedKeys() + for _, colIdx := range sortedFlexKeys { + naturalWOfCol := flexibleColsOriginalWidths.Get(colIdx) + hardMinOfCol := hardMinimums.Get(colIdx) + flexiblePartOfCol := naturalWOfCol - hardMinOfCol + proportion := 0.0 + if sumOfFlexiblePotentialBase > 0 { + proportion = float64(flexiblePartOfCol) / float64(sumOfFlexiblePotentialBase) + } else if len(sortedFlexKeys) > 0 { + proportion = 1.0 / float64(len(sortedFlexKeys)) + } + extraForThisCol := int(math.Round(float64(remainingWidthToDistribute) * proportion)) + currentAssignedW := finalWidths.Get(colIdx) + finalWidths.Set(colIdx, currentAssignedW+extraForThisCol) + distributedExtraSum += extraForThisCol + } + errorInDist := remainingWidthToDistribute - distributedExtraSum + ctx.logger.Debugf("Distributed %d, error: %d", distributedExtraSum, errorInDist) + if errorInDist != 0 && len(sortedFlexKeys) > 0 { + for i := 0; i < int(math.Abs(float64(errorInDist))); i++ { + colToAdjust := sortedFlexKeys[i%len(sortedFlexKeys)] + w := finalWidths.Get(colToAdjust) + adj := 1 + if errorInDist < 0 { + adj = -1 + } + if !(adj < 0 && w+adj < hardMinimums.Get(colToAdjust)) { + finalWidths.Set(colToAdjust, w+adj) + } else if adj > 0 { + finalWidths.Set(colToAdjust, w+adj) + } + } + } + } else { + if ctx.numCols > 0 { + extraPerCol := remainingWidthToDistribute / ctx.numCols + rem := remainingWidthToDistribute % ctx.numCols + for i := 0; i < ctx.numCols; i++ { + currentW := finalWidths.Get(i) + add := extraPerCol + if i < rem { + add++ + } + finalWidths.Set(i, currentW+add) + } + } + } + } + } + finalSumCheck := 0 + finalWidths.Each(func(idx int, w int) { + if w < 1 && targetTotalColumnContentWidth > 0 { + finalWidths.Set(idx, 1) + } else if w < 0 { + finalWidths.Set(idx, 0) + } + finalSumCheck += finalWidths.Get(idx) + }) + ctx.logger.Debugf("Final widths after scaling: %v (sum: %d, target: %d)", finalWidths, finalSumCheck, targetTotalColumnContentWidth) + } + } + + // Assign final widths to context + ctx.widths[tw.Header] = finalWidths.Clone() + ctx.widths[tw.Row] = finalWidths.Clone() + ctx.widths[tw.Footer] = finalWidths.Clone() + ctx.logger.Debugf("Final normalized widths: header=%v, row=%v, footer=%v", ctx.widths[tw.Header], ctx.widths[tw.Row], ctx.widths[tw.Footer]) + return nil +} + +// calculateContentMaxWidth computes the maximum content width for a column, accounting for padding and mode-specific constraints. +// Returns the effective content width (after subtracting padding) for the given column index. +func (t *Table) calculateContentMaxWidth(colIdx int, config tw.CellConfig, padLeftWidth, padRightWidth int, isStreaming bool) int { + var effectiveContentMaxWidth int + + if isStreaming { + // Existing streaming logic remains unchanged + totalColumnWidthFromStream := t.streamWidths.Get(colIdx) + if totalColumnWidthFromStream < 0 { + totalColumnWidthFromStream = 0 + } + effectiveContentMaxWidth = totalColumnWidthFromStream - padLeftWidth - padRightWidth + if effectiveContentMaxWidth < 1 && totalColumnWidthFromStream > (padLeftWidth+padRightWidth) { + effectiveContentMaxWidth = 1 + } else if effectiveContentMaxWidth < 0 { + effectiveContentMaxWidth = 0 + } + if totalColumnWidthFromStream == 0 { + effectiveContentMaxWidth = 0 + } + t.logger.Debugf("calculateContentMaxWidth: Streaming col %d, TotalColWd=%d, PadL=%d, PadR=%d -> ContentMaxWd=%d", colIdx, totalColumnWidthFromStream, padLeftWidth, padRightWidth, effectiveContentMaxWidth) + } else { + // New priority-based width constraint checking + constraintTotalCellWidth := 0 + hasConstraint := false + + // 1. Check new Widths.PerColumn (highest priority) + if t.config.Widths.Constrained() { + + if colWidth, ok := t.config.Widths.PerColumn.OK(colIdx); ok && colWidth > 0 { + constraintTotalCellWidth = colWidth + hasConstraint = true + t.logger.Debugf("calculateContentMaxWidth: Using Widths.PerColumn[%d] = %d", + colIdx, constraintTotalCellWidth) + } + + // 2. Check new Widths.Global + if !hasConstraint && t.config.Widths.Global > 0 { + constraintTotalCellWidth = t.config.Widths.Global + hasConstraint = true + t.logger.Debugf("calculateContentMaxWidth: Using Widths.Global = %d", constraintTotalCellWidth) + } + } + + // 3. Fall back to legacy ColMaxWidths.PerColumn (backward compatibility) + if !hasConstraint && config.ColMaxWidths.PerColumn != nil { + if colMax, ok := config.ColMaxWidths.PerColumn.OK(colIdx); ok && colMax > 0 { + constraintTotalCellWidth = colMax + hasConstraint = true + t.logger.Debugf("calculateContentMaxWidth: Using legacy ColMaxWidths.PerColumn[%d] = %d", + colIdx, constraintTotalCellWidth) + } + } + + // 4. Fall back to legacy ColMaxWidths.Global + if !hasConstraint && config.ColMaxWidths.Global > 0 { + constraintTotalCellWidth = config.ColMaxWidths.Global + hasConstraint = true + t.logger.Debugf("calculateContentMaxWidth: Using legacy ColMaxWidths.Global = %d", + constraintTotalCellWidth) + } + + // 5. Fall back to table MaxWidth if auto-wrapping + if !hasConstraint && t.config.MaxWidth > 0 && config.Formatting.AutoWrap != tw.WrapNone { + constraintTotalCellWidth = t.config.MaxWidth + hasConstraint = true + t.logger.Debugf("calculateContentMaxWidth: Using table MaxWidth = %d (AutoWrap enabled)", + constraintTotalCellWidth) + } + + // Calculate effective width based on found constraint + if hasConstraint { + effectiveContentMaxWidth = constraintTotalCellWidth - padLeftWidth - padRightWidth + if effectiveContentMaxWidth < 1 && constraintTotalCellWidth > (padLeftWidth+padRightWidth) { + effectiveContentMaxWidth = 1 + } else if effectiveContentMaxWidth < 0 { + effectiveContentMaxWidth = 0 + } + t.logger.Debugf("calculateContentMaxWidth: ConstraintTotalCellWidth=%d, PadL=%d, PadR=%d -> EffectiveContentMaxWidth=%d", + constraintTotalCellWidth, padLeftWidth, padRightWidth, effectiveContentMaxWidth) + } else { + effectiveContentMaxWidth = 0 + t.logger.Debugf("calculateContentMaxWidth: No width constraints found for column %d", colIdx) + } + } + + return effectiveContentMaxWidth +} + +// convertToStringer invokes the table's stringer function with optional caching. +func (t *Table) convertToStringer(input interface{}) ([]string, error) { + // This function is now only called if t.stringer is non-nil. + if t.stringer == nil { + return nil, errors.New("internal error: convertToStringer called with nil t.stringer") + } + + t.logger.Debugf("convertToString attempt %v using %v", input, t.stringer) + + inputType := reflect.TypeOf(input) + stringerFuncVal := reflect.ValueOf(t.stringer) + stringerFuncType := stringerFuncVal.Type() + + // Cache lookup (simplified, actual cache logic can be more complex) + if t.stringerCacheEnabled { + t.stringerCacheMu.RLock() + cachedFunc, ok := t.stringerCache[inputType] + t.stringerCacheMu.RUnlock() + if ok { + // Add proper type checking for cachedFunc against input here if necessary + t.logger.Debugf("convertToStringer: Cache hit for type %v", inputType) + results := cachedFunc.Call([]reflect.Value{reflect.ValueOf(input)}) + if len(results) == 1 && results[0].Type() == reflect.TypeOf([]string{}) { + return results[0].Interface().([]string), nil + } + } + } + + // Robust type checking for the stringer function + validSignature := stringerFuncVal.Kind() == reflect.Func && + stringerFuncType.NumIn() == 1 && + stringerFuncType.NumOut() == 1 && + stringerFuncType.Out(0) == reflect.TypeOf([]string{}) + + if !validSignature { + return nil, errors.Newf("table stringer (type %T) does not have signature func(SomeType) []string", t.stringer) + } + + // Check if input is assignable to stringer's parameter type + paramType := stringerFuncType.In(0) + assignable := false + if inputType != nil { // input is not untyped nil + if inputType.AssignableTo(paramType) { + assignable = true + } else if paramType.Kind() == reflect.Interface && inputType.Implements(paramType) { + assignable = true + } else if paramType.Kind() == reflect.Interface && paramType.NumMethod() == 0 { // stringer expects interface{} + assignable = true + } + } else if paramType.Kind() == reflect.Interface || (paramType.Kind() == reflect.Ptr && paramType.Elem().Kind() != reflect.Interface) { + // If input is nil, it can be assigned if stringer expects an interface or a pointer type + // (but not a pointer to an interface, which is rare for stringers). + // A nil value for a concrete type parameter would cause a panic on Call. + // So, if paramType is not an interface/pointer, and input is nil, it's an issue. + // This needs careful handling. For now, assume assignable if interface/pointer. + assignable = true + } + + if !assignable { + return nil, errors.Newf("input type %T cannot be passed to table stringer expecting %s", input, paramType) + } + + var callArgs []reflect.Value + if input == nil { + // If input is nil, we must pass a zero value of the stringer's parameter type + // if that type is a pointer or interface. + // Passing reflect.ValueOf(nil) directly will cause issues if paramType is concrete. + callArgs = []reflect.Value{reflect.Zero(paramType)} + } else { + callArgs = []reflect.Value{reflect.ValueOf(input)} + } + + resultValues := stringerFuncVal.Call(callArgs) + + if t.stringerCacheEnabled && inputType != nil { // Only cache if inputType is valid + t.stringerCacheMu.Lock() + t.stringerCache[inputType] = stringerFuncVal + t.stringerCacheMu.Unlock() + } + + return resultValues[0].Interface().([]string), nil +} + +// convertToString converts a value to its string representation. +func (t *Table) convertToString(value interface{}) string { + if value == nil { + return "" + } + switch v := value.(type) { + case tw.Formatter: + return v.Format() + case io.Reader: + const maxReadSize = 512 + var buf strings.Builder + _, err := io.CopyN(&buf, v, maxReadSize) + if err != nil && err != io.EOF { + return fmt.Sprintf("[reader error: %v]", err) // Keep fmt.Sprintf for rare error case + } + if buf.Len() == maxReadSize { + buf.WriteString(tw.CharEllipsis) + } + return buf.String() + case sql.NullString: + if v.Valid { + return v.String + } + return "" + case sql.NullInt64: + if v.Valid { + return strconv.FormatInt(v.Int64, 10) + } + return "" + case sql.NullFloat64: + if v.Valid { + return strconv.FormatFloat(v.Float64, 'f', -1, 64) + } + return "" + case sql.NullBool: + if v.Valid { + return strconv.FormatBool(v.Bool) + } + return "" + case sql.NullTime: + if v.Valid { + return v.Time.String() + } + return "" + case []byte: + return string(v) + case error: + return v.Error() + case fmt.Stringer: + return v.String() + case string: + return v + case int: + return strconv.FormatInt(int64(v), 10) + case int8: + return strconv.FormatInt(int64(v), 10) + case int16: + return strconv.FormatInt(int64(v), 10) + case int32: + return strconv.FormatInt(int64(v), 10) + case int64: + return strconv.FormatInt(v, 10) + case uint: + return strconv.FormatUint(uint64(v), 10) + case uint8: + return strconv.FormatUint(uint64(v), 10) + case uint16: + return strconv.FormatUint(uint64(v), 10) + case uint32: + return strconv.FormatUint(uint64(v), 10) + case uint64: + return strconv.FormatUint(v, 10) + case float32: + return strconv.FormatFloat(float64(v), 'f', -1, 32) + case float64: + return strconv.FormatFloat(v, 'f', -1, 64) + case bool: + return strconv.FormatBool(v) + default: + t.logger.Debugf("convertToString: Falling back to fmt.Sprintf for type %T", value) + return fmt.Sprintf("%v", value) // Fallback for rare types + } +} + +// convertItemToCells is responsible for converting a single input item (which could be +// a struct, a basic type, or an item implementing Stringer/Formatter) into a slice +// of strings, where each string represents a cell for the table row. +func (t *Table) convertItemToCells(item interface{}) ([]string, error) { + t.logger.Debugf("convertItemToCells: Converting item of type %T", item) + + // 1. User-defined table-wide stringer (t.stringer) takes highest precedence. + if t.stringer != nil { + res, err := t.convertToStringer(item) + if err == nil { + t.logger.Debugf("convertItemToCells: Used custom table stringer (t.stringer) for type %T. Produced %d cells: %v", item, len(res), res) + return res, nil + } + t.logger.Warnf("convertItemToCells: Custom table stringer (t.stringer) was set but incompatible or errored for type %T: %v. Will attempt other conversion methods.", item, err) + } + + // 2. Handle untyped nil directly. + if item == nil { + t.logger.Debugf("convertItemToCells: Item is untyped nil. Returning single empty cell.") + return []string{""}, nil + } + + itemValue := reflect.ValueOf(item) + itemType := itemValue.Type() + + // 3. Handle pointers: Dereference pointers to get to the underlying struct or value. + if itemType.Kind() == reflect.Ptr { + if itemValue.IsNil() { + t.logger.Debugf("convertItemToCells: Item is a nil pointer of type %s. Returning single empty cell.", itemType.String()) + return []string{""}, nil + } + itemValue = itemValue.Elem() + itemType = itemValue.Type() + t.logger.Debugf("convertItemToCells: Dereferenced pointer, now processing type %s.", itemType.String()) + } + + // 4. Special handling for structs: + if itemType.Kind() == reflect.Struct { + // Check if the original item (before potential dereference) implements Formatter or Stringer. + if formatter, ok := item.(tw.Formatter); ok { + t.logger.Debugf("convertItemToCells: Struct item (type %s) is tw.Formatter. Using Format(). Resulting in 1 cell.", itemType.Name()) + return []string{formatter.Format()}, nil + } + if stringer, ok := item.(fmt.Stringer); ok { + t.logger.Debugf("convertItemToCells: Struct item (type %s) is fmt.Stringer. Using String(). Resulting in 1 cell.", itemType.Name()) + return []string{stringer.String()}, nil + } + + t.logger.Debugf("convertItemToCells: Item is a struct (type %s). Attempting generic field reflection to expand into multiple cells.", itemType.Name()) + numFields := itemValue.NumField() + structCells := make([]string, 0, numFields) + hasProcessableFields := false + + for i := 0; i < numFields; i++ { + fieldMeta := itemType.Field(i) + if fieldMeta.PkgPath != "" { + t.logger.Debugf("convertItemToCells: Skipping unexported field %s in struct %s", fieldMeta.Name, itemType.Name()) + continue + } + hasProcessableFields = true // Mark true if we encounter any exported field + + jsonTag := fieldMeta.Tag.Get("json") + if jsonTag == "-" { + t.logger.Debugf("convertItemToCells: Skipping field %s in struct %s due to json:\"-\" tag", fieldMeta.Name, itemType.Name()) + continue + } + + fieldReflectedValue := itemValue.Field(i) + if strings.Contains(jsonTag, ",omitempty") && fieldReflectedValue.IsZero() { + t.logger.Debugf("convertItemToCells: Omitting zero value for field %s in struct %s due to omitempty tag", fieldMeta.Name, itemType.Name()) + structCells = append(structCells, "") + continue + } + structCells = append(structCells, t.convertToString(fieldReflectedValue.Interface())) + } + + // Only return expanded cells if there were processable fields. + // If a struct has no exported fields, or all were skipped via json:"-", + // it should still produce output (e.g. fmt.Sprintf of the struct) rather than an empty row. + if hasProcessableFields { + t.logger.Debugf("convertItemToCells: Struct %s reflected into %d cells: %v", itemType.Name(), len(structCells), structCells) + return structCells, nil + } + + t.logger.Warnf("convertItemToCells: Struct %s has no processable exported fields. Falling back to Sprintf for the whole item (resulting in 1 cell).", itemType.Name()) + return []string{t.convertToString(item)}, nil // 'item' is the original potentially pointer type + } + + // 5. Item is NOT a struct. It might be a basic type or a non-struct type implementing Formatter/Stringer. + // These should all result in a single cell. + if formatter, ok := item.(tw.Formatter); ok { + t.logger.Debugf("convertItemToCells: Item (non-struct, type %T) is tw.Formatter. Using Format(). Resulting in 1 cell.", item) + return []string{formatter.Format()}, nil + } + if stringer, ok := item.(fmt.Stringer); ok { + t.logger.Debugf("convertItemToCells: Item (non-struct, type %T) is fmt.Stringer. Using String(). Resulting in 1 cell.", item) + return []string{stringer.String()}, nil + } + + // 6. Fallback for any other single item (e.g., basic types like int, string, bool): + t.logger.Debugf("convertItemToCells: Item (type %T) is a basic type or unhandled by other mechanisms. Treating as single cell via convertToString.", item) + return []string{t.convertToString(item)}, nil +} + +// convertCellsToStrings converts a row to its raw string representation using specified cell config for filters. +// 'rowInput' can be []string, []any, or a custom type if t.stringer is set. +func (t *Table) convertCellsToStrings(rowInput interface{}, cellCfg tw.CellConfig) ([]string, error) { + t.logger.Debugf("convertCellsToStrings: Converting row: %v (type: %T)", rowInput, rowInput) + + var cells []string + var err error + + switch v := rowInput.(type) { + //Directly supported slice types + case []string: + cells = v + case []interface{}: // Catches variadic simple types grouped by Append + cells = make([]string, len(v)) + for i, val := range v { + cells[i] = t.convertToString(val) + } + case []int: + cells = make([]string, len(v)) + for i, val := range v { + cells[i] = strconv.Itoa(val) + } + case []int8: + cells = make([]string, len(v)) + for i, val := range v { + cells[i] = strconv.FormatInt(int64(val), 10) + } + case []int16: + cells = make([]string, len(v)) + for i, val := range v { + cells[i] = strconv.FormatInt(int64(val), 10) + } + case []int32: // Also rune + cells = make([]string, len(v)) + for i, val := range v { + cells[i] = t.convertToString(val) + } // Use convertToString for potential rune + case []int64: + cells = make([]string, len(v)) + for i, val := range v { + cells[i] = strconv.FormatInt(val, 10) + } + case []uint: + cells = make([]string, len(v)) + for i, val := range v { + cells[i] = strconv.FormatUint(uint64(val), 10) + } + case []uint8: // Also byte + cells = make([]string, len(v)) + // If it's truly []byte, convertToString will handle it as a string. + // If it's a slice of small numbers, convertToString will handle them individually. + for i, val := range v { + cells[i] = t.convertToString(val) + } + case []uint16: + cells = make([]string, len(v)) + for i, val := range v { + cells[i] = strconv.FormatUint(uint64(val), 10) + } + case []uint32: + cells = make([]string, len(v)) + for i, val := range v { + cells[i] = strconv.FormatUint(uint64(val), 10) + } + case []uint64: + cells = make([]string, len(v)) + for i, val := range v { + cells[i] = strconv.FormatUint(val, 10) + } + case []float32: + cells = make([]string, len(v)) + for i, val := range v { + cells[i] = strconv.FormatFloat(float64(val), 'f', -1, 32) + } + case []float64: + cells = make([]string, len(v)) + for i, val := range v { + cells[i] = strconv.FormatFloat(val, 'f', -1, 64) + } + case []bool: + cells = make([]string, len(v)) + for i, val := range v { + cells[i] = strconv.FormatBool(val) + } + case []tw.Formatter: + cells = make([]string, len(v)) + for i, val := range v { + cells[i] = val.Format() + } + case []fmt.Stringer: + cells = make([]string, len(v)) + for i, val := range v { + cells[i] = val.String() + } + + //Cases for single items that are NOT slices + // These are now dispatched to convertItemToCells by the default case. + // Keeping direct tw.Formatter and fmt.Stringer here could be a micro-optimization + // if `rowInput` is *exactly* that type (not a struct implementing it), + // but for clarity, `convertItemToCells` can handle these too. + // For this iteration, to match the described flow: + case tw.Formatter: // This handles a single Formatter item + t.logger.Debugf("convertCellsToStrings: Input is a single tw.Formatter. Using Format().") + cells = []string{v.Format()} + case fmt.Stringer: // This handles a single Stringer item + t.logger.Debugf("convertCellsToStrings: Input is a single fmt.Stringer. Using String().") + cells = []string{v.String()} + + default: + // If rowInput is not one of the recognized slice types above, + // or not a single Formatter/Stringer that was directly matched, + // it's treated as a single item that needs to be converted into potentially multiple cells. + // This is where structs (for field expansion) or other single values (for a single cell) are handled. + t.logger.Debugf("convertCellsToStrings: Default case for type %T. Dispatching to convertItemToCells.", rowInput) + cells, err = t.convertItemToCells(rowInput) + if err != nil { + t.logger.Errorf("convertCellsToStrings: Error from convertItemToCells for type %T: %v", rowInput, err) + return nil, err + } + } + + // Apply filters (common logic for all successful conversions) + if err == nil && cells != nil { + if cellCfg.Filter.Global != nil { + t.logger.Debugf("convertCellsToStrings: Applying global filter to cells: %v", cells) + cells = cellCfg.Filter.Global(cells) + } + if len(cellCfg.Filter.PerColumn) > 0 { + t.logger.Debugf("convertCellsToStrings: Applying per-column filters to %d cells", len(cells)) + for i := 0; i < len(cellCfg.Filter.PerColumn); i++ { + if i < len(cells) && cellCfg.Filter.PerColumn[i] != nil { + originalCell := cells[i] + cells[i] = cellCfg.Filter.PerColumn[i](cells[i]) + if cells[i] != originalCell { + t.logger.Debugf(" convertCellsToStrings: Col %d filter applied: '%s' -> '%s'", i, originalCell, cells[i]) + } + } else if i >= len(cells) && cellCfg.Filter.PerColumn[i] != nil { + t.logger.Warnf(" convertCellsToStrings: Per-column filter defined for col %d, but item only produced %d cells. Filter for this column skipped.", i, len(cells)) + } + } + } + } + + if err != nil { + t.logger.Debugf("convertCellsToStrings: Returning with error: %v", err) + return nil, err + } + t.logger.Debugf("convertCellsToStrings: Conversion and filtering completed, raw cells: %v", cells) + return cells, nil +} + +// determineLocation determines the boundary location for a line. +// Parameters include lineIdx, totalLines, topPad, and bottomPad. +// Returns a tw.Location indicating First, Middle, or End. +func (t *Table) determineLocation(lineIdx, totalLines int, topPad, bottomPad string) tw.Location { + if lineIdx == 0 && topPad == tw.Empty { + return tw.LocationFirst + } + if lineIdx == totalLines-1 && bottomPad == tw.Empty { + return tw.LocationEnd + } + return tw.LocationMiddle +} + +// ensureStreamWidthsCalculated ensures that stream widths and column count are initialized for streaming mode. +// It uses sampleData and sectionConfig to calculate widths if not already set. +// Returns an error if the column count cannot be determined. +func (t *Table) ensureStreamWidthsCalculated(sampleData []string, sectionConfig tw.CellConfig) error { + if t.streamWidths != nil && t.streamWidths.Len() > 0 { + t.logger.Debugf("Stream widths already set: %v", t.streamWidths) + return nil + } + t.streamCalculateWidths(sampleData, sectionConfig) + if t.streamNumCols == 0 { + t.logger.Warn("Failed to determine column count from sample data") + return errors.New("failed to determine column count for streaming") + } + for i := 0; i < t.streamNumCols; i++ { + if _, ok := t.streamWidths.OK(i); !ok { + t.streamWidths.Set(i, 0) + } + } + t.logger.Debugf("Initialized stream widths: %v", t.streamWidths) + return nil +} + +// getColMaxWidths retrieves maximum column widths for a section. +// Parameter position specifies the section (Header, Row, Footer). +// Returns a map of column indices to maximum widths. +func (t *Table) getColMaxWidths(position tw.Position) tw.CellWidth { + switch position { + case tw.Header: + return t.config.Header.ColMaxWidths + case tw.Row: + return t.config.Row.ColMaxWidths + case tw.Footer: + return t.config.Footer.ColMaxWidths + default: + return tw.CellWidth{} + } +} + +// getEmptyColumnInfo identifies empty columns in row data. +// Parameter numOriginalCols specifies the total column count. +// Returns a boolean slice (true for empty) and visible column count. +func (t *Table) getEmptyColumnInfo(numOriginalCols int) (isEmpty []bool, visibleColCount int) { + isEmpty = make([]bool, numOriginalCols) + for i := range isEmpty { + isEmpty[i] = true + } + + if t.config.Behavior.AutoHide.Disabled() { + t.logger.Debugf("getEmptyColumnInfo: AutoHide disabled, marking all %d columns as visible.", numOriginalCols) + for i := range isEmpty { + isEmpty[i] = false + } + visibleColCount = numOriginalCols + return isEmpty, visibleColCount + } + + t.logger.Debugf("getEmptyColumnInfo: Checking %d rows for %d columns...", len(t.rows), numOriginalCols) + + for rowIdx, logicalRow := range t.rows { + for lineIdx, visualLine := range logicalRow { + for colIdx, cellContent := range visualLine { + if colIdx >= numOriginalCols { + continue + } + if !isEmpty[colIdx] { + continue + } + + cellContent = t.Trimmer(cellContent) + + if cellContent != "" { + isEmpty[colIdx] = false + t.logger.Debugf("getEmptyColumnInfo: Found content in row %d, line %d, col %d ('%s'). Marked as not empty.", rowIdx, lineIdx, colIdx, cellContent) + } + } + } + } + + visibleColCount = 0 + for _, empty := range isEmpty { + if !empty { + visibleColCount++ + } + } + + t.logger.Debugf("getEmptyColumnInfo: Detection complete. isEmpty: %v, visibleColCount: %d", isEmpty, visibleColCount) + return isEmpty, visibleColCount +} + +// getNumColsToUse determines the number of columns to use for rendering, based on streaming or batch mode. +// Returns the number of columns (streamNumCols for streaming, maxColumns for batch). +func (t *Table) getNumColsToUse() int { + if t.config.Stream.Enable && t.hasPrinted { + t.logger.Debugf("getNumColsToUse: Using streamNumCols: %d", t.streamNumCols) + return t.streamNumCols + } + + // For batch mode: + if t.isBatchRenderNumColsSet { + // If the flag is set, batchRenderNumCols holds the authoritative count + // for the current Render() pass, even if that count is 0. + t.logger.Debugf("getNumColsToUse (batch): Using cached t.batchRenderNumCols: %d (because isBatchRenderNumColsSet is true)", t.batchRenderNumCols) + return t.batchRenderNumCols + } + + // Fallback: If not streaming and cache flag is not set (e.g., called outside a Render pass) + num := t.maxColumns() + t.logger.Debugf("getNumColsToUse (batch): Cache not active, calculated via t.maxColumns(): %d", num) + return num +} + +// prepareTableSection prepares either headers or footers for the table +func (t *Table) prepareTableSection(elements []any, config tw.CellConfig, sectionName string) [][]string { + actualCellsToProcess := t.processVariadic(elements) + t.logger.Debugf("%s(): Effective cells to process: %v", sectionName, actualCellsToProcess) + + stringsResult, err := t.convertCellsToStrings(actualCellsToProcess, config) + if err != nil { + t.logger.Errorf("%s(): Failed to convert elements to strings: %v", sectionName, err) + stringsResult = []string{} + } + + prepared := t.prepareContent(stringsResult, config) + numColsBatch := t.maxColumns() + + if len(prepared) > 0 { + for i := range prepared { + if len(prepared[i]) < numColsBatch { + t.logger.Debugf("Padding %s line %d from %d to %d columns", sectionName, i, len(prepared[i]), numColsBatch) + paddedLine := make([]string, numColsBatch) + copy(paddedLine, prepared[i]) + for j := len(prepared[i]); j < numColsBatch; j++ { + paddedLine[j] = tw.Empty + } + prepared[i] = paddedLine + } else if len(prepared[i]) > numColsBatch { + t.logger.Debugf("Truncating %s line %d from %d to %d columns", sectionName, i, len(prepared[i]), numColsBatch) + prepared[i] = prepared[i][:numColsBatch] + } + } + } + + return prepared +} + +// processVariadic handles the common logic for processing variadic arguments +// that could be either individual elements or a slice of elements +func (t *Table) processVariadic(elements []any) []any { + if len(elements) == 1 { + switch v := elements[0].(type) { + case []string: + t.logger.Debugf("Detected single []string argument. Unpacking it (fast path).") + out := make([]any, len(v)) + for i := range v { + out[i] = v[i] + } + return out + + case []interface{}: + t.logger.Debugf("Detected single []interface{} argument. Unpacking it (fast path).") + out := make([]any, len(v)) + copy(out, v) + return out + } + } + + t.logger.Debugf("Input has multiple elements or single non-slice. Using variadic elements as-is.") + return elements +} + +// toStringLines converts raw cells to formatted lines for table output +func (t *Table) toStringLines(row interface{}, config tw.CellConfig) ([][]string, error) { + cells, err := t.convertCellsToStrings(row, config) + if err != nil { + return nil, err + } + return t.prepareContent(cells, config), nil +} + +// updateWidths updates the width map based on cell content and padding. +// Parameters include row content, widths map, and padding configuration. +// No return value. +func (t *Table) updateWidths(row []string, widths tw.Mapper[int, int], padding tw.CellPadding) { + t.logger.Debugf("Updating widths for row: %v", row) + for i, cell := range row { + colPad := padding.Global + + if i < len(padding.PerColumn) && padding.PerColumn[i].Paddable() { + colPad = padding.PerColumn[i] + t.logger.Debugf(" Col %d: Using per-column padding: L:'%s' R:'%s'", i, colPad.Left, colPad.Right) + } else { + t.logger.Debugf(" Col %d: Using global padding: L:'%s' R:'%s'", i, padding.Global.Left, padding.Global.Right) + } + + padLeftWidth := tw.DisplayWidth(colPad.Left) + padRightWidth := tw.DisplayWidth(colPad.Right) + + // Split cell into lines and find maximum content width + lines := strings.Split(cell, tw.NewLine) + contentWidth := 0 + for _, line := range lines { + lineWidth := tw.DisplayWidth(line) + if t.config.Behavior.TrimSpace.Enabled() { + lineWidth = tw.DisplayWidth(t.Trimmer(line)) + } + if lineWidth > contentWidth { + contentWidth = lineWidth + } + } + + totalWidth := contentWidth + padLeftWidth + padRightWidth + minRequiredPaddingWidth := padLeftWidth + padRightWidth + + if contentWidth == 0 && totalWidth < minRequiredPaddingWidth { + t.logger.Debugf(" Col %d: Empty content, ensuring width >= padding width (%d). Setting totalWidth to %d.", i, minRequiredPaddingWidth, minRequiredPaddingWidth) + totalWidth = minRequiredPaddingWidth + } + + if totalWidth < 1 { + t.logger.Debugf(" Col %d: Calculated totalWidth is zero, setting minimum width to 1.", i) + totalWidth = 1 + } + + currentMax, _ := widths.OK(i) + if totalWidth > currentMax { + widths.Set(i, totalWidth) + t.logger.Debugf(" Col %d: Updated width from %d to %d (content:%d + padL:%d + padR:%d) for cell '%s'", i, currentMax, totalWidth, contentWidth, padLeftWidth, padRightWidth, cell) + } else { + t.logger.Debugf(" Col %d: Width %d not greater than current max %d for cell '%s'", i, totalWidth, currentMax, cell) + } + } +} diff --git a/vendor/github.com/yuin/goldmark/ast/block.go b/vendor/github.com/yuin/goldmark/ast/block.go index eae7acd..efeea08 100644 --- a/vendor/github.com/yuin/goldmark/ast/block.go +++ b/vendor/github.com/yuin/goldmark/ast/block.go @@ -10,8 +10,8 @@ import ( // A BaseBlock struct implements the Node interface partialliy. type BaseBlock struct { BaseNode + lines textm.Segments blankPreviousLines bool - lines *textm.Segments } // Type implements Node.Type. @@ -36,15 +36,12 @@ func (b *BaseBlock) SetBlankPreviousLines(v bool) { // Lines implements Node.Lines. func (b *BaseBlock) Lines() *textm.Segments { - if b.lines == nil { - b.lines = textm.NewSegments() - } - return b.lines + return &b.lines } // SetLines implements Node.SetLines. func (b *BaseBlock) SetLines(v *textm.Segments) { - b.lines = v + b.lines = *v } // A Document struct is a root node of Markdown text. @@ -515,6 +512,7 @@ func (n *HTMLBlock) Dump(source []byte, level int) { cl := n.ClosureLine fmt.Printf("%sClosure: \"%s\"\n", indent2, string(cl.Value(source))) } + fmt.Printf("%sHasBlankPreviousLines: %v\n", indent2, n.HasBlankPreviousLines()) fmt.Printf("%s}\n", indent) } diff --git a/vendor/github.com/yuin/goldmark/parser/code_block.go b/vendor/github.com/yuin/goldmark/parser/code_block.go index d99146c..5a24016 100644 --- a/vendor/github.com/yuin/goldmark/parser/code_block.go +++ b/vendor/github.com/yuin/goldmark/parser/code_block.go @@ -37,7 +37,7 @@ func (b *codeBlockParser) Open(parent ast.Node, reader text.Reader, pc Context) } segment.ForceNewline = true node.Lines().Append(segment) - reader.Advance(segment.Len() - 1) + reader.AdvanceToEOL() return node, NoChildren } @@ -62,7 +62,7 @@ func (b *codeBlockParser) Continue(node ast.Node, reader text.Reader, pc Context segment.ForceNewline = true node.Lines().Append(segment) - reader.Advance(segment.Len() - 1) + reader.AdvanceToEOL() return Continue | NoChildren } diff --git a/vendor/github.com/yuin/goldmark/parser/html_block.go b/vendor/github.com/yuin/goldmark/parser/html_block.go index 09dc21f..262ef93 100644 --- a/vendor/github.com/yuin/goldmark/parser/html_block.go +++ b/vendor/github.com/yuin/goldmark/parser/html_block.go @@ -150,7 +150,7 @@ func (b *htmlBlockParser) Open(parent ast.Node, reader text.Reader, pc Context) } } if node != nil { - reader.Advance(segment.Len() - util.TrimRightSpaceLength(line)) + reader.AdvanceToEOL() node.Lines().Append(segment) return node, NoChildren } @@ -173,7 +173,7 @@ func (b *htmlBlockParser) Continue(node ast.Node, reader text.Reader, pc Context } if htmlBlockType1CloseRegexp.Match(line) { htmlBlock.ClosureLine = segment - reader.Advance(segment.Len() - util.TrimRightSpaceLength(line)) + reader.AdvanceToEOL() return Close } case ast.HTMLBlockType2: @@ -202,7 +202,7 @@ func (b *htmlBlockParser) Continue(node ast.Node, reader text.Reader, pc Context } if bytes.Contains(line, closurePattern) { htmlBlock.ClosureLine = segment - reader.Advance(segment.Len()) + reader.AdvanceToEOL() return Close } @@ -212,7 +212,7 @@ func (b *htmlBlockParser) Continue(node ast.Node, reader text.Reader, pc Context } } node.Lines().Append(segment) - reader.Advance(segment.Len() - util.TrimRightSpaceLength(line)) + reader.AdvanceToEOL() return Continue | NoChildren } diff --git a/vendor/github.com/yuin/goldmark/parser/list_item.go b/vendor/github.com/yuin/goldmark/parser/list_item.go index 2206ad9..f4d7da4 100644 --- a/vendor/github.com/yuin/goldmark/parser/list_item.go +++ b/vendor/github.com/yuin/goldmark/parser/list_item.go @@ -53,7 +53,7 @@ func (b *listItemParser) Open(parent ast.Node, reader text.Reader, pc Context) ( func (b *listItemParser) Continue(node ast.Node, reader text.Reader, pc Context) State { line, _ := reader.PeekLine() if util.IsBlank(line) { - reader.Advance(len(line) - 1) + reader.AdvanceToEOL() return Continue | HasChildren } diff --git a/vendor/github.com/yuin/goldmark/parser/paragraph.go b/vendor/github.com/yuin/goldmark/parser/paragraph.go index 9d3fa38..801b0df 100644 --- a/vendor/github.com/yuin/goldmark/parser/paragraph.go +++ b/vendor/github.com/yuin/goldmark/parser/paragraph.go @@ -29,7 +29,7 @@ func (b *paragraphParser) Open(parent ast.Node, reader text.Reader, pc Context) } node := ast.NewParagraph() node.Lines().Append(segment) - reader.Advance(segment.Len() - 1) + reader.AdvanceToEOL() return node, NoChildren } @@ -39,7 +39,7 @@ func (b *paragraphParser) Continue(node ast.Node, reader text.Reader, pc Context return Close } node.Lines().Append(segment) - reader.Advance(segment.Len() - 1) + reader.AdvanceToEOL() return Continue | NoChildren } diff --git a/vendor/github.com/yuin/goldmark/parser/parser.go b/vendor/github.com/yuin/goldmark/parser/parser.go index b05db13..78a6b26 100644 --- a/vendor/github.com/yuin/goldmark/parser/parser.go +++ b/vendor/github.com/yuin/goldmark/parser/parser.go @@ -1030,47 +1030,35 @@ type lineStat struct { } func isBlankLine(lineNum, level int, stats []lineStat) bool { - ret := true - for i := len(stats) - 1 - level; i >= 0; i-- { - ret = false + l := len(stats) + if l == 0 { + return true + } + for i := l - 1 - level; i >= 0; i-- { s := stats[i] - if s.lineNum == lineNum { - if s.level < level && s.isBlank { - return true - } else if s.level == level { - return s.isBlank - } - } - if s.lineNum < lineNum { - return ret + if s.lineNum == lineNum && s.level <= level { + return s.isBlank + } else if s.lineNum < lineNum { + break } } - return ret + return false } func (p *parser) parseBlocks(parent ast.Node, reader text.Reader, pc Context) { - pc.SetOpenedBlocks([]Block{}) + pc.SetOpenedBlocks(nil) blankLines := make([]lineStat, 0, 128) - var isBlank bool for { // process blocks separated by blank lines - _, lines, ok := reader.SkipBlankLines() + _, _, ok := reader.SkipBlankLines() if !ok { return } - lineNum, _ := reader.Position() - if lines != 0 { - blankLines = blankLines[0:0] - l := len(pc.OpenedBlocks()) - for i := 0; i < l; i++ { - blankLines = append(blankLines, lineStat{lineNum - 1, i, lines != 0}) - } - } - isBlank = isBlankLine(lineNum-1, 0, blankLines) // first, we try to open blocks - if p.openBlocks(parent, isBlank, reader, pc) != newBlocksOpened { + if p.openBlocks(parent, true, reader, pc) != newBlocksOpened { return } reader.AdvanceLine() + blankLines = blankLines[0:0] for { // process opened blocks line by line openedBlocks := pc.OpenedBlocks() l := len(openedBlocks) @@ -1096,7 +1084,7 @@ func (p *parser) parseBlocks(parent ast.Node, reader text.Reader, pc Context) { // When current node is a container block and has no children, // we try to open new child nodes if state&HasChildren != 0 && i == lastIndex { - isBlank = isBlankLine(lineNum-1, i, blankLines) + isBlank := isBlankLine(lineNum-1, i+1, blankLines) p.openBlocks(be.Node, isBlank, reader, pc) break } @@ -1104,7 +1092,7 @@ func (p *parser) parseBlocks(parent ast.Node, reader text.Reader, pc Context) { } } // current node may be closed or lazy continuation - isBlank = isBlankLine(lineNum-1, i, blankLines) + isBlank := isBlankLine(lineNum-1, i, blankLines) thisParent := parent if i != 0 { thisParent = openedBlocks[i-1].Node diff --git a/vendor/github.com/yuin/goldmark/parser/thematic_break.go b/vendor/github.com/yuin/goldmark/parser/thematic_break.go index db20a1e..ea015c8 100644 --- a/vendor/github.com/yuin/goldmark/parser/thematic_break.go +++ b/vendor/github.com/yuin/goldmark/parser/thematic_break.go @@ -50,9 +50,9 @@ func (b *thematicBreakPraser) Trigger() []byte { } func (b *thematicBreakPraser) Open(parent ast.Node, reader text.Reader, pc Context) (ast.Node, State) { - line, segment := reader.PeekLine() + line, _ := reader.PeekLine() if isThematicBreak(line, reader.LineOffset()) { - reader.Advance(segment.Len() - 1) + reader.AdvanceToEOL() return ast.NewThematicBreak(), NoChildren } return nil, NoChildren diff --git a/vendor/github.com/yuin/goldmark/text/reader.go b/vendor/github.com/yuin/goldmark/text/reader.go index b3f97fb..21083dc 100644 --- a/vendor/github.com/yuin/goldmark/text/reader.go +++ b/vendor/github.com/yuin/goldmark/text/reader.go @@ -55,6 +55,11 @@ type Reader interface { // reader. AdvanceAndSetPadding(int, int) + // AdvanceToEOL advances the internal pointer to the end of line. + // If the line ends with a newline, it will be included in the segment. + // If the line ends with EOF, it will not be included in the segment. + AdvanceToEOL() + // AdvanceLine advances the internal pointer to the next line head. AdvanceLine() @@ -220,21 +225,46 @@ func (r *reader) AdvanceAndSetPadding(n, padding int) { } } +func (r *reader) AdvanceToEOL() { + if r.pos.Start >= r.sourceLength { + return + } + + r.lineOffset = -1 + i := -1 + if r.peekedLine != nil { + r.pos.Start += len(r.peekedLine) - r.pos.Padding - 1 + if r.source[r.pos.Start] == '\n' { + i = 0 + } + } + if i == -1 { + i = bytes.IndexByte(r.source[r.pos.Start:], '\n') + } + r.peekedLine = nil + if i != -1 { + r.pos.Start += i + } else { + r.pos.Start = r.sourceLength + } + r.pos.Padding = 0 +} + func (r *reader) AdvanceLine() { r.lineOffset = -1 r.peekedLine = nil r.pos.Start = r.pos.Stop r.head = r.pos.Start - if r.pos.Start < 0 { + if r.pos.Start < 0 || r.pos.Start >= r.sourceLength { return } r.pos.Stop = r.sourceLength - for i := r.pos.Start; i < r.sourceLength; i++ { - c := r.source[i] - if c == '\n' { - r.pos.Stop = i + 1 - break - } + i := 0 + if r.source[r.pos.Start] != '\n' { + i = bytes.IndexByte(r.source[r.pos.Start:], '\n') + } + if i != -1 { + r.pos.Stop = r.pos.Start + i + 1 } r.line++ r.pos.Padding = 0 @@ -444,6 +474,17 @@ func (r *blockReader) AdvanceAndSetPadding(n, padding int) { } } +func (r *blockReader) AdvanceToEOL() { + r.lineOffset = -1 + r.pos.Padding = 0 + c := r.source[r.pos.Stop-1] + if c == '\n' { + r.pos.Start = r.pos.Stop - 1 + } else { + r.pos.Start = r.pos.Stop + } +} + func (r *blockReader) AdvanceLine() { r.SetPosition(r.line+1, NewSegment(invalidValue, invalidValue)) r.head = r.pos.Start diff --git a/vendor/github.com/yuin/goldmark/text/segment.go b/vendor/github.com/yuin/goldmark/text/segment.go index 93fbf19..30655dd 100644 --- a/vendor/github.com/yuin/goldmark/text/segment.go +++ b/vendor/github.com/yuin/goldmark/text/segment.go @@ -176,17 +176,11 @@ func NewSegments() *Segments { // Append appends the given segment after the tail of the collection. func (s *Segments) Append(t Segment) { - if s.values == nil { - s.values = make([]Segment, 0, 20) - } s.values = append(s.values, t) } // AppendAll appends all elements of given segments after the tail of the collection. func (s *Segments) AppendAll(t []Segment) { - if s.values == nil { - s.values = make([]Segment, 0, 20) - } s.values = append(s.values, t...) } diff --git a/vendor/go.mau.fi/util/exhttp/cors.go b/vendor/go.mau.fi/util/exhttp/cors.go index 037be8d..a27bda2 100644 --- a/vendor/go.mau.fi/util/exhttp/cors.go +++ b/vendor/go.mau.fi/util/exhttp/cors.go @@ -1,3 +1,9 @@ +// Copyright (c) 2024 Sumner Evans +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + package exhttp import "net/http" diff --git a/vendor/go.mau.fi/util/exhttp/handleerrors.go b/vendor/go.mau.fi/util/exhttp/handleerrors.go index d2d37b1..eba389b 100644 --- a/vendor/go.mau.fi/util/exhttp/handleerrors.go +++ b/vendor/go.mau.fi/util/exhttp/handleerrors.go @@ -1,3 +1,9 @@ +// Copyright (c) 2024 Sumner Evans +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + package exhttp import "net/http" diff --git a/vendor/go.mau.fi/util/exhttp/json.go b/vendor/go.mau.fi/util/exhttp/json.go index 2717b0f..91d7f0e 100644 --- a/vendor/go.mau.fi/util/exhttp/json.go +++ b/vendor/go.mau.fi/util/exhttp/json.go @@ -1,3 +1,9 @@ +// Copyright (c) 2024 Sumner Evans +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + package exhttp import ( @@ -26,10 +32,5 @@ func WriteJSONData(w http.ResponseWriter, httpStatusCode int, data []byte) { } func WriteEmptyJSONResponse(w http.ResponseWriter, httpStatusCode int) { - if AutoAllowCORS { - AddCORSHeaders(w) - } - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(httpStatusCode) - _, _ = w.Write([]byte("{}")) + WriteJSONData(w, httpStatusCode, []byte("{}")) } diff --git a/vendor/go.mau.fi/util/exhttp/middleware.go b/vendor/go.mau.fi/util/exhttp/middleware.go index 733d348..fb1ab59 100644 --- a/vendor/go.mau.fi/util/exhttp/middleware.go +++ b/vendor/go.mau.fi/util/exhttp/middleware.go @@ -1,3 +1,9 @@ +// Copyright (c) 2024 Sumner Evans +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + package exhttp import "net/http" diff --git a/vendor/go.mau.fi/util/exhttp/networkerror.go b/vendor/go.mau.fi/util/exhttp/networkerror.go new file mode 100644 index 0000000..58c55b8 --- /dev/null +++ b/vendor/go.mau.fi/util/exhttp/networkerror.go @@ -0,0 +1,37 @@ +// Copyright (c) 2025 Toni Spets +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +package exhttp + +import ( + "errors" + "net" + "syscall" + + "golang.org/x/net/http2" +) + +func IsNetworkError(err error) bool { + if errno := syscall.Errno(0); errors.As(err, &errno) { + // common errnos for network related operations + return errno == syscall.ENETDOWN || + errno == syscall.ENETUNREACH || + errno == syscall.ENETRESET || + errno == syscall.ECONNABORTED || + errno == syscall.ECONNRESET || + errno == syscall.ENOBUFS || + errno == syscall.ETIMEDOUT || + errno == syscall.ECONNREFUSED || + errno == syscall.EHOSTDOWN || + errno == syscall.EHOSTUNREACH + } else if netError := net.Error(nil); errors.As(err, &netError) { + return true + } else if errors.As(err, &http2.StreamError{}) { + return true + } + + return false +} diff --git a/vendor/go.mau.fi/util/exstrings/stringutil.go b/vendor/go.mau.fi/util/exstrings/stringutil.go new file mode 100644 index 0000000..28a1dc1 --- /dev/null +++ b/vendor/go.mau.fi/util/exstrings/stringutil.go @@ -0,0 +1,76 @@ +// Copyright (c) 2025 Tulir Asokan +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +package exstrings + +import ( + "crypto/sha256" + "crypto/subtle" + "strings" + "unsafe" +) + +// UnsafeBytes returns a byte slice that points to the same memory as the input string. +// +// The returned byte slice must not be modified. +func UnsafeBytes(str string) []byte { + return unsafe.Slice(unsafe.StringData(str), len(str)) +} + +// SHA256 returns the SHA-256 hash of the input string without copying the string. +func SHA256(str string) [32]byte { + return sha256.Sum256(UnsafeBytes(str)) +} + +// ConstantTimeEqual compares two strings using [subtle.ConstantTimeCompare] without copying the strings. +// +// Note that ConstantTimeCompare is not constant time if the strings are of different length. +func ConstantTimeEqual(a, b string) bool { + return subtle.ConstantTimeCompare(UnsafeBytes(a), UnsafeBytes(b)) == 1 +} + +// LongestSequenceOf returns the length of the longest contiguous sequence of a single rune in a string. +func LongestSequenceOf(a string, b rune) int { + // IndexRune has some optimizations, so use it to find the starting point + firstIndex := strings.IndexRune(a, b) + if firstIndex == -1 { + return 0 + } + count := 0 + maxCount := 0 + for _, r := range a[firstIndex:] { + if r == b { + count++ + if count > maxCount { + maxCount = count + } + } else { + count = 0 + } + } + return maxCount +} + +// LongestSequenceOfFunc returns the length of the longest contiguous sequence of runes in a string. +// +// If the provided function returns zero or higher, the return value is added to the current count. +// If the return value is negative, the count is reset to zero. +func LongestSequenceOfFunc(a string, fn func(b rune) int) int { + count := 0 + maxCount := 0 + for _, r := range a { + val := fn(r) + if val < 0 { + count = 0 + } else { + count += val + if count > maxCount { + maxCount = count + } + } + } + return maxCount +} diff --git a/vendor/go.mau.fi/util/jsonbytes/unpadded.go b/vendor/go.mau.fi/util/jsonbytes/unpadded.go index 37ffb64..d7d17de 100644 --- a/vendor/go.mau.fi/util/jsonbytes/unpadded.go +++ b/vendor/go.mau.fi/util/jsonbytes/unpadded.go @@ -28,3 +28,21 @@ func (b *UnpaddedBytes) UnmarshalJSON(data []byte) error { *b, err = base64.RawStdEncoding.DecodeString(b64str) return err } + +// UnpaddedURLBytes is a byte slice that is encoded and decoded using +// [base64.RawURLEncoding] instead of the default padded base64. +type UnpaddedURLBytes []byte + +func (b UnpaddedURLBytes) MarshalJSON() ([]byte, error) { + return json.Marshal(base64.RawURLEncoding.EncodeToString(b)) +} + +func (b *UnpaddedURLBytes) UnmarshalJSON(data []byte) error { + var b64str string + err := json.Unmarshal(data, &b64str) + if err != nil { + return err + } + *b, err = base64.RawURLEncoding.DecodeString(b64str) + return err +} diff --git a/vendor/golang.org/x/crypto/ssh/certs.go b/vendor/golang.org/x/crypto/ssh/certs.go index 27d0e14..a3dc629 100644 --- a/vendor/golang.org/x/crypto/ssh/certs.go +++ b/vendor/golang.org/x/crypto/ssh/certs.go @@ -20,14 +20,19 @@ import ( // returned by MultiAlgorithmSigner and don't appear in the Signature.Format // field. const ( - CertAlgoRSAv01 = "ssh-rsa-cert-v01@openssh.com" - CertAlgoDSAv01 = "ssh-dss-cert-v01@openssh.com" - CertAlgoECDSA256v01 = "ecdsa-sha2-nistp256-cert-v01@openssh.com" - CertAlgoECDSA384v01 = "ecdsa-sha2-nistp384-cert-v01@openssh.com" - CertAlgoECDSA521v01 = "ecdsa-sha2-nistp521-cert-v01@openssh.com" - CertAlgoSKECDSA256v01 = "sk-ecdsa-sha2-nistp256-cert-v01@openssh.com" - CertAlgoED25519v01 = "ssh-ed25519-cert-v01@openssh.com" - CertAlgoSKED25519v01 = "sk-ssh-ed25519-cert-v01@openssh.com" + CertAlgoRSAv01 = "ssh-rsa-cert-v01@openssh.com" + // Deprecated: DSA is only supported at insecure key sizes, and was removed + // from major implementations. + CertAlgoDSAv01 = InsecureCertAlgoDSAv01 + // Deprecated: DSA is only supported at insecure key sizes, and was removed + // from major implementations. + InsecureCertAlgoDSAv01 = "ssh-dss-cert-v01@openssh.com" + CertAlgoECDSA256v01 = "ecdsa-sha2-nistp256-cert-v01@openssh.com" + CertAlgoECDSA384v01 = "ecdsa-sha2-nistp384-cert-v01@openssh.com" + CertAlgoECDSA521v01 = "ecdsa-sha2-nistp521-cert-v01@openssh.com" + CertAlgoSKECDSA256v01 = "sk-ecdsa-sha2-nistp256-cert-v01@openssh.com" + CertAlgoED25519v01 = "ssh-ed25519-cert-v01@openssh.com" + CertAlgoSKED25519v01 = "sk-ssh-ed25519-cert-v01@openssh.com" // CertAlgoRSASHA256v01 and CertAlgoRSASHA512v01 can't appear as a // Certificate.Type (or PublicKey.Type), but only in @@ -485,16 +490,16 @@ func (c *Certificate) SignCert(rand io.Reader, authority Signer) error { // // This map must be kept in sync with the one in agent/client.go. var certKeyAlgoNames = map[string]string{ - CertAlgoRSAv01: KeyAlgoRSA, - CertAlgoRSASHA256v01: KeyAlgoRSASHA256, - CertAlgoRSASHA512v01: KeyAlgoRSASHA512, - CertAlgoDSAv01: KeyAlgoDSA, - CertAlgoECDSA256v01: KeyAlgoECDSA256, - CertAlgoECDSA384v01: KeyAlgoECDSA384, - CertAlgoECDSA521v01: KeyAlgoECDSA521, - CertAlgoSKECDSA256v01: KeyAlgoSKECDSA256, - CertAlgoED25519v01: KeyAlgoED25519, - CertAlgoSKED25519v01: KeyAlgoSKED25519, + CertAlgoRSAv01: KeyAlgoRSA, + CertAlgoRSASHA256v01: KeyAlgoRSASHA256, + CertAlgoRSASHA512v01: KeyAlgoRSASHA512, + InsecureCertAlgoDSAv01: InsecureKeyAlgoDSA, + CertAlgoECDSA256v01: KeyAlgoECDSA256, + CertAlgoECDSA384v01: KeyAlgoECDSA384, + CertAlgoECDSA521v01: KeyAlgoECDSA521, + CertAlgoSKECDSA256v01: KeyAlgoSKECDSA256, + CertAlgoED25519v01: KeyAlgoED25519, + CertAlgoSKED25519v01: KeyAlgoSKED25519, } // underlyingAlgo returns the signature algorithm associated with algo (which is diff --git a/vendor/golang.org/x/crypto/ssh/cipher.go b/vendor/golang.org/x/crypto/ssh/cipher.go index 741e984..6a5b582 100644 --- a/vendor/golang.org/x/crypto/ssh/cipher.go +++ b/vendor/golang.org/x/crypto/ssh/cipher.go @@ -58,11 +58,11 @@ func newRC4(key, iv []byte) (cipher.Stream, error) { type cipherMode struct { keySize int ivSize int - create func(key, iv []byte, macKey []byte, algs directionAlgorithms) (packetCipher, error) + create func(key, iv []byte, macKey []byte, algs DirectionAlgorithms) (packetCipher, error) } -func streamCipherMode(skip int, createFunc func(key, iv []byte) (cipher.Stream, error)) func(key, iv []byte, macKey []byte, algs directionAlgorithms) (packetCipher, error) { - return func(key, iv, macKey []byte, algs directionAlgorithms) (packetCipher, error) { +func streamCipherMode(skip int, createFunc func(key, iv []byte) (cipher.Stream, error)) func(key, iv []byte, macKey []byte, algs DirectionAlgorithms) (packetCipher, error) { + return func(key, iv, macKey []byte, algs DirectionAlgorithms) (packetCipher, error) { stream, err := createFunc(key, iv) if err != nil { return nil, err @@ -98,36 +98,36 @@ func streamCipherMode(skip int, createFunc func(key, iv []byte) (cipher.Stream, var cipherModes = map[string]*cipherMode{ // Ciphers from RFC 4344, which introduced many CTR-based ciphers. Algorithms // are defined in the order specified in the RFC. - "aes128-ctr": {16, aes.BlockSize, streamCipherMode(0, newAESCTR)}, - "aes192-ctr": {24, aes.BlockSize, streamCipherMode(0, newAESCTR)}, - "aes256-ctr": {32, aes.BlockSize, streamCipherMode(0, newAESCTR)}, + CipherAES128CTR: {16, aes.BlockSize, streamCipherMode(0, newAESCTR)}, + CipherAES192CTR: {24, aes.BlockSize, streamCipherMode(0, newAESCTR)}, + CipherAES256CTR: {32, aes.BlockSize, streamCipherMode(0, newAESCTR)}, // Ciphers from RFC 4345, which introduces security-improved arcfour ciphers. // They are defined in the order specified in the RFC. - "arcfour128": {16, 0, streamCipherMode(1536, newRC4)}, - "arcfour256": {32, 0, streamCipherMode(1536, newRC4)}, + InsecureCipherRC4128: {16, 0, streamCipherMode(1536, newRC4)}, + InsecureCipherRC4256: {32, 0, streamCipherMode(1536, newRC4)}, // Cipher defined in RFC 4253, which describes SSH Transport Layer Protocol. // Note that this cipher is not safe, as stated in RFC 4253: "Arcfour (and // RC4) has problems with weak keys, and should be used with caution." // RFC 4345 introduces improved versions of Arcfour. - "arcfour": {16, 0, streamCipherMode(0, newRC4)}, + InsecureCipherRC4: {16, 0, streamCipherMode(0, newRC4)}, // AEAD ciphers - gcm128CipherID: {16, 12, newGCMCipher}, - gcm256CipherID: {32, 12, newGCMCipher}, - chacha20Poly1305ID: {64, 0, newChaCha20Cipher}, + CipherAES128GCM: {16, 12, newGCMCipher}, + CipherAES256GCM: {32, 12, newGCMCipher}, + CipherChaCha20Poly1305: {64, 0, newChaCha20Cipher}, // CBC mode is insecure and so is not included in the default config. // (See https://www.ieee-security.org/TC/SP2013/papers/4977a526.pdf). If absolutely // needed, it's possible to specify a custom Config to enable it. // You should expect that an active attacker can recover plaintext if // you do. - aes128cbcID: {16, aes.BlockSize, newAESCBCCipher}, + InsecureCipherAES128CBC: {16, aes.BlockSize, newAESCBCCipher}, // 3des-cbc is insecure and is not included in the default // config. - tripledescbcID: {24, des.BlockSize, newTripleDESCBCCipher}, + InsecureCipherTripleDESCBC: {24, des.BlockSize, newTripleDESCBCCipher}, } // prefixLen is the length of the packet prefix that contains the packet length @@ -307,7 +307,7 @@ type gcmCipher struct { buf []byte } -func newGCMCipher(key, iv, unusedMacKey []byte, unusedAlgs directionAlgorithms) (packetCipher, error) { +func newGCMCipher(key, iv, unusedMacKey []byte, unusedAlgs DirectionAlgorithms) (packetCipher, error) { c, err := aes.NewCipher(key) if err != nil { return nil, err @@ -429,7 +429,7 @@ type cbcCipher struct { oracleCamouflage uint32 } -func newCBCCipher(c cipher.Block, key, iv, macKey []byte, algs directionAlgorithms) (packetCipher, error) { +func newCBCCipher(c cipher.Block, key, iv, macKey []byte, algs DirectionAlgorithms) (packetCipher, error) { cbc := &cbcCipher{ mac: macModes[algs.MAC].new(macKey), decrypter: cipher.NewCBCDecrypter(c, iv), @@ -443,7 +443,7 @@ func newCBCCipher(c cipher.Block, key, iv, macKey []byte, algs directionAlgorith return cbc, nil } -func newAESCBCCipher(key, iv, macKey []byte, algs directionAlgorithms) (packetCipher, error) { +func newAESCBCCipher(key, iv, macKey []byte, algs DirectionAlgorithms) (packetCipher, error) { c, err := aes.NewCipher(key) if err != nil { return nil, err @@ -457,7 +457,7 @@ func newAESCBCCipher(key, iv, macKey []byte, algs directionAlgorithms) (packetCi return cbc, nil } -func newTripleDESCBCCipher(key, iv, macKey []byte, algs directionAlgorithms) (packetCipher, error) { +func newTripleDESCBCCipher(key, iv, macKey []byte, algs DirectionAlgorithms) (packetCipher, error) { c, err := des.NewTripleDESCipher(key) if err != nil { return nil, err @@ -635,8 +635,6 @@ func (c *cbcCipher) writeCipherPacket(seqNum uint32, w io.Writer, rand io.Reader return nil } -const chacha20Poly1305ID = "chacha20-poly1305@openssh.com" - // chacha20Poly1305Cipher implements the chacha20-poly1305@openssh.com // AEAD, which is described here: // @@ -650,7 +648,7 @@ type chacha20Poly1305Cipher struct { buf []byte } -func newChaCha20Cipher(key, unusedIV, unusedMACKey []byte, unusedAlgs directionAlgorithms) (packetCipher, error) { +func newChaCha20Cipher(key, unusedIV, unusedMACKey []byte, unusedAlgs DirectionAlgorithms) (packetCipher, error) { if len(key) != 64 { panic(len(key)) } diff --git a/vendor/golang.org/x/crypto/ssh/client.go b/vendor/golang.org/x/crypto/ssh/client.go index fd8c497..3307978 100644 --- a/vendor/golang.org/x/crypto/ssh/client.go +++ b/vendor/golang.org/x/crypto/ssh/client.go @@ -110,6 +110,7 @@ func (c *connection) clientHandshake(dialAddress string, config *ClientConfig) e } c.sessionID = c.transport.getSessionID() + c.algorithms = c.transport.getAlgorithms() return c.clientAuthenticate(config) } diff --git a/vendor/golang.org/x/crypto/ssh/common.go b/vendor/golang.org/x/crypto/ssh/common.go index 7e9c2cb..0415d33 100644 --- a/vendor/golang.org/x/crypto/ssh/common.go +++ b/vendor/golang.org/x/crypto/ssh/common.go @@ -10,6 +10,7 @@ import ( "fmt" "io" "math" + "slices" "sync" _ "crypto/sha1" @@ -24,69 +25,258 @@ const ( serviceSSH = "ssh-connection" ) -// supportedCiphers lists ciphers we support but might not recommend. -var supportedCiphers = []string{ - "aes128-ctr", "aes192-ctr", "aes256-ctr", - "aes128-gcm@openssh.com", gcm256CipherID, - chacha20Poly1305ID, - "arcfour256", "arcfour128", "arcfour", - aes128cbcID, - tripledescbcID, +// The ciphers currently or previously implemented by this library, to use in +// [Config.Ciphers]. For a list, see the [Algorithms.Ciphers] returned by +// [SupportedAlgorithms] or [InsecureAlgorithms]. +const ( + CipherAES128GCM = "aes128-gcm@openssh.com" + CipherAES256GCM = "aes256-gcm@openssh.com" + CipherChaCha20Poly1305 = "chacha20-poly1305@openssh.com" + CipherAES128CTR = "aes128-ctr" + CipherAES192CTR = "aes192-ctr" + CipherAES256CTR = "aes256-ctr" + InsecureCipherAES128CBC = "aes128-cbc" + InsecureCipherTripleDESCBC = "3des-cbc" + InsecureCipherRC4 = "arcfour" + InsecureCipherRC4128 = "arcfour128" + InsecureCipherRC4256 = "arcfour256" +) + +// The key exchanges currently or previously implemented by this library, to use +// in [Config.KeyExchanges]. For a list, see the +// [Algorithms.KeyExchanges] returned by [SupportedAlgorithms] or +// [InsecureAlgorithms]. +const ( + InsecureKeyExchangeDH1SHA1 = "diffie-hellman-group1-sha1" + InsecureKeyExchangeDH14SHA1 = "diffie-hellman-group14-sha1" + KeyExchangeDH14SHA256 = "diffie-hellman-group14-sha256" + KeyExchangeDH16SHA512 = "diffie-hellman-group16-sha512" + KeyExchangeECDHP256 = "ecdh-sha2-nistp256" + KeyExchangeECDHP384 = "ecdh-sha2-nistp384" + KeyExchangeECDHP521 = "ecdh-sha2-nistp521" + KeyExchangeCurve25519 = "curve25519-sha256" + InsecureKeyExchangeDHGEXSHA1 = "diffie-hellman-group-exchange-sha1" + KeyExchangeDHGEXSHA256 = "diffie-hellman-group-exchange-sha256" + // KeyExchangeMLKEM768X25519 is supported from Go 1.24. + KeyExchangeMLKEM768X25519 = "mlkem768x25519-sha256" + + // An alias for KeyExchangeCurve25519SHA256. This kex ID will be added if + // KeyExchangeCurve25519SHA256 is requested for backward compatibility with + // OpenSSH versions up to 7.2. + keyExchangeCurve25519LibSSH = "curve25519-sha256@libssh.org" +) + +// The message authentication code (MAC) currently or previously implemented by +// this library, to use in [Config.MACs]. For a list, see the +// [Algorithms.MACs] returned by [SupportedAlgorithms] or +// [InsecureAlgorithms]. +const ( + HMACSHA256ETM = "hmac-sha2-256-etm@openssh.com" + HMACSHA512ETM = "hmac-sha2-512-etm@openssh.com" + HMACSHA256 = "hmac-sha2-256" + HMACSHA512 = "hmac-sha2-512" + HMACSHA1 = "hmac-sha1" + InsecureHMACSHA196 = "hmac-sha1-96" +) + +var ( + // supportedKexAlgos specifies key-exchange algorithms implemented by this + // package in preference order, excluding those with security issues. + supportedKexAlgos = []string{ + KeyExchangeCurve25519, + KeyExchangeECDHP256, + KeyExchangeECDHP384, + KeyExchangeECDHP521, + KeyExchangeDH14SHA256, + KeyExchangeDH16SHA512, + KeyExchangeDHGEXSHA256, + } + // defaultKexAlgos specifies the default preference for key-exchange + // algorithms in preference order. + defaultKexAlgos = []string{ + KeyExchangeCurve25519, + KeyExchangeECDHP256, + KeyExchangeECDHP384, + KeyExchangeECDHP521, + KeyExchangeDH14SHA256, + InsecureKeyExchangeDH14SHA1, + } + // insecureKexAlgos specifies key-exchange algorithms implemented by this + // package and which have security issues. + insecureKexAlgos = []string{ + InsecureKeyExchangeDH14SHA1, + InsecureKeyExchangeDH1SHA1, + InsecureKeyExchangeDHGEXSHA1, + } + // supportedCiphers specifies cipher algorithms implemented by this package + // in preference order, excluding those with security issues. + supportedCiphers = []string{ + CipherAES128GCM, + CipherAES256GCM, + CipherChaCha20Poly1305, + CipherAES128CTR, + CipherAES192CTR, + CipherAES256CTR, + } + // defaultCiphers specifies the default preference for ciphers algorithms + // in preference order. + defaultCiphers = supportedCiphers + // insecureCiphers specifies cipher algorithms implemented by this + // package and which have security issues. + insecureCiphers = []string{ + InsecureCipherAES128CBC, + InsecureCipherTripleDESCBC, + InsecureCipherRC4256, + InsecureCipherRC4128, + InsecureCipherRC4, + } + // supportedMACs specifies MAC algorithms implemented by this package in + // preference order, excluding those with security issues. + supportedMACs = []string{ + HMACSHA256ETM, + HMACSHA512ETM, + HMACSHA256, + HMACSHA512, + HMACSHA1, + } + // defaultMACs specifies the default preference for MAC algorithms in + // preference order. + defaultMACs = []string{ + HMACSHA256ETM, + HMACSHA512ETM, + HMACSHA256, + HMACSHA512, + HMACSHA1, + InsecureHMACSHA196, + } + // insecureMACs specifies MAC algorithms implemented by this + // package and which have security issues. + insecureMACs = []string{ + InsecureHMACSHA196, + } + // supportedHostKeyAlgos specifies the supported host-key algorithms (i.e. + // methods of authenticating servers) implemented by this package in + // preference order, excluding those with security issues. + supportedHostKeyAlgos = []string{ + CertAlgoRSASHA256v01, + CertAlgoRSASHA512v01, + CertAlgoECDSA256v01, + CertAlgoECDSA384v01, + CertAlgoECDSA521v01, + CertAlgoED25519v01, + KeyAlgoRSASHA256, + KeyAlgoRSASHA512, + KeyAlgoECDSA256, + KeyAlgoECDSA384, + KeyAlgoECDSA521, + KeyAlgoED25519, + } + // defaultHostKeyAlgos specifies the default preference for host-key + // algorithms in preference order. + defaultHostKeyAlgos = []string{ + CertAlgoRSASHA256v01, + CertAlgoRSASHA512v01, + CertAlgoRSAv01, + InsecureCertAlgoDSAv01, + CertAlgoECDSA256v01, + CertAlgoECDSA384v01, + CertAlgoECDSA521v01, + CertAlgoED25519v01, + KeyAlgoECDSA256, + KeyAlgoECDSA384, + KeyAlgoECDSA521, + KeyAlgoRSASHA256, + KeyAlgoRSASHA512, + KeyAlgoRSA, + InsecureKeyAlgoDSA, + KeyAlgoED25519, + } + // insecureHostKeyAlgos specifies host-key algorithms implemented by this + // package and which have security issues. + insecureHostKeyAlgos = []string{ + KeyAlgoRSA, + InsecureKeyAlgoDSA, + CertAlgoRSAv01, + InsecureCertAlgoDSAv01, + } + // supportedPubKeyAuthAlgos specifies the supported client public key + // authentication algorithms. Note that this doesn't include certificate + // types since those use the underlying algorithm. Order is irrelevant. + supportedPubKeyAuthAlgos = []string{ + KeyAlgoED25519, + KeyAlgoSKED25519, + KeyAlgoSKECDSA256, + KeyAlgoECDSA256, + KeyAlgoECDSA384, + KeyAlgoECDSA521, + KeyAlgoRSASHA256, + KeyAlgoRSASHA512, + } + + // defaultPubKeyAuthAlgos specifies the preferred client public key + // authentication algorithms. This list is sent to the client if it supports + // the server-sig-algs extension. Order is irrelevant. + defaultPubKeyAuthAlgos = []string{ + KeyAlgoED25519, + KeyAlgoSKED25519, + KeyAlgoSKECDSA256, + KeyAlgoECDSA256, + KeyAlgoECDSA384, + KeyAlgoECDSA521, + KeyAlgoRSASHA256, + KeyAlgoRSASHA512, + KeyAlgoRSA, + InsecureKeyAlgoDSA, + } + // insecurePubKeyAuthAlgos specifies client public key authentication + // algorithms implemented by this package and which have security issues. + insecurePubKeyAuthAlgos = []string{ + KeyAlgoRSA, + InsecureKeyAlgoDSA, + } +) + +// NegotiatedAlgorithms defines algorithms negotiated between client and server. +type NegotiatedAlgorithms struct { + KeyExchange string + HostKey string + Read DirectionAlgorithms + Write DirectionAlgorithms } -// preferredCiphers specifies the default preference for ciphers. -var preferredCiphers = []string{ - "aes128-gcm@openssh.com", gcm256CipherID, - chacha20Poly1305ID, - "aes128-ctr", "aes192-ctr", "aes256-ctr", +// Algorithms defines a set of algorithms that can be configured in the client +// or server config for negotiation during a handshake. +type Algorithms struct { + KeyExchanges []string + Ciphers []string + MACs []string + HostKeys []string + PublicKeyAuths []string } -// supportedKexAlgos specifies the supported key-exchange algorithms in -// preference order. -var supportedKexAlgos = []string{ - kexAlgoCurve25519SHA256, kexAlgoCurve25519SHA256LibSSH, - // P384 and P521 are not constant-time yet, but since we don't - // reuse ephemeral keys, using them for ECDH should be OK. - kexAlgoECDH256, kexAlgoECDH384, kexAlgoECDH521, - kexAlgoDH14SHA256, kexAlgoDH16SHA512, kexAlgoDH14SHA1, - kexAlgoDH1SHA1, +// SupportedAlgorithms returns algorithms currently implemented by this package, +// excluding those with security issues, which are returned by +// InsecureAlgorithms. The algorithms listed here are in preference order. +func SupportedAlgorithms() Algorithms { + return Algorithms{ + Ciphers: slices.Clone(supportedCiphers), + MACs: slices.Clone(supportedMACs), + KeyExchanges: slices.Clone(supportedKexAlgos), + HostKeys: slices.Clone(supportedHostKeyAlgos), + PublicKeyAuths: slices.Clone(supportedPubKeyAuthAlgos), + } } -// serverForbiddenKexAlgos contains key exchange algorithms, that are forbidden -// for the server half. -var serverForbiddenKexAlgos = map[string]struct{}{ - kexAlgoDHGEXSHA1: {}, // server half implementation is only minimal to satisfy the automated tests - kexAlgoDHGEXSHA256: {}, // server half implementation is only minimal to satisfy the automated tests -} - -// preferredKexAlgos specifies the default preference for key-exchange -// algorithms in preference order. The diffie-hellman-group16-sha512 algorithm -// is disabled by default because it is a bit slower than the others. -var preferredKexAlgos = []string{ - kexAlgoCurve25519SHA256, kexAlgoCurve25519SHA256LibSSH, - kexAlgoECDH256, kexAlgoECDH384, kexAlgoECDH521, - kexAlgoDH14SHA256, kexAlgoDH14SHA1, -} - -// supportedHostKeyAlgos specifies the supported host-key algorithms (i.e. methods -// of authenticating servers) in preference order. -var supportedHostKeyAlgos = []string{ - CertAlgoRSASHA256v01, CertAlgoRSASHA512v01, - CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, - CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoED25519v01, - - KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521, - KeyAlgoRSASHA256, KeyAlgoRSASHA512, - KeyAlgoRSA, KeyAlgoDSA, - - KeyAlgoED25519, -} - -// supportedMACs specifies a default set of MAC algorithms in preference order. -// This is based on RFC 4253, section 6.4, but with hmac-md5 variants removed -// because they have reached the end of their useful life. -var supportedMACs = []string{ - "hmac-sha2-256-etm@openssh.com", "hmac-sha2-512-etm@openssh.com", "hmac-sha2-256", "hmac-sha2-512", "hmac-sha1", "hmac-sha1-96", +// InsecureAlgorithms returns algorithms currently implemented by this package +// and which have security issues. +func InsecureAlgorithms() Algorithms { + return Algorithms{ + KeyExchanges: slices.Clone(insecureKexAlgos), + Ciphers: slices.Clone(insecureCiphers), + MACs: slices.Clone(insecureMACs), + HostKeys: slices.Clone(insecureHostKeyAlgos), + PublicKeyAuths: slices.Clone(insecurePubKeyAuthAlgos), + } } var supportedCompressions = []string{compressionNone} @@ -94,13 +284,13 @@ var supportedCompressions = []string{compressionNone} // hashFuncs keeps the mapping of supported signature algorithms to their // respective hashes needed for signing and verification. var hashFuncs = map[string]crypto.Hash{ - KeyAlgoRSA: crypto.SHA1, - KeyAlgoRSASHA256: crypto.SHA256, - KeyAlgoRSASHA512: crypto.SHA512, - KeyAlgoDSA: crypto.SHA1, - KeyAlgoECDSA256: crypto.SHA256, - KeyAlgoECDSA384: crypto.SHA384, - KeyAlgoECDSA521: crypto.SHA512, + KeyAlgoRSA: crypto.SHA1, + KeyAlgoRSASHA256: crypto.SHA256, + KeyAlgoRSASHA512: crypto.SHA512, + InsecureKeyAlgoDSA: crypto.SHA1, + KeyAlgoECDSA256: crypto.SHA256, + KeyAlgoECDSA384: crypto.SHA384, + KeyAlgoECDSA521: crypto.SHA512, // KeyAlgoED25519 doesn't pre-hash. KeyAlgoSKECDSA256: crypto.SHA256, KeyAlgoSKED25519: crypto.SHA256, @@ -135,18 +325,6 @@ func isRSACert(algo string) bool { return isRSA(algo) } -// supportedPubKeyAuthAlgos specifies the supported client public key -// authentication algorithms. Note that this doesn't include certificate types -// since those use the underlying algorithm. This list is sent to the client if -// it supports the server-sig-algs extension. Order is irrelevant. -var supportedPubKeyAuthAlgos = []string{ - KeyAlgoED25519, - KeyAlgoSKED25519, KeyAlgoSKECDSA256, - KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521, - KeyAlgoRSASHA256, KeyAlgoRSASHA512, KeyAlgoRSA, - KeyAlgoDSA, -} - // unexpectedMessageError results when the SSH message that we received didn't // match what we wanted. func unexpectedMessageError(expected, got uint8) error { @@ -169,20 +347,21 @@ func findCommon(what string, client []string, server []string) (common string, e return "", fmt.Errorf("ssh: no common algorithm for %s; client offered: %v, server offered: %v", what, client, server) } -// directionAlgorithms records algorithm choices in one direction (either read or write) -type directionAlgorithms struct { +// DirectionAlgorithms defines the algorithms negotiated in one direction +// (either read or write). +type DirectionAlgorithms struct { Cipher string MAC string - Compression string + compression string } // rekeyBytes returns a rekeying intervals in bytes. -func (a *directionAlgorithms) rekeyBytes() int64 { +func (a *DirectionAlgorithms) rekeyBytes() int64 { // According to RFC 4344 block ciphers should rekey after // 2^(BLOCKSIZE/4) blocks. For all AES flavors BLOCKSIZE is // 128. switch a.Cipher { - case "aes128-ctr", "aes192-ctr", "aes256-ctr", gcm128CipherID, gcm256CipherID, aes128cbcID: + case CipherAES128CTR, CipherAES192CTR, CipherAES256CTR, CipherAES128GCM, CipherAES256GCM, InsecureCipherAES128CBC: return 16 * (1 << 32) } @@ -192,32 +371,25 @@ func (a *directionAlgorithms) rekeyBytes() int64 { } var aeadCiphers = map[string]bool{ - gcm128CipherID: true, - gcm256CipherID: true, - chacha20Poly1305ID: true, + CipherAES128GCM: true, + CipherAES256GCM: true, + CipherChaCha20Poly1305: true, } -type algorithms struct { - kex string - hostKey string - w directionAlgorithms - r directionAlgorithms -} +func findAgreedAlgorithms(isClient bool, clientKexInit, serverKexInit *kexInitMsg) (algs *NegotiatedAlgorithms, err error) { + result := &NegotiatedAlgorithms{} -func findAgreedAlgorithms(isClient bool, clientKexInit, serverKexInit *kexInitMsg) (algs *algorithms, err error) { - result := &algorithms{} - - result.kex, err = findCommon("key exchange", clientKexInit.KexAlgos, serverKexInit.KexAlgos) + result.KeyExchange, err = findCommon("key exchange", clientKexInit.KexAlgos, serverKexInit.KexAlgos) if err != nil { return } - result.hostKey, err = findCommon("host key", clientKexInit.ServerHostKeyAlgos, serverKexInit.ServerHostKeyAlgos) + result.HostKey, err = findCommon("host key", clientKexInit.ServerHostKeyAlgos, serverKexInit.ServerHostKeyAlgos) if err != nil { return } - stoc, ctos := &result.w, &result.r + stoc, ctos := &result.Write, &result.Read if isClient { ctos, stoc = stoc, ctos } @@ -246,12 +418,12 @@ func findAgreedAlgorithms(isClient bool, clientKexInit, serverKexInit *kexInitMs } } - ctos.Compression, err = findCommon("client to server compression", clientKexInit.CompressionClientServer, serverKexInit.CompressionClientServer) + ctos.compression, err = findCommon("client to server compression", clientKexInit.CompressionClientServer, serverKexInit.CompressionClientServer) if err != nil { return } - stoc.Compression, err = findCommon("server to client compression", clientKexInit.CompressionServerClient, serverKexInit.CompressionServerClient) + stoc.compression, err = findCommon("server to client compression", clientKexInit.CompressionServerClient, serverKexInit.CompressionServerClient) if err != nil { return } @@ -297,7 +469,7 @@ func (c *Config) SetDefaults() { c.Rand = rand.Reader } if c.Ciphers == nil { - c.Ciphers = preferredCiphers + c.Ciphers = defaultCiphers } var ciphers []string for _, c := range c.Ciphers { @@ -309,19 +481,22 @@ func (c *Config) SetDefaults() { c.Ciphers = ciphers if c.KeyExchanges == nil { - c.KeyExchanges = preferredKexAlgos + c.KeyExchanges = defaultKexAlgos } var kexs []string for _, k := range c.KeyExchanges { if kexAlgoMap[k] != nil { // Ignore the KEX if we have no kexAlgoMap definition. kexs = append(kexs, k) + if k == KeyExchangeCurve25519 && !contains(c.KeyExchanges, keyExchangeCurve25519LibSSH) { + kexs = append(kexs, keyExchangeCurve25519LibSSH) + } } } c.KeyExchanges = kexs if c.MACs == nil { - c.MACs = supportedMACs + c.MACs = defaultMACs } var macs []string for _, m := range c.MACs { diff --git a/vendor/golang.org/x/crypto/ssh/connection.go b/vendor/golang.org/x/crypto/ssh/connection.go index 8f345ee..613a71a 100644 --- a/vendor/golang.org/x/crypto/ssh/connection.go +++ b/vendor/golang.org/x/crypto/ssh/connection.go @@ -74,6 +74,13 @@ type Conn interface { // Disconnect } +// AlgorithmsConnMetadata is a ConnMetadata that can return the algorithms +// negotiated between client and server. +type AlgorithmsConnMetadata interface { + ConnMetadata + Algorithms() NegotiatedAlgorithms +} + // DiscardRequests consumes and rejects all requests from the // passed-in channel. func DiscardRequests(in <-chan *Request) { @@ -106,6 +113,7 @@ type sshConn struct { sessionID []byte clientVersion []byte serverVersion []byte + algorithms NegotiatedAlgorithms } func dup(src []byte) []byte { @@ -141,3 +149,7 @@ func (c *sshConn) ClientVersion() []byte { func (c *sshConn) ServerVersion() []byte { return dup(c.serverVersion) } + +func (c *sshConn) Algorithms() NegotiatedAlgorithms { + return c.algorithms +} diff --git a/vendor/golang.org/x/crypto/ssh/handshake.go b/vendor/golang.org/x/crypto/ssh/handshake.go index b6bf546..a90bfe3 100644 --- a/vendor/golang.org/x/crypto/ssh/handshake.go +++ b/vendor/golang.org/x/crypto/ssh/handshake.go @@ -38,7 +38,7 @@ type keyingTransport interface { // prepareKeyChange sets up a key change. The key change for a // direction will be effected if a msgNewKeys message is sent // or received. - prepareKeyChange(*algorithms, *kexResult) error + prepareKeyChange(*NegotiatedAlgorithms, *kexResult) error // setStrictMode sets the strict KEX mode, notably triggering // sequence number resets on sending or receiving msgNewKeys. @@ -115,7 +115,7 @@ type handshakeTransport struct { bannerCallback BannerCallback // Algorithms agreed in the last key exchange. - algorithms *algorithms + algorithms *NegotiatedAlgorithms // Counters exclusively owned by readLoop. readPacketsLeft uint32 @@ -164,7 +164,7 @@ func newClientTransport(conn keyingTransport, clientVersion, serverVersion []byt if config.HostKeyAlgorithms != nil { t.hostKeyAlgorithms = config.HostKeyAlgorithms } else { - t.hostKeyAlgorithms = supportedHostKeyAlgos + t.hostKeyAlgorithms = defaultHostKeyAlgos } go t.readLoop() go t.kexLoop() @@ -184,6 +184,10 @@ func (t *handshakeTransport) getSessionID() []byte { return t.sessionID } +func (t *handshakeTransport) getAlgorithms() NegotiatedAlgorithms { + return *t.algorithms +} + // waitSession waits for the session to be established. This should be // the first thing to call after instantiating handshakeTransport. func (t *handshakeTransport) waitSession() error { @@ -290,7 +294,7 @@ func (t *handshakeTransport) resetWriteThresholds() { if t.config.RekeyThreshold > 0 { t.writeBytesLeft = int64(t.config.RekeyThreshold) } else if t.algorithms != nil { - t.writeBytesLeft = t.algorithms.w.rekeyBytes() + t.writeBytesLeft = t.algorithms.Write.rekeyBytes() } else { t.writeBytesLeft = 1 << 30 } @@ -407,7 +411,7 @@ func (t *handshakeTransport) resetReadThresholds() { if t.config.RekeyThreshold > 0 { t.readBytesLeft = int64(t.config.RekeyThreshold) } else if t.algorithms != nil { - t.readBytesLeft = t.algorithms.r.rekeyBytes() + t.readBytesLeft = t.algorithms.Read.rekeyBytes() } else { t.readBytesLeft = 1 << 30 } @@ -700,9 +704,9 @@ func (t *handshakeTransport) enterKeyExchange(otherInitPacket []byte) error { } } - kex, ok := kexAlgoMap[t.algorithms.kex] + kex, ok := kexAlgoMap[t.algorithms.KeyExchange] if !ok { - return fmt.Errorf("ssh: unexpected key exchange algorithm %v", t.algorithms.kex) + return fmt.Errorf("ssh: unexpected key exchange algorithm %v", t.algorithms.KeyExchange) } var result *kexResult @@ -809,12 +813,12 @@ func pickHostKey(hostKeys []Signer, algo string) AlgorithmSigner { } func (t *handshakeTransport) server(kex kexAlgorithm, magics *handshakeMagics) (*kexResult, error) { - hostKey := pickHostKey(t.hostKeys, t.algorithms.hostKey) + hostKey := pickHostKey(t.hostKeys, t.algorithms.HostKey) if hostKey == nil { return nil, errors.New("ssh: internal error: negotiated unsupported signature type") } - r, err := kex.Server(t.conn, t.config.Rand, magics, hostKey, t.algorithms.hostKey) + r, err := kex.Server(t.conn, t.config.Rand, magics, hostKey, t.algorithms.HostKey) return r, err } @@ -829,7 +833,7 @@ func (t *handshakeTransport) client(kex kexAlgorithm, magics *handshakeMagics) ( return nil, err } - if err := verifyHostKeySignature(hostKey, t.algorithms.hostKey, result); err != nil { + if err := verifyHostKeySignature(hostKey, t.algorithms.HostKey, result); err != nil { return nil, err } diff --git a/vendor/golang.org/x/crypto/ssh/kex.go b/vendor/golang.org/x/crypto/ssh/kex.go index 8a05f79..cf388a9 100644 --- a/vendor/golang.org/x/crypto/ssh/kex.go +++ b/vendor/golang.org/x/crypto/ssh/kex.go @@ -20,21 +20,18 @@ import ( ) const ( - kexAlgoDH1SHA1 = "diffie-hellman-group1-sha1" - kexAlgoDH14SHA1 = "diffie-hellman-group14-sha1" - kexAlgoDH14SHA256 = "diffie-hellman-group14-sha256" - kexAlgoDH16SHA512 = "diffie-hellman-group16-sha512" - kexAlgoECDH256 = "ecdh-sha2-nistp256" - kexAlgoECDH384 = "ecdh-sha2-nistp384" - kexAlgoECDH521 = "ecdh-sha2-nistp521" - kexAlgoCurve25519SHA256LibSSH = "curve25519-sha256@libssh.org" - kexAlgoCurve25519SHA256 = "curve25519-sha256" - - // For the following kex only the client half contains a production - // ready implementation. The server half only consists of a minimal - // implementation to satisfy the automated tests. - kexAlgoDHGEXSHA1 = "diffie-hellman-group-exchange-sha1" - kexAlgoDHGEXSHA256 = "diffie-hellman-group-exchange-sha256" + // This is the group called diffie-hellman-group1-sha1 in RFC 4253 and + // Oakley Group 2 in RFC 2409. + oakleyGroup2 = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF" + // This is the group called diffie-hellman-group14-sha1 in RFC 4253 and + // Oakley Group 14 in RFC 3526. + oakleyGroup14 = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF" + // This is the group called diffie-hellman-group15-sha512 in RFC 8268 and + // Oakley Group 15 in RFC 3526. + oakleyGroup15 = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF" + // This is the group called diffie-hellman-group16-sha512 in RFC 8268 and + // Oakley Group 16 in RFC 3526. + oakleyGroup16 = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D788719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA993B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934063199FFFFFFFFFFFFFFFF" ) // kexResult captures the outcome of a key exchange. @@ -402,53 +399,46 @@ func ecHash(curve elliptic.Curve) crypto.Hash { var kexAlgoMap = map[string]kexAlgorithm{} func init() { - // This is the group called diffie-hellman-group1-sha1 in - // RFC 4253 and Oakley Group 2 in RFC 2409. - p, _ := new(big.Int).SetString("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF", 16) - kexAlgoMap[kexAlgoDH1SHA1] = &dhGroup{ + p, _ := new(big.Int).SetString(oakleyGroup2, 16) + kexAlgoMap[InsecureKeyExchangeDH1SHA1] = &dhGroup{ g: new(big.Int).SetInt64(2), p: p, pMinus1: new(big.Int).Sub(p, bigOne), hashFunc: crypto.SHA1, } - // This are the groups called diffie-hellman-group14-sha1 and - // diffie-hellman-group14-sha256 in RFC 4253 and RFC 8268, - // and Oakley Group 14 in RFC 3526. - p, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF", 16) + p, _ = new(big.Int).SetString(oakleyGroup14, 16) group14 := &dhGroup{ g: new(big.Int).SetInt64(2), p: p, pMinus1: new(big.Int).Sub(p, bigOne), } - kexAlgoMap[kexAlgoDH14SHA1] = &dhGroup{ + kexAlgoMap[InsecureKeyExchangeDH14SHA1] = &dhGroup{ g: group14.g, p: group14.p, pMinus1: group14.pMinus1, hashFunc: crypto.SHA1, } - kexAlgoMap[kexAlgoDH14SHA256] = &dhGroup{ + kexAlgoMap[KeyExchangeDH14SHA256] = &dhGroup{ g: group14.g, p: group14.p, pMinus1: group14.pMinus1, hashFunc: crypto.SHA256, } - // This is the group called diffie-hellman-group16-sha512 in RFC - // 8268 and Oakley Group 16 in RFC 3526. - p, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D788719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA993B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934063199FFFFFFFFFFFFFFFF", 16) + p, _ = new(big.Int).SetString(oakleyGroup16, 16) - kexAlgoMap[kexAlgoDH16SHA512] = &dhGroup{ + kexAlgoMap[KeyExchangeDH16SHA512] = &dhGroup{ g: new(big.Int).SetInt64(2), p: p, pMinus1: new(big.Int).Sub(p, bigOne), hashFunc: crypto.SHA512, } - kexAlgoMap[kexAlgoECDH521] = &ecdh{elliptic.P521()} - kexAlgoMap[kexAlgoECDH384] = &ecdh{elliptic.P384()} - kexAlgoMap[kexAlgoECDH256] = &ecdh{elliptic.P256()} - kexAlgoMap[kexAlgoCurve25519SHA256] = &curve25519sha256{} - kexAlgoMap[kexAlgoCurve25519SHA256LibSSH] = &curve25519sha256{} - kexAlgoMap[kexAlgoDHGEXSHA1] = &dhGEXSHA{hashFunc: crypto.SHA1} - kexAlgoMap[kexAlgoDHGEXSHA256] = &dhGEXSHA{hashFunc: crypto.SHA256} + kexAlgoMap[KeyExchangeECDHP521] = &ecdh{elliptic.P521()} + kexAlgoMap[KeyExchangeECDHP384] = &ecdh{elliptic.P384()} + kexAlgoMap[KeyExchangeECDHP256] = &ecdh{elliptic.P256()} + kexAlgoMap[KeyExchangeCurve25519] = &curve25519sha256{} + kexAlgoMap[keyExchangeCurve25519LibSSH] = &curve25519sha256{} + kexAlgoMap[InsecureKeyExchangeDHGEXSHA1] = &dhGEXSHA{hashFunc: crypto.SHA1} + kexAlgoMap[KeyExchangeDHGEXSHA256] = &dhGEXSHA{hashFunc: crypto.SHA256} } // curve25519sha256 implements the curve25519-sha256 (formerly known as @@ -601,9 +591,9 @@ const ( func (gex *dhGEXSHA) Client(c packetConn, randSource io.Reader, magics *handshakeMagics) (*kexResult, error) { // Send GexRequest kexDHGexRequest := kexDHGexRequestMsg{ - MinBits: dhGroupExchangeMinimumBits, - PreferedBits: dhGroupExchangePreferredBits, - MaxBits: dhGroupExchangeMaximumBits, + MinBits: dhGroupExchangeMinimumBits, + PreferredBits: dhGroupExchangePreferredBits, + MaxBits: dhGroupExchangeMaximumBits, } if err := c.writePacket(Marshal(&kexDHGexRequest)); err != nil { return nil, err @@ -690,9 +680,7 @@ func (gex *dhGEXSHA) Client(c packetConn, randSource io.Reader, magics *handshak } // Server half implementation of the Diffie Hellman Key Exchange with SHA1 and SHA256. -// -// This is a minimal implementation to satisfy the automated tests. -func (gex dhGEXSHA) Server(c packetConn, randSource io.Reader, magics *handshakeMagics, priv AlgorithmSigner, algo string) (result *kexResult, err error) { +func (gex *dhGEXSHA) Server(c packetConn, randSource io.Reader, magics *handshakeMagics, priv AlgorithmSigner, algo string) (result *kexResult, err error) { // Receive GexRequest packet, err := c.readPacket() if err != nil { @@ -702,13 +690,32 @@ func (gex dhGEXSHA) Server(c packetConn, randSource io.Reader, magics *handshake if err = Unmarshal(packet, &kexDHGexRequest); err != nil { return } + // We check that the request received is valid and that the MaxBits + // requested are at least equal to our supported minimum. This is the same + // check done in OpenSSH: + // https://github.com/openssh/openssh-portable/blob/80a2f64b/kexgexs.c#L94 + // + // Furthermore, we also check that the required MinBits are less than or + // equal to 4096 because we can use up to Oakley Group 16. + if kexDHGexRequest.MaxBits < kexDHGexRequest.MinBits || kexDHGexRequest.PreferredBits < kexDHGexRequest.MinBits || + kexDHGexRequest.MaxBits < kexDHGexRequest.PreferredBits || kexDHGexRequest.MaxBits < dhGroupExchangeMinimumBits || + kexDHGexRequest.MinBits > 4096 { + return nil, fmt.Errorf("ssh: DH GEX request out of range, min: %d, max: %d, preferred: %d", kexDHGexRequest.MinBits, + kexDHGexRequest.MaxBits, kexDHGexRequest.PreferredBits) + } + + var p *big.Int + // We hardcode sending Oakley Group 14 (2048 bits), Oakley Group 15 (3072 + // bits) or Oakley Group 16 (4096 bits), based on the requested max size. + if kexDHGexRequest.MaxBits < 3072 { + p, _ = new(big.Int).SetString(oakleyGroup14, 16) + } else if kexDHGexRequest.MaxBits < 4096 { + p, _ = new(big.Int).SetString(oakleyGroup15, 16) + } else { + p, _ = new(big.Int).SetString(oakleyGroup16, 16) + } - // Send GexGroup - // This is the group called diffie-hellman-group14-sha1 in RFC - // 4253 and Oakley Group 14 in RFC 3526. - p, _ := new(big.Int).SetString("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF", 16) g := big.NewInt(2) - msg := &kexDHGexGroupMsg{ P: p, G: g, @@ -746,9 +753,9 @@ func (gex dhGEXSHA) Server(c packetConn, randSource io.Reader, magics *handshake h := gex.hashFunc.New() magics.write(h) writeString(h, hostKeyBytes) - binary.Write(h, binary.BigEndian, uint32(dhGroupExchangeMinimumBits)) - binary.Write(h, binary.BigEndian, uint32(dhGroupExchangePreferredBits)) - binary.Write(h, binary.BigEndian, uint32(dhGroupExchangeMaximumBits)) + binary.Write(h, binary.BigEndian, kexDHGexRequest.MinBits) + binary.Write(h, binary.BigEndian, kexDHGexRequest.PreferredBits) + binary.Write(h, binary.BigEndian, kexDHGexRequest.MaxBits) writeInt(h, p) writeInt(h, g) writeInt(h, kexDHGexInit.X) diff --git a/vendor/golang.org/x/crypto/ssh/keys.go b/vendor/golang.org/x/crypto/ssh/keys.go index 98e6706..566e09d 100644 --- a/vendor/golang.org/x/crypto/ssh/keys.go +++ b/vendor/golang.org/x/crypto/ssh/keys.go @@ -36,14 +36,19 @@ import ( // ClientConfig.HostKeyAlgorithms, Signature.Format, or as AlgorithmSigner // arguments. const ( - KeyAlgoRSA = "ssh-rsa" - KeyAlgoDSA = "ssh-dss" - KeyAlgoECDSA256 = "ecdsa-sha2-nistp256" - KeyAlgoSKECDSA256 = "sk-ecdsa-sha2-nistp256@openssh.com" - KeyAlgoECDSA384 = "ecdsa-sha2-nistp384" - KeyAlgoECDSA521 = "ecdsa-sha2-nistp521" - KeyAlgoED25519 = "ssh-ed25519" - KeyAlgoSKED25519 = "sk-ssh-ed25519@openssh.com" + KeyAlgoRSA = "ssh-rsa" + // Deprecated: DSA is only supported at insecure key sizes, and was removed + // from major implementations. + KeyAlgoDSA = InsecureKeyAlgoDSA + // Deprecated: DSA is only supported at insecure key sizes, and was removed + // from major implementations. + InsecureKeyAlgoDSA = "ssh-dss" + KeyAlgoECDSA256 = "ecdsa-sha2-nistp256" + KeyAlgoSKECDSA256 = "sk-ecdsa-sha2-nistp256@openssh.com" + KeyAlgoECDSA384 = "ecdsa-sha2-nistp384" + KeyAlgoECDSA521 = "ecdsa-sha2-nistp521" + KeyAlgoED25519 = "ssh-ed25519" + KeyAlgoSKED25519 = "sk-ssh-ed25519@openssh.com" // KeyAlgoRSASHA256 and KeyAlgoRSASHA512 are only public key algorithms, not // public key formats, so they can't appear as a PublicKey.Type. The @@ -67,7 +72,7 @@ func parsePubKey(in []byte, algo string) (pubKey PublicKey, rest []byte, err err switch algo { case KeyAlgoRSA: return parseRSA(in) - case KeyAlgoDSA: + case InsecureKeyAlgoDSA: return parseDSA(in) case KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521: return parseECDSA(in) @@ -77,7 +82,7 @@ func parsePubKey(in []byte, algo string) (pubKey PublicKey, rest []byte, err err return parseED25519(in) case KeyAlgoSKED25519: return parseSKEd25519(in) - case CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoSKECDSA256v01, CertAlgoED25519v01, CertAlgoSKED25519v01: + case CertAlgoRSAv01, InsecureCertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoSKECDSA256v01, CertAlgoED25519v01, CertAlgoSKED25519v01: cert, err := parseCert(in, certKeyAlgoNames[algo]) if err != nil { return nil, nil, err diff --git a/vendor/golang.org/x/crypto/ssh/mac.go b/vendor/golang.org/x/crypto/ssh/mac.go index 06a1b27..de2639d 100644 --- a/vendor/golang.org/x/crypto/ssh/mac.go +++ b/vendor/golang.org/x/crypto/ssh/mac.go @@ -47,22 +47,22 @@ func (t truncatingMAC) Size() int { func (t truncatingMAC) BlockSize() int { return t.hmac.BlockSize() } var macModes = map[string]*macMode{ - "hmac-sha2-512-etm@openssh.com": {64, true, func(key []byte) hash.Hash { + HMACSHA512ETM: {64, true, func(key []byte) hash.Hash { return hmac.New(sha512.New, key) }}, - "hmac-sha2-256-etm@openssh.com": {32, true, func(key []byte) hash.Hash { + HMACSHA256ETM: {32, true, func(key []byte) hash.Hash { return hmac.New(sha256.New, key) }}, - "hmac-sha2-512": {64, false, func(key []byte) hash.Hash { + HMACSHA512: {64, false, func(key []byte) hash.Hash { return hmac.New(sha512.New, key) }}, - "hmac-sha2-256": {32, false, func(key []byte) hash.Hash { + HMACSHA256: {32, false, func(key []byte) hash.Hash { return hmac.New(sha256.New, key) }}, - "hmac-sha1": {20, false, func(key []byte) hash.Hash { + HMACSHA1: {20, false, func(key []byte) hash.Hash { return hmac.New(sha1.New, key) }}, - "hmac-sha1-96": {20, false, func(key []byte) hash.Hash { + InsecureHMACSHA196: {20, false, func(key []byte) hash.Hash { return truncatingMAC{12, hmac.New(sha1.New, key)} }}, } diff --git a/vendor/golang.org/x/crypto/ssh/messages.go b/vendor/golang.org/x/crypto/ssh/messages.go index 118427b..251b9d0 100644 --- a/vendor/golang.org/x/crypto/ssh/messages.go +++ b/vendor/golang.org/x/crypto/ssh/messages.go @@ -122,9 +122,9 @@ type kexDHGexReplyMsg struct { const msgKexDHGexRequest = 34 type kexDHGexRequestMsg struct { - MinBits uint32 `sshtype:"34"` - PreferedBits uint32 - MaxBits uint32 + MinBits uint32 `sshtype:"34"` + PreferredBits uint32 + MaxBits uint32 } // See RFC 4253, section 10. diff --git a/vendor/golang.org/x/crypto/ssh/mlkem.go b/vendor/golang.org/x/crypto/ssh/mlkem.go new file mode 100644 index 0000000..657e107 --- /dev/null +++ b/vendor/golang.org/x/crypto/ssh/mlkem.go @@ -0,0 +1,183 @@ +// Copyright 2024 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. + +//go:build go1.24 + +package ssh + +import ( + "crypto" + "crypto/mlkem" + "crypto/sha256" + "errors" + "fmt" + "io" + "runtime" + "slices" + + "golang.org/x/crypto/curve25519" +) + +func init() { + // After Go 1.24rc1 mlkem swapped the order of return values of Encapsulate. + // See #70950. + if runtime.Version() == "go1.24rc1" { + return + } + supportedKexAlgos = slices.Insert(supportedKexAlgos, 0, KeyExchangeMLKEM768X25519) + defaultKexAlgos = slices.Insert(defaultKexAlgos, 0, KeyExchangeMLKEM768X25519) + kexAlgoMap[KeyExchangeMLKEM768X25519] = &mlkem768WithCurve25519sha256{} +} + +// mlkem768WithCurve25519sha256 implements the hybrid ML-KEM768 with +// curve25519-sha256 key exchange method, as described by +// draft-kampanakis-curdle-ssh-pq-ke-05 section 2.3.3. +type mlkem768WithCurve25519sha256 struct{} + +func (kex *mlkem768WithCurve25519sha256) Client(c packetConn, rand io.Reader, magics *handshakeMagics) (*kexResult, error) { + var c25519kp curve25519KeyPair + if err := c25519kp.generate(rand); err != nil { + return nil, err + } + + seed := make([]byte, mlkem.SeedSize) + if _, err := io.ReadFull(rand, seed); err != nil { + return nil, err + } + + mlkemDk, err := mlkem.NewDecapsulationKey768(seed) + if err != nil { + return nil, err + } + + hybridKey := append(mlkemDk.EncapsulationKey().Bytes(), c25519kp.pub[:]...) + if err := c.writePacket(Marshal(&kexECDHInitMsg{hybridKey})); err != nil { + return nil, err + } + + packet, err := c.readPacket() + if err != nil { + return nil, err + } + + var reply kexECDHReplyMsg + if err = Unmarshal(packet, &reply); err != nil { + return nil, err + } + + if len(reply.EphemeralPubKey) != mlkem.CiphertextSize768+32 { + return nil, errors.New("ssh: peer's mlkem768x25519 public value has wrong length") + } + + // Perform KEM decapsulate operation to obtain shared key from ML-KEM. + mlkem768Secret, err := mlkemDk.Decapsulate(reply.EphemeralPubKey[:mlkem.CiphertextSize768]) + if err != nil { + return nil, err + } + + // Complete Curve25519 ECDH to obtain its shared key. + c25519Secret, err := curve25519.X25519(c25519kp.priv[:], reply.EphemeralPubKey[mlkem.CiphertextSize768:]) + if err != nil { + return nil, fmt.Errorf("ssh: peer's mlkem768x25519 public value is not valid: %w", err) + } + // Compute actual shared key. + h := sha256.New() + h.Write(mlkem768Secret) + h.Write(c25519Secret) + secret := h.Sum(nil) + + h.Reset() + magics.write(h) + writeString(h, reply.HostKey) + writeString(h, hybridKey) + writeString(h, reply.EphemeralPubKey) + + K := make([]byte, stringLength(len(secret))) + marshalString(K, secret) + h.Write(K) + + return &kexResult{ + H: h.Sum(nil), + K: K, + HostKey: reply.HostKey, + Signature: reply.Signature, + Hash: crypto.SHA256, + }, nil +} + +func (kex *mlkem768WithCurve25519sha256) Server(c packetConn, rand io.Reader, magics *handshakeMagics, priv AlgorithmSigner, algo string) (*kexResult, error) { + packet, err := c.readPacket() + if err != nil { + return nil, err + } + + var kexInit kexECDHInitMsg + if err = Unmarshal(packet, &kexInit); err != nil { + return nil, err + } + + if len(kexInit.ClientPubKey) != mlkem.EncapsulationKeySize768+32 { + return nil, errors.New("ssh: peer's ML-KEM768/curve25519 public value has wrong length") + } + + encapsulationKey, err := mlkem.NewEncapsulationKey768(kexInit.ClientPubKey[:mlkem.EncapsulationKeySize768]) + if err != nil { + return nil, fmt.Errorf("ssh: peer's ML-KEM768 encapsulation key is not valid: %w", err) + } + // Perform KEM encapsulate operation to obtain ciphertext and shared key. + mlkem768Secret, mlkem768Ciphertext := encapsulationKey.Encapsulate() + + // Perform server side of Curve25519 ECDH to obtain server public value and + // shared key. + var c25519kp curve25519KeyPair + if err := c25519kp.generate(rand); err != nil { + return nil, err + } + c25519Secret, err := curve25519.X25519(c25519kp.priv[:], kexInit.ClientPubKey[mlkem.EncapsulationKeySize768:]) + if err != nil { + return nil, fmt.Errorf("ssh: peer's ML-KEM768/curve25519 public value is not valid: %w", err) + } + hybridKey := append(mlkem768Ciphertext, c25519kp.pub[:]...) + + // Compute actual shared key. + h := sha256.New() + h.Write(mlkem768Secret) + h.Write(c25519Secret) + secret := h.Sum(nil) + + hostKeyBytes := priv.PublicKey().Marshal() + + h.Reset() + magics.write(h) + writeString(h, hostKeyBytes) + writeString(h, kexInit.ClientPubKey) + writeString(h, hybridKey) + + K := make([]byte, stringLength(len(secret))) + marshalString(K, secret) + h.Write(K) + + H := h.Sum(nil) + + sig, err := signAndMarshal(priv, rand, H, algo) + if err != nil { + return nil, err + } + + reply := kexECDHReplyMsg{ + EphemeralPubKey: hybridKey, + HostKey: hostKeyBytes, + Signature: sig, + } + if err := c.writePacket(Marshal(&reply)); err != nil { + return nil, err + } + return &kexResult{ + H: H, + K: K, + HostKey: hostKeyBytes, + Signature: sig, + Hash: crypto.SHA256, + }, nil +} diff --git a/vendor/golang.org/x/crypto/ssh/server.go b/vendor/golang.org/x/crypto/ssh/server.go index 1839ddc..98679ba 100644 --- a/vendor/golang.org/x/crypto/ssh/server.go +++ b/vendor/golang.org/x/crypto/ssh/server.go @@ -243,22 +243,15 @@ func NewServerConn(c net.Conn, config *ServerConfig) (*ServerConn, <-chan NewCha fullConf.MaxAuthTries = 6 } if len(fullConf.PublicKeyAuthAlgorithms) == 0 { - fullConf.PublicKeyAuthAlgorithms = supportedPubKeyAuthAlgos + fullConf.PublicKeyAuthAlgorithms = defaultPubKeyAuthAlgos } else { for _, algo := range fullConf.PublicKeyAuthAlgorithms { - if !contains(supportedPubKeyAuthAlgos, algo) { + if !contains(SupportedAlgorithms().PublicKeyAuths, algo) && !contains(InsecureAlgorithms().PublicKeyAuths, algo) { c.Close() return nil, nil, nil, fmt.Errorf("ssh: unsupported public key authentication algorithm %s", algo) } } } - // Check if the config contains any unsupported key exchanges - for _, kex := range fullConf.KeyExchanges { - if _, ok := serverForbiddenKexAlgos[kex]; ok { - c.Close() - return nil, nil, nil, fmt.Errorf("ssh: unsupported key exchange %s for server", kex) - } - } s := &connection{ sshConn: sshConn{conn: c}, @@ -315,6 +308,7 @@ func (s *connection) serverHandshake(config *ServerConfig) (*Permissions, error) // We just did the key change, so the session ID is established. s.sessionID = s.transport.getSessionID() + s.algorithms = s.transport.getAlgorithms() var packet []byte if packet, err = s.transport.readPacket(); err != nil { diff --git a/vendor/golang.org/x/crypto/ssh/transport.go b/vendor/golang.org/x/crypto/ssh/transport.go index 0424d2d..6636198 100644 --- a/vendor/golang.org/x/crypto/ssh/transport.go +++ b/vendor/golang.org/x/crypto/ssh/transport.go @@ -16,13 +16,6 @@ import ( // wire. No message decoding is done, to minimize the impact on timing. const debugTransport = false -const ( - gcm128CipherID = "aes128-gcm@openssh.com" - gcm256CipherID = "aes256-gcm@openssh.com" - aes128cbcID = "aes128-cbc" - tripledescbcID = "3des-cbc" -) - // packetConn represents a transport that implements packet based // operations. type packetConn interface { @@ -92,14 +85,14 @@ func (t *transport) setInitialKEXDone() { // prepareKeyChange sets up key material for a keychange. The key changes in // both directions are triggered by reading and writing a msgNewKey packet // respectively. -func (t *transport) prepareKeyChange(algs *algorithms, kexResult *kexResult) error { - ciph, err := newPacketCipher(t.reader.dir, algs.r, kexResult) +func (t *transport) prepareKeyChange(algs *NegotiatedAlgorithms, kexResult *kexResult) error { + ciph, err := newPacketCipher(t.reader.dir, algs.Read, kexResult) if err != nil { return err } t.reader.pendingKeyChange <- ciph - ciph, err = newPacketCipher(t.writer.dir, algs.w, kexResult) + ciph, err = newPacketCipher(t.writer.dir, algs.Write, kexResult) if err != nil { return err } @@ -259,7 +252,7 @@ var ( // setupKeys sets the cipher and MAC keys from kex.K, kex.H and sessionId, as // described in RFC 4253, section 6.4. direction should either be serverKeys // (to setup server->client keys) or clientKeys (for client->server keys). -func newPacketCipher(d direction, algs directionAlgorithms, kex *kexResult) (packetCipher, error) { +func newPacketCipher(d direction, algs DirectionAlgorithms, kex *kexResult) (packetCipher, error) { cipherMode := cipherModes[algs.Cipher] iv := make([]byte, cipherMode.ivSize) diff --git a/vendor/golang.org/x/net/http/httpguts/guts.go b/vendor/golang.org/x/net/http/httpguts/guts.go new file mode 100644 index 0000000..e6cd0ce --- /dev/null +++ b/vendor/golang.org/x/net/http/httpguts/guts.go @@ -0,0 +1,50 @@ +// Copyright 2018 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 httpguts provides functions implementing various details +// of the HTTP specification. +// +// This package is shared by the standard library (which vendors it) +// and x/net/http2. It comes with no API stability promise. +package httpguts + +import ( + "net/textproto" + "strings" +) + +// ValidTrailerHeader reports whether name is a valid header field name to appear +// in trailers. +// See RFC 7230, Section 4.1.2 +func ValidTrailerHeader(name string) bool { + name = textproto.CanonicalMIMEHeaderKey(name) + if strings.HasPrefix(name, "If-") || badTrailer[name] { + return false + } + return true +} + +var badTrailer = map[string]bool{ + "Authorization": true, + "Cache-Control": true, + "Connection": true, + "Content-Encoding": true, + "Content-Length": true, + "Content-Range": true, + "Content-Type": true, + "Expect": true, + "Host": true, + "Keep-Alive": true, + "Max-Forwards": true, + "Pragma": true, + "Proxy-Authenticate": true, + "Proxy-Authorization": true, + "Proxy-Connection": true, + "Range": true, + "Realm": true, + "Te": true, + "Trailer": true, + "Transfer-Encoding": true, + "Www-Authenticate": true, +} diff --git a/vendor/golang.org/x/net/http/httpguts/httplex.go b/vendor/golang.org/x/net/http/httpguts/httplex.go new file mode 100644 index 0000000..9b4de94 --- /dev/null +++ b/vendor/golang.org/x/net/http/httpguts/httplex.go @@ -0,0 +1,347 @@ +// Copyright 2016 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 httpguts + +import ( + "net" + "strings" + "unicode/utf8" + + "golang.org/x/net/idna" +) + +var isTokenTable = [256]bool{ + '!': true, + '#': true, + '$': true, + '%': true, + '&': true, + '\'': true, + '*': true, + '+': true, + '-': true, + '.': true, + '0': true, + '1': true, + '2': true, + '3': true, + '4': true, + '5': true, + '6': true, + '7': true, + '8': true, + '9': true, + 'A': true, + 'B': true, + 'C': true, + 'D': true, + 'E': true, + 'F': true, + 'G': true, + 'H': true, + 'I': true, + 'J': true, + 'K': true, + 'L': true, + 'M': true, + 'N': true, + 'O': true, + 'P': true, + 'Q': true, + 'R': true, + 'S': true, + 'T': true, + 'U': true, + 'W': true, + 'V': true, + 'X': true, + 'Y': true, + 'Z': true, + '^': true, + '_': true, + '`': true, + 'a': true, + 'b': true, + 'c': true, + 'd': true, + 'e': true, + 'f': true, + 'g': true, + 'h': true, + 'i': true, + 'j': true, + 'k': true, + 'l': true, + 'm': true, + 'n': true, + 'o': true, + 'p': true, + 'q': true, + 'r': true, + 's': true, + 't': true, + 'u': true, + 'v': true, + 'w': true, + 'x': true, + 'y': true, + 'z': true, + '|': true, + '~': true, +} + +func IsTokenRune(r rune) bool { + return r < utf8.RuneSelf && isTokenTable[byte(r)] +} + +// HeaderValuesContainsToken reports whether any string in values +// contains the provided token, ASCII case-insensitively. +func HeaderValuesContainsToken(values []string, token string) bool { + for _, v := range values { + if headerValueContainsToken(v, token) { + return true + } + } + return false +} + +// isOWS reports whether b is an optional whitespace byte, as defined +// by RFC 7230 section 3.2.3. +func isOWS(b byte) bool { return b == ' ' || b == '\t' } + +// trimOWS returns x with all optional whitespace removes from the +// beginning and end. +func trimOWS(x string) string { + // TODO: consider using strings.Trim(x, " \t") instead, + // if and when it's fast enough. See issue 10292. + // But this ASCII-only code will probably always beat UTF-8 + // aware code. + for len(x) > 0 && isOWS(x[0]) { + x = x[1:] + } + for len(x) > 0 && isOWS(x[len(x)-1]) { + x = x[:len(x)-1] + } + return x +} + +// headerValueContainsToken reports whether v (assumed to be a +// 0#element, in the ABNF extension described in RFC 7230 section 7) +// contains token amongst its comma-separated tokens, ASCII +// case-insensitively. +func headerValueContainsToken(v string, token string) bool { + for comma := strings.IndexByte(v, ','); comma != -1; comma = strings.IndexByte(v, ',') { + if tokenEqual(trimOWS(v[:comma]), token) { + return true + } + v = v[comma+1:] + } + return tokenEqual(trimOWS(v), token) +} + +// lowerASCII returns the ASCII lowercase version of b. +func lowerASCII(b byte) byte { + if 'A' <= b && b <= 'Z' { + return b + ('a' - 'A') + } + return b +} + +// tokenEqual reports whether t1 and t2 are equal, ASCII case-insensitively. +func tokenEqual(t1, t2 string) bool { + if len(t1) != len(t2) { + return false + } + for i, b := range t1 { + if b >= utf8.RuneSelf { + // No UTF-8 or non-ASCII allowed in tokens. + return false + } + if lowerASCII(byte(b)) != lowerASCII(t2[i]) { + return false + } + } + return true +} + +// isLWS reports whether b is linear white space, according +// to http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 +// +// LWS = [CRLF] 1*( SP | HT ) +func isLWS(b byte) bool { return b == ' ' || b == '\t' } + +// isCTL reports whether b is a control byte, according +// to http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 +// +// CTL = +func isCTL(b byte) bool { + const del = 0x7f // a CTL + return b < ' ' || b == del +} + +// ValidHeaderFieldName reports whether v is a valid HTTP/1.x header name. +// HTTP/2 imposes the additional restriction that uppercase ASCII +// letters are not allowed. +// +// RFC 7230 says: +// +// header-field = field-name ":" OWS field-value OWS +// field-name = token +// token = 1*tchar +// tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / +// "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA +func ValidHeaderFieldName(v string) bool { + if len(v) == 0 { + return false + } + for i := 0; i < len(v); i++ { + if !isTokenTable[v[i]] { + return false + } + } + return true +} + +// ValidHostHeader reports whether h is a valid host header. +func ValidHostHeader(h string) bool { + // The latest spec is actually this: + // + // http://tools.ietf.org/html/rfc7230#section-5.4 + // Host = uri-host [ ":" port ] + // + // Where uri-host is: + // http://tools.ietf.org/html/rfc3986#section-3.2.2 + // + // But we're going to be much more lenient for now and just + // search for any byte that's not a valid byte in any of those + // expressions. + for i := 0; i < len(h); i++ { + if !validHostByte[h[i]] { + return false + } + } + return true +} + +// See the validHostHeader comment. +var validHostByte = [256]bool{ + '0': true, '1': true, '2': true, '3': true, '4': true, '5': true, '6': true, '7': true, + '8': true, '9': true, + + 'a': true, 'b': true, 'c': true, 'd': true, 'e': true, 'f': true, 'g': true, 'h': true, + 'i': true, 'j': true, 'k': true, 'l': true, 'm': true, 'n': true, 'o': true, 'p': true, + 'q': true, 'r': true, 's': true, 't': true, 'u': true, 'v': true, 'w': true, 'x': true, + 'y': true, 'z': true, + + 'A': true, 'B': true, 'C': true, 'D': true, 'E': true, 'F': true, 'G': true, 'H': true, + 'I': true, 'J': true, 'K': true, 'L': true, 'M': true, 'N': true, 'O': true, 'P': true, + 'Q': true, 'R': true, 'S': true, 'T': true, 'U': true, 'V': true, 'W': true, 'X': true, + 'Y': true, 'Z': true, + + '!': true, // sub-delims + '$': true, // sub-delims + '%': true, // pct-encoded (and used in IPv6 zones) + '&': true, // sub-delims + '(': true, // sub-delims + ')': true, // sub-delims + '*': true, // sub-delims + '+': true, // sub-delims + ',': true, // sub-delims + '-': true, // unreserved + '.': true, // unreserved + ':': true, // IPv6address + Host expression's optional port + ';': true, // sub-delims + '=': true, // sub-delims + '[': true, + '\'': true, // sub-delims + ']': true, + '_': true, // unreserved + '~': true, // unreserved +} + +// ValidHeaderFieldValue reports whether v is a valid "field-value" according to +// http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 : +// +// message-header = field-name ":" [ field-value ] +// field-value = *( field-content | LWS ) +// field-content = +// +// http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 : +// +// TEXT = +// LWS = [CRLF] 1*( SP | HT ) +// CTL = +// +// RFC 7230 says: +// +// field-value = *( field-content / obs-fold ) +// obj-fold = N/A to http2, and deprecated +// field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] +// field-vchar = VCHAR / obs-text +// obs-text = %x80-FF +// VCHAR = "any visible [USASCII] character" +// +// http2 further says: "Similarly, HTTP/2 allows header field values +// that are not valid. While most of the values that can be encoded +// will not alter header field parsing, carriage return (CR, ASCII +// 0xd), line feed (LF, ASCII 0xa), and the zero character (NUL, ASCII +// 0x0) might be exploited by an attacker if they are translated +// verbatim. Any request or response that contains a character not +// permitted in a header field value MUST be treated as malformed +// (Section 8.1.2.6). Valid characters are defined by the +// field-content ABNF rule in Section 3.2 of [RFC7230]." +// +// This function does not (yet?) properly handle the rejection of +// strings that begin or end with SP or HTAB. +func ValidHeaderFieldValue(v string) bool { + for i := 0; i < len(v); i++ { + b := v[i] + if isCTL(b) && !isLWS(b) { + return false + } + } + return true +} + +func isASCII(s string) bool { + for i := 0; i < len(s); i++ { + if s[i] >= utf8.RuneSelf { + return false + } + } + return true +} + +// PunycodeHostPort returns the IDNA Punycode version +// of the provided "host" or "host:port" string. +func PunycodeHostPort(v string) (string, error) { + if isASCII(v) { + return v, nil + } + + host, port, err := net.SplitHostPort(v) + if err != nil { + // The input 'v' argument was just a "host" argument, + // without a port. This error should not be returned + // to the caller. + host = v + port = "" + } + host, err = idna.ToASCII(host) + if err != nil { + // Non-UTF-8? Not representable in Punycode, in any + // case. + return "", err + } + if port == "" { + return host, nil + } + return net.JoinHostPort(host, port), nil +} diff --git a/vendor/golang.org/x/net/http2/.gitignore b/vendor/golang.org/x/net/http2/.gitignore new file mode 100644 index 0000000..190f122 --- /dev/null +++ b/vendor/golang.org/x/net/http2/.gitignore @@ -0,0 +1,2 @@ +*~ +h2i/h2i diff --git a/vendor/golang.org/x/net/http2/ascii.go b/vendor/golang.org/x/net/http2/ascii.go new file mode 100644 index 0000000..17caa20 --- /dev/null +++ b/vendor/golang.org/x/net/http2/ascii.go @@ -0,0 +1,53 @@ +// Copyright 2021 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 http2 + +import "strings" + +// The HTTP protocols are defined in terms of ASCII, not Unicode. This file +// contains helper functions which may use Unicode-aware functions which would +// otherwise be unsafe and could introduce vulnerabilities if used improperly. + +// asciiEqualFold is strings.EqualFold, ASCII only. It reports whether s and t +// are equal, ASCII-case-insensitively. +func asciiEqualFold(s, t string) bool { + if len(s) != len(t) { + return false + } + for i := 0; i < len(s); i++ { + if lower(s[i]) != lower(t[i]) { + return false + } + } + return true +} + +// lower returns the ASCII lowercase version of b. +func lower(b byte) byte { + if 'A' <= b && b <= 'Z' { + return b + ('a' - 'A') + } + return b +} + +// isASCIIPrint returns whether s is ASCII and printable according to +// https://tools.ietf.org/html/rfc20#section-4.2. +func isASCIIPrint(s string) bool { + for i := 0; i < len(s); i++ { + if s[i] < ' ' || s[i] > '~' { + return false + } + } + return true +} + +// asciiToLower returns the lowercase version of s if s is ASCII and printable, +// and whether or not it was. +func asciiToLower(s string) (lower string, ok bool) { + if !isASCIIPrint(s) { + return "", false + } + return strings.ToLower(s), true +} diff --git a/vendor/golang.org/x/net/http2/ciphers.go b/vendor/golang.org/x/net/http2/ciphers.go new file mode 100644 index 0000000..c9a0cf3 --- /dev/null +++ b/vendor/golang.org/x/net/http2/ciphers.go @@ -0,0 +1,641 @@ +// Copyright 2017 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 http2 + +// A list of the possible cipher suite ids. Taken from +// https://www.iana.org/assignments/tls-parameters/tls-parameters.txt + +const ( + cipher_TLS_NULL_WITH_NULL_NULL uint16 = 0x0000 + cipher_TLS_RSA_WITH_NULL_MD5 uint16 = 0x0001 + cipher_TLS_RSA_WITH_NULL_SHA uint16 = 0x0002 + cipher_TLS_RSA_EXPORT_WITH_RC4_40_MD5 uint16 = 0x0003 + cipher_TLS_RSA_WITH_RC4_128_MD5 uint16 = 0x0004 + cipher_TLS_RSA_WITH_RC4_128_SHA uint16 = 0x0005 + cipher_TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 uint16 = 0x0006 + cipher_TLS_RSA_WITH_IDEA_CBC_SHA uint16 = 0x0007 + cipher_TLS_RSA_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x0008 + cipher_TLS_RSA_WITH_DES_CBC_SHA uint16 = 0x0009 + cipher_TLS_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0x000A + cipher_TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x000B + cipher_TLS_DH_DSS_WITH_DES_CBC_SHA uint16 = 0x000C + cipher_TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA uint16 = 0x000D + cipher_TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x000E + cipher_TLS_DH_RSA_WITH_DES_CBC_SHA uint16 = 0x000F + cipher_TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0x0010 + cipher_TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x0011 + cipher_TLS_DHE_DSS_WITH_DES_CBC_SHA uint16 = 0x0012 + cipher_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA uint16 = 0x0013 + cipher_TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x0014 + cipher_TLS_DHE_RSA_WITH_DES_CBC_SHA uint16 = 0x0015 + cipher_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0x0016 + cipher_TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 uint16 = 0x0017 + cipher_TLS_DH_anon_WITH_RC4_128_MD5 uint16 = 0x0018 + cipher_TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x0019 + cipher_TLS_DH_anon_WITH_DES_CBC_SHA uint16 = 0x001A + cipher_TLS_DH_anon_WITH_3DES_EDE_CBC_SHA uint16 = 0x001B + // Reserved uint16 = 0x001C-1D + cipher_TLS_KRB5_WITH_DES_CBC_SHA uint16 = 0x001E + cipher_TLS_KRB5_WITH_3DES_EDE_CBC_SHA uint16 = 0x001F + cipher_TLS_KRB5_WITH_RC4_128_SHA uint16 = 0x0020 + cipher_TLS_KRB5_WITH_IDEA_CBC_SHA uint16 = 0x0021 + cipher_TLS_KRB5_WITH_DES_CBC_MD5 uint16 = 0x0022 + cipher_TLS_KRB5_WITH_3DES_EDE_CBC_MD5 uint16 = 0x0023 + cipher_TLS_KRB5_WITH_RC4_128_MD5 uint16 = 0x0024 + cipher_TLS_KRB5_WITH_IDEA_CBC_MD5 uint16 = 0x0025 + cipher_TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA uint16 = 0x0026 + cipher_TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA uint16 = 0x0027 + cipher_TLS_KRB5_EXPORT_WITH_RC4_40_SHA uint16 = 0x0028 + cipher_TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5 uint16 = 0x0029 + cipher_TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5 uint16 = 0x002A + cipher_TLS_KRB5_EXPORT_WITH_RC4_40_MD5 uint16 = 0x002B + cipher_TLS_PSK_WITH_NULL_SHA uint16 = 0x002C + cipher_TLS_DHE_PSK_WITH_NULL_SHA uint16 = 0x002D + cipher_TLS_RSA_PSK_WITH_NULL_SHA uint16 = 0x002E + cipher_TLS_RSA_WITH_AES_128_CBC_SHA uint16 = 0x002F + cipher_TLS_DH_DSS_WITH_AES_128_CBC_SHA uint16 = 0x0030 + cipher_TLS_DH_RSA_WITH_AES_128_CBC_SHA uint16 = 0x0031 + cipher_TLS_DHE_DSS_WITH_AES_128_CBC_SHA uint16 = 0x0032 + cipher_TLS_DHE_RSA_WITH_AES_128_CBC_SHA uint16 = 0x0033 + cipher_TLS_DH_anon_WITH_AES_128_CBC_SHA uint16 = 0x0034 + cipher_TLS_RSA_WITH_AES_256_CBC_SHA uint16 = 0x0035 + cipher_TLS_DH_DSS_WITH_AES_256_CBC_SHA uint16 = 0x0036 + cipher_TLS_DH_RSA_WITH_AES_256_CBC_SHA uint16 = 0x0037 + cipher_TLS_DHE_DSS_WITH_AES_256_CBC_SHA uint16 = 0x0038 + cipher_TLS_DHE_RSA_WITH_AES_256_CBC_SHA uint16 = 0x0039 + cipher_TLS_DH_anon_WITH_AES_256_CBC_SHA uint16 = 0x003A + cipher_TLS_RSA_WITH_NULL_SHA256 uint16 = 0x003B + cipher_TLS_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0x003C + cipher_TLS_RSA_WITH_AES_256_CBC_SHA256 uint16 = 0x003D + cipher_TLS_DH_DSS_WITH_AES_128_CBC_SHA256 uint16 = 0x003E + cipher_TLS_DH_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0x003F + cipher_TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 uint16 = 0x0040 + cipher_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0041 + cipher_TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0042 + cipher_TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0043 + cipher_TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0044 + cipher_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0045 + cipher_TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0046 + // Reserved uint16 = 0x0047-4F + // Reserved uint16 = 0x0050-58 + // Reserved uint16 = 0x0059-5C + // Unassigned uint16 = 0x005D-5F + // Reserved uint16 = 0x0060-66 + cipher_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0x0067 + cipher_TLS_DH_DSS_WITH_AES_256_CBC_SHA256 uint16 = 0x0068 + cipher_TLS_DH_RSA_WITH_AES_256_CBC_SHA256 uint16 = 0x0069 + cipher_TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 uint16 = 0x006A + cipher_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 uint16 = 0x006B + cipher_TLS_DH_anon_WITH_AES_128_CBC_SHA256 uint16 = 0x006C + cipher_TLS_DH_anon_WITH_AES_256_CBC_SHA256 uint16 = 0x006D + // Unassigned uint16 = 0x006E-83 + cipher_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0084 + cipher_TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0085 + cipher_TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0086 + cipher_TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0087 + cipher_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0088 + cipher_TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0089 + cipher_TLS_PSK_WITH_RC4_128_SHA uint16 = 0x008A + cipher_TLS_PSK_WITH_3DES_EDE_CBC_SHA uint16 = 0x008B + cipher_TLS_PSK_WITH_AES_128_CBC_SHA uint16 = 0x008C + cipher_TLS_PSK_WITH_AES_256_CBC_SHA uint16 = 0x008D + cipher_TLS_DHE_PSK_WITH_RC4_128_SHA uint16 = 0x008E + cipher_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA uint16 = 0x008F + cipher_TLS_DHE_PSK_WITH_AES_128_CBC_SHA uint16 = 0x0090 + cipher_TLS_DHE_PSK_WITH_AES_256_CBC_SHA uint16 = 0x0091 + cipher_TLS_RSA_PSK_WITH_RC4_128_SHA uint16 = 0x0092 + cipher_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA uint16 = 0x0093 + cipher_TLS_RSA_PSK_WITH_AES_128_CBC_SHA uint16 = 0x0094 + cipher_TLS_RSA_PSK_WITH_AES_256_CBC_SHA uint16 = 0x0095 + cipher_TLS_RSA_WITH_SEED_CBC_SHA uint16 = 0x0096 + cipher_TLS_DH_DSS_WITH_SEED_CBC_SHA uint16 = 0x0097 + cipher_TLS_DH_RSA_WITH_SEED_CBC_SHA uint16 = 0x0098 + cipher_TLS_DHE_DSS_WITH_SEED_CBC_SHA uint16 = 0x0099 + cipher_TLS_DHE_RSA_WITH_SEED_CBC_SHA uint16 = 0x009A + cipher_TLS_DH_anon_WITH_SEED_CBC_SHA uint16 = 0x009B + cipher_TLS_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0x009C + cipher_TLS_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0x009D + cipher_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0x009E + cipher_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0x009F + cipher_TLS_DH_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0x00A0 + cipher_TLS_DH_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0x00A1 + cipher_TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 uint16 = 0x00A2 + cipher_TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 uint16 = 0x00A3 + cipher_TLS_DH_DSS_WITH_AES_128_GCM_SHA256 uint16 = 0x00A4 + cipher_TLS_DH_DSS_WITH_AES_256_GCM_SHA384 uint16 = 0x00A5 + cipher_TLS_DH_anon_WITH_AES_128_GCM_SHA256 uint16 = 0x00A6 + cipher_TLS_DH_anon_WITH_AES_256_GCM_SHA384 uint16 = 0x00A7 + cipher_TLS_PSK_WITH_AES_128_GCM_SHA256 uint16 = 0x00A8 + cipher_TLS_PSK_WITH_AES_256_GCM_SHA384 uint16 = 0x00A9 + cipher_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 uint16 = 0x00AA + cipher_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 uint16 = 0x00AB + cipher_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 uint16 = 0x00AC + cipher_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 uint16 = 0x00AD + cipher_TLS_PSK_WITH_AES_128_CBC_SHA256 uint16 = 0x00AE + cipher_TLS_PSK_WITH_AES_256_CBC_SHA384 uint16 = 0x00AF + cipher_TLS_PSK_WITH_NULL_SHA256 uint16 = 0x00B0 + cipher_TLS_PSK_WITH_NULL_SHA384 uint16 = 0x00B1 + cipher_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 uint16 = 0x00B2 + cipher_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 uint16 = 0x00B3 + cipher_TLS_DHE_PSK_WITH_NULL_SHA256 uint16 = 0x00B4 + cipher_TLS_DHE_PSK_WITH_NULL_SHA384 uint16 = 0x00B5 + cipher_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 uint16 = 0x00B6 + cipher_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 uint16 = 0x00B7 + cipher_TLS_RSA_PSK_WITH_NULL_SHA256 uint16 = 0x00B8 + cipher_TLS_RSA_PSK_WITH_NULL_SHA384 uint16 = 0x00B9 + cipher_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BA + cipher_TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BB + cipher_TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BC + cipher_TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BD + cipher_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BE + cipher_TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BF + cipher_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C0 + cipher_TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C1 + cipher_TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C2 + cipher_TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C3 + cipher_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C4 + cipher_TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C5 + // Unassigned uint16 = 0x00C6-FE + cipher_TLS_EMPTY_RENEGOTIATION_INFO_SCSV uint16 = 0x00FF + // Unassigned uint16 = 0x01-55,* + cipher_TLS_FALLBACK_SCSV uint16 = 0x5600 + // Unassigned uint16 = 0x5601 - 0xC000 + cipher_TLS_ECDH_ECDSA_WITH_NULL_SHA uint16 = 0xC001 + cipher_TLS_ECDH_ECDSA_WITH_RC4_128_SHA uint16 = 0xC002 + cipher_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC003 + cipher_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA uint16 = 0xC004 + cipher_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA uint16 = 0xC005 + cipher_TLS_ECDHE_ECDSA_WITH_NULL_SHA uint16 = 0xC006 + cipher_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA uint16 = 0xC007 + cipher_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC008 + cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA uint16 = 0xC009 + cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA uint16 = 0xC00A + cipher_TLS_ECDH_RSA_WITH_NULL_SHA uint16 = 0xC00B + cipher_TLS_ECDH_RSA_WITH_RC4_128_SHA uint16 = 0xC00C + cipher_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC00D + cipher_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA uint16 = 0xC00E + cipher_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA uint16 = 0xC00F + cipher_TLS_ECDHE_RSA_WITH_NULL_SHA uint16 = 0xC010 + cipher_TLS_ECDHE_RSA_WITH_RC4_128_SHA uint16 = 0xC011 + cipher_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC012 + cipher_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA uint16 = 0xC013 + cipher_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA uint16 = 0xC014 + cipher_TLS_ECDH_anon_WITH_NULL_SHA uint16 = 0xC015 + cipher_TLS_ECDH_anon_WITH_RC4_128_SHA uint16 = 0xC016 + cipher_TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA uint16 = 0xC017 + cipher_TLS_ECDH_anon_WITH_AES_128_CBC_SHA uint16 = 0xC018 + cipher_TLS_ECDH_anon_WITH_AES_256_CBC_SHA uint16 = 0xC019 + cipher_TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC01A + cipher_TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC01B + cipher_TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA uint16 = 0xC01C + cipher_TLS_SRP_SHA_WITH_AES_128_CBC_SHA uint16 = 0xC01D + cipher_TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA uint16 = 0xC01E + cipher_TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA uint16 = 0xC01F + cipher_TLS_SRP_SHA_WITH_AES_256_CBC_SHA uint16 = 0xC020 + cipher_TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA uint16 = 0xC021 + cipher_TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA uint16 = 0xC022 + cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 uint16 = 0xC023 + cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 uint16 = 0xC024 + cipher_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 uint16 = 0xC025 + cipher_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 uint16 = 0xC026 + cipher_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0xC027 + cipher_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 uint16 = 0xC028 + cipher_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0xC029 + cipher_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 uint16 = 0xC02A + cipher_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 uint16 = 0xC02B + cipher_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 uint16 = 0xC02C + cipher_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 uint16 = 0xC02D + cipher_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 uint16 = 0xC02E + cipher_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0xC02F + cipher_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0xC030 + cipher_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0xC031 + cipher_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0xC032 + cipher_TLS_ECDHE_PSK_WITH_RC4_128_SHA uint16 = 0xC033 + cipher_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA uint16 = 0xC034 + cipher_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA uint16 = 0xC035 + cipher_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA uint16 = 0xC036 + cipher_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 uint16 = 0xC037 + cipher_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 uint16 = 0xC038 + cipher_TLS_ECDHE_PSK_WITH_NULL_SHA uint16 = 0xC039 + cipher_TLS_ECDHE_PSK_WITH_NULL_SHA256 uint16 = 0xC03A + cipher_TLS_ECDHE_PSK_WITH_NULL_SHA384 uint16 = 0xC03B + cipher_TLS_RSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC03C + cipher_TLS_RSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC03D + cipher_TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC03E + cipher_TLS_DH_DSS_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC03F + cipher_TLS_DH_RSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC040 + cipher_TLS_DH_RSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC041 + cipher_TLS_DHE_DSS_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC042 + cipher_TLS_DHE_DSS_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC043 + cipher_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC044 + cipher_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC045 + cipher_TLS_DH_anon_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC046 + cipher_TLS_DH_anon_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC047 + cipher_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC048 + cipher_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC049 + cipher_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC04A + cipher_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC04B + cipher_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC04C + cipher_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC04D + cipher_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC04E + cipher_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC04F + cipher_TLS_RSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC050 + cipher_TLS_RSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC051 + cipher_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC052 + cipher_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC053 + cipher_TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC054 + cipher_TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC055 + cipher_TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC056 + cipher_TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC057 + cipher_TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC058 + cipher_TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC059 + cipher_TLS_DH_anon_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC05A + cipher_TLS_DH_anon_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC05B + cipher_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC05C + cipher_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC05D + cipher_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC05E + cipher_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC05F + cipher_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC060 + cipher_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC061 + cipher_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC062 + cipher_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC063 + cipher_TLS_PSK_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC064 + cipher_TLS_PSK_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC065 + cipher_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC066 + cipher_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC067 + cipher_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC068 + cipher_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC069 + cipher_TLS_PSK_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC06A + cipher_TLS_PSK_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC06B + cipher_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC06C + cipher_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC06D + cipher_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC06E + cipher_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC06F + cipher_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC070 + cipher_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC071 + cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC072 + cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC073 + cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC074 + cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC075 + cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC076 + cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC077 + cipher_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC078 + cipher_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC079 + cipher_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC07A + cipher_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC07B + cipher_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC07C + cipher_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC07D + cipher_TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC07E + cipher_TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC07F + cipher_TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC080 + cipher_TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC081 + cipher_TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC082 + cipher_TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC083 + cipher_TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC084 + cipher_TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC085 + cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC086 + cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC087 + cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC088 + cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC089 + cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC08A + cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC08B + cipher_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC08C + cipher_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC08D + cipher_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC08E + cipher_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC08F + cipher_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC090 + cipher_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC091 + cipher_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC092 + cipher_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC093 + cipher_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC094 + cipher_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC095 + cipher_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC096 + cipher_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC097 + cipher_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC098 + cipher_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC099 + cipher_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC09A + cipher_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC09B + cipher_TLS_RSA_WITH_AES_128_CCM uint16 = 0xC09C + cipher_TLS_RSA_WITH_AES_256_CCM uint16 = 0xC09D + cipher_TLS_DHE_RSA_WITH_AES_128_CCM uint16 = 0xC09E + cipher_TLS_DHE_RSA_WITH_AES_256_CCM uint16 = 0xC09F + cipher_TLS_RSA_WITH_AES_128_CCM_8 uint16 = 0xC0A0 + cipher_TLS_RSA_WITH_AES_256_CCM_8 uint16 = 0xC0A1 + cipher_TLS_DHE_RSA_WITH_AES_128_CCM_8 uint16 = 0xC0A2 + cipher_TLS_DHE_RSA_WITH_AES_256_CCM_8 uint16 = 0xC0A3 + cipher_TLS_PSK_WITH_AES_128_CCM uint16 = 0xC0A4 + cipher_TLS_PSK_WITH_AES_256_CCM uint16 = 0xC0A5 + cipher_TLS_DHE_PSK_WITH_AES_128_CCM uint16 = 0xC0A6 + cipher_TLS_DHE_PSK_WITH_AES_256_CCM uint16 = 0xC0A7 + cipher_TLS_PSK_WITH_AES_128_CCM_8 uint16 = 0xC0A8 + cipher_TLS_PSK_WITH_AES_256_CCM_8 uint16 = 0xC0A9 + cipher_TLS_PSK_DHE_WITH_AES_128_CCM_8 uint16 = 0xC0AA + cipher_TLS_PSK_DHE_WITH_AES_256_CCM_8 uint16 = 0xC0AB + cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CCM uint16 = 0xC0AC + cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CCM uint16 = 0xC0AD + cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 uint16 = 0xC0AE + cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 uint16 = 0xC0AF + // Unassigned uint16 = 0xC0B0-FF + // Unassigned uint16 = 0xC1-CB,* + // Unassigned uint16 = 0xCC00-A7 + cipher_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCA8 + cipher_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCA9 + cipher_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCAA + cipher_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCAB + cipher_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCAC + cipher_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCAD + cipher_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCAE +) + +// isBadCipher reports whether the cipher is blacklisted by the HTTP/2 spec. +// References: +// https://tools.ietf.org/html/rfc7540#appendix-A +// Reject cipher suites from Appendix A. +// "This list includes those cipher suites that do not +// offer an ephemeral key exchange and those that are +// based on the TLS null, stream or block cipher type" +func isBadCipher(cipher uint16) bool { + switch cipher { + case cipher_TLS_NULL_WITH_NULL_NULL, + cipher_TLS_RSA_WITH_NULL_MD5, + cipher_TLS_RSA_WITH_NULL_SHA, + cipher_TLS_RSA_EXPORT_WITH_RC4_40_MD5, + cipher_TLS_RSA_WITH_RC4_128_MD5, + cipher_TLS_RSA_WITH_RC4_128_SHA, + cipher_TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5, + cipher_TLS_RSA_WITH_IDEA_CBC_SHA, + cipher_TLS_RSA_EXPORT_WITH_DES40_CBC_SHA, + cipher_TLS_RSA_WITH_DES_CBC_SHA, + cipher_TLS_RSA_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA, + cipher_TLS_DH_DSS_WITH_DES_CBC_SHA, + cipher_TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA, + cipher_TLS_DH_RSA_WITH_DES_CBC_SHA, + cipher_TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, + cipher_TLS_DHE_DSS_WITH_DES_CBC_SHA, + cipher_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, + cipher_TLS_DHE_RSA_WITH_DES_CBC_SHA, + cipher_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_DH_anon_EXPORT_WITH_RC4_40_MD5, + cipher_TLS_DH_anon_WITH_RC4_128_MD5, + cipher_TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA, + cipher_TLS_DH_anon_WITH_DES_CBC_SHA, + cipher_TLS_DH_anon_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_KRB5_WITH_DES_CBC_SHA, + cipher_TLS_KRB5_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_KRB5_WITH_RC4_128_SHA, + cipher_TLS_KRB5_WITH_IDEA_CBC_SHA, + cipher_TLS_KRB5_WITH_DES_CBC_MD5, + cipher_TLS_KRB5_WITH_3DES_EDE_CBC_MD5, + cipher_TLS_KRB5_WITH_RC4_128_MD5, + cipher_TLS_KRB5_WITH_IDEA_CBC_MD5, + cipher_TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA, + cipher_TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA, + cipher_TLS_KRB5_EXPORT_WITH_RC4_40_SHA, + cipher_TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5, + cipher_TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5, + cipher_TLS_KRB5_EXPORT_WITH_RC4_40_MD5, + cipher_TLS_PSK_WITH_NULL_SHA, + cipher_TLS_DHE_PSK_WITH_NULL_SHA, + cipher_TLS_RSA_PSK_WITH_NULL_SHA, + cipher_TLS_RSA_WITH_AES_128_CBC_SHA, + cipher_TLS_DH_DSS_WITH_AES_128_CBC_SHA, + cipher_TLS_DH_RSA_WITH_AES_128_CBC_SHA, + cipher_TLS_DHE_DSS_WITH_AES_128_CBC_SHA, + cipher_TLS_DHE_RSA_WITH_AES_128_CBC_SHA, + cipher_TLS_DH_anon_WITH_AES_128_CBC_SHA, + cipher_TLS_RSA_WITH_AES_256_CBC_SHA, + cipher_TLS_DH_DSS_WITH_AES_256_CBC_SHA, + cipher_TLS_DH_RSA_WITH_AES_256_CBC_SHA, + cipher_TLS_DHE_DSS_WITH_AES_256_CBC_SHA, + cipher_TLS_DHE_RSA_WITH_AES_256_CBC_SHA, + cipher_TLS_DH_anon_WITH_AES_256_CBC_SHA, + cipher_TLS_RSA_WITH_NULL_SHA256, + cipher_TLS_RSA_WITH_AES_128_CBC_SHA256, + cipher_TLS_RSA_WITH_AES_256_CBC_SHA256, + cipher_TLS_DH_DSS_WITH_AES_128_CBC_SHA256, + cipher_TLS_DH_RSA_WITH_AES_128_CBC_SHA256, + cipher_TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, + cipher_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA, + cipher_TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA, + cipher_TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA, + cipher_TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA, + cipher_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA, + cipher_TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA, + cipher_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, + cipher_TLS_DH_DSS_WITH_AES_256_CBC_SHA256, + cipher_TLS_DH_RSA_WITH_AES_256_CBC_SHA256, + cipher_TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, + cipher_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, + cipher_TLS_DH_anon_WITH_AES_128_CBC_SHA256, + cipher_TLS_DH_anon_WITH_AES_256_CBC_SHA256, + cipher_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA, + cipher_TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA, + cipher_TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA, + cipher_TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA, + cipher_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA, + cipher_TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA, + cipher_TLS_PSK_WITH_RC4_128_SHA, + cipher_TLS_PSK_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_PSK_WITH_AES_128_CBC_SHA, + cipher_TLS_PSK_WITH_AES_256_CBC_SHA, + cipher_TLS_DHE_PSK_WITH_RC4_128_SHA, + cipher_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_DHE_PSK_WITH_AES_128_CBC_SHA, + cipher_TLS_DHE_PSK_WITH_AES_256_CBC_SHA, + cipher_TLS_RSA_PSK_WITH_RC4_128_SHA, + cipher_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_RSA_PSK_WITH_AES_128_CBC_SHA, + cipher_TLS_RSA_PSK_WITH_AES_256_CBC_SHA, + cipher_TLS_RSA_WITH_SEED_CBC_SHA, + cipher_TLS_DH_DSS_WITH_SEED_CBC_SHA, + cipher_TLS_DH_RSA_WITH_SEED_CBC_SHA, + cipher_TLS_DHE_DSS_WITH_SEED_CBC_SHA, + cipher_TLS_DHE_RSA_WITH_SEED_CBC_SHA, + cipher_TLS_DH_anon_WITH_SEED_CBC_SHA, + cipher_TLS_RSA_WITH_AES_128_GCM_SHA256, + cipher_TLS_RSA_WITH_AES_256_GCM_SHA384, + cipher_TLS_DH_RSA_WITH_AES_128_GCM_SHA256, + cipher_TLS_DH_RSA_WITH_AES_256_GCM_SHA384, + cipher_TLS_DH_DSS_WITH_AES_128_GCM_SHA256, + cipher_TLS_DH_DSS_WITH_AES_256_GCM_SHA384, + cipher_TLS_DH_anon_WITH_AES_128_GCM_SHA256, + cipher_TLS_DH_anon_WITH_AES_256_GCM_SHA384, + cipher_TLS_PSK_WITH_AES_128_GCM_SHA256, + cipher_TLS_PSK_WITH_AES_256_GCM_SHA384, + cipher_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256, + cipher_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384, + cipher_TLS_PSK_WITH_AES_128_CBC_SHA256, + cipher_TLS_PSK_WITH_AES_256_CBC_SHA384, + cipher_TLS_PSK_WITH_NULL_SHA256, + cipher_TLS_PSK_WITH_NULL_SHA384, + cipher_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256, + cipher_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384, + cipher_TLS_DHE_PSK_WITH_NULL_SHA256, + cipher_TLS_DHE_PSK_WITH_NULL_SHA384, + cipher_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256, + cipher_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384, + cipher_TLS_RSA_PSK_WITH_NULL_SHA256, + cipher_TLS_RSA_PSK_WITH_NULL_SHA384, + cipher_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256, + cipher_TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256, + cipher_TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256, + cipher_TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256, + cipher_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256, + cipher_TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256, + cipher_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256, + cipher_TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256, + cipher_TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256, + cipher_TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256, + cipher_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256, + cipher_TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256, + cipher_TLS_EMPTY_RENEGOTIATION_INFO_SCSV, + cipher_TLS_ECDH_ECDSA_WITH_NULL_SHA, + cipher_TLS_ECDH_ECDSA_WITH_RC4_128_SHA, + cipher_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, + cipher_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, + cipher_TLS_ECDHE_ECDSA_WITH_NULL_SHA, + cipher_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, + cipher_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + cipher_TLS_ECDH_RSA_WITH_NULL_SHA, + cipher_TLS_ECDH_RSA_WITH_RC4_128_SHA, + cipher_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, + cipher_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, + cipher_TLS_ECDHE_RSA_WITH_NULL_SHA, + cipher_TLS_ECDHE_RSA_WITH_RC4_128_SHA, + cipher_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + cipher_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + cipher_TLS_ECDH_anon_WITH_NULL_SHA, + cipher_TLS_ECDH_anon_WITH_RC4_128_SHA, + cipher_TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_ECDH_anon_WITH_AES_128_CBC_SHA, + cipher_TLS_ECDH_anon_WITH_AES_256_CBC_SHA, + cipher_TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_SRP_SHA_WITH_AES_128_CBC_SHA, + cipher_TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA, + cipher_TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA, + cipher_TLS_SRP_SHA_WITH_AES_256_CBC_SHA, + cipher_TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA, + cipher_TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA, + cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, + cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, + cipher_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, + cipher_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, + cipher_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, + cipher_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, + cipher_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, + cipher_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, + cipher_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, + cipher_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, + cipher_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, + cipher_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, + cipher_TLS_ECDHE_PSK_WITH_RC4_128_SHA, + cipher_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA, + cipher_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA, + cipher_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA, + cipher_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, + cipher_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384, + cipher_TLS_ECDHE_PSK_WITH_NULL_SHA, + cipher_TLS_ECDHE_PSK_WITH_NULL_SHA256, + cipher_TLS_ECDHE_PSK_WITH_NULL_SHA384, + cipher_TLS_RSA_WITH_ARIA_128_CBC_SHA256, + cipher_TLS_RSA_WITH_ARIA_256_CBC_SHA384, + cipher_TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256, + cipher_TLS_DH_DSS_WITH_ARIA_256_CBC_SHA384, + cipher_TLS_DH_RSA_WITH_ARIA_128_CBC_SHA256, + cipher_TLS_DH_RSA_WITH_ARIA_256_CBC_SHA384, + cipher_TLS_DHE_DSS_WITH_ARIA_128_CBC_SHA256, + cipher_TLS_DHE_DSS_WITH_ARIA_256_CBC_SHA384, + cipher_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256, + cipher_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384, + cipher_TLS_DH_anon_WITH_ARIA_128_CBC_SHA256, + cipher_TLS_DH_anon_WITH_ARIA_256_CBC_SHA384, + cipher_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256, + cipher_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384, + cipher_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256, + cipher_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384, + cipher_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256, + cipher_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384, + cipher_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256, + cipher_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384, + cipher_TLS_RSA_WITH_ARIA_128_GCM_SHA256, + cipher_TLS_RSA_WITH_ARIA_256_GCM_SHA384, + cipher_TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256, + cipher_TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384, + cipher_TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256, + cipher_TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384, + cipher_TLS_DH_anon_WITH_ARIA_128_GCM_SHA256, + cipher_TLS_DH_anon_WITH_ARIA_256_GCM_SHA384, + cipher_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256, + cipher_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384, + cipher_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256, + cipher_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384, + cipher_TLS_PSK_WITH_ARIA_128_CBC_SHA256, + cipher_TLS_PSK_WITH_ARIA_256_CBC_SHA384, + cipher_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256, + cipher_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384, + cipher_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256, + cipher_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384, + cipher_TLS_PSK_WITH_ARIA_128_GCM_SHA256, + cipher_TLS_PSK_WITH_ARIA_256_GCM_SHA384, + cipher_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256, + cipher_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384, + cipher_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256, + cipher_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384, + cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256, + cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384, + cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256, + cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384, + cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256, + cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384, + cipher_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256, + cipher_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384, + cipher_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256, + cipher_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384, + cipher_TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256, + cipher_TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384, + cipher_TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256, + cipher_TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384, + cipher_TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256, + cipher_TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384, + cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256, + cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384, + cipher_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256, + cipher_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384, + cipher_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256, + cipher_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384, + cipher_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256, + cipher_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384, + cipher_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256, + cipher_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384, + cipher_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256, + cipher_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384, + cipher_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256, + cipher_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384, + cipher_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256, + cipher_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384, + cipher_TLS_RSA_WITH_AES_128_CCM, + cipher_TLS_RSA_WITH_AES_256_CCM, + cipher_TLS_RSA_WITH_AES_128_CCM_8, + cipher_TLS_RSA_WITH_AES_256_CCM_8, + cipher_TLS_PSK_WITH_AES_128_CCM, + cipher_TLS_PSK_WITH_AES_256_CCM, + cipher_TLS_PSK_WITH_AES_128_CCM_8, + cipher_TLS_PSK_WITH_AES_256_CCM_8: + return true + default: + return false + } +} diff --git a/vendor/golang.org/x/net/http2/client_conn_pool.go b/vendor/golang.org/x/net/http2/client_conn_pool.go new file mode 100644 index 0000000..e81b73e --- /dev/null +++ b/vendor/golang.org/x/net/http2/client_conn_pool.go @@ -0,0 +1,311 @@ +// Copyright 2015 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. + +// Transport code's client connection pooling. + +package http2 + +import ( + "context" + "errors" + "net" + "net/http" + "sync" +) + +// ClientConnPool manages a pool of HTTP/2 client connections. +type ClientConnPool interface { + // GetClientConn returns a specific HTTP/2 connection (usually + // a TLS-TCP connection) to an HTTP/2 server. On success, the + // returned ClientConn accounts for the upcoming RoundTrip + // call, so the caller should not omit it. If the caller needs + // to, ClientConn.RoundTrip can be called with a bogus + // new(http.Request) to release the stream reservation. + GetClientConn(req *http.Request, addr string) (*ClientConn, error) + MarkDead(*ClientConn) +} + +// clientConnPoolIdleCloser is the interface implemented by ClientConnPool +// implementations which can close their idle connections. +type clientConnPoolIdleCloser interface { + ClientConnPool + closeIdleConnections() +} + +var ( + _ clientConnPoolIdleCloser = (*clientConnPool)(nil) + _ clientConnPoolIdleCloser = noDialClientConnPool{} +) + +// TODO: use singleflight for dialing and addConnCalls? +type clientConnPool struct { + t *Transport + + mu sync.Mutex // TODO: maybe switch to RWMutex + // TODO: add support for sharing conns based on cert names + // (e.g. share conn for googleapis.com and appspot.com) + conns map[string][]*ClientConn // key is host:port + dialing map[string]*dialCall // currently in-flight dials + keys map[*ClientConn][]string + addConnCalls map[string]*addConnCall // in-flight addConnIfNeeded calls +} + +func (p *clientConnPool) GetClientConn(req *http.Request, addr string) (*ClientConn, error) { + return p.getClientConn(req, addr, dialOnMiss) +} + +const ( + dialOnMiss = true + noDialOnMiss = false +) + +func (p *clientConnPool) getClientConn(req *http.Request, addr string, dialOnMiss bool) (*ClientConn, error) { + // TODO(dneil): Dial a new connection when t.DisableKeepAlives is set? + if isConnectionCloseRequest(req) && dialOnMiss { + // It gets its own connection. + traceGetConn(req, addr) + const singleUse = true + cc, err := p.t.dialClientConn(req.Context(), addr, singleUse) + if err != nil { + return nil, err + } + return cc, nil + } + for { + p.mu.Lock() + for _, cc := range p.conns[addr] { + if cc.ReserveNewRequest() { + // When a connection is presented to us by the net/http package, + // the GetConn hook has already been called. + // Don't call it a second time here. + if !cc.getConnCalled { + traceGetConn(req, addr) + } + cc.getConnCalled = false + p.mu.Unlock() + return cc, nil + } + } + if !dialOnMiss { + p.mu.Unlock() + return nil, ErrNoCachedConn + } + traceGetConn(req, addr) + call := p.getStartDialLocked(req.Context(), addr) + p.mu.Unlock() + <-call.done + if shouldRetryDial(call, req) { + continue + } + cc, err := call.res, call.err + if err != nil { + return nil, err + } + if cc.ReserveNewRequest() { + return cc, nil + } + } +} + +// dialCall is an in-flight Transport dial call to a host. +type dialCall struct { + _ incomparable + p *clientConnPool + // the context associated with the request + // that created this dialCall + ctx context.Context + done chan struct{} // closed when done + res *ClientConn // valid after done is closed + err error // valid after done is closed +} + +// requires p.mu is held. +func (p *clientConnPool) getStartDialLocked(ctx context.Context, addr string) *dialCall { + if call, ok := p.dialing[addr]; ok { + // A dial is already in-flight. Don't start another. + return call + } + call := &dialCall{p: p, done: make(chan struct{}), ctx: ctx} + if p.dialing == nil { + p.dialing = make(map[string]*dialCall) + } + p.dialing[addr] = call + go call.dial(call.ctx, addr) + return call +} + +// run in its own goroutine. +func (c *dialCall) dial(ctx context.Context, addr string) { + const singleUse = false // shared conn + c.res, c.err = c.p.t.dialClientConn(ctx, addr, singleUse) + + c.p.mu.Lock() + delete(c.p.dialing, addr) + if c.err == nil { + c.p.addConnLocked(addr, c.res) + } + c.p.mu.Unlock() + + close(c.done) +} + +// addConnIfNeeded makes a NewClientConn out of c if a connection for key doesn't +// already exist. It coalesces concurrent calls with the same key. +// This is used by the http1 Transport code when it creates a new connection. Because +// the http1 Transport doesn't de-dup TCP dials to outbound hosts (because it doesn't know +// the protocol), it can get into a situation where it has multiple TLS connections. +// This code decides which ones live or die. +// The return value used is whether c was used. +// c is never closed. +func (p *clientConnPool) addConnIfNeeded(key string, t *Transport, c net.Conn) (used bool, err error) { + p.mu.Lock() + for _, cc := range p.conns[key] { + if cc.CanTakeNewRequest() { + p.mu.Unlock() + return false, nil + } + } + call, dup := p.addConnCalls[key] + if !dup { + if p.addConnCalls == nil { + p.addConnCalls = make(map[string]*addConnCall) + } + call = &addConnCall{ + p: p, + done: make(chan struct{}), + } + p.addConnCalls[key] = call + go call.run(t, key, c) + } + p.mu.Unlock() + + <-call.done + if call.err != nil { + return false, call.err + } + return !dup, nil +} + +type addConnCall struct { + _ incomparable + p *clientConnPool + done chan struct{} // closed when done + err error +} + +func (c *addConnCall) run(t *Transport, key string, nc net.Conn) { + cc, err := t.NewClientConn(nc) + + p := c.p + p.mu.Lock() + if err != nil { + c.err = err + } else { + cc.getConnCalled = true // already called by the net/http package + p.addConnLocked(key, cc) + } + delete(p.addConnCalls, key) + p.mu.Unlock() + close(c.done) +} + +// p.mu must be held +func (p *clientConnPool) addConnLocked(key string, cc *ClientConn) { + for _, v := range p.conns[key] { + if v == cc { + return + } + } + if p.conns == nil { + p.conns = make(map[string][]*ClientConn) + } + if p.keys == nil { + p.keys = make(map[*ClientConn][]string) + } + p.conns[key] = append(p.conns[key], cc) + p.keys[cc] = append(p.keys[cc], key) +} + +func (p *clientConnPool) MarkDead(cc *ClientConn) { + p.mu.Lock() + defer p.mu.Unlock() + for _, key := range p.keys[cc] { + vv, ok := p.conns[key] + if !ok { + continue + } + newList := filterOutClientConn(vv, cc) + if len(newList) > 0 { + p.conns[key] = newList + } else { + delete(p.conns, key) + } + } + delete(p.keys, cc) +} + +func (p *clientConnPool) closeIdleConnections() { + p.mu.Lock() + defer p.mu.Unlock() + // TODO: don't close a cc if it was just added to the pool + // milliseconds ago and has never been used. There's currently + // a small race window with the HTTP/1 Transport's integration + // where it can add an idle conn just before using it, and + // somebody else can concurrently call CloseIdleConns and + // break some caller's RoundTrip. + for _, vv := range p.conns { + for _, cc := range vv { + cc.closeIfIdle() + } + } +} + +func filterOutClientConn(in []*ClientConn, exclude *ClientConn) []*ClientConn { + out := in[:0] + for _, v := range in { + if v != exclude { + out = append(out, v) + } + } + // If we filtered it out, zero out the last item to prevent + // the GC from seeing it. + if len(in) != len(out) { + in[len(in)-1] = nil + } + return out +} + +// noDialClientConnPool is an implementation of http2.ClientConnPool +// which never dials. We let the HTTP/1.1 client dial and use its TLS +// connection instead. +type noDialClientConnPool struct{ *clientConnPool } + +func (p noDialClientConnPool) GetClientConn(req *http.Request, addr string) (*ClientConn, error) { + return p.getClientConn(req, addr, noDialOnMiss) +} + +// shouldRetryDial reports whether the current request should +// retry dialing after the call finished unsuccessfully, for example +// if the dial was canceled because of a context cancellation or +// deadline expiry. +func shouldRetryDial(call *dialCall, req *http.Request) bool { + if call.err == nil { + // No error, no need to retry + return false + } + if call.ctx == req.Context() { + // If the call has the same context as the request, the dial + // should not be retried, since any cancellation will have come + // from this request. + return false + } + if !errors.Is(call.err, context.Canceled) && !errors.Is(call.err, context.DeadlineExceeded) { + // If the call error is not because of a context cancellation or a deadline expiry, + // the dial should not be retried. + return false + } + // Only retry if the error is a context cancellation error or deadline expiry + // and the context associated with the call was canceled or expired. + return call.ctx.Err() != nil +} diff --git a/vendor/golang.org/x/net/http2/config.go b/vendor/golang.org/x/net/http2/config.go new file mode 100644 index 0000000..ca645d9 --- /dev/null +++ b/vendor/golang.org/x/net/http2/config.go @@ -0,0 +1,122 @@ +// Copyright 2024 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 http2 + +import ( + "math" + "net/http" + "time" +) + +// http2Config is a package-internal version of net/http.HTTP2Config. +// +// http.HTTP2Config was added in Go 1.24. +// When running with a version of net/http that includes HTTP2Config, +// we merge the configuration with the fields in Transport or Server +// to produce an http2Config. +// +// Zero valued fields in http2Config are interpreted as in the +// net/http.HTTPConfig documentation. +// +// Precedence order for reconciling configurations is: +// +// - Use the net/http.{Server,Transport}.HTTP2Config value, when non-zero. +// - Otherwise use the http2.{Server.Transport} value. +// - If the resulting value is zero or out of range, use a default. +type http2Config struct { + MaxConcurrentStreams uint32 + MaxDecoderHeaderTableSize uint32 + MaxEncoderHeaderTableSize uint32 + MaxReadFrameSize uint32 + MaxUploadBufferPerConnection int32 + MaxUploadBufferPerStream int32 + SendPingTimeout time.Duration + PingTimeout time.Duration + WriteByteTimeout time.Duration + PermitProhibitedCipherSuites bool + CountError func(errType string) +} + +// configFromServer merges configuration settings from +// net/http.Server.HTTP2Config and http2.Server. +func configFromServer(h1 *http.Server, h2 *Server) http2Config { + conf := http2Config{ + MaxConcurrentStreams: h2.MaxConcurrentStreams, + MaxEncoderHeaderTableSize: h2.MaxEncoderHeaderTableSize, + MaxDecoderHeaderTableSize: h2.MaxDecoderHeaderTableSize, + MaxReadFrameSize: h2.MaxReadFrameSize, + MaxUploadBufferPerConnection: h2.MaxUploadBufferPerConnection, + MaxUploadBufferPerStream: h2.MaxUploadBufferPerStream, + SendPingTimeout: h2.ReadIdleTimeout, + PingTimeout: h2.PingTimeout, + WriteByteTimeout: h2.WriteByteTimeout, + PermitProhibitedCipherSuites: h2.PermitProhibitedCipherSuites, + CountError: h2.CountError, + } + fillNetHTTPServerConfig(&conf, h1) + setConfigDefaults(&conf, true) + return conf +} + +// configFromTransport merges configuration settings from h2 and h2.t1.HTTP2 +// (the net/http Transport). +func configFromTransport(h2 *Transport) http2Config { + conf := http2Config{ + MaxEncoderHeaderTableSize: h2.MaxEncoderHeaderTableSize, + MaxDecoderHeaderTableSize: h2.MaxDecoderHeaderTableSize, + MaxReadFrameSize: h2.MaxReadFrameSize, + SendPingTimeout: h2.ReadIdleTimeout, + PingTimeout: h2.PingTimeout, + WriteByteTimeout: h2.WriteByteTimeout, + } + + // Unlike most config fields, where out-of-range values revert to the default, + // Transport.MaxReadFrameSize clips. + if conf.MaxReadFrameSize < minMaxFrameSize { + conf.MaxReadFrameSize = minMaxFrameSize + } else if conf.MaxReadFrameSize > maxFrameSize { + conf.MaxReadFrameSize = maxFrameSize + } + + if h2.t1 != nil { + fillNetHTTPTransportConfig(&conf, h2.t1) + } + setConfigDefaults(&conf, false) + return conf +} + +func setDefault[T ~int | ~int32 | ~uint32 | ~int64](v *T, minval, maxval, defval T) { + if *v < minval || *v > maxval { + *v = defval + } +} + +func setConfigDefaults(conf *http2Config, server bool) { + setDefault(&conf.MaxConcurrentStreams, 1, math.MaxUint32, defaultMaxStreams) + setDefault(&conf.MaxEncoderHeaderTableSize, 1, math.MaxUint32, initialHeaderTableSize) + setDefault(&conf.MaxDecoderHeaderTableSize, 1, math.MaxUint32, initialHeaderTableSize) + if server { + setDefault(&conf.MaxUploadBufferPerConnection, initialWindowSize, math.MaxInt32, 1<<20) + } else { + setDefault(&conf.MaxUploadBufferPerConnection, initialWindowSize, math.MaxInt32, transportDefaultConnFlow) + } + if server { + setDefault(&conf.MaxUploadBufferPerStream, 1, math.MaxInt32, 1<<20) + } else { + setDefault(&conf.MaxUploadBufferPerStream, 1, math.MaxInt32, transportDefaultStreamFlow) + } + setDefault(&conf.MaxReadFrameSize, minMaxFrameSize, maxFrameSize, defaultMaxReadFrameSize) + setDefault(&conf.PingTimeout, 1, math.MaxInt64, 15*time.Second) +} + +// adjustHTTP1MaxHeaderSize converts a limit in bytes on the size of an HTTP/1 header +// to an HTTP/2 MAX_HEADER_LIST_SIZE value. +func adjustHTTP1MaxHeaderSize(n int64) int64 { + // http2's count is in a slightly different unit and includes 32 bytes per pair. + // So, take the net/http.Server value and pad it up a bit, assuming 10 headers. + const perFieldOverhead = 32 // per http2 spec + const typicalHeaders = 10 // conservative + return n + typicalHeaders*perFieldOverhead +} diff --git a/vendor/golang.org/x/net/http2/config_go124.go b/vendor/golang.org/x/net/http2/config_go124.go new file mode 100644 index 0000000..5b516c5 --- /dev/null +++ b/vendor/golang.org/x/net/http2/config_go124.go @@ -0,0 +1,61 @@ +// Copyright 2024 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. + +//go:build go1.24 + +package http2 + +import "net/http" + +// fillNetHTTPServerConfig sets fields in conf from srv.HTTP2. +func fillNetHTTPServerConfig(conf *http2Config, srv *http.Server) { + fillNetHTTPConfig(conf, srv.HTTP2) +} + +// fillNetHTTPTransportConfig sets fields in conf from tr.HTTP2. +func fillNetHTTPTransportConfig(conf *http2Config, tr *http.Transport) { + fillNetHTTPConfig(conf, tr.HTTP2) +} + +func fillNetHTTPConfig(conf *http2Config, h2 *http.HTTP2Config) { + if h2 == nil { + return + } + if h2.MaxConcurrentStreams != 0 { + conf.MaxConcurrentStreams = uint32(h2.MaxConcurrentStreams) + } + if h2.MaxEncoderHeaderTableSize != 0 { + conf.MaxEncoderHeaderTableSize = uint32(h2.MaxEncoderHeaderTableSize) + } + if h2.MaxDecoderHeaderTableSize != 0 { + conf.MaxDecoderHeaderTableSize = uint32(h2.MaxDecoderHeaderTableSize) + } + if h2.MaxConcurrentStreams != 0 { + conf.MaxConcurrentStreams = uint32(h2.MaxConcurrentStreams) + } + if h2.MaxReadFrameSize != 0 { + conf.MaxReadFrameSize = uint32(h2.MaxReadFrameSize) + } + if h2.MaxReceiveBufferPerConnection != 0 { + conf.MaxUploadBufferPerConnection = int32(h2.MaxReceiveBufferPerConnection) + } + if h2.MaxReceiveBufferPerStream != 0 { + conf.MaxUploadBufferPerStream = int32(h2.MaxReceiveBufferPerStream) + } + if h2.SendPingTimeout != 0 { + conf.SendPingTimeout = h2.SendPingTimeout + } + if h2.PingTimeout != 0 { + conf.PingTimeout = h2.PingTimeout + } + if h2.WriteByteTimeout != 0 { + conf.WriteByteTimeout = h2.WriteByteTimeout + } + if h2.PermitProhibitedCipherSuites { + conf.PermitProhibitedCipherSuites = true + } + if h2.CountError != nil { + conf.CountError = h2.CountError + } +} diff --git a/vendor/golang.org/x/net/http2/config_pre_go124.go b/vendor/golang.org/x/net/http2/config_pre_go124.go new file mode 100644 index 0000000..060fd6c --- /dev/null +++ b/vendor/golang.org/x/net/http2/config_pre_go124.go @@ -0,0 +1,16 @@ +// Copyright 2024 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. + +//go:build !go1.24 + +package http2 + +import "net/http" + +// Pre-Go 1.24 fallback. +// The Server.HTTP2 and Transport.HTTP2 config fields were added in Go 1.24. + +func fillNetHTTPServerConfig(conf *http2Config, srv *http.Server) {} + +func fillNetHTTPTransportConfig(conf *http2Config, tr *http.Transport) {} diff --git a/vendor/golang.org/x/net/http2/databuffer.go b/vendor/golang.org/x/net/http2/databuffer.go new file mode 100644 index 0000000..e6f55cb --- /dev/null +++ b/vendor/golang.org/x/net/http2/databuffer.go @@ -0,0 +1,149 @@ +// Copyright 2014 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 http2 + +import ( + "errors" + "fmt" + "sync" +) + +// Buffer chunks are allocated from a pool to reduce pressure on GC. +// The maximum wasted space per dataBuffer is 2x the largest size class, +// which happens when the dataBuffer has multiple chunks and there is +// one unread byte in both the first and last chunks. We use a few size +// classes to minimize overheads for servers that typically receive very +// small request bodies. +// +// TODO: Benchmark to determine if the pools are necessary. The GC may have +// improved enough that we can instead allocate chunks like this: +// make([]byte, max(16<<10, expectedBytesRemaining)) +var dataChunkPools = [...]sync.Pool{ + {New: func() interface{} { return new([1 << 10]byte) }}, + {New: func() interface{} { return new([2 << 10]byte) }}, + {New: func() interface{} { return new([4 << 10]byte) }}, + {New: func() interface{} { return new([8 << 10]byte) }}, + {New: func() interface{} { return new([16 << 10]byte) }}, +} + +func getDataBufferChunk(size int64) []byte { + switch { + case size <= 1<<10: + return dataChunkPools[0].Get().(*[1 << 10]byte)[:] + case size <= 2<<10: + return dataChunkPools[1].Get().(*[2 << 10]byte)[:] + case size <= 4<<10: + return dataChunkPools[2].Get().(*[4 << 10]byte)[:] + case size <= 8<<10: + return dataChunkPools[3].Get().(*[8 << 10]byte)[:] + default: + return dataChunkPools[4].Get().(*[16 << 10]byte)[:] + } +} + +func putDataBufferChunk(p []byte) { + switch len(p) { + case 1 << 10: + dataChunkPools[0].Put((*[1 << 10]byte)(p)) + case 2 << 10: + dataChunkPools[1].Put((*[2 << 10]byte)(p)) + case 4 << 10: + dataChunkPools[2].Put((*[4 << 10]byte)(p)) + case 8 << 10: + dataChunkPools[3].Put((*[8 << 10]byte)(p)) + case 16 << 10: + dataChunkPools[4].Put((*[16 << 10]byte)(p)) + default: + panic(fmt.Sprintf("unexpected buffer len=%v", len(p))) + } +} + +// dataBuffer is an io.ReadWriter backed by a list of data chunks. +// Each dataBuffer is used to read DATA frames on a single stream. +// The buffer is divided into chunks so the server can limit the +// total memory used by a single connection without limiting the +// request body size on any single stream. +type dataBuffer struct { + chunks [][]byte + r int // next byte to read is chunks[0][r] + w int // next byte to write is chunks[len(chunks)-1][w] + size int // total buffered bytes + expected int64 // we expect at least this many bytes in future Write calls (ignored if <= 0) +} + +var errReadEmpty = errors.New("read from empty dataBuffer") + +// Read copies bytes from the buffer into p. +// It is an error to read when no data is available. +func (b *dataBuffer) Read(p []byte) (int, error) { + if b.size == 0 { + return 0, errReadEmpty + } + var ntotal int + for len(p) > 0 && b.size > 0 { + readFrom := b.bytesFromFirstChunk() + n := copy(p, readFrom) + p = p[n:] + ntotal += n + b.r += n + b.size -= n + // If the first chunk has been consumed, advance to the next chunk. + if b.r == len(b.chunks[0]) { + putDataBufferChunk(b.chunks[0]) + end := len(b.chunks) - 1 + copy(b.chunks[:end], b.chunks[1:]) + b.chunks[end] = nil + b.chunks = b.chunks[:end] + b.r = 0 + } + } + return ntotal, nil +} + +func (b *dataBuffer) bytesFromFirstChunk() []byte { + if len(b.chunks) == 1 { + return b.chunks[0][b.r:b.w] + } + return b.chunks[0][b.r:] +} + +// Len returns the number of bytes of the unread portion of the buffer. +func (b *dataBuffer) Len() int { + return b.size +} + +// Write appends p to the buffer. +func (b *dataBuffer) Write(p []byte) (int, error) { + ntotal := len(p) + for len(p) > 0 { + // If the last chunk is empty, allocate a new chunk. Try to allocate + // enough to fully copy p plus any additional bytes we expect to + // receive. However, this may allocate less than len(p). + want := int64(len(p)) + if b.expected > want { + want = b.expected + } + chunk := b.lastChunkOrAlloc(want) + n := copy(chunk[b.w:], p) + p = p[n:] + b.w += n + b.size += n + b.expected -= int64(n) + } + return ntotal, nil +} + +func (b *dataBuffer) lastChunkOrAlloc(want int64) []byte { + if len(b.chunks) != 0 { + last := b.chunks[len(b.chunks)-1] + if b.w < len(last) { + return last + } + } + chunk := getDataBufferChunk(want) + b.chunks = append(b.chunks, chunk) + b.w = 0 + return chunk +} diff --git a/vendor/golang.org/x/net/http2/errors.go b/vendor/golang.org/x/net/http2/errors.go new file mode 100644 index 0000000..f2067da --- /dev/null +++ b/vendor/golang.org/x/net/http2/errors.go @@ -0,0 +1,145 @@ +// Copyright 2014 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 http2 + +import ( + "errors" + "fmt" +) + +// An ErrCode is an unsigned 32-bit error code as defined in the HTTP/2 spec. +type ErrCode uint32 + +const ( + ErrCodeNo ErrCode = 0x0 + ErrCodeProtocol ErrCode = 0x1 + ErrCodeInternal ErrCode = 0x2 + ErrCodeFlowControl ErrCode = 0x3 + ErrCodeSettingsTimeout ErrCode = 0x4 + ErrCodeStreamClosed ErrCode = 0x5 + ErrCodeFrameSize ErrCode = 0x6 + ErrCodeRefusedStream ErrCode = 0x7 + ErrCodeCancel ErrCode = 0x8 + ErrCodeCompression ErrCode = 0x9 + ErrCodeConnect ErrCode = 0xa + ErrCodeEnhanceYourCalm ErrCode = 0xb + ErrCodeInadequateSecurity ErrCode = 0xc + ErrCodeHTTP11Required ErrCode = 0xd +) + +var errCodeName = map[ErrCode]string{ + ErrCodeNo: "NO_ERROR", + ErrCodeProtocol: "PROTOCOL_ERROR", + ErrCodeInternal: "INTERNAL_ERROR", + ErrCodeFlowControl: "FLOW_CONTROL_ERROR", + ErrCodeSettingsTimeout: "SETTINGS_TIMEOUT", + ErrCodeStreamClosed: "STREAM_CLOSED", + ErrCodeFrameSize: "FRAME_SIZE_ERROR", + ErrCodeRefusedStream: "REFUSED_STREAM", + ErrCodeCancel: "CANCEL", + ErrCodeCompression: "COMPRESSION_ERROR", + ErrCodeConnect: "CONNECT_ERROR", + ErrCodeEnhanceYourCalm: "ENHANCE_YOUR_CALM", + ErrCodeInadequateSecurity: "INADEQUATE_SECURITY", + ErrCodeHTTP11Required: "HTTP_1_1_REQUIRED", +} + +func (e ErrCode) String() string { + if s, ok := errCodeName[e]; ok { + return s + } + return fmt.Sprintf("unknown error code 0x%x", uint32(e)) +} + +func (e ErrCode) stringToken() string { + if s, ok := errCodeName[e]; ok { + return s + } + return fmt.Sprintf("ERR_UNKNOWN_%d", uint32(e)) +} + +// ConnectionError is an error that results in the termination of the +// entire connection. +type ConnectionError ErrCode + +func (e ConnectionError) Error() string { return fmt.Sprintf("connection error: %s", ErrCode(e)) } + +// StreamError is an error that only affects one stream within an +// HTTP/2 connection. +type StreamError struct { + StreamID uint32 + Code ErrCode + Cause error // optional additional detail +} + +// errFromPeer is a sentinel error value for StreamError.Cause to +// indicate that the StreamError was sent from the peer over the wire +// and wasn't locally generated in the Transport. +var errFromPeer = errors.New("received from peer") + +func streamError(id uint32, code ErrCode) StreamError { + return StreamError{StreamID: id, Code: code} +} + +func (e StreamError) Error() string { + if e.Cause != nil { + return fmt.Sprintf("stream error: stream ID %d; %v; %v", e.StreamID, e.Code, e.Cause) + } + return fmt.Sprintf("stream error: stream ID %d; %v", e.StreamID, e.Code) +} + +// 6.9.1 The Flow Control Window +// "If a sender receives a WINDOW_UPDATE that causes a flow control +// window to exceed this maximum it MUST terminate either the stream +// or the connection, as appropriate. For streams, [...]; for the +// connection, a GOAWAY frame with a FLOW_CONTROL_ERROR code." +type goAwayFlowError struct{} + +func (goAwayFlowError) Error() string { return "connection exceeded flow control window size" } + +// connError represents an HTTP/2 ConnectionError error code, along +// with a string (for debugging) explaining why. +// +// Errors of this type are only returned by the frame parser functions +// and converted into ConnectionError(Code), after stashing away +// the Reason into the Framer's errDetail field, accessible via +// the (*Framer).ErrorDetail method. +type connError struct { + Code ErrCode // the ConnectionError error code + Reason string // additional reason +} + +func (e connError) Error() string { + return fmt.Sprintf("http2: connection error: %v: %v", e.Code, e.Reason) +} + +type pseudoHeaderError string + +func (e pseudoHeaderError) Error() string { + return fmt.Sprintf("invalid pseudo-header %q", string(e)) +} + +type duplicatePseudoHeaderError string + +func (e duplicatePseudoHeaderError) Error() string { + return fmt.Sprintf("duplicate pseudo-header %q", string(e)) +} + +type headerFieldNameError string + +func (e headerFieldNameError) Error() string { + return fmt.Sprintf("invalid header field name %q", string(e)) +} + +type headerFieldValueError string + +func (e headerFieldValueError) Error() string { + return fmt.Sprintf("invalid header field value for %q", string(e)) +} + +var ( + errMixPseudoHeaderTypes = errors.New("mix of request and response pseudo headers") + errPseudoAfterRegular = errors.New("pseudo header field after regular") +) diff --git a/vendor/golang.org/x/net/http2/flow.go b/vendor/golang.org/x/net/http2/flow.go new file mode 100644 index 0000000..b7dbd18 --- /dev/null +++ b/vendor/golang.org/x/net/http2/flow.go @@ -0,0 +1,120 @@ +// Copyright 2014 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. + +// Flow control + +package http2 + +// inflowMinRefresh is the minimum number of bytes we'll send for a +// flow control window update. +const inflowMinRefresh = 4 << 10 + +// inflow accounts for an inbound flow control window. +// It tracks both the latest window sent to the peer (used for enforcement) +// and the accumulated unsent window. +type inflow struct { + avail int32 + unsent int32 +} + +// init sets the initial window. +func (f *inflow) init(n int32) { + f.avail = n +} + +// add adds n bytes to the window, with a maximum window size of max, +// indicating that the peer can now send us more data. +// For example, the user read from a {Request,Response} body and consumed +// some of the buffered data, so the peer can now send more. +// It returns the number of bytes to send in a WINDOW_UPDATE frame to the peer. +// Window updates are accumulated and sent when the unsent capacity +// is at least inflowMinRefresh or will at least double the peer's available window. +func (f *inflow) add(n int) (connAdd int32) { + if n < 0 { + panic("negative update") + } + unsent := int64(f.unsent) + int64(n) + // "A sender MUST NOT allow a flow-control window to exceed 2^31-1 octets." + // RFC 7540 Section 6.9.1. + const maxWindow = 1<<31 - 1 + if unsent+int64(f.avail) > maxWindow { + panic("flow control update exceeds maximum window size") + } + f.unsent = int32(unsent) + if f.unsent < inflowMinRefresh && f.unsent < f.avail { + // If there aren't at least inflowMinRefresh bytes of window to send, + // and this update won't at least double the window, buffer the update for later. + return 0 + } + f.avail += f.unsent + f.unsent = 0 + return int32(unsent) +} + +// take attempts to take n bytes from the peer's flow control window. +// It reports whether the window has available capacity. +func (f *inflow) take(n uint32) bool { + if n > uint32(f.avail) { + return false + } + f.avail -= int32(n) + return true +} + +// takeInflows attempts to take n bytes from two inflows, +// typically connection-level and stream-level flows. +// It reports whether both windows have available capacity. +func takeInflows(f1, f2 *inflow, n uint32) bool { + if n > uint32(f1.avail) || n > uint32(f2.avail) { + return false + } + f1.avail -= int32(n) + f2.avail -= int32(n) + return true +} + +// outflow is the outbound flow control window's size. +type outflow struct { + _ incomparable + + // n is the number of DATA bytes we're allowed to send. + // An outflow is kept both on a conn and a per-stream. + n int32 + + // conn points to the shared connection-level outflow that is + // shared by all streams on that conn. It is nil for the outflow + // that's on the conn directly. + conn *outflow +} + +func (f *outflow) setConnFlow(cf *outflow) { f.conn = cf } + +func (f *outflow) available() int32 { + n := f.n + if f.conn != nil && f.conn.n < n { + n = f.conn.n + } + return n +} + +func (f *outflow) take(n int32) { + if n > f.available() { + panic("internal error: took too much") + } + f.n -= n + if f.conn != nil { + f.conn.n -= n + } +} + +// add adds n bytes (positive or negative) to the flow control window. +// It returns false if the sum would exceed 2^31-1. +func (f *outflow) add(n int32) bool { + sum := f.n + n + if (sum > n) == (f.n > 0) { + f.n = sum + return true + } + return false +} diff --git a/vendor/golang.org/x/net/http2/frame.go b/vendor/golang.org/x/net/http2/frame.go new file mode 100644 index 0000000..db3264d --- /dev/null +++ b/vendor/golang.org/x/net/http2/frame.go @@ -0,0 +1,1702 @@ +// Copyright 2014 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 http2 + +import ( + "bytes" + "encoding/binary" + "errors" + "fmt" + "io" + "log" + "strings" + "sync" + + "golang.org/x/net/http/httpguts" + "golang.org/x/net/http2/hpack" +) + +const frameHeaderLen = 9 + +var padZeros = make([]byte, 255) // zeros for padding + +// A FrameType is a registered frame type as defined in +// https://httpwg.org/specs/rfc7540.html#rfc.section.11.2 +type FrameType uint8 + +const ( + FrameData FrameType = 0x0 + FrameHeaders FrameType = 0x1 + FramePriority FrameType = 0x2 + FrameRSTStream FrameType = 0x3 + FrameSettings FrameType = 0x4 + FramePushPromise FrameType = 0x5 + FramePing FrameType = 0x6 + FrameGoAway FrameType = 0x7 + FrameWindowUpdate FrameType = 0x8 + FrameContinuation FrameType = 0x9 +) + +var frameNames = [...]string{ + FrameData: "DATA", + FrameHeaders: "HEADERS", + FramePriority: "PRIORITY", + FrameRSTStream: "RST_STREAM", + FrameSettings: "SETTINGS", + FramePushPromise: "PUSH_PROMISE", + FramePing: "PING", + FrameGoAway: "GOAWAY", + FrameWindowUpdate: "WINDOW_UPDATE", + FrameContinuation: "CONTINUATION", +} + +func (t FrameType) String() string { + if int(t) < len(frameNames) { + return frameNames[t] + } + return fmt.Sprintf("UNKNOWN_FRAME_TYPE_%d", t) +} + +// Flags is a bitmask of HTTP/2 flags. +// The meaning of flags varies depending on the frame type. +type Flags uint8 + +// Has reports whether f contains all (0 or more) flags in v. +func (f Flags) Has(v Flags) bool { + return (f & v) == v +} + +// Frame-specific FrameHeader flag bits. +const ( + // Data Frame + FlagDataEndStream Flags = 0x1 + FlagDataPadded Flags = 0x8 + + // Headers Frame + FlagHeadersEndStream Flags = 0x1 + FlagHeadersEndHeaders Flags = 0x4 + FlagHeadersPadded Flags = 0x8 + FlagHeadersPriority Flags = 0x20 + + // Settings Frame + FlagSettingsAck Flags = 0x1 + + // Ping Frame + FlagPingAck Flags = 0x1 + + // Continuation Frame + FlagContinuationEndHeaders Flags = 0x4 + + FlagPushPromiseEndHeaders Flags = 0x4 + FlagPushPromisePadded Flags = 0x8 +) + +var flagName = map[FrameType]map[Flags]string{ + FrameData: { + FlagDataEndStream: "END_STREAM", + FlagDataPadded: "PADDED", + }, + FrameHeaders: { + FlagHeadersEndStream: "END_STREAM", + FlagHeadersEndHeaders: "END_HEADERS", + FlagHeadersPadded: "PADDED", + FlagHeadersPriority: "PRIORITY", + }, + FrameSettings: { + FlagSettingsAck: "ACK", + }, + FramePing: { + FlagPingAck: "ACK", + }, + FrameContinuation: { + FlagContinuationEndHeaders: "END_HEADERS", + }, + FramePushPromise: { + FlagPushPromiseEndHeaders: "END_HEADERS", + FlagPushPromisePadded: "PADDED", + }, +} + +// a frameParser parses a frame given its FrameHeader and payload +// bytes. The length of payload will always equal fh.Length (which +// might be 0). +type frameParser func(fc *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) + +var frameParsers = [...]frameParser{ + FrameData: parseDataFrame, + FrameHeaders: parseHeadersFrame, + FramePriority: parsePriorityFrame, + FrameRSTStream: parseRSTStreamFrame, + FrameSettings: parseSettingsFrame, + FramePushPromise: parsePushPromise, + FramePing: parsePingFrame, + FrameGoAway: parseGoAwayFrame, + FrameWindowUpdate: parseWindowUpdateFrame, + FrameContinuation: parseContinuationFrame, +} + +func typeFrameParser(t FrameType) frameParser { + if int(t) < len(frameParsers) { + return frameParsers[t] + } + return parseUnknownFrame +} + +// A FrameHeader is the 9 byte header of all HTTP/2 frames. +// +// See https://httpwg.org/specs/rfc7540.html#FrameHeader +type FrameHeader struct { + valid bool // caller can access []byte fields in the Frame + + // Type is the 1 byte frame type. There are ten standard frame + // types, but extension frame types may be written by WriteRawFrame + // and will be returned by ReadFrame (as UnknownFrame). + Type FrameType + + // Flags are the 1 byte of 8 potential bit flags per frame. + // They are specific to the frame type. + Flags Flags + + // Length is the length of the frame, not including the 9 byte header. + // The maximum size is one byte less than 16MB (uint24), but only + // frames up to 16KB are allowed without peer agreement. + Length uint32 + + // StreamID is which stream this frame is for. Certain frames + // are not stream-specific, in which case this field is 0. + StreamID uint32 +} + +// Header returns h. It exists so FrameHeaders can be embedded in other +// specific frame types and implement the Frame interface. +func (h FrameHeader) Header() FrameHeader { return h } + +func (h FrameHeader) String() string { + var buf bytes.Buffer + buf.WriteString("[FrameHeader ") + h.writeDebug(&buf) + buf.WriteByte(']') + return buf.String() +} + +func (h FrameHeader) writeDebug(buf *bytes.Buffer) { + buf.WriteString(h.Type.String()) + if h.Flags != 0 { + buf.WriteString(" flags=") + set := 0 + for i := uint8(0); i < 8; i++ { + if h.Flags&(1< 1 { + buf.WriteByte('|') + } + name := flagName[h.Type][Flags(1<>24), + byte(streamID>>16), + byte(streamID>>8), + byte(streamID)) +} + +func (f *Framer) endWrite() error { + // Now that we know the final size, fill in the FrameHeader in + // the space previously reserved for it. Abuse append. + length := len(f.wbuf) - frameHeaderLen + if length >= (1 << 24) { + return ErrFrameTooLarge + } + _ = append(f.wbuf[:0], + byte(length>>16), + byte(length>>8), + byte(length)) + if f.logWrites { + f.logWrite() + } + + n, err := f.w.Write(f.wbuf) + if err == nil && n != len(f.wbuf) { + err = io.ErrShortWrite + } + return err +} + +func (f *Framer) logWrite() { + if f.debugFramer == nil { + f.debugFramerBuf = new(bytes.Buffer) + f.debugFramer = NewFramer(nil, f.debugFramerBuf) + f.debugFramer.logReads = false // we log it ourselves, saying "wrote" below + // Let us read anything, even if we accidentally wrote it + // in the wrong order: + f.debugFramer.AllowIllegalReads = true + } + f.debugFramerBuf.Write(f.wbuf) + fr, err := f.debugFramer.ReadFrame() + if err != nil { + f.debugWriteLoggerf("http2: Framer %p: failed to decode just-written frame", f) + return + } + f.debugWriteLoggerf("http2: Framer %p: wrote %v", f, summarizeFrame(fr)) +} + +func (f *Framer) writeByte(v byte) { f.wbuf = append(f.wbuf, v) } +func (f *Framer) writeBytes(v []byte) { f.wbuf = append(f.wbuf, v...) } +func (f *Framer) writeUint16(v uint16) { f.wbuf = append(f.wbuf, byte(v>>8), byte(v)) } +func (f *Framer) writeUint32(v uint32) { + f.wbuf = append(f.wbuf, byte(v>>24), byte(v>>16), byte(v>>8), byte(v)) +} + +const ( + minMaxFrameSize = 1 << 14 + maxFrameSize = 1<<24 - 1 +) + +// SetReuseFrames allows the Framer to reuse Frames. +// If called on a Framer, Frames returned by calls to ReadFrame are only +// valid until the next call to ReadFrame. +func (fr *Framer) SetReuseFrames() { + if fr.frameCache != nil { + return + } + fr.frameCache = &frameCache{} +} + +type frameCache struct { + dataFrame DataFrame +} + +func (fc *frameCache) getDataFrame() *DataFrame { + if fc == nil { + return &DataFrame{} + } + return &fc.dataFrame +} + +// NewFramer returns a Framer that writes frames to w and reads them from r. +func NewFramer(w io.Writer, r io.Reader) *Framer { + fr := &Framer{ + w: w, + r: r, + countError: func(string) {}, + logReads: logFrameReads, + logWrites: logFrameWrites, + debugReadLoggerf: log.Printf, + debugWriteLoggerf: log.Printf, + } + fr.getReadBuf = func(size uint32) []byte { + if cap(fr.readBuf) >= int(size) { + return fr.readBuf[:size] + } + fr.readBuf = make([]byte, size) + return fr.readBuf + } + fr.SetMaxReadFrameSize(maxFrameSize) + return fr +} + +// SetMaxReadFrameSize sets the maximum size of a frame +// that will be read by a subsequent call to ReadFrame. +// It is the caller's responsibility to advertise this +// limit with a SETTINGS frame. +func (fr *Framer) SetMaxReadFrameSize(v uint32) { + if v > maxFrameSize { + v = maxFrameSize + } + fr.maxReadSize = v +} + +// ErrorDetail returns a more detailed error of the last error +// returned by Framer.ReadFrame. For instance, if ReadFrame +// returns a StreamError with code PROTOCOL_ERROR, ErrorDetail +// will say exactly what was invalid. ErrorDetail is not guaranteed +// to return a non-nil value and like the rest of the http2 package, +// its return value is not protected by an API compatibility promise. +// ErrorDetail is reset after the next call to ReadFrame. +func (fr *Framer) ErrorDetail() error { + return fr.errDetail +} + +// ErrFrameTooLarge is returned from Framer.ReadFrame when the peer +// sends a frame that is larger than declared with SetMaxReadFrameSize. +var ErrFrameTooLarge = errors.New("http2: frame too large") + +// terminalReadFrameError reports whether err is an unrecoverable +// error from ReadFrame and no other frames should be read. +func terminalReadFrameError(err error) bool { + if _, ok := err.(StreamError); ok { + return false + } + return err != nil +} + +// ReadFrame reads a single frame. The returned Frame is only valid +// until the next call to ReadFrame. +// +// If the frame is larger than previously set with SetMaxReadFrameSize, the +// returned error is ErrFrameTooLarge. Other errors may be of type +// ConnectionError, StreamError, or anything else from the underlying +// reader. +// +// If ReadFrame returns an error and a non-nil Frame, the Frame's StreamID +// indicates the stream responsible for the error. +func (fr *Framer) ReadFrame() (Frame, error) { + fr.errDetail = nil + if fr.lastFrame != nil { + fr.lastFrame.invalidate() + } + fh, err := readFrameHeader(fr.headerBuf[:], fr.r) + if err != nil { + return nil, err + } + if fh.Length > fr.maxReadSize { + if fh == invalidHTTP1LookingFrameHeader() { + return nil, fmt.Errorf("http2: failed reading the frame payload: %w, note that the frame header looked like an HTTP/1.1 header", ErrFrameTooLarge) + } + return nil, ErrFrameTooLarge + } + payload := fr.getReadBuf(fh.Length) + if _, err := io.ReadFull(fr.r, payload); err != nil { + if fh == invalidHTTP1LookingFrameHeader() { + return nil, fmt.Errorf("http2: failed reading the frame payload: %w, note that the frame header looked like an HTTP/1.1 header", err) + } + return nil, err + } + f, err := typeFrameParser(fh.Type)(fr.frameCache, fh, fr.countError, payload) + if err != nil { + if ce, ok := err.(connError); ok { + return nil, fr.connError(ce.Code, ce.Reason) + } + return nil, err + } + if err := fr.checkFrameOrder(f); err != nil { + return nil, err + } + if fr.logReads { + fr.debugReadLoggerf("http2: Framer %p: read %v", fr, summarizeFrame(f)) + } + if fh.Type == FrameHeaders && fr.ReadMetaHeaders != nil { + return fr.readMetaFrame(f.(*HeadersFrame)) + } + return f, nil +} + +// connError returns ConnectionError(code) but first +// stashes away a public reason to the caller can optionally relay it +// to the peer before hanging up on them. This might help others debug +// their implementations. +func (fr *Framer) connError(code ErrCode, reason string) error { + fr.errDetail = errors.New(reason) + return ConnectionError(code) +} + +// checkFrameOrder reports an error if f is an invalid frame to return +// next from ReadFrame. Mostly it checks whether HEADERS and +// CONTINUATION frames are contiguous. +func (fr *Framer) checkFrameOrder(f Frame) error { + last := fr.lastFrame + fr.lastFrame = f + if fr.AllowIllegalReads { + return nil + } + + fh := f.Header() + if fr.lastHeaderStream != 0 { + if fh.Type != FrameContinuation { + return fr.connError(ErrCodeProtocol, + fmt.Sprintf("got %s for stream %d; expected CONTINUATION following %s for stream %d", + fh.Type, fh.StreamID, + last.Header().Type, fr.lastHeaderStream)) + } + if fh.StreamID != fr.lastHeaderStream { + return fr.connError(ErrCodeProtocol, + fmt.Sprintf("got CONTINUATION for stream %d; expected stream %d", + fh.StreamID, fr.lastHeaderStream)) + } + } else if fh.Type == FrameContinuation { + return fr.connError(ErrCodeProtocol, fmt.Sprintf("unexpected CONTINUATION for stream %d", fh.StreamID)) + } + + switch fh.Type { + case FrameHeaders, FrameContinuation: + if fh.Flags.Has(FlagHeadersEndHeaders) { + fr.lastHeaderStream = 0 + } else { + fr.lastHeaderStream = fh.StreamID + } + } + + return nil +} + +// A DataFrame conveys arbitrary, variable-length sequences of octets +// associated with a stream. +// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.1 +type DataFrame struct { + FrameHeader + data []byte +} + +func (f *DataFrame) StreamEnded() bool { + return f.FrameHeader.Flags.Has(FlagDataEndStream) +} + +// Data returns the frame's data octets, not including any padding +// size byte or padding suffix bytes. +// The caller must not retain the returned memory past the next +// call to ReadFrame. +func (f *DataFrame) Data() []byte { + f.checkValid() + return f.data +} + +func parseDataFrame(fc *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) { + if fh.StreamID == 0 { + // DATA frames MUST be associated with a stream. If a + // DATA frame is received whose stream identifier + // field is 0x0, the recipient MUST respond with a + // connection error (Section 5.4.1) of type + // PROTOCOL_ERROR. + countError("frame_data_stream_0") + return nil, connError{ErrCodeProtocol, "DATA frame with stream ID 0"} + } + f := fc.getDataFrame() + f.FrameHeader = fh + + var padSize byte + if fh.Flags.Has(FlagDataPadded) { + var err error + payload, padSize, err = readByte(payload) + if err != nil { + countError("frame_data_pad_byte_short") + return nil, err + } + } + if int(padSize) > len(payload) { + // If the length of the padding is greater than the + // length of the frame payload, the recipient MUST + // treat this as a connection error. + // Filed: https://github.com/http2/http2-spec/issues/610 + countError("frame_data_pad_too_big") + return nil, connError{ErrCodeProtocol, "pad size larger than data payload"} + } + f.data = payload[:len(payload)-int(padSize)] + return f, nil +} + +var ( + errStreamID = errors.New("invalid stream ID") + errDepStreamID = errors.New("invalid dependent stream ID") + errPadLength = errors.New("pad length too large") + errPadBytes = errors.New("padding bytes must all be zeros unless AllowIllegalWrites is enabled") +) + +func validStreamIDOrZero(streamID uint32) bool { + return streamID&(1<<31) == 0 +} + +func validStreamID(streamID uint32) bool { + return streamID != 0 && streamID&(1<<31) == 0 +} + +// WriteData writes a DATA frame. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility not to violate the maximum frame size +// and to not call other Write methods concurrently. +func (f *Framer) WriteData(streamID uint32, endStream bool, data []byte) error { + return f.WriteDataPadded(streamID, endStream, data, nil) +} + +// WriteDataPadded writes a DATA frame with optional padding. +// +// If pad is nil, the padding bit is not sent. +// The length of pad must not exceed 255 bytes. +// The bytes of pad must all be zero, unless f.AllowIllegalWrites is set. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility not to violate the maximum frame size +// and to not call other Write methods concurrently. +func (f *Framer) WriteDataPadded(streamID uint32, endStream bool, data, pad []byte) error { + if err := f.startWriteDataPadded(streamID, endStream, data, pad); err != nil { + return err + } + return f.endWrite() +} + +// startWriteDataPadded is WriteDataPadded, but only writes the frame to the Framer's internal buffer. +// The caller should call endWrite to flush the frame to the underlying writer. +func (f *Framer) startWriteDataPadded(streamID uint32, endStream bool, data, pad []byte) error { + if !validStreamID(streamID) && !f.AllowIllegalWrites { + return errStreamID + } + if len(pad) > 0 { + if len(pad) > 255 { + return errPadLength + } + if !f.AllowIllegalWrites { + for _, b := range pad { + if b != 0 { + // "Padding octets MUST be set to zero when sending." + return errPadBytes + } + } + } + } + var flags Flags + if endStream { + flags |= FlagDataEndStream + } + if pad != nil { + flags |= FlagDataPadded + } + f.startWrite(FrameData, flags, streamID) + if pad != nil { + f.wbuf = append(f.wbuf, byte(len(pad))) + } + f.wbuf = append(f.wbuf, data...) + f.wbuf = append(f.wbuf, pad...) + return nil +} + +// A SettingsFrame conveys configuration parameters that affect how +// endpoints communicate, such as preferences and constraints on peer +// behavior. +// +// See https://httpwg.org/specs/rfc7540.html#SETTINGS +type SettingsFrame struct { + FrameHeader + p []byte +} + +func parseSettingsFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { + if fh.Flags.Has(FlagSettingsAck) && fh.Length > 0 { + // When this (ACK 0x1) bit is set, the payload of the + // SETTINGS frame MUST be empty. Receipt of a + // SETTINGS frame with the ACK flag set and a length + // field value other than 0 MUST be treated as a + // connection error (Section 5.4.1) of type + // FRAME_SIZE_ERROR. + countError("frame_settings_ack_with_length") + return nil, ConnectionError(ErrCodeFrameSize) + } + if fh.StreamID != 0 { + // SETTINGS frames always apply to a connection, + // never a single stream. The stream identifier for a + // SETTINGS frame MUST be zero (0x0). If an endpoint + // receives a SETTINGS frame whose stream identifier + // field is anything other than 0x0, the endpoint MUST + // respond with a connection error (Section 5.4.1) of + // type PROTOCOL_ERROR. + countError("frame_settings_has_stream") + return nil, ConnectionError(ErrCodeProtocol) + } + if len(p)%6 != 0 { + countError("frame_settings_mod_6") + // Expecting even number of 6 byte settings. + return nil, ConnectionError(ErrCodeFrameSize) + } + f := &SettingsFrame{FrameHeader: fh, p: p} + if v, ok := f.Value(SettingInitialWindowSize); ok && v > (1<<31)-1 { + countError("frame_settings_window_size_too_big") + // Values above the maximum flow control window size of 2^31 - 1 MUST + // be treated as a connection error (Section 5.4.1) of type + // FLOW_CONTROL_ERROR. + return nil, ConnectionError(ErrCodeFlowControl) + } + return f, nil +} + +func (f *SettingsFrame) IsAck() bool { + return f.FrameHeader.Flags.Has(FlagSettingsAck) +} + +func (f *SettingsFrame) Value(id SettingID) (v uint32, ok bool) { + f.checkValid() + for i := 0; i < f.NumSettings(); i++ { + if s := f.Setting(i); s.ID == id { + return s.Val, true + } + } + return 0, false +} + +// Setting returns the setting from the frame at the given 0-based index. +// The index must be >= 0 and less than f.NumSettings(). +func (f *SettingsFrame) Setting(i int) Setting { + buf := f.p + return Setting{ + ID: SettingID(binary.BigEndian.Uint16(buf[i*6 : i*6+2])), + Val: binary.BigEndian.Uint32(buf[i*6+2 : i*6+6]), + } +} + +func (f *SettingsFrame) NumSettings() int { return len(f.p) / 6 } + +// HasDuplicates reports whether f contains any duplicate setting IDs. +func (f *SettingsFrame) HasDuplicates() bool { + num := f.NumSettings() + if num == 0 { + return false + } + // If it's small enough (the common case), just do the n^2 + // thing and avoid a map allocation. + if num < 10 { + for i := 0; i < num; i++ { + idi := f.Setting(i).ID + for j := i + 1; j < num; j++ { + idj := f.Setting(j).ID + if idi == idj { + return true + } + } + } + return false + } + seen := map[SettingID]bool{} + for i := 0; i < num; i++ { + id := f.Setting(i).ID + if seen[id] { + return true + } + seen[id] = true + } + return false +} + +// ForeachSetting runs fn for each setting. +// It stops and returns the first error. +func (f *SettingsFrame) ForeachSetting(fn func(Setting) error) error { + f.checkValid() + for i := 0; i < f.NumSettings(); i++ { + if err := fn(f.Setting(i)); err != nil { + return err + } + } + return nil +} + +// WriteSettings writes a SETTINGS frame with zero or more settings +// specified and the ACK bit not set. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility to not call other Write methods concurrently. +func (f *Framer) WriteSettings(settings ...Setting) error { + f.startWrite(FrameSettings, 0, 0) + for _, s := range settings { + f.writeUint16(uint16(s.ID)) + f.writeUint32(s.Val) + } + return f.endWrite() +} + +// WriteSettingsAck writes an empty SETTINGS frame with the ACK bit set. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility to not call other Write methods concurrently. +func (f *Framer) WriteSettingsAck() error { + f.startWrite(FrameSettings, FlagSettingsAck, 0) + return f.endWrite() +} + +// A PingFrame is a mechanism for measuring a minimal round trip time +// from the sender, as well as determining whether an idle connection +// is still functional. +// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.7 +type PingFrame struct { + FrameHeader + Data [8]byte +} + +func (f *PingFrame) IsAck() bool { return f.Flags.Has(FlagPingAck) } + +func parsePingFrame(_ *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) { + if len(payload) != 8 { + countError("frame_ping_length") + return nil, ConnectionError(ErrCodeFrameSize) + } + if fh.StreamID != 0 { + countError("frame_ping_has_stream") + return nil, ConnectionError(ErrCodeProtocol) + } + f := &PingFrame{FrameHeader: fh} + copy(f.Data[:], payload) + return f, nil +} + +func (f *Framer) WritePing(ack bool, data [8]byte) error { + var flags Flags + if ack { + flags = FlagPingAck + } + f.startWrite(FramePing, flags, 0) + f.writeBytes(data[:]) + return f.endWrite() +} + +// A GoAwayFrame informs the remote peer to stop creating streams on this connection. +// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.8 +type GoAwayFrame struct { + FrameHeader + LastStreamID uint32 + ErrCode ErrCode + debugData []byte +} + +// DebugData returns any debug data in the GOAWAY frame. Its contents +// are not defined. +// The caller must not retain the returned memory past the next +// call to ReadFrame. +func (f *GoAwayFrame) DebugData() []byte { + f.checkValid() + return f.debugData +} + +func parseGoAwayFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { + if fh.StreamID != 0 { + countError("frame_goaway_has_stream") + return nil, ConnectionError(ErrCodeProtocol) + } + if len(p) < 8 { + countError("frame_goaway_short") + return nil, ConnectionError(ErrCodeFrameSize) + } + return &GoAwayFrame{ + FrameHeader: fh, + LastStreamID: binary.BigEndian.Uint32(p[:4]) & (1<<31 - 1), + ErrCode: ErrCode(binary.BigEndian.Uint32(p[4:8])), + debugData: p[8:], + }, nil +} + +func (f *Framer) WriteGoAway(maxStreamID uint32, code ErrCode, debugData []byte) error { + f.startWrite(FrameGoAway, 0, 0) + f.writeUint32(maxStreamID & (1<<31 - 1)) + f.writeUint32(uint32(code)) + f.writeBytes(debugData) + return f.endWrite() +} + +// An UnknownFrame is the frame type returned when the frame type is unknown +// or no specific frame type parser exists. +type UnknownFrame struct { + FrameHeader + p []byte +} + +// Payload returns the frame's payload (after the header). It is not +// valid to call this method after a subsequent call to +// Framer.ReadFrame, nor is it valid to retain the returned slice. +// The memory is owned by the Framer and is invalidated when the next +// frame is read. +func (f *UnknownFrame) Payload() []byte { + f.checkValid() + return f.p +} + +func parseUnknownFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { + return &UnknownFrame{fh, p}, nil +} + +// A WindowUpdateFrame is used to implement flow control. +// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.9 +type WindowUpdateFrame struct { + FrameHeader + Increment uint32 // never read with high bit set +} + +func parseWindowUpdateFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { + if len(p) != 4 { + countError("frame_windowupdate_bad_len") + return nil, ConnectionError(ErrCodeFrameSize) + } + inc := binary.BigEndian.Uint32(p[:4]) & 0x7fffffff // mask off high reserved bit + if inc == 0 { + // A receiver MUST treat the receipt of a + // WINDOW_UPDATE frame with an flow control window + // increment of 0 as a stream error (Section 5.4.2) of + // type PROTOCOL_ERROR; errors on the connection flow + // control window MUST be treated as a connection + // error (Section 5.4.1). + if fh.StreamID == 0 { + countError("frame_windowupdate_zero_inc_conn") + return nil, ConnectionError(ErrCodeProtocol) + } + countError("frame_windowupdate_zero_inc_stream") + return nil, streamError(fh.StreamID, ErrCodeProtocol) + } + return &WindowUpdateFrame{ + FrameHeader: fh, + Increment: inc, + }, nil +} + +// WriteWindowUpdate writes a WINDOW_UPDATE frame. +// The increment value must be between 1 and 2,147,483,647, inclusive. +// If the Stream ID is zero, the window update applies to the +// connection as a whole. +func (f *Framer) WriteWindowUpdate(streamID, incr uint32) error { + // "The legal range for the increment to the flow control window is 1 to 2^31-1 (2,147,483,647) octets." + if (incr < 1 || incr > 2147483647) && !f.AllowIllegalWrites { + return errors.New("illegal window increment value") + } + f.startWrite(FrameWindowUpdate, 0, streamID) + f.writeUint32(incr) + return f.endWrite() +} + +// A HeadersFrame is used to open a stream and additionally carries a +// header block fragment. +type HeadersFrame struct { + FrameHeader + + // Priority is set if FlagHeadersPriority is set in the FrameHeader. + Priority PriorityParam + + headerFragBuf []byte // not owned +} + +func (f *HeadersFrame) HeaderBlockFragment() []byte { + f.checkValid() + return f.headerFragBuf +} + +func (f *HeadersFrame) HeadersEnded() bool { + return f.FrameHeader.Flags.Has(FlagHeadersEndHeaders) +} + +func (f *HeadersFrame) StreamEnded() bool { + return f.FrameHeader.Flags.Has(FlagHeadersEndStream) +} + +func (f *HeadersFrame) HasPriority() bool { + return f.FrameHeader.Flags.Has(FlagHeadersPriority) +} + +func parseHeadersFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (_ Frame, err error) { + hf := &HeadersFrame{ + FrameHeader: fh, + } + if fh.StreamID == 0 { + // HEADERS frames MUST be associated with a stream. If a HEADERS frame + // is received whose stream identifier field is 0x0, the recipient MUST + // respond with a connection error (Section 5.4.1) of type + // PROTOCOL_ERROR. + countError("frame_headers_zero_stream") + return nil, connError{ErrCodeProtocol, "HEADERS frame with stream ID 0"} + } + var padLength uint8 + if fh.Flags.Has(FlagHeadersPadded) { + if p, padLength, err = readByte(p); err != nil { + countError("frame_headers_pad_short") + return + } + } + if fh.Flags.Has(FlagHeadersPriority) { + var v uint32 + p, v, err = readUint32(p) + if err != nil { + countError("frame_headers_prio_short") + return nil, err + } + hf.Priority.StreamDep = v & 0x7fffffff + hf.Priority.Exclusive = (v != hf.Priority.StreamDep) // high bit was set + p, hf.Priority.Weight, err = readByte(p) + if err != nil { + countError("frame_headers_prio_weight_short") + return nil, err + } + } + if len(p)-int(padLength) < 0 { + countError("frame_headers_pad_too_big") + return nil, streamError(fh.StreamID, ErrCodeProtocol) + } + hf.headerFragBuf = p[:len(p)-int(padLength)] + return hf, nil +} + +// HeadersFrameParam are the parameters for writing a HEADERS frame. +type HeadersFrameParam struct { + // StreamID is the required Stream ID to initiate. + StreamID uint32 + // BlockFragment is part (or all) of a Header Block. + BlockFragment []byte + + // EndStream indicates that the header block is the last that + // the endpoint will send for the identified stream. Setting + // this flag causes the stream to enter one of "half closed" + // states. + EndStream bool + + // EndHeaders indicates that this frame contains an entire + // header block and is not followed by any + // CONTINUATION frames. + EndHeaders bool + + // PadLength is the optional number of bytes of zeros to add + // to this frame. + PadLength uint8 + + // Priority, if non-zero, includes stream priority information + // in the HEADER frame. + Priority PriorityParam +} + +// WriteHeaders writes a single HEADERS frame. +// +// This is a low-level header writing method. Encoding headers and +// splitting them into any necessary CONTINUATION frames is handled +// elsewhere. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility to not call other Write methods concurrently. +func (f *Framer) WriteHeaders(p HeadersFrameParam) error { + if !validStreamID(p.StreamID) && !f.AllowIllegalWrites { + return errStreamID + } + var flags Flags + if p.PadLength != 0 { + flags |= FlagHeadersPadded + } + if p.EndStream { + flags |= FlagHeadersEndStream + } + if p.EndHeaders { + flags |= FlagHeadersEndHeaders + } + if !p.Priority.IsZero() { + flags |= FlagHeadersPriority + } + f.startWrite(FrameHeaders, flags, p.StreamID) + if p.PadLength != 0 { + f.writeByte(p.PadLength) + } + if !p.Priority.IsZero() { + v := p.Priority.StreamDep + if !validStreamIDOrZero(v) && !f.AllowIllegalWrites { + return errDepStreamID + } + if p.Priority.Exclusive { + v |= 1 << 31 + } + f.writeUint32(v) + f.writeByte(p.Priority.Weight) + } + f.wbuf = append(f.wbuf, p.BlockFragment...) + f.wbuf = append(f.wbuf, padZeros[:p.PadLength]...) + return f.endWrite() +} + +// A PriorityFrame specifies the sender-advised priority of a stream. +// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.3 +type PriorityFrame struct { + FrameHeader + PriorityParam +} + +// PriorityParam are the stream prioritzation parameters. +type PriorityParam struct { + // StreamDep is a 31-bit stream identifier for the + // stream that this stream depends on. Zero means no + // dependency. + StreamDep uint32 + + // Exclusive is whether the dependency is exclusive. + Exclusive bool + + // Weight is the stream's zero-indexed weight. It should be + // set together with StreamDep, or neither should be set. Per + // the spec, "Add one to the value to obtain a weight between + // 1 and 256." + Weight uint8 +} + +func (p PriorityParam) IsZero() bool { + return p == PriorityParam{} +} + +func parsePriorityFrame(_ *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) { + if fh.StreamID == 0 { + countError("frame_priority_zero_stream") + return nil, connError{ErrCodeProtocol, "PRIORITY frame with stream ID 0"} + } + if len(payload) != 5 { + countError("frame_priority_bad_length") + return nil, connError{ErrCodeFrameSize, fmt.Sprintf("PRIORITY frame payload size was %d; want 5", len(payload))} + } + v := binary.BigEndian.Uint32(payload[:4]) + streamID := v & 0x7fffffff // mask off high bit + return &PriorityFrame{ + FrameHeader: fh, + PriorityParam: PriorityParam{ + Weight: payload[4], + StreamDep: streamID, + Exclusive: streamID != v, // was high bit set? + }, + }, nil +} + +// WritePriority writes a PRIORITY frame. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility to not call other Write methods concurrently. +func (f *Framer) WritePriority(streamID uint32, p PriorityParam) error { + if !validStreamID(streamID) && !f.AllowIllegalWrites { + return errStreamID + } + if !validStreamIDOrZero(p.StreamDep) { + return errDepStreamID + } + f.startWrite(FramePriority, 0, streamID) + v := p.StreamDep + if p.Exclusive { + v |= 1 << 31 + } + f.writeUint32(v) + f.writeByte(p.Weight) + return f.endWrite() +} + +// A RSTStreamFrame allows for abnormal termination of a stream. +// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.4 +type RSTStreamFrame struct { + FrameHeader + ErrCode ErrCode +} + +func parseRSTStreamFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { + if len(p) != 4 { + countError("frame_rststream_bad_len") + return nil, ConnectionError(ErrCodeFrameSize) + } + if fh.StreamID == 0 { + countError("frame_rststream_zero_stream") + return nil, ConnectionError(ErrCodeProtocol) + } + return &RSTStreamFrame{fh, ErrCode(binary.BigEndian.Uint32(p[:4]))}, nil +} + +// WriteRSTStream writes a RST_STREAM frame. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility to not call other Write methods concurrently. +func (f *Framer) WriteRSTStream(streamID uint32, code ErrCode) error { + if !validStreamID(streamID) && !f.AllowIllegalWrites { + return errStreamID + } + f.startWrite(FrameRSTStream, 0, streamID) + f.writeUint32(uint32(code)) + return f.endWrite() +} + +// A ContinuationFrame is used to continue a sequence of header block fragments. +// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.10 +type ContinuationFrame struct { + FrameHeader + headerFragBuf []byte +} + +func parseContinuationFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { + if fh.StreamID == 0 { + countError("frame_continuation_zero_stream") + return nil, connError{ErrCodeProtocol, "CONTINUATION frame with stream ID 0"} + } + return &ContinuationFrame{fh, p}, nil +} + +func (f *ContinuationFrame) HeaderBlockFragment() []byte { + f.checkValid() + return f.headerFragBuf +} + +func (f *ContinuationFrame) HeadersEnded() bool { + return f.FrameHeader.Flags.Has(FlagContinuationEndHeaders) +} + +// WriteContinuation writes a CONTINUATION frame. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility to not call other Write methods concurrently. +func (f *Framer) WriteContinuation(streamID uint32, endHeaders bool, headerBlockFragment []byte) error { + if !validStreamID(streamID) && !f.AllowIllegalWrites { + return errStreamID + } + var flags Flags + if endHeaders { + flags |= FlagContinuationEndHeaders + } + f.startWrite(FrameContinuation, flags, streamID) + f.wbuf = append(f.wbuf, headerBlockFragment...) + return f.endWrite() +} + +// A PushPromiseFrame is used to initiate a server stream. +// See https://httpwg.org/specs/rfc7540.html#rfc.section.6.6 +type PushPromiseFrame struct { + FrameHeader + PromiseID uint32 + headerFragBuf []byte // not owned +} + +func (f *PushPromiseFrame) HeaderBlockFragment() []byte { + f.checkValid() + return f.headerFragBuf +} + +func (f *PushPromiseFrame) HeadersEnded() bool { + return f.FrameHeader.Flags.Has(FlagPushPromiseEndHeaders) +} + +func parsePushPromise(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (_ Frame, err error) { + pp := &PushPromiseFrame{ + FrameHeader: fh, + } + if pp.StreamID == 0 { + // PUSH_PROMISE frames MUST be associated with an existing, + // peer-initiated stream. The stream identifier of a + // PUSH_PROMISE frame indicates the stream it is associated + // with. If the stream identifier field specifies the value + // 0x0, a recipient MUST respond with a connection error + // (Section 5.4.1) of type PROTOCOL_ERROR. + countError("frame_pushpromise_zero_stream") + return nil, ConnectionError(ErrCodeProtocol) + } + // The PUSH_PROMISE frame includes optional padding. + // Padding fields and flags are identical to those defined for DATA frames + var padLength uint8 + if fh.Flags.Has(FlagPushPromisePadded) { + if p, padLength, err = readByte(p); err != nil { + countError("frame_pushpromise_pad_short") + return + } + } + + p, pp.PromiseID, err = readUint32(p) + if err != nil { + countError("frame_pushpromise_promiseid_short") + return + } + pp.PromiseID = pp.PromiseID & (1<<31 - 1) + + if int(padLength) > len(p) { + // like the DATA frame, error out if padding is longer than the body. + countError("frame_pushpromise_pad_too_big") + return nil, ConnectionError(ErrCodeProtocol) + } + pp.headerFragBuf = p[:len(p)-int(padLength)] + return pp, nil +} + +// PushPromiseParam are the parameters for writing a PUSH_PROMISE frame. +type PushPromiseParam struct { + // StreamID is the required Stream ID to initiate. + StreamID uint32 + + // PromiseID is the required Stream ID which this + // Push Promises + PromiseID uint32 + + // BlockFragment is part (or all) of a Header Block. + BlockFragment []byte + + // EndHeaders indicates that this frame contains an entire + // header block and is not followed by any + // CONTINUATION frames. + EndHeaders bool + + // PadLength is the optional number of bytes of zeros to add + // to this frame. + PadLength uint8 +} + +// WritePushPromise writes a single PushPromise Frame. +// +// As with Header Frames, This is the low level call for writing +// individual frames. Continuation frames are handled elsewhere. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility to not call other Write methods concurrently. +func (f *Framer) WritePushPromise(p PushPromiseParam) error { + if !validStreamID(p.StreamID) && !f.AllowIllegalWrites { + return errStreamID + } + var flags Flags + if p.PadLength != 0 { + flags |= FlagPushPromisePadded + } + if p.EndHeaders { + flags |= FlagPushPromiseEndHeaders + } + f.startWrite(FramePushPromise, flags, p.StreamID) + if p.PadLength != 0 { + f.writeByte(p.PadLength) + } + if !validStreamID(p.PromiseID) && !f.AllowIllegalWrites { + return errStreamID + } + f.writeUint32(p.PromiseID) + f.wbuf = append(f.wbuf, p.BlockFragment...) + f.wbuf = append(f.wbuf, padZeros[:p.PadLength]...) + return f.endWrite() +} + +// WriteRawFrame writes a raw frame. This can be used to write +// extension frames unknown to this package. +func (f *Framer) WriteRawFrame(t FrameType, flags Flags, streamID uint32, payload []byte) error { + f.startWrite(t, flags, streamID) + f.writeBytes(payload) + return f.endWrite() +} + +func readByte(p []byte) (remain []byte, b byte, err error) { + if len(p) == 0 { + return nil, 0, io.ErrUnexpectedEOF + } + return p[1:], p[0], nil +} + +func readUint32(p []byte) (remain []byte, v uint32, err error) { + if len(p) < 4 { + return nil, 0, io.ErrUnexpectedEOF + } + return p[4:], binary.BigEndian.Uint32(p[:4]), nil +} + +type streamEnder interface { + StreamEnded() bool +} + +type headersEnder interface { + HeadersEnded() bool +} + +type headersOrContinuation interface { + headersEnder + HeaderBlockFragment() []byte +} + +// A MetaHeadersFrame is the representation of one HEADERS frame and +// zero or more contiguous CONTINUATION frames and the decoding of +// their HPACK-encoded contents. +// +// This type of frame does not appear on the wire and is only returned +// by the Framer when Framer.ReadMetaHeaders is set. +type MetaHeadersFrame struct { + *HeadersFrame + + // Fields are the fields contained in the HEADERS and + // CONTINUATION frames. The underlying slice is owned by the + // Framer and must not be retained after the next call to + // ReadFrame. + // + // Fields are guaranteed to be in the correct http2 order and + // not have unknown pseudo header fields or invalid header + // field names or values. Required pseudo header fields may be + // missing, however. Use the MetaHeadersFrame.Pseudo accessor + // method access pseudo headers. + Fields []hpack.HeaderField + + // Truncated is whether the max header list size limit was hit + // and Fields is incomplete. The hpack decoder state is still + // valid, however. + Truncated bool +} + +// PseudoValue returns the given pseudo header field's value. +// The provided pseudo field should not contain the leading colon. +func (mh *MetaHeadersFrame) PseudoValue(pseudo string) string { + for _, hf := range mh.Fields { + if !hf.IsPseudo() { + return "" + } + if hf.Name[1:] == pseudo { + return hf.Value + } + } + return "" +} + +// RegularFields returns the regular (non-pseudo) header fields of mh. +// The caller does not own the returned slice. +func (mh *MetaHeadersFrame) RegularFields() []hpack.HeaderField { + for i, hf := range mh.Fields { + if !hf.IsPseudo() { + return mh.Fields[i:] + } + } + return nil +} + +// PseudoFields returns the pseudo header fields of mh. +// The caller does not own the returned slice. +func (mh *MetaHeadersFrame) PseudoFields() []hpack.HeaderField { + for i, hf := range mh.Fields { + if !hf.IsPseudo() { + return mh.Fields[:i] + } + } + return mh.Fields +} + +func (mh *MetaHeadersFrame) checkPseudos() error { + var isRequest, isResponse bool + pf := mh.PseudoFields() + for i, hf := range pf { + switch hf.Name { + case ":method", ":path", ":scheme", ":authority", ":protocol": + isRequest = true + case ":status": + isResponse = true + default: + return pseudoHeaderError(hf.Name) + } + // Check for duplicates. + // This would be a bad algorithm, but N is 5. + // And this doesn't allocate. + for _, hf2 := range pf[:i] { + if hf.Name == hf2.Name { + return duplicatePseudoHeaderError(hf.Name) + } + } + } + if isRequest && isResponse { + return errMixPseudoHeaderTypes + } + return nil +} + +func (fr *Framer) maxHeaderStringLen() int { + v := int(fr.maxHeaderListSize()) + if v < 0 { + // If maxHeaderListSize overflows an int, use no limit (0). + return 0 + } + return v +} + +// readMetaFrame returns 0 or more CONTINUATION frames from fr and +// merge them into the provided hf and returns a MetaHeadersFrame +// with the decoded hpack values. +func (fr *Framer) readMetaFrame(hf *HeadersFrame) (Frame, error) { + if fr.AllowIllegalReads { + return nil, errors.New("illegal use of AllowIllegalReads with ReadMetaHeaders") + } + mh := &MetaHeadersFrame{ + HeadersFrame: hf, + } + var remainSize = fr.maxHeaderListSize() + var sawRegular bool + + var invalid error // pseudo header field errors + hdec := fr.ReadMetaHeaders + hdec.SetEmitEnabled(true) + hdec.SetMaxStringLength(fr.maxHeaderStringLen()) + hdec.SetEmitFunc(func(hf hpack.HeaderField) { + if VerboseLogs && fr.logReads { + fr.debugReadLoggerf("http2: decoded hpack field %+v", hf) + } + if !httpguts.ValidHeaderFieldValue(hf.Value) { + // Don't include the value in the error, because it may be sensitive. + invalid = headerFieldValueError(hf.Name) + } + isPseudo := strings.HasPrefix(hf.Name, ":") + if isPseudo { + if sawRegular { + invalid = errPseudoAfterRegular + } + } else { + sawRegular = true + if !validWireHeaderFieldName(hf.Name) { + invalid = headerFieldNameError(hf.Name) + } + } + + if invalid != nil { + hdec.SetEmitEnabled(false) + return + } + + size := hf.Size() + if size > remainSize { + hdec.SetEmitEnabled(false) + mh.Truncated = true + remainSize = 0 + return + } + remainSize -= size + + mh.Fields = append(mh.Fields, hf) + }) + // Lose reference to MetaHeadersFrame: + defer hdec.SetEmitFunc(func(hf hpack.HeaderField) {}) + + var hc headersOrContinuation = hf + for { + frag := hc.HeaderBlockFragment() + + // Avoid parsing large amounts of headers that we will then discard. + // If the sender exceeds the max header list size by too much, + // skip parsing the fragment and close the connection. + // + // "Too much" is either any CONTINUATION frame after we've already + // exceeded the max header list size (in which case remainSize is 0), + // or a frame whose encoded size is more than twice the remaining + // header list bytes we're willing to accept. + if int64(len(frag)) > int64(2*remainSize) { + if VerboseLogs { + log.Printf("http2: header list too large") + } + // It would be nice to send a RST_STREAM before sending the GOAWAY, + // but the structure of the server's frame writer makes this difficult. + return mh, ConnectionError(ErrCodeProtocol) + } + + // Also close the connection after any CONTINUATION frame following an + // invalid header, since we stop tracking the size of the headers after + // an invalid one. + if invalid != nil { + if VerboseLogs { + log.Printf("http2: invalid header: %v", invalid) + } + // It would be nice to send a RST_STREAM before sending the GOAWAY, + // but the structure of the server's frame writer makes this difficult. + return mh, ConnectionError(ErrCodeProtocol) + } + + if _, err := hdec.Write(frag); err != nil { + return mh, ConnectionError(ErrCodeCompression) + } + + if hc.HeadersEnded() { + break + } + if f, err := fr.ReadFrame(); err != nil { + return nil, err + } else { + hc = f.(*ContinuationFrame) // guaranteed by checkFrameOrder + } + } + + mh.HeadersFrame.headerFragBuf = nil + mh.HeadersFrame.invalidate() + + if err := hdec.Close(); err != nil { + return mh, ConnectionError(ErrCodeCompression) + } + if invalid != nil { + fr.errDetail = invalid + if VerboseLogs { + log.Printf("http2: invalid header: %v", invalid) + } + return nil, StreamError{mh.StreamID, ErrCodeProtocol, invalid} + } + if err := mh.checkPseudos(); err != nil { + fr.errDetail = err + if VerboseLogs { + log.Printf("http2: invalid pseudo headers: %v", err) + } + return nil, StreamError{mh.StreamID, ErrCodeProtocol, err} + } + return mh, nil +} + +func summarizeFrame(f Frame) string { + var buf bytes.Buffer + f.Header().writeDebug(&buf) + switch f := f.(type) { + case *SettingsFrame: + n := 0 + f.ForeachSetting(func(s Setting) error { + n++ + if n == 1 { + buf.WriteString(", settings:") + } + fmt.Fprintf(&buf, " %v=%v,", s.ID, s.Val) + return nil + }) + if n > 0 { + buf.Truncate(buf.Len() - 1) // remove trailing comma + } + case *DataFrame: + data := f.Data() + const max = 256 + if len(data) > max { + data = data[:max] + } + fmt.Fprintf(&buf, " data=%q", data) + if len(f.Data()) > max { + fmt.Fprintf(&buf, " (%d bytes omitted)", len(f.Data())-max) + } + case *WindowUpdateFrame: + if f.StreamID == 0 { + buf.WriteString(" (conn)") + } + fmt.Fprintf(&buf, " incr=%v", f.Increment) + case *PingFrame: + fmt.Fprintf(&buf, " ping=%q", f.Data[:]) + case *GoAwayFrame: + fmt.Fprintf(&buf, " LastStreamID=%v ErrCode=%v Debug=%q", + f.LastStreamID, f.ErrCode, f.debugData) + case *RSTStreamFrame: + fmt.Fprintf(&buf, " ErrCode=%v", f.ErrCode) + } + return buf.String() +} diff --git a/vendor/golang.org/x/net/http2/gotrack.go b/vendor/golang.org/x/net/http2/gotrack.go new file mode 100644 index 0000000..9933c9f --- /dev/null +++ b/vendor/golang.org/x/net/http2/gotrack.go @@ -0,0 +1,170 @@ +// Copyright 2014 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. + +// Defensive debug-only utility to track that functions run on the +// goroutine that they're supposed to. + +package http2 + +import ( + "bytes" + "errors" + "fmt" + "os" + "runtime" + "strconv" + "sync" +) + +var DebugGoroutines = os.Getenv("DEBUG_HTTP2_GOROUTINES") == "1" + +type goroutineLock uint64 + +func newGoroutineLock() goroutineLock { + if !DebugGoroutines { + return 0 + } + return goroutineLock(curGoroutineID()) +} + +func (g goroutineLock) check() { + if !DebugGoroutines { + return + } + if curGoroutineID() != uint64(g) { + panic("running on the wrong goroutine") + } +} + +func (g goroutineLock) checkNotOn() { + if !DebugGoroutines { + return + } + if curGoroutineID() == uint64(g) { + panic("running on the wrong goroutine") + } +} + +var goroutineSpace = []byte("goroutine ") + +func curGoroutineID() uint64 { + bp := littleBuf.Get().(*[]byte) + defer littleBuf.Put(bp) + b := *bp + b = b[:runtime.Stack(b, false)] + // Parse the 4707 out of "goroutine 4707 [" + b = bytes.TrimPrefix(b, goroutineSpace) + i := bytes.IndexByte(b, ' ') + if i < 0 { + panic(fmt.Sprintf("No space found in %q", b)) + } + b = b[:i] + n, err := parseUintBytes(b, 10, 64) + if err != nil { + panic(fmt.Sprintf("Failed to parse goroutine ID out of %q: %v", b, err)) + } + return n +} + +var littleBuf = sync.Pool{ + New: func() interface{} { + buf := make([]byte, 64) + return &buf + }, +} + +// parseUintBytes is like strconv.ParseUint, but using a []byte. +func parseUintBytes(s []byte, base int, bitSize int) (n uint64, err error) { + var cutoff, maxVal uint64 + + if bitSize == 0 { + bitSize = int(strconv.IntSize) + } + + s0 := s + switch { + case len(s) < 1: + err = strconv.ErrSyntax + goto Error + + case 2 <= base && base <= 36: + // valid base; nothing to do + + case base == 0: + // Look for octal, hex prefix. + switch { + case s[0] == '0' && len(s) > 1 && (s[1] == 'x' || s[1] == 'X'): + base = 16 + s = s[2:] + if len(s) < 1 { + err = strconv.ErrSyntax + goto Error + } + case s[0] == '0': + base = 8 + default: + base = 10 + } + + default: + err = errors.New("invalid base " + strconv.Itoa(base)) + goto Error + } + + n = 0 + cutoff = cutoff64(base) + maxVal = 1<= base { + n = 0 + err = strconv.ErrSyntax + goto Error + } + + if n >= cutoff { + // n*base overflows + n = 1<<64 - 1 + err = strconv.ErrRange + goto Error + } + n *= uint64(base) + + n1 := n + uint64(v) + if n1 < n || n1 > maxVal { + // n+v overflows + n = 1<<64 - 1 + err = strconv.ErrRange + goto Error + } + n = n1 + } + + return n, nil + +Error: + return n, &strconv.NumError{Func: "ParseUint", Num: string(s0), Err: err} +} + +// Return the first number n such that n*base >= 1<<64. +func cutoff64(base int) uint64 { + if base < 2 { + return 0 + } + return (1<<64-1)/uint64(base) + 1 +} diff --git a/vendor/golang.org/x/net/http2/hpack/encode.go b/vendor/golang.org/x/net/http2/hpack/encode.go new file mode 100644 index 0000000..46219da --- /dev/null +++ b/vendor/golang.org/x/net/http2/hpack/encode.go @@ -0,0 +1,245 @@ +// Copyright 2014 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 hpack + +import ( + "io" +) + +const ( + uint32Max = ^uint32(0) + initialHeaderTableSize = 4096 +) + +type Encoder struct { + dynTab dynamicTable + // minSize is the minimum table size set by + // SetMaxDynamicTableSize after the previous Header Table Size + // Update. + minSize uint32 + // maxSizeLimit is the maximum table size this encoder + // supports. This will protect the encoder from too large + // size. + maxSizeLimit uint32 + // tableSizeUpdate indicates whether "Header Table Size + // Update" is required. + tableSizeUpdate bool + w io.Writer + buf []byte +} + +// NewEncoder returns a new Encoder which performs HPACK encoding. An +// encoded data is written to w. +func NewEncoder(w io.Writer) *Encoder { + e := &Encoder{ + minSize: uint32Max, + maxSizeLimit: initialHeaderTableSize, + tableSizeUpdate: false, + w: w, + } + e.dynTab.table.init() + e.dynTab.setMaxSize(initialHeaderTableSize) + return e +} + +// WriteField encodes f into a single Write to e's underlying Writer. +// This function may also produce bytes for "Header Table Size Update" +// if necessary. If produced, it is done before encoding f. +func (e *Encoder) WriteField(f HeaderField) error { + e.buf = e.buf[:0] + + if e.tableSizeUpdate { + e.tableSizeUpdate = false + if e.minSize < e.dynTab.maxSize { + e.buf = appendTableSize(e.buf, e.minSize) + } + e.minSize = uint32Max + e.buf = appendTableSize(e.buf, e.dynTab.maxSize) + } + + idx, nameValueMatch := e.searchTable(f) + if nameValueMatch { + e.buf = appendIndexed(e.buf, idx) + } else { + indexing := e.shouldIndex(f) + if indexing { + e.dynTab.add(f) + } + + if idx == 0 { + e.buf = appendNewName(e.buf, f, indexing) + } else { + e.buf = appendIndexedName(e.buf, f, idx, indexing) + } + } + n, err := e.w.Write(e.buf) + if err == nil && n != len(e.buf) { + err = io.ErrShortWrite + } + return err +} + +// searchTable searches f in both stable and dynamic header tables. +// The static header table is searched first. Only when there is no +// exact match for both name and value, the dynamic header table is +// then searched. If there is no match, i is 0. If both name and value +// match, i is the matched index and nameValueMatch becomes true. If +// only name matches, i points to that index and nameValueMatch +// becomes false. +func (e *Encoder) searchTable(f HeaderField) (i uint64, nameValueMatch bool) { + i, nameValueMatch = staticTable.search(f) + if nameValueMatch { + return i, true + } + + j, nameValueMatch := e.dynTab.table.search(f) + if nameValueMatch || (i == 0 && j != 0) { + return j + uint64(staticTable.len()), nameValueMatch + } + + return i, false +} + +// SetMaxDynamicTableSize changes the dynamic header table size to v. +// The actual size is bounded by the value passed to +// SetMaxDynamicTableSizeLimit. +func (e *Encoder) SetMaxDynamicTableSize(v uint32) { + if v > e.maxSizeLimit { + v = e.maxSizeLimit + } + if v < e.minSize { + e.minSize = v + } + e.tableSizeUpdate = true + e.dynTab.setMaxSize(v) +} + +// MaxDynamicTableSize returns the current dynamic header table size. +func (e *Encoder) MaxDynamicTableSize() (v uint32) { + return e.dynTab.maxSize +} + +// SetMaxDynamicTableSizeLimit changes the maximum value that can be +// specified in SetMaxDynamicTableSize to v. By default, it is set to +// 4096, which is the same size of the default dynamic header table +// size described in HPACK specification. If the current maximum +// dynamic header table size is strictly greater than v, "Header Table +// Size Update" will be done in the next WriteField call and the +// maximum dynamic header table size is truncated to v. +func (e *Encoder) SetMaxDynamicTableSizeLimit(v uint32) { + e.maxSizeLimit = v + if e.dynTab.maxSize > v { + e.tableSizeUpdate = true + e.dynTab.setMaxSize(v) + } +} + +// shouldIndex reports whether f should be indexed. +func (e *Encoder) shouldIndex(f HeaderField) bool { + return !f.Sensitive && f.Size() <= e.dynTab.maxSize +} + +// appendIndexed appends index i, as encoded in "Indexed Header Field" +// representation, to dst and returns the extended buffer. +func appendIndexed(dst []byte, i uint64) []byte { + first := len(dst) + dst = appendVarInt(dst, 7, i) + dst[first] |= 0x80 + return dst +} + +// appendNewName appends f, as encoded in one of "Literal Header field +// - New Name" representation variants, to dst and returns the +// extended buffer. +// +// If f.Sensitive is true, "Never Indexed" representation is used. If +// f.Sensitive is false and indexing is true, "Incremental Indexing" +// representation is used. +func appendNewName(dst []byte, f HeaderField, indexing bool) []byte { + dst = append(dst, encodeTypeByte(indexing, f.Sensitive)) + dst = appendHpackString(dst, f.Name) + return appendHpackString(dst, f.Value) +} + +// appendIndexedName appends f and index i referring indexed name +// entry, as encoded in one of "Literal Header field - Indexed Name" +// representation variants, to dst and returns the extended buffer. +// +// If f.Sensitive is true, "Never Indexed" representation is used. If +// f.Sensitive is false and indexing is true, "Incremental Indexing" +// representation is used. +func appendIndexedName(dst []byte, f HeaderField, i uint64, indexing bool) []byte { + first := len(dst) + var n byte + if indexing { + n = 6 + } else { + n = 4 + } + dst = appendVarInt(dst, n, i) + dst[first] |= encodeTypeByte(indexing, f.Sensitive) + return appendHpackString(dst, f.Value) +} + +// appendTableSize appends v, as encoded in "Header Table Size Update" +// representation, to dst and returns the extended buffer. +func appendTableSize(dst []byte, v uint32) []byte { + first := len(dst) + dst = appendVarInt(dst, 5, uint64(v)) + dst[first] |= 0x20 + return dst +} + +// appendVarInt appends i, as encoded in variable integer form using n +// bit prefix, to dst and returns the extended buffer. +// +// See +// https://httpwg.org/specs/rfc7541.html#integer.representation +func appendVarInt(dst []byte, n byte, i uint64) []byte { + k := uint64((1 << n) - 1) + if i < k { + return append(dst, byte(i)) + } + dst = append(dst, byte(k)) + i -= k + for ; i >= 128; i >>= 7 { + dst = append(dst, byte(0x80|(i&0x7f))) + } + return append(dst, byte(i)) +} + +// appendHpackString appends s, as encoded in "String Literal" +// representation, to dst and returns the extended buffer. +// +// s will be encoded in Huffman codes only when it produces strictly +// shorter byte string. +func appendHpackString(dst []byte, s string) []byte { + huffmanLength := HuffmanEncodeLength(s) + if huffmanLength < uint64(len(s)) { + first := len(dst) + dst = appendVarInt(dst, 7, huffmanLength) + dst = AppendHuffmanString(dst, s) + dst[first] |= 0x80 + } else { + dst = appendVarInt(dst, 7, uint64(len(s))) + dst = append(dst, s...) + } + return dst +} + +// encodeTypeByte returns type byte. If sensitive is true, type byte +// for "Never Indexed" representation is returned. If sensitive is +// false and indexing is true, type byte for "Incremental Indexing" +// representation is returned. Otherwise, type byte for "Without +// Indexing" is returned. +func encodeTypeByte(indexing, sensitive bool) byte { + if sensitive { + return 0x10 + } + if indexing { + return 0x40 + } + return 0 +} diff --git a/vendor/golang.org/x/net/http2/hpack/hpack.go b/vendor/golang.org/x/net/http2/hpack/hpack.go new file mode 100644 index 0000000..7a1d976 --- /dev/null +++ b/vendor/golang.org/x/net/http2/hpack/hpack.go @@ -0,0 +1,523 @@ +// Copyright 2014 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 hpack implements HPACK, a compression format for +// efficiently representing HTTP header fields in the context of HTTP/2. +// +// See http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-09 +package hpack + +import ( + "bytes" + "errors" + "fmt" +) + +// A DecodingError is something the spec defines as a decoding error. +type DecodingError struct { + Err error +} + +func (de DecodingError) Error() string { + return fmt.Sprintf("decoding error: %v", de.Err) +} + +// An InvalidIndexError is returned when an encoder references a table +// entry before the static table or after the end of the dynamic table. +type InvalidIndexError int + +func (e InvalidIndexError) Error() string { + return fmt.Sprintf("invalid indexed representation index %d", int(e)) +} + +// A HeaderField is a name-value pair. Both the name and value are +// treated as opaque sequences of octets. +type HeaderField struct { + Name, Value string + + // Sensitive means that this header field should never be + // indexed. + Sensitive bool +} + +// IsPseudo reports whether the header field is an http2 pseudo header. +// That is, it reports whether it starts with a colon. +// It is not otherwise guaranteed to be a valid pseudo header field, +// though. +func (hf HeaderField) IsPseudo() bool { + return len(hf.Name) != 0 && hf.Name[0] == ':' +} + +func (hf HeaderField) String() string { + var suffix string + if hf.Sensitive { + suffix = " (sensitive)" + } + return fmt.Sprintf("header field %q = %q%s", hf.Name, hf.Value, suffix) +} + +// Size returns the size of an entry per RFC 7541 section 4.1. +func (hf HeaderField) Size() uint32 { + // https://httpwg.org/specs/rfc7541.html#rfc.section.4.1 + // "The size of the dynamic table is the sum of the size of + // its entries. The size of an entry is the sum of its name's + // length in octets (as defined in Section 5.2), its value's + // length in octets (see Section 5.2), plus 32. The size of + // an entry is calculated using the length of the name and + // value without any Huffman encoding applied." + + // This can overflow if somebody makes a large HeaderField + // Name and/or Value by hand, but we don't care, because that + // won't happen on the wire because the encoding doesn't allow + // it. + return uint32(len(hf.Name) + len(hf.Value) + 32) +} + +// A Decoder is the decoding context for incremental processing of +// header blocks. +type Decoder struct { + dynTab dynamicTable + emit func(f HeaderField) + + emitEnabled bool // whether calls to emit are enabled + maxStrLen int // 0 means unlimited + + // buf is the unparsed buffer. It's only written to + // saveBuf if it was truncated in the middle of a header + // block. Because it's usually not owned, we can only + // process it under Write. + buf []byte // not owned; only valid during Write + + // saveBuf is previous data passed to Write which we weren't able + // to fully parse before. Unlike buf, we own this data. + saveBuf bytes.Buffer + + firstField bool // processing the first field of the header block +} + +// NewDecoder returns a new decoder with the provided maximum dynamic +// table size. The emitFunc will be called for each valid field +// parsed, in the same goroutine as calls to Write, before Write returns. +func NewDecoder(maxDynamicTableSize uint32, emitFunc func(f HeaderField)) *Decoder { + d := &Decoder{ + emit: emitFunc, + emitEnabled: true, + firstField: true, + } + d.dynTab.table.init() + d.dynTab.allowedMaxSize = maxDynamicTableSize + d.dynTab.setMaxSize(maxDynamicTableSize) + return d +} + +// ErrStringLength is returned by Decoder.Write when the max string length +// (as configured by Decoder.SetMaxStringLength) would be violated. +var ErrStringLength = errors.New("hpack: string too long") + +// SetMaxStringLength sets the maximum size of a HeaderField name or +// value string. If a string exceeds this length (even after any +// decompression), Write will return ErrStringLength. +// A value of 0 means unlimited and is the default from NewDecoder. +func (d *Decoder) SetMaxStringLength(n int) { + d.maxStrLen = n +} + +// SetEmitFunc changes the callback used when new header fields +// are decoded. +// It must be non-nil. It does not affect EmitEnabled. +func (d *Decoder) SetEmitFunc(emitFunc func(f HeaderField)) { + d.emit = emitFunc +} + +// SetEmitEnabled controls whether the emitFunc provided to NewDecoder +// should be called. The default is true. +// +// This facility exists to let servers enforce MAX_HEADER_LIST_SIZE +// while still decoding and keeping in-sync with decoder state, but +// without doing unnecessary decompression or generating unnecessary +// garbage for header fields past the limit. +func (d *Decoder) SetEmitEnabled(v bool) { d.emitEnabled = v } + +// EmitEnabled reports whether calls to the emitFunc provided to NewDecoder +// are currently enabled. The default is true. +func (d *Decoder) EmitEnabled() bool { return d.emitEnabled } + +// TODO: add method *Decoder.Reset(maxSize, emitFunc) to let callers re-use Decoders and their +// underlying buffers for garbage reasons. + +func (d *Decoder) SetMaxDynamicTableSize(v uint32) { + d.dynTab.setMaxSize(v) +} + +// SetAllowedMaxDynamicTableSize sets the upper bound that the encoded +// stream (via dynamic table size updates) may set the maximum size +// to. +func (d *Decoder) SetAllowedMaxDynamicTableSize(v uint32) { + d.dynTab.allowedMaxSize = v +} + +type dynamicTable struct { + // https://httpwg.org/specs/rfc7541.html#rfc.section.2.3.2 + table headerFieldTable + size uint32 // in bytes + maxSize uint32 // current maxSize + allowedMaxSize uint32 // maxSize may go up to this, inclusive +} + +func (dt *dynamicTable) setMaxSize(v uint32) { + dt.maxSize = v + dt.evict() +} + +func (dt *dynamicTable) add(f HeaderField) { + dt.table.addEntry(f) + dt.size += f.Size() + dt.evict() +} + +// If we're too big, evict old stuff. +func (dt *dynamicTable) evict() { + var n int + for dt.size > dt.maxSize && n < dt.table.len() { + dt.size -= dt.table.ents[n].Size() + n++ + } + dt.table.evictOldest(n) +} + +func (d *Decoder) maxTableIndex() int { + // This should never overflow. RFC 7540 Section 6.5.2 limits the size of + // the dynamic table to 2^32 bytes, where each entry will occupy more than + // one byte. Further, the staticTable has a fixed, small length. + return d.dynTab.table.len() + staticTable.len() +} + +func (d *Decoder) at(i uint64) (hf HeaderField, ok bool) { + // See Section 2.3.3. + if i == 0 { + return + } + if i <= uint64(staticTable.len()) { + return staticTable.ents[i-1], true + } + if i > uint64(d.maxTableIndex()) { + return + } + // In the dynamic table, newer entries have lower indices. + // However, dt.ents[0] is the oldest entry. Hence, dt.ents is + // the reversed dynamic table. + dt := d.dynTab.table + return dt.ents[dt.len()-(int(i)-staticTable.len())], true +} + +// DecodeFull decodes an entire block. +// +// TODO: remove this method and make it incremental later? This is +// easier for debugging now. +func (d *Decoder) DecodeFull(p []byte) ([]HeaderField, error) { + var hf []HeaderField + saveFunc := d.emit + defer func() { d.emit = saveFunc }() + d.emit = func(f HeaderField) { hf = append(hf, f) } + if _, err := d.Write(p); err != nil { + return nil, err + } + if err := d.Close(); err != nil { + return nil, err + } + return hf, nil +} + +// Close declares that the decoding is complete and resets the Decoder +// to be reused again for a new header block. If there is any remaining +// data in the decoder's buffer, Close returns an error. +func (d *Decoder) Close() error { + if d.saveBuf.Len() > 0 { + d.saveBuf.Reset() + return DecodingError{errors.New("truncated headers")} + } + d.firstField = true + return nil +} + +func (d *Decoder) Write(p []byte) (n int, err error) { + if len(p) == 0 { + // Prevent state machine CPU attacks (making us redo + // work up to the point of finding out we don't have + // enough data) + return + } + // Only copy the data if we have to. Optimistically assume + // that p will contain a complete header block. + if d.saveBuf.Len() == 0 { + d.buf = p + } else { + d.saveBuf.Write(p) + d.buf = d.saveBuf.Bytes() + d.saveBuf.Reset() + } + + for len(d.buf) > 0 { + err = d.parseHeaderFieldRepr() + if err == errNeedMore { + // Extra paranoia, making sure saveBuf won't + // get too large. All the varint and string + // reading code earlier should already catch + // overlong things and return ErrStringLength, + // but keep this as a last resort. + const varIntOverhead = 8 // conservative + if d.maxStrLen != 0 && int64(len(d.buf)) > 2*(int64(d.maxStrLen)+varIntOverhead) { + return 0, ErrStringLength + } + d.saveBuf.Write(d.buf) + return len(p), nil + } + d.firstField = false + if err != nil { + break + } + } + return len(p), err +} + +// errNeedMore is an internal sentinel error value that means the +// buffer is truncated and we need to read more data before we can +// continue parsing. +var errNeedMore = errors.New("need more data") + +type indexType int + +const ( + indexedTrue indexType = iota + indexedFalse + indexedNever +) + +func (v indexType) indexed() bool { return v == indexedTrue } +func (v indexType) sensitive() bool { return v == indexedNever } + +// returns errNeedMore if there isn't enough data available. +// any other error is fatal. +// consumes d.buf iff it returns nil. +// precondition: must be called with len(d.buf) > 0 +func (d *Decoder) parseHeaderFieldRepr() error { + b := d.buf[0] + switch { + case b&128 != 0: + // Indexed representation. + // High bit set? + // https://httpwg.org/specs/rfc7541.html#rfc.section.6.1 + return d.parseFieldIndexed() + case b&192 == 64: + // 6.2.1 Literal Header Field with Incremental Indexing + // 0b10xxxxxx: top two bits are 10 + // https://httpwg.org/specs/rfc7541.html#rfc.section.6.2.1 + return d.parseFieldLiteral(6, indexedTrue) + case b&240 == 0: + // 6.2.2 Literal Header Field without Indexing + // 0b0000xxxx: top four bits are 0000 + // https://httpwg.org/specs/rfc7541.html#rfc.section.6.2.2 + return d.parseFieldLiteral(4, indexedFalse) + case b&240 == 16: + // 6.2.3 Literal Header Field never Indexed + // 0b0001xxxx: top four bits are 0001 + // https://httpwg.org/specs/rfc7541.html#rfc.section.6.2.3 + return d.parseFieldLiteral(4, indexedNever) + case b&224 == 32: + // 6.3 Dynamic Table Size Update + // Top three bits are '001'. + // https://httpwg.org/specs/rfc7541.html#rfc.section.6.3 + return d.parseDynamicTableSizeUpdate() + } + + return DecodingError{errors.New("invalid encoding")} +} + +// (same invariants and behavior as parseHeaderFieldRepr) +func (d *Decoder) parseFieldIndexed() error { + buf := d.buf + idx, buf, err := readVarInt(7, buf) + if err != nil { + return err + } + hf, ok := d.at(idx) + if !ok { + return DecodingError{InvalidIndexError(idx)} + } + d.buf = buf + return d.callEmit(HeaderField{Name: hf.Name, Value: hf.Value}) +} + +// (same invariants and behavior as parseHeaderFieldRepr) +func (d *Decoder) parseFieldLiteral(n uint8, it indexType) error { + buf := d.buf + nameIdx, buf, err := readVarInt(n, buf) + if err != nil { + return err + } + + var hf HeaderField + wantStr := d.emitEnabled || it.indexed() + var undecodedName undecodedString + if nameIdx > 0 { + ihf, ok := d.at(nameIdx) + if !ok { + return DecodingError{InvalidIndexError(nameIdx)} + } + hf.Name = ihf.Name + } else { + undecodedName, buf, err = d.readString(buf) + if err != nil { + return err + } + } + undecodedValue, buf, err := d.readString(buf) + if err != nil { + return err + } + if wantStr { + if nameIdx <= 0 { + hf.Name, err = d.decodeString(undecodedName) + if err != nil { + return err + } + } + hf.Value, err = d.decodeString(undecodedValue) + if err != nil { + return err + } + } + d.buf = buf + if it.indexed() { + d.dynTab.add(hf) + } + hf.Sensitive = it.sensitive() + return d.callEmit(hf) +} + +func (d *Decoder) callEmit(hf HeaderField) error { + if d.maxStrLen != 0 { + if len(hf.Name) > d.maxStrLen || len(hf.Value) > d.maxStrLen { + return ErrStringLength + } + } + if d.emitEnabled { + d.emit(hf) + } + return nil +} + +// (same invariants and behavior as parseHeaderFieldRepr) +func (d *Decoder) parseDynamicTableSizeUpdate() error { + // RFC 7541, sec 4.2: This dynamic table size update MUST occur at the + // beginning of the first header block following the change to the dynamic table size. + if !d.firstField && d.dynTab.size > 0 { + return DecodingError{errors.New("dynamic table size update MUST occur at the beginning of a header block")} + } + + buf := d.buf + size, buf, err := readVarInt(5, buf) + if err != nil { + return err + } + if size > uint64(d.dynTab.allowedMaxSize) { + return DecodingError{errors.New("dynamic table size update too large")} + } + d.dynTab.setMaxSize(uint32(size)) + d.buf = buf + return nil +} + +var errVarintOverflow = DecodingError{errors.New("varint integer overflow")} + +// readVarInt reads an unsigned variable length integer off the +// beginning of p. n is the parameter as described in +// https://httpwg.org/specs/rfc7541.html#rfc.section.5.1. +// +// n must always be between 1 and 8. +// +// The returned remain buffer is either a smaller suffix of p, or err != nil. +// The error is errNeedMore if p doesn't contain a complete integer. +func readVarInt(n byte, p []byte) (i uint64, remain []byte, err error) { + if n < 1 || n > 8 { + panic("bad n") + } + if len(p) == 0 { + return 0, p, errNeedMore + } + i = uint64(p[0]) + if n < 8 { + i &= (1 << uint64(n)) - 1 + } + if i < (1< 0 { + b := p[0] + p = p[1:] + i += uint64(b&127) << m + if b&128 == 0 { + return i, p, nil + } + m += 7 + if m >= 63 { // TODO: proper overflow check. making this up. + return 0, origP, errVarintOverflow + } + } + return 0, origP, errNeedMore +} + +// readString reads an hpack string from p. +// +// It returns a reference to the encoded string data to permit deferring decode costs +// until after the caller verifies all data is present. +func (d *Decoder) readString(p []byte) (u undecodedString, remain []byte, err error) { + if len(p) == 0 { + return u, p, errNeedMore + } + isHuff := p[0]&128 != 0 + strLen, p, err := readVarInt(7, p) + if err != nil { + return u, p, err + } + if d.maxStrLen != 0 && strLen > uint64(d.maxStrLen) { + // Returning an error here means Huffman decoding errors + // for non-indexed strings past the maximum string length + // are ignored, but the server is returning an error anyway + // and because the string is not indexed the error will not + // affect the decoding state. + return u, nil, ErrStringLength + } + if uint64(len(p)) < strLen { + return u, p, errNeedMore + } + u.isHuff = isHuff + u.b = p[:strLen] + return u, p[strLen:], nil +} + +type undecodedString struct { + isHuff bool + b []byte +} + +func (d *Decoder) decodeString(u undecodedString) (string, error) { + if !u.isHuff { + return string(u.b), nil + } + buf := bufPool.Get().(*bytes.Buffer) + buf.Reset() // don't trust others + var s string + err := huffmanDecode(buf, d.maxStrLen, u.b) + if err == nil { + s = buf.String() + } + buf.Reset() // be nice to GC + bufPool.Put(buf) + return s, err +} diff --git a/vendor/golang.org/x/net/http2/hpack/huffman.go b/vendor/golang.org/x/net/http2/hpack/huffman.go new file mode 100644 index 0000000..20d083a --- /dev/null +++ b/vendor/golang.org/x/net/http2/hpack/huffman.go @@ -0,0 +1,226 @@ +// Copyright 2014 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 hpack + +import ( + "bytes" + "errors" + "io" + "sync" +) + +var bufPool = sync.Pool{ + New: func() interface{} { return new(bytes.Buffer) }, +} + +// HuffmanDecode decodes the string in v and writes the expanded +// result to w, returning the number of bytes written to w and the +// Write call's return value. At most one Write call is made. +func HuffmanDecode(w io.Writer, v []byte) (int, error) { + buf := bufPool.Get().(*bytes.Buffer) + buf.Reset() + defer bufPool.Put(buf) + if err := huffmanDecode(buf, 0, v); err != nil { + return 0, err + } + return w.Write(buf.Bytes()) +} + +// HuffmanDecodeToString decodes the string in v. +func HuffmanDecodeToString(v []byte) (string, error) { + buf := bufPool.Get().(*bytes.Buffer) + buf.Reset() + defer bufPool.Put(buf) + if err := huffmanDecode(buf, 0, v); err != nil { + return "", err + } + return buf.String(), nil +} + +// ErrInvalidHuffman is returned for errors found decoding +// Huffman-encoded strings. +var ErrInvalidHuffman = errors.New("hpack: invalid Huffman-encoded data") + +// huffmanDecode decodes v to buf. +// If maxLen is greater than 0, attempts to write more to buf than +// maxLen bytes will return ErrStringLength. +func huffmanDecode(buf *bytes.Buffer, maxLen int, v []byte) error { + rootHuffmanNode := getRootHuffmanNode() + n := rootHuffmanNode + // cur is the bit buffer that has not been fed into n. + // cbits is the number of low order bits in cur that are valid. + // sbits is the number of bits of the symbol prefix being decoded. + cur, cbits, sbits := uint(0), uint8(0), uint8(0) + for _, b := range v { + cur = cur<<8 | uint(b) + cbits += 8 + sbits += 8 + for cbits >= 8 { + idx := byte(cur >> (cbits - 8)) + n = n.children[idx] + if n == nil { + return ErrInvalidHuffman + } + if n.children == nil { + if maxLen != 0 && buf.Len() == maxLen { + return ErrStringLength + } + buf.WriteByte(n.sym) + cbits -= n.codeLen + n = rootHuffmanNode + sbits = cbits + } else { + cbits -= 8 + } + } + } + for cbits > 0 { + n = n.children[byte(cur<<(8-cbits))] + if n == nil { + return ErrInvalidHuffman + } + if n.children != nil || n.codeLen > cbits { + break + } + if maxLen != 0 && buf.Len() == maxLen { + return ErrStringLength + } + buf.WriteByte(n.sym) + cbits -= n.codeLen + n = rootHuffmanNode + sbits = cbits + } + if sbits > 7 { + // Either there was an incomplete symbol, or overlong padding. + // Both are decoding errors per RFC 7541 section 5.2. + return ErrInvalidHuffman + } + if mask := uint(1< 8 { + codeLen -= 8 + i := uint8(code >> codeLen) + if cur.children[i] == nil { + cur.children[i] = newInternalNode() + } + cur = cur.children[i] + } + shift := 8 - codeLen + start, end := int(uint8(code<= 32 { + n %= 32 // Normally would be -= 32 but %= 32 informs compiler 0 <= n <= 31 for upcoming shift + y := uint32(x >> n) // Compiler doesn't combine memory writes if y isn't uint32 + dst = append(dst, byte(y>>24), byte(y>>16), byte(y>>8), byte(y)) + } + } + // Add padding bits if necessary + if over := n % 8; over > 0 { + const ( + eosCode = 0x3fffffff + eosNBits = 30 + eosPadByte = eosCode >> (eosNBits - 8) + ) + pad := 8 - over + x = (x << pad) | (eosPadByte >> over) + n += pad // 8 now divides into n exactly + } + // n in (0, 8, 16, 24, 32) + switch n / 8 { + case 0: + return dst + case 1: + return append(dst, byte(x)) + case 2: + y := uint16(x) + return append(dst, byte(y>>8), byte(y)) + case 3: + y := uint16(x >> 8) + return append(dst, byte(y>>8), byte(y), byte(x)) + } + // case 4: + y := uint32(x) + return append(dst, byte(y>>24), byte(y>>16), byte(y>>8), byte(y)) +} + +// HuffmanEncodeLength returns the number of bytes required to encode +// s in Huffman codes. The result is round up to byte boundary. +func HuffmanEncodeLength(s string) uint64 { + n := uint64(0) + for i := 0; i < len(s); i++ { + n += uint64(huffmanCodeLen[s[i]]) + } + return (n + 7) / 8 +} diff --git a/vendor/golang.org/x/net/http2/hpack/static_table.go b/vendor/golang.org/x/net/http2/hpack/static_table.go new file mode 100644 index 0000000..754a1eb --- /dev/null +++ b/vendor/golang.org/x/net/http2/hpack/static_table.go @@ -0,0 +1,188 @@ +// go generate gen.go +// Code generated by the command above; DO NOT EDIT. + +package hpack + +var staticTable = &headerFieldTable{ + evictCount: 0, + byName: map[string]uint64{ + ":authority": 1, + ":method": 3, + ":path": 5, + ":scheme": 7, + ":status": 14, + "accept-charset": 15, + "accept-encoding": 16, + "accept-language": 17, + "accept-ranges": 18, + "accept": 19, + "access-control-allow-origin": 20, + "age": 21, + "allow": 22, + "authorization": 23, + "cache-control": 24, + "content-disposition": 25, + "content-encoding": 26, + "content-language": 27, + "content-length": 28, + "content-location": 29, + "content-range": 30, + "content-type": 31, + "cookie": 32, + "date": 33, + "etag": 34, + "expect": 35, + "expires": 36, + "from": 37, + "host": 38, + "if-match": 39, + "if-modified-since": 40, + "if-none-match": 41, + "if-range": 42, + "if-unmodified-since": 43, + "last-modified": 44, + "link": 45, + "location": 46, + "max-forwards": 47, + "proxy-authenticate": 48, + "proxy-authorization": 49, + "range": 50, + "referer": 51, + "refresh": 52, + "retry-after": 53, + "server": 54, + "set-cookie": 55, + "strict-transport-security": 56, + "transfer-encoding": 57, + "user-agent": 58, + "vary": 59, + "via": 60, + "www-authenticate": 61, + }, + byNameValue: map[pairNameValue]uint64{ + {name: ":authority", value: ""}: 1, + {name: ":method", value: "GET"}: 2, + {name: ":method", value: "POST"}: 3, + {name: ":path", value: "/"}: 4, + {name: ":path", value: "/index.html"}: 5, + {name: ":scheme", value: "http"}: 6, + {name: ":scheme", value: "https"}: 7, + {name: ":status", value: "200"}: 8, + {name: ":status", value: "204"}: 9, + {name: ":status", value: "206"}: 10, + {name: ":status", value: "304"}: 11, + {name: ":status", value: "400"}: 12, + {name: ":status", value: "404"}: 13, + {name: ":status", value: "500"}: 14, + {name: "accept-charset", value: ""}: 15, + {name: "accept-encoding", value: "gzip, deflate"}: 16, + {name: "accept-language", value: ""}: 17, + {name: "accept-ranges", value: ""}: 18, + {name: "accept", value: ""}: 19, + {name: "access-control-allow-origin", value: ""}: 20, + {name: "age", value: ""}: 21, + {name: "allow", value: ""}: 22, + {name: "authorization", value: ""}: 23, + {name: "cache-control", value: ""}: 24, + {name: "content-disposition", value: ""}: 25, + {name: "content-encoding", value: ""}: 26, + {name: "content-language", value: ""}: 27, + {name: "content-length", value: ""}: 28, + {name: "content-location", value: ""}: 29, + {name: "content-range", value: ""}: 30, + {name: "content-type", value: ""}: 31, + {name: "cookie", value: ""}: 32, + {name: "date", value: ""}: 33, + {name: "etag", value: ""}: 34, + {name: "expect", value: ""}: 35, + {name: "expires", value: ""}: 36, + {name: "from", value: ""}: 37, + {name: "host", value: ""}: 38, + {name: "if-match", value: ""}: 39, + {name: "if-modified-since", value: ""}: 40, + {name: "if-none-match", value: ""}: 41, + {name: "if-range", value: ""}: 42, + {name: "if-unmodified-since", value: ""}: 43, + {name: "last-modified", value: ""}: 44, + {name: "link", value: ""}: 45, + {name: "location", value: ""}: 46, + {name: "max-forwards", value: ""}: 47, + {name: "proxy-authenticate", value: ""}: 48, + {name: "proxy-authorization", value: ""}: 49, + {name: "range", value: ""}: 50, + {name: "referer", value: ""}: 51, + {name: "refresh", value: ""}: 52, + {name: "retry-after", value: ""}: 53, + {name: "server", value: ""}: 54, + {name: "set-cookie", value: ""}: 55, + {name: "strict-transport-security", value: ""}: 56, + {name: "transfer-encoding", value: ""}: 57, + {name: "user-agent", value: ""}: 58, + {name: "vary", value: ""}: 59, + {name: "via", value: ""}: 60, + {name: "www-authenticate", value: ""}: 61, + }, + ents: []HeaderField{ + {Name: ":authority", Value: "", Sensitive: false}, + {Name: ":method", Value: "GET", Sensitive: false}, + {Name: ":method", Value: "POST", Sensitive: false}, + {Name: ":path", Value: "/", Sensitive: false}, + {Name: ":path", Value: "/index.html", Sensitive: false}, + {Name: ":scheme", Value: "http", Sensitive: false}, + {Name: ":scheme", Value: "https", Sensitive: false}, + {Name: ":status", Value: "200", Sensitive: false}, + {Name: ":status", Value: "204", Sensitive: false}, + {Name: ":status", Value: "206", Sensitive: false}, + {Name: ":status", Value: "304", Sensitive: false}, + {Name: ":status", Value: "400", Sensitive: false}, + {Name: ":status", Value: "404", Sensitive: false}, + {Name: ":status", Value: "500", Sensitive: false}, + {Name: "accept-charset", Value: "", Sensitive: false}, + {Name: "accept-encoding", Value: "gzip, deflate", Sensitive: false}, + {Name: "accept-language", Value: "", Sensitive: false}, + {Name: "accept-ranges", Value: "", Sensitive: false}, + {Name: "accept", Value: "", Sensitive: false}, + {Name: "access-control-allow-origin", Value: "", Sensitive: false}, + {Name: "age", Value: "", Sensitive: false}, + {Name: "allow", Value: "", Sensitive: false}, + {Name: "authorization", Value: "", Sensitive: false}, + {Name: "cache-control", Value: "", Sensitive: false}, + {Name: "content-disposition", Value: "", Sensitive: false}, + {Name: "content-encoding", Value: "", Sensitive: false}, + {Name: "content-language", Value: "", Sensitive: false}, + {Name: "content-length", Value: "", Sensitive: false}, + {Name: "content-location", Value: "", Sensitive: false}, + {Name: "content-range", Value: "", Sensitive: false}, + {Name: "content-type", Value: "", Sensitive: false}, + {Name: "cookie", Value: "", Sensitive: false}, + {Name: "date", Value: "", Sensitive: false}, + {Name: "etag", Value: "", Sensitive: false}, + {Name: "expect", Value: "", Sensitive: false}, + {Name: "expires", Value: "", Sensitive: false}, + {Name: "from", Value: "", Sensitive: false}, + {Name: "host", Value: "", Sensitive: false}, + {Name: "if-match", Value: "", Sensitive: false}, + {Name: "if-modified-since", Value: "", Sensitive: false}, + {Name: "if-none-match", Value: "", Sensitive: false}, + {Name: "if-range", Value: "", Sensitive: false}, + {Name: "if-unmodified-since", Value: "", Sensitive: false}, + {Name: "last-modified", Value: "", Sensitive: false}, + {Name: "link", Value: "", Sensitive: false}, + {Name: "location", Value: "", Sensitive: false}, + {Name: "max-forwards", Value: "", Sensitive: false}, + {Name: "proxy-authenticate", Value: "", Sensitive: false}, + {Name: "proxy-authorization", Value: "", Sensitive: false}, + {Name: "range", Value: "", Sensitive: false}, + {Name: "referer", Value: "", Sensitive: false}, + {Name: "refresh", Value: "", Sensitive: false}, + {Name: "retry-after", Value: "", Sensitive: false}, + {Name: "server", Value: "", Sensitive: false}, + {Name: "set-cookie", Value: "", Sensitive: false}, + {Name: "strict-transport-security", Value: "", Sensitive: false}, + {Name: "transfer-encoding", Value: "", Sensitive: false}, + {Name: "user-agent", Value: "", Sensitive: false}, + {Name: "vary", Value: "", Sensitive: false}, + {Name: "via", Value: "", Sensitive: false}, + {Name: "www-authenticate", Value: "", Sensitive: false}, + }, +} diff --git a/vendor/golang.org/x/net/http2/hpack/tables.go b/vendor/golang.org/x/net/http2/hpack/tables.go new file mode 100644 index 0000000..8cbdf3f --- /dev/null +++ b/vendor/golang.org/x/net/http2/hpack/tables.go @@ -0,0 +1,403 @@ +// Copyright 2014 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 hpack + +import ( + "fmt" +) + +// headerFieldTable implements a list of HeaderFields. +// This is used to implement the static and dynamic tables. +type headerFieldTable struct { + // For static tables, entries are never evicted. + // + // For dynamic tables, entries are evicted from ents[0] and added to the end. + // Each entry has a unique id that starts at one and increments for each + // entry that is added. This unique id is stable across evictions, meaning + // it can be used as a pointer to a specific entry. As in hpack, unique ids + // are 1-based. The unique id for ents[k] is k + evictCount + 1. + // + // Zero is not a valid unique id. + // + // evictCount should not overflow in any remotely practical situation. In + // practice, we will have one dynamic table per HTTP/2 connection. If we + // assume a very powerful server that handles 1M QPS per connection and each + // request adds (then evicts) 100 entries from the table, it would still take + // 2M years for evictCount to overflow. + ents []HeaderField + evictCount uint64 + + // byName maps a HeaderField name to the unique id of the newest entry with + // the same name. See above for a definition of "unique id". + byName map[string]uint64 + + // byNameValue maps a HeaderField name/value pair to the unique id of the newest + // entry with the same name and value. See above for a definition of "unique id". + byNameValue map[pairNameValue]uint64 +} + +type pairNameValue struct { + name, value string +} + +func (t *headerFieldTable) init() { + t.byName = make(map[string]uint64) + t.byNameValue = make(map[pairNameValue]uint64) +} + +// len reports the number of entries in the table. +func (t *headerFieldTable) len() int { + return len(t.ents) +} + +// addEntry adds a new entry. +func (t *headerFieldTable) addEntry(f HeaderField) { + id := uint64(t.len()) + t.evictCount + 1 + t.byName[f.Name] = id + t.byNameValue[pairNameValue{f.Name, f.Value}] = id + t.ents = append(t.ents, f) +} + +// evictOldest evicts the n oldest entries in the table. +func (t *headerFieldTable) evictOldest(n int) { + if n > t.len() { + panic(fmt.Sprintf("evictOldest(%v) on table with %v entries", n, t.len())) + } + for k := 0; k < n; k++ { + f := t.ents[k] + id := t.evictCount + uint64(k) + 1 + if t.byName[f.Name] == id { + delete(t.byName, f.Name) + } + if p := (pairNameValue{f.Name, f.Value}); t.byNameValue[p] == id { + delete(t.byNameValue, p) + } + } + copy(t.ents, t.ents[n:]) + for k := t.len() - n; k < t.len(); k++ { + t.ents[k] = HeaderField{} // so strings can be garbage collected + } + t.ents = t.ents[:t.len()-n] + if t.evictCount+uint64(n) < t.evictCount { + panic("evictCount overflow") + } + t.evictCount += uint64(n) +} + +// search finds f in the table. If there is no match, i is 0. +// If both name and value match, i is the matched index and nameValueMatch +// becomes true. If only name matches, i points to that index and +// nameValueMatch becomes false. +// +// The returned index is a 1-based HPACK index. For dynamic tables, HPACK says +// that index 1 should be the newest entry, but t.ents[0] is the oldest entry, +// meaning t.ents is reversed for dynamic tables. Hence, when t is a dynamic +// table, the return value i actually refers to the entry t.ents[t.len()-i]. +// +// All tables are assumed to be a dynamic tables except for the global staticTable. +// +// See Section 2.3.3. +func (t *headerFieldTable) search(f HeaderField) (i uint64, nameValueMatch bool) { + if !f.Sensitive { + if id := t.byNameValue[pairNameValue{f.Name, f.Value}]; id != 0 { + return t.idToIndex(id), true + } + } + if id := t.byName[f.Name]; id != 0 { + return t.idToIndex(id), false + } + return 0, false +} + +// idToIndex converts a unique id to an HPACK index. +// See Section 2.3.3. +func (t *headerFieldTable) idToIndex(id uint64) uint64 { + if id <= t.evictCount { + panic(fmt.Sprintf("id (%v) <= evictCount (%v)", id, t.evictCount)) + } + k := id - t.evictCount - 1 // convert id to an index t.ents[k] + if t != staticTable { + return uint64(t.len()) - k // dynamic table + } + return k + 1 +} + +var huffmanCodes = [256]uint32{ + 0x1ff8, + 0x7fffd8, + 0xfffffe2, + 0xfffffe3, + 0xfffffe4, + 0xfffffe5, + 0xfffffe6, + 0xfffffe7, + 0xfffffe8, + 0xffffea, + 0x3ffffffc, + 0xfffffe9, + 0xfffffea, + 0x3ffffffd, + 0xfffffeb, + 0xfffffec, + 0xfffffed, + 0xfffffee, + 0xfffffef, + 0xffffff0, + 0xffffff1, + 0xffffff2, + 0x3ffffffe, + 0xffffff3, + 0xffffff4, + 0xffffff5, + 0xffffff6, + 0xffffff7, + 0xffffff8, + 0xffffff9, + 0xffffffa, + 0xffffffb, + 0x14, + 0x3f8, + 0x3f9, + 0xffa, + 0x1ff9, + 0x15, + 0xf8, + 0x7fa, + 0x3fa, + 0x3fb, + 0xf9, + 0x7fb, + 0xfa, + 0x16, + 0x17, + 0x18, + 0x0, + 0x1, + 0x2, + 0x19, + 0x1a, + 0x1b, + 0x1c, + 0x1d, + 0x1e, + 0x1f, + 0x5c, + 0xfb, + 0x7ffc, + 0x20, + 0xffb, + 0x3fc, + 0x1ffa, + 0x21, + 0x5d, + 0x5e, + 0x5f, + 0x60, + 0x61, + 0x62, + 0x63, + 0x64, + 0x65, + 0x66, + 0x67, + 0x68, + 0x69, + 0x6a, + 0x6b, + 0x6c, + 0x6d, + 0x6e, + 0x6f, + 0x70, + 0x71, + 0x72, + 0xfc, + 0x73, + 0xfd, + 0x1ffb, + 0x7fff0, + 0x1ffc, + 0x3ffc, + 0x22, + 0x7ffd, + 0x3, + 0x23, + 0x4, + 0x24, + 0x5, + 0x25, + 0x26, + 0x27, + 0x6, + 0x74, + 0x75, + 0x28, + 0x29, + 0x2a, + 0x7, + 0x2b, + 0x76, + 0x2c, + 0x8, + 0x9, + 0x2d, + 0x77, + 0x78, + 0x79, + 0x7a, + 0x7b, + 0x7ffe, + 0x7fc, + 0x3ffd, + 0x1ffd, + 0xffffffc, + 0xfffe6, + 0x3fffd2, + 0xfffe7, + 0xfffe8, + 0x3fffd3, + 0x3fffd4, + 0x3fffd5, + 0x7fffd9, + 0x3fffd6, + 0x7fffda, + 0x7fffdb, + 0x7fffdc, + 0x7fffdd, + 0x7fffde, + 0xffffeb, + 0x7fffdf, + 0xffffec, + 0xffffed, + 0x3fffd7, + 0x7fffe0, + 0xffffee, + 0x7fffe1, + 0x7fffe2, + 0x7fffe3, + 0x7fffe4, + 0x1fffdc, + 0x3fffd8, + 0x7fffe5, + 0x3fffd9, + 0x7fffe6, + 0x7fffe7, + 0xffffef, + 0x3fffda, + 0x1fffdd, + 0xfffe9, + 0x3fffdb, + 0x3fffdc, + 0x7fffe8, + 0x7fffe9, + 0x1fffde, + 0x7fffea, + 0x3fffdd, + 0x3fffde, + 0xfffff0, + 0x1fffdf, + 0x3fffdf, + 0x7fffeb, + 0x7fffec, + 0x1fffe0, + 0x1fffe1, + 0x3fffe0, + 0x1fffe2, + 0x7fffed, + 0x3fffe1, + 0x7fffee, + 0x7fffef, + 0xfffea, + 0x3fffe2, + 0x3fffe3, + 0x3fffe4, + 0x7ffff0, + 0x3fffe5, + 0x3fffe6, + 0x7ffff1, + 0x3ffffe0, + 0x3ffffe1, + 0xfffeb, + 0x7fff1, + 0x3fffe7, + 0x7ffff2, + 0x3fffe8, + 0x1ffffec, + 0x3ffffe2, + 0x3ffffe3, + 0x3ffffe4, + 0x7ffffde, + 0x7ffffdf, + 0x3ffffe5, + 0xfffff1, + 0x1ffffed, + 0x7fff2, + 0x1fffe3, + 0x3ffffe6, + 0x7ffffe0, + 0x7ffffe1, + 0x3ffffe7, + 0x7ffffe2, + 0xfffff2, + 0x1fffe4, + 0x1fffe5, + 0x3ffffe8, + 0x3ffffe9, + 0xffffffd, + 0x7ffffe3, + 0x7ffffe4, + 0x7ffffe5, + 0xfffec, + 0xfffff3, + 0xfffed, + 0x1fffe6, + 0x3fffe9, + 0x1fffe7, + 0x1fffe8, + 0x7ffff3, + 0x3fffea, + 0x3fffeb, + 0x1ffffee, + 0x1ffffef, + 0xfffff4, + 0xfffff5, + 0x3ffffea, + 0x7ffff4, + 0x3ffffeb, + 0x7ffffe6, + 0x3ffffec, + 0x3ffffed, + 0x7ffffe7, + 0x7ffffe8, + 0x7ffffe9, + 0x7ffffea, + 0x7ffffeb, + 0xffffffe, + 0x7ffffec, + 0x7ffffed, + 0x7ffffee, + 0x7ffffef, + 0x7fffff0, + 0x3ffffee, +} + +var huffmanCodeLen = [256]uint8{ + 13, 23, 28, 28, 28, 28, 28, 28, 28, 24, 30, 28, 28, 30, 28, 28, + 28, 28, 28, 28, 28, 28, 30, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 6, 10, 10, 12, 13, 6, 8, 11, 10, 10, 8, 11, 8, 6, 6, 6, + 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 8, 15, 6, 12, 10, + 13, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 8, 13, 19, 13, 14, 6, + 15, 5, 6, 5, 6, 5, 6, 6, 6, 5, 7, 7, 6, 6, 6, 5, + 6, 7, 6, 5, 5, 6, 7, 7, 7, 7, 7, 15, 11, 14, 13, 28, + 20, 22, 20, 20, 22, 22, 22, 23, 22, 23, 23, 23, 23, 23, 24, 23, + 24, 24, 22, 23, 24, 23, 23, 23, 23, 21, 22, 23, 22, 23, 23, 24, + 22, 21, 20, 22, 22, 23, 23, 21, 23, 22, 22, 24, 21, 22, 23, 23, + 21, 21, 22, 21, 23, 22, 23, 23, 20, 22, 22, 22, 23, 22, 22, 23, + 26, 26, 20, 19, 22, 23, 22, 25, 26, 26, 26, 27, 27, 26, 24, 25, + 19, 21, 26, 27, 27, 26, 27, 24, 21, 21, 26, 26, 28, 27, 27, 27, + 20, 24, 20, 21, 22, 21, 21, 23, 22, 22, 25, 25, 24, 24, 26, 23, + 26, 27, 26, 26, 27, 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, 26, +} diff --git a/vendor/golang.org/x/net/http2/http2.go b/vendor/golang.org/x/net/http2/http2.go new file mode 100644 index 0000000..6c18ea2 --- /dev/null +++ b/vendor/golang.org/x/net/http2/http2.go @@ -0,0 +1,432 @@ +// Copyright 2014 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 http2 implements the HTTP/2 protocol. +// +// This package is low-level and intended to be used directly by very +// few people. Most users will use it indirectly through the automatic +// use by the net/http package (from Go 1.6 and later). +// For use in earlier Go versions see ConfigureServer. (Transport support +// requires Go 1.6 or later) +// +// See https://http2.github.io/ for more information on HTTP/2. +// +// See https://http2.golang.org/ for a test server running this code. +package http2 // import "golang.org/x/net/http2" + +import ( + "bufio" + "context" + "crypto/tls" + "errors" + "fmt" + "net" + "net/http" + "os" + "sort" + "strconv" + "strings" + "sync" + "time" + + "golang.org/x/net/http/httpguts" +) + +var ( + VerboseLogs bool + logFrameWrites bool + logFrameReads bool + inTests bool + + // Enabling extended CONNECT by causes browsers to attempt to use + // WebSockets-over-HTTP/2. This results in problems when the server's websocket + // package doesn't support extended CONNECT. + // + // Disable extended CONNECT by default for now. + // + // Issue #71128. + disableExtendedConnectProtocol = true +) + +func init() { + e := os.Getenv("GODEBUG") + if strings.Contains(e, "http2debug=1") { + VerboseLogs = true + } + if strings.Contains(e, "http2debug=2") { + VerboseLogs = true + logFrameWrites = true + logFrameReads = true + } + if strings.Contains(e, "http2xconnect=1") { + disableExtendedConnectProtocol = false + } +} + +const ( + // ClientPreface is the string that must be sent by new + // connections from clients. + ClientPreface = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" + + // SETTINGS_MAX_FRAME_SIZE default + // https://httpwg.org/specs/rfc7540.html#rfc.section.6.5.2 + initialMaxFrameSize = 16384 + + // NextProtoTLS is the NPN/ALPN protocol negotiated during + // HTTP/2's TLS setup. + NextProtoTLS = "h2" + + // https://httpwg.org/specs/rfc7540.html#SettingValues + initialHeaderTableSize = 4096 + + initialWindowSize = 65535 // 6.9.2 Initial Flow Control Window Size + + defaultMaxReadFrameSize = 1 << 20 +) + +var ( + clientPreface = []byte(ClientPreface) +) + +type streamState int + +// HTTP/2 stream states. +// +// See http://tools.ietf.org/html/rfc7540#section-5.1. +// +// For simplicity, the server code merges "reserved (local)" into +// "half-closed (remote)". This is one less state transition to track. +// The only downside is that we send PUSH_PROMISEs slightly less +// liberally than allowable. More discussion here: +// https://lists.w3.org/Archives/Public/ietf-http-wg/2016JulSep/0599.html +// +// "reserved (remote)" is omitted since the client code does not +// support server push. +const ( + stateIdle streamState = iota + stateOpen + stateHalfClosedLocal + stateHalfClosedRemote + stateClosed +) + +var stateName = [...]string{ + stateIdle: "Idle", + stateOpen: "Open", + stateHalfClosedLocal: "HalfClosedLocal", + stateHalfClosedRemote: "HalfClosedRemote", + stateClosed: "Closed", +} + +func (st streamState) String() string { + return stateName[st] +} + +// Setting is a setting parameter: which setting it is, and its value. +type Setting struct { + // ID is which setting is being set. + // See https://httpwg.org/specs/rfc7540.html#SettingFormat + ID SettingID + + // Val is the value. + Val uint32 +} + +func (s Setting) String() string { + return fmt.Sprintf("[%v = %d]", s.ID, s.Val) +} + +// Valid reports whether the setting is valid. +func (s Setting) Valid() error { + // Limits and error codes from 6.5.2 Defined SETTINGS Parameters + switch s.ID { + case SettingEnablePush: + if s.Val != 1 && s.Val != 0 { + return ConnectionError(ErrCodeProtocol) + } + case SettingInitialWindowSize: + if s.Val > 1<<31-1 { + return ConnectionError(ErrCodeFlowControl) + } + case SettingMaxFrameSize: + if s.Val < 16384 || s.Val > 1<<24-1 { + return ConnectionError(ErrCodeProtocol) + } + case SettingEnableConnectProtocol: + if s.Val != 1 && s.Val != 0 { + return ConnectionError(ErrCodeProtocol) + } + } + return nil +} + +// A SettingID is an HTTP/2 setting as defined in +// https://httpwg.org/specs/rfc7540.html#iana-settings +type SettingID uint16 + +const ( + SettingHeaderTableSize SettingID = 0x1 + SettingEnablePush SettingID = 0x2 + SettingMaxConcurrentStreams SettingID = 0x3 + SettingInitialWindowSize SettingID = 0x4 + SettingMaxFrameSize SettingID = 0x5 + SettingMaxHeaderListSize SettingID = 0x6 + SettingEnableConnectProtocol SettingID = 0x8 +) + +var settingName = map[SettingID]string{ + SettingHeaderTableSize: "HEADER_TABLE_SIZE", + SettingEnablePush: "ENABLE_PUSH", + SettingMaxConcurrentStreams: "MAX_CONCURRENT_STREAMS", + SettingInitialWindowSize: "INITIAL_WINDOW_SIZE", + SettingMaxFrameSize: "MAX_FRAME_SIZE", + SettingMaxHeaderListSize: "MAX_HEADER_LIST_SIZE", + SettingEnableConnectProtocol: "ENABLE_CONNECT_PROTOCOL", +} + +func (s SettingID) String() string { + if v, ok := settingName[s]; ok { + return v + } + return fmt.Sprintf("UNKNOWN_SETTING_%d", uint16(s)) +} + +// validWireHeaderFieldName reports whether v is a valid header field +// name (key). See httpguts.ValidHeaderName for the base rules. +// +// Further, http2 says: +// +// "Just as in HTTP/1.x, header field names are strings of ASCII +// characters that are compared in a case-insensitive +// fashion. However, header field names MUST be converted to +// lowercase prior to their encoding in HTTP/2. " +func validWireHeaderFieldName(v string) bool { + if len(v) == 0 { + return false + } + for _, r := range v { + if !httpguts.IsTokenRune(r) { + return false + } + if 'A' <= r && r <= 'Z' { + return false + } + } + return true +} + +func httpCodeString(code int) string { + switch code { + case 200: + return "200" + case 404: + return "404" + } + return strconv.Itoa(code) +} + +// from pkg io +type stringWriter interface { + WriteString(s string) (n int, err error) +} + +// A closeWaiter is like a sync.WaitGroup but only goes 1 to 0 (open to closed). +type closeWaiter chan struct{} + +// Init makes a closeWaiter usable. +// It exists because so a closeWaiter value can be placed inside a +// larger struct and have the Mutex and Cond's memory in the same +// allocation. +func (cw *closeWaiter) Init() { + *cw = make(chan struct{}) +} + +// Close marks the closeWaiter as closed and unblocks any waiters. +func (cw closeWaiter) Close() { + close(cw) +} + +// Wait waits for the closeWaiter to become closed. +func (cw closeWaiter) Wait() { + <-cw +} + +// bufferedWriter is a buffered writer that writes to w. +// Its buffered writer is lazily allocated as needed, to minimize +// idle memory usage with many connections. +type bufferedWriter struct { + _ incomparable + group synctestGroupInterface // immutable + conn net.Conn // immutable + bw *bufio.Writer // non-nil when data is buffered + byteTimeout time.Duration // immutable, WriteByteTimeout +} + +func newBufferedWriter(group synctestGroupInterface, conn net.Conn, timeout time.Duration) *bufferedWriter { + return &bufferedWriter{ + group: group, + conn: conn, + byteTimeout: timeout, + } +} + +// bufWriterPoolBufferSize is the size of bufio.Writer's +// buffers created using bufWriterPool. +// +// TODO: pick a less arbitrary value? this is a bit under +// (3 x typical 1500 byte MTU) at least. Other than that, +// not much thought went into it. +const bufWriterPoolBufferSize = 4 << 10 + +var bufWriterPool = sync.Pool{ + New: func() interface{} { + return bufio.NewWriterSize(nil, bufWriterPoolBufferSize) + }, +} + +func (w *bufferedWriter) Available() int { + if w.bw == nil { + return bufWriterPoolBufferSize + } + return w.bw.Available() +} + +func (w *bufferedWriter) Write(p []byte) (n int, err error) { + if w.bw == nil { + bw := bufWriterPool.Get().(*bufio.Writer) + bw.Reset((*bufferedWriterTimeoutWriter)(w)) + w.bw = bw + } + return w.bw.Write(p) +} + +func (w *bufferedWriter) Flush() error { + bw := w.bw + if bw == nil { + return nil + } + err := bw.Flush() + bw.Reset(nil) + bufWriterPool.Put(bw) + w.bw = nil + return err +} + +type bufferedWriterTimeoutWriter bufferedWriter + +func (w *bufferedWriterTimeoutWriter) Write(p []byte) (n int, err error) { + return writeWithByteTimeout(w.group, w.conn, w.byteTimeout, p) +} + +// writeWithByteTimeout writes to conn. +// If more than timeout passes without any bytes being written to the connection, +// the write fails. +func writeWithByteTimeout(group synctestGroupInterface, conn net.Conn, timeout time.Duration, p []byte) (n int, err error) { + if timeout <= 0 { + return conn.Write(p) + } + for { + var now time.Time + if group == nil { + now = time.Now() + } else { + now = group.Now() + } + conn.SetWriteDeadline(now.Add(timeout)) + nn, err := conn.Write(p[n:]) + n += nn + if n == len(p) || nn == 0 || !errors.Is(err, os.ErrDeadlineExceeded) { + // Either we finished the write, made no progress, or hit the deadline. + // Whichever it is, we're done now. + conn.SetWriteDeadline(time.Time{}) + return n, err + } + } +} + +func mustUint31(v int32) uint32 { + if v < 0 || v > 2147483647 { + panic("out of range") + } + return uint32(v) +} + +// bodyAllowedForStatus reports whether a given response status code +// permits a body. See RFC 7230, section 3.3. +func bodyAllowedForStatus(status int) bool { + switch { + case status >= 100 && status <= 199: + return false + case status == 204: + return false + case status == 304: + return false + } + return true +} + +type httpError struct { + _ incomparable + msg string + timeout bool +} + +func (e *httpError) Error() string { return e.msg } +func (e *httpError) Timeout() bool { return e.timeout } +func (e *httpError) Temporary() bool { return true } + +var errTimeout error = &httpError{msg: "http2: timeout awaiting response headers", timeout: true} + +type connectionStater interface { + ConnectionState() tls.ConnectionState +} + +var sorterPool = sync.Pool{New: func() interface{} { return new(sorter) }} + +type sorter struct { + v []string // owned by sorter +} + +func (s *sorter) Len() int { return len(s.v) } +func (s *sorter) Swap(i, j int) { s.v[i], s.v[j] = s.v[j], s.v[i] } +func (s *sorter) Less(i, j int) bool { return s.v[i] < s.v[j] } + +// Keys returns the sorted keys of h. +// +// The returned slice is only valid until s used again or returned to +// its pool. +func (s *sorter) Keys(h http.Header) []string { + keys := s.v[:0] + for k := range h { + keys = append(keys, k) + } + s.v = keys + sort.Sort(s) + return keys +} + +func (s *sorter) SortStrings(ss []string) { + // Our sorter works on s.v, which sorter owns, so + // stash it away while we sort the user's buffer. + save := s.v + s.v = ss + sort.Sort(s) + s.v = save +} + +// incomparable is a zero-width, non-comparable type. Adding it to a struct +// makes that struct also non-comparable, and generally doesn't add +// any size (as long as it's first). +type incomparable [0]func() + +// synctestGroupInterface is the methods of synctestGroup used by Server and Transport. +// It's defined as an interface here to let us keep synctestGroup entirely test-only +// and not a part of non-test builds. +type synctestGroupInterface interface { + Join() + Now() time.Time + NewTimer(d time.Duration) timer + AfterFunc(d time.Duration, f func()) timer + ContextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) +} diff --git a/vendor/golang.org/x/net/http2/pipe.go b/vendor/golang.org/x/net/http2/pipe.go new file mode 100644 index 0000000..3b9f06b --- /dev/null +++ b/vendor/golang.org/x/net/http2/pipe.go @@ -0,0 +1,184 @@ +// Copyright 2014 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 http2 + +import ( + "errors" + "io" + "sync" +) + +// pipe is a goroutine-safe io.Reader/io.Writer pair. It's like +// io.Pipe except there are no PipeReader/PipeWriter halves, and the +// underlying buffer is an interface. (io.Pipe is always unbuffered) +type pipe struct { + mu sync.Mutex + c sync.Cond // c.L lazily initialized to &p.mu + b pipeBuffer // nil when done reading + unread int // bytes unread when done + err error // read error once empty. non-nil means closed. + breakErr error // immediate read error (caller doesn't see rest of b) + donec chan struct{} // closed on error + readFn func() // optional code to run in Read before error +} + +type pipeBuffer interface { + Len() int + io.Writer + io.Reader +} + +// setBuffer initializes the pipe buffer. +// It has no effect if the pipe is already closed. +func (p *pipe) setBuffer(b pipeBuffer) { + p.mu.Lock() + defer p.mu.Unlock() + if p.err != nil || p.breakErr != nil { + return + } + p.b = b +} + +func (p *pipe) Len() int { + p.mu.Lock() + defer p.mu.Unlock() + if p.b == nil { + return p.unread + } + return p.b.Len() +} + +// Read waits until data is available and copies bytes +// from the buffer into p. +func (p *pipe) Read(d []byte) (n int, err error) { + p.mu.Lock() + defer p.mu.Unlock() + if p.c.L == nil { + p.c.L = &p.mu + } + for { + if p.breakErr != nil { + return 0, p.breakErr + } + if p.b != nil && p.b.Len() > 0 { + return p.b.Read(d) + } + if p.err != nil { + if p.readFn != nil { + p.readFn() // e.g. copy trailers + p.readFn = nil // not sticky like p.err + } + p.b = nil + return 0, p.err + } + p.c.Wait() + } +} + +var ( + errClosedPipeWrite = errors.New("write on closed buffer") + errUninitializedPipeWrite = errors.New("write on uninitialized buffer") +) + +// Write copies bytes from p into the buffer and wakes a reader. +// It is an error to write more data than the buffer can hold. +func (p *pipe) Write(d []byte) (n int, err error) { + p.mu.Lock() + defer p.mu.Unlock() + if p.c.L == nil { + p.c.L = &p.mu + } + defer p.c.Signal() + if p.err != nil || p.breakErr != nil { + return 0, errClosedPipeWrite + } + // pipe.setBuffer is never invoked, leaving the buffer uninitialized. + // We shouldn't try to write to an uninitialized pipe, + // but returning an error is better than panicking. + if p.b == nil { + return 0, errUninitializedPipeWrite + } + return p.b.Write(d) +} + +// CloseWithError causes the next Read (waking up a current blocked +// Read if needed) to return the provided err after all data has been +// read. +// +// The error must be non-nil. +func (p *pipe) CloseWithError(err error) { p.closeWithError(&p.err, err, nil) } + +// BreakWithError causes the next Read (waking up a current blocked +// Read if needed) to return the provided err immediately, without +// waiting for unread data. +func (p *pipe) BreakWithError(err error) { p.closeWithError(&p.breakErr, err, nil) } + +// closeWithErrorAndCode is like CloseWithError but also sets some code to run +// in the caller's goroutine before returning the error. +func (p *pipe) closeWithErrorAndCode(err error, fn func()) { p.closeWithError(&p.err, err, fn) } + +func (p *pipe) closeWithError(dst *error, err error, fn func()) { + if err == nil { + panic("err must be non-nil") + } + p.mu.Lock() + defer p.mu.Unlock() + if p.c.L == nil { + p.c.L = &p.mu + } + defer p.c.Signal() + if *dst != nil { + // Already been done. + return + } + p.readFn = fn + if dst == &p.breakErr { + if p.b != nil { + p.unread += p.b.Len() + } + p.b = nil + } + *dst = err + p.closeDoneLocked() +} + +// requires p.mu be held. +func (p *pipe) closeDoneLocked() { + if p.donec == nil { + return + } + // Close if unclosed. This isn't racy since we always + // hold p.mu while closing. + select { + case <-p.donec: + default: + close(p.donec) + } +} + +// Err returns the error (if any) first set by BreakWithError or CloseWithError. +func (p *pipe) Err() error { + p.mu.Lock() + defer p.mu.Unlock() + if p.breakErr != nil { + return p.breakErr + } + return p.err +} + +// Done returns a channel which is closed if and when this pipe is closed +// with CloseWithError. +func (p *pipe) Done() <-chan struct{} { + p.mu.Lock() + defer p.mu.Unlock() + if p.donec == nil { + p.donec = make(chan struct{}) + if p.err != nil || p.breakErr != nil { + // Already hit an error. + p.closeDoneLocked() + } + } + return p.donec +} diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go new file mode 100644 index 0000000..51fca38 --- /dev/null +++ b/vendor/golang.org/x/net/http2/server.go @@ -0,0 +1,3350 @@ +// Copyright 2014 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. + +// TODO: turn off the serve goroutine when idle, so +// an idle conn only has the readFrames goroutine active. (which could +// also be optimized probably to pin less memory in crypto/tls). This +// would involve tracking when the serve goroutine is active (atomic +// int32 read/CAS probably?) and starting it up when frames arrive, +// and shutting it down when all handlers exit. the occasional PING +// packets could use time.AfterFunc to call sc.wakeStartServeLoop() +// (which is a no-op if already running) and then queue the PING write +// as normal. The serve loop would then exit in most cases (if no +// Handlers running) and not be woken up again until the PING packet +// returns. + +// TODO (maybe): add a mechanism for Handlers to going into +// half-closed-local mode (rw.(io.Closer) test?) but not exit their +// handler, and continue to be able to read from the +// Request.Body. This would be a somewhat semantic change from HTTP/1 +// (or at least what we expose in net/http), so I'd probably want to +// add it there too. For now, this package says that returning from +// the Handler ServeHTTP function means you're both done reading and +// done writing, without a way to stop just one or the other. + +package http2 + +import ( + "bufio" + "bytes" + "context" + "crypto/rand" + "crypto/tls" + "errors" + "fmt" + "io" + "log" + "math" + "net" + "net/http" + "net/textproto" + "net/url" + "os" + "reflect" + "runtime" + "strconv" + "strings" + "sync" + "time" + + "golang.org/x/net/http/httpguts" + "golang.org/x/net/http2/hpack" + "golang.org/x/net/internal/httpcommon" +) + +const ( + prefaceTimeout = 10 * time.Second + firstSettingsTimeout = 2 * time.Second // should be in-flight with preface anyway + handlerChunkWriteSize = 4 << 10 + defaultMaxStreams = 250 // TODO: make this 100 as the GFE seems to? + + // maxQueuedControlFrames is the maximum number of control frames like + // SETTINGS, PING and RST_STREAM that will be queued for writing before + // the connection is closed to prevent memory exhaustion attacks. + maxQueuedControlFrames = 10000 +) + +var ( + errClientDisconnected = errors.New("client disconnected") + errClosedBody = errors.New("body closed by handler") + errHandlerComplete = errors.New("http2: request body closed due to handler exiting") + errStreamClosed = errors.New("http2: stream closed") +) + +var responseWriterStatePool = sync.Pool{ + New: func() interface{} { + rws := &responseWriterState{} + rws.bw = bufio.NewWriterSize(chunkWriter{rws}, handlerChunkWriteSize) + return rws + }, +} + +// Test hooks. +var ( + testHookOnConn func() + testHookGetServerConn func(*serverConn) + testHookOnPanicMu *sync.Mutex // nil except in tests + testHookOnPanic func(sc *serverConn, panicVal interface{}) (rePanic bool) +) + +// Server is an HTTP/2 server. +type Server struct { + // MaxHandlers limits the number of http.Handler ServeHTTP goroutines + // which may run at a time over all connections. + // Negative or zero no limit. + // TODO: implement + MaxHandlers int + + // MaxConcurrentStreams optionally specifies the number of + // concurrent streams that each client may have open at a + // time. This is unrelated to the number of http.Handler goroutines + // which may be active globally, which is MaxHandlers. + // If zero, MaxConcurrentStreams defaults to at least 100, per + // the HTTP/2 spec's recommendations. + MaxConcurrentStreams uint32 + + // MaxDecoderHeaderTableSize optionally specifies the http2 + // SETTINGS_HEADER_TABLE_SIZE to send in the initial settings frame. It + // informs the remote endpoint of the maximum size of the header compression + // table used to decode header blocks, in octets. If zero, the default value + // of 4096 is used. + MaxDecoderHeaderTableSize uint32 + + // MaxEncoderHeaderTableSize optionally specifies an upper limit for the + // header compression table used for encoding request headers. Received + // SETTINGS_HEADER_TABLE_SIZE settings are capped at this limit. If zero, + // the default value of 4096 is used. + MaxEncoderHeaderTableSize uint32 + + // MaxReadFrameSize optionally specifies the largest frame + // this server is willing to read. A valid value is between + // 16k and 16M, inclusive. If zero or otherwise invalid, a + // default value is used. + MaxReadFrameSize uint32 + + // PermitProhibitedCipherSuites, if true, permits the use of + // cipher suites prohibited by the HTTP/2 spec. + PermitProhibitedCipherSuites bool + + // IdleTimeout specifies how long until idle clients should be + // closed with a GOAWAY frame. PING frames are not considered + // activity for the purposes of IdleTimeout. + // If zero or negative, there is no timeout. + IdleTimeout time.Duration + + // ReadIdleTimeout is the timeout after which a health check using a ping + // frame will be carried out if no frame is received on the connection. + // If zero, no health check is performed. + ReadIdleTimeout time.Duration + + // PingTimeout is the timeout after which the connection will be closed + // if a response to a ping is not received. + // If zero, a default of 15 seconds is used. + PingTimeout time.Duration + + // WriteByteTimeout is the timeout after which a connection will be + // closed if no data can be written to it. The timeout begins when data is + // available to write, and is extended whenever any bytes are written. + // If zero or negative, there is no timeout. + WriteByteTimeout time.Duration + + // MaxUploadBufferPerConnection is the size of the initial flow + // control window for each connections. The HTTP/2 spec does not + // allow this to be smaller than 65535 or larger than 2^32-1. + // If the value is outside this range, a default value will be + // used instead. + MaxUploadBufferPerConnection int32 + + // MaxUploadBufferPerStream is the size of the initial flow control + // window for each stream. The HTTP/2 spec does not allow this to + // be larger than 2^32-1. If the value is zero or larger than the + // maximum, a default value will be used instead. + MaxUploadBufferPerStream int32 + + // NewWriteScheduler constructs a write scheduler for a connection. + // If nil, a default scheduler is chosen. + NewWriteScheduler func() WriteScheduler + + // CountError, if non-nil, is called on HTTP/2 server errors. + // It's intended to increment a metric for monitoring, such + // as an expvar or Prometheus metric. + // The errType consists of only ASCII word characters. + CountError func(errType string) + + // Internal state. This is a pointer (rather than embedded directly) + // so that we don't embed a Mutex in this struct, which will make the + // struct non-copyable, which might break some callers. + state *serverInternalState + + // Synchronization group used for testing. + // Outside of tests, this is nil. + group synctestGroupInterface +} + +func (s *Server) markNewGoroutine() { + if s.group != nil { + s.group.Join() + } +} + +func (s *Server) now() time.Time { + if s.group != nil { + return s.group.Now() + } + return time.Now() +} + +// newTimer creates a new time.Timer, or a synthetic timer in tests. +func (s *Server) newTimer(d time.Duration) timer { + if s.group != nil { + return s.group.NewTimer(d) + } + return timeTimer{time.NewTimer(d)} +} + +// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests. +func (s *Server) afterFunc(d time.Duration, f func()) timer { + if s.group != nil { + return s.group.AfterFunc(d, f) + } + return timeTimer{time.AfterFunc(d, f)} +} + +type serverInternalState struct { + mu sync.Mutex + activeConns map[*serverConn]struct{} +} + +func (s *serverInternalState) registerConn(sc *serverConn) { + if s == nil { + return // if the Server was used without calling ConfigureServer + } + s.mu.Lock() + s.activeConns[sc] = struct{}{} + s.mu.Unlock() +} + +func (s *serverInternalState) unregisterConn(sc *serverConn) { + if s == nil { + return // if the Server was used without calling ConfigureServer + } + s.mu.Lock() + delete(s.activeConns, sc) + s.mu.Unlock() +} + +func (s *serverInternalState) startGracefulShutdown() { + if s == nil { + return // if the Server was used without calling ConfigureServer + } + s.mu.Lock() + for sc := range s.activeConns { + sc.startGracefulShutdown() + } + s.mu.Unlock() +} + +// ConfigureServer adds HTTP/2 support to a net/http Server. +// +// The configuration conf may be nil. +// +// ConfigureServer must be called before s begins serving. +func ConfigureServer(s *http.Server, conf *Server) error { + if s == nil { + panic("nil *http.Server") + } + if conf == nil { + conf = new(Server) + } + conf.state = &serverInternalState{activeConns: make(map[*serverConn]struct{})} + if h1, h2 := s, conf; h2.IdleTimeout == 0 { + if h1.IdleTimeout != 0 { + h2.IdleTimeout = h1.IdleTimeout + } else { + h2.IdleTimeout = h1.ReadTimeout + } + } + s.RegisterOnShutdown(conf.state.startGracefulShutdown) + + if s.TLSConfig == nil { + s.TLSConfig = new(tls.Config) + } else if s.TLSConfig.CipherSuites != nil && s.TLSConfig.MinVersion < tls.VersionTLS13 { + // If they already provided a TLS 1.0–1.2 CipherSuite list, return an + // error if it is missing ECDHE_RSA_WITH_AES_128_GCM_SHA256 or + // ECDHE_ECDSA_WITH_AES_128_GCM_SHA256. + haveRequired := false + for _, cs := range s.TLSConfig.CipherSuites { + switch cs { + case tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + // Alternative MTI cipher to not discourage ECDSA-only servers. + // See http://golang.org/cl/30721 for further information. + tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: + haveRequired = true + } + } + if !haveRequired { + return fmt.Errorf("http2: TLSConfig.CipherSuites is missing an HTTP/2-required AES_128_GCM_SHA256 cipher (need at least one of TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 or TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256)") + } + } + + // Note: not setting MinVersion to tls.VersionTLS12, + // as we don't want to interfere with HTTP/1.1 traffic + // on the user's server. We enforce TLS 1.2 later once + // we accept a connection. Ideally this should be done + // during next-proto selection, but using TLS <1.2 with + // HTTP/2 is still the client's bug. + + s.TLSConfig.PreferServerCipherSuites = true + + if !strSliceContains(s.TLSConfig.NextProtos, NextProtoTLS) { + s.TLSConfig.NextProtos = append(s.TLSConfig.NextProtos, NextProtoTLS) + } + if !strSliceContains(s.TLSConfig.NextProtos, "http/1.1") { + s.TLSConfig.NextProtos = append(s.TLSConfig.NextProtos, "http/1.1") + } + + if s.TLSNextProto == nil { + s.TLSNextProto = map[string]func(*http.Server, *tls.Conn, http.Handler){} + } + protoHandler := func(hs *http.Server, c net.Conn, h http.Handler, sawClientPreface bool) { + if testHookOnConn != nil { + testHookOnConn() + } + // The TLSNextProto interface predates contexts, so + // the net/http package passes down its per-connection + // base context via an exported but unadvertised + // method on the Handler. This is for internal + // net/http<=>http2 use only. + var ctx context.Context + type baseContexter interface { + BaseContext() context.Context + } + if bc, ok := h.(baseContexter); ok { + ctx = bc.BaseContext() + } + conf.ServeConn(c, &ServeConnOpts{ + Context: ctx, + Handler: h, + BaseConfig: hs, + SawClientPreface: sawClientPreface, + }) + } + s.TLSNextProto[NextProtoTLS] = func(hs *http.Server, c *tls.Conn, h http.Handler) { + protoHandler(hs, c, h, false) + } + // The "unencrypted_http2" TLSNextProto key is used to pass off non-TLS HTTP/2 conns. + // + // A connection passed in this method has already had the HTTP/2 preface read from it. + s.TLSNextProto[nextProtoUnencryptedHTTP2] = func(hs *http.Server, c *tls.Conn, h http.Handler) { + nc, err := unencryptedNetConnFromTLSConn(c) + if err != nil { + if lg := hs.ErrorLog; lg != nil { + lg.Print(err) + } else { + log.Print(err) + } + go c.Close() + return + } + protoHandler(hs, nc, h, true) + } + return nil +} + +// ServeConnOpts are options for the Server.ServeConn method. +type ServeConnOpts struct { + // Context is the base context to use. + // If nil, context.Background is used. + Context context.Context + + // BaseConfig optionally sets the base configuration + // for values. If nil, defaults are used. + BaseConfig *http.Server + + // Handler specifies which handler to use for processing + // requests. If nil, BaseConfig.Handler is used. If BaseConfig + // or BaseConfig.Handler is nil, http.DefaultServeMux is used. + Handler http.Handler + + // UpgradeRequest is an initial request received on a connection + // undergoing an h2c upgrade. The request body must have been + // completely read from the connection before calling ServeConn, + // and the 101 Switching Protocols response written. + UpgradeRequest *http.Request + + // Settings is the decoded contents of the HTTP2-Settings header + // in an h2c upgrade request. + Settings []byte + + // SawClientPreface is set if the HTTP/2 connection preface + // has already been read from the connection. + SawClientPreface bool +} + +func (o *ServeConnOpts) context() context.Context { + if o != nil && o.Context != nil { + return o.Context + } + return context.Background() +} + +func (o *ServeConnOpts) baseConfig() *http.Server { + if o != nil && o.BaseConfig != nil { + return o.BaseConfig + } + return new(http.Server) +} + +func (o *ServeConnOpts) handler() http.Handler { + if o != nil { + if o.Handler != nil { + return o.Handler + } + if o.BaseConfig != nil && o.BaseConfig.Handler != nil { + return o.BaseConfig.Handler + } + } + return http.DefaultServeMux +} + +// ServeConn serves HTTP/2 requests on the provided connection and +// blocks until the connection is no longer readable. +// +// ServeConn starts speaking HTTP/2 assuming that c has not had any +// reads or writes. It writes its initial settings frame and expects +// to be able to read the preface and settings frame from the +// client. If c has a ConnectionState method like a *tls.Conn, the +// ConnectionState is used to verify the TLS ciphersuite and to set +// the Request.TLS field in Handlers. +// +// ServeConn does not support h2c by itself. Any h2c support must be +// implemented in terms of providing a suitably-behaving net.Conn. +// +// The opts parameter is optional. If nil, default values are used. +func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { + s.serveConn(c, opts, nil) +} + +func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverConn)) { + baseCtx, cancel := serverConnBaseContext(c, opts) + defer cancel() + + http1srv := opts.baseConfig() + conf := configFromServer(http1srv, s) + sc := &serverConn{ + srv: s, + hs: http1srv, + conn: c, + baseCtx: baseCtx, + remoteAddrStr: c.RemoteAddr().String(), + bw: newBufferedWriter(s.group, c, conf.WriteByteTimeout), + handler: opts.handler(), + streams: make(map[uint32]*stream), + readFrameCh: make(chan readFrameResult), + wantWriteFrameCh: make(chan FrameWriteRequest, 8), + serveMsgCh: make(chan interface{}, 8), + wroteFrameCh: make(chan frameWriteResult, 1), // buffered; one send in writeFrameAsync + bodyReadCh: make(chan bodyReadMsg), // buffering doesn't matter either way + doneServing: make(chan struct{}), + clientMaxStreams: math.MaxUint32, // Section 6.5.2: "Initially, there is no limit to this value" + advMaxStreams: conf.MaxConcurrentStreams, + initialStreamSendWindowSize: initialWindowSize, + initialStreamRecvWindowSize: conf.MaxUploadBufferPerStream, + maxFrameSize: initialMaxFrameSize, + pingTimeout: conf.PingTimeout, + countErrorFunc: conf.CountError, + serveG: newGoroutineLock(), + pushEnabled: true, + sawClientPreface: opts.SawClientPreface, + } + if newf != nil { + newf(sc) + } + + s.state.registerConn(sc) + defer s.state.unregisterConn(sc) + + // The net/http package sets the write deadline from the + // http.Server.WriteTimeout during the TLS handshake, but then + // passes the connection off to us with the deadline already set. + // Write deadlines are set per stream in serverConn.newStream. + // Disarm the net.Conn write deadline here. + if sc.hs.WriteTimeout > 0 { + sc.conn.SetWriteDeadline(time.Time{}) + } + + if s.NewWriteScheduler != nil { + sc.writeSched = s.NewWriteScheduler() + } else { + sc.writeSched = newRoundRobinWriteScheduler() + } + + // These start at the RFC-specified defaults. If there is a higher + // configured value for inflow, that will be updated when we send a + // WINDOW_UPDATE shortly after sending SETTINGS. + sc.flow.add(initialWindowSize) + sc.inflow.init(initialWindowSize) + sc.hpackEncoder = hpack.NewEncoder(&sc.headerWriteBuf) + sc.hpackEncoder.SetMaxDynamicTableSizeLimit(conf.MaxEncoderHeaderTableSize) + + fr := NewFramer(sc.bw, c) + if conf.CountError != nil { + fr.countError = conf.CountError + } + fr.ReadMetaHeaders = hpack.NewDecoder(conf.MaxDecoderHeaderTableSize, nil) + fr.MaxHeaderListSize = sc.maxHeaderListSize() + fr.SetMaxReadFrameSize(conf.MaxReadFrameSize) + sc.framer = fr + + if tc, ok := c.(connectionStater); ok { + sc.tlsState = new(tls.ConnectionState) + *sc.tlsState = tc.ConnectionState() + // 9.2 Use of TLS Features + // An implementation of HTTP/2 over TLS MUST use TLS + // 1.2 or higher with the restrictions on feature set + // and cipher suite described in this section. Due to + // implementation limitations, it might not be + // possible to fail TLS negotiation. An endpoint MUST + // immediately terminate an HTTP/2 connection that + // does not meet the TLS requirements described in + // this section with a connection error (Section + // 5.4.1) of type INADEQUATE_SECURITY. + if sc.tlsState.Version < tls.VersionTLS12 { + sc.rejectConn(ErrCodeInadequateSecurity, "TLS version too low") + return + } + + if sc.tlsState.ServerName == "" { + // Client must use SNI, but we don't enforce that anymore, + // since it was causing problems when connecting to bare IP + // addresses during development. + // + // TODO: optionally enforce? Or enforce at the time we receive + // a new request, and verify the ServerName matches the :authority? + // But that precludes proxy situations, perhaps. + // + // So for now, do nothing here again. + } + + if !conf.PermitProhibitedCipherSuites && isBadCipher(sc.tlsState.CipherSuite) { + // "Endpoints MAY choose to generate a connection error + // (Section 5.4.1) of type INADEQUATE_SECURITY if one of + // the prohibited cipher suites are negotiated." + // + // We choose that. In my opinion, the spec is weak + // here. It also says both parties must support at least + // TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 so there's no + // excuses here. If we really must, we could allow an + // "AllowInsecureWeakCiphers" option on the server later. + // Let's see how it plays out first. + sc.rejectConn(ErrCodeInadequateSecurity, fmt.Sprintf("Prohibited TLS 1.2 Cipher Suite: %x", sc.tlsState.CipherSuite)) + return + } + } + + if opts.Settings != nil { + fr := &SettingsFrame{ + FrameHeader: FrameHeader{valid: true}, + p: opts.Settings, + } + if err := fr.ForeachSetting(sc.processSetting); err != nil { + sc.rejectConn(ErrCodeProtocol, "invalid settings") + return + } + opts.Settings = nil + } + + if hook := testHookGetServerConn; hook != nil { + hook(sc) + } + + if opts.UpgradeRequest != nil { + sc.upgradeRequest(opts.UpgradeRequest) + opts.UpgradeRequest = nil + } + + sc.serve(conf) +} + +func serverConnBaseContext(c net.Conn, opts *ServeConnOpts) (ctx context.Context, cancel func()) { + ctx, cancel = context.WithCancel(opts.context()) + ctx = context.WithValue(ctx, http.LocalAddrContextKey, c.LocalAddr()) + if hs := opts.baseConfig(); hs != nil { + ctx = context.WithValue(ctx, http.ServerContextKey, hs) + } + return +} + +func (sc *serverConn) rejectConn(err ErrCode, debug string) { + sc.vlogf("http2: server rejecting conn: %v, %s", err, debug) + // ignoring errors. hanging up anyway. + sc.framer.WriteGoAway(0, err, []byte(debug)) + sc.bw.Flush() + sc.conn.Close() +} + +type serverConn struct { + // Immutable: + srv *Server + hs *http.Server + conn net.Conn + bw *bufferedWriter // writing to conn + handler http.Handler + baseCtx context.Context + framer *Framer + doneServing chan struct{} // closed when serverConn.serve ends + readFrameCh chan readFrameResult // written by serverConn.readFrames + wantWriteFrameCh chan FrameWriteRequest // from handlers -> serve + wroteFrameCh chan frameWriteResult // from writeFrameAsync -> serve, tickles more frame writes + bodyReadCh chan bodyReadMsg // from handlers -> serve + serveMsgCh chan interface{} // misc messages & code to send to / run on the serve loop + flow outflow // conn-wide (not stream-specific) outbound flow control + inflow inflow // conn-wide inbound flow control + tlsState *tls.ConnectionState // shared by all handlers, like net/http + remoteAddrStr string + writeSched WriteScheduler + countErrorFunc func(errType string) + + // Everything following is owned by the serve loop; use serveG.check(): + serveG goroutineLock // used to verify funcs are on serve() + pushEnabled bool + sawClientPreface bool // preface has already been read, used in h2c upgrade + sawFirstSettings bool // got the initial SETTINGS frame after the preface + needToSendSettingsAck bool + unackedSettings int // how many SETTINGS have we sent without ACKs? + queuedControlFrames int // control frames in the writeSched queue + clientMaxStreams uint32 // SETTINGS_MAX_CONCURRENT_STREAMS from client (our PUSH_PROMISE limit) + advMaxStreams uint32 // our SETTINGS_MAX_CONCURRENT_STREAMS advertised the client + curClientStreams uint32 // number of open streams initiated by the client + curPushedStreams uint32 // number of open streams initiated by server push + curHandlers uint32 // number of running handler goroutines + maxClientStreamID uint32 // max ever seen from client (odd), or 0 if there have been no client requests + maxPushPromiseID uint32 // ID of the last push promise (even), or 0 if there have been no pushes + streams map[uint32]*stream + unstartedHandlers []unstartedHandler + initialStreamSendWindowSize int32 + initialStreamRecvWindowSize int32 + maxFrameSize int32 + peerMaxHeaderListSize uint32 // zero means unknown (default) + canonHeader map[string]string // http2-lower-case -> Go-Canonical-Case + canonHeaderKeysSize int // canonHeader keys size in bytes + writingFrame bool // started writing a frame (on serve goroutine or separate) + writingFrameAsync bool // started a frame on its own goroutine but haven't heard back on wroteFrameCh + needsFrameFlush bool // last frame write wasn't a flush + inGoAway bool // we've started to or sent GOAWAY + inFrameScheduleLoop bool // whether we're in the scheduleFrameWrite loop + needToSendGoAway bool // we need to schedule a GOAWAY frame write + pingSent bool + sentPingData [8]byte + goAwayCode ErrCode + shutdownTimer timer // nil until used + idleTimer timer // nil if unused + readIdleTimeout time.Duration + pingTimeout time.Duration + readIdleTimer timer // nil if unused + + // Owned by the writeFrameAsync goroutine: + headerWriteBuf bytes.Buffer + hpackEncoder *hpack.Encoder + + // Used by startGracefulShutdown. + shutdownOnce sync.Once +} + +func (sc *serverConn) maxHeaderListSize() uint32 { + n := sc.hs.MaxHeaderBytes + if n <= 0 { + n = http.DefaultMaxHeaderBytes + } + return uint32(adjustHTTP1MaxHeaderSize(int64(n))) +} + +func (sc *serverConn) curOpenStreams() uint32 { + sc.serveG.check() + return sc.curClientStreams + sc.curPushedStreams +} + +// stream represents a stream. This is the minimal metadata needed by +// the serve goroutine. Most of the actual stream state is owned by +// the http.Handler's goroutine in the responseWriter. Because the +// responseWriter's responseWriterState is recycled at the end of a +// handler, this struct intentionally has no pointer to the +// *responseWriter{,State} itself, as the Handler ending nils out the +// responseWriter's state field. +type stream struct { + // immutable: + sc *serverConn + id uint32 + body *pipe // non-nil if expecting DATA frames + cw closeWaiter // closed wait stream transitions to closed state + ctx context.Context + cancelCtx func() + + // owned by serverConn's serve loop: + bodyBytes int64 // body bytes seen so far + declBodyBytes int64 // or -1 if undeclared + flow outflow // limits writing from Handler to client + inflow inflow // what the client is allowed to POST/etc to us + state streamState + resetQueued bool // RST_STREAM queued for write; set by sc.resetStream + gotTrailerHeader bool // HEADER frame for trailers was seen + wroteHeaders bool // whether we wrote headers (not status 100) + readDeadline timer // nil if unused + writeDeadline timer // nil if unused + closeErr error // set before cw is closed + + trailer http.Header // accumulated trailers + reqTrailer http.Header // handler's Request.Trailer +} + +func (sc *serverConn) Framer() *Framer { return sc.framer } +func (sc *serverConn) CloseConn() error { return sc.conn.Close() } +func (sc *serverConn) Flush() error { return sc.bw.Flush() } +func (sc *serverConn) HeaderEncoder() (*hpack.Encoder, *bytes.Buffer) { + return sc.hpackEncoder, &sc.headerWriteBuf +} + +func (sc *serverConn) state(streamID uint32) (streamState, *stream) { + sc.serveG.check() + // http://tools.ietf.org/html/rfc7540#section-5.1 + if st, ok := sc.streams[streamID]; ok { + return st.state, st + } + // "The first use of a new stream identifier implicitly closes all + // streams in the "idle" state that might have been initiated by + // that peer with a lower-valued stream identifier. For example, if + // a client sends a HEADERS frame on stream 7 without ever sending a + // frame on stream 5, then stream 5 transitions to the "closed" + // state when the first frame for stream 7 is sent or received." + if streamID%2 == 1 { + if streamID <= sc.maxClientStreamID { + return stateClosed, nil + } + } else { + if streamID <= sc.maxPushPromiseID { + return stateClosed, nil + } + } + return stateIdle, nil +} + +// setConnState calls the net/http ConnState hook for this connection, if configured. +// Note that the net/http package does StateNew and StateClosed for us. +// There is currently no plan for StateHijacked or hijacking HTTP/2 connections. +func (sc *serverConn) setConnState(state http.ConnState) { + if sc.hs.ConnState != nil { + sc.hs.ConnState(sc.conn, state) + } +} + +func (sc *serverConn) vlogf(format string, args ...interface{}) { + if VerboseLogs { + sc.logf(format, args...) + } +} + +func (sc *serverConn) logf(format string, args ...interface{}) { + if lg := sc.hs.ErrorLog; lg != nil { + lg.Printf(format, args...) + } else { + log.Printf(format, args...) + } +} + +// errno returns v's underlying uintptr, else 0. +// +// TODO: remove this helper function once http2 can use build +// tags. See comment in isClosedConnError. +func errno(v error) uintptr { + if rv := reflect.ValueOf(v); rv.Kind() == reflect.Uintptr { + return uintptr(rv.Uint()) + } + return 0 +} + +// isClosedConnError reports whether err is an error from use of a closed +// network connection. +func isClosedConnError(err error) bool { + if err == nil { + return false + } + + if errors.Is(err, net.ErrClosed) { + return true + } + + // TODO(bradfitz): x/tools/cmd/bundle doesn't really support + // build tags, so I can't make an http2_windows.go file with + // Windows-specific stuff. Fix that and move this, once we + // have a way to bundle this into std's net/http somehow. + if runtime.GOOS == "windows" { + if oe, ok := err.(*net.OpError); ok && oe.Op == "read" { + if se, ok := oe.Err.(*os.SyscallError); ok && se.Syscall == "wsarecv" { + const WSAECONNABORTED = 10053 + const WSAECONNRESET = 10054 + if n := errno(se.Err); n == WSAECONNRESET || n == WSAECONNABORTED { + return true + } + } + } + } + return false +} + +func (sc *serverConn) condlogf(err error, format string, args ...interface{}) { + if err == nil { + return + } + if err == io.EOF || err == io.ErrUnexpectedEOF || isClosedConnError(err) || err == errPrefaceTimeout { + // Boring, expected errors. + sc.vlogf(format, args...) + } else { + sc.logf(format, args...) + } +} + +// maxCachedCanonicalHeadersKeysSize is an arbitrarily-chosen limit on the size +// of the entries in the canonHeader cache. +// This should be larger than the size of unique, uncommon header keys likely to +// be sent by the peer, while not so high as to permit unreasonable memory usage +// if the peer sends an unbounded number of unique header keys. +const maxCachedCanonicalHeadersKeysSize = 2048 + +func (sc *serverConn) canonicalHeader(v string) string { + sc.serveG.check() + cv, ok := httpcommon.CachedCanonicalHeader(v) + if ok { + return cv + } + cv, ok = sc.canonHeader[v] + if ok { + return cv + } + if sc.canonHeader == nil { + sc.canonHeader = make(map[string]string) + } + cv = http.CanonicalHeaderKey(v) + size := 100 + len(v)*2 // 100 bytes of map overhead + key + value + if sc.canonHeaderKeysSize+size <= maxCachedCanonicalHeadersKeysSize { + sc.canonHeader[v] = cv + sc.canonHeaderKeysSize += size + } + return cv +} + +type readFrameResult struct { + f Frame // valid until readMore is called + err error + + // readMore should be called once the consumer no longer needs or + // retains f. After readMore, f is invalid and more frames can be + // read. + readMore func() +} + +// readFrames is the loop that reads incoming frames. +// It takes care to only read one frame at a time, blocking until the +// consumer is done with the frame. +// It's run on its own goroutine. +func (sc *serverConn) readFrames() { + sc.srv.markNewGoroutine() + gate := make(chan struct{}) + gateDone := func() { gate <- struct{}{} } + for { + f, err := sc.framer.ReadFrame() + select { + case sc.readFrameCh <- readFrameResult{f, err, gateDone}: + case <-sc.doneServing: + return + } + select { + case <-gate: + case <-sc.doneServing: + return + } + if terminalReadFrameError(err) { + return + } + } +} + +// frameWriteResult is the message passed from writeFrameAsync to the serve goroutine. +type frameWriteResult struct { + _ incomparable + wr FrameWriteRequest // what was written (or attempted) + err error // result of the writeFrame call +} + +// writeFrameAsync runs in its own goroutine and writes a single frame +// and then reports when it's done. +// At most one goroutine can be running writeFrameAsync at a time per +// serverConn. +func (sc *serverConn) writeFrameAsync(wr FrameWriteRequest, wd *writeData) { + sc.srv.markNewGoroutine() + var err error + if wd == nil { + err = wr.write.writeFrame(sc) + } else { + err = sc.framer.endWrite() + } + sc.wroteFrameCh <- frameWriteResult{wr: wr, err: err} +} + +func (sc *serverConn) closeAllStreamsOnConnClose() { + sc.serveG.check() + for _, st := range sc.streams { + sc.closeStream(st, errClientDisconnected) + } +} + +func (sc *serverConn) stopShutdownTimer() { + sc.serveG.check() + if t := sc.shutdownTimer; t != nil { + t.Stop() + } +} + +func (sc *serverConn) notePanic() { + // Note: this is for serverConn.serve panicking, not http.Handler code. + if testHookOnPanicMu != nil { + testHookOnPanicMu.Lock() + defer testHookOnPanicMu.Unlock() + } + if testHookOnPanic != nil { + if e := recover(); e != nil { + if testHookOnPanic(sc, e) { + panic(e) + } + } + } +} + +func (sc *serverConn) serve(conf http2Config) { + sc.serveG.check() + defer sc.notePanic() + defer sc.conn.Close() + defer sc.closeAllStreamsOnConnClose() + defer sc.stopShutdownTimer() + defer close(sc.doneServing) // unblocks handlers trying to send + + if VerboseLogs { + sc.vlogf("http2: server connection from %v on %p", sc.conn.RemoteAddr(), sc.hs) + } + + settings := writeSettings{ + {SettingMaxFrameSize, conf.MaxReadFrameSize}, + {SettingMaxConcurrentStreams, sc.advMaxStreams}, + {SettingMaxHeaderListSize, sc.maxHeaderListSize()}, + {SettingHeaderTableSize, conf.MaxDecoderHeaderTableSize}, + {SettingInitialWindowSize, uint32(sc.initialStreamRecvWindowSize)}, + } + if !disableExtendedConnectProtocol { + settings = append(settings, Setting{SettingEnableConnectProtocol, 1}) + } + sc.writeFrame(FrameWriteRequest{ + write: settings, + }) + sc.unackedSettings++ + + // Each connection starts with initialWindowSize inflow tokens. + // If a higher value is configured, we add more tokens. + if diff := conf.MaxUploadBufferPerConnection - initialWindowSize; diff > 0 { + sc.sendWindowUpdate(nil, int(diff)) + } + + if err := sc.readPreface(); err != nil { + sc.condlogf(err, "http2: server: error reading preface from client %v: %v", sc.conn.RemoteAddr(), err) + return + } + // Now that we've got the preface, get us out of the + // "StateNew" state. We can't go directly to idle, though. + // Active means we read some data and anticipate a request. We'll + // do another Active when we get a HEADERS frame. + sc.setConnState(http.StateActive) + sc.setConnState(http.StateIdle) + + if sc.srv.IdleTimeout > 0 { + sc.idleTimer = sc.srv.afterFunc(sc.srv.IdleTimeout, sc.onIdleTimer) + defer sc.idleTimer.Stop() + } + + if conf.SendPingTimeout > 0 { + sc.readIdleTimeout = conf.SendPingTimeout + sc.readIdleTimer = sc.srv.afterFunc(conf.SendPingTimeout, sc.onReadIdleTimer) + defer sc.readIdleTimer.Stop() + } + + go sc.readFrames() // closed by defer sc.conn.Close above + + settingsTimer := sc.srv.afterFunc(firstSettingsTimeout, sc.onSettingsTimer) + defer settingsTimer.Stop() + + lastFrameTime := sc.srv.now() + loopNum := 0 + for { + loopNum++ + select { + case wr := <-sc.wantWriteFrameCh: + if se, ok := wr.write.(StreamError); ok { + sc.resetStream(se) + break + } + sc.writeFrame(wr) + case res := <-sc.wroteFrameCh: + sc.wroteFrame(res) + case res := <-sc.readFrameCh: + lastFrameTime = sc.srv.now() + // Process any written frames before reading new frames from the client since a + // written frame could have triggered a new stream to be started. + if sc.writingFrameAsync { + select { + case wroteRes := <-sc.wroteFrameCh: + sc.wroteFrame(wroteRes) + default: + } + } + if !sc.processFrameFromReader(res) { + return + } + res.readMore() + if settingsTimer != nil { + settingsTimer.Stop() + settingsTimer = nil + } + case m := <-sc.bodyReadCh: + sc.noteBodyRead(m.st, m.n) + case msg := <-sc.serveMsgCh: + switch v := msg.(type) { + case func(int): + v(loopNum) // for testing + case *serverMessage: + switch v { + case settingsTimerMsg: + sc.logf("timeout waiting for SETTINGS frames from %v", sc.conn.RemoteAddr()) + return + case idleTimerMsg: + sc.vlogf("connection is idle") + sc.goAway(ErrCodeNo) + case readIdleTimerMsg: + sc.handlePingTimer(lastFrameTime) + case shutdownTimerMsg: + sc.vlogf("GOAWAY close timer fired; closing conn from %v", sc.conn.RemoteAddr()) + return + case gracefulShutdownMsg: + sc.startGracefulShutdownInternal() + case handlerDoneMsg: + sc.handlerDone() + default: + panic("unknown timer") + } + case *startPushRequest: + sc.startPush(v) + case func(*serverConn): + v(sc) + default: + panic(fmt.Sprintf("unexpected type %T", v)) + } + } + + // If the peer is causing us to generate a lot of control frames, + // but not reading them from us, assume they are trying to make us + // run out of memory. + if sc.queuedControlFrames > maxQueuedControlFrames { + sc.vlogf("http2: too many control frames in send queue, closing connection") + return + } + + // Start the shutdown timer after sending a GOAWAY. When sending GOAWAY + // with no error code (graceful shutdown), don't start the timer until + // all open streams have been completed. + sentGoAway := sc.inGoAway && !sc.needToSendGoAway && !sc.writingFrame + gracefulShutdownComplete := sc.goAwayCode == ErrCodeNo && sc.curOpenStreams() == 0 + if sentGoAway && sc.shutdownTimer == nil && (sc.goAwayCode != ErrCodeNo || gracefulShutdownComplete) { + sc.shutDownIn(goAwayTimeout) + } + } +} + +func (sc *serverConn) handlePingTimer(lastFrameReadTime time.Time) { + if sc.pingSent { + sc.logf("timeout waiting for PING response") + if f := sc.countErrorFunc; f != nil { + f("conn_close_lost_ping") + } + sc.conn.Close() + return + } + + pingAt := lastFrameReadTime.Add(sc.readIdleTimeout) + now := sc.srv.now() + if pingAt.After(now) { + // We received frames since arming the ping timer. + // Reset it for the next possible timeout. + sc.readIdleTimer.Reset(pingAt.Sub(now)) + return + } + + sc.pingSent = true + // Ignore crypto/rand.Read errors: It generally can't fail, and worse case if it does + // is we send a PING frame containing 0s. + _, _ = rand.Read(sc.sentPingData[:]) + sc.writeFrame(FrameWriteRequest{ + write: &writePing{data: sc.sentPingData}, + }) + sc.readIdleTimer.Reset(sc.pingTimeout) +} + +type serverMessage int + +// Message values sent to serveMsgCh. +var ( + settingsTimerMsg = new(serverMessage) + idleTimerMsg = new(serverMessage) + readIdleTimerMsg = new(serverMessage) + shutdownTimerMsg = new(serverMessage) + gracefulShutdownMsg = new(serverMessage) + handlerDoneMsg = new(serverMessage) +) + +func (sc *serverConn) onSettingsTimer() { sc.sendServeMsg(settingsTimerMsg) } +func (sc *serverConn) onIdleTimer() { sc.sendServeMsg(idleTimerMsg) } +func (sc *serverConn) onReadIdleTimer() { sc.sendServeMsg(readIdleTimerMsg) } +func (sc *serverConn) onShutdownTimer() { sc.sendServeMsg(shutdownTimerMsg) } + +func (sc *serverConn) sendServeMsg(msg interface{}) { + sc.serveG.checkNotOn() // NOT + select { + case sc.serveMsgCh <- msg: + case <-sc.doneServing: + } +} + +var errPrefaceTimeout = errors.New("timeout waiting for client preface") + +// readPreface reads the ClientPreface greeting from the peer or +// returns errPrefaceTimeout on timeout, or an error if the greeting +// is invalid. +func (sc *serverConn) readPreface() error { + if sc.sawClientPreface { + return nil + } + errc := make(chan error, 1) + go func() { + // Read the client preface + buf := make([]byte, len(ClientPreface)) + if _, err := io.ReadFull(sc.conn, buf); err != nil { + errc <- err + } else if !bytes.Equal(buf, clientPreface) { + errc <- fmt.Errorf("bogus greeting %q", buf) + } else { + errc <- nil + } + }() + timer := sc.srv.newTimer(prefaceTimeout) // TODO: configurable on *Server? + defer timer.Stop() + select { + case <-timer.C(): + return errPrefaceTimeout + case err := <-errc: + if err == nil { + if VerboseLogs { + sc.vlogf("http2: server: client %v said hello", sc.conn.RemoteAddr()) + } + } + return err + } +} + +var errChanPool = sync.Pool{ + New: func() interface{} { return make(chan error, 1) }, +} + +var writeDataPool = sync.Pool{ + New: func() interface{} { return new(writeData) }, +} + +// writeDataFromHandler writes DATA response frames from a handler on +// the given stream. +func (sc *serverConn) writeDataFromHandler(stream *stream, data []byte, endStream bool) error { + ch := errChanPool.Get().(chan error) + writeArg := writeDataPool.Get().(*writeData) + *writeArg = writeData{stream.id, data, endStream} + err := sc.writeFrameFromHandler(FrameWriteRequest{ + write: writeArg, + stream: stream, + done: ch, + }) + if err != nil { + return err + } + var frameWriteDone bool // the frame write is done (successfully or not) + select { + case err = <-ch: + frameWriteDone = true + case <-sc.doneServing: + return errClientDisconnected + case <-stream.cw: + // If both ch and stream.cw were ready (as might + // happen on the final Write after an http.Handler + // ends), prefer the write result. Otherwise this + // might just be us successfully closing the stream. + // The writeFrameAsync and serve goroutines guarantee + // that the ch send will happen before the stream.cw + // close. + select { + case err = <-ch: + frameWriteDone = true + default: + return errStreamClosed + } + } + errChanPool.Put(ch) + if frameWriteDone { + writeDataPool.Put(writeArg) + } + return err +} + +// writeFrameFromHandler sends wr to sc.wantWriteFrameCh, but aborts +// if the connection has gone away. +// +// This must not be run from the serve goroutine itself, else it might +// deadlock writing to sc.wantWriteFrameCh (which is only mildly +// buffered and is read by serve itself). If you're on the serve +// goroutine, call writeFrame instead. +func (sc *serverConn) writeFrameFromHandler(wr FrameWriteRequest) error { + sc.serveG.checkNotOn() // NOT + select { + case sc.wantWriteFrameCh <- wr: + return nil + case <-sc.doneServing: + // Serve loop is gone. + // Client has closed their connection to the server. + return errClientDisconnected + } +} + +// writeFrame schedules a frame to write and sends it if there's nothing +// already being written. +// +// There is no pushback here (the serve goroutine never blocks). It's +// the http.Handlers that block, waiting for their previous frames to +// make it onto the wire +// +// If you're not on the serve goroutine, use writeFrameFromHandler instead. +func (sc *serverConn) writeFrame(wr FrameWriteRequest) { + sc.serveG.check() + + // If true, wr will not be written and wr.done will not be signaled. + var ignoreWrite bool + + // We are not allowed to write frames on closed streams. RFC 7540 Section + // 5.1.1 says: "An endpoint MUST NOT send frames other than PRIORITY on + // a closed stream." Our server never sends PRIORITY, so that exception + // does not apply. + // + // The serverConn might close an open stream while the stream's handler + // is still running. For example, the server might close a stream when it + // receives bad data from the client. If this happens, the handler might + // attempt to write a frame after the stream has been closed (since the + // handler hasn't yet been notified of the close). In this case, we simply + // ignore the frame. The handler will notice that the stream is closed when + // it waits for the frame to be written. + // + // As an exception to this rule, we allow sending RST_STREAM after close. + // This allows us to immediately reject new streams without tracking any + // state for those streams (except for the queued RST_STREAM frame). This + // may result in duplicate RST_STREAMs in some cases, but the client should + // ignore those. + if wr.StreamID() != 0 { + _, isReset := wr.write.(StreamError) + if state, _ := sc.state(wr.StreamID()); state == stateClosed && !isReset { + ignoreWrite = true + } + } + + // Don't send a 100-continue response if we've already sent headers. + // See golang.org/issue/14030. + switch wr.write.(type) { + case *writeResHeaders: + wr.stream.wroteHeaders = true + case write100ContinueHeadersFrame: + if wr.stream.wroteHeaders { + // We do not need to notify wr.done because this frame is + // never written with wr.done != nil. + if wr.done != nil { + panic("wr.done != nil for write100ContinueHeadersFrame") + } + ignoreWrite = true + } + } + + if !ignoreWrite { + if wr.isControl() { + sc.queuedControlFrames++ + // For extra safety, detect wraparounds, which should not happen, + // and pull the plug. + if sc.queuedControlFrames < 0 { + sc.conn.Close() + } + } + sc.writeSched.Push(wr) + } + sc.scheduleFrameWrite() +} + +// startFrameWrite starts a goroutine to write wr (in a separate +// goroutine since that might block on the network), and updates the +// serve goroutine's state about the world, updated from info in wr. +func (sc *serverConn) startFrameWrite(wr FrameWriteRequest) { + sc.serveG.check() + if sc.writingFrame { + panic("internal error: can only be writing one frame at a time") + } + + st := wr.stream + if st != nil { + switch st.state { + case stateHalfClosedLocal: + switch wr.write.(type) { + case StreamError, handlerPanicRST, writeWindowUpdate: + // RFC 7540 Section 5.1 allows sending RST_STREAM, PRIORITY, and WINDOW_UPDATE + // in this state. (We never send PRIORITY from the server, so that is not checked.) + default: + panic(fmt.Sprintf("internal error: attempt to send frame on a half-closed-local stream: %v", wr)) + } + case stateClosed: + panic(fmt.Sprintf("internal error: attempt to send frame on a closed stream: %v", wr)) + } + } + if wpp, ok := wr.write.(*writePushPromise); ok { + var err error + wpp.promisedID, err = wpp.allocatePromisedID() + if err != nil { + sc.writingFrameAsync = false + wr.replyToWriter(err) + return + } + } + + sc.writingFrame = true + sc.needsFrameFlush = true + if wr.write.staysWithinBuffer(sc.bw.Available()) { + sc.writingFrameAsync = false + err := wr.write.writeFrame(sc) + sc.wroteFrame(frameWriteResult{wr: wr, err: err}) + } else if wd, ok := wr.write.(*writeData); ok { + // Encode the frame in the serve goroutine, to ensure we don't have + // any lingering asynchronous references to data passed to Write. + // See https://go.dev/issue/58446. + sc.framer.startWriteDataPadded(wd.streamID, wd.endStream, wd.p, nil) + sc.writingFrameAsync = true + go sc.writeFrameAsync(wr, wd) + } else { + sc.writingFrameAsync = true + go sc.writeFrameAsync(wr, nil) + } +} + +// errHandlerPanicked is the error given to any callers blocked in a read from +// Request.Body when the main goroutine panics. Since most handlers read in the +// main ServeHTTP goroutine, this will show up rarely. +var errHandlerPanicked = errors.New("http2: handler panicked") + +// wroteFrame is called on the serve goroutine with the result of +// whatever happened on writeFrameAsync. +func (sc *serverConn) wroteFrame(res frameWriteResult) { + sc.serveG.check() + if !sc.writingFrame { + panic("internal error: expected to be already writing a frame") + } + sc.writingFrame = false + sc.writingFrameAsync = false + + if res.err != nil { + sc.conn.Close() + } + + wr := res.wr + + if writeEndsStream(wr.write) { + st := wr.stream + if st == nil { + panic("internal error: expecting non-nil stream") + } + switch st.state { + case stateOpen: + // Here we would go to stateHalfClosedLocal in + // theory, but since our handler is done and + // the net/http package provides no mechanism + // for closing a ResponseWriter while still + // reading data (see possible TODO at top of + // this file), we go into closed state here + // anyway, after telling the peer we're + // hanging up on them. We'll transition to + // stateClosed after the RST_STREAM frame is + // written. + st.state = stateHalfClosedLocal + // Section 8.1: a server MAY request that the client abort + // transmission of a request without error by sending a + // RST_STREAM with an error code of NO_ERROR after sending + // a complete response. + sc.resetStream(streamError(st.id, ErrCodeNo)) + case stateHalfClosedRemote: + sc.closeStream(st, errHandlerComplete) + } + } else { + switch v := wr.write.(type) { + case StreamError: + // st may be unknown if the RST_STREAM was generated to reject bad input. + if st, ok := sc.streams[v.StreamID]; ok { + sc.closeStream(st, v) + } + case handlerPanicRST: + sc.closeStream(wr.stream, errHandlerPanicked) + } + } + + // Reply (if requested) to unblock the ServeHTTP goroutine. + wr.replyToWriter(res.err) + + sc.scheduleFrameWrite() +} + +// scheduleFrameWrite tickles the frame writing scheduler. +// +// If a frame is already being written, nothing happens. This will be called again +// when the frame is done being written. +// +// If a frame isn't being written and we need to send one, the best frame +// to send is selected by writeSched. +// +// If a frame isn't being written and there's nothing else to send, we +// flush the write buffer. +func (sc *serverConn) scheduleFrameWrite() { + sc.serveG.check() + if sc.writingFrame || sc.inFrameScheduleLoop { + return + } + sc.inFrameScheduleLoop = true + for !sc.writingFrameAsync { + if sc.needToSendGoAway { + sc.needToSendGoAway = false + sc.startFrameWrite(FrameWriteRequest{ + write: &writeGoAway{ + maxStreamID: sc.maxClientStreamID, + code: sc.goAwayCode, + }, + }) + continue + } + if sc.needToSendSettingsAck { + sc.needToSendSettingsAck = false + sc.startFrameWrite(FrameWriteRequest{write: writeSettingsAck{}}) + continue + } + if !sc.inGoAway || sc.goAwayCode == ErrCodeNo { + if wr, ok := sc.writeSched.Pop(); ok { + if wr.isControl() { + sc.queuedControlFrames-- + } + sc.startFrameWrite(wr) + continue + } + } + if sc.needsFrameFlush { + sc.startFrameWrite(FrameWriteRequest{write: flushFrameWriter{}}) + sc.needsFrameFlush = false // after startFrameWrite, since it sets this true + continue + } + break + } + sc.inFrameScheduleLoop = false +} + +// startGracefulShutdown gracefully shuts down a connection. This +// sends GOAWAY with ErrCodeNo to tell the client we're gracefully +// shutting down. The connection isn't closed until all current +// streams are done. +// +// startGracefulShutdown returns immediately; it does not wait until +// the connection has shut down. +func (sc *serverConn) startGracefulShutdown() { + sc.serveG.checkNotOn() // NOT + sc.shutdownOnce.Do(func() { sc.sendServeMsg(gracefulShutdownMsg) }) +} + +// After sending GOAWAY with an error code (non-graceful shutdown), the +// connection will close after goAwayTimeout. +// +// If we close the connection immediately after sending GOAWAY, there may +// be unsent data in our kernel receive buffer, which will cause the kernel +// to send a TCP RST on close() instead of a FIN. This RST will abort the +// connection immediately, whether or not the client had received the GOAWAY. +// +// Ideally we should delay for at least 1 RTT + epsilon so the client has +// a chance to read the GOAWAY and stop sending messages. Measuring RTT +// is hard, so we approximate with 1 second. See golang.org/issue/18701. +// +// This is a var so it can be shorter in tests, where all requests uses the +// loopback interface making the expected RTT very small. +// +// TODO: configurable? +var goAwayTimeout = 1 * time.Second + +func (sc *serverConn) startGracefulShutdownInternal() { + sc.goAway(ErrCodeNo) +} + +func (sc *serverConn) goAway(code ErrCode) { + sc.serveG.check() + if sc.inGoAway { + if sc.goAwayCode == ErrCodeNo { + sc.goAwayCode = code + } + return + } + sc.inGoAway = true + sc.needToSendGoAway = true + sc.goAwayCode = code + sc.scheduleFrameWrite() +} + +func (sc *serverConn) shutDownIn(d time.Duration) { + sc.serveG.check() + sc.shutdownTimer = sc.srv.afterFunc(d, sc.onShutdownTimer) +} + +func (sc *serverConn) resetStream(se StreamError) { + sc.serveG.check() + sc.writeFrame(FrameWriteRequest{write: se}) + if st, ok := sc.streams[se.StreamID]; ok { + st.resetQueued = true + } +} + +// processFrameFromReader processes the serve loop's read from readFrameCh from the +// frame-reading goroutine. +// processFrameFromReader returns whether the connection should be kept open. +func (sc *serverConn) processFrameFromReader(res readFrameResult) bool { + sc.serveG.check() + err := res.err + if err != nil { + if err == ErrFrameTooLarge { + sc.goAway(ErrCodeFrameSize) + return true // goAway will close the loop + } + clientGone := err == io.EOF || err == io.ErrUnexpectedEOF || isClosedConnError(err) + if clientGone { + // TODO: could we also get into this state if + // the peer does a half close + // (e.g. CloseWrite) because they're done + // sending frames but they're still wanting + // our open replies? Investigate. + // TODO: add CloseWrite to crypto/tls.Conn first + // so we have a way to test this? I suppose + // just for testing we could have a non-TLS mode. + return false + } + } else { + f := res.f + if VerboseLogs { + sc.vlogf("http2: server read frame %v", summarizeFrame(f)) + } + err = sc.processFrame(f) + if err == nil { + return true + } + } + + switch ev := err.(type) { + case StreamError: + sc.resetStream(ev) + return true + case goAwayFlowError: + sc.goAway(ErrCodeFlowControl) + return true + case ConnectionError: + if res.f != nil { + if id := res.f.Header().StreamID; id > sc.maxClientStreamID { + sc.maxClientStreamID = id + } + } + sc.logf("http2: server connection error from %v: %v", sc.conn.RemoteAddr(), ev) + sc.goAway(ErrCode(ev)) + return true // goAway will handle shutdown + default: + if res.err != nil { + sc.vlogf("http2: server closing client connection; error reading frame from client %s: %v", sc.conn.RemoteAddr(), err) + } else { + sc.logf("http2: server closing client connection: %v", err) + } + return false + } +} + +func (sc *serverConn) processFrame(f Frame) error { + sc.serveG.check() + + // First frame received must be SETTINGS. + if !sc.sawFirstSettings { + if _, ok := f.(*SettingsFrame); !ok { + return sc.countError("first_settings", ConnectionError(ErrCodeProtocol)) + } + sc.sawFirstSettings = true + } + + // Discard frames for streams initiated after the identified last + // stream sent in a GOAWAY, or all frames after sending an error. + // We still need to return connection-level flow control for DATA frames. + // RFC 9113 Section 6.8. + if sc.inGoAway && (sc.goAwayCode != ErrCodeNo || f.Header().StreamID > sc.maxClientStreamID) { + + if f, ok := f.(*DataFrame); ok { + if !sc.inflow.take(f.Length) { + return sc.countError("data_flow", streamError(f.Header().StreamID, ErrCodeFlowControl)) + } + sc.sendWindowUpdate(nil, int(f.Length)) // conn-level + } + return nil + } + + switch f := f.(type) { + case *SettingsFrame: + return sc.processSettings(f) + case *MetaHeadersFrame: + return sc.processHeaders(f) + case *WindowUpdateFrame: + return sc.processWindowUpdate(f) + case *PingFrame: + return sc.processPing(f) + case *DataFrame: + return sc.processData(f) + case *RSTStreamFrame: + return sc.processResetStream(f) + case *PriorityFrame: + return sc.processPriority(f) + case *GoAwayFrame: + return sc.processGoAway(f) + case *PushPromiseFrame: + // A client cannot push. Thus, servers MUST treat the receipt of a PUSH_PROMISE + // frame as a connection error (Section 5.4.1) of type PROTOCOL_ERROR. + return sc.countError("push_promise", ConnectionError(ErrCodeProtocol)) + default: + sc.vlogf("http2: server ignoring frame: %v", f.Header()) + return nil + } +} + +func (sc *serverConn) processPing(f *PingFrame) error { + sc.serveG.check() + if f.IsAck() { + if sc.pingSent && sc.sentPingData == f.Data { + // This is a response to a PING we sent. + sc.pingSent = false + sc.readIdleTimer.Reset(sc.readIdleTimeout) + } + // 6.7 PING: " An endpoint MUST NOT respond to PING frames + // containing this flag." + return nil + } + if f.StreamID != 0 { + // "PING frames are not associated with any individual + // stream. If a PING frame is received with a stream + // identifier field value other than 0x0, the recipient MUST + // respond with a connection error (Section 5.4.1) of type + // PROTOCOL_ERROR." + return sc.countError("ping_on_stream", ConnectionError(ErrCodeProtocol)) + } + sc.writeFrame(FrameWriteRequest{write: writePingAck{f}}) + return nil +} + +func (sc *serverConn) processWindowUpdate(f *WindowUpdateFrame) error { + sc.serveG.check() + switch { + case f.StreamID != 0: // stream-level flow control + state, st := sc.state(f.StreamID) + if state == stateIdle { + // Section 5.1: "Receiving any frame other than HEADERS + // or PRIORITY on a stream in this state MUST be + // treated as a connection error (Section 5.4.1) of + // type PROTOCOL_ERROR." + return sc.countError("stream_idle", ConnectionError(ErrCodeProtocol)) + } + if st == nil { + // "WINDOW_UPDATE can be sent by a peer that has sent a + // frame bearing the END_STREAM flag. This means that a + // receiver could receive a WINDOW_UPDATE frame on a "half + // closed (remote)" or "closed" stream. A receiver MUST + // NOT treat this as an error, see Section 5.1." + return nil + } + if !st.flow.add(int32(f.Increment)) { + return sc.countError("bad_flow", streamError(f.StreamID, ErrCodeFlowControl)) + } + default: // connection-level flow control + if !sc.flow.add(int32(f.Increment)) { + return goAwayFlowError{} + } + } + sc.scheduleFrameWrite() + return nil +} + +func (sc *serverConn) processResetStream(f *RSTStreamFrame) error { + sc.serveG.check() + + state, st := sc.state(f.StreamID) + if state == stateIdle { + // 6.4 "RST_STREAM frames MUST NOT be sent for a + // stream in the "idle" state. If a RST_STREAM frame + // identifying an idle stream is received, the + // recipient MUST treat this as a connection error + // (Section 5.4.1) of type PROTOCOL_ERROR. + return sc.countError("reset_idle_stream", ConnectionError(ErrCodeProtocol)) + } + if st != nil { + st.cancelCtx() + sc.closeStream(st, streamError(f.StreamID, f.ErrCode)) + } + return nil +} + +func (sc *serverConn) closeStream(st *stream, err error) { + sc.serveG.check() + if st.state == stateIdle || st.state == stateClosed { + panic(fmt.Sprintf("invariant; can't close stream in state %v", st.state)) + } + st.state = stateClosed + if st.readDeadline != nil { + st.readDeadline.Stop() + } + if st.writeDeadline != nil { + st.writeDeadline.Stop() + } + if st.isPushed() { + sc.curPushedStreams-- + } else { + sc.curClientStreams-- + } + delete(sc.streams, st.id) + if len(sc.streams) == 0 { + sc.setConnState(http.StateIdle) + if sc.srv.IdleTimeout > 0 && sc.idleTimer != nil { + sc.idleTimer.Reset(sc.srv.IdleTimeout) + } + if h1ServerKeepAlivesDisabled(sc.hs) { + sc.startGracefulShutdownInternal() + } + } + if p := st.body; p != nil { + // Return any buffered unread bytes worth of conn-level flow control. + // See golang.org/issue/16481 + sc.sendWindowUpdate(nil, p.Len()) + + p.CloseWithError(err) + } + if e, ok := err.(StreamError); ok { + if e.Cause != nil { + err = e.Cause + } else { + err = errStreamClosed + } + } + st.closeErr = err + st.cancelCtx() + st.cw.Close() // signals Handler's CloseNotifier, unblocks writes, etc + sc.writeSched.CloseStream(st.id) +} + +func (sc *serverConn) processSettings(f *SettingsFrame) error { + sc.serveG.check() + if f.IsAck() { + sc.unackedSettings-- + if sc.unackedSettings < 0 { + // Why is the peer ACKing settings we never sent? + // The spec doesn't mention this case, but + // hang up on them anyway. + return sc.countError("ack_mystery", ConnectionError(ErrCodeProtocol)) + } + return nil + } + if f.NumSettings() > 100 || f.HasDuplicates() { + // This isn't actually in the spec, but hang up on + // suspiciously large settings frames or those with + // duplicate entries. + return sc.countError("settings_big_or_dups", ConnectionError(ErrCodeProtocol)) + } + if err := f.ForeachSetting(sc.processSetting); err != nil { + return err + } + // TODO: judging by RFC 7540, Section 6.5.3 each SETTINGS frame should be + // acknowledged individually, even if multiple are received before the ACK. + sc.needToSendSettingsAck = true + sc.scheduleFrameWrite() + return nil +} + +func (sc *serverConn) processSetting(s Setting) error { + sc.serveG.check() + if err := s.Valid(); err != nil { + return err + } + if VerboseLogs { + sc.vlogf("http2: server processing setting %v", s) + } + switch s.ID { + case SettingHeaderTableSize: + sc.hpackEncoder.SetMaxDynamicTableSize(s.Val) + case SettingEnablePush: + sc.pushEnabled = s.Val != 0 + case SettingMaxConcurrentStreams: + sc.clientMaxStreams = s.Val + case SettingInitialWindowSize: + return sc.processSettingInitialWindowSize(s.Val) + case SettingMaxFrameSize: + sc.maxFrameSize = int32(s.Val) // the maximum valid s.Val is < 2^31 + case SettingMaxHeaderListSize: + sc.peerMaxHeaderListSize = s.Val + case SettingEnableConnectProtocol: + // Receipt of this parameter by a server does not + // have any impact + default: + // Unknown setting: "An endpoint that receives a SETTINGS + // frame with any unknown or unsupported identifier MUST + // ignore that setting." + if VerboseLogs { + sc.vlogf("http2: server ignoring unknown setting %v", s) + } + } + return nil +} + +func (sc *serverConn) processSettingInitialWindowSize(val uint32) error { + sc.serveG.check() + // Note: val already validated to be within range by + // processSetting's Valid call. + + // "A SETTINGS frame can alter the initial flow control window + // size for all current streams. When the value of + // SETTINGS_INITIAL_WINDOW_SIZE changes, a receiver MUST + // adjust the size of all stream flow control windows that it + // maintains by the difference between the new value and the + // old value." + old := sc.initialStreamSendWindowSize + sc.initialStreamSendWindowSize = int32(val) + growth := int32(val) - old // may be negative + for _, st := range sc.streams { + if !st.flow.add(growth) { + // 6.9.2 Initial Flow Control Window Size + // "An endpoint MUST treat a change to + // SETTINGS_INITIAL_WINDOW_SIZE that causes any flow + // control window to exceed the maximum size as a + // connection error (Section 5.4.1) of type + // FLOW_CONTROL_ERROR." + return sc.countError("setting_win_size", ConnectionError(ErrCodeFlowControl)) + } + } + return nil +} + +func (sc *serverConn) processData(f *DataFrame) error { + sc.serveG.check() + id := f.Header().StreamID + + data := f.Data() + state, st := sc.state(id) + if id == 0 || state == stateIdle { + // Section 6.1: "DATA frames MUST be associated with a + // stream. If a DATA frame is received whose stream + // identifier field is 0x0, the recipient MUST respond + // with a connection error (Section 5.4.1) of type + // PROTOCOL_ERROR." + // + // Section 5.1: "Receiving any frame other than HEADERS + // or PRIORITY on a stream in this state MUST be + // treated as a connection error (Section 5.4.1) of + // type PROTOCOL_ERROR." + return sc.countError("data_on_idle", ConnectionError(ErrCodeProtocol)) + } + + // "If a DATA frame is received whose stream is not in "open" + // or "half closed (local)" state, the recipient MUST respond + // with a stream error (Section 5.4.2) of type STREAM_CLOSED." + if st == nil || state != stateOpen || st.gotTrailerHeader || st.resetQueued { + // This includes sending a RST_STREAM if the stream is + // in stateHalfClosedLocal (which currently means that + // the http.Handler returned, so it's done reading & + // done writing). Try to stop the client from sending + // more DATA. + + // But still enforce their connection-level flow control, + // and return any flow control bytes since we're not going + // to consume them. + if !sc.inflow.take(f.Length) { + return sc.countError("data_flow", streamError(id, ErrCodeFlowControl)) + } + sc.sendWindowUpdate(nil, int(f.Length)) // conn-level + + if st != nil && st.resetQueued { + // Already have a stream error in flight. Don't send another. + return nil + } + return sc.countError("closed", streamError(id, ErrCodeStreamClosed)) + } + if st.body == nil { + panic("internal error: should have a body in this state") + } + + // Sender sending more than they'd declared? + if st.declBodyBytes != -1 && st.bodyBytes+int64(len(data)) > st.declBodyBytes { + if !sc.inflow.take(f.Length) { + return sc.countError("data_flow", streamError(id, ErrCodeFlowControl)) + } + sc.sendWindowUpdate(nil, int(f.Length)) // conn-level + + st.body.CloseWithError(fmt.Errorf("sender tried to send more than declared Content-Length of %d bytes", st.declBodyBytes)) + // RFC 7540, sec 8.1.2.6: A request or response is also malformed if the + // value of a content-length header field does not equal the sum of the + // DATA frame payload lengths that form the body. + return sc.countError("send_too_much", streamError(id, ErrCodeProtocol)) + } + if f.Length > 0 { + // Check whether the client has flow control quota. + if !takeInflows(&sc.inflow, &st.inflow, f.Length) { + return sc.countError("flow_on_data_length", streamError(id, ErrCodeFlowControl)) + } + + if len(data) > 0 { + st.bodyBytes += int64(len(data)) + wrote, err := st.body.Write(data) + if err != nil { + // The handler has closed the request body. + // Return the connection-level flow control for the discarded data, + // but not the stream-level flow control. + sc.sendWindowUpdate(nil, int(f.Length)-wrote) + return nil + } + if wrote != len(data) { + panic("internal error: bad Writer") + } + } + + // Return any padded flow control now, since we won't + // refund it later on body reads. + // Call sendWindowUpdate even if there is no padding, + // to return buffered flow control credit if the sent + // window has shrunk. + pad := int32(f.Length) - int32(len(data)) + sc.sendWindowUpdate32(nil, pad) + sc.sendWindowUpdate32(st, pad) + } + if f.StreamEnded() { + st.endStream() + } + return nil +} + +func (sc *serverConn) processGoAway(f *GoAwayFrame) error { + sc.serveG.check() + if f.ErrCode != ErrCodeNo { + sc.logf("http2: received GOAWAY %+v, starting graceful shutdown", f) + } else { + sc.vlogf("http2: received GOAWAY %+v, starting graceful shutdown", f) + } + sc.startGracefulShutdownInternal() + // http://tools.ietf.org/html/rfc7540#section-6.8 + // We should not create any new streams, which means we should disable push. + sc.pushEnabled = false + return nil +} + +// isPushed reports whether the stream is server-initiated. +func (st *stream) isPushed() bool { + return st.id%2 == 0 +} + +// endStream closes a Request.Body's pipe. It is called when a DATA +// frame says a request body is over (or after trailers). +func (st *stream) endStream() { + sc := st.sc + sc.serveG.check() + + if st.declBodyBytes != -1 && st.declBodyBytes != st.bodyBytes { + st.body.CloseWithError(fmt.Errorf("request declared a Content-Length of %d but only wrote %d bytes", + st.declBodyBytes, st.bodyBytes)) + } else { + st.body.closeWithErrorAndCode(io.EOF, st.copyTrailersToHandlerRequest) + st.body.CloseWithError(io.EOF) + } + st.state = stateHalfClosedRemote +} + +// copyTrailersToHandlerRequest is run in the Handler's goroutine in +// its Request.Body.Read just before it gets io.EOF. +func (st *stream) copyTrailersToHandlerRequest() { + for k, vv := range st.trailer { + if _, ok := st.reqTrailer[k]; ok { + // Only copy it over it was pre-declared. + st.reqTrailer[k] = vv + } + } +} + +// onReadTimeout is run on its own goroutine (from time.AfterFunc) +// when the stream's ReadTimeout has fired. +func (st *stream) onReadTimeout() { + if st.body != nil { + // Wrap the ErrDeadlineExceeded to avoid callers depending on us + // returning the bare error. + st.body.CloseWithError(fmt.Errorf("%w", os.ErrDeadlineExceeded)) + } +} + +// onWriteTimeout is run on its own goroutine (from time.AfterFunc) +// when the stream's WriteTimeout has fired. +func (st *stream) onWriteTimeout() { + st.sc.writeFrameFromHandler(FrameWriteRequest{write: StreamError{ + StreamID: st.id, + Code: ErrCodeInternal, + Cause: os.ErrDeadlineExceeded, + }}) +} + +func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { + sc.serveG.check() + id := f.StreamID + // http://tools.ietf.org/html/rfc7540#section-5.1.1 + // Streams initiated by a client MUST use odd-numbered stream + // identifiers. [...] An endpoint that receives an unexpected + // stream identifier MUST respond with a connection error + // (Section 5.4.1) of type PROTOCOL_ERROR. + if id%2 != 1 { + return sc.countError("headers_even", ConnectionError(ErrCodeProtocol)) + } + // A HEADERS frame can be used to create a new stream or + // send a trailer for an open one. If we already have a stream + // open, let it process its own HEADERS frame (trailers at this + // point, if it's valid). + if st := sc.streams[f.StreamID]; st != nil { + if st.resetQueued { + // We're sending RST_STREAM to close the stream, so don't bother + // processing this frame. + return nil + } + // RFC 7540, sec 5.1: If an endpoint receives additional frames, other than + // WINDOW_UPDATE, PRIORITY, or RST_STREAM, for a stream that is in + // this state, it MUST respond with a stream error (Section 5.4.2) of + // type STREAM_CLOSED. + if st.state == stateHalfClosedRemote { + return sc.countError("headers_half_closed", streamError(id, ErrCodeStreamClosed)) + } + return st.processTrailerHeaders(f) + } + + // [...] The identifier of a newly established stream MUST be + // numerically greater than all streams that the initiating + // endpoint has opened or reserved. [...] An endpoint that + // receives an unexpected stream identifier MUST respond with + // a connection error (Section 5.4.1) of type PROTOCOL_ERROR. + if id <= sc.maxClientStreamID { + return sc.countError("stream_went_down", ConnectionError(ErrCodeProtocol)) + } + sc.maxClientStreamID = id + + if sc.idleTimer != nil { + sc.idleTimer.Stop() + } + + // http://tools.ietf.org/html/rfc7540#section-5.1.2 + // [...] Endpoints MUST NOT exceed the limit set by their peer. An + // endpoint that receives a HEADERS frame that causes their + // advertised concurrent stream limit to be exceeded MUST treat + // this as a stream error (Section 5.4.2) of type PROTOCOL_ERROR + // or REFUSED_STREAM. + if sc.curClientStreams+1 > sc.advMaxStreams { + if sc.unackedSettings == 0 { + // They should know better. + return sc.countError("over_max_streams", streamError(id, ErrCodeProtocol)) + } + // Assume it's a network race, where they just haven't + // received our last SETTINGS update. But actually + // this can't happen yet, because we don't yet provide + // a way for users to adjust server parameters at + // runtime. + return sc.countError("over_max_streams_race", streamError(id, ErrCodeRefusedStream)) + } + + initialState := stateOpen + if f.StreamEnded() { + initialState = stateHalfClosedRemote + } + st := sc.newStream(id, 0, initialState) + + if f.HasPriority() { + if err := sc.checkPriority(f.StreamID, f.Priority); err != nil { + return err + } + sc.writeSched.AdjustStream(st.id, f.Priority) + } + + rw, req, err := sc.newWriterAndRequest(st, f) + if err != nil { + return err + } + st.reqTrailer = req.Trailer + if st.reqTrailer != nil { + st.trailer = make(http.Header) + } + st.body = req.Body.(*requestBody).pipe // may be nil + st.declBodyBytes = req.ContentLength + + handler := sc.handler.ServeHTTP + if f.Truncated { + // Their header list was too long. Send a 431 error. + handler = handleHeaderListTooLong + } else if err := checkValidHTTP2RequestHeaders(req.Header); err != nil { + handler = new400Handler(err) + } + + // The net/http package sets the read deadline from the + // http.Server.ReadTimeout during the TLS handshake, but then + // passes the connection off to us with the deadline already + // set. Disarm it here after the request headers are read, + // similar to how the http1 server works. Here it's + // technically more like the http1 Server's ReadHeaderTimeout + // (in Go 1.8), though. That's a more sane option anyway. + if sc.hs.ReadTimeout > 0 { + sc.conn.SetReadDeadline(time.Time{}) + st.readDeadline = sc.srv.afterFunc(sc.hs.ReadTimeout, st.onReadTimeout) + } + + return sc.scheduleHandler(id, rw, req, handler) +} + +func (sc *serverConn) upgradeRequest(req *http.Request) { + sc.serveG.check() + id := uint32(1) + sc.maxClientStreamID = id + st := sc.newStream(id, 0, stateHalfClosedRemote) + st.reqTrailer = req.Trailer + if st.reqTrailer != nil { + st.trailer = make(http.Header) + } + rw := sc.newResponseWriter(st, req) + + // Disable any read deadline set by the net/http package + // prior to the upgrade. + if sc.hs.ReadTimeout > 0 { + sc.conn.SetReadDeadline(time.Time{}) + } + + // This is the first request on the connection, + // so start the handler directly rather than going + // through scheduleHandler. + sc.curHandlers++ + go sc.runHandler(rw, req, sc.handler.ServeHTTP) +} + +func (st *stream) processTrailerHeaders(f *MetaHeadersFrame) error { + sc := st.sc + sc.serveG.check() + if st.gotTrailerHeader { + return sc.countError("dup_trailers", ConnectionError(ErrCodeProtocol)) + } + st.gotTrailerHeader = true + if !f.StreamEnded() { + return sc.countError("trailers_not_ended", streamError(st.id, ErrCodeProtocol)) + } + + if len(f.PseudoFields()) > 0 { + return sc.countError("trailers_pseudo", streamError(st.id, ErrCodeProtocol)) + } + if st.trailer != nil { + for _, hf := range f.RegularFields() { + key := sc.canonicalHeader(hf.Name) + if !httpguts.ValidTrailerHeader(key) { + // TODO: send more details to the peer somehow. But http2 has + // no way to send debug data at a stream level. Discuss with + // HTTP folk. + return sc.countError("trailers_bogus", streamError(st.id, ErrCodeProtocol)) + } + st.trailer[key] = append(st.trailer[key], hf.Value) + } + } + st.endStream() + return nil +} + +func (sc *serverConn) checkPriority(streamID uint32, p PriorityParam) error { + if streamID == p.StreamDep { + // Section 5.3.1: "A stream cannot depend on itself. An endpoint MUST treat + // this as a stream error (Section 5.4.2) of type PROTOCOL_ERROR." + // Section 5.3.3 says that a stream can depend on one of its dependencies, + // so it's only self-dependencies that are forbidden. + return sc.countError("priority", streamError(streamID, ErrCodeProtocol)) + } + return nil +} + +func (sc *serverConn) processPriority(f *PriorityFrame) error { + if err := sc.checkPriority(f.StreamID, f.PriorityParam); err != nil { + return err + } + sc.writeSched.AdjustStream(f.StreamID, f.PriorityParam) + return nil +} + +func (sc *serverConn) newStream(id, pusherID uint32, state streamState) *stream { + sc.serveG.check() + if id == 0 { + panic("internal error: cannot create stream with id 0") + } + + ctx, cancelCtx := context.WithCancel(sc.baseCtx) + st := &stream{ + sc: sc, + id: id, + state: state, + ctx: ctx, + cancelCtx: cancelCtx, + } + st.cw.Init() + st.flow.conn = &sc.flow // link to conn-level counter + st.flow.add(sc.initialStreamSendWindowSize) + st.inflow.init(sc.initialStreamRecvWindowSize) + if sc.hs.WriteTimeout > 0 { + st.writeDeadline = sc.srv.afterFunc(sc.hs.WriteTimeout, st.onWriteTimeout) + } + + sc.streams[id] = st + sc.writeSched.OpenStream(st.id, OpenStreamOptions{PusherID: pusherID}) + if st.isPushed() { + sc.curPushedStreams++ + } else { + sc.curClientStreams++ + } + if sc.curOpenStreams() == 1 { + sc.setConnState(http.StateActive) + } + + return st +} + +func (sc *serverConn) newWriterAndRequest(st *stream, f *MetaHeadersFrame) (*responseWriter, *http.Request, error) { + sc.serveG.check() + + rp := httpcommon.ServerRequestParam{ + Method: f.PseudoValue("method"), + Scheme: f.PseudoValue("scheme"), + Authority: f.PseudoValue("authority"), + Path: f.PseudoValue("path"), + Protocol: f.PseudoValue("protocol"), + } + + // extended connect is disabled, so we should not see :protocol + if disableExtendedConnectProtocol && rp.Protocol != "" { + return nil, nil, sc.countError("bad_connect", streamError(f.StreamID, ErrCodeProtocol)) + } + + isConnect := rp.Method == "CONNECT" + if isConnect { + if rp.Protocol == "" && (rp.Path != "" || rp.Scheme != "" || rp.Authority == "") { + return nil, nil, sc.countError("bad_connect", streamError(f.StreamID, ErrCodeProtocol)) + } + } else if rp.Method == "" || rp.Path == "" || (rp.Scheme != "https" && rp.Scheme != "http") { + // See 8.1.2.6 Malformed Requests and Responses: + // + // Malformed requests or responses that are detected + // MUST be treated as a stream error (Section 5.4.2) + // of type PROTOCOL_ERROR." + // + // 8.1.2.3 Request Pseudo-Header Fields + // "All HTTP/2 requests MUST include exactly one valid + // value for the :method, :scheme, and :path + // pseudo-header fields" + return nil, nil, sc.countError("bad_path_method", streamError(f.StreamID, ErrCodeProtocol)) + } + + header := make(http.Header) + rp.Header = header + for _, hf := range f.RegularFields() { + header.Add(sc.canonicalHeader(hf.Name), hf.Value) + } + if rp.Authority == "" { + rp.Authority = header.Get("Host") + } + if rp.Protocol != "" { + header.Set(":protocol", rp.Protocol) + } + + rw, req, err := sc.newWriterAndRequestNoBody(st, rp) + if err != nil { + return nil, nil, err + } + bodyOpen := !f.StreamEnded() + if bodyOpen { + if vv, ok := rp.Header["Content-Length"]; ok { + if cl, err := strconv.ParseUint(vv[0], 10, 63); err == nil { + req.ContentLength = int64(cl) + } else { + req.ContentLength = 0 + } + } else { + req.ContentLength = -1 + } + req.Body.(*requestBody).pipe = &pipe{ + b: &dataBuffer{expected: req.ContentLength}, + } + } + return rw, req, nil +} + +func (sc *serverConn) newWriterAndRequestNoBody(st *stream, rp httpcommon.ServerRequestParam) (*responseWriter, *http.Request, error) { + sc.serveG.check() + + var tlsState *tls.ConnectionState // nil if not scheme https + if rp.Scheme == "https" { + tlsState = sc.tlsState + } + + res := httpcommon.NewServerRequest(rp) + if res.InvalidReason != "" { + return nil, nil, sc.countError(res.InvalidReason, streamError(st.id, ErrCodeProtocol)) + } + + body := &requestBody{ + conn: sc, + stream: st, + needsContinue: res.NeedsContinue, + } + req := (&http.Request{ + Method: rp.Method, + URL: res.URL, + RemoteAddr: sc.remoteAddrStr, + Header: rp.Header, + RequestURI: res.RequestURI, + Proto: "HTTP/2.0", + ProtoMajor: 2, + ProtoMinor: 0, + TLS: tlsState, + Host: rp.Authority, + Body: body, + Trailer: res.Trailer, + }).WithContext(st.ctx) + rw := sc.newResponseWriter(st, req) + return rw, req, nil +} + +func (sc *serverConn) newResponseWriter(st *stream, req *http.Request) *responseWriter { + rws := responseWriterStatePool.Get().(*responseWriterState) + bwSave := rws.bw + *rws = responseWriterState{} // zero all the fields + rws.conn = sc + rws.bw = bwSave + rws.bw.Reset(chunkWriter{rws}) + rws.stream = st + rws.req = req + return &responseWriter{rws: rws} +} + +type unstartedHandler struct { + streamID uint32 + rw *responseWriter + req *http.Request + handler func(http.ResponseWriter, *http.Request) +} + +// scheduleHandler starts a handler goroutine, +// or schedules one to start as soon as an existing handler finishes. +func (sc *serverConn) scheduleHandler(streamID uint32, rw *responseWriter, req *http.Request, handler func(http.ResponseWriter, *http.Request)) error { + sc.serveG.check() + maxHandlers := sc.advMaxStreams + if sc.curHandlers < maxHandlers { + sc.curHandlers++ + go sc.runHandler(rw, req, handler) + return nil + } + if len(sc.unstartedHandlers) > int(4*sc.advMaxStreams) { + return sc.countError("too_many_early_resets", ConnectionError(ErrCodeEnhanceYourCalm)) + } + sc.unstartedHandlers = append(sc.unstartedHandlers, unstartedHandler{ + streamID: streamID, + rw: rw, + req: req, + handler: handler, + }) + return nil +} + +func (sc *serverConn) handlerDone() { + sc.serveG.check() + sc.curHandlers-- + i := 0 + maxHandlers := sc.advMaxStreams + for ; i < len(sc.unstartedHandlers); i++ { + u := sc.unstartedHandlers[i] + if sc.streams[u.streamID] == nil { + // This stream was reset before its goroutine had a chance to start. + continue + } + if sc.curHandlers >= maxHandlers { + break + } + sc.curHandlers++ + go sc.runHandler(u.rw, u.req, u.handler) + sc.unstartedHandlers[i] = unstartedHandler{} // don't retain references + } + sc.unstartedHandlers = sc.unstartedHandlers[i:] + if len(sc.unstartedHandlers) == 0 { + sc.unstartedHandlers = nil + } +} + +// Run on its own goroutine. +func (sc *serverConn) runHandler(rw *responseWriter, req *http.Request, handler func(http.ResponseWriter, *http.Request)) { + sc.srv.markNewGoroutine() + defer sc.sendServeMsg(handlerDoneMsg) + didPanic := true + defer func() { + rw.rws.stream.cancelCtx() + if req.MultipartForm != nil { + req.MultipartForm.RemoveAll() + } + if didPanic { + e := recover() + sc.writeFrameFromHandler(FrameWriteRequest{ + write: handlerPanicRST{rw.rws.stream.id}, + stream: rw.rws.stream, + }) + // Same as net/http: + if e != nil && e != http.ErrAbortHandler { + const size = 64 << 10 + buf := make([]byte, size) + buf = buf[:runtime.Stack(buf, false)] + sc.logf("http2: panic serving %v: %v\n%s", sc.conn.RemoteAddr(), e, buf) + } + return + } + rw.handlerDone() + }() + handler(rw, req) + didPanic = false +} + +func handleHeaderListTooLong(w http.ResponseWriter, r *http.Request) { + // 10.5.1 Limits on Header Block Size: + // .. "A server that receives a larger header block than it is + // willing to handle can send an HTTP 431 (Request Header Fields Too + // Large) status code" + const statusRequestHeaderFieldsTooLarge = 431 // only in Go 1.6+ + w.WriteHeader(statusRequestHeaderFieldsTooLarge) + io.WriteString(w, "

HTTP Error 431

Request Header Field(s) Too Large

") +} + +// called from handler goroutines. +// h may be nil. +func (sc *serverConn) writeHeaders(st *stream, headerData *writeResHeaders) error { + sc.serveG.checkNotOn() // NOT on + var errc chan error + if headerData.h != nil { + // If there's a header map (which we don't own), so we have to block on + // waiting for this frame to be written, so an http.Flush mid-handler + // writes out the correct value of keys, before a handler later potentially + // mutates it. + errc = errChanPool.Get().(chan error) + } + if err := sc.writeFrameFromHandler(FrameWriteRequest{ + write: headerData, + stream: st, + done: errc, + }); err != nil { + return err + } + if errc != nil { + select { + case err := <-errc: + errChanPool.Put(errc) + return err + case <-sc.doneServing: + return errClientDisconnected + case <-st.cw: + return errStreamClosed + } + } + return nil +} + +// called from handler goroutines. +func (sc *serverConn) write100ContinueHeaders(st *stream) { + sc.writeFrameFromHandler(FrameWriteRequest{ + write: write100ContinueHeadersFrame{st.id}, + stream: st, + }) +} + +// A bodyReadMsg tells the server loop that the http.Handler read n +// bytes of the DATA from the client on the given stream. +type bodyReadMsg struct { + st *stream + n int +} + +// called from handler goroutines. +// Notes that the handler for the given stream ID read n bytes of its body +// and schedules flow control tokens to be sent. +func (sc *serverConn) noteBodyReadFromHandler(st *stream, n int, err error) { + sc.serveG.checkNotOn() // NOT on + if n > 0 { + select { + case sc.bodyReadCh <- bodyReadMsg{st, n}: + case <-sc.doneServing: + } + } +} + +func (sc *serverConn) noteBodyRead(st *stream, n int) { + sc.serveG.check() + sc.sendWindowUpdate(nil, n) // conn-level + if st.state != stateHalfClosedRemote && st.state != stateClosed { + // Don't send this WINDOW_UPDATE if the stream is closed + // remotely. + sc.sendWindowUpdate(st, n) + } +} + +// st may be nil for conn-level +func (sc *serverConn) sendWindowUpdate32(st *stream, n int32) { + sc.sendWindowUpdate(st, int(n)) +} + +// st may be nil for conn-level +func (sc *serverConn) sendWindowUpdate(st *stream, n int) { + sc.serveG.check() + var streamID uint32 + var send int32 + if st == nil { + send = sc.inflow.add(n) + } else { + streamID = st.id + send = st.inflow.add(n) + } + if send == 0 { + return + } + sc.writeFrame(FrameWriteRequest{ + write: writeWindowUpdate{streamID: streamID, n: uint32(send)}, + stream: st, + }) +} + +// requestBody is the Handler's Request.Body type. +// Read and Close may be called concurrently. +type requestBody struct { + _ incomparable + stream *stream + conn *serverConn + closeOnce sync.Once // for use by Close only + sawEOF bool // for use by Read only + pipe *pipe // non-nil if we have an HTTP entity message body + needsContinue bool // need to send a 100-continue +} + +func (b *requestBody) Close() error { + b.closeOnce.Do(func() { + if b.pipe != nil { + b.pipe.BreakWithError(errClosedBody) + } + }) + return nil +} + +func (b *requestBody) Read(p []byte) (n int, err error) { + if b.needsContinue { + b.needsContinue = false + b.conn.write100ContinueHeaders(b.stream) + } + if b.pipe == nil || b.sawEOF { + return 0, io.EOF + } + n, err = b.pipe.Read(p) + if err == io.EOF { + b.sawEOF = true + } + if b.conn == nil && inTests { + return + } + b.conn.noteBodyReadFromHandler(b.stream, n, err) + return +} + +// responseWriter is the http.ResponseWriter implementation. It's +// intentionally small (1 pointer wide) to minimize garbage. The +// responseWriterState pointer inside is zeroed at the end of a +// request (in handlerDone) and calls on the responseWriter thereafter +// simply crash (caller's mistake), but the much larger responseWriterState +// and buffers are reused between multiple requests. +type responseWriter struct { + rws *responseWriterState +} + +// Optional http.ResponseWriter interfaces implemented. +var ( + _ http.CloseNotifier = (*responseWriter)(nil) + _ http.Flusher = (*responseWriter)(nil) + _ stringWriter = (*responseWriter)(nil) +) + +type responseWriterState struct { + // immutable within a request: + stream *stream + req *http.Request + conn *serverConn + + // TODO: adjust buffer writing sizes based on server config, frame size updates from peer, etc + bw *bufio.Writer // writing to a chunkWriter{this *responseWriterState} + + // mutated by http.Handler goroutine: + handlerHeader http.Header // nil until called + snapHeader http.Header // snapshot of handlerHeader at WriteHeader time + trailers []string // set in writeChunk + status int // status code passed to WriteHeader + wroteHeader bool // WriteHeader called (explicitly or implicitly). Not necessarily sent to user yet. + sentHeader bool // have we sent the header frame? + handlerDone bool // handler has finished + + sentContentLen int64 // non-zero if handler set a Content-Length header + wroteBytes int64 + + closeNotifierMu sync.Mutex // guards closeNotifierCh + closeNotifierCh chan bool // nil until first used +} + +type chunkWriter struct{ rws *responseWriterState } + +func (cw chunkWriter) Write(p []byte) (n int, err error) { + n, err = cw.rws.writeChunk(p) + if err == errStreamClosed { + // If writing failed because the stream has been closed, + // return the reason it was closed. + err = cw.rws.stream.closeErr + } + return n, err +} + +func (rws *responseWriterState) hasTrailers() bool { return len(rws.trailers) > 0 } + +func (rws *responseWriterState) hasNonemptyTrailers() bool { + for _, trailer := range rws.trailers { + if _, ok := rws.handlerHeader[trailer]; ok { + return true + } + } + return false +} + +// declareTrailer is called for each Trailer header when the +// response header is written. It notes that a header will need to be +// written in the trailers at the end of the response. +func (rws *responseWriterState) declareTrailer(k string) { + k = http.CanonicalHeaderKey(k) + if !httpguts.ValidTrailerHeader(k) { + // Forbidden by RFC 7230, section 4.1.2. + rws.conn.logf("ignoring invalid trailer %q", k) + return + } + if !strSliceContains(rws.trailers, k) { + rws.trailers = append(rws.trailers, k) + } +} + +// writeChunk writes chunks from the bufio.Writer. But because +// bufio.Writer may bypass its chunking, sometimes p may be +// arbitrarily large. +// +// writeChunk is also responsible (on the first chunk) for sending the +// HEADER response. +func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { + if !rws.wroteHeader { + rws.writeHeader(200) + } + + if rws.handlerDone { + rws.promoteUndeclaredTrailers() + } + + isHeadResp := rws.req.Method == "HEAD" + if !rws.sentHeader { + rws.sentHeader = true + var ctype, clen string + if clen = rws.snapHeader.Get("Content-Length"); clen != "" { + rws.snapHeader.Del("Content-Length") + if cl, err := strconv.ParseUint(clen, 10, 63); err == nil { + rws.sentContentLen = int64(cl) + } else { + clen = "" + } + } + _, hasContentLength := rws.snapHeader["Content-Length"] + if !hasContentLength && clen == "" && rws.handlerDone && bodyAllowedForStatus(rws.status) && (len(p) > 0 || !isHeadResp) { + clen = strconv.Itoa(len(p)) + } + _, hasContentType := rws.snapHeader["Content-Type"] + // If the Content-Encoding is non-blank, we shouldn't + // sniff the body. See Issue golang.org/issue/31753. + ce := rws.snapHeader.Get("Content-Encoding") + hasCE := len(ce) > 0 + if !hasCE && !hasContentType && bodyAllowedForStatus(rws.status) && len(p) > 0 { + ctype = http.DetectContentType(p) + } + var date string + if _, ok := rws.snapHeader["Date"]; !ok { + // TODO(bradfitz): be faster here, like net/http? measure. + date = rws.conn.srv.now().UTC().Format(http.TimeFormat) + } + + for _, v := range rws.snapHeader["Trailer"] { + foreachHeaderElement(v, rws.declareTrailer) + } + + // "Connection" headers aren't allowed in HTTP/2 (RFC 7540, 8.1.2.2), + // but respect "Connection" == "close" to mean sending a GOAWAY and tearing + // down the TCP connection when idle, like we do for HTTP/1. + // TODO: remove more Connection-specific header fields here, in addition + // to "Connection". + if _, ok := rws.snapHeader["Connection"]; ok { + v := rws.snapHeader.Get("Connection") + delete(rws.snapHeader, "Connection") + if v == "close" { + rws.conn.startGracefulShutdown() + } + } + + endStream := (rws.handlerDone && !rws.hasTrailers() && len(p) == 0) || isHeadResp + err = rws.conn.writeHeaders(rws.stream, &writeResHeaders{ + streamID: rws.stream.id, + httpResCode: rws.status, + h: rws.snapHeader, + endStream: endStream, + contentType: ctype, + contentLength: clen, + date: date, + }) + if err != nil { + return 0, err + } + if endStream { + return 0, nil + } + } + if isHeadResp { + return len(p), nil + } + if len(p) == 0 && !rws.handlerDone { + return 0, nil + } + + // only send trailers if they have actually been defined by the + // server handler. + hasNonemptyTrailers := rws.hasNonemptyTrailers() + endStream := rws.handlerDone && !hasNonemptyTrailers + if len(p) > 0 || endStream { + // only send a 0 byte DATA frame if we're ending the stream. + if err := rws.conn.writeDataFromHandler(rws.stream, p, endStream); err != nil { + return 0, err + } + } + + if rws.handlerDone && hasNonemptyTrailers { + err = rws.conn.writeHeaders(rws.stream, &writeResHeaders{ + streamID: rws.stream.id, + h: rws.handlerHeader, + trailers: rws.trailers, + endStream: true, + }) + return len(p), err + } + return len(p), nil +} + +// TrailerPrefix is a magic prefix for ResponseWriter.Header map keys +// that, if present, signals that the map entry is actually for +// the response trailers, and not the response headers. The prefix +// is stripped after the ServeHTTP call finishes and the values are +// sent in the trailers. +// +// This mechanism is intended only for trailers that are not known +// prior to the headers being written. If the set of trailers is fixed +// or known before the header is written, the normal Go trailers mechanism +// is preferred: +// +// https://golang.org/pkg/net/http/#ResponseWriter +// https://golang.org/pkg/net/http/#example_ResponseWriter_trailers +const TrailerPrefix = "Trailer:" + +// promoteUndeclaredTrailers permits http.Handlers to set trailers +// after the header has already been flushed. Because the Go +// ResponseWriter interface has no way to set Trailers (only the +// Header), and because we didn't want to expand the ResponseWriter +// interface, and because nobody used trailers, and because RFC 7230 +// says you SHOULD (but not must) predeclare any trailers in the +// header, the official ResponseWriter rules said trailers in Go must +// be predeclared, and then we reuse the same ResponseWriter.Header() +// map to mean both Headers and Trailers. When it's time to write the +// Trailers, we pick out the fields of Headers that were declared as +// trailers. That worked for a while, until we found the first major +// user of Trailers in the wild: gRPC (using them only over http2), +// and gRPC libraries permit setting trailers mid-stream without +// predeclaring them. So: change of plans. We still permit the old +// way, but we also permit this hack: if a Header() key begins with +// "Trailer:", the suffix of that key is a Trailer. Because ':' is an +// invalid token byte anyway, there is no ambiguity. (And it's already +// filtered out) It's mildly hacky, but not terrible. +// +// This method runs after the Handler is done and promotes any Header +// fields to be trailers. +func (rws *responseWriterState) promoteUndeclaredTrailers() { + for k, vv := range rws.handlerHeader { + if !strings.HasPrefix(k, TrailerPrefix) { + continue + } + trailerKey := strings.TrimPrefix(k, TrailerPrefix) + rws.declareTrailer(trailerKey) + rws.handlerHeader[http.CanonicalHeaderKey(trailerKey)] = vv + } + + if len(rws.trailers) > 1 { + sorter := sorterPool.Get().(*sorter) + sorter.SortStrings(rws.trailers) + sorterPool.Put(sorter) + } +} + +func (w *responseWriter) SetReadDeadline(deadline time.Time) error { + st := w.rws.stream + if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) { + // If we're setting a deadline in the past, reset the stream immediately + // so writes after SetWriteDeadline returns will fail. + st.onReadTimeout() + return nil + } + w.rws.conn.sendServeMsg(func(sc *serverConn) { + if st.readDeadline != nil { + if !st.readDeadline.Stop() { + // Deadline already exceeded, or stream has been closed. + return + } + } + if deadline.IsZero() { + st.readDeadline = nil + } else if st.readDeadline == nil { + st.readDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onReadTimeout) + } else { + st.readDeadline.Reset(deadline.Sub(sc.srv.now())) + } + }) + return nil +} + +func (w *responseWriter) SetWriteDeadline(deadline time.Time) error { + st := w.rws.stream + if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) { + // If we're setting a deadline in the past, reset the stream immediately + // so writes after SetWriteDeadline returns will fail. + st.onWriteTimeout() + return nil + } + w.rws.conn.sendServeMsg(func(sc *serverConn) { + if st.writeDeadline != nil { + if !st.writeDeadline.Stop() { + // Deadline already exceeded, or stream has been closed. + return + } + } + if deadline.IsZero() { + st.writeDeadline = nil + } else if st.writeDeadline == nil { + st.writeDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onWriteTimeout) + } else { + st.writeDeadline.Reset(deadline.Sub(sc.srv.now())) + } + }) + return nil +} + +func (w *responseWriter) EnableFullDuplex() error { + // We always support full duplex responses, so this is a no-op. + return nil +} + +func (w *responseWriter) Flush() { + w.FlushError() +} + +func (w *responseWriter) FlushError() error { + rws := w.rws + if rws == nil { + panic("Header called after Handler finished") + } + var err error + if rws.bw.Buffered() > 0 { + err = rws.bw.Flush() + } else { + // The bufio.Writer won't call chunkWriter.Write + // (writeChunk with zero bytes), so we have to do it + // ourselves to force the HTTP response header and/or + // final DATA frame (with END_STREAM) to be sent. + _, err = chunkWriter{rws}.Write(nil) + if err == nil { + select { + case <-rws.stream.cw: + err = rws.stream.closeErr + default: + } + } + } + return err +} + +func (w *responseWriter) CloseNotify() <-chan bool { + rws := w.rws + if rws == nil { + panic("CloseNotify called after Handler finished") + } + rws.closeNotifierMu.Lock() + ch := rws.closeNotifierCh + if ch == nil { + ch = make(chan bool, 1) + rws.closeNotifierCh = ch + cw := rws.stream.cw + go func() { + cw.Wait() // wait for close + ch <- true + }() + } + rws.closeNotifierMu.Unlock() + return ch +} + +func (w *responseWriter) Header() http.Header { + rws := w.rws + if rws == nil { + panic("Header called after Handler finished") + } + if rws.handlerHeader == nil { + rws.handlerHeader = make(http.Header) + } + return rws.handlerHeader +} + +// checkWriteHeaderCode is a copy of net/http's checkWriteHeaderCode. +func checkWriteHeaderCode(code int) { + // Issue 22880: require valid WriteHeader status codes. + // For now we only enforce that it's three digits. + // In the future we might block things over 599 (600 and above aren't defined + // at http://httpwg.org/specs/rfc7231.html#status.codes). + // But for now any three digits. + // + // We used to send "HTTP/1.1 000 0" on the wire in responses but there's + // no equivalent bogus thing we can realistically send in HTTP/2, + // so we'll consistently panic instead and help people find their bugs + // early. (We can't return an error from WriteHeader even if we wanted to.) + if code < 100 || code > 999 { + panic(fmt.Sprintf("invalid WriteHeader code %v", code)) + } +} + +func (w *responseWriter) WriteHeader(code int) { + rws := w.rws + if rws == nil { + panic("WriteHeader called after Handler finished") + } + rws.writeHeader(code) +} + +func (rws *responseWriterState) writeHeader(code int) { + if rws.wroteHeader { + return + } + + checkWriteHeaderCode(code) + + // Handle informational headers + if code >= 100 && code <= 199 { + // Per RFC 8297 we must not clear the current header map + h := rws.handlerHeader + + _, cl := h["Content-Length"] + _, te := h["Transfer-Encoding"] + if cl || te { + h = h.Clone() + h.Del("Content-Length") + h.Del("Transfer-Encoding") + } + + rws.conn.writeHeaders(rws.stream, &writeResHeaders{ + streamID: rws.stream.id, + httpResCode: code, + h: h, + endStream: rws.handlerDone && !rws.hasTrailers(), + }) + + return + } + + rws.wroteHeader = true + rws.status = code + if len(rws.handlerHeader) > 0 { + rws.snapHeader = cloneHeader(rws.handlerHeader) + } +} + +func cloneHeader(h http.Header) http.Header { + h2 := make(http.Header, len(h)) + for k, vv := range h { + vv2 := make([]string, len(vv)) + copy(vv2, vv) + h2[k] = vv2 + } + return h2 +} + +// The Life Of A Write is like this: +// +// * Handler calls w.Write or w.WriteString -> +// * -> rws.bw (*bufio.Writer) -> +// * (Handler might call Flush) +// * -> chunkWriter{rws} +// * -> responseWriterState.writeChunk(p []byte) +// * -> responseWriterState.writeChunk (most of the magic; see comment there) +func (w *responseWriter) Write(p []byte) (n int, err error) { + return w.write(len(p), p, "") +} + +func (w *responseWriter) WriteString(s string) (n int, err error) { + return w.write(len(s), nil, s) +} + +// either dataB or dataS is non-zero. +func (w *responseWriter) write(lenData int, dataB []byte, dataS string) (n int, err error) { + rws := w.rws + if rws == nil { + panic("Write called after Handler finished") + } + if !rws.wroteHeader { + w.WriteHeader(200) + } + if !bodyAllowedForStatus(rws.status) { + return 0, http.ErrBodyNotAllowed + } + rws.wroteBytes += int64(len(dataB)) + int64(len(dataS)) // only one can be set + if rws.sentContentLen != 0 && rws.wroteBytes > rws.sentContentLen { + // TODO: send a RST_STREAM + return 0, errors.New("http2: handler wrote more than declared Content-Length") + } + + if dataB != nil { + return rws.bw.Write(dataB) + } else { + return rws.bw.WriteString(dataS) + } +} + +func (w *responseWriter) handlerDone() { + rws := w.rws + rws.handlerDone = true + w.Flush() + w.rws = nil + responseWriterStatePool.Put(rws) +} + +// Push errors. +var ( + ErrRecursivePush = errors.New("http2: recursive push not allowed") + ErrPushLimitReached = errors.New("http2: push would exceed peer's SETTINGS_MAX_CONCURRENT_STREAMS") +) + +var _ http.Pusher = (*responseWriter)(nil) + +func (w *responseWriter) Push(target string, opts *http.PushOptions) error { + st := w.rws.stream + sc := st.sc + sc.serveG.checkNotOn() + + // No recursive pushes: "PUSH_PROMISE frames MUST only be sent on a peer-initiated stream." + // http://tools.ietf.org/html/rfc7540#section-6.6 + if st.isPushed() { + return ErrRecursivePush + } + + if opts == nil { + opts = new(http.PushOptions) + } + + // Default options. + if opts.Method == "" { + opts.Method = "GET" + } + if opts.Header == nil { + opts.Header = http.Header{} + } + wantScheme := "http" + if w.rws.req.TLS != nil { + wantScheme = "https" + } + + // Validate the request. + u, err := url.Parse(target) + if err != nil { + return err + } + if u.Scheme == "" { + if !strings.HasPrefix(target, "/") { + return fmt.Errorf("target must be an absolute URL or an absolute path: %q", target) + } + u.Scheme = wantScheme + u.Host = w.rws.req.Host + } else { + if u.Scheme != wantScheme { + return fmt.Errorf("cannot push URL with scheme %q from request with scheme %q", u.Scheme, wantScheme) + } + if u.Host == "" { + return errors.New("URL must have a host") + } + } + for k := range opts.Header { + if strings.HasPrefix(k, ":") { + return fmt.Errorf("promised request headers cannot include pseudo header %q", k) + } + // These headers are meaningful only if the request has a body, + // but PUSH_PROMISE requests cannot have a body. + // http://tools.ietf.org/html/rfc7540#section-8.2 + // Also disallow Host, since the promised URL must be absolute. + if asciiEqualFold(k, "content-length") || + asciiEqualFold(k, "content-encoding") || + asciiEqualFold(k, "trailer") || + asciiEqualFold(k, "te") || + asciiEqualFold(k, "expect") || + asciiEqualFold(k, "host") { + return fmt.Errorf("promised request headers cannot include %q", k) + } + } + if err := checkValidHTTP2RequestHeaders(opts.Header); err != nil { + return err + } + + // The RFC effectively limits promised requests to GET and HEAD: + // "Promised requests MUST be cacheable [GET, HEAD, or POST], and MUST be safe [GET or HEAD]" + // http://tools.ietf.org/html/rfc7540#section-8.2 + if opts.Method != "GET" && opts.Method != "HEAD" { + return fmt.Errorf("method %q must be GET or HEAD", opts.Method) + } + + msg := &startPushRequest{ + parent: st, + method: opts.Method, + url: u, + header: cloneHeader(opts.Header), + done: errChanPool.Get().(chan error), + } + + select { + case <-sc.doneServing: + return errClientDisconnected + case <-st.cw: + return errStreamClosed + case sc.serveMsgCh <- msg: + } + + select { + case <-sc.doneServing: + return errClientDisconnected + case <-st.cw: + return errStreamClosed + case err := <-msg.done: + errChanPool.Put(msg.done) + return err + } +} + +type startPushRequest struct { + parent *stream + method string + url *url.URL + header http.Header + done chan error +} + +func (sc *serverConn) startPush(msg *startPushRequest) { + sc.serveG.check() + + // http://tools.ietf.org/html/rfc7540#section-6.6. + // PUSH_PROMISE frames MUST only be sent on a peer-initiated stream that + // is in either the "open" or "half-closed (remote)" state. + if msg.parent.state != stateOpen && msg.parent.state != stateHalfClosedRemote { + // responseWriter.Push checks that the stream is peer-initiated. + msg.done <- errStreamClosed + return + } + + // http://tools.ietf.org/html/rfc7540#section-6.6. + if !sc.pushEnabled { + msg.done <- http.ErrNotSupported + return + } + + // PUSH_PROMISE frames must be sent in increasing order by stream ID, so + // we allocate an ID for the promised stream lazily, when the PUSH_PROMISE + // is written. Once the ID is allocated, we start the request handler. + allocatePromisedID := func() (uint32, error) { + sc.serveG.check() + + // Check this again, just in case. Technically, we might have received + // an updated SETTINGS by the time we got around to writing this frame. + if !sc.pushEnabled { + return 0, http.ErrNotSupported + } + // http://tools.ietf.org/html/rfc7540#section-6.5.2. + if sc.curPushedStreams+1 > sc.clientMaxStreams { + return 0, ErrPushLimitReached + } + + // http://tools.ietf.org/html/rfc7540#section-5.1.1. + // Streams initiated by the server MUST use even-numbered identifiers. + // A server that is unable to establish a new stream identifier can send a GOAWAY + // frame so that the client is forced to open a new connection for new streams. + if sc.maxPushPromiseID+2 >= 1<<31 { + sc.startGracefulShutdownInternal() + return 0, ErrPushLimitReached + } + sc.maxPushPromiseID += 2 + promisedID := sc.maxPushPromiseID + + // http://tools.ietf.org/html/rfc7540#section-8.2. + // Strictly speaking, the new stream should start in "reserved (local)", then + // transition to "half closed (remote)" after sending the initial HEADERS, but + // we start in "half closed (remote)" for simplicity. + // See further comments at the definition of stateHalfClosedRemote. + promised := sc.newStream(promisedID, msg.parent.id, stateHalfClosedRemote) + rw, req, err := sc.newWriterAndRequestNoBody(promised, httpcommon.ServerRequestParam{ + Method: msg.method, + Scheme: msg.url.Scheme, + Authority: msg.url.Host, + Path: msg.url.RequestURI(), + Header: cloneHeader(msg.header), // clone since handler runs concurrently with writing the PUSH_PROMISE + }) + if err != nil { + // Should not happen, since we've already validated msg.url. + panic(fmt.Sprintf("newWriterAndRequestNoBody(%+v): %v", msg.url, err)) + } + + sc.curHandlers++ + go sc.runHandler(rw, req, sc.handler.ServeHTTP) + return promisedID, nil + } + + sc.writeFrame(FrameWriteRequest{ + write: &writePushPromise{ + streamID: msg.parent.id, + method: msg.method, + url: msg.url, + h: msg.header, + allocatePromisedID: allocatePromisedID, + }, + stream: msg.parent, + done: msg.done, + }) +} + +// foreachHeaderElement splits v according to the "#rule" construction +// in RFC 7230 section 7 and calls fn for each non-empty element. +func foreachHeaderElement(v string, fn func(string)) { + v = textproto.TrimString(v) + if v == "" { + return + } + if !strings.Contains(v, ",") { + fn(v) + return + } + for _, f := range strings.Split(v, ",") { + if f = textproto.TrimString(f); f != "" { + fn(f) + } + } +} + +// From http://httpwg.org/specs/rfc7540.html#rfc.section.8.1.2.2 +var connHeaders = []string{ + "Connection", + "Keep-Alive", + "Proxy-Connection", + "Transfer-Encoding", + "Upgrade", +} + +// checkValidHTTP2RequestHeaders checks whether h is a valid HTTP/2 request, +// per RFC 7540 Section 8.1.2.2. +// The returned error is reported to users. +func checkValidHTTP2RequestHeaders(h http.Header) error { + for _, k := range connHeaders { + if _, ok := h[k]; ok { + return fmt.Errorf("request header %q is not valid in HTTP/2", k) + } + } + te := h["Te"] + if len(te) > 0 && (len(te) > 1 || (te[0] != "trailers" && te[0] != "")) { + return errors.New(`request header "TE" may only be "trailers" in HTTP/2`) + } + return nil +} + +func new400Handler(err error) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + http.Error(w, err.Error(), http.StatusBadRequest) + } +} + +// h1ServerKeepAlivesDisabled reports whether hs has its keep-alives +// disabled. See comments on h1ServerShutdownChan above for why +// the code is written this way. +func h1ServerKeepAlivesDisabled(hs *http.Server) bool { + var x interface{} = hs + type I interface { + doKeepAlives() bool + } + if hs, ok := x.(I); ok { + return !hs.doKeepAlives() + } + return false +} + +func (sc *serverConn) countError(name string, err error) error { + if sc == nil || sc.srv == nil { + return err + } + f := sc.countErrorFunc + if f == nil { + return err + } + var typ string + var code ErrCode + switch e := err.(type) { + case ConnectionError: + typ = "conn" + code = ErrCode(e) + case StreamError: + typ = "stream" + code = ErrCode(e.Code) + default: + return err + } + codeStr := errCodeName[code] + if codeStr == "" { + codeStr = strconv.Itoa(int(code)) + } + f(fmt.Sprintf("%s_%s_%s", typ, codeStr, name)) + return err +} diff --git a/vendor/golang.org/x/net/http2/timer.go b/vendor/golang.org/x/net/http2/timer.go new file mode 100644 index 0000000..0b1c17b --- /dev/null +++ b/vendor/golang.org/x/net/http2/timer.go @@ -0,0 +1,20 @@ +// Copyright 2024 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 http2 + +import "time" + +// A timer is a time.Timer, as an interface which can be replaced in tests. +type timer = interface { + C() <-chan time.Time + Reset(d time.Duration) bool + Stop() bool +} + +// timeTimer adapts a time.Timer to the timer interface. +type timeTimer struct { + *time.Timer +} + +func (t timeTimer) C() <-chan time.Time { return t.Timer.C } diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go new file mode 100644 index 0000000..f26356b --- /dev/null +++ b/vendor/golang.org/x/net/http2/transport.go @@ -0,0 +1,3287 @@ +// Copyright 2015 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. + +// Transport code. + +package http2 + +import ( + "bufio" + "bytes" + "compress/gzip" + "context" + "crypto/rand" + "crypto/tls" + "errors" + "fmt" + "io" + "io/fs" + "log" + "math" + "math/bits" + mathrand "math/rand" + "net" + "net/http" + "net/http/httptrace" + "net/textproto" + "strconv" + "strings" + "sync" + "sync/atomic" + "time" + + "golang.org/x/net/http/httpguts" + "golang.org/x/net/http2/hpack" + "golang.org/x/net/idna" + "golang.org/x/net/internal/httpcommon" +) + +const ( + // transportDefaultConnFlow is how many connection-level flow control + // tokens we give the server at start-up, past the default 64k. + transportDefaultConnFlow = 1 << 30 + + // transportDefaultStreamFlow is how many stream-level flow + // control tokens we announce to the peer, and how many bytes + // we buffer per stream. + transportDefaultStreamFlow = 4 << 20 + + defaultUserAgent = "Go-http-client/2.0" + + // initialMaxConcurrentStreams is a connections maxConcurrentStreams until + // it's received servers initial SETTINGS frame, which corresponds with the + // spec's minimum recommended value. + initialMaxConcurrentStreams = 100 + + // defaultMaxConcurrentStreams is a connections default maxConcurrentStreams + // if the server doesn't include one in its initial SETTINGS frame. + defaultMaxConcurrentStreams = 1000 +) + +// Transport is an HTTP/2 Transport. +// +// A Transport internally caches connections to servers. It is safe +// for concurrent use by multiple goroutines. +type Transport struct { + // DialTLSContext specifies an optional dial function with context for + // creating TLS connections for requests. + // + // If DialTLSContext and DialTLS is nil, tls.Dial is used. + // + // If the returned net.Conn has a ConnectionState method like tls.Conn, + // it will be used to set http.Response.TLS. + DialTLSContext func(ctx context.Context, network, addr string, cfg *tls.Config) (net.Conn, error) + + // DialTLS specifies an optional dial function for creating + // TLS connections for requests. + // + // If DialTLSContext and DialTLS is nil, tls.Dial is used. + // + // Deprecated: Use DialTLSContext instead, which allows the transport + // to cancel dials as soon as they are no longer needed. + // If both are set, DialTLSContext takes priority. + DialTLS func(network, addr string, cfg *tls.Config) (net.Conn, error) + + // TLSClientConfig specifies the TLS configuration to use with + // tls.Client. If nil, the default configuration is used. + TLSClientConfig *tls.Config + + // ConnPool optionally specifies an alternate connection pool to use. + // If nil, the default is used. + ConnPool ClientConnPool + + // DisableCompression, if true, prevents the Transport from + // requesting compression with an "Accept-Encoding: gzip" + // request header when the Request contains no existing + // Accept-Encoding value. If the Transport requests gzip on + // its own and gets a gzipped response, it's transparently + // decoded in the Response.Body. However, if the user + // explicitly requested gzip it is not automatically + // uncompressed. + DisableCompression bool + + // AllowHTTP, if true, permits HTTP/2 requests using the insecure, + // plain-text "http" scheme. Note that this does not enable h2c support. + AllowHTTP bool + + // MaxHeaderListSize is the http2 SETTINGS_MAX_HEADER_LIST_SIZE to + // send in the initial settings frame. It is how many bytes + // of response headers are allowed. Unlike the http2 spec, zero here + // means to use a default limit (currently 10MB). If you actually + // want to advertise an unlimited value to the peer, Transport + // interprets the highest possible value here (0xffffffff or 1<<32-1) + // to mean no limit. + MaxHeaderListSize uint32 + + // MaxReadFrameSize is the http2 SETTINGS_MAX_FRAME_SIZE to send in the + // initial settings frame. It is the size in bytes of the largest frame + // payload that the sender is willing to receive. If 0, no setting is + // sent, and the value is provided by the peer, which should be 16384 + // according to the spec: + // https://datatracker.ietf.org/doc/html/rfc7540#section-6.5.2. + // Values are bounded in the range 16k to 16M. + MaxReadFrameSize uint32 + + // MaxDecoderHeaderTableSize optionally specifies the http2 + // SETTINGS_HEADER_TABLE_SIZE to send in the initial settings frame. It + // informs the remote endpoint of the maximum size of the header compression + // table used to decode header blocks, in octets. If zero, the default value + // of 4096 is used. + MaxDecoderHeaderTableSize uint32 + + // MaxEncoderHeaderTableSize optionally specifies an upper limit for the + // header compression table used for encoding request headers. Received + // SETTINGS_HEADER_TABLE_SIZE settings are capped at this limit. If zero, + // the default value of 4096 is used. + MaxEncoderHeaderTableSize uint32 + + // StrictMaxConcurrentStreams controls whether the server's + // SETTINGS_MAX_CONCURRENT_STREAMS should be respected + // globally. If false, new TCP connections are created to the + // server as needed to keep each under the per-connection + // SETTINGS_MAX_CONCURRENT_STREAMS limit. If true, the + // server's SETTINGS_MAX_CONCURRENT_STREAMS is interpreted as + // a global limit and callers of RoundTrip block when needed, + // waiting for their turn. + StrictMaxConcurrentStreams bool + + // IdleConnTimeout is the maximum amount of time an idle + // (keep-alive) connection will remain idle before closing + // itself. + // Zero means no limit. + IdleConnTimeout time.Duration + + // ReadIdleTimeout is the timeout after which a health check using ping + // frame will be carried out if no frame is received on the connection. + // Note that a ping response will is considered a received frame, so if + // there is no other traffic on the connection, the health check will + // be performed every ReadIdleTimeout interval. + // If zero, no health check is performed. + ReadIdleTimeout time.Duration + + // PingTimeout is the timeout after which the connection will be closed + // if a response to Ping is not received. + // Defaults to 15s. + PingTimeout time.Duration + + // WriteByteTimeout is the timeout after which the connection will be + // closed no data can be written to it. The timeout begins when data is + // available to write, and is extended whenever any bytes are written. + WriteByteTimeout time.Duration + + // CountError, if non-nil, is called on HTTP/2 transport errors. + // It's intended to increment a metric for monitoring, such + // as an expvar or Prometheus metric. + // The errType consists of only ASCII word characters. + CountError func(errType string) + + // t1, if non-nil, is the standard library Transport using + // this transport. Its settings are used (but not its + // RoundTrip method, etc). + t1 *http.Transport + + connPoolOnce sync.Once + connPoolOrDef ClientConnPool // non-nil version of ConnPool + + *transportTestHooks +} + +// Hook points used for testing. +// Outside of tests, t.transportTestHooks is nil and these all have minimal implementations. +// Inside tests, see the testSyncHooks function docs. + +type transportTestHooks struct { + newclientconn func(*ClientConn) + group synctestGroupInterface +} + +func (t *Transport) markNewGoroutine() { + if t != nil && t.transportTestHooks != nil { + t.transportTestHooks.group.Join() + } +} + +func (t *Transport) now() time.Time { + if t != nil && t.transportTestHooks != nil { + return t.transportTestHooks.group.Now() + } + return time.Now() +} + +func (t *Transport) timeSince(when time.Time) time.Duration { + if t != nil && t.transportTestHooks != nil { + return t.now().Sub(when) + } + return time.Since(when) +} + +// newTimer creates a new time.Timer, or a synthetic timer in tests. +func (t *Transport) newTimer(d time.Duration) timer { + if t.transportTestHooks != nil { + return t.transportTestHooks.group.NewTimer(d) + } + return timeTimer{time.NewTimer(d)} +} + +// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests. +func (t *Transport) afterFunc(d time.Duration, f func()) timer { + if t.transportTestHooks != nil { + return t.transportTestHooks.group.AfterFunc(d, f) + } + return timeTimer{time.AfterFunc(d, f)} +} + +func (t *Transport) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) { + if t.transportTestHooks != nil { + return t.transportTestHooks.group.ContextWithTimeout(ctx, d) + } + return context.WithTimeout(ctx, d) +} + +func (t *Transport) maxHeaderListSize() uint32 { + n := int64(t.MaxHeaderListSize) + if t.t1 != nil && t.t1.MaxResponseHeaderBytes != 0 { + n = t.t1.MaxResponseHeaderBytes + if n > 0 { + n = adjustHTTP1MaxHeaderSize(n) + } + } + if n <= 0 { + return 10 << 20 + } + if n >= 0xffffffff { + return 0 + } + return uint32(n) +} + +func (t *Transport) disableCompression() bool { + return t.DisableCompression || (t.t1 != nil && t.t1.DisableCompression) +} + +// ConfigureTransport configures a net/http HTTP/1 Transport to use HTTP/2. +// It returns an error if t1 has already been HTTP/2-enabled. +// +// Use ConfigureTransports instead to configure the HTTP/2 Transport. +func ConfigureTransport(t1 *http.Transport) error { + _, err := ConfigureTransports(t1) + return err +} + +// ConfigureTransports configures a net/http HTTP/1 Transport to use HTTP/2. +// It returns a new HTTP/2 Transport for further configuration. +// It returns an error if t1 has already been HTTP/2-enabled. +func ConfigureTransports(t1 *http.Transport) (*Transport, error) { + return configureTransports(t1) +} + +func configureTransports(t1 *http.Transport) (*Transport, error) { + connPool := new(clientConnPool) + t2 := &Transport{ + ConnPool: noDialClientConnPool{connPool}, + t1: t1, + } + connPool.t = t2 + if err := registerHTTPSProtocol(t1, noDialH2RoundTripper{t2}); err != nil { + return nil, err + } + if t1.TLSClientConfig == nil { + t1.TLSClientConfig = new(tls.Config) + } + if !strSliceContains(t1.TLSClientConfig.NextProtos, "h2") { + t1.TLSClientConfig.NextProtos = append([]string{"h2"}, t1.TLSClientConfig.NextProtos...) + } + if !strSliceContains(t1.TLSClientConfig.NextProtos, "http/1.1") { + t1.TLSClientConfig.NextProtos = append(t1.TLSClientConfig.NextProtos, "http/1.1") + } + upgradeFn := func(scheme, authority string, c net.Conn) http.RoundTripper { + addr := authorityAddr(scheme, authority) + if used, err := connPool.addConnIfNeeded(addr, t2, c); err != nil { + go c.Close() + return erringRoundTripper{err} + } else if !used { + // Turns out we don't need this c. + // For example, two goroutines made requests to the same host + // at the same time, both kicking off TCP dials. (since protocol + // was unknown) + go c.Close() + } + if scheme == "http" { + return (*unencryptedTransport)(t2) + } + return t2 + } + if t1.TLSNextProto == nil { + t1.TLSNextProto = make(map[string]func(string, *tls.Conn) http.RoundTripper) + } + t1.TLSNextProto[NextProtoTLS] = func(authority string, c *tls.Conn) http.RoundTripper { + return upgradeFn("https", authority, c) + } + // The "unencrypted_http2" TLSNextProto key is used to pass off non-TLS HTTP/2 conns. + t1.TLSNextProto[nextProtoUnencryptedHTTP2] = func(authority string, c *tls.Conn) http.RoundTripper { + nc, err := unencryptedNetConnFromTLSConn(c) + if err != nil { + go c.Close() + return erringRoundTripper{err} + } + return upgradeFn("http", authority, nc) + } + return t2, nil +} + +// unencryptedTransport is a Transport with a RoundTrip method that +// always permits http:// URLs. +type unencryptedTransport Transport + +func (t *unencryptedTransport) RoundTrip(req *http.Request) (*http.Response, error) { + return (*Transport)(t).RoundTripOpt(req, RoundTripOpt{allowHTTP: true}) +} + +func (t *Transport) connPool() ClientConnPool { + t.connPoolOnce.Do(t.initConnPool) + return t.connPoolOrDef +} + +func (t *Transport) initConnPool() { + if t.ConnPool != nil { + t.connPoolOrDef = t.ConnPool + } else { + t.connPoolOrDef = &clientConnPool{t: t} + } +} + +// ClientConn is the state of a single HTTP/2 client connection to an +// HTTP/2 server. +type ClientConn struct { + t *Transport + tconn net.Conn // usually *tls.Conn, except specialized impls + tlsState *tls.ConnectionState // nil only for specialized impls + atomicReused uint32 // whether conn is being reused; atomic + singleUse bool // whether being used for a single http.Request + getConnCalled bool // used by clientConnPool + + // readLoop goroutine fields: + readerDone chan struct{} // closed on error + readerErr error // set before readerDone is closed + + idleTimeout time.Duration // or 0 for never + idleTimer timer + + mu sync.Mutex // guards following + cond *sync.Cond // hold mu; broadcast on flow/closed changes + flow outflow // our conn-level flow control quota (cs.outflow is per stream) + inflow inflow // peer's conn-level flow control + doNotReuse bool // whether conn is marked to not be reused for any future requests + closing bool + closed bool + closedOnIdle bool // true if conn was closed for idleness + seenSettings bool // true if we've seen a settings frame, false otherwise + seenSettingsChan chan struct{} // closed when seenSettings is true or frame reading fails + wantSettingsAck bool // we sent a SETTINGS frame and haven't heard back + goAway *GoAwayFrame // if non-nil, the GoAwayFrame we received + goAwayDebug string // goAway frame's debug data, retained as a string + streams map[uint32]*clientStream // client-initiated + streamsReserved int // incr by ReserveNewRequest; decr on RoundTrip + nextStreamID uint32 + pendingRequests int // requests blocked and waiting to be sent because len(streams) == maxConcurrentStreams + pings map[[8]byte]chan struct{} // in flight ping data to notification channel + br *bufio.Reader + lastActive time.Time + lastIdle time.Time // time last idle + // Settings from peer: (also guarded by wmu) + maxFrameSize uint32 + maxConcurrentStreams uint32 + peerMaxHeaderListSize uint64 + peerMaxHeaderTableSize uint32 + initialWindowSize uint32 + initialStreamRecvWindowSize int32 + readIdleTimeout time.Duration + pingTimeout time.Duration + extendedConnectAllowed bool + + // rstStreamPingsBlocked works around an unfortunate gRPC behavior. + // gRPC strictly limits the number of PING frames that it will receive. + // The default is two pings per two hours, but the limit resets every time + // the gRPC endpoint sends a HEADERS or DATA frame. See golang/go#70575. + // + // rstStreamPingsBlocked is set after receiving a response to a PING frame + // bundled with an RST_STREAM (see pendingResets below), and cleared after + // receiving a HEADERS or DATA frame. + rstStreamPingsBlocked bool + + // pendingResets is the number of RST_STREAM frames we have sent to the peer, + // without confirming that the peer has received them. When we send a RST_STREAM, + // we bundle it with a PING frame, unless a PING is already in flight. We count + // the reset stream against the connection's concurrency limit until we get + // a PING response. This limits the number of requests we'll try to send to a + // completely unresponsive connection. + pendingResets int + + // reqHeaderMu is a 1-element semaphore channel controlling access to sending new requests. + // Write to reqHeaderMu to lock it, read from it to unlock. + // Lock reqmu BEFORE mu or wmu. + reqHeaderMu chan struct{} + + // wmu is held while writing. + // Acquire BEFORE mu when holding both, to avoid blocking mu on network writes. + // Only acquire both at the same time when changing peer settings. + wmu sync.Mutex + bw *bufio.Writer + fr *Framer + werr error // first write error that has occurred + hbuf bytes.Buffer // HPACK encoder writes into this + henc *hpack.Encoder +} + +// clientStream is the state for a single HTTP/2 stream. One of these +// is created for each Transport.RoundTrip call. +type clientStream struct { + cc *ClientConn + + // Fields of Request that we may access even after the response body is closed. + ctx context.Context + reqCancel <-chan struct{} + + trace *httptrace.ClientTrace // or nil + ID uint32 + bufPipe pipe // buffered pipe with the flow-controlled response payload + requestedGzip bool + isHead bool + + abortOnce sync.Once + abort chan struct{} // closed to signal stream should end immediately + abortErr error // set if abort is closed + + peerClosed chan struct{} // closed when the peer sends an END_STREAM flag + donec chan struct{} // closed after the stream is in the closed state + on100 chan struct{} // buffered; written to if a 100 is received + + respHeaderRecv chan struct{} // closed when headers are received + res *http.Response // set if respHeaderRecv is closed + + flow outflow // guarded by cc.mu + inflow inflow // guarded by cc.mu + bytesRemain int64 // -1 means unknown; owned by transportResponseBody.Read + readErr error // sticky read error; owned by transportResponseBody.Read + + reqBody io.ReadCloser + reqBodyContentLength int64 // -1 means unknown + reqBodyClosed chan struct{} // guarded by cc.mu; non-nil on Close, closed when done + + // owned by writeRequest: + sentEndStream bool // sent an END_STREAM flag to the peer + sentHeaders bool + + // owned by clientConnReadLoop: + firstByte bool // got the first response byte + pastHeaders bool // got first MetaHeadersFrame (actual headers) + pastTrailers bool // got optional second MetaHeadersFrame (trailers) + readClosed bool // peer sent an END_STREAM flag + readAborted bool // read loop reset the stream + totalHeaderSize int64 // total size of 1xx headers seen + + trailer http.Header // accumulated trailers + resTrailer *http.Header // client's Response.Trailer +} + +var got1xxFuncForTests func(int, textproto.MIMEHeader) error + +// get1xxTraceFunc returns the value of request's httptrace.ClientTrace.Got1xxResponse func, +// if any. It returns nil if not set or if the Go version is too old. +func (cs *clientStream) get1xxTraceFunc() func(int, textproto.MIMEHeader) error { + if fn := got1xxFuncForTests; fn != nil { + return fn + } + return traceGot1xxResponseFunc(cs.trace) +} + +func (cs *clientStream) abortStream(err error) { + cs.cc.mu.Lock() + defer cs.cc.mu.Unlock() + cs.abortStreamLocked(err) +} + +func (cs *clientStream) abortStreamLocked(err error) { + cs.abortOnce.Do(func() { + cs.abortErr = err + close(cs.abort) + }) + if cs.reqBody != nil { + cs.closeReqBodyLocked() + } + // TODO(dneil): Clean up tests where cs.cc.cond is nil. + if cs.cc.cond != nil { + // Wake up writeRequestBody if it is waiting on flow control. + cs.cc.cond.Broadcast() + } +} + +func (cs *clientStream) abortRequestBodyWrite() { + cc := cs.cc + cc.mu.Lock() + defer cc.mu.Unlock() + if cs.reqBody != nil && cs.reqBodyClosed == nil { + cs.closeReqBodyLocked() + cc.cond.Broadcast() + } +} + +func (cs *clientStream) closeReqBodyLocked() { + if cs.reqBodyClosed != nil { + return + } + cs.reqBodyClosed = make(chan struct{}) + reqBodyClosed := cs.reqBodyClosed + go func() { + cs.cc.t.markNewGoroutine() + cs.reqBody.Close() + close(reqBodyClosed) + }() +} + +type stickyErrWriter struct { + group synctestGroupInterface + conn net.Conn + timeout time.Duration + err *error +} + +func (sew stickyErrWriter) Write(p []byte) (n int, err error) { + if *sew.err != nil { + return 0, *sew.err + } + n, err = writeWithByteTimeout(sew.group, sew.conn, sew.timeout, p) + *sew.err = err + return n, err +} + +// noCachedConnError is the concrete type of ErrNoCachedConn, which +// needs to be detected by net/http regardless of whether it's its +// bundled version (in h2_bundle.go with a rewritten type name) or +// from a user's x/net/http2. As such, as it has a unique method name +// (IsHTTP2NoCachedConnError) that net/http sniffs for via func +// isNoCachedConnError. +type noCachedConnError struct{} + +func (noCachedConnError) IsHTTP2NoCachedConnError() {} +func (noCachedConnError) Error() string { return "http2: no cached connection was available" } + +// isNoCachedConnError reports whether err is of type noCachedConnError +// or its equivalent renamed type in net/http2's h2_bundle.go. Both types +// may coexist in the same running program. +func isNoCachedConnError(err error) bool { + _, ok := err.(interface{ IsHTTP2NoCachedConnError() }) + return ok +} + +var ErrNoCachedConn error = noCachedConnError{} + +// RoundTripOpt are options for the Transport.RoundTripOpt method. +type RoundTripOpt struct { + // OnlyCachedConn controls whether RoundTripOpt may + // create a new TCP connection. If set true and + // no cached connection is available, RoundTripOpt + // will return ErrNoCachedConn. + OnlyCachedConn bool + + allowHTTP bool // allow http:// URLs +} + +func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { + return t.RoundTripOpt(req, RoundTripOpt{}) +} + +// authorityAddr returns a given authority (a host/IP, or host:port / ip:port) +// and returns a host:port. The port 443 is added if needed. +func authorityAddr(scheme string, authority string) (addr string) { + host, port, err := net.SplitHostPort(authority) + if err != nil { // authority didn't have a port + host = authority + port = "" + } + if port == "" { // authority's port was empty + port = "443" + if scheme == "http" { + port = "80" + } + } + if a, err := idna.ToASCII(host); err == nil { + host = a + } + // IPv6 address literal, without a port: + if strings.HasPrefix(host, "[") && strings.HasSuffix(host, "]") { + return host + ":" + port + } + return net.JoinHostPort(host, port) +} + +// RoundTripOpt is like RoundTrip, but takes options. +func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Response, error) { + switch req.URL.Scheme { + case "https": + // Always okay. + case "http": + if !t.AllowHTTP && !opt.allowHTTP { + return nil, errors.New("http2: unencrypted HTTP/2 not enabled") + } + default: + return nil, errors.New("http2: unsupported scheme") + } + + addr := authorityAddr(req.URL.Scheme, req.URL.Host) + for retry := 0; ; retry++ { + cc, err := t.connPool().GetClientConn(req, addr) + if err != nil { + t.vlogf("http2: Transport failed to get client conn for %s: %v", addr, err) + return nil, err + } + reused := !atomic.CompareAndSwapUint32(&cc.atomicReused, 0, 1) + traceGotConn(req, cc, reused) + res, err := cc.RoundTrip(req) + if err != nil && retry <= 6 { + roundTripErr := err + if req, err = shouldRetryRequest(req, err); err == nil { + // After the first retry, do exponential backoff with 10% jitter. + if retry == 0 { + t.vlogf("RoundTrip retrying after failure: %v", roundTripErr) + continue + } + backoff := float64(uint(1) << (uint(retry) - 1)) + backoff += backoff * (0.1 * mathrand.Float64()) + d := time.Second * time.Duration(backoff) + tm := t.newTimer(d) + select { + case <-tm.C(): + t.vlogf("RoundTrip retrying after failure: %v", roundTripErr) + continue + case <-req.Context().Done(): + tm.Stop() + err = req.Context().Err() + } + } + } + if err == errClientConnNotEstablished { + // This ClientConn was created recently, + // this is the first request to use it, + // and the connection is closed and not usable. + // + // In this state, cc.idleTimer will remove the conn from the pool + // when it fires. Stop the timer and remove it here so future requests + // won't try to use this connection. + // + // If the timer has already fired and we're racing it, the redundant + // call to MarkDead is harmless. + if cc.idleTimer != nil { + cc.idleTimer.Stop() + } + t.connPool().MarkDead(cc) + } + if err != nil { + t.vlogf("RoundTrip failure: %v", err) + return nil, err + } + return res, nil + } +} + +// CloseIdleConnections closes any connections which were previously +// connected from previous requests but are now sitting idle. +// It does not interrupt any connections currently in use. +func (t *Transport) CloseIdleConnections() { + if cp, ok := t.connPool().(clientConnPoolIdleCloser); ok { + cp.closeIdleConnections() + } +} + +var ( + errClientConnClosed = errors.New("http2: client conn is closed") + errClientConnUnusable = errors.New("http2: client conn not usable") + errClientConnNotEstablished = errors.New("http2: client conn could not be established") + errClientConnGotGoAway = errors.New("http2: Transport received Server's graceful shutdown GOAWAY") +) + +// shouldRetryRequest is called by RoundTrip when a request fails to get +// response headers. It is always called with a non-nil error. +// It returns either a request to retry (either the same request, or a +// modified clone), or an error if the request can't be replayed. +func shouldRetryRequest(req *http.Request, err error) (*http.Request, error) { + if !canRetryError(err) { + return nil, err + } + // If the Body is nil (or http.NoBody), it's safe to reuse + // this request and its Body. + if req.Body == nil || req.Body == http.NoBody { + return req, nil + } + + // If the request body can be reset back to its original + // state via the optional req.GetBody, do that. + if req.GetBody != nil { + body, err := req.GetBody() + if err != nil { + return nil, err + } + newReq := *req + newReq.Body = body + return &newReq, nil + } + + // The Request.Body can't reset back to the beginning, but we + // don't seem to have started to read from it yet, so reuse + // the request directly. + if err == errClientConnUnusable { + return req, nil + } + + return nil, fmt.Errorf("http2: Transport: cannot retry err [%v] after Request.Body was written; define Request.GetBody to avoid this error", err) +} + +func canRetryError(err error) bool { + if err == errClientConnUnusable || err == errClientConnGotGoAway { + return true + } + if se, ok := err.(StreamError); ok { + if se.Code == ErrCodeProtocol && se.Cause == errFromPeer { + // See golang/go#47635, golang/go#42777 + return true + } + return se.Code == ErrCodeRefusedStream + } + return false +} + +func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse bool) (*ClientConn, error) { + if t.transportTestHooks != nil { + return t.newClientConn(nil, singleUse) + } + host, _, err := net.SplitHostPort(addr) + if err != nil { + return nil, err + } + tconn, err := t.dialTLS(ctx, "tcp", addr, t.newTLSConfig(host)) + if err != nil { + return nil, err + } + return t.newClientConn(tconn, singleUse) +} + +func (t *Transport) newTLSConfig(host string) *tls.Config { + cfg := new(tls.Config) + if t.TLSClientConfig != nil { + *cfg = *t.TLSClientConfig.Clone() + } + if !strSliceContains(cfg.NextProtos, NextProtoTLS) { + cfg.NextProtos = append([]string{NextProtoTLS}, cfg.NextProtos...) + } + if cfg.ServerName == "" { + cfg.ServerName = host + } + return cfg +} + +func (t *Transport) dialTLS(ctx context.Context, network, addr string, tlsCfg *tls.Config) (net.Conn, error) { + if t.DialTLSContext != nil { + return t.DialTLSContext(ctx, network, addr, tlsCfg) + } else if t.DialTLS != nil { + return t.DialTLS(network, addr, tlsCfg) + } + + tlsCn, err := t.dialTLSWithContext(ctx, network, addr, tlsCfg) + if err != nil { + return nil, err + } + state := tlsCn.ConnectionState() + if p := state.NegotiatedProtocol; p != NextProtoTLS { + return nil, fmt.Errorf("http2: unexpected ALPN protocol %q; want %q", p, NextProtoTLS) + } + if !state.NegotiatedProtocolIsMutual { + return nil, errors.New("http2: could not negotiate protocol mutually") + } + return tlsCn, nil +} + +// disableKeepAlives reports whether connections should be closed as +// soon as possible after handling the first request. +func (t *Transport) disableKeepAlives() bool { + return t.t1 != nil && t.t1.DisableKeepAlives +} + +func (t *Transport) expectContinueTimeout() time.Duration { + if t.t1 == nil { + return 0 + } + return t.t1.ExpectContinueTimeout +} + +func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) { + return t.newClientConn(c, t.disableKeepAlives()) +} + +func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, error) { + conf := configFromTransport(t) + cc := &ClientConn{ + t: t, + tconn: c, + readerDone: make(chan struct{}), + nextStreamID: 1, + maxFrameSize: 16 << 10, // spec default + initialWindowSize: 65535, // spec default + initialStreamRecvWindowSize: conf.MaxUploadBufferPerStream, + maxConcurrentStreams: initialMaxConcurrentStreams, // "infinite", per spec. Use a smaller value until we have received server settings. + peerMaxHeaderListSize: 0xffffffffffffffff, // "infinite", per spec. Use 2^64-1 instead. + streams: make(map[uint32]*clientStream), + singleUse: singleUse, + seenSettingsChan: make(chan struct{}), + wantSettingsAck: true, + readIdleTimeout: conf.SendPingTimeout, + pingTimeout: conf.PingTimeout, + pings: make(map[[8]byte]chan struct{}), + reqHeaderMu: make(chan struct{}, 1), + lastActive: t.now(), + } + var group synctestGroupInterface + if t.transportTestHooks != nil { + t.markNewGoroutine() + t.transportTestHooks.newclientconn(cc) + c = cc.tconn + group = t.group + } + if VerboseLogs { + t.vlogf("http2: Transport creating client conn %p to %v", cc, c.RemoteAddr()) + } + + cc.cond = sync.NewCond(&cc.mu) + cc.flow.add(int32(initialWindowSize)) + + // TODO: adjust this writer size to account for frame size + + // MTU + crypto/tls record padding. + cc.bw = bufio.NewWriter(stickyErrWriter{ + group: group, + conn: c, + timeout: conf.WriteByteTimeout, + err: &cc.werr, + }) + cc.br = bufio.NewReader(c) + cc.fr = NewFramer(cc.bw, cc.br) + cc.fr.SetMaxReadFrameSize(conf.MaxReadFrameSize) + if t.CountError != nil { + cc.fr.countError = t.CountError + } + maxHeaderTableSize := conf.MaxDecoderHeaderTableSize + cc.fr.ReadMetaHeaders = hpack.NewDecoder(maxHeaderTableSize, nil) + cc.fr.MaxHeaderListSize = t.maxHeaderListSize() + + cc.henc = hpack.NewEncoder(&cc.hbuf) + cc.henc.SetMaxDynamicTableSizeLimit(conf.MaxEncoderHeaderTableSize) + cc.peerMaxHeaderTableSize = initialHeaderTableSize + + if cs, ok := c.(connectionStater); ok { + state := cs.ConnectionState() + cc.tlsState = &state + } + + initialSettings := []Setting{ + {ID: SettingEnablePush, Val: 0}, + {ID: SettingInitialWindowSize, Val: uint32(cc.initialStreamRecvWindowSize)}, + } + initialSettings = append(initialSettings, Setting{ID: SettingMaxFrameSize, Val: conf.MaxReadFrameSize}) + if max := t.maxHeaderListSize(); max != 0 { + initialSettings = append(initialSettings, Setting{ID: SettingMaxHeaderListSize, Val: max}) + } + if maxHeaderTableSize != initialHeaderTableSize { + initialSettings = append(initialSettings, Setting{ID: SettingHeaderTableSize, Val: maxHeaderTableSize}) + } + + cc.bw.Write(clientPreface) + cc.fr.WriteSettings(initialSettings...) + cc.fr.WriteWindowUpdate(0, uint32(conf.MaxUploadBufferPerConnection)) + cc.inflow.init(conf.MaxUploadBufferPerConnection + initialWindowSize) + cc.bw.Flush() + if cc.werr != nil { + cc.Close() + return nil, cc.werr + } + + // Start the idle timer after the connection is fully initialized. + if d := t.idleConnTimeout(); d != 0 { + cc.idleTimeout = d + cc.idleTimer = t.afterFunc(d, cc.onIdleTimeout) + } + + go cc.readLoop() + return cc, nil +} + +func (cc *ClientConn) healthCheck() { + pingTimeout := cc.pingTimeout + // We don't need to periodically ping in the health check, because the readLoop of ClientConn will + // trigger the healthCheck again if there is no frame received. + ctx, cancel := cc.t.contextWithTimeout(context.Background(), pingTimeout) + defer cancel() + cc.vlogf("http2: Transport sending health check") + err := cc.Ping(ctx) + if err != nil { + cc.vlogf("http2: Transport health check failure: %v", err) + cc.closeForLostPing() + } else { + cc.vlogf("http2: Transport health check success") + } +} + +// SetDoNotReuse marks cc as not reusable for future HTTP requests. +func (cc *ClientConn) SetDoNotReuse() { + cc.mu.Lock() + defer cc.mu.Unlock() + cc.doNotReuse = true +} + +func (cc *ClientConn) setGoAway(f *GoAwayFrame) { + cc.mu.Lock() + defer cc.mu.Unlock() + + old := cc.goAway + cc.goAway = f + + // Merge the previous and current GoAway error frames. + if cc.goAwayDebug == "" { + cc.goAwayDebug = string(f.DebugData()) + } + if old != nil && old.ErrCode != ErrCodeNo { + cc.goAway.ErrCode = old.ErrCode + } + last := f.LastStreamID + for streamID, cs := range cc.streams { + if streamID <= last { + // The server's GOAWAY indicates that it received this stream. + // It will either finish processing it, or close the connection + // without doing so. Either way, leave the stream alone for now. + continue + } + if streamID == 1 && cc.goAway.ErrCode != ErrCodeNo { + // Don't retry the first stream on a connection if we get a non-NO error. + // If the server is sending an error on a new connection, + // retrying the request on a new one probably isn't going to work. + cs.abortStreamLocked(fmt.Errorf("http2: Transport received GOAWAY from server ErrCode:%v", cc.goAway.ErrCode)) + } else { + // Aborting the stream with errClentConnGotGoAway indicates that + // the request should be retried on a new connection. + cs.abortStreamLocked(errClientConnGotGoAway) + } + } +} + +// CanTakeNewRequest reports whether the connection can take a new request, +// meaning it has not been closed or received or sent a GOAWAY. +// +// If the caller is going to immediately make a new request on this +// connection, use ReserveNewRequest instead. +func (cc *ClientConn) CanTakeNewRequest() bool { + cc.mu.Lock() + defer cc.mu.Unlock() + return cc.canTakeNewRequestLocked() +} + +// ReserveNewRequest is like CanTakeNewRequest but also reserves a +// concurrent stream in cc. The reservation is decremented on the +// next call to RoundTrip. +func (cc *ClientConn) ReserveNewRequest() bool { + cc.mu.Lock() + defer cc.mu.Unlock() + if st := cc.idleStateLocked(); !st.canTakeNewRequest { + return false + } + cc.streamsReserved++ + return true +} + +// ClientConnState describes the state of a ClientConn. +type ClientConnState struct { + // Closed is whether the connection is closed. + Closed bool + + // Closing is whether the connection is in the process of + // closing. It may be closing due to shutdown, being a + // single-use connection, being marked as DoNotReuse, or + // having received a GOAWAY frame. + Closing bool + + // StreamsActive is how many streams are active. + StreamsActive int + + // StreamsReserved is how many streams have been reserved via + // ClientConn.ReserveNewRequest. + StreamsReserved int + + // StreamsPending is how many requests have been sent in excess + // of the peer's advertised MaxConcurrentStreams setting and + // are waiting for other streams to complete. + StreamsPending int + + // MaxConcurrentStreams is how many concurrent streams the + // peer advertised as acceptable. Zero means no SETTINGS + // frame has been received yet. + MaxConcurrentStreams uint32 + + // LastIdle, if non-zero, is when the connection last + // transitioned to idle state. + LastIdle time.Time +} + +// State returns a snapshot of cc's state. +func (cc *ClientConn) State() ClientConnState { + cc.wmu.Lock() + maxConcurrent := cc.maxConcurrentStreams + if !cc.seenSettings { + maxConcurrent = 0 + } + cc.wmu.Unlock() + + cc.mu.Lock() + defer cc.mu.Unlock() + return ClientConnState{ + Closed: cc.closed, + Closing: cc.closing || cc.singleUse || cc.doNotReuse || cc.goAway != nil, + StreamsActive: len(cc.streams) + cc.pendingResets, + StreamsReserved: cc.streamsReserved, + StreamsPending: cc.pendingRequests, + LastIdle: cc.lastIdle, + MaxConcurrentStreams: maxConcurrent, + } +} + +// clientConnIdleState describes the suitability of a client +// connection to initiate a new RoundTrip request. +type clientConnIdleState struct { + canTakeNewRequest bool +} + +func (cc *ClientConn) idleState() clientConnIdleState { + cc.mu.Lock() + defer cc.mu.Unlock() + return cc.idleStateLocked() +} + +func (cc *ClientConn) idleStateLocked() (st clientConnIdleState) { + if cc.singleUse && cc.nextStreamID > 1 { + return + } + var maxConcurrentOkay bool + if cc.t.StrictMaxConcurrentStreams { + // We'll tell the caller we can take a new request to + // prevent the caller from dialing a new TCP + // connection, but then we'll block later before + // writing it. + maxConcurrentOkay = true + } else { + // We can take a new request if the total of + // - active streams; + // - reservation slots for new streams; and + // - streams for which we have sent a RST_STREAM and a PING, + // but received no subsequent frame + // is less than the concurrency limit. + maxConcurrentOkay = cc.currentRequestCountLocked() < int(cc.maxConcurrentStreams) + } + + st.canTakeNewRequest = cc.goAway == nil && !cc.closed && !cc.closing && maxConcurrentOkay && + !cc.doNotReuse && + int64(cc.nextStreamID)+2*int64(cc.pendingRequests) < math.MaxInt32 && + !cc.tooIdleLocked() + + // If this connection has never been used for a request and is closed, + // then let it take a request (which will fail). + // If the conn was closed for idleness, we're racing the idle timer; + // don't try to use the conn. (Issue #70515.) + // + // This avoids a situation where an error early in a connection's lifetime + // goes unreported. + if cc.nextStreamID == 1 && cc.streamsReserved == 0 && cc.closed && !cc.closedOnIdle { + st.canTakeNewRequest = true + } + + return +} + +// currentRequestCountLocked reports the number of concurrency slots currently in use, +// including active streams, reserved slots, and reset streams waiting for acknowledgement. +func (cc *ClientConn) currentRequestCountLocked() int { + return len(cc.streams) + cc.streamsReserved + cc.pendingResets +} + +func (cc *ClientConn) canTakeNewRequestLocked() bool { + st := cc.idleStateLocked() + return st.canTakeNewRequest +} + +// tooIdleLocked reports whether this connection has been been sitting idle +// for too much wall time. +func (cc *ClientConn) tooIdleLocked() bool { + // The Round(0) strips the monontonic clock reading so the + // times are compared based on their wall time. We don't want + // to reuse a connection that's been sitting idle during + // VM/laptop suspend if monotonic time was also frozen. + return cc.idleTimeout != 0 && !cc.lastIdle.IsZero() && cc.t.timeSince(cc.lastIdle.Round(0)) > cc.idleTimeout +} + +// onIdleTimeout is called from a time.AfterFunc goroutine. It will +// only be called when we're idle, but because we're coming from a new +// goroutine, there could be a new request coming in at the same time, +// so this simply calls the synchronized closeIfIdle to shut down this +// connection. The timer could just call closeIfIdle, but this is more +// clear. +func (cc *ClientConn) onIdleTimeout() { + cc.closeIfIdle() +} + +func (cc *ClientConn) closeConn() { + t := time.AfterFunc(250*time.Millisecond, cc.forceCloseConn) + defer t.Stop() + cc.tconn.Close() +} + +// A tls.Conn.Close can hang for a long time if the peer is unresponsive. +// Try to shut it down more aggressively. +func (cc *ClientConn) forceCloseConn() { + tc, ok := cc.tconn.(*tls.Conn) + if !ok { + return + } + if nc := tc.NetConn(); nc != nil { + nc.Close() + } +} + +func (cc *ClientConn) closeIfIdle() { + cc.mu.Lock() + if len(cc.streams) > 0 || cc.streamsReserved > 0 { + cc.mu.Unlock() + return + } + cc.closed = true + cc.closedOnIdle = true + nextID := cc.nextStreamID + // TODO: do clients send GOAWAY too? maybe? Just Close: + cc.mu.Unlock() + + if VerboseLogs { + cc.vlogf("http2: Transport closing idle conn %p (forSingleUse=%v, maxStream=%v)", cc, cc.singleUse, nextID-2) + } + cc.closeConn() +} + +func (cc *ClientConn) isDoNotReuseAndIdle() bool { + cc.mu.Lock() + defer cc.mu.Unlock() + return cc.doNotReuse && len(cc.streams) == 0 +} + +var shutdownEnterWaitStateHook = func() {} + +// Shutdown gracefully closes the client connection, waiting for running streams to complete. +func (cc *ClientConn) Shutdown(ctx context.Context) error { + if err := cc.sendGoAway(); err != nil { + return err + } + // Wait for all in-flight streams to complete or connection to close + done := make(chan struct{}) + cancelled := false // guarded by cc.mu + go func() { + cc.t.markNewGoroutine() + cc.mu.Lock() + defer cc.mu.Unlock() + for { + if len(cc.streams) == 0 || cc.closed { + cc.closed = true + close(done) + break + } + if cancelled { + break + } + cc.cond.Wait() + } + }() + shutdownEnterWaitStateHook() + select { + case <-done: + cc.closeConn() + return nil + case <-ctx.Done(): + cc.mu.Lock() + // Free the goroutine above + cancelled = true + cc.cond.Broadcast() + cc.mu.Unlock() + return ctx.Err() + } +} + +func (cc *ClientConn) sendGoAway() error { + cc.mu.Lock() + closing := cc.closing + cc.closing = true + maxStreamID := cc.nextStreamID + cc.mu.Unlock() + if closing { + // GOAWAY sent already + return nil + } + + cc.wmu.Lock() + defer cc.wmu.Unlock() + // Send a graceful shutdown frame to server + if err := cc.fr.WriteGoAway(maxStreamID, ErrCodeNo, nil); err != nil { + return err + } + if err := cc.bw.Flush(); err != nil { + return err + } + // Prevent new requests + return nil +} + +// closes the client connection immediately. In-flight requests are interrupted. +// err is sent to streams. +func (cc *ClientConn) closeForError(err error) { + cc.mu.Lock() + cc.closed = true + for _, cs := range cc.streams { + cs.abortStreamLocked(err) + } + cc.cond.Broadcast() + cc.mu.Unlock() + cc.closeConn() +} + +// Close closes the client connection immediately. +// +// In-flight requests are interrupted. For a graceful shutdown, use Shutdown instead. +func (cc *ClientConn) Close() error { + err := errors.New("http2: client connection force closed via ClientConn.Close") + cc.closeForError(err) + return nil +} + +// closes the client connection immediately. In-flight requests are interrupted. +func (cc *ClientConn) closeForLostPing() { + err := errors.New("http2: client connection lost") + if f := cc.t.CountError; f != nil { + f("conn_close_lost_ping") + } + cc.closeForError(err) +} + +// errRequestCanceled is a copy of net/http's errRequestCanceled because it's not +// exported. At least they'll be DeepEqual for h1-vs-h2 comparisons tests. +var errRequestCanceled = errors.New("net/http: request canceled") + +func (cc *ClientConn) responseHeaderTimeout() time.Duration { + if cc.t.t1 != nil { + return cc.t.t1.ResponseHeaderTimeout + } + // No way to do this (yet?) with just an http2.Transport. Probably + // no need. Request.Cancel this is the new way. We only need to support + // this for compatibility with the old http.Transport fields when + // we're doing transparent http2. + return 0 +} + +// actualContentLength returns a sanitized version of +// req.ContentLength, where 0 actually means zero (not unknown) and -1 +// means unknown. +func actualContentLength(req *http.Request) int64 { + if req.Body == nil || req.Body == http.NoBody { + return 0 + } + if req.ContentLength != 0 { + return req.ContentLength + } + return -1 +} + +func (cc *ClientConn) decrStreamReservations() { + cc.mu.Lock() + defer cc.mu.Unlock() + cc.decrStreamReservationsLocked() +} + +func (cc *ClientConn) decrStreamReservationsLocked() { + if cc.streamsReserved > 0 { + cc.streamsReserved-- + } +} + +func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) { + return cc.roundTrip(req, nil) +} + +func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) (*http.Response, error) { + ctx := req.Context() + cs := &clientStream{ + cc: cc, + ctx: ctx, + reqCancel: req.Cancel, + isHead: req.Method == "HEAD", + reqBody: req.Body, + reqBodyContentLength: actualContentLength(req), + trace: httptrace.ContextClientTrace(ctx), + peerClosed: make(chan struct{}), + abort: make(chan struct{}), + respHeaderRecv: make(chan struct{}), + donec: make(chan struct{}), + } + + cs.requestedGzip = httpcommon.IsRequestGzip(req.Method, req.Header, cc.t.disableCompression()) + + go cs.doRequest(req, streamf) + + waitDone := func() error { + select { + case <-cs.donec: + return nil + case <-ctx.Done(): + return ctx.Err() + case <-cs.reqCancel: + return errRequestCanceled + } + } + + handleResponseHeaders := func() (*http.Response, error) { + res := cs.res + if res.StatusCode > 299 { + // On error or status code 3xx, 4xx, 5xx, etc abort any + // ongoing write, assuming that the server doesn't care + // about our request body. If the server replied with 1xx or + // 2xx, however, then assume the server DOES potentially + // want our body (e.g. full-duplex streaming: + // golang.org/issue/13444). If it turns out the server + // doesn't, they'll RST_STREAM us soon enough. This is a + // heuristic to avoid adding knobs to Transport. Hopefully + // we can keep it. + cs.abortRequestBodyWrite() + } + res.Request = req + res.TLS = cc.tlsState + if res.Body == noBody && actualContentLength(req) == 0 { + // If there isn't a request or response body still being + // written, then wait for the stream to be closed before + // RoundTrip returns. + if err := waitDone(); err != nil { + return nil, err + } + } + return res, nil + } + + cancelRequest := func(cs *clientStream, err error) error { + cs.cc.mu.Lock() + bodyClosed := cs.reqBodyClosed + cs.cc.mu.Unlock() + // Wait for the request body to be closed. + // + // If nothing closed the body before now, abortStreamLocked + // will have started a goroutine to close it. + // + // Closing the body before returning avoids a race condition + // with net/http checking its readTrackingBody to see if the + // body was read from or closed. See golang/go#60041. + // + // The body is closed in a separate goroutine without the + // connection mutex held, but dropping the mutex before waiting + // will keep us from holding it indefinitely if the body + // close is slow for some reason. + if bodyClosed != nil { + <-bodyClosed + } + return err + } + + for { + select { + case <-cs.respHeaderRecv: + return handleResponseHeaders() + case <-cs.abort: + select { + case <-cs.respHeaderRecv: + // If both cs.respHeaderRecv and cs.abort are signaling, + // pick respHeaderRecv. The server probably wrote the + // response and immediately reset the stream. + // golang.org/issue/49645 + return handleResponseHeaders() + default: + waitDone() + return nil, cs.abortErr + } + case <-ctx.Done(): + err := ctx.Err() + cs.abortStream(err) + return nil, cancelRequest(cs, err) + case <-cs.reqCancel: + cs.abortStream(errRequestCanceled) + return nil, cancelRequest(cs, errRequestCanceled) + } + } +} + +// doRequest runs for the duration of the request lifetime. +// +// It sends the request and performs post-request cleanup (closing Request.Body, etc.). +func (cs *clientStream) doRequest(req *http.Request, streamf func(*clientStream)) { + cs.cc.t.markNewGoroutine() + err := cs.writeRequest(req, streamf) + cs.cleanupWriteRequest(err) +} + +var errExtendedConnectNotSupported = errors.New("net/http: extended connect not supported by peer") + +// writeRequest sends a request. +// +// It returns nil after the request is written, the response read, +// and the request stream is half-closed by the peer. +// +// It returns non-nil if the request ends otherwise. +// If the returned error is StreamError, the error Code may be used in resetting the stream. +func (cs *clientStream) writeRequest(req *http.Request, streamf func(*clientStream)) (err error) { + cc := cs.cc + ctx := cs.ctx + + // wait for setting frames to be received, a server can change this value later, + // but we just wait for the first settings frame + var isExtendedConnect bool + if req.Method == "CONNECT" && req.Header.Get(":protocol") != "" { + isExtendedConnect = true + } + + // Acquire the new-request lock by writing to reqHeaderMu. + // This lock guards the critical section covering allocating a new stream ID + // (requires mu) and creating the stream (requires wmu). + if cc.reqHeaderMu == nil { + panic("RoundTrip on uninitialized ClientConn") // for tests + } + if isExtendedConnect { + select { + case <-cs.reqCancel: + return errRequestCanceled + case <-ctx.Done(): + return ctx.Err() + case <-cc.seenSettingsChan: + if !cc.extendedConnectAllowed { + return errExtendedConnectNotSupported + } + } + } + select { + case cc.reqHeaderMu <- struct{}{}: + case <-cs.reqCancel: + return errRequestCanceled + case <-ctx.Done(): + return ctx.Err() + } + + cc.mu.Lock() + if cc.idleTimer != nil { + cc.idleTimer.Stop() + } + cc.decrStreamReservationsLocked() + if err := cc.awaitOpenSlotForStreamLocked(cs); err != nil { + cc.mu.Unlock() + <-cc.reqHeaderMu + return err + } + cc.addStreamLocked(cs) // assigns stream ID + if isConnectionCloseRequest(req) { + cc.doNotReuse = true + } + cc.mu.Unlock() + + if streamf != nil { + streamf(cs) + } + + continueTimeout := cc.t.expectContinueTimeout() + if continueTimeout != 0 { + if !httpguts.HeaderValuesContainsToken(req.Header["Expect"], "100-continue") { + continueTimeout = 0 + } else { + cs.on100 = make(chan struct{}, 1) + } + } + + // Past this point (where we send request headers), it is possible for + // RoundTrip to return successfully. Since the RoundTrip contract permits + // the caller to "mutate or reuse" the Request after closing the Response's Body, + // we must take care when referencing the Request from here on. + err = cs.encodeAndWriteHeaders(req) + <-cc.reqHeaderMu + if err != nil { + return err + } + + hasBody := cs.reqBodyContentLength != 0 + if !hasBody { + cs.sentEndStream = true + } else { + if continueTimeout != 0 { + traceWait100Continue(cs.trace) + timer := time.NewTimer(continueTimeout) + select { + case <-timer.C: + err = nil + case <-cs.on100: + err = nil + case <-cs.abort: + err = cs.abortErr + case <-ctx.Done(): + err = ctx.Err() + case <-cs.reqCancel: + err = errRequestCanceled + } + timer.Stop() + if err != nil { + traceWroteRequest(cs.trace, err) + return err + } + } + + if err = cs.writeRequestBody(req); err != nil { + if err != errStopReqBodyWrite { + traceWroteRequest(cs.trace, err) + return err + } + } else { + cs.sentEndStream = true + } + } + + traceWroteRequest(cs.trace, err) + + var respHeaderTimer <-chan time.Time + var respHeaderRecv chan struct{} + if d := cc.responseHeaderTimeout(); d != 0 { + timer := cc.t.newTimer(d) + defer timer.Stop() + respHeaderTimer = timer.C() + respHeaderRecv = cs.respHeaderRecv + } + // Wait until the peer half-closes its end of the stream, + // or until the request is aborted (via context, error, or otherwise), + // whichever comes first. + for { + select { + case <-cs.peerClosed: + return nil + case <-respHeaderTimer: + return errTimeout + case <-respHeaderRecv: + respHeaderRecv = nil + respHeaderTimer = nil // keep waiting for END_STREAM + case <-cs.abort: + return cs.abortErr + case <-ctx.Done(): + return ctx.Err() + case <-cs.reqCancel: + return errRequestCanceled + } + } +} + +func (cs *clientStream) encodeAndWriteHeaders(req *http.Request) error { + cc := cs.cc + ctx := cs.ctx + + cc.wmu.Lock() + defer cc.wmu.Unlock() + + // If the request was canceled while waiting for cc.mu, just quit. + select { + case <-cs.abort: + return cs.abortErr + case <-ctx.Done(): + return ctx.Err() + case <-cs.reqCancel: + return errRequestCanceled + default: + } + + // Encode headers. + // + // we send: HEADERS{1}, CONTINUATION{0,} + DATA{0,} (DATA is + // sent by writeRequestBody below, along with any Trailers, + // again in form HEADERS{1}, CONTINUATION{0,}) + cc.hbuf.Reset() + res, err := encodeRequestHeaders(req, cs.requestedGzip, cc.peerMaxHeaderListSize, func(name, value string) { + cc.writeHeader(name, value) + }) + if err != nil { + return fmt.Errorf("http2: %w", err) + } + hdrs := cc.hbuf.Bytes() + + // Write the request. + endStream := !res.HasBody && !res.HasTrailers + cs.sentHeaders = true + err = cc.writeHeaders(cs.ID, endStream, int(cc.maxFrameSize), hdrs) + traceWroteHeaders(cs.trace) + return err +} + +func encodeRequestHeaders(req *http.Request, addGzipHeader bool, peerMaxHeaderListSize uint64, headerf func(name, value string)) (httpcommon.EncodeHeadersResult, error) { + return httpcommon.EncodeHeaders(req.Context(), httpcommon.EncodeHeadersParam{ + Request: httpcommon.Request{ + Header: req.Header, + Trailer: req.Trailer, + URL: req.URL, + Host: req.Host, + Method: req.Method, + ActualContentLength: actualContentLength(req), + }, + AddGzipHeader: addGzipHeader, + PeerMaxHeaderListSize: peerMaxHeaderListSize, + DefaultUserAgent: defaultUserAgent, + }, headerf) +} + +// cleanupWriteRequest performs post-request tasks. +// +// If err (the result of writeRequest) is non-nil and the stream is not closed, +// cleanupWriteRequest will send a reset to the peer. +func (cs *clientStream) cleanupWriteRequest(err error) { + cc := cs.cc + + if cs.ID == 0 { + // We were canceled before creating the stream, so return our reservation. + cc.decrStreamReservations() + } + + // TODO: write h12Compare test showing whether + // Request.Body is closed by the Transport, + // and in multiple cases: server replies <=299 and >299 + // while still writing request body + cc.mu.Lock() + mustCloseBody := false + if cs.reqBody != nil && cs.reqBodyClosed == nil { + mustCloseBody = true + cs.reqBodyClosed = make(chan struct{}) + } + bodyClosed := cs.reqBodyClosed + closeOnIdle := cc.singleUse || cc.doNotReuse || cc.t.disableKeepAlives() || cc.goAway != nil + cc.mu.Unlock() + if mustCloseBody { + cs.reqBody.Close() + close(bodyClosed) + } + if bodyClosed != nil { + <-bodyClosed + } + + if err != nil && cs.sentEndStream { + // If the connection is closed immediately after the response is read, + // we may be aborted before finishing up here. If the stream was closed + // cleanly on both sides, there is no error. + select { + case <-cs.peerClosed: + err = nil + default: + } + } + if err != nil { + cs.abortStream(err) // possibly redundant, but harmless + if cs.sentHeaders { + if se, ok := err.(StreamError); ok { + if se.Cause != errFromPeer { + cc.writeStreamReset(cs.ID, se.Code, false, err) + } + } else { + // We're cancelling an in-flight request. + // + // This could be due to the server becoming unresponsive. + // To avoid sending too many requests on a dead connection, + // we let the request continue to consume a concurrency slot + // until we can confirm the server is still responding. + // We do this by sending a PING frame along with the RST_STREAM + // (unless a ping is already in flight). + // + // For simplicity, we don't bother tracking the PING payload: + // We reset cc.pendingResets any time we receive a PING ACK. + // + // We skip this if the conn is going to be closed on idle, + // because it's short lived and will probably be closed before + // we get the ping response. + ping := false + if !closeOnIdle { + cc.mu.Lock() + // rstStreamPingsBlocked works around a gRPC behavior: + // see comment on the field for details. + if !cc.rstStreamPingsBlocked { + if cc.pendingResets == 0 { + ping = true + } + cc.pendingResets++ + } + cc.mu.Unlock() + } + cc.writeStreamReset(cs.ID, ErrCodeCancel, ping, err) + } + } + cs.bufPipe.CloseWithError(err) // no-op if already closed + } else { + if cs.sentHeaders && !cs.sentEndStream { + cc.writeStreamReset(cs.ID, ErrCodeNo, false, nil) + } + cs.bufPipe.CloseWithError(errRequestCanceled) + } + if cs.ID != 0 { + cc.forgetStreamID(cs.ID) + } + + cc.wmu.Lock() + werr := cc.werr + cc.wmu.Unlock() + if werr != nil { + cc.Close() + } + + close(cs.donec) +} + +// awaitOpenSlotForStreamLocked waits until len(streams) < maxConcurrentStreams. +// Must hold cc.mu. +func (cc *ClientConn) awaitOpenSlotForStreamLocked(cs *clientStream) error { + for { + if cc.closed && cc.nextStreamID == 1 && cc.streamsReserved == 0 { + // This is the very first request sent to this connection. + // Return a fatal error which aborts the retry loop. + return errClientConnNotEstablished + } + cc.lastActive = cc.t.now() + if cc.closed || !cc.canTakeNewRequestLocked() { + return errClientConnUnusable + } + cc.lastIdle = time.Time{} + if cc.currentRequestCountLocked() < int(cc.maxConcurrentStreams) { + return nil + } + cc.pendingRequests++ + cc.cond.Wait() + cc.pendingRequests-- + select { + case <-cs.abort: + return cs.abortErr + default: + } + } +} + +// requires cc.wmu be held +func (cc *ClientConn) writeHeaders(streamID uint32, endStream bool, maxFrameSize int, hdrs []byte) error { + first := true // first frame written (HEADERS is first, then CONTINUATION) + for len(hdrs) > 0 && cc.werr == nil { + chunk := hdrs + if len(chunk) > maxFrameSize { + chunk = chunk[:maxFrameSize] + } + hdrs = hdrs[len(chunk):] + endHeaders := len(hdrs) == 0 + if first { + cc.fr.WriteHeaders(HeadersFrameParam{ + StreamID: streamID, + BlockFragment: chunk, + EndStream: endStream, + EndHeaders: endHeaders, + }) + first = false + } else { + cc.fr.WriteContinuation(streamID, endHeaders, chunk) + } + } + cc.bw.Flush() + return cc.werr +} + +// internal error values; they don't escape to callers +var ( + // abort request body write; don't send cancel + errStopReqBodyWrite = errors.New("http2: aborting request body write") + + // abort request body write, but send stream reset of cancel. + errStopReqBodyWriteAndCancel = errors.New("http2: canceling request") + + errReqBodyTooLong = errors.New("http2: request body larger than specified content length") +) + +// frameScratchBufferLen returns the length of a buffer to use for +// outgoing request bodies to read/write to/from. +// +// It returns max(1, min(peer's advertised max frame size, +// Request.ContentLength+1, 512KB)). +func (cs *clientStream) frameScratchBufferLen(maxFrameSize int) int { + const max = 512 << 10 + n := int64(maxFrameSize) + if n > max { + n = max + } + if cl := cs.reqBodyContentLength; cl != -1 && cl+1 < n { + // Add an extra byte past the declared content-length to + // give the caller's Request.Body io.Reader a chance to + // give us more bytes than they declared, so we can catch it + // early. + n = cl + 1 + } + if n < 1 { + return 1 + } + return int(n) // doesn't truncate; max is 512K +} + +// Seven bufPools manage different frame sizes. This helps to avoid scenarios where long-running +// streaming requests using small frame sizes occupy large buffers initially allocated for prior +// requests needing big buffers. The size ranges are as follows: +// {0 KB, 16 KB], {16 KB, 32 KB], {32 KB, 64 KB], {64 KB, 128 KB], {128 KB, 256 KB], +// {256 KB, 512 KB], {512 KB, infinity} +// In practice, the maximum scratch buffer size should not exceed 512 KB due to +// frameScratchBufferLen(maxFrameSize), thus the "infinity pool" should never be used. +// It exists mainly as a safety measure, for potential future increases in max buffer size. +var bufPools [7]sync.Pool // of *[]byte +func bufPoolIndex(size int) int { + if size <= 16384 { + return 0 + } + size -= 1 + bits := bits.Len(uint(size)) + index := bits - 14 + if index >= len(bufPools) { + return len(bufPools) - 1 + } + return index +} + +func (cs *clientStream) writeRequestBody(req *http.Request) (err error) { + cc := cs.cc + body := cs.reqBody + sentEnd := false // whether we sent the final DATA frame w/ END_STREAM + + hasTrailers := req.Trailer != nil + remainLen := cs.reqBodyContentLength + hasContentLen := remainLen != -1 + + cc.mu.Lock() + maxFrameSize := int(cc.maxFrameSize) + cc.mu.Unlock() + + // Scratch buffer for reading into & writing from. + scratchLen := cs.frameScratchBufferLen(maxFrameSize) + var buf []byte + index := bufPoolIndex(scratchLen) + if bp, ok := bufPools[index].Get().(*[]byte); ok && len(*bp) >= scratchLen { + defer bufPools[index].Put(bp) + buf = *bp + } else { + buf = make([]byte, scratchLen) + defer bufPools[index].Put(&buf) + } + + var sawEOF bool + for !sawEOF { + n, err := body.Read(buf) + if hasContentLen { + remainLen -= int64(n) + if remainLen == 0 && err == nil { + // The request body's Content-Length was predeclared and + // we just finished reading it all, but the underlying io.Reader + // returned the final chunk with a nil error (which is one of + // the two valid things a Reader can do at EOF). Because we'd prefer + // to send the END_STREAM bit early, double-check that we're actually + // at EOF. Subsequent reads should return (0, EOF) at this point. + // If either value is different, we return an error in one of two ways below. + var scratch [1]byte + var n1 int + n1, err = body.Read(scratch[:]) + remainLen -= int64(n1) + } + if remainLen < 0 { + err = errReqBodyTooLong + return err + } + } + if err != nil { + cc.mu.Lock() + bodyClosed := cs.reqBodyClosed != nil + cc.mu.Unlock() + switch { + case bodyClosed: + return errStopReqBodyWrite + case err == io.EOF: + sawEOF = true + err = nil + default: + return err + } + } + + remain := buf[:n] + for len(remain) > 0 && err == nil { + var allowed int32 + allowed, err = cs.awaitFlowControl(len(remain)) + if err != nil { + return err + } + cc.wmu.Lock() + data := remain[:allowed] + remain = remain[allowed:] + sentEnd = sawEOF && len(remain) == 0 && !hasTrailers + err = cc.fr.WriteData(cs.ID, sentEnd, data) + if err == nil { + // TODO(bradfitz): this flush is for latency, not bandwidth. + // Most requests won't need this. Make this opt-in or + // opt-out? Use some heuristic on the body type? Nagel-like + // timers? Based on 'n'? Only last chunk of this for loop, + // unless flow control tokens are low? For now, always. + // If we change this, see comment below. + err = cc.bw.Flush() + } + cc.wmu.Unlock() + } + if err != nil { + return err + } + } + + if sentEnd { + // Already sent END_STREAM (which implies we have no + // trailers) and flushed, because currently all + // WriteData frames above get a flush. So we're done. + return nil + } + + // Since the RoundTrip contract permits the caller to "mutate or reuse" + // a request after the Response's Body is closed, verify that this hasn't + // happened before accessing the trailers. + cc.mu.Lock() + trailer := req.Trailer + err = cs.abortErr + cc.mu.Unlock() + if err != nil { + return err + } + + cc.wmu.Lock() + defer cc.wmu.Unlock() + var trls []byte + if len(trailer) > 0 { + trls, err = cc.encodeTrailers(trailer) + if err != nil { + return err + } + } + + // Two ways to send END_STREAM: either with trailers, or + // with an empty DATA frame. + if len(trls) > 0 { + err = cc.writeHeaders(cs.ID, true, maxFrameSize, trls) + } else { + err = cc.fr.WriteData(cs.ID, true, nil) + } + if ferr := cc.bw.Flush(); ferr != nil && err == nil { + err = ferr + } + return err +} + +// awaitFlowControl waits for [1, min(maxBytes, cc.cs.maxFrameSize)] flow +// control tokens from the server. +// It returns either the non-zero number of tokens taken or an error +// if the stream is dead. +func (cs *clientStream) awaitFlowControl(maxBytes int) (taken int32, err error) { + cc := cs.cc + ctx := cs.ctx + cc.mu.Lock() + defer cc.mu.Unlock() + for { + if cc.closed { + return 0, errClientConnClosed + } + if cs.reqBodyClosed != nil { + return 0, errStopReqBodyWrite + } + select { + case <-cs.abort: + return 0, cs.abortErr + case <-ctx.Done(): + return 0, ctx.Err() + case <-cs.reqCancel: + return 0, errRequestCanceled + default: + } + if a := cs.flow.available(); a > 0 { + take := a + if int(take) > maxBytes { + + take = int32(maxBytes) // can't truncate int; take is int32 + } + if take > int32(cc.maxFrameSize) { + take = int32(cc.maxFrameSize) + } + cs.flow.take(take) + return take, nil + } + cc.cond.Wait() + } +} + +// requires cc.wmu be held. +func (cc *ClientConn) encodeTrailers(trailer http.Header) ([]byte, error) { + cc.hbuf.Reset() + + hlSize := uint64(0) + for k, vv := range trailer { + for _, v := range vv { + hf := hpack.HeaderField{Name: k, Value: v} + hlSize += uint64(hf.Size()) + } + } + if hlSize > cc.peerMaxHeaderListSize { + return nil, errRequestHeaderListSize + } + + for k, vv := range trailer { + lowKey, ascii := httpcommon.LowerHeader(k) + if !ascii { + // Skip writing invalid headers. Per RFC 7540, Section 8.1.2, header + // field names have to be ASCII characters (just as in HTTP/1.x). + continue + } + // Transfer-Encoding, etc.. have already been filtered at the + // start of RoundTrip + for _, v := range vv { + cc.writeHeader(lowKey, v) + } + } + return cc.hbuf.Bytes(), nil +} + +func (cc *ClientConn) writeHeader(name, value string) { + if VerboseLogs { + log.Printf("http2: Transport encoding header %q = %q", name, value) + } + cc.henc.WriteField(hpack.HeaderField{Name: name, Value: value}) +} + +type resAndError struct { + _ incomparable + res *http.Response + err error +} + +// requires cc.mu be held. +func (cc *ClientConn) addStreamLocked(cs *clientStream) { + cs.flow.add(int32(cc.initialWindowSize)) + cs.flow.setConnFlow(&cc.flow) + cs.inflow.init(cc.initialStreamRecvWindowSize) + cs.ID = cc.nextStreamID + cc.nextStreamID += 2 + cc.streams[cs.ID] = cs + if cs.ID == 0 { + panic("assigned stream ID 0") + } +} + +func (cc *ClientConn) forgetStreamID(id uint32) { + cc.mu.Lock() + slen := len(cc.streams) + delete(cc.streams, id) + if len(cc.streams) != slen-1 { + panic("forgetting unknown stream id") + } + cc.lastActive = cc.t.now() + if len(cc.streams) == 0 && cc.idleTimer != nil { + cc.idleTimer.Reset(cc.idleTimeout) + cc.lastIdle = cc.t.now() + } + // Wake up writeRequestBody via clientStream.awaitFlowControl and + // wake up RoundTrip if there is a pending request. + cc.cond.Broadcast() + + closeOnIdle := cc.singleUse || cc.doNotReuse || cc.t.disableKeepAlives() || cc.goAway != nil + if closeOnIdle && cc.streamsReserved == 0 && len(cc.streams) == 0 { + if VerboseLogs { + cc.vlogf("http2: Transport closing idle conn %p (forSingleUse=%v, maxStream=%v)", cc, cc.singleUse, cc.nextStreamID-2) + } + cc.closed = true + defer cc.closeConn() + } + + cc.mu.Unlock() +} + +// clientConnReadLoop is the state owned by the clientConn's frame-reading readLoop. +type clientConnReadLoop struct { + _ incomparable + cc *ClientConn +} + +// readLoop runs in its own goroutine and reads and dispatches frames. +func (cc *ClientConn) readLoop() { + cc.t.markNewGoroutine() + rl := &clientConnReadLoop{cc: cc} + defer rl.cleanup() + cc.readerErr = rl.run() + if ce, ok := cc.readerErr.(ConnectionError); ok { + cc.wmu.Lock() + cc.fr.WriteGoAway(0, ErrCode(ce), nil) + cc.wmu.Unlock() + } +} + +// GoAwayError is returned by the Transport when the server closes the +// TCP connection after sending a GOAWAY frame. +type GoAwayError struct { + LastStreamID uint32 + ErrCode ErrCode + DebugData string +} + +func (e GoAwayError) Error() string { + return fmt.Sprintf("http2: server sent GOAWAY and closed the connection; LastStreamID=%v, ErrCode=%v, debug=%q", + e.LastStreamID, e.ErrCode, e.DebugData) +} + +func isEOFOrNetReadError(err error) bool { + if err == io.EOF { + return true + } + ne, ok := err.(*net.OpError) + return ok && ne.Op == "read" +} + +func (rl *clientConnReadLoop) cleanup() { + cc := rl.cc + defer cc.closeConn() + defer close(cc.readerDone) + + if cc.idleTimer != nil { + cc.idleTimer.Stop() + } + + // Close any response bodies if the server closes prematurely. + // TODO: also do this if we've written the headers but not + // gotten a response yet. + err := cc.readerErr + cc.mu.Lock() + if cc.goAway != nil && isEOFOrNetReadError(err) { + err = GoAwayError{ + LastStreamID: cc.goAway.LastStreamID, + ErrCode: cc.goAway.ErrCode, + DebugData: cc.goAwayDebug, + } + } else if err == io.EOF { + err = io.ErrUnexpectedEOF + } + cc.closed = true + + // If the connection has never been used, and has been open for only a short time, + // leave it in the connection pool for a little while. + // + // This avoids a situation where new connections are constantly created, + // added to the pool, fail, and are removed from the pool, without any error + // being surfaced to the user. + unusedWaitTime := 5 * time.Second + if cc.idleTimeout > 0 && unusedWaitTime > cc.idleTimeout { + unusedWaitTime = cc.idleTimeout + } + idleTime := cc.t.now().Sub(cc.lastActive) + if atomic.LoadUint32(&cc.atomicReused) == 0 && idleTime < unusedWaitTime && !cc.closedOnIdle { + cc.idleTimer = cc.t.afterFunc(unusedWaitTime-idleTime, func() { + cc.t.connPool().MarkDead(cc) + }) + } else { + cc.mu.Unlock() // avoid any deadlocks in MarkDead + cc.t.connPool().MarkDead(cc) + cc.mu.Lock() + } + + for _, cs := range cc.streams { + select { + case <-cs.peerClosed: + // The server closed the stream before closing the conn, + // so no need to interrupt it. + default: + cs.abortStreamLocked(err) + } + } + cc.cond.Broadcast() + cc.mu.Unlock() + + if !cc.seenSettings { + // If we have a pending request that wants extended CONNECT, + // let it continue and fail with the connection error. + cc.extendedConnectAllowed = true + close(cc.seenSettingsChan) + } +} + +// countReadFrameError calls Transport.CountError with a string +// representing err. +func (cc *ClientConn) countReadFrameError(err error) { + f := cc.t.CountError + if f == nil || err == nil { + return + } + if ce, ok := err.(ConnectionError); ok { + errCode := ErrCode(ce) + f(fmt.Sprintf("read_frame_conn_error_%s", errCode.stringToken())) + return + } + if errors.Is(err, io.EOF) { + f("read_frame_eof") + return + } + if errors.Is(err, io.ErrUnexpectedEOF) { + f("read_frame_unexpected_eof") + return + } + if errors.Is(err, ErrFrameTooLarge) { + f("read_frame_too_large") + return + } + f("read_frame_other") +} + +func (rl *clientConnReadLoop) run() error { + cc := rl.cc + gotSettings := false + readIdleTimeout := cc.readIdleTimeout + var t timer + if readIdleTimeout != 0 { + t = cc.t.afterFunc(readIdleTimeout, cc.healthCheck) + } + for { + f, err := cc.fr.ReadFrame() + if t != nil { + t.Reset(readIdleTimeout) + } + if err != nil { + cc.vlogf("http2: Transport readFrame error on conn %p: (%T) %v", cc, err, err) + } + if se, ok := err.(StreamError); ok { + if cs := rl.streamByID(se.StreamID, notHeaderOrDataFrame); cs != nil { + if se.Cause == nil { + se.Cause = cc.fr.errDetail + } + rl.endStreamError(cs, se) + } + continue + } else if err != nil { + cc.countReadFrameError(err) + return err + } + if VerboseLogs { + cc.vlogf("http2: Transport received %s", summarizeFrame(f)) + } + if !gotSettings { + if _, ok := f.(*SettingsFrame); !ok { + cc.logf("protocol error: received %T before a SETTINGS frame", f) + return ConnectionError(ErrCodeProtocol) + } + gotSettings = true + } + + switch f := f.(type) { + case *MetaHeadersFrame: + err = rl.processHeaders(f) + case *DataFrame: + err = rl.processData(f) + case *GoAwayFrame: + err = rl.processGoAway(f) + case *RSTStreamFrame: + err = rl.processResetStream(f) + case *SettingsFrame: + err = rl.processSettings(f) + case *PushPromiseFrame: + err = rl.processPushPromise(f) + case *WindowUpdateFrame: + err = rl.processWindowUpdate(f) + case *PingFrame: + err = rl.processPing(f) + default: + cc.logf("Transport: unhandled response frame type %T", f) + } + if err != nil { + if VerboseLogs { + cc.vlogf("http2: Transport conn %p received error from processing frame %v: %v", cc, summarizeFrame(f), err) + } + return err + } + } +} + +func (rl *clientConnReadLoop) processHeaders(f *MetaHeadersFrame) error { + cs := rl.streamByID(f.StreamID, headerOrDataFrame) + if cs == nil { + // We'd get here if we canceled a request while the + // server had its response still in flight. So if this + // was just something we canceled, ignore it. + return nil + } + if cs.readClosed { + rl.endStreamError(cs, StreamError{ + StreamID: f.StreamID, + Code: ErrCodeProtocol, + Cause: errors.New("protocol error: headers after END_STREAM"), + }) + return nil + } + if !cs.firstByte { + if cs.trace != nil { + // TODO(bradfitz): move first response byte earlier, + // when we first read the 9 byte header, not waiting + // until all the HEADERS+CONTINUATION frames have been + // merged. This works for now. + traceFirstResponseByte(cs.trace) + } + cs.firstByte = true + } + if !cs.pastHeaders { + cs.pastHeaders = true + } else { + return rl.processTrailers(cs, f) + } + + res, err := rl.handleResponse(cs, f) + if err != nil { + if _, ok := err.(ConnectionError); ok { + return err + } + // Any other error type is a stream error. + rl.endStreamError(cs, StreamError{ + StreamID: f.StreamID, + Code: ErrCodeProtocol, + Cause: err, + }) + return nil // return nil from process* funcs to keep conn alive + } + if res == nil { + // (nil, nil) special case. See handleResponse docs. + return nil + } + cs.resTrailer = &res.Trailer + cs.res = res + close(cs.respHeaderRecv) + if f.StreamEnded() { + rl.endStream(cs) + } + return nil +} + +// may return error types nil, or ConnectionError. Any other error value +// is a StreamError of type ErrCodeProtocol. The returned error in that case +// is the detail. +// +// As a special case, handleResponse may return (nil, nil) to skip the +// frame (currently only used for 1xx responses). +func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFrame) (*http.Response, error) { + if f.Truncated { + return nil, errResponseHeaderListSize + } + + status := f.PseudoValue("status") + if status == "" { + return nil, errors.New("malformed response from server: missing status pseudo header") + } + statusCode, err := strconv.Atoi(status) + if err != nil { + return nil, errors.New("malformed response from server: malformed non-numeric status pseudo header") + } + + regularFields := f.RegularFields() + strs := make([]string, len(regularFields)) + header := make(http.Header, len(regularFields)) + res := &http.Response{ + Proto: "HTTP/2.0", + ProtoMajor: 2, + Header: header, + StatusCode: statusCode, + Status: status + " " + http.StatusText(statusCode), + } + for _, hf := range regularFields { + key := httpcommon.CanonicalHeader(hf.Name) + if key == "Trailer" { + t := res.Trailer + if t == nil { + t = make(http.Header) + res.Trailer = t + } + foreachHeaderElement(hf.Value, func(v string) { + t[httpcommon.CanonicalHeader(v)] = nil + }) + } else { + vv := header[key] + if vv == nil && len(strs) > 0 { + // More than likely this will be a single-element key. + // Most headers aren't multi-valued. + // Set the capacity on strs[0] to 1, so any future append + // won't extend the slice into the other strings. + vv, strs = strs[:1:1], strs[1:] + vv[0] = hf.Value + header[key] = vv + } else { + header[key] = append(vv, hf.Value) + } + } + } + + if statusCode >= 100 && statusCode <= 199 { + if f.StreamEnded() { + return nil, errors.New("1xx informational response with END_STREAM flag") + } + if fn := cs.get1xxTraceFunc(); fn != nil { + // If the 1xx response is being delivered to the user, + // then they're responsible for limiting the number + // of responses. + if err := fn(statusCode, textproto.MIMEHeader(header)); err != nil { + return nil, err + } + } else { + // If the user didn't examine the 1xx response, then we + // limit the size of all 1xx headers. + // + // This differs a bit from the HTTP/1 implementation, which + // limits the size of all 1xx headers plus the final response. + // Use the larger limit of MaxHeaderListSize and + // net/http.Transport.MaxResponseHeaderBytes. + limit := int64(cs.cc.t.maxHeaderListSize()) + if t1 := cs.cc.t.t1; t1 != nil && t1.MaxResponseHeaderBytes > limit { + limit = t1.MaxResponseHeaderBytes + } + for _, h := range f.Fields { + cs.totalHeaderSize += int64(h.Size()) + } + if cs.totalHeaderSize > limit { + if VerboseLogs { + log.Printf("http2: 1xx informational responses too large") + } + return nil, errors.New("header list too large") + } + } + if statusCode == 100 { + traceGot100Continue(cs.trace) + select { + case cs.on100 <- struct{}{}: + default: + } + } + cs.pastHeaders = false // do it all again + return nil, nil + } + + res.ContentLength = -1 + if clens := res.Header["Content-Length"]; len(clens) == 1 { + if cl, err := strconv.ParseUint(clens[0], 10, 63); err == nil { + res.ContentLength = int64(cl) + } else { + // TODO: care? unlike http/1, it won't mess up our framing, so it's + // more safe smuggling-wise to ignore. + } + } else if len(clens) > 1 { + // TODO: care? unlike http/1, it won't mess up our framing, so it's + // more safe smuggling-wise to ignore. + } else if f.StreamEnded() && !cs.isHead { + res.ContentLength = 0 + } + + if cs.isHead { + res.Body = noBody + return res, nil + } + + if f.StreamEnded() { + if res.ContentLength > 0 { + res.Body = missingBody{} + } else { + res.Body = noBody + } + return res, nil + } + + cs.bufPipe.setBuffer(&dataBuffer{expected: res.ContentLength}) + cs.bytesRemain = res.ContentLength + res.Body = transportResponseBody{cs} + + if cs.requestedGzip && asciiEqualFold(res.Header.Get("Content-Encoding"), "gzip") { + res.Header.Del("Content-Encoding") + res.Header.Del("Content-Length") + res.ContentLength = -1 + res.Body = &gzipReader{body: res.Body} + res.Uncompressed = true + } + return res, nil +} + +func (rl *clientConnReadLoop) processTrailers(cs *clientStream, f *MetaHeadersFrame) error { + if cs.pastTrailers { + // Too many HEADERS frames for this stream. + return ConnectionError(ErrCodeProtocol) + } + cs.pastTrailers = true + if !f.StreamEnded() { + // We expect that any headers for trailers also + // has END_STREAM. + return ConnectionError(ErrCodeProtocol) + } + if len(f.PseudoFields()) > 0 { + // No pseudo header fields are defined for trailers. + // TODO: ConnectionError might be overly harsh? Check. + return ConnectionError(ErrCodeProtocol) + } + + trailer := make(http.Header) + for _, hf := range f.RegularFields() { + key := httpcommon.CanonicalHeader(hf.Name) + trailer[key] = append(trailer[key], hf.Value) + } + cs.trailer = trailer + + rl.endStream(cs) + return nil +} + +// transportResponseBody is the concrete type of Transport.RoundTrip's +// Response.Body. It is an io.ReadCloser. +type transportResponseBody struct { + cs *clientStream +} + +func (b transportResponseBody) Read(p []byte) (n int, err error) { + cs := b.cs + cc := cs.cc + + if cs.readErr != nil { + return 0, cs.readErr + } + n, err = b.cs.bufPipe.Read(p) + if cs.bytesRemain != -1 { + if int64(n) > cs.bytesRemain { + n = int(cs.bytesRemain) + if err == nil { + err = errors.New("net/http: server replied with more than declared Content-Length; truncated") + cs.abortStream(err) + } + cs.readErr = err + return int(cs.bytesRemain), err + } + cs.bytesRemain -= int64(n) + if err == io.EOF && cs.bytesRemain > 0 { + err = io.ErrUnexpectedEOF + cs.readErr = err + return n, err + } + } + if n == 0 { + // No flow control tokens to send back. + return + } + + cc.mu.Lock() + connAdd := cc.inflow.add(n) + var streamAdd int32 + if err == nil { // No need to refresh if the stream is over or failed. + streamAdd = cs.inflow.add(n) + } + cc.mu.Unlock() + + if connAdd != 0 || streamAdd != 0 { + cc.wmu.Lock() + defer cc.wmu.Unlock() + if connAdd != 0 { + cc.fr.WriteWindowUpdate(0, mustUint31(connAdd)) + } + if streamAdd != 0 { + cc.fr.WriteWindowUpdate(cs.ID, mustUint31(streamAdd)) + } + cc.bw.Flush() + } + return +} + +var errClosedResponseBody = errors.New("http2: response body closed") + +func (b transportResponseBody) Close() error { + cs := b.cs + cc := cs.cc + + cs.bufPipe.BreakWithError(errClosedResponseBody) + cs.abortStream(errClosedResponseBody) + + unread := cs.bufPipe.Len() + if unread > 0 { + cc.mu.Lock() + // Return connection-level flow control. + connAdd := cc.inflow.add(unread) + cc.mu.Unlock() + + // TODO(dneil): Acquiring this mutex can block indefinitely. + // Move flow control return to a goroutine? + cc.wmu.Lock() + // Return connection-level flow control. + if connAdd > 0 { + cc.fr.WriteWindowUpdate(0, uint32(connAdd)) + } + cc.bw.Flush() + cc.wmu.Unlock() + } + + select { + case <-cs.donec: + case <-cs.ctx.Done(): + // See golang/go#49366: The net/http package can cancel the + // request context after the response body is fully read. + // Don't treat this as an error. + return nil + case <-cs.reqCancel: + return errRequestCanceled + } + return nil +} + +func (rl *clientConnReadLoop) processData(f *DataFrame) error { + cc := rl.cc + cs := rl.streamByID(f.StreamID, headerOrDataFrame) + data := f.Data() + if cs == nil { + cc.mu.Lock() + neverSent := cc.nextStreamID + cc.mu.Unlock() + if f.StreamID >= neverSent { + // We never asked for this. + cc.logf("http2: Transport received unsolicited DATA frame; closing connection") + return ConnectionError(ErrCodeProtocol) + } + // We probably did ask for this, but canceled. Just ignore it. + // TODO: be stricter here? only silently ignore things which + // we canceled, but not things which were closed normally + // by the peer? Tough without accumulating too much state. + + // But at least return their flow control: + if f.Length > 0 { + cc.mu.Lock() + ok := cc.inflow.take(f.Length) + connAdd := cc.inflow.add(int(f.Length)) + cc.mu.Unlock() + if !ok { + return ConnectionError(ErrCodeFlowControl) + } + if connAdd > 0 { + cc.wmu.Lock() + cc.fr.WriteWindowUpdate(0, uint32(connAdd)) + cc.bw.Flush() + cc.wmu.Unlock() + } + } + return nil + } + if cs.readClosed { + cc.logf("protocol error: received DATA after END_STREAM") + rl.endStreamError(cs, StreamError{ + StreamID: f.StreamID, + Code: ErrCodeProtocol, + }) + return nil + } + if !cs.pastHeaders { + cc.logf("protocol error: received DATA before a HEADERS frame") + rl.endStreamError(cs, StreamError{ + StreamID: f.StreamID, + Code: ErrCodeProtocol, + }) + return nil + } + if f.Length > 0 { + if cs.isHead && len(data) > 0 { + cc.logf("protocol error: received DATA on a HEAD request") + rl.endStreamError(cs, StreamError{ + StreamID: f.StreamID, + Code: ErrCodeProtocol, + }) + return nil + } + // Check connection-level flow control. + cc.mu.Lock() + if !takeInflows(&cc.inflow, &cs.inflow, f.Length) { + cc.mu.Unlock() + return ConnectionError(ErrCodeFlowControl) + } + // Return any padded flow control now, since we won't + // refund it later on body reads. + var refund int + if pad := int(f.Length) - len(data); pad > 0 { + refund += pad + } + + didReset := false + var err error + if len(data) > 0 { + if _, err = cs.bufPipe.Write(data); err != nil { + // Return len(data) now if the stream is already closed, + // since data will never be read. + didReset = true + refund += len(data) + } + } + + sendConn := cc.inflow.add(refund) + var sendStream int32 + if !didReset { + sendStream = cs.inflow.add(refund) + } + cc.mu.Unlock() + + if sendConn > 0 || sendStream > 0 { + cc.wmu.Lock() + if sendConn > 0 { + cc.fr.WriteWindowUpdate(0, uint32(sendConn)) + } + if sendStream > 0 { + cc.fr.WriteWindowUpdate(cs.ID, uint32(sendStream)) + } + cc.bw.Flush() + cc.wmu.Unlock() + } + + if err != nil { + rl.endStreamError(cs, err) + return nil + } + } + + if f.StreamEnded() { + rl.endStream(cs) + } + return nil +} + +func (rl *clientConnReadLoop) endStream(cs *clientStream) { + // TODO: check that any declared content-length matches, like + // server.go's (*stream).endStream method. + if !cs.readClosed { + cs.readClosed = true + // Close cs.bufPipe and cs.peerClosed with cc.mu held to avoid a + // race condition: The caller can read io.EOF from Response.Body + // and close the body before we close cs.peerClosed, causing + // cleanupWriteRequest to send a RST_STREAM. + rl.cc.mu.Lock() + defer rl.cc.mu.Unlock() + cs.bufPipe.closeWithErrorAndCode(io.EOF, cs.copyTrailers) + close(cs.peerClosed) + } +} + +func (rl *clientConnReadLoop) endStreamError(cs *clientStream, err error) { + cs.readAborted = true + cs.abortStream(err) +} + +// Constants passed to streamByID for documentation purposes. +const ( + headerOrDataFrame = true + notHeaderOrDataFrame = false +) + +// streamByID returns the stream with the given id, or nil if no stream has that id. +// If headerOrData is true, it clears rst.StreamPingsBlocked. +func (rl *clientConnReadLoop) streamByID(id uint32, headerOrData bool) *clientStream { + rl.cc.mu.Lock() + defer rl.cc.mu.Unlock() + if headerOrData { + // Work around an unfortunate gRPC behavior. + // See comment on ClientConn.rstStreamPingsBlocked for details. + rl.cc.rstStreamPingsBlocked = false + } + cs := rl.cc.streams[id] + if cs != nil && !cs.readAborted { + return cs + } + return nil +} + +func (cs *clientStream) copyTrailers() { + for k, vv := range cs.trailer { + t := cs.resTrailer + if *t == nil { + *t = make(http.Header) + } + (*t)[k] = vv + } +} + +func (rl *clientConnReadLoop) processGoAway(f *GoAwayFrame) error { + cc := rl.cc + cc.t.connPool().MarkDead(cc) + if f.ErrCode != 0 { + // TODO: deal with GOAWAY more. particularly the error code + cc.vlogf("transport got GOAWAY with error code = %v", f.ErrCode) + if fn := cc.t.CountError; fn != nil { + fn("recv_goaway_" + f.ErrCode.stringToken()) + } + } + cc.setGoAway(f) + return nil +} + +func (rl *clientConnReadLoop) processSettings(f *SettingsFrame) error { + cc := rl.cc + // Locking both mu and wmu here allows frame encoding to read settings with only wmu held. + // Acquiring wmu when f.IsAck() is unnecessary, but convenient and mostly harmless. + cc.wmu.Lock() + defer cc.wmu.Unlock() + + if err := rl.processSettingsNoWrite(f); err != nil { + return err + } + if !f.IsAck() { + cc.fr.WriteSettingsAck() + cc.bw.Flush() + } + return nil +} + +func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { + cc := rl.cc + cc.mu.Lock() + defer cc.mu.Unlock() + + if f.IsAck() { + if cc.wantSettingsAck { + cc.wantSettingsAck = false + return nil + } + return ConnectionError(ErrCodeProtocol) + } + + var seenMaxConcurrentStreams bool + err := f.ForeachSetting(func(s Setting) error { + switch s.ID { + case SettingMaxFrameSize: + cc.maxFrameSize = s.Val + case SettingMaxConcurrentStreams: + cc.maxConcurrentStreams = s.Val + seenMaxConcurrentStreams = true + case SettingMaxHeaderListSize: + cc.peerMaxHeaderListSize = uint64(s.Val) + case SettingInitialWindowSize: + // Values above the maximum flow-control + // window size of 2^31-1 MUST be treated as a + // connection error (Section 5.4.1) of type + // FLOW_CONTROL_ERROR. + if s.Val > math.MaxInt32 { + return ConnectionError(ErrCodeFlowControl) + } + + // Adjust flow control of currently-open + // frames by the difference of the old initial + // window size and this one. + delta := int32(s.Val) - int32(cc.initialWindowSize) + for _, cs := range cc.streams { + cs.flow.add(delta) + } + cc.cond.Broadcast() + + cc.initialWindowSize = s.Val + case SettingHeaderTableSize: + cc.henc.SetMaxDynamicTableSize(s.Val) + cc.peerMaxHeaderTableSize = s.Val + case SettingEnableConnectProtocol: + if err := s.Valid(); err != nil { + return err + } + // If the peer wants to send us SETTINGS_ENABLE_CONNECT_PROTOCOL, + // we require that it do so in the first SETTINGS frame. + // + // When we attempt to use extended CONNECT, we wait for the first + // SETTINGS frame to see if the server supports it. If we let the + // server enable the feature with a later SETTINGS frame, then + // users will see inconsistent results depending on whether we've + // seen that frame or not. + if !cc.seenSettings { + cc.extendedConnectAllowed = s.Val == 1 + } + default: + cc.vlogf("Unhandled Setting: %v", s) + } + return nil + }) + if err != nil { + return err + } + + if !cc.seenSettings { + if !seenMaxConcurrentStreams { + // This was the servers initial SETTINGS frame and it + // didn't contain a MAX_CONCURRENT_STREAMS field so + // increase the number of concurrent streams this + // connection can establish to our default. + cc.maxConcurrentStreams = defaultMaxConcurrentStreams + } + close(cc.seenSettingsChan) + cc.seenSettings = true + } + + return nil +} + +func (rl *clientConnReadLoop) processWindowUpdate(f *WindowUpdateFrame) error { + cc := rl.cc + cs := rl.streamByID(f.StreamID, notHeaderOrDataFrame) + if f.StreamID != 0 && cs == nil { + return nil + } + + cc.mu.Lock() + defer cc.mu.Unlock() + + fl := &cc.flow + if cs != nil { + fl = &cs.flow + } + if !fl.add(int32(f.Increment)) { + // For stream, the sender sends RST_STREAM with an error code of FLOW_CONTROL_ERROR + if cs != nil { + rl.endStreamError(cs, StreamError{ + StreamID: f.StreamID, + Code: ErrCodeFlowControl, + }) + return nil + } + + return ConnectionError(ErrCodeFlowControl) + } + cc.cond.Broadcast() + return nil +} + +func (rl *clientConnReadLoop) processResetStream(f *RSTStreamFrame) error { + cs := rl.streamByID(f.StreamID, notHeaderOrDataFrame) + if cs == nil { + // TODO: return error if server tries to RST_STREAM an idle stream + return nil + } + serr := streamError(cs.ID, f.ErrCode) + serr.Cause = errFromPeer + if f.ErrCode == ErrCodeProtocol { + rl.cc.SetDoNotReuse() + } + if fn := cs.cc.t.CountError; fn != nil { + fn("recv_rststream_" + f.ErrCode.stringToken()) + } + cs.abortStream(serr) + + cs.bufPipe.CloseWithError(serr) + return nil +} + +// Ping sends a PING frame to the server and waits for the ack. +func (cc *ClientConn) Ping(ctx context.Context) error { + c := make(chan struct{}) + // Generate a random payload + var p [8]byte + for { + if _, err := rand.Read(p[:]); err != nil { + return err + } + cc.mu.Lock() + // check for dup before insert + if _, found := cc.pings[p]; !found { + cc.pings[p] = c + cc.mu.Unlock() + break + } + cc.mu.Unlock() + } + var pingError error + errc := make(chan struct{}) + go func() { + cc.t.markNewGoroutine() + cc.wmu.Lock() + defer cc.wmu.Unlock() + if pingError = cc.fr.WritePing(false, p); pingError != nil { + close(errc) + return + } + if pingError = cc.bw.Flush(); pingError != nil { + close(errc) + return + } + }() + select { + case <-c: + return nil + case <-errc: + return pingError + case <-ctx.Done(): + return ctx.Err() + case <-cc.readerDone: + // connection closed + return cc.readerErr + } +} + +func (rl *clientConnReadLoop) processPing(f *PingFrame) error { + if f.IsAck() { + cc := rl.cc + cc.mu.Lock() + defer cc.mu.Unlock() + // If ack, notify listener if any + if c, ok := cc.pings[f.Data]; ok { + close(c) + delete(cc.pings, f.Data) + } + if cc.pendingResets > 0 { + // See clientStream.cleanupWriteRequest. + cc.pendingResets = 0 + cc.rstStreamPingsBlocked = true + cc.cond.Broadcast() + } + return nil + } + cc := rl.cc + cc.wmu.Lock() + defer cc.wmu.Unlock() + if err := cc.fr.WritePing(true, f.Data); err != nil { + return err + } + return cc.bw.Flush() +} + +func (rl *clientConnReadLoop) processPushPromise(f *PushPromiseFrame) error { + // We told the peer we don't want them. + // Spec says: + // "PUSH_PROMISE MUST NOT be sent if the SETTINGS_ENABLE_PUSH + // setting of the peer endpoint is set to 0. An endpoint that + // has set this setting and has received acknowledgement MUST + // treat the receipt of a PUSH_PROMISE frame as a connection + // error (Section 5.4.1) of type PROTOCOL_ERROR." + return ConnectionError(ErrCodeProtocol) +} + +// writeStreamReset sends a RST_STREAM frame. +// When ping is true, it also sends a PING frame with a random payload. +func (cc *ClientConn) writeStreamReset(streamID uint32, code ErrCode, ping bool, err error) { + // TODO: map err to more interesting error codes, once the + // HTTP community comes up with some. But currently for + // RST_STREAM there's no equivalent to GOAWAY frame's debug + // data, and the error codes are all pretty vague ("cancel"). + cc.wmu.Lock() + cc.fr.WriteRSTStream(streamID, code) + if ping { + var payload [8]byte + rand.Read(payload[:]) + cc.fr.WritePing(false, payload) + } + cc.bw.Flush() + cc.wmu.Unlock() +} + +var ( + errResponseHeaderListSize = errors.New("http2: response header list larger than advertised limit") + errRequestHeaderListSize = httpcommon.ErrRequestHeaderListSize +) + +func (cc *ClientConn) logf(format string, args ...interface{}) { + cc.t.logf(format, args...) +} + +func (cc *ClientConn) vlogf(format string, args ...interface{}) { + cc.t.vlogf(format, args...) +} + +func (t *Transport) vlogf(format string, args ...interface{}) { + if VerboseLogs { + t.logf(format, args...) + } +} + +func (t *Transport) logf(format string, args ...interface{}) { + log.Printf(format, args...) +} + +var noBody io.ReadCloser = noBodyReader{} + +type noBodyReader struct{} + +func (noBodyReader) Close() error { return nil } +func (noBodyReader) Read([]byte) (int, error) { return 0, io.EOF } + +type missingBody struct{} + +func (missingBody) Close() error { return nil } +func (missingBody) Read([]byte) (int, error) { return 0, io.ErrUnexpectedEOF } + +func strSliceContains(ss []string, s string) bool { + for _, v := range ss { + if v == s { + return true + } + } + return false +} + +type erringRoundTripper struct{ err error } + +func (rt erringRoundTripper) RoundTripErr() error { return rt.err } +func (rt erringRoundTripper) RoundTrip(*http.Request) (*http.Response, error) { return nil, rt.err } + +// gzipReader wraps a response body so it can lazily +// call gzip.NewReader on the first call to Read +type gzipReader struct { + _ incomparable + body io.ReadCloser // underlying Response.Body + zr *gzip.Reader // lazily-initialized gzip reader + zerr error // sticky error +} + +func (gz *gzipReader) Read(p []byte) (n int, err error) { + if gz.zerr != nil { + return 0, gz.zerr + } + if gz.zr == nil { + gz.zr, err = gzip.NewReader(gz.body) + if err != nil { + gz.zerr = err + return 0, err + } + } + return gz.zr.Read(p) +} + +func (gz *gzipReader) Close() error { + if err := gz.body.Close(); err != nil { + return err + } + gz.zerr = fs.ErrClosed + return nil +} + +type errorReader struct{ err error } + +func (r errorReader) Read(p []byte) (int, error) { return 0, r.err } + +// isConnectionCloseRequest reports whether req should use its own +// connection for a single request and then close the connection. +func isConnectionCloseRequest(req *http.Request) bool { + return req.Close || httpguts.HeaderValuesContainsToken(req.Header["Connection"], "close") +} + +// registerHTTPSProtocol calls Transport.RegisterProtocol but +// converting panics into errors. +func registerHTTPSProtocol(t *http.Transport, rt noDialH2RoundTripper) (err error) { + defer func() { + if e := recover(); e != nil { + err = fmt.Errorf("%v", e) + } + }() + t.RegisterProtocol("https", rt) + return nil +} + +// noDialH2RoundTripper is a RoundTripper which only tries to complete the request +// if there's already has a cached connection to the host. +// (The field is exported so it can be accessed via reflect from net/http; tested +// by TestNoDialH2RoundTripperType) +type noDialH2RoundTripper struct{ *Transport } + +func (rt noDialH2RoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + res, err := rt.Transport.RoundTrip(req) + if isNoCachedConnError(err) { + return nil, http.ErrSkipAltProtocol + } + return res, err +} + +func (t *Transport) idleConnTimeout() time.Duration { + // to keep things backwards compatible, we use non-zero values of + // IdleConnTimeout, followed by using the IdleConnTimeout on the underlying + // http1 transport, followed by 0 + if t.IdleConnTimeout != 0 { + return t.IdleConnTimeout + } + + if t.t1 != nil { + return t.t1.IdleConnTimeout + } + + return 0 +} + +func traceGetConn(req *http.Request, hostPort string) { + trace := httptrace.ContextClientTrace(req.Context()) + if trace == nil || trace.GetConn == nil { + return + } + trace.GetConn(hostPort) +} + +func traceGotConn(req *http.Request, cc *ClientConn, reused bool) { + trace := httptrace.ContextClientTrace(req.Context()) + if trace == nil || trace.GotConn == nil { + return + } + ci := httptrace.GotConnInfo{Conn: cc.tconn} + ci.Reused = reused + cc.mu.Lock() + ci.WasIdle = len(cc.streams) == 0 && reused + if ci.WasIdle && !cc.lastActive.IsZero() { + ci.IdleTime = cc.t.timeSince(cc.lastActive) + } + cc.mu.Unlock() + + trace.GotConn(ci) +} + +func traceWroteHeaders(trace *httptrace.ClientTrace) { + if trace != nil && trace.WroteHeaders != nil { + trace.WroteHeaders() + } +} + +func traceGot100Continue(trace *httptrace.ClientTrace) { + if trace != nil && trace.Got100Continue != nil { + trace.Got100Continue() + } +} + +func traceWait100Continue(trace *httptrace.ClientTrace) { + if trace != nil && trace.Wait100Continue != nil { + trace.Wait100Continue() + } +} + +func traceWroteRequest(trace *httptrace.ClientTrace, err error) { + if trace != nil && trace.WroteRequest != nil { + trace.WroteRequest(httptrace.WroteRequestInfo{Err: err}) + } +} + +func traceFirstResponseByte(trace *httptrace.ClientTrace) { + if trace != nil && trace.GotFirstResponseByte != nil { + trace.GotFirstResponseByte() + } +} + +func traceGot1xxResponseFunc(trace *httptrace.ClientTrace) func(int, textproto.MIMEHeader) error { + if trace != nil { + return trace.Got1xxResponse + } + return nil +} + +// dialTLSWithContext uses tls.Dialer, added in Go 1.15, to open a TLS +// connection. +func (t *Transport) dialTLSWithContext(ctx context.Context, network, addr string, cfg *tls.Config) (*tls.Conn, error) { + dialer := &tls.Dialer{ + Config: cfg, + } + cn, err := dialer.DialContext(ctx, network, addr) + if err != nil { + return nil, err + } + tlsCn := cn.(*tls.Conn) // DialContext comment promises this will always succeed + return tlsCn, nil +} diff --git a/vendor/golang.org/x/net/http2/unencrypted.go b/vendor/golang.org/x/net/http2/unencrypted.go new file mode 100644 index 0000000..b2de211 --- /dev/null +++ b/vendor/golang.org/x/net/http2/unencrypted.go @@ -0,0 +1,32 @@ +// Copyright 2024 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 http2 + +import ( + "crypto/tls" + "errors" + "net" +) + +const nextProtoUnencryptedHTTP2 = "unencrypted_http2" + +// unencryptedNetConnFromTLSConn retrieves a net.Conn wrapped in a *tls.Conn. +// +// TLSNextProto functions accept a *tls.Conn. +// +// When passing an unencrypted HTTP/2 connection to a TLSNextProto function, +// we pass a *tls.Conn with an underlying net.Conn containing the unencrypted connection. +// To be extra careful about mistakes (accidentally dropping TLS encryption in a place +// where we want it), the tls.Conn contains a net.Conn with an UnencryptedNetConn method +// that returns the actual connection we want to use. +func unencryptedNetConnFromTLSConn(tc *tls.Conn) (net.Conn, error) { + conner, ok := tc.NetConn().(interface { + UnencryptedNetConn() net.Conn + }) + if !ok { + return nil, errors.New("http2: TLS conn unexpectedly found in unencrypted handoff") + } + return conner.UnencryptedNetConn(), nil +} diff --git a/vendor/golang.org/x/net/http2/write.go b/vendor/golang.org/x/net/http2/write.go new file mode 100644 index 0000000..fdb35b9 --- /dev/null +++ b/vendor/golang.org/x/net/http2/write.go @@ -0,0 +1,381 @@ +// Copyright 2014 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 http2 + +import ( + "bytes" + "fmt" + "log" + "net/http" + "net/url" + + "golang.org/x/net/http/httpguts" + "golang.org/x/net/http2/hpack" + "golang.org/x/net/internal/httpcommon" +) + +// writeFramer is implemented by any type that is used to write frames. +type writeFramer interface { + writeFrame(writeContext) error + + // staysWithinBuffer reports whether this writer promises that + // it will only write less than or equal to size bytes, and it + // won't Flush the write context. + staysWithinBuffer(size int) bool +} + +// writeContext is the interface needed by the various frame writer +// types below. All the writeFrame methods below are scheduled via the +// frame writing scheduler (see writeScheduler in writesched.go). +// +// This interface is implemented by *serverConn. +// +// TODO: decide whether to a) use this in the client code (which didn't +// end up using this yet, because it has a simpler design, not +// currently implementing priorities), or b) delete this and +// make the server code a bit more concrete. +type writeContext interface { + Framer() *Framer + Flush() error + CloseConn() error + // HeaderEncoder returns an HPACK encoder that writes to the + // returned buffer. + HeaderEncoder() (*hpack.Encoder, *bytes.Buffer) +} + +// writeEndsStream reports whether w writes a frame that will transition +// the stream to a half-closed local state. This returns false for RST_STREAM, +// which closes the entire stream (not just the local half). +func writeEndsStream(w writeFramer) bool { + switch v := w.(type) { + case *writeData: + return v.endStream + case *writeResHeaders: + return v.endStream + case nil: + // This can only happen if the caller reuses w after it's + // been intentionally nil'ed out to prevent use. Keep this + // here to catch future refactoring breaking it. + panic("writeEndsStream called on nil writeFramer") + } + return false +} + +type flushFrameWriter struct{} + +func (flushFrameWriter) writeFrame(ctx writeContext) error { + return ctx.Flush() +} + +func (flushFrameWriter) staysWithinBuffer(max int) bool { return false } + +type writeSettings []Setting + +func (s writeSettings) staysWithinBuffer(max int) bool { + const settingSize = 6 // uint16 + uint32 + return frameHeaderLen+settingSize*len(s) <= max + +} + +func (s writeSettings) writeFrame(ctx writeContext) error { + return ctx.Framer().WriteSettings([]Setting(s)...) +} + +type writeGoAway struct { + maxStreamID uint32 + code ErrCode +} + +func (p *writeGoAway) writeFrame(ctx writeContext) error { + err := ctx.Framer().WriteGoAway(p.maxStreamID, p.code, nil) + ctx.Flush() // ignore error: we're hanging up on them anyway + return err +} + +func (*writeGoAway) staysWithinBuffer(max int) bool { return false } // flushes + +type writeData struct { + streamID uint32 + p []byte + endStream bool +} + +func (w *writeData) String() string { + return fmt.Sprintf("writeData(stream=%d, p=%d, endStream=%v)", w.streamID, len(w.p), w.endStream) +} + +func (w *writeData) writeFrame(ctx writeContext) error { + return ctx.Framer().WriteData(w.streamID, w.endStream, w.p) +} + +func (w *writeData) staysWithinBuffer(max int) bool { + return frameHeaderLen+len(w.p) <= max +} + +// handlerPanicRST is the message sent from handler goroutines when +// the handler panics. +type handlerPanicRST struct { + StreamID uint32 +} + +func (hp handlerPanicRST) writeFrame(ctx writeContext) error { + return ctx.Framer().WriteRSTStream(hp.StreamID, ErrCodeInternal) +} + +func (hp handlerPanicRST) staysWithinBuffer(max int) bool { return frameHeaderLen+4 <= max } + +func (se StreamError) writeFrame(ctx writeContext) error { + return ctx.Framer().WriteRSTStream(se.StreamID, se.Code) +} + +func (se StreamError) staysWithinBuffer(max int) bool { return frameHeaderLen+4 <= max } + +type writePing struct { + data [8]byte +} + +func (w writePing) writeFrame(ctx writeContext) error { + return ctx.Framer().WritePing(false, w.data) +} + +func (w writePing) staysWithinBuffer(max int) bool { return frameHeaderLen+len(w.data) <= max } + +type writePingAck struct{ pf *PingFrame } + +func (w writePingAck) writeFrame(ctx writeContext) error { + return ctx.Framer().WritePing(true, w.pf.Data) +} + +func (w writePingAck) staysWithinBuffer(max int) bool { return frameHeaderLen+len(w.pf.Data) <= max } + +type writeSettingsAck struct{} + +func (writeSettingsAck) writeFrame(ctx writeContext) error { + return ctx.Framer().WriteSettingsAck() +} + +func (writeSettingsAck) staysWithinBuffer(max int) bool { return frameHeaderLen <= max } + +// splitHeaderBlock splits headerBlock into fragments so that each fragment fits +// in a single frame, then calls fn for each fragment. firstFrag/lastFrag are true +// for the first/last fragment, respectively. +func splitHeaderBlock(ctx writeContext, headerBlock []byte, fn func(ctx writeContext, frag []byte, firstFrag, lastFrag bool) error) error { + // For now we're lazy and just pick the minimum MAX_FRAME_SIZE + // that all peers must support (16KB). Later we could care + // more and send larger frames if the peer advertised it, but + // there's little point. Most headers are small anyway (so we + // generally won't have CONTINUATION frames), and extra frames + // only waste 9 bytes anyway. + const maxFrameSize = 16384 + + first := true + for len(headerBlock) > 0 { + frag := headerBlock + if len(frag) > maxFrameSize { + frag = frag[:maxFrameSize] + } + headerBlock = headerBlock[len(frag):] + if err := fn(ctx, frag, first, len(headerBlock) == 0); err != nil { + return err + } + first = false + } + return nil +} + +// writeResHeaders is a request to write a HEADERS and 0+ CONTINUATION frames +// for HTTP response headers or trailers from a server handler. +type writeResHeaders struct { + streamID uint32 + httpResCode int // 0 means no ":status" line + h http.Header // may be nil + trailers []string // if non-nil, which keys of h to write. nil means all. + endStream bool + + date string + contentType string + contentLength string +} + +func encKV(enc *hpack.Encoder, k, v string) { + if VerboseLogs { + log.Printf("http2: server encoding header %q = %q", k, v) + } + enc.WriteField(hpack.HeaderField{Name: k, Value: v}) +} + +func (w *writeResHeaders) staysWithinBuffer(max int) bool { + // TODO: this is a common one. It'd be nice to return true + // here and get into the fast path if we could be clever and + // calculate the size fast enough, or at least a conservative + // upper bound that usually fires. (Maybe if w.h and + // w.trailers are nil, so we don't need to enumerate it.) + // Otherwise I'm afraid that just calculating the length to + // answer this question would be slower than the ~2µs benefit. + return false +} + +func (w *writeResHeaders) writeFrame(ctx writeContext) error { + enc, buf := ctx.HeaderEncoder() + buf.Reset() + + if w.httpResCode != 0 { + encKV(enc, ":status", httpCodeString(w.httpResCode)) + } + + encodeHeaders(enc, w.h, w.trailers) + + if w.contentType != "" { + encKV(enc, "content-type", w.contentType) + } + if w.contentLength != "" { + encKV(enc, "content-length", w.contentLength) + } + if w.date != "" { + encKV(enc, "date", w.date) + } + + headerBlock := buf.Bytes() + if len(headerBlock) == 0 && w.trailers == nil { + panic("unexpected empty hpack") + } + + return splitHeaderBlock(ctx, headerBlock, w.writeHeaderBlock) +} + +func (w *writeResHeaders) writeHeaderBlock(ctx writeContext, frag []byte, firstFrag, lastFrag bool) error { + if firstFrag { + return ctx.Framer().WriteHeaders(HeadersFrameParam{ + StreamID: w.streamID, + BlockFragment: frag, + EndStream: w.endStream, + EndHeaders: lastFrag, + }) + } else { + return ctx.Framer().WriteContinuation(w.streamID, lastFrag, frag) + } +} + +// writePushPromise is a request to write a PUSH_PROMISE and 0+ CONTINUATION frames. +type writePushPromise struct { + streamID uint32 // pusher stream + method string // for :method + url *url.URL // for :scheme, :authority, :path + h http.Header + + // Creates an ID for a pushed stream. This runs on serveG just before + // the frame is written. The returned ID is copied to promisedID. + allocatePromisedID func() (uint32, error) + promisedID uint32 +} + +func (w *writePushPromise) staysWithinBuffer(max int) bool { + // TODO: see writeResHeaders.staysWithinBuffer + return false +} + +func (w *writePushPromise) writeFrame(ctx writeContext) error { + enc, buf := ctx.HeaderEncoder() + buf.Reset() + + encKV(enc, ":method", w.method) + encKV(enc, ":scheme", w.url.Scheme) + encKV(enc, ":authority", w.url.Host) + encKV(enc, ":path", w.url.RequestURI()) + encodeHeaders(enc, w.h, nil) + + headerBlock := buf.Bytes() + if len(headerBlock) == 0 { + panic("unexpected empty hpack") + } + + return splitHeaderBlock(ctx, headerBlock, w.writeHeaderBlock) +} + +func (w *writePushPromise) writeHeaderBlock(ctx writeContext, frag []byte, firstFrag, lastFrag bool) error { + if firstFrag { + return ctx.Framer().WritePushPromise(PushPromiseParam{ + StreamID: w.streamID, + PromiseID: w.promisedID, + BlockFragment: frag, + EndHeaders: lastFrag, + }) + } else { + return ctx.Framer().WriteContinuation(w.streamID, lastFrag, frag) + } +} + +type write100ContinueHeadersFrame struct { + streamID uint32 +} + +func (w write100ContinueHeadersFrame) writeFrame(ctx writeContext) error { + enc, buf := ctx.HeaderEncoder() + buf.Reset() + encKV(enc, ":status", "100") + return ctx.Framer().WriteHeaders(HeadersFrameParam{ + StreamID: w.streamID, + BlockFragment: buf.Bytes(), + EndStream: false, + EndHeaders: true, + }) +} + +func (w write100ContinueHeadersFrame) staysWithinBuffer(max int) bool { + // Sloppy but conservative: + return 9+2*(len(":status")+len("100")) <= max +} + +type writeWindowUpdate struct { + streamID uint32 // or 0 for conn-level + n uint32 +} + +func (wu writeWindowUpdate) staysWithinBuffer(max int) bool { return frameHeaderLen+4 <= max } + +func (wu writeWindowUpdate) writeFrame(ctx writeContext) error { + return ctx.Framer().WriteWindowUpdate(wu.streamID, wu.n) +} + +// encodeHeaders encodes an http.Header. If keys is not nil, then (k, h[k]) +// is encoded only if k is in keys. +func encodeHeaders(enc *hpack.Encoder, h http.Header, keys []string) { + if keys == nil { + sorter := sorterPool.Get().(*sorter) + // Using defer here, since the returned keys from the + // sorter.Keys method is only valid until the sorter + // is returned: + defer sorterPool.Put(sorter) + keys = sorter.Keys(h) + } + for _, k := range keys { + vv := h[k] + k, ascii := httpcommon.LowerHeader(k) + if !ascii { + // Skip writing invalid headers. Per RFC 7540, Section 8.1.2, header + // field names have to be ASCII characters (just as in HTTP/1.x). + continue + } + if !validWireHeaderFieldName(k) { + // Skip it as backup paranoia. Per + // golang.org/issue/14048, these should + // already be rejected at a higher level. + continue + } + isTE := k == "transfer-encoding" + for _, v := range vv { + if !httpguts.ValidHeaderFieldValue(v) { + // TODO: return an error? golang.org/issue/14048 + // For now just omit it. + continue + } + // TODO: more of "8.1.2.2 Connection-Specific Header Fields" + if isTE && v != "trailers" { + continue + } + encKV(enc, k, v) + } + } +} diff --git a/vendor/golang.org/x/net/http2/writesched.go b/vendor/golang.org/x/net/http2/writesched.go new file mode 100644 index 0000000..cc893ad --- /dev/null +++ b/vendor/golang.org/x/net/http2/writesched.go @@ -0,0 +1,251 @@ +// Copyright 2014 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 http2 + +import "fmt" + +// WriteScheduler is the interface implemented by HTTP/2 write schedulers. +// Methods are never called concurrently. +type WriteScheduler interface { + // OpenStream opens a new stream in the write scheduler. + // It is illegal to call this with streamID=0 or with a streamID that is + // already open -- the call may panic. + OpenStream(streamID uint32, options OpenStreamOptions) + + // CloseStream closes a stream in the write scheduler. Any frames queued on + // this stream should be discarded. It is illegal to call this on a stream + // that is not open -- the call may panic. + CloseStream(streamID uint32) + + // AdjustStream adjusts the priority of the given stream. This may be called + // on a stream that has not yet been opened or has been closed. Note that + // RFC 7540 allows PRIORITY frames to be sent on streams in any state. See: + // https://tools.ietf.org/html/rfc7540#section-5.1 + AdjustStream(streamID uint32, priority PriorityParam) + + // Push queues a frame in the scheduler. In most cases, this will not be + // called with wr.StreamID()!=0 unless that stream is currently open. The one + // exception is RST_STREAM frames, which may be sent on idle or closed streams. + Push(wr FrameWriteRequest) + + // Pop dequeues the next frame to write. Returns false if no frames can + // be written. Frames with a given wr.StreamID() are Pop'd in the same + // order they are Push'd, except RST_STREAM frames. No frames should be + // discarded except by CloseStream. + Pop() (wr FrameWriteRequest, ok bool) +} + +// OpenStreamOptions specifies extra options for WriteScheduler.OpenStream. +type OpenStreamOptions struct { + // PusherID is zero if the stream was initiated by the client. Otherwise, + // PusherID names the stream that pushed the newly opened stream. + PusherID uint32 +} + +// FrameWriteRequest is a request to write a frame. +type FrameWriteRequest struct { + // write is the interface value that does the writing, once the + // WriteScheduler has selected this frame to write. The write + // functions are all defined in write.go. + write writeFramer + + // stream is the stream on which this frame will be written. + // nil for non-stream frames like PING and SETTINGS. + // nil for RST_STREAM streams, which use the StreamError.StreamID field instead. + stream *stream + + // done, if non-nil, must be a buffered channel with space for + // 1 message and is sent the return value from write (or an + // earlier error) when the frame has been written. + done chan error +} + +// StreamID returns the id of the stream this frame will be written to. +// 0 is used for non-stream frames such as PING and SETTINGS. +func (wr FrameWriteRequest) StreamID() uint32 { + if wr.stream == nil { + if se, ok := wr.write.(StreamError); ok { + // (*serverConn).resetStream doesn't set + // stream because it doesn't necessarily have + // one. So special case this type of write + // message. + return se.StreamID + } + return 0 + } + return wr.stream.id +} + +// isControl reports whether wr is a control frame for MaxQueuedControlFrames +// purposes. That includes non-stream frames and RST_STREAM frames. +func (wr FrameWriteRequest) isControl() bool { + return wr.stream == nil +} + +// DataSize returns the number of flow control bytes that must be consumed +// to write this entire frame. This is 0 for non-DATA frames. +func (wr FrameWriteRequest) DataSize() int { + if wd, ok := wr.write.(*writeData); ok { + return len(wd.p) + } + return 0 +} + +// Consume consumes min(n, available) bytes from this frame, where available +// is the number of flow control bytes available on the stream. Consume returns +// 0, 1, or 2 frames, where the integer return value gives the number of frames +// returned. +// +// If flow control prevents consuming any bytes, this returns (_, _, 0). If +// the entire frame was consumed, this returns (wr, _, 1). Otherwise, this +// returns (consumed, rest, 2), where 'consumed' contains the consumed bytes and +// 'rest' contains the remaining bytes. The consumed bytes are deducted from the +// underlying stream's flow control budget. +func (wr FrameWriteRequest) Consume(n int32) (FrameWriteRequest, FrameWriteRequest, int) { + var empty FrameWriteRequest + + // Non-DATA frames are always consumed whole. + wd, ok := wr.write.(*writeData) + if !ok || len(wd.p) == 0 { + return wr, empty, 1 + } + + // Might need to split after applying limits. + allowed := wr.stream.flow.available() + if n < allowed { + allowed = n + } + if wr.stream.sc.maxFrameSize < allowed { + allowed = wr.stream.sc.maxFrameSize + } + if allowed <= 0 { + return empty, empty, 0 + } + if len(wd.p) > int(allowed) { + wr.stream.flow.take(allowed) + consumed := FrameWriteRequest{ + stream: wr.stream, + write: &writeData{ + streamID: wd.streamID, + p: wd.p[:allowed], + // Even if the original had endStream set, there + // are bytes remaining because len(wd.p) > allowed, + // so we know endStream is false. + endStream: false, + }, + // Our caller is blocking on the final DATA frame, not + // this intermediate frame, so no need to wait. + done: nil, + } + rest := FrameWriteRequest{ + stream: wr.stream, + write: &writeData{ + streamID: wd.streamID, + p: wd.p[allowed:], + endStream: wd.endStream, + }, + done: wr.done, + } + return consumed, rest, 2 + } + + // The frame is consumed whole. + // NB: This cast cannot overflow because allowed is <= math.MaxInt32. + wr.stream.flow.take(int32(len(wd.p))) + return wr, empty, 1 +} + +// String is for debugging only. +func (wr FrameWriteRequest) String() string { + var des string + if s, ok := wr.write.(fmt.Stringer); ok { + des = s.String() + } else { + des = fmt.Sprintf("%T", wr.write) + } + return fmt.Sprintf("[FrameWriteRequest stream=%d, ch=%v, writer=%v]", wr.StreamID(), wr.done != nil, des) +} + +// replyToWriter sends err to wr.done and panics if the send must block +// This does nothing if wr.done is nil. +func (wr *FrameWriteRequest) replyToWriter(err error) { + if wr.done == nil { + return + } + select { + case wr.done <- err: + default: + panic(fmt.Sprintf("unbuffered done channel passed in for type %T", wr.write)) + } + wr.write = nil // prevent use (assume it's tainted after wr.done send) +} + +// writeQueue is used by implementations of WriteScheduler. +type writeQueue struct { + s []FrameWriteRequest + prev, next *writeQueue +} + +func (q *writeQueue) empty() bool { return len(q.s) == 0 } + +func (q *writeQueue) push(wr FrameWriteRequest) { + q.s = append(q.s, wr) +} + +func (q *writeQueue) shift() FrameWriteRequest { + if len(q.s) == 0 { + panic("invalid use of queue") + } + wr := q.s[0] + // TODO: less copy-happy queue. + copy(q.s, q.s[1:]) + q.s[len(q.s)-1] = FrameWriteRequest{} + q.s = q.s[:len(q.s)-1] + return wr +} + +// consume consumes up to n bytes from q.s[0]. If the frame is +// entirely consumed, it is removed from the queue. If the frame +// is partially consumed, the frame is kept with the consumed +// bytes removed. Returns true iff any bytes were consumed. +func (q *writeQueue) consume(n int32) (FrameWriteRequest, bool) { + if len(q.s) == 0 { + return FrameWriteRequest{}, false + } + consumed, rest, numresult := q.s[0].Consume(n) + switch numresult { + case 0: + return FrameWriteRequest{}, false + case 1: + q.shift() + case 2: + q.s[0] = rest + } + return consumed, true +} + +type writeQueuePool []*writeQueue + +// put inserts an unused writeQueue into the pool. +func (p *writeQueuePool) put(q *writeQueue) { + for i := range q.s { + q.s[i] = FrameWriteRequest{} + } + q.s = q.s[:0] + *p = append(*p, q) +} + +// get returns an empty writeQueue. +func (p *writeQueuePool) get() *writeQueue { + ln := len(*p) + if ln == 0 { + return new(writeQueue) + } + x := ln - 1 + q := (*p)[x] + (*p)[x] = nil + *p = (*p)[:x] + return q +} diff --git a/vendor/golang.org/x/net/http2/writesched_priority.go b/vendor/golang.org/x/net/http2/writesched_priority.go new file mode 100644 index 0000000..f678333 --- /dev/null +++ b/vendor/golang.org/x/net/http2/writesched_priority.go @@ -0,0 +1,451 @@ +// Copyright 2016 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 http2 + +import ( + "fmt" + "math" + "sort" +) + +// RFC 7540, Section 5.3.5: the default weight is 16. +const priorityDefaultWeight = 15 // 16 = 15 + 1 + +// PriorityWriteSchedulerConfig configures a priorityWriteScheduler. +type PriorityWriteSchedulerConfig struct { + // MaxClosedNodesInTree controls the maximum number of closed streams to + // retain in the priority tree. Setting this to zero saves a small amount + // of memory at the cost of performance. + // + // See RFC 7540, Section 5.3.4: + // "It is possible for a stream to become closed while prioritization + // information ... is in transit. ... This potentially creates suboptimal + // prioritization, since the stream could be given a priority that is + // different from what is intended. To avoid these problems, an endpoint + // SHOULD retain stream prioritization state for a period after streams + // become closed. The longer state is retained, the lower the chance that + // streams are assigned incorrect or default priority values." + MaxClosedNodesInTree int + + // MaxIdleNodesInTree controls the maximum number of idle streams to + // retain in the priority tree. Setting this to zero saves a small amount + // of memory at the cost of performance. + // + // See RFC 7540, Section 5.3.4: + // Similarly, streams that are in the "idle" state can be assigned + // priority or become a parent of other streams. This allows for the + // creation of a grouping node in the dependency tree, which enables + // more flexible expressions of priority. Idle streams begin with a + // default priority (Section 5.3.5). + MaxIdleNodesInTree int + + // ThrottleOutOfOrderWrites enables write throttling to help ensure that + // data is delivered in priority order. This works around a race where + // stream B depends on stream A and both streams are about to call Write + // to queue DATA frames. If B wins the race, a naive scheduler would eagerly + // write as much data from B as possible, but this is suboptimal because A + // is a higher-priority stream. With throttling enabled, we write a small + // amount of data from B to minimize the amount of bandwidth that B can + // steal from A. + ThrottleOutOfOrderWrites bool +} + +// NewPriorityWriteScheduler constructs a WriteScheduler that schedules +// frames by following HTTP/2 priorities as described in RFC 7540 Section 5.3. +// If cfg is nil, default options are used. +func NewPriorityWriteScheduler(cfg *PriorityWriteSchedulerConfig) WriteScheduler { + if cfg == nil { + // For justification of these defaults, see: + // https://docs.google.com/document/d/1oLhNg1skaWD4_DtaoCxdSRN5erEXrH-KnLrMwEpOtFY + cfg = &PriorityWriteSchedulerConfig{ + MaxClosedNodesInTree: 10, + MaxIdleNodesInTree: 10, + ThrottleOutOfOrderWrites: false, + } + } + + ws := &priorityWriteScheduler{ + nodes: make(map[uint32]*priorityNode), + maxClosedNodesInTree: cfg.MaxClosedNodesInTree, + maxIdleNodesInTree: cfg.MaxIdleNodesInTree, + enableWriteThrottle: cfg.ThrottleOutOfOrderWrites, + } + ws.nodes[0] = &ws.root + if cfg.ThrottleOutOfOrderWrites { + ws.writeThrottleLimit = 1024 + } else { + ws.writeThrottleLimit = math.MaxInt32 + } + return ws +} + +type priorityNodeState int + +const ( + priorityNodeOpen priorityNodeState = iota + priorityNodeClosed + priorityNodeIdle +) + +// priorityNode is a node in an HTTP/2 priority tree. +// Each node is associated with a single stream ID. +// See RFC 7540, Section 5.3. +type priorityNode struct { + q writeQueue // queue of pending frames to write + id uint32 // id of the stream, or 0 for the root of the tree + weight uint8 // the actual weight is weight+1, so the value is in [1,256] + state priorityNodeState // open | closed | idle + bytes int64 // number of bytes written by this node, or 0 if closed + subtreeBytes int64 // sum(node.bytes) of all nodes in this subtree + + // These links form the priority tree. + parent *priorityNode + kids *priorityNode // start of the kids list + prev, next *priorityNode // doubly-linked list of siblings +} + +func (n *priorityNode) setParent(parent *priorityNode) { + if n == parent { + panic("setParent to self") + } + if n.parent == parent { + return + } + // Unlink from current parent. + if parent := n.parent; parent != nil { + if n.prev == nil { + parent.kids = n.next + } else { + n.prev.next = n.next + } + if n.next != nil { + n.next.prev = n.prev + } + } + // Link to new parent. + // If parent=nil, remove n from the tree. + // Always insert at the head of parent.kids (this is assumed by walkReadyInOrder). + n.parent = parent + if parent == nil { + n.next = nil + n.prev = nil + } else { + n.next = parent.kids + n.prev = nil + if n.next != nil { + n.next.prev = n + } + parent.kids = n + } +} + +func (n *priorityNode) addBytes(b int64) { + n.bytes += b + for ; n != nil; n = n.parent { + n.subtreeBytes += b + } +} + +// walkReadyInOrder iterates over the tree in priority order, calling f for each node +// with a non-empty write queue. When f returns true, this function returns true and the +// walk halts. tmp is used as scratch space for sorting. +// +// f(n, openParent) takes two arguments: the node to visit, n, and a bool that is true +// if any ancestor p of n is still open (ignoring the root node). +func (n *priorityNode) walkReadyInOrder(openParent bool, tmp *[]*priorityNode, f func(*priorityNode, bool) bool) bool { + if !n.q.empty() && f(n, openParent) { + return true + } + if n.kids == nil { + return false + } + + // Don't consider the root "open" when updating openParent since + // we can't send data frames on the root stream (only control frames). + if n.id != 0 { + openParent = openParent || (n.state == priorityNodeOpen) + } + + // Common case: only one kid or all kids have the same weight. + // Some clients don't use weights; other clients (like web browsers) + // use mostly-linear priority trees. + w := n.kids.weight + needSort := false + for k := n.kids.next; k != nil; k = k.next { + if k.weight != w { + needSort = true + break + } + } + if !needSort { + for k := n.kids; k != nil; k = k.next { + if k.walkReadyInOrder(openParent, tmp, f) { + return true + } + } + return false + } + + // Uncommon case: sort the child nodes. We remove the kids from the parent, + // then re-insert after sorting so we can reuse tmp for future sort calls. + *tmp = (*tmp)[:0] + for n.kids != nil { + *tmp = append(*tmp, n.kids) + n.kids.setParent(nil) + } + sort.Sort(sortPriorityNodeSiblings(*tmp)) + for i := len(*tmp) - 1; i >= 0; i-- { + (*tmp)[i].setParent(n) // setParent inserts at the head of n.kids + } + for k := n.kids; k != nil; k = k.next { + if k.walkReadyInOrder(openParent, tmp, f) { + return true + } + } + return false +} + +type sortPriorityNodeSiblings []*priorityNode + +func (z sortPriorityNodeSiblings) Len() int { return len(z) } +func (z sortPriorityNodeSiblings) Swap(i, k int) { z[i], z[k] = z[k], z[i] } +func (z sortPriorityNodeSiblings) Less(i, k int) bool { + // Prefer the subtree that has sent fewer bytes relative to its weight. + // See sections 5.3.2 and 5.3.4. + wi, bi := float64(z[i].weight+1), float64(z[i].subtreeBytes) + wk, bk := float64(z[k].weight+1), float64(z[k].subtreeBytes) + if bi == 0 && bk == 0 { + return wi >= wk + } + if bk == 0 { + return false + } + return bi/bk <= wi/wk +} + +type priorityWriteScheduler struct { + // root is the root of the priority tree, where root.id = 0. + // The root queues control frames that are not associated with any stream. + root priorityNode + + // nodes maps stream ids to priority tree nodes. + nodes map[uint32]*priorityNode + + // maxID is the maximum stream id in nodes. + maxID uint32 + + // lists of nodes that have been closed or are idle, but are kept in + // the tree for improved prioritization. When the lengths exceed either + // maxClosedNodesInTree or maxIdleNodesInTree, old nodes are discarded. + closedNodes, idleNodes []*priorityNode + + // From the config. + maxClosedNodesInTree int + maxIdleNodesInTree int + writeThrottleLimit int32 + enableWriteThrottle bool + + // tmp is scratch space for priorityNode.walkReadyInOrder to reduce allocations. + tmp []*priorityNode + + // pool of empty queues for reuse. + queuePool writeQueuePool +} + +func (ws *priorityWriteScheduler) OpenStream(streamID uint32, options OpenStreamOptions) { + // The stream may be currently idle but cannot be opened or closed. + if curr := ws.nodes[streamID]; curr != nil { + if curr.state != priorityNodeIdle { + panic(fmt.Sprintf("stream %d already opened", streamID)) + } + curr.state = priorityNodeOpen + return + } + + // RFC 7540, Section 5.3.5: + // "All streams are initially assigned a non-exclusive dependency on stream 0x0. + // Pushed streams initially depend on their associated stream. In both cases, + // streams are assigned a default weight of 16." + parent := ws.nodes[options.PusherID] + if parent == nil { + parent = &ws.root + } + n := &priorityNode{ + q: *ws.queuePool.get(), + id: streamID, + weight: priorityDefaultWeight, + state: priorityNodeOpen, + } + n.setParent(parent) + ws.nodes[streamID] = n + if streamID > ws.maxID { + ws.maxID = streamID + } +} + +func (ws *priorityWriteScheduler) CloseStream(streamID uint32) { + if streamID == 0 { + panic("violation of WriteScheduler interface: cannot close stream 0") + } + if ws.nodes[streamID] == nil { + panic(fmt.Sprintf("violation of WriteScheduler interface: unknown stream %d", streamID)) + } + if ws.nodes[streamID].state != priorityNodeOpen { + panic(fmt.Sprintf("violation of WriteScheduler interface: stream %d already closed", streamID)) + } + + n := ws.nodes[streamID] + n.state = priorityNodeClosed + n.addBytes(-n.bytes) + + q := n.q + ws.queuePool.put(&q) + n.q.s = nil + if ws.maxClosedNodesInTree > 0 { + ws.addClosedOrIdleNode(&ws.closedNodes, ws.maxClosedNodesInTree, n) + } else { + ws.removeNode(n) + } +} + +func (ws *priorityWriteScheduler) AdjustStream(streamID uint32, priority PriorityParam) { + if streamID == 0 { + panic("adjustPriority on root") + } + + // If streamID does not exist, there are two cases: + // - A closed stream that has been removed (this will have ID <= maxID) + // - An idle stream that is being used for "grouping" (this will have ID > maxID) + n := ws.nodes[streamID] + if n == nil { + if streamID <= ws.maxID || ws.maxIdleNodesInTree == 0 { + return + } + ws.maxID = streamID + n = &priorityNode{ + q: *ws.queuePool.get(), + id: streamID, + weight: priorityDefaultWeight, + state: priorityNodeIdle, + } + n.setParent(&ws.root) + ws.nodes[streamID] = n + ws.addClosedOrIdleNode(&ws.idleNodes, ws.maxIdleNodesInTree, n) + } + + // Section 5.3.1: A dependency on a stream that is not currently in the tree + // results in that stream being given a default priority (Section 5.3.5). + parent := ws.nodes[priority.StreamDep] + if parent == nil { + n.setParent(&ws.root) + n.weight = priorityDefaultWeight + return + } + + // Ignore if the client tries to make a node its own parent. + if n == parent { + return + } + + // Section 5.3.3: + // "If a stream is made dependent on one of its own dependencies, the + // formerly dependent stream is first moved to be dependent on the + // reprioritized stream's previous parent. The moved dependency retains + // its weight." + // + // That is: if parent depends on n, move parent to depend on n.parent. + for x := parent.parent; x != nil; x = x.parent { + if x == n { + parent.setParent(n.parent) + break + } + } + + // Section 5.3.3: The exclusive flag causes the stream to become the sole + // dependency of its parent stream, causing other dependencies to become + // dependent on the exclusive stream. + if priority.Exclusive { + k := parent.kids + for k != nil { + next := k.next + if k != n { + k.setParent(n) + } + k = next + } + } + + n.setParent(parent) + n.weight = priority.Weight +} + +func (ws *priorityWriteScheduler) Push(wr FrameWriteRequest) { + var n *priorityNode + if wr.isControl() { + n = &ws.root + } else { + id := wr.StreamID() + n = ws.nodes[id] + if n == nil { + // id is an idle or closed stream. wr should not be a HEADERS or + // DATA frame. In other case, we push wr onto the root, rather + // than creating a new priorityNode. + if wr.DataSize() > 0 { + panic("add DATA on non-open stream") + } + n = &ws.root + } + } + n.q.push(wr) +} + +func (ws *priorityWriteScheduler) Pop() (wr FrameWriteRequest, ok bool) { + ws.root.walkReadyInOrder(false, &ws.tmp, func(n *priorityNode, openParent bool) bool { + limit := int32(math.MaxInt32) + if openParent { + limit = ws.writeThrottleLimit + } + wr, ok = n.q.consume(limit) + if !ok { + return false + } + n.addBytes(int64(wr.DataSize())) + // If B depends on A and B continuously has data available but A + // does not, gradually increase the throttling limit to allow B to + // steal more and more bandwidth from A. + if openParent { + ws.writeThrottleLimit += 1024 + if ws.writeThrottleLimit < 0 { + ws.writeThrottleLimit = math.MaxInt32 + } + } else if ws.enableWriteThrottle { + ws.writeThrottleLimit = 1024 + } + return true + }) + return wr, ok +} + +func (ws *priorityWriteScheduler) addClosedOrIdleNode(list *[]*priorityNode, maxSize int, n *priorityNode) { + if maxSize == 0 { + return + } + if len(*list) == maxSize { + // Remove the oldest node, then shift left. + ws.removeNode((*list)[0]) + x := (*list)[1:] + copy(*list, x) + *list = (*list)[:len(x)] + } + *list = append(*list, n) +} + +func (ws *priorityWriteScheduler) removeNode(n *priorityNode) { + for n.kids != nil { + n.kids.setParent(n.parent) + } + n.setParent(nil) + delete(ws.nodes, n.id) +} diff --git a/vendor/golang.org/x/net/http2/writesched_random.go b/vendor/golang.org/x/net/http2/writesched_random.go new file mode 100644 index 0000000..f2e55e0 --- /dev/null +++ b/vendor/golang.org/x/net/http2/writesched_random.go @@ -0,0 +1,77 @@ +// Copyright 2014 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 http2 + +import "math" + +// NewRandomWriteScheduler constructs a WriteScheduler that ignores HTTP/2 +// priorities. Control frames like SETTINGS and PING are written before DATA +// frames, but if no control frames are queued and multiple streams have queued +// HEADERS or DATA frames, Pop selects a ready stream arbitrarily. +func NewRandomWriteScheduler() WriteScheduler { + return &randomWriteScheduler{sq: make(map[uint32]*writeQueue)} +} + +type randomWriteScheduler struct { + // zero are frames not associated with a specific stream. + zero writeQueue + + // sq contains the stream-specific queues, keyed by stream ID. + // When a stream is idle, closed, or emptied, it's deleted + // from the map. + sq map[uint32]*writeQueue + + // pool of empty queues for reuse. + queuePool writeQueuePool +} + +func (ws *randomWriteScheduler) OpenStream(streamID uint32, options OpenStreamOptions) { + // no-op: idle streams are not tracked +} + +func (ws *randomWriteScheduler) CloseStream(streamID uint32) { + q, ok := ws.sq[streamID] + if !ok { + return + } + delete(ws.sq, streamID) + ws.queuePool.put(q) +} + +func (ws *randomWriteScheduler) AdjustStream(streamID uint32, priority PriorityParam) { + // no-op: priorities are ignored +} + +func (ws *randomWriteScheduler) Push(wr FrameWriteRequest) { + if wr.isControl() { + ws.zero.push(wr) + return + } + id := wr.StreamID() + q, ok := ws.sq[id] + if !ok { + q = ws.queuePool.get() + ws.sq[id] = q + } + q.push(wr) +} + +func (ws *randomWriteScheduler) Pop() (FrameWriteRequest, bool) { + // Control and RST_STREAM frames first. + if !ws.zero.empty() { + return ws.zero.shift(), true + } + // Iterate over all non-idle streams until finding one that can be consumed. + for streamID, q := range ws.sq { + if wr, ok := q.consume(math.MaxInt32); ok { + if q.empty() { + delete(ws.sq, streamID) + ws.queuePool.put(q) + } + return wr, true + } + } + return FrameWriteRequest{}, false +} diff --git a/vendor/golang.org/x/net/http2/writesched_roundrobin.go b/vendor/golang.org/x/net/http2/writesched_roundrobin.go new file mode 100644 index 0000000..54fe863 --- /dev/null +++ b/vendor/golang.org/x/net/http2/writesched_roundrobin.go @@ -0,0 +1,119 @@ +// Copyright 2023 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 http2 + +import ( + "fmt" + "math" +) + +type roundRobinWriteScheduler struct { + // control contains control frames (SETTINGS, PING, etc.). + control writeQueue + + // streams maps stream ID to a queue. + streams map[uint32]*writeQueue + + // stream queues are stored in a circular linked list. + // head is the next stream to write, or nil if there are no streams open. + head *writeQueue + + // pool of empty queues for reuse. + queuePool writeQueuePool +} + +// newRoundRobinWriteScheduler constructs a new write scheduler. +// The round robin scheduler priorizes control frames +// like SETTINGS and PING over DATA frames. +// When there are no control frames to send, it performs a round-robin +// selection from the ready streams. +func newRoundRobinWriteScheduler() WriteScheduler { + ws := &roundRobinWriteScheduler{ + streams: make(map[uint32]*writeQueue), + } + return ws +} + +func (ws *roundRobinWriteScheduler) OpenStream(streamID uint32, options OpenStreamOptions) { + if ws.streams[streamID] != nil { + panic(fmt.Errorf("stream %d already opened", streamID)) + } + q := ws.queuePool.get() + ws.streams[streamID] = q + if ws.head == nil { + ws.head = q + q.next = q + q.prev = q + } else { + // Queues are stored in a ring. + // Insert the new stream before ws.head, putting it at the end of the list. + q.prev = ws.head.prev + q.next = ws.head + q.prev.next = q + q.next.prev = q + } +} + +func (ws *roundRobinWriteScheduler) CloseStream(streamID uint32) { + q := ws.streams[streamID] + if q == nil { + return + } + if q.next == q { + // This was the only open stream. + ws.head = nil + } else { + q.prev.next = q.next + q.next.prev = q.prev + if ws.head == q { + ws.head = q.next + } + } + delete(ws.streams, streamID) + ws.queuePool.put(q) +} + +func (ws *roundRobinWriteScheduler) AdjustStream(streamID uint32, priority PriorityParam) {} + +func (ws *roundRobinWriteScheduler) Push(wr FrameWriteRequest) { + if wr.isControl() { + ws.control.push(wr) + return + } + q := ws.streams[wr.StreamID()] + if q == nil { + // This is a closed stream. + // wr should not be a HEADERS or DATA frame. + // We push the request onto the control queue. + if wr.DataSize() > 0 { + panic("add DATA on non-open stream") + } + ws.control.push(wr) + return + } + q.push(wr) +} + +func (ws *roundRobinWriteScheduler) Pop() (FrameWriteRequest, bool) { + // Control and RST_STREAM frames first. + if !ws.control.empty() { + return ws.control.shift(), true + } + if ws.head == nil { + return FrameWriteRequest{}, false + } + q := ws.head + for { + if wr, ok := q.consume(math.MaxInt32); ok { + ws.head = q.next + return wr, true + } + q = q.next + if q == ws.head { + break + } + } + return FrameWriteRequest{}, false +} diff --git a/vendor/golang.org/x/net/internal/httpcommon/ascii.go b/vendor/golang.org/x/net/internal/httpcommon/ascii.go new file mode 100644 index 0000000..ed14da5 --- /dev/null +++ b/vendor/golang.org/x/net/internal/httpcommon/ascii.go @@ -0,0 +1,53 @@ +// 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 httpcommon + +import "strings" + +// The HTTP protocols are defined in terms of ASCII, not Unicode. This file +// contains helper functions which may use Unicode-aware functions which would +// otherwise be unsafe and could introduce vulnerabilities if used improperly. + +// asciiEqualFold is strings.EqualFold, ASCII only. It reports whether s and t +// are equal, ASCII-case-insensitively. +func asciiEqualFold(s, t string) bool { + if len(s) != len(t) { + return false + } + for i := 0; i < len(s); i++ { + if lower(s[i]) != lower(t[i]) { + return false + } + } + return true +} + +// lower returns the ASCII lowercase version of b. +func lower(b byte) byte { + if 'A' <= b && b <= 'Z' { + return b + ('a' - 'A') + } + return b +} + +// isASCIIPrint returns whether s is ASCII and printable according to +// https://tools.ietf.org/html/rfc20#section-4.2. +func isASCIIPrint(s string) bool { + for i := 0; i < len(s); i++ { + if s[i] < ' ' || s[i] > '~' { + return false + } + } + return true +} + +// asciiToLower returns the lowercase version of s if s is ASCII and printable, +// and whether or not it was. +func asciiToLower(s string) (lower string, ok bool) { + if !isASCIIPrint(s) { + return "", false + } + return strings.ToLower(s), true +} diff --git a/vendor/golang.org/x/net/internal/httpcommon/headermap.go b/vendor/golang.org/x/net/internal/httpcommon/headermap.go new file mode 100644 index 0000000..92483d8 --- /dev/null +++ b/vendor/golang.org/x/net/internal/httpcommon/headermap.go @@ -0,0 +1,115 @@ +// 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 httpcommon + +import ( + "net/textproto" + "sync" +) + +var ( + commonBuildOnce sync.Once + commonLowerHeader map[string]string // Go-Canonical-Case -> lower-case + commonCanonHeader map[string]string // lower-case -> Go-Canonical-Case +) + +func buildCommonHeaderMapsOnce() { + commonBuildOnce.Do(buildCommonHeaderMaps) +} + +func buildCommonHeaderMaps() { + common := []string{ + "accept", + "accept-charset", + "accept-encoding", + "accept-language", + "accept-ranges", + "age", + "access-control-allow-credentials", + "access-control-allow-headers", + "access-control-allow-methods", + "access-control-allow-origin", + "access-control-expose-headers", + "access-control-max-age", + "access-control-request-headers", + "access-control-request-method", + "allow", + "authorization", + "cache-control", + "content-disposition", + "content-encoding", + "content-language", + "content-length", + "content-location", + "content-range", + "content-type", + "cookie", + "date", + "etag", + "expect", + "expires", + "from", + "host", + "if-match", + "if-modified-since", + "if-none-match", + "if-unmodified-since", + "last-modified", + "link", + "location", + "max-forwards", + "origin", + "proxy-authenticate", + "proxy-authorization", + "range", + "referer", + "refresh", + "retry-after", + "server", + "set-cookie", + "strict-transport-security", + "trailer", + "transfer-encoding", + "user-agent", + "vary", + "via", + "www-authenticate", + "x-forwarded-for", + "x-forwarded-proto", + } + commonLowerHeader = make(map[string]string, len(common)) + commonCanonHeader = make(map[string]string, len(common)) + for _, v := range common { + chk := textproto.CanonicalMIMEHeaderKey(v) + commonLowerHeader[chk] = v + commonCanonHeader[v] = chk + } +} + +// LowerHeader returns the lowercase form of a header name, +// used on the wire for HTTP/2 and HTTP/3 requests. +func LowerHeader(v string) (lower string, ascii bool) { + buildCommonHeaderMapsOnce() + if s, ok := commonLowerHeader[v]; ok { + return s, true + } + return asciiToLower(v) +} + +// CanonicalHeader canonicalizes a header name. (For example, "host" becomes "Host".) +func CanonicalHeader(v string) string { + buildCommonHeaderMapsOnce() + if s, ok := commonCanonHeader[v]; ok { + return s + } + return textproto.CanonicalMIMEHeaderKey(v) +} + +// CachedCanonicalHeader returns the canonical form of a well-known header name. +func CachedCanonicalHeader(v string) (string, bool) { + buildCommonHeaderMapsOnce() + s, ok := commonCanonHeader[v] + return s, ok +} diff --git a/vendor/golang.org/x/net/internal/httpcommon/request.go b/vendor/golang.org/x/net/internal/httpcommon/request.go new file mode 100644 index 0000000..4b70553 --- /dev/null +++ b/vendor/golang.org/x/net/internal/httpcommon/request.go @@ -0,0 +1,467 @@ +// 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 httpcommon + +import ( + "context" + "errors" + "fmt" + "net/http/httptrace" + "net/textproto" + "net/url" + "sort" + "strconv" + "strings" + + "golang.org/x/net/http/httpguts" + "golang.org/x/net/http2/hpack" +) + +var ( + ErrRequestHeaderListSize = errors.New("request header list larger than peer's advertised limit") +) + +// Request is a subset of http.Request. +// It'd be simpler to pass an *http.Request, of course, but we can't depend on net/http +// without creating a dependency cycle. +type Request struct { + URL *url.URL + Method string + Host string + Header map[string][]string + Trailer map[string][]string + ActualContentLength int64 // 0 means 0, -1 means unknown +} + +// EncodeHeadersParam is parameters to EncodeHeaders. +type EncodeHeadersParam struct { + Request Request + + // AddGzipHeader indicates that an "accept-encoding: gzip" header should be + // added to the request. + AddGzipHeader bool + + // PeerMaxHeaderListSize, when non-zero, is the peer's MAX_HEADER_LIST_SIZE setting. + PeerMaxHeaderListSize uint64 + + // DefaultUserAgent is the User-Agent header to send when the request + // neither contains a User-Agent nor disables it. + DefaultUserAgent string +} + +// EncodeHeadersParam is the result of EncodeHeaders. +type EncodeHeadersResult struct { + HasBody bool + HasTrailers bool +} + +// EncodeHeaders constructs request headers common to HTTP/2 and HTTP/3. +// It validates a request and calls headerf with each pseudo-header and header +// for the request. +// The headerf function is called with the validated, canonicalized header name. +func EncodeHeaders(ctx context.Context, param EncodeHeadersParam, headerf func(name, value string)) (res EncodeHeadersResult, _ error) { + req := param.Request + + // Check for invalid connection-level headers. + if err := checkConnHeaders(req.Header); err != nil { + return res, err + } + + if req.URL == nil { + return res, errors.New("Request.URL is nil") + } + + host := req.Host + if host == "" { + host = req.URL.Host + } + host, err := httpguts.PunycodeHostPort(host) + if err != nil { + return res, err + } + if !httpguts.ValidHostHeader(host) { + return res, errors.New("invalid Host header") + } + + // isNormalConnect is true if this is a non-extended CONNECT request. + isNormalConnect := false + var protocol string + if vv := req.Header[":protocol"]; len(vv) > 0 { + protocol = vv[0] + } + if req.Method == "CONNECT" && protocol == "" { + isNormalConnect = true + } else if protocol != "" && req.Method != "CONNECT" { + return res, errors.New("invalid :protocol header in non-CONNECT request") + } + + // Validate the path, except for non-extended CONNECT requests which have no path. + var path string + if !isNormalConnect { + path = req.URL.RequestURI() + if !validPseudoPath(path) { + orig := path + path = strings.TrimPrefix(path, req.URL.Scheme+"://"+host) + if !validPseudoPath(path) { + if req.URL.Opaque != "" { + return res, fmt.Errorf("invalid request :path %q from URL.Opaque = %q", orig, req.URL.Opaque) + } else { + return res, fmt.Errorf("invalid request :path %q", orig) + } + } + } + } + + // Check for any invalid headers+trailers and return an error before we + // potentially pollute our hpack state. (We want to be able to + // continue to reuse the hpack encoder for future requests) + if err := validateHeaders(req.Header); err != "" { + return res, fmt.Errorf("invalid HTTP header %s", err) + } + if err := validateHeaders(req.Trailer); err != "" { + return res, fmt.Errorf("invalid HTTP trailer %s", err) + } + + trailers, err := commaSeparatedTrailers(req.Trailer) + if err != nil { + return res, err + } + + enumerateHeaders := func(f func(name, value string)) { + // 8.1.2.3 Request Pseudo-Header Fields + // The :path pseudo-header field includes the path and query parts of the + // target URI (the path-absolute production and optionally a '?' character + // followed by the query production, see Sections 3.3 and 3.4 of + // [RFC3986]). + f(":authority", host) + m := req.Method + if m == "" { + m = "GET" + } + f(":method", m) + if !isNormalConnect { + f(":path", path) + f(":scheme", req.URL.Scheme) + } + if protocol != "" { + f(":protocol", protocol) + } + if trailers != "" { + f("trailer", trailers) + } + + var didUA bool + for k, vv := range req.Header { + if asciiEqualFold(k, "host") || asciiEqualFold(k, "content-length") { + // Host is :authority, already sent. + // Content-Length is automatic, set below. + continue + } else if asciiEqualFold(k, "connection") || + asciiEqualFold(k, "proxy-connection") || + asciiEqualFold(k, "transfer-encoding") || + asciiEqualFold(k, "upgrade") || + asciiEqualFold(k, "keep-alive") { + // Per 8.1.2.2 Connection-Specific Header + // Fields, don't send connection-specific + // fields. We have already checked if any + // are error-worthy so just ignore the rest. + continue + } else if asciiEqualFold(k, "user-agent") { + // Match Go's http1 behavior: at most one + // User-Agent. If set to nil or empty string, + // then omit it. Otherwise if not mentioned, + // include the default (below). + didUA = true + if len(vv) < 1 { + continue + } + vv = vv[:1] + if vv[0] == "" { + continue + } + } else if asciiEqualFold(k, "cookie") { + // Per 8.1.2.5 To allow for better compression efficiency, the + // Cookie header field MAY be split into separate header fields, + // each with one or more cookie-pairs. + for _, v := range vv { + for { + p := strings.IndexByte(v, ';') + if p < 0 { + break + } + f("cookie", v[:p]) + p++ + // strip space after semicolon if any. + for p+1 <= len(v) && v[p] == ' ' { + p++ + } + v = v[p:] + } + if len(v) > 0 { + f("cookie", v) + } + } + continue + } else if k == ":protocol" { + // :protocol pseudo-header was already sent above. + continue + } + + for _, v := range vv { + f(k, v) + } + } + if shouldSendReqContentLength(req.Method, req.ActualContentLength) { + f("content-length", strconv.FormatInt(req.ActualContentLength, 10)) + } + if param.AddGzipHeader { + f("accept-encoding", "gzip") + } + if !didUA { + f("user-agent", param.DefaultUserAgent) + } + } + + // Do a first pass over the headers counting bytes to ensure + // we don't exceed cc.peerMaxHeaderListSize. This is done as a + // separate pass before encoding the headers to prevent + // modifying the hpack state. + if param.PeerMaxHeaderListSize > 0 { + hlSize := uint64(0) + enumerateHeaders(func(name, value string) { + hf := hpack.HeaderField{Name: name, Value: value} + hlSize += uint64(hf.Size()) + }) + + if hlSize > param.PeerMaxHeaderListSize { + return res, ErrRequestHeaderListSize + } + } + + trace := httptrace.ContextClientTrace(ctx) + + // Header list size is ok. Write the headers. + enumerateHeaders(func(name, value string) { + name, ascii := LowerHeader(name) + if !ascii { + // Skip writing invalid headers. Per RFC 7540, Section 8.1.2, header + // field names have to be ASCII characters (just as in HTTP/1.x). + return + } + + headerf(name, value) + + if trace != nil && trace.WroteHeaderField != nil { + trace.WroteHeaderField(name, []string{value}) + } + }) + + res.HasBody = req.ActualContentLength != 0 + res.HasTrailers = trailers != "" + return res, nil +} + +// IsRequestGzip reports whether we should add an Accept-Encoding: gzip header +// for a request. +func IsRequestGzip(method string, header map[string][]string, disableCompression bool) bool { + // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere? + if !disableCompression && + len(header["Accept-Encoding"]) == 0 && + len(header["Range"]) == 0 && + method != "HEAD" { + // Request gzip only, not deflate. Deflate is ambiguous and + // not as universally supported anyway. + // See: https://zlib.net/zlib_faq.html#faq39 + // + // Note that we don't request this for HEAD requests, + // due to a bug in nginx: + // http://trac.nginx.org/nginx/ticket/358 + // https://golang.org/issue/5522 + // + // We don't request gzip if the request is for a range, since + // auto-decoding a portion of a gzipped document will just fail + // anyway. See https://golang.org/issue/8923 + return true + } + return false +} + +// checkConnHeaders checks whether req has any invalid connection-level headers. +// +// https://www.rfc-editor.org/rfc/rfc9114.html#section-4.2-3 +// https://www.rfc-editor.org/rfc/rfc9113.html#section-8.2.2-1 +// +// Certain headers are special-cased as okay but not transmitted later. +// For example, we allow "Transfer-Encoding: chunked", but drop the header when encoding. +func checkConnHeaders(h map[string][]string) error { + if vv := h["Upgrade"]; len(vv) > 0 && (vv[0] != "" && vv[0] != "chunked") { + return fmt.Errorf("invalid Upgrade request header: %q", vv) + } + if vv := h["Transfer-Encoding"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && vv[0] != "chunked") { + return fmt.Errorf("invalid Transfer-Encoding request header: %q", vv) + } + if vv := h["Connection"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && !asciiEqualFold(vv[0], "close") && !asciiEqualFold(vv[0], "keep-alive")) { + return fmt.Errorf("invalid Connection request header: %q", vv) + } + return nil +} + +func commaSeparatedTrailers(trailer map[string][]string) (string, error) { + keys := make([]string, 0, len(trailer)) + for k := range trailer { + k = CanonicalHeader(k) + switch k { + case "Transfer-Encoding", "Trailer", "Content-Length": + return "", fmt.Errorf("invalid Trailer key %q", k) + } + keys = append(keys, k) + } + if len(keys) > 0 { + sort.Strings(keys) + return strings.Join(keys, ","), nil + } + return "", nil +} + +// validPseudoPath reports whether v is a valid :path pseudo-header +// value. It must be either: +// +// - a non-empty string starting with '/' +// - the string '*', for OPTIONS requests. +// +// For now this is only used a quick check for deciding when to clean +// up Opaque URLs before sending requests from the Transport. +// See golang.org/issue/16847 +// +// We used to enforce that the path also didn't start with "//", but +// Google's GFE accepts such paths and Chrome sends them, so ignore +// that part of the spec. See golang.org/issue/19103. +func validPseudoPath(v string) bool { + return (len(v) > 0 && v[0] == '/') || v == "*" +} + +func validateHeaders(hdrs map[string][]string) string { + for k, vv := range hdrs { + if !httpguts.ValidHeaderFieldName(k) && k != ":protocol" { + return fmt.Sprintf("name %q", k) + } + for _, v := range vv { + if !httpguts.ValidHeaderFieldValue(v) { + // Don't include the value in the error, + // because it may be sensitive. + return fmt.Sprintf("value for header %q", k) + } + } + } + return "" +} + +// shouldSendReqContentLength reports whether we should send +// a "content-length" request header. This logic is basically a copy of the net/http +// transferWriter.shouldSendContentLength. +// The contentLength is the corrected contentLength (so 0 means actually 0, not unknown). +// -1 means unknown. +func shouldSendReqContentLength(method string, contentLength int64) bool { + if contentLength > 0 { + return true + } + if contentLength < 0 { + return false + } + // For zero bodies, whether we send a content-length depends on the method. + // It also kinda doesn't matter for http2 either way, with END_STREAM. + switch method { + case "POST", "PUT", "PATCH": + return true + default: + return false + } +} + +// ServerRequestParam is parameters to NewServerRequest. +type ServerRequestParam struct { + Method string + Scheme, Authority, Path string + Protocol string + Header map[string][]string +} + +// ServerRequestResult is the result of NewServerRequest. +type ServerRequestResult struct { + // Various http.Request fields. + URL *url.URL + RequestURI string + Trailer map[string][]string + + NeedsContinue bool // client provided an "Expect: 100-continue" header + + // If the request should be rejected, this is a short string suitable for passing + // to the http2 package's CountError function. + // It might be a bit odd to return errors this way rather than returing an error, + // but this ensures we don't forget to include a CountError reason. + InvalidReason string +} + +func NewServerRequest(rp ServerRequestParam) ServerRequestResult { + needsContinue := httpguts.HeaderValuesContainsToken(rp.Header["Expect"], "100-continue") + if needsContinue { + delete(rp.Header, "Expect") + } + // Merge Cookie headers into one "; "-delimited value. + if cookies := rp.Header["Cookie"]; len(cookies) > 1 { + rp.Header["Cookie"] = []string{strings.Join(cookies, "; ")} + } + + // Setup Trailers + var trailer map[string][]string + for _, v := range rp.Header["Trailer"] { + for _, key := range strings.Split(v, ",") { + key = textproto.CanonicalMIMEHeaderKey(textproto.TrimString(key)) + switch key { + case "Transfer-Encoding", "Trailer", "Content-Length": + // Bogus. (copy of http1 rules) + // Ignore. + default: + if trailer == nil { + trailer = make(map[string][]string) + } + trailer[key] = nil + } + } + } + delete(rp.Header, "Trailer") + + // "':authority' MUST NOT include the deprecated userinfo subcomponent + // for "http" or "https" schemed URIs." + // https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.3.8 + if strings.IndexByte(rp.Authority, '@') != -1 && (rp.Scheme == "http" || rp.Scheme == "https") { + return ServerRequestResult{ + InvalidReason: "userinfo_in_authority", + } + } + + var url_ *url.URL + var requestURI string + if rp.Method == "CONNECT" && rp.Protocol == "" { + url_ = &url.URL{Host: rp.Authority} + requestURI = rp.Authority // mimic HTTP/1 server behavior + } else { + var err error + url_, err = url.ParseRequestURI(rp.Path) + if err != nil { + return ServerRequestResult{ + InvalidReason: "bad_path", + } + } + requestURI = rp.Path + } + + return ServerRequestResult{ + URL: url_, + NeedsContinue: needsContinue, + RequestURI: requestURI, + Trailer: trailer, + } +} diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go index 2e73ee1..6354199 100644 --- a/vendor/golang.org/x/sys/cpu/cpu.go +++ b/vendor/golang.org/x/sys/cpu/cpu.go @@ -232,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_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_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/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 ad67df2..958bcf4 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -2700,6 +2700,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 @@ -3628,3 +3630,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..a58bc48 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") @@ -4391,6 +4392,14 @@ func WSACleanup() (err error) { return } +func WSADuplicateSocket(s Handle, processID uint32, info *WSAProtocolInfo) (err error) { + r1, _, e1 := syscall.Syscall(procWSADuplicateSocketW.Addr(), 3, 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))) n = int32(r0) diff --git a/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go b/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go index 6e34df4..89f5097 100644 --- a/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go +++ b/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go @@ -207,6 +207,9 @@ func childrenOf(n ast.Node) []ast.Node { return false // no recursion }) + // TODO(adonovan): be more careful about missing (!Pos.Valid) + // tokens in trees produced from invalid input. + // Then add fake Nodes for bare tokens. switch n := n.(type) { case *ast.ArrayType: @@ -226,9 +229,12 @@ func childrenOf(n ast.Node) []ast.Node { children = append(children, tok(n.OpPos, len(n.Op.String()))) case *ast.BlockStmt: - children = append(children, - tok(n.Lbrace, len("{")), - tok(n.Rbrace, len("}"))) + if n.Lbrace.IsValid() { + children = append(children, tok(n.Lbrace, len("{"))) + } + if n.Rbrace.IsValid() { + children = append(children, tok(n.Rbrace, len("}"))) + } case *ast.BranchStmt: children = append(children, @@ -304,9 +310,12 @@ func childrenOf(n ast.Node) []ast.Node { // TODO(adonovan): Field.{Doc,Comment,Tag}? case *ast.FieldList: - children = append(children, - tok(n.Opening, len("(")), // or len("[") - tok(n.Closing, len(")"))) // or len("]") + if n.Opening.IsValid() { + children = append(children, tok(n.Opening, len("("))) + } + if n.Closing.IsValid() { + children = append(children, tok(n.Closing, len(")"))) + } case *ast.File: // TODO test: Doc diff --git a/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go b/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go index 5c8dbbb..4ad0549 100644 --- a/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go +++ b/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go @@ -67,6 +67,10 @@ var abort = new(int) // singleton, to signal termination of Apply // // The methods Replace, Delete, InsertBefore, and InsertAfter // can be used to change the AST without disrupting Apply. +// +// This type is not to be confused with [inspector.Cursor] from +// package [golang.org/x/tools/go/ast/inspector], which provides +// stateless navigation of immutable syntax trees. type Cursor struct { parent ast.Node name string diff --git a/vendor/golang.org/x/tools/go/loader/doc.go b/vendor/golang.org/x/tools/go/loader/doc.go index e35b1fd..769a1fc 100644 --- a/vendor/golang.org/x/tools/go/loader/doc.go +++ b/vendor/golang.org/x/tools/go/loader/doc.go @@ -164,7 +164,7 @@ package loader // entry is created in this cache by startLoad the first time the // package is imported. The first goroutine to request an entry becomes // responsible for completing the task and broadcasting completion to -// subsequent requestors, which block until then. +// subsequent requesters, which block until then. // // Type checking occurs in (parallel) postorder: we cannot type-check a // set of files until we have loaded and type-checked all of their diff --git a/vendor/maunium.net/go/mautrix/CHANGELOG.md b/vendor/maunium.net/go/mautrix/CHANGELOG.md index 565d7f1..b2eefb3 100644 --- a/vendor/maunium.net/go/mautrix/CHANGELOG.md +++ b/vendor/maunium.net/go/mautrix/CHANGELOG.md @@ -1,3 +1,61 @@ +## v0.24.1 (2025-06-16) + +* *(commands)* Added framework for using reactions as buttons that execute + command handlers. +* *(client)* Added wrapper for `/relations` endpoints. +* *(client)* Added support for stable version of room summary endpoint. +* *(client)* Fixed parsing URL preview responses where width/height are strings. +* *(federation)* Fixed bugs in server auth. +* *(id)* Added utilities for validating server names. +* *(event)* Fixed incorrect empty `entity` field when sending hashed moderation + policy events. +* *(event)* Added [MSC4293] redact events field to member events. +* *(event)* Added support for fallbacks in [MSC4144] per-message profiles. +* *(format)* Added `MarkdownLink` and `MarkdownMention` utility functions for + generating properly escaped markdown. +* *(synapseadmin)* Added support for synchronous (v1) room delete endpoint. +* *(synapseadmin)* Changed `Client` struct to not embed the `mautrix.Client`. + This is a breaking change if you were relying on accessing non-admin functions + from the admin client. +* *(bridgev2/provisioning)* Fixed `/display_and_wait` not passing through errors + from the network connector properly. +* *(bridgev2/crypto)* Fixed encryption not working if the user's ID had the same + prefix as the bridge ghosts (e.g. `@whatsappbridgeuser:example.com` with a + `@whatsapp_` prefix). +* *(bridgev2)* Fixed portals not being saved after creating a DM portal from a + Matrix DM invite. +* *(bridgev2)* Added config option to determine whether cross-room replies + should be bridged. +* *(appservice)* Fixed `EnsureRegistered` not being called when sending a custom + member event for the controlled user. + +[MSC4293]: https://github.com/matrix-org/matrix-spec-proposals/pull/4293 + +## v0.24.0 (2025-05-16) + +* *(commands)* Added generic framework for implementing bot commands. +* *(client)* Added support for specifying maximum number of HTTP retries using + a context value instead of having to call `MakeFullRequest` manually. +* *(client,federation)* Added methods for fetching room directories. +* *(federation)* Added support for server side of request authentication. +* *(synapseadmin)* Added wrapper for the account suspension endpoint. +* *(format)* Added method for safely wrapping a string in markdown inline code. +* *(crypto)* Added method to import key backup without persisting to database, + to allow the client more control over the process. +* *(bridgev2)* Added viewing chat interface to signal when the user is viewing + a given chat. +* *(bridgev2)* Added option to pass through transaction ID from client when + sending messages to remote network. +* *(crypto)* Fixed unnecessary error log when decrypting dummy events used for + unwedging Olm sessions. +* *(crypto)* Fixed `forwarding_curve25519_key_chain` not being set consistently + when backing up keys. +* *(event)* Fixed marshaling legacy VoIP events with no version field. +* *(bridgev2)* Fixed disappearing message references not being deleted when the + portal is deleted. +* *(bridgev2)* Fixed read receipt bridging not ignoring fake message entries + and causing unnecessary error logs. + ## v0.23.3 (2025-04-16) * *(commands)* Added generic command processing framework for bots. diff --git a/vendor/maunium.net/go/mautrix/client.go b/vendor/maunium.net/go/mautrix/client.go index a08fbed..6f74601 100644 --- a/vendor/maunium.net/go/mautrix/client.go +++ b/vendor/maunium.net/go/mautrix/client.go @@ -316,6 +316,7 @@ type contextKey int const ( LogBodyContextKey contextKey = iota LogRequestIDContextKey + MaxAttemptsContextKey ) func (cli *Client) RequestStart(req *http.Request) { @@ -324,6 +325,14 @@ func (cli *Client) RequestStart(req *http.Request) { } } +// WithMaxRetries updates the context to set the maximum number of retries for any HTTP requests made with the context. +// +// 0 means the request will only be attempted once and will not be retried. +// Negative values will remove the override and fallback to the defaults. +func WithMaxRetries(ctx context.Context, maxRetries int) context.Context { + return context.WithValue(ctx, MaxAttemptsContextKey, maxRetries+1) +} + func (cli *Client) LogRequestDone(req *http.Request, resp *http.Response, err error, handlerErr error, contentLength int, duration time.Duration) { if cli == nil { return @@ -472,8 +481,16 @@ func (cli *Client) MakeFullRequestWithResp(ctx context.Context, params FullReque if cli == nil { return nil, nil, ErrClientIsNil } + if cli.HomeserverURL == nil || cli.HomeserverURL.Scheme == "" { + return nil, nil, ErrClientHasNoHomeserver + } if params.MaxAttempts == 0 { - params.MaxAttempts = 1 + cli.DefaultHTTPRetries + maxAttempts, ok := ctx.Value(MaxAttemptsContextKey).(int) + if ok && maxAttempts > 0 { + params.MaxAttempts = maxAttempts + } else { + params.MaxAttempts = 1 + cli.DefaultHTTPRetries + } } if params.BackoffDuration == 0 { if cli.DefaultHTTPBackoff == 0 { @@ -538,7 +555,11 @@ func (cli *Client) doRetry(req *http.Request, cause error, retries int, backoff log.Warn().Err(cause). Int("retry_in_seconds", int(backoff.Seconds())). Msg("Request failed, retrying") - time.Sleep(backoff) + select { + case <-time.After(backoff): + case <-req.Context().Done(): + return nil, nil, req.Context().Err() + } if cli.UpdateRequestOnRetry != nil { req = cli.UpdateRequestOnRetry(req, cause) } @@ -1041,13 +1062,17 @@ func (cli *Client) GetMutualRooms(ctx context.Context, otherUserID id.UserID, ex } func (cli *Client) GetRoomSummary(ctx context.Context, roomIDOrAlias string, via ...string) (resp *RespRoomSummary, err error) { + urlPath := ClientURLPath{"unstable", "im.nheko.summary", "summary", roomIDOrAlias} + if cli.SpecVersions.ContainsGreaterOrEqual(SpecV115) { + urlPath = ClientURLPath{"v1", "room_summary", roomIDOrAlias} + } // TODO add version check after one is added to MSC3266 - urlPath := cli.BuildURLWithFullQuery(ClientURLPath{"unstable", "im.nheko.summary", "summary", roomIDOrAlias}, func(q url.Values) { + fullURL := cli.BuildURLWithFullQuery(urlPath, func(q url.Values) { if len(via) > 0 { q["via"] = via } }) - _, err = cli.MakeRequest(ctx, http.MethodGet, urlPath, nil, &resp) + _, err = cli.MakeRequest(ctx, http.MethodGet, fullURL, nil, &resp) return } @@ -1791,6 +1816,9 @@ func (cli *Client) uploadMediaToURL(ctx context.Context, data ReqUploadMedia) (* break } err = fmt.Errorf("HTTP %d", resp.StatusCode) + } else if errors.Is(err, context.Canceled) { + cli.Log.Warn().Str("url", data.UnstableUploadURL).Msg("External media upload canceled") + return nil, err } if retries <= 0 { cli.Log.Warn().Str("url", data.UnstableUploadURL).Err(err). @@ -1972,6 +2000,12 @@ func (cli *Client) JoinedRooms(ctx context.Context) (resp *RespJoinedRooms, err return } +func (cli *Client) PublicRooms(ctx context.Context, req *ReqPublicRooms) (resp *RespPublicRooms, err error) { + urlPath := cli.BuildURLWithQuery(ClientURLPath{"v3", "publicRooms"}, req.Query()) + _, err = cli.MakeRequest(ctx, http.MethodGet, urlPath, nil, &resp) + return +} + // Hierarchy returns a list of rooms that are in the room's hierarchy. See https://spec.matrix.org/v1.4/client-server-api/#get_matrixclientv1roomsroomidhierarchy // // The hierarchy API is provided to walk the space tree and discover the rooms with their aesthetic details. works in a depth-first manner: @@ -2062,6 +2096,12 @@ func (cli *Client) GetUnredactedEventContent(ctx context.Context, roomID id.Room return } +func (cli *Client) GetRelations(ctx context.Context, roomID id.RoomID, eventID id.EventID, req *ReqGetRelations) (resp *RespGetRelations, err error) { + urlPath := cli.BuildURLWithQuery(append(ClientURLPath{"v1", "rooms", roomID, "relations", eventID}, req.PathSuffix()...), req.Query()) + _, err = cli.MakeRequest(ctx, http.MethodGet, urlPath, nil, &resp) + return +} + func (cli *Client) MarkRead(ctx context.Context, roomID id.RoomID, eventID id.EventID) (err error) { return cli.SendReceipt(ctx, roomID, eventID, event.ReceiptTypeRead, nil) } diff --git a/vendor/maunium.net/go/mautrix/crypto/cross_sign_key.go b/vendor/maunium.net/go/mautrix/crypto/cross_sign_key.go index 97ecd86..4094f69 100644 --- a/vendor/maunium.net/go/mautrix/crypto/cross_sign_key.go +++ b/vendor/maunium.net/go/mautrix/crypto/cross_sign_key.go @@ -11,6 +11,8 @@ import ( "context" "fmt" + "go.mau.fi/util/jsonbytes" + "maunium.net/go/mautrix" "maunium.net/go/mautrix/crypto/olm" "maunium.net/go/mautrix/crypto/signatures" @@ -33,9 +35,9 @@ func (cskc *CrossSigningKeysCache) PublicKeys() *CrossSigningPublicKeysCache { } type CrossSigningSeeds struct { - MasterKey []byte - SelfSigningKey []byte - UserSigningKey []byte + MasterKey jsonbytes.UnpaddedURLBytes `json:"m.cross_signing.master"` + SelfSigningKey jsonbytes.UnpaddedURLBytes `json:"m.cross_signing.self_signing"` + UserSigningKey jsonbytes.UnpaddedURLBytes `json:"m.cross_signing.user_signing"` } func (mach *OlmMachine) ExportCrossSigningKeys() CrossSigningSeeds { diff --git a/vendor/maunium.net/go/mautrix/crypto/cryptohelper/cryptohelper.go b/vendor/maunium.net/go/mautrix/crypto/cryptohelper/cryptohelper.go index f03835e..56f8b48 100644 --- a/vendor/maunium.net/go/mautrix/crypto/cryptohelper/cryptohelper.go +++ b/vendor/maunium.net/go/mautrix/crypto/cryptohelper/cryptohelper.go @@ -170,14 +170,12 @@ func (helper *CryptoHelper) Init(ctx context.Context) error { if err != nil { return err } - rawCryptoStore.DeviceID = resp.DeviceID helper.client.DeviceID = resp.DeviceID } else { helper.log.Debug(). Str("username", helper.LoginAs.Identifier.User). Stringer("device_id", storedDeviceID). Msg("Using existing device") - rawCryptoStore.DeviceID = storedDeviceID helper.client.DeviceID = storedDeviceID } } else if helper.LoginAs != nil { @@ -193,12 +191,10 @@ func (helper *CryptoHelper) Init(ctx context.Context) error { if err != nil { return err } - if storedDeviceID == "" { - rawCryptoStore.DeviceID = helper.client.DeviceID - } } else if storedDeviceID != "" && storedDeviceID != helper.client.DeviceID { return fmt.Errorf("mismatching device ID in client and crypto store (%q != %q)", storedDeviceID, helper.client.DeviceID) } + rawCryptoStore.DeviceID = helper.client.DeviceID } else if helper.LoginAs != nil { return fmt.Errorf("LoginAs can only be used with a managed crypto store") } diff --git a/vendor/maunium.net/go/mautrix/crypto/decryptolm.go b/vendor/maunium.net/go/mautrix/crypto/decryptolm.go index 353979d..b737e4e 100644 --- a/vendor/maunium.net/go/mautrix/crypto/decryptolm.go +++ b/vendor/maunium.net/go/mautrix/crypto/decryptolm.go @@ -106,9 +106,11 @@ func (mach *OlmMachine) decryptAndParseOlmCiphertext(ctx context.Context, evt *e return nil, RecipientKeyMismatch } - err = olmEvt.Content.ParseRaw(olmEvt.Type) - if err != nil && !errors.Is(err, event.ErrUnsupportedContentType) { - return nil, fmt.Errorf("failed to parse content of olm payload event: %w", err) + if len(olmEvt.Content.VeryRaw) > 0 { + err = olmEvt.Content.ParseRaw(olmEvt.Type) + if err != nil && !errors.Is(err, event.ErrUnsupportedContentType) { + return nil, fmt.Errorf("failed to parse content of olm payload event: %w", err) + } } olmEvt.SenderKey = senderKey diff --git a/vendor/maunium.net/go/mautrix/crypto/keybackup.go b/vendor/maunium.net/go/mautrix/crypto/keybackup.go index a9686fd..d8b3d71 100644 --- a/vendor/maunium.net/go/mautrix/crypto/keybackup.go +++ b/vendor/maunium.net/go/mautrix/crypto/keybackup.go @@ -3,6 +3,7 @@ package crypto import ( "context" "encoding/base64" + "errors" "fmt" "time" @@ -12,6 +13,7 @@ import ( "maunium.net/go/mautrix/crypto/backup" "maunium.net/go/mautrix/crypto/olm" "maunium.net/go/mautrix/crypto/signatures" + "maunium.net/go/mautrix/event" "maunium.net/go/mautrix/id" ) @@ -154,13 +156,23 @@ func (mach *OlmMachine) GetAndStoreKeyBackup(ctx context.Context, version id.Key return nil } -func (mach *OlmMachine) ImportRoomKeyFromBackup(ctx context.Context, version id.KeyBackupVersion, roomID id.RoomID, sessionID id.SessionID, keyBackupData *backup.MegolmSessionData) (*InboundGroupSession, error) { - log := zerolog.Ctx(ctx).With(). - Str("room_id", roomID.String()). - Str("session_id", sessionID.String()). - Logger() +var ( + ErrUnknownAlgorithmInKeyBackup = errors.New("ignoring room key in backup with weird algorithm") + ErrMismatchingSessionIDInKeyBackup = errors.New("mismatched session ID while creating inbound group session from key backup") + ErrFailedToStoreNewInboundGroupSessionFromBackup = errors.New("failed to store new inbound group session from key backup") +) + +func (mach *OlmMachine) ImportRoomKeyFromBackupWithoutSaving( + ctx context.Context, + version id.KeyBackupVersion, + roomID id.RoomID, + config *event.EncryptionEventContent, + sessionID id.SessionID, + keyBackupData *backup.MegolmSessionData, +) (*InboundGroupSession, error) { + log := zerolog.Ctx(ctx) if keyBackupData.Algorithm != id.AlgorithmMegolmV1 { - return nil, fmt.Errorf("ignoring room key in backup with weird algorithm %s", keyBackupData.Algorithm) + return nil, fmt.Errorf("%w %s", ErrUnknownAlgorithmInKeyBackup, keyBackupData.Algorithm) } igsInternal, err := olm.InboundGroupSessionImport([]byte(keyBackupData.SessionKey)) @@ -168,26 +180,21 @@ func (mach *OlmMachine) ImportRoomKeyFromBackup(ctx context.Context, version id. return nil, fmt.Errorf("failed to import inbound group session: %w", err) } else if igsInternal.ID() != sessionID { log.Warn(). + Stringer("room_id", roomID). + Stringer("session_id", sessionID). Stringer("actual_session_id", igsInternal.ID()). Msg("Mismatched session ID while creating inbound group session from key backup") - return nil, fmt.Errorf("mismatched session ID while creating inbound group session from key backup") + return nil, ErrMismatchingSessionIDInKeyBackup } var maxAge time.Duration var maxMessages int - if config, err := mach.StateStore.GetEncryptionEvent(ctx, roomID); err != nil { - log.Error().Err(err).Msg("Failed to get encryption event for room") - } else if config != nil { + if config != nil { maxAge = time.Duration(config.RotationPeriodMillis) * time.Millisecond maxMessages = config.RotationPeriodMessages } - firstKnownIndex := igsInternal.FirstKnownIndex() - if firstKnownIndex > 0 { - log.Warn().Uint32("first_known_index", firstKnownIndex).Msg("Importing partial session") - } - - igs := &InboundGroupSession{ + return &InboundGroupSession{ Internal: igsInternal, SigningKey: keyBackupData.SenderClaimedKeys.Ed25519, SenderKey: keyBackupData.SenderKey, @@ -199,11 +206,33 @@ func (mach *OlmMachine) ImportRoomKeyFromBackup(ctx context.Context, version id. MaxAge: maxAge.Milliseconds(), MaxMessages: maxMessages, KeyBackupVersion: version, - } - err = mach.CryptoStore.PutGroupSession(ctx, igs) - if err != nil { - return nil, fmt.Errorf("failed to store new inbound group session: %w", err) - } - mach.markSessionReceived(ctx, roomID, sessionID, firstKnownIndex) - return igs, nil + }, nil +} + +func (mach *OlmMachine) ImportRoomKeyFromBackup(ctx context.Context, version id.KeyBackupVersion, roomID id.RoomID, sessionID id.SessionID, keyBackupData *backup.MegolmSessionData) (*InboundGroupSession, error) { + config, err := mach.StateStore.GetEncryptionEvent(ctx, roomID) + if err != nil { + zerolog.Ctx(ctx).Err(err). + Stringer("room_id", roomID). + Stringer("session_id", sessionID). + Msg("Failed to get encryption event for room") + } + imported, err := mach.ImportRoomKeyFromBackupWithoutSaving(ctx, version, roomID, config, sessionID, keyBackupData) + if err != nil { + return nil, err + } + firstKnownIndex := imported.Internal.FirstKnownIndex() + if firstKnownIndex > 0 { + zerolog.Ctx(ctx).Warn(). + Stringer("room_id", roomID). + Stringer("session_id", sessionID). + Uint32("first_known_index", firstKnownIndex). + Msg("Importing partial session") + } + err = mach.CryptoStore.PutGroupSession(ctx, imported) + if err != nil { + return nil, fmt.Errorf("%w: %w", ErrFailedToStoreNewInboundGroupSessionFromBackup, err) + } + mach.MarkSessionReceived(ctx, roomID, sessionID, firstKnownIndex) + return imported, nil } diff --git a/vendor/maunium.net/go/mautrix/crypto/keyimport.go b/vendor/maunium.net/go/mautrix/crypto/keyimport.go index 1dc7f6c..36ad6b9 100644 --- a/vendor/maunium.net/go/mautrix/crypto/keyimport.go +++ b/vendor/maunium.net/go/mautrix/crypto/keyimport.go @@ -127,7 +127,7 @@ func (mach *OlmMachine) importExportedRoomKey(ctx context.Context, session Expor if err != nil { return false, fmt.Errorf("failed to store imported session: %w", err) } - mach.markSessionReceived(ctx, session.RoomID, igs.ID(), firstKnownIndex) + mach.MarkSessionReceived(ctx, session.RoomID, igs.ID(), firstKnownIndex) return true, nil } diff --git a/vendor/maunium.net/go/mautrix/crypto/keysharing.go b/vendor/maunium.net/go/mautrix/crypto/keysharing.go index ea0ae65..f1d427a 100644 --- a/vendor/maunium.net/go/mautrix/crypto/keysharing.go +++ b/vendor/maunium.net/go/mautrix/crypto/keysharing.go @@ -200,7 +200,7 @@ func (mach *OlmMachine) importForwardedRoomKey(ctx context.Context, evt *Decrypt log.Error().Err(err).Msg("Failed to store new inbound group session") return false } - mach.markSessionReceived(ctx, content.RoomID, content.SessionID, firstKnownIndex) + mach.MarkSessionReceived(ctx, content.RoomID, content.SessionID, firstKnownIndex) log.Debug().Msg("Received forwarded inbound group session") return true } @@ -347,9 +347,6 @@ func (mach *OlmMachine) HandleRoomKeyRequest(ctx context.Context, sender id.User mach.rejectKeyRequest(ctx, KeyShareRejectInternalError, device, content.Body) return } - if igs.ForwardingChains == nil { - igs.ForwardingChains = []string{} - } forwardedRoomKey := event.Content{ Parsed: &event.ForwardedRoomKeyEventContent{ diff --git a/vendor/maunium.net/go/mautrix/crypto/machine.go b/vendor/maunium.net/go/mautrix/crypto/machine.go index e2af298..cac91bf 100644 --- a/vendor/maunium.net/go/mautrix/crypto/machine.go +++ b/vendor/maunium.net/go/mautrix/crypto/machine.go @@ -584,7 +584,7 @@ func (mach *OlmMachine) createGroupSession(ctx context.Context, senderKey id.Sen log.Err(err).Str("session_id", sessionID.String()).Msg("Failed to store new inbound group session") return fmt.Errorf("failed to store new inbound group session: %w", err) } - mach.markSessionReceived(ctx, roomID, sessionID, igs.Internal.FirstKnownIndex()) + mach.MarkSessionReceived(ctx, roomID, sessionID, igs.Internal.FirstKnownIndex()) log.Debug(). Str("session_id", sessionID.String()). Str("sender_key", senderKey.String()). @@ -595,7 +595,7 @@ func (mach *OlmMachine) createGroupSession(ctx context.Context, senderKey id.Sen return nil } -func (mach *OlmMachine) markSessionReceived(ctx context.Context, roomID id.RoomID, id id.SessionID, firstKnownIndex uint32) { +func (mach *OlmMachine) MarkSessionReceived(ctx context.Context, roomID id.RoomID, id id.SessionID, firstKnownIndex uint32) { if mach.SessionReceived != nil { mach.SessionReceived(ctx, roomID, id, firstKnownIndex) } diff --git a/vendor/maunium.net/go/mautrix/crypto/sessions.go b/vendor/maunium.net/go/mautrix/crypto/sessions.go index 457a0a4..aecb041 100644 --- a/vendor/maunium.net/go/mautrix/crypto/sessions.go +++ b/vendor/maunium.net/go/mautrix/crypto/sessions.go @@ -125,7 +125,7 @@ func NewInboundGroupSession(senderKey id.SenderKey, signingKey id.Ed25519, roomI SigningKey: signingKey, SenderKey: senderKey, RoomID: roomID, - ForwardingChains: nil, + ForwardingChains: []string{}, ReceivedAt: time.Now().UTC(), MaxAge: maxAge.Milliseconds(), MaxMessages: maxMessages, diff --git a/vendor/maunium.net/go/mautrix/crypto/sql_store.go b/vendor/maunium.net/go/mautrix/crypto/sql_store.go index 514c1e8..b062576 100644 --- a/vendor/maunium.net/go/mautrix/crypto/sql_store.go +++ b/vendor/maunium.net/go/mautrix/crypto/sql_store.go @@ -326,6 +326,9 @@ func (store *SQLCryptoStore) PutGroupSession(ctx context.Context, session *Inbou if err != nil { return err } + if session.ForwardingChains == nil { + session.ForwardingChains = []string{} + } forwardingChains := strings.Join(session.ForwardingChains, ",") ratchetSafety, err := json.Marshal(&session.RatchetSafety) if err != nil { @@ -509,6 +512,8 @@ func (store *SQLCryptoStore) postScanInboundGroupSession(sessionBytes, ratchetSa } if forwardingChains != "" { chains = strings.Split(forwardingChains, ",") + } else { + chains = []string{} } var rs RatchetSafety if len(ratchetSafetyBytes) > 0 { diff --git a/vendor/maunium.net/go/mautrix/error.go b/vendor/maunium.net/go/mautrix/error.go index 6f5dbe7..6f4880d 100644 --- a/vendor/maunium.net/go/mautrix/error.go +++ b/vendor/maunium.net/go/mautrix/error.go @@ -77,7 +77,8 @@ var ( ) var ( - ErrClientIsNil = errors.New("client is nil") + ErrClientIsNil = errors.New("client is nil") + ErrClientHasNoHomeserver = errors.New("client has no homeserver set") ) // HTTPError An HTTP Error response, which may wrap an underlying native Go Error. diff --git a/vendor/maunium.net/go/mautrix/event/beeper.go b/vendor/maunium.net/go/mautrix/event/beeper.go index 19c6253..a85e82f 100644 --- a/vendor/maunium.net/go/mautrix/event/beeper.go +++ b/vendor/maunium.net/go/mautrix/event/beeper.go @@ -9,7 +9,12 @@ package event import ( "encoding/base32" "encoding/binary" + "encoding/json" "fmt" + "html" + "regexp" + "strconv" + "strings" "maunium.net/go/mautrix/id" ) @@ -81,6 +86,25 @@ type BeeperRoomKeyAckEventContent struct { FirstMessageIndex int `json:"first_message_index"` } +type IntOrString int + +func (ios *IntOrString) UnmarshalJSON(data []byte) error { + if len(data) > 0 && data[0] == '"' { + var str string + err := json.Unmarshal(data, &str) + if err != nil { + return err + } + intVal, err := strconv.Atoi(str) + if err != nil { + return err + } + *ios = IntOrString(intVal) + return nil + } + return json.Unmarshal(data, (*int)(ios)) +} + type LinkPreview struct { CanonicalURL string `json:"og:url,omitempty"` Title string `json:"og:title,omitempty"` @@ -90,10 +114,10 @@ type LinkPreview struct { ImageURL id.ContentURIString `json:"og:image,omitempty"` - ImageSize int `json:"matrix:image:size,omitempty"` - ImageWidth int `json:"og:image:width,omitempty"` - ImageHeight int `json:"og:image:height,omitempty"` - ImageType string `json:"og:image:type,omitempty"` + ImageSize IntOrString `json:"matrix:image:size,omitempty"` + ImageWidth IntOrString `json:"og:image:width,omitempty"` + ImageHeight IntOrString `json:"og:image:height,omitempty"` + ImageType string `json:"og:image:type,omitempty"` } // BeeperLinkPreview contains the data for a bundled URL preview as specified in MSC4095 @@ -120,6 +144,34 @@ type BeeperPerMessageProfile struct { Displayname string `json:"displayname,omitempty"` AvatarURL *id.ContentURIString `json:"avatar_url,omitempty"` AvatarFile *EncryptedFileInfo `json:"avatar_file,omitempty"` + HasFallback bool `json:"has_fallback,omitempty"` +} + +func (content *MessageEventContent) AddPerMessageProfileFallback() { + if content.BeeperPerMessageProfile == nil || content.BeeperPerMessageProfile.HasFallback || content.BeeperPerMessageProfile.Displayname == "" { + return + } + content.BeeperPerMessageProfile.HasFallback = true + content.EnsureHasHTML() + content.Body = fmt.Sprintf("%s: %s", content.BeeperPerMessageProfile.Displayname, content.Body) + content.FormattedBody = fmt.Sprintf( + "%s: %s", + html.EscapeString(content.BeeperPerMessageProfile.Displayname), + content.FormattedBody, + ) +} + +var HTMLProfileFallbackRegex = regexp.MustCompile(`([^<]+): `) + +func (content *MessageEventContent) RemovePerMessageProfileFallback() { + if content.BeeperPerMessageProfile == nil || !content.BeeperPerMessageProfile.HasFallback || content.BeeperPerMessageProfile.Displayname == "" { + return + } + content.BeeperPerMessageProfile.HasFallback = false + content.Body = strings.TrimPrefix(content.Body, content.BeeperPerMessageProfile.Displayname+": ") + if content.Format == FormatHTML { + content.FormattedBody = HTMLProfileFallbackRegex.ReplaceAllLiteralString(content.FormattedBody, "") + } } type BeeperEncodedOrder struct { diff --git a/vendor/maunium.net/go/mautrix/event/content.go b/vendor/maunium.net/go/mautrix/event/content.go index 2347898..b56e35f 100644 --- a/vendor/maunium.net/go/mautrix/event/content.go +++ b/vendor/maunium.net/go/mautrix/event/content.go @@ -123,7 +123,7 @@ var TypeMap = map[Type]reflect.Type{ // When being marshaled into JSON, the data in Parsed will be marshaled first and then recursively merged // with the data in Raw. Values in Raw are preferred, but nested objects will be recursed into before merging, // rather than overriding the whole object with the one in Raw). -// If one of them is nil, the only the other is used. If both (Parsed and Raw) are nil, VeryRaw is used instead. +// If one of them is nil, then only the other is used. If both (Parsed and Raw) are nil, VeryRaw is used instead. type Content struct { VeryRaw json.RawMessage Raw map[string]interface{} diff --git a/vendor/maunium.net/go/mautrix/event/events.go b/vendor/maunium.net/go/mautrix/event/events.go index 92cc39a..a763cc3 100644 --- a/vendor/maunium.net/go/mautrix/event/events.go +++ b/vendor/maunium.net/go/mautrix/event/events.go @@ -140,6 +140,7 @@ type StrippedState struct { type Unsigned struct { PrevContent *Content `json:"prev_content,omitempty"` PrevSender id.UserID `json:"prev_sender,omitempty"` + Membership Membership `json:"membership,omitempty"` ReplacesState id.EventID `json:"replaces_state,omitempty"` Age int64 `json:"age,omitempty"` TransactionID string `json:"transaction_id,omitempty"` @@ -151,10 +152,14 @@ type Unsigned struct { BeeperHSSuborder int16 `json:"com.beeper.hs.suborder,omitempty"` BeeperHSOrderString *BeeperEncodedOrder `json:"com.beeper.hs.order_string,omitempty"` BeeperFromBackup bool `json:"com.beeper.from_backup,omitempty"` + + MauSoftFailed bool `json:"fi.mau.soft_failed,omitempty"` + MauRejectionReason string `json:"fi.mau.rejection_reason,omitempty"` } func (us *Unsigned) IsEmpty() bool { - return us.PrevContent == nil && us.PrevSender == "" && us.ReplacesState == "" && us.Age == 0 && + return us.PrevContent == nil && us.PrevSender == "" && us.ReplacesState == "" && us.Age == 0 && us.Membership == "" && us.TransactionID == "" && us.RedactedBecause == nil && us.InviteRoomState == nil && us.Relations == nil && - us.BeeperHSOrder == 0 && us.BeeperHSSuborder == 0 && us.BeeperHSOrderString.IsZero() + us.BeeperHSOrder == 0 && us.BeeperHSSuborder == 0 && us.BeeperHSOrderString.IsZero() && + !us.MauSoftFailed && us.MauRejectionReason == "" } diff --git a/vendor/maunium.net/go/mautrix/event/member.go b/vendor/maunium.net/go/mautrix/event/member.go index d0ff2a7..02b7cae 100644 --- a/vendor/maunium.net/go/mautrix/event/member.go +++ b/vendor/maunium.net/go/mautrix/event/member.go @@ -42,6 +42,8 @@ type MemberEventContent struct { ThirdPartyInvite *ThirdPartyInvite `json:"third_party_invite,omitempty"` Reason string `json:"reason,omitempty"` MSC3414File *EncryptedFileInfo `json:"org.matrix.msc3414.file,omitempty"` + + MSC4293RedactEvents bool `json:"org.matrix.msc4293.redact_events,omitempty"` } type ThirdPartyInvite struct { diff --git a/vendor/maunium.net/go/mautrix/event/message.go b/vendor/maunium.net/go/mautrix/event/message.go index 4831378..5140388 100644 --- a/vendor/maunium.net/go/mautrix/event/message.go +++ b/vendor/maunium.net/go/mautrix/event/message.go @@ -210,6 +210,7 @@ func (content *MessageEventContent) SetEdit(original id.EventID) { content.RelatesTo = (&RelatesTo{}).SetReplace(original) if content.MsgType == MsgText || content.MsgType == MsgNotice { content.Body = "* " + content.Body + content.Mentions = &Mentions{} if content.Format == FormatHTML && len(content.FormattedBody) > 0 { content.FormattedBody = "* " + content.FormattedBody } diff --git a/vendor/maunium.net/go/mautrix/event/relations.go b/vendor/maunium.net/go/mautrix/event/relations.go index e855a7e..2316cbc 100644 --- a/vendor/maunium.net/go/mautrix/event/relations.go +++ b/vendor/maunium.net/go/mautrix/event/relations.go @@ -34,7 +34,7 @@ type RelatesTo struct { type InReplyTo struct { EventID id.EventID `json:"event_id,omitempty"` - UnstableRoomID id.RoomID `json:"room_id,omitempty"` + UnstableRoomID id.RoomID `json:"com.beeper.cross_room_id,omitempty"` } func (rel *RelatesTo) Copy() *RelatesTo { diff --git a/vendor/maunium.net/go/mautrix/event/state.go b/vendor/maunium.net/go/mautrix/event/state.go index 006ed2a..028691e 100644 --- a/vendor/maunium.net/go/mautrix/event/state.go +++ b/vendor/maunium.net/go/mautrix/event/state.go @@ -231,7 +231,7 @@ func (ph *PolicyHashes) DecodeSHA256() *[32]byte { // ModPolicyContent represents the content of a m.room.rule.user, m.room.rule.room, and m.room.rule.server state event. // https://spec.matrix.org/v1.2/client-server-api/#moderation-policy-lists type ModPolicyContent struct { - Entity string `json:"entity"` + Entity string `json:"entity,omitempty"` Reason string `json:"reason"` Recommendation PolicyRecommendation `json:"recommendation"` UnstableHashes *PolicyHashes `json:"org.matrix.msc4205.hashes,omitempty"` diff --git a/vendor/maunium.net/go/mautrix/event/voip.go b/vendor/maunium.net/go/mautrix/event/voip.go index 28f56c9..cd8364a 100644 --- a/vendor/maunium.net/go/mautrix/event/voip.go +++ b/vendor/maunium.net/go/mautrix/event/voip.go @@ -76,7 +76,7 @@ func (cv *CallVersion) Int() (int, error) { type BaseCallEventContent struct { CallID string `json:"call_id"` PartyID string `json:"party_id"` - Version CallVersion `json:"version"` + Version CallVersion `json:"version,omitempty"` } type CallInviteEventContent struct { diff --git a/vendor/maunium.net/go/mautrix/format/htmlparser.go b/vendor/maunium.net/go/mautrix/format/htmlparser.go index e50a578..f9d51e3 100644 --- a/vendor/maunium.net/go/mautrix/format/htmlparser.go +++ b/vendor/maunium.net/go/mautrix/format/htmlparser.go @@ -187,25 +187,6 @@ func (parser *HTMLParser) listToString(node *html.Node, ctx Context) string { return strings.Join(children, "\n") } -func LongestSequence(in string, of rune) int { - currentSeq := 0 - maxSeq := 0 - for _, chr := range in { - if chr == of { - currentSeq++ - } else { - if currentSeq > maxSeq { - maxSeq = currentSeq - } - currentSeq = 0 - } - } - if currentSeq > maxSeq { - maxSeq = currentSeq - } - return maxSeq -} - func (parser *HTMLParser) basicFormatToString(node *html.Node, ctx Context) string { str := parser.nodeToTagAwareString(node.FirstChild, ctx) switch node.Data { @@ -232,8 +213,7 @@ func (parser *HTMLParser) basicFormatToString(node *html.Node, ctx Context) stri if parser.MonospaceConverter != nil { return parser.MonospaceConverter(str, ctx) } - surround := strings.Repeat("`", LongestSequence(str, '`')+1) - return fmt.Sprintf("%s%s%s", surround, str, surround) + return SafeMarkdownCode(str) } return str } diff --git a/vendor/maunium.net/go/mautrix/format/markdown.go b/vendor/maunium.net/go/mautrix/format/markdown.go index a1c9316..3d9979b 100644 --- a/vendor/maunium.net/go/mautrix/format/markdown.go +++ b/vendor/maunium.net/go/mautrix/format/markdown.go @@ -14,9 +14,11 @@ import ( "github.com/yuin/goldmark" "github.com/yuin/goldmark/extension" "github.com/yuin/goldmark/renderer/html" + "go.mau.fi/util/exstrings" "maunium.net/go/mautrix/event" "maunium.net/go/mautrix/format/mdext" + "maunium.net/go/mautrix/id" ) const paragraphStart = "

" @@ -40,7 +42,7 @@ func UnwrapSingleParagraph(html string) string { return html } -var mdEscapeRegex = regexp.MustCompile("([\\\\`*_[\\]])") +var mdEscapeRegex = regexp.MustCompile("([\\\\`*_[\\]()])") func EscapeMarkdown(text string) string { text = mdEscapeRegex.ReplaceAllString(text, "\\$1") @@ -49,6 +51,35 @@ func EscapeMarkdown(text string) string { return text } +type uriAble interface { + String() string + URI() *id.MatrixURI +} + +func MarkdownMention(id uriAble) string { + return MarkdownLink(id.String(), id.URI().MatrixToURL()) +} + +func MarkdownLink(name string, url string) string { + return fmt.Sprintf("[%s](%s)", EscapeMarkdown(name), EscapeMarkdown(url)) +} + +func SafeMarkdownCode[T ~string](textInput T) string { + if textInput == "" { + return "` `" + } + text := strings.ReplaceAll(string(textInput), "\n", " ") + backtickCount := exstrings.LongestSequenceOf(text, '`') + if backtickCount == 0 { + return fmt.Sprintf("`%s`", text) + } + quotes := strings.Repeat("`", backtickCount+1) + if text[0] == '`' || text[len(text)-1] == '`' { + return fmt.Sprintf("%s %s %s", quotes, text, quotes) + } + return fmt.Sprintf("%s%s%s", quotes, text, quotes) +} + func RenderMarkdownCustom(text string, renderer goldmark.Markdown) event.MessageEventContent { var buf strings.Builder err := renderer.Convert([]byte(text), &buf) diff --git a/vendor/maunium.net/go/mautrix/id/matrixuri.go b/vendor/maunium.net/go/mautrix/id/matrixuri.go index 2637d87..8f5ec84 100644 --- a/vendor/maunium.net/go/mautrix/id/matrixuri.go +++ b/vendor/maunium.net/go/mautrix/id/matrixuri.go @@ -210,7 +210,11 @@ func ProcessMatrixURI(uri *url.URL) (*MatrixURI, error) { if len(parts[1]) == 0 { return nil, ErrEmptySecondSegment } - parsed.MXID1 = parts[1] + var err error + parsed.MXID1, err = url.PathUnescape(parts[1]) + if err != nil { + return nil, fmt.Errorf("failed to url decode second segment %q: %w", parts[1], err) + } // Step 6: if the first part is a room and the URI has 4 segments, construct a second level identifier if parsed.Sigil1 == '!' && len(parts) == 4 { @@ -226,7 +230,10 @@ func ProcessMatrixURI(uri *url.URL) (*MatrixURI, error) { if len(parts[3]) == 0 { return nil, ErrEmptyFourthSegment } - parsed.MXID2 = parts[3] + parsed.MXID2, err = url.PathUnescape(parts[3]) + if err != nil { + return nil, fmt.Errorf("failed to url decode fourth segment %q: %w", parts[3], err) + } } // Step 7: parse the query and extract via and action items diff --git a/vendor/maunium.net/go/mautrix/id/servername.go b/vendor/maunium.net/go/mautrix/id/servername.go new file mode 100644 index 0000000..591f394 --- /dev/null +++ b/vendor/maunium.net/go/mautrix/id/servername.go @@ -0,0 +1,58 @@ +// Copyright (c) 2025 Tulir Asokan +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +package id + +import ( + "regexp" + "strconv" +) + +type ParsedServerNameType int + +const ( + ServerNameDNS ParsedServerNameType = iota + ServerNameIPv4 + ServerNameIPv6 +) + +type ParsedServerName struct { + Type ParsedServerNameType + Host string + Port int +} + +var ServerNameRegex = regexp.MustCompile(`^(?:\[([0-9A-Fa-f:.]{2,45})]|(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|([0-9A-Za-z.-]{1,255}))(\d{1,5})?$`) + +func ValidateServerName(serverName string) bool { + return len(serverName) <= 255 && len(serverName) > 0 && ServerNameRegex.MatchString(serverName) +} + +func ParseServerName(serverName string) *ParsedServerName { + if len(serverName) > 255 || len(serverName) < 1 { + return nil + } + match := ServerNameRegex.FindStringSubmatch(serverName) + if len(match) != 5 { + return nil + } + port, _ := strconv.Atoi(match[4]) + parsed := &ParsedServerName{ + Port: port, + } + switch { + case match[1] != "": + parsed.Type = ServerNameIPv6 + parsed.Host = match[1] + case match[2] != "": + parsed.Type = ServerNameIPv4 + parsed.Host = match[2] + case match[3] != "": + parsed.Type = ServerNameDNS + parsed.Host = match[3] + } + return parsed +} diff --git a/vendor/maunium.net/go/mautrix/id/userid.go b/vendor/maunium.net/go/mautrix/id/userid.go index 5913601..6d9f408 100644 --- a/vendor/maunium.net/go/mautrix/id/userid.go +++ b/vendor/maunium.net/go/mautrix/id/userid.go @@ -30,10 +30,11 @@ func NewEncodedUserID(localpart, homeserver string) UserID { } var ( - ErrInvalidUserID = errors.New("is not a valid user ID") - ErrNoncompliantLocalpart = errors.New("contains characters that are not allowed") - ErrUserIDTooLong = errors.New("the given user ID is longer than 255 characters") - ErrEmptyLocalpart = errors.New("empty localparts are not allowed") + ErrInvalidUserID = errors.New("is not a valid user ID") + ErrNoncompliantLocalpart = errors.New("contains characters that are not allowed") + ErrUserIDTooLong = errors.New("the given user ID is longer than 255 characters") + ErrEmptyLocalpart = errors.New("empty localparts are not allowed") + ErrNoncompliantServerPart = errors.New("is not a valid server name") ) // ParseCommonIdentifier parses a common identifier according to https://spec.matrix.org/v1.9/appendices/#common-identifier-format @@ -113,6 +114,9 @@ func (userID UserID) ParseAndValidate() (localpart, homeserver string, err error if err == nil && len(userID) > UserIDMaxLength { err = ErrUserIDTooLong } + if err == nil && !ValidateServerName(homeserver) { + err = fmt.Errorf("%q %q", homeserver, ErrNoncompliantServerPart) + } return } diff --git a/vendor/maunium.net/go/mautrix/requests.go b/vendor/maunium.net/go/mautrix/requests.go index 377534a..8363aed 100644 --- a/vendor/maunium.net/go/mautrix/requests.go +++ b/vendor/maunium.net/go/mautrix/requests.go @@ -193,6 +193,8 @@ type ReqKickUser struct { type ReqBanUser struct { Reason string `json:"reason,omitempty"` UserID id.UserID `json:"user_id"` + + MSC4293RedactEvents bool `json:"org.matrix.msc4293.redact_events,omitempty"` } // ReqUnbanUser is the JSON request for https://spec.matrix.org/v1.2/client-server-api/#post_matrixclientv3roomsroomidunban @@ -424,6 +426,33 @@ type ReqSendReceipt struct { ThreadID string `json:"thread_id,omitempty"` } +type ReqPublicRooms struct { + IncludeAllNetworks bool + Limit int + Since string + ThirdPartyInstanceID string +} + +func (req *ReqPublicRooms) Query() map[string]string { + query := map[string]string{} + if req == nil { + return query + } + if req.IncludeAllNetworks { + query["include_all_networks"] = "true" + } + if req.Limit > 0 { + query["limit"] = strconv.Itoa(req.Limit) + } + if req.Since != "" { + query["since"] = req.Since + } + if req.ThirdPartyInstanceID != "" { + query["third_party_instance_id"] = req.ThirdPartyInstanceID + } + return query +} + // ReqHierarchy contains the parameters for https://spec.matrix.org/v1.4/client-server-api/#get_matrixclientv1roomsroomidhierarchy // // As it's a GET method, there is no JSON body, so this is only query parameters. @@ -516,3 +545,44 @@ type ReqReport struct { Reason string `json:"reason,omitempty"` Score int `json:"score,omitempty"` } + +type ReqGetRelations struct { + RelationType event.RelationType + EventType event.Type + + Dir Direction + From string + To string + Limit int + Recurse bool +} + +func (rgr *ReqGetRelations) PathSuffix() ClientURLPath { + if rgr.RelationType != "" { + if rgr.EventType.Type != "" { + return ClientURLPath{rgr.RelationType, rgr.EventType.Type} + } + return ClientURLPath{rgr.RelationType} + } + return ClientURLPath{} +} + +func (rgr *ReqGetRelations) Query() map[string]string { + query := map[string]string{} + if rgr.Dir != 0 { + query["dir"] = string(rgr.Dir) + } + if rgr.From != "" { + query["from"] = rgr.From + } + if rgr.To != "" { + query["to"] = rgr.To + } + if rgr.Limit > 0 { + query["limit"] = strconv.Itoa(rgr.Limit) + } + if rgr.Recurse { + query["recurse"] = "true" + } + return query +} diff --git a/vendor/maunium.net/go/mautrix/responses.go b/vendor/maunium.net/go/mautrix/responses.go index ee7f470..20d02af 100644 --- a/vendor/maunium.net/go/mautrix/responses.go +++ b/vendor/maunium.net/go/mautrix/responses.go @@ -709,3 +709,10 @@ type RespOpenIDToken struct { MatrixServerName string `json:"matrix_server_name"` TokenType string `json:"token_type"` // Always "Bearer" } + +type RespGetRelations struct { + Chunk []*event.Event `json:"chunk"` + NextBatch string `json:"next_batch,omitempty"` + PrevBatch string `json:"prev_batch,omitempty"` + RecursionDepth int `json:"recursion_depth,omitempty"` +} diff --git a/vendor/maunium.net/go/mautrix/version.go b/vendor/maunium.net/go/mautrix/version.go index 2e67069..193205e 100644 --- a/vendor/maunium.net/go/mautrix/version.go +++ b/vendor/maunium.net/go/mautrix/version.go @@ -7,7 +7,7 @@ import ( "strings" ) -const Version = "v0.23.3" +const Version = "v0.24.1" var GoModVersion = "" var Commit = "" diff --git a/vendor/maunium.net/go/mautrix/versions.go b/vendor/maunium.net/go/mautrix/versions.go index 7e75298..f87bddd 100644 --- a/vendor/maunium.net/go/mautrix/versions.go +++ b/vendor/maunium.net/go/mautrix/versions.go @@ -115,6 +115,8 @@ var ( SpecV111 = MustParseSpecVersion("v1.11") SpecV112 = MustParseSpecVersion("v1.12") SpecV113 = MustParseSpecVersion("v1.13") + SpecV114 = MustParseSpecVersion("v1.14") + SpecV115 = MustParseSpecVersion("v1.15") ) func (svf SpecVersionFormat) String() string { diff --git a/vendor/modernc.org/libc/Makefile b/vendor/modernc.org/libc/Makefile index a2ff9da..0365ae7 100644 --- a/vendor/modernc.org/libc/Makefile +++ b/vendor/modernc.org/libc/Makefile @@ -32,13 +32,14 @@ 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 build -o /dev/null -v genasm.go + go vet 2>&1 | grep -n 'asm_' || true generate: download mkdir -p $(DIR) || true diff --git a/vendor/modernc.org/libc/asm_linux_amd64.go b/vendor/modernc.org/libc/asm_linux_amd64.go new file mode 100644 index 0000000..d42d884 --- /dev/null +++ b/vendor/modernc.org/libc/asm_linux_amd64.go @@ -0,0 +1,1320 @@ +// Code generated for linux/amd64 by 'genasm', DO NOT EDIT. + +package libc + +func Ya64l(tls *TLS, s uintptr) (r int64) +func Yabort(tls *TLS) +func Yabs(tls *TLS, a int32) (r int32) +func Yaccept(tls *TLS, fd int32, addr uintptr, len1 uintptr) (r1 int32) +func Yaccept4(tls *TLS, fd int32, addr uintptr, len1 uintptr, flg int32) (r1 int32) +func Yaccess(tls *TLS, filename uintptr, amode int32) (r int32) +func Yacct(tls *TLS, filename uintptr) (r int32) +func Yacos(tls *TLS, x float64) (r float64) +func Yacosf(tls *TLS, x float32) (r float32) +func Yacosh(tls *TLS, x float64) (r float64) +func Yacoshf(tls *TLS, x float32) (r float32) +func Yacoshl(tls *TLS, x float64) (r float64) +func Yacosl(tls *TLS, x float64) (r float64) +func Yaddmntent(tls *TLS, f uintptr, mnt uintptr) (r int32) +func Yadjtime(tls *TLS, in uintptr, out uintptr) (r int32) +func Yadjtimex(tls *TLS, tx uintptr) (r int32) +func Yalarm(tls *TLS, seconds uint32) (r uint32) +func Yalloca(tls *TLS, size Tsize_t) uintptr +func Yalphasort(tls *TLS, a uintptr, b uintptr) (r int32) +func Yarch_prctl(tls *TLS, code int32, addr uint64) (r int32) +func Yasctime(tls *TLS, tm uintptr) (r uintptr) +func Yasctime_r(tls *TLS, tm uintptr, buf uintptr) (r uintptr) +func Yasin(tls *TLS, x float64) (r1 float64) +func Yasinf(tls *TLS, x float32) (r float32) +func Yasinh(tls *TLS, x3 float64) (r float64) +func Yasinhf(tls *TLS, x3 float32) (r float32) +func Yasinhl(tls *TLS, x float64) (r float64) +func Yasinl(tls *TLS, x float64) (r float64) +func Yasprintf(tls *TLS, s uintptr, fmt uintptr, va uintptr) (r int32) +func Yat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) +func Yatan(tls *TLS, x3 float64) (r float64) +func Yatan2(tls *TLS, y float64, x float64) (r float64) +func Yatan2f(tls *TLS, y float32, x float32) (r float32) +func Yatan2l(tls *TLS, y float64, x float64) (r float64) +func Yatanf(tls *TLS, x3 float32) (r float32) +func Yatanh(tls *TLS, x3 float64) (r float64) +func Yatanhf(tls *TLS, x3 float32) (r float32) +func Yatanhl(tls *TLS, x float64) (r float64) +func Yatanl(tls *TLS, x float64) (r float64) +func Yatexit(tls *TLS, func_ uintptr) (r int32) +func Yatof(tls *TLS, s uintptr) (r float64) +func Yatoi(tls *TLS, s uintptr) (r int32) +func Yatol(tls *TLS, s uintptr) (r int64) +func Yatoll(tls *TLS, s uintptr) (r int64) +func Ybacktrace(t *TLS, buf uintptr, size int32) int32 +func Ybacktrace_symbols_fd(t *TLS, buffer uintptr, size, fd int32) +func Ybasename(tls *TLS, s uintptr) (r uintptr) +func Ybcmp(tls *TLS, s1 uintptr, s2 uintptr, n Tsize_t) (r int32) +func Ybcopy(tls *TLS, s1 uintptr, s2 uintptr, n Tsize_t) +func Ybind(tls *TLS, fd int32, addr uintptr, len1 Tsocklen_t) (r1 int32) +func Ybind_textdomain_codeset(tls *TLS, domainname uintptr, codeset uintptr) (r uintptr) +func Ybindtextdomain(tls *TLS, domainname uintptr, dirname uintptr) (r uintptr) +func Ybrk(tls *TLS, end uintptr) (r int32) +func Ybsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, cmp uintptr) (r uintptr) +func Ybtowc(tls *TLS, c int32) (r Twint_t) +func Ybzero(tls *TLS, s uintptr, n Tsize_t) +func Yc16rtomb(tls *TLS, s uintptr, c16 Tchar16_t, ps uintptr) (r Tsize_t) +func Yc32rtomb(tls *TLS, s uintptr, c32 Tchar32_t, ps uintptr) (r Tsize_t) +func Ycabs(tls *TLS, z complex128) (r float64) +func Ycabsf(tls *TLS, z complex64) (r float32) +func Ycabsl(tls *TLS, z complex128) (r float64) +func Ycacos(tls *TLS, z complex128) (r complex128) +func Ycacosf(tls *TLS, z complex64) (r complex64) +func Ycacosh(tls *TLS, z complex128) (r complex128) +func Ycacoshf(tls *TLS, z complex64) (r complex64) +func Ycacoshl(tls *TLS, z complex128) (r complex128) +func Ycacosl(tls *TLS, z complex128) (r complex128) +func Ycalloc(tls *TLS, m Tsize_t, n Tsize_t) (r uintptr) +func Ycapget(tls *TLS, a uintptr, b uintptr) (r int32) +func Ycapset(tls *TLS, a uintptr, b uintptr) (r int32) +func Ycarg(tls *TLS, z complex128) (r float64) +func Ycargf(tls *TLS, z complex64) (r float32) +func Ycargl(tls *TLS, z complex128) (r float64) +func Ycasin(tls *TLS, z complex128) (r1 complex128) +func Ycasinf(tls *TLS, z complex64) (r1 complex64) +func Ycasinh(tls *TLS, z complex128) (r complex128) +func Ycasinhf(tls *TLS, z complex64) (r complex64) +func Ycasinhl(tls *TLS, z complex128) (r complex128) +func Ycasinl(tls *TLS, z complex128) (r complex128) +func Ycatan(tls *TLS, z complex128) (r complex128) +func Ycatanf(tls *TLS, z complex64) (r complex64) +func Ycatanh(tls *TLS, z complex128) (r complex128) +func Ycatanhf(tls *TLS, z complex64) (r complex64) +func Ycatanhl(tls *TLS, z complex128) (r complex128) +func Ycatanl(tls *TLS, z complex128) (r complex128) +func Ycatclose(tls *TLS, catd Tnl_catd) (r int32) +func Ycatgets(tls *TLS, catd Tnl_catd, set_id int32, msg_id int32, s uintptr) (r uintptr) +func Ycatopen(tls *TLS, name uintptr, oflag int32) (r Tnl_catd) +func Ycbrt(tls *TLS, x float64) (r1 float64) +func Ycbrtf(tls *TLS, x float32) (r1 float32) +func Ycbrtl(tls *TLS, x float64) (r float64) +func Yccos(tls *TLS, z complex128) (r complex128) +func Yccosf(tls *TLS, z complex64) (r complex64) +func Yccosh(tls *TLS, z complex128) (r complex128) +func Yccoshf(tls *TLS, z complex64) (r complex64) +func Yccoshl(tls *TLS, z complex128) (r complex128) +func Yccosl(tls *TLS, z complex128) (r complex128) +func Yceil(tls *TLS, x3 float64) (r float64) +func Yceilf(tls *TLS, x3 float32) (r float32) +func Yceill(tls *TLS, x float64) (r float64) +func Ycexp(tls *TLS, z complex128) (r complex128) +func Ycexpf(tls *TLS, z complex64) (r complex64) +func Ycexpl(tls *TLS, z complex128) (r complex128) +func Ycfgetispeed(tls *TLS, tio uintptr) (r Tspeed_t) +func Ycfgetospeed(tls *TLS, tio uintptr) (r Tspeed_t) +func Ycfmakeraw(tls *TLS, t uintptr) +func Ycfsetispeed(tls *TLS, tio uintptr, speed Tspeed_t) (r int32) +func Ycfsetospeed(tls *TLS, tio uintptr, speed Tspeed_t) (r int32) +func Ycfsetspeed(tls *TLS, tio uintptr, speed Tspeed_t) (r int32) +func Ychdir(tls *TLS, path uintptr) (r int32) +func Ychmod(tls *TLS, path uintptr, mode Tmode_t) (r int32) +func Ychown(tls *TLS, path uintptr, uid Tuid_t, gid Tgid_t) (r int32) +func Ychroot(tls *TLS, path uintptr) (r int32) +func Ycimag(tls *TLS, z complex128) (r float64) +func Ycimagf(tls *TLS, z complex64) (r float32) +func Ycimagl(tls *TLS, z complex128) (r float64) +func Yclearenv(tls *TLS) (r int32) +func Yclearerr(tls *TLS, f uintptr) +func Yclearerr_unlocked(tls *TLS, f uintptr) +func Yclock(tls *TLS) (r Tclock_t) +func Yclock_adjtime(tls *TLS, clock_id Tclockid_t, utx uintptr) (r1 int32) +func Yclock_getcpuclockid(tls *TLS, pid Tpid_t, clk uintptr) (r int32) +func Yclock_getres(tls *TLS, clk Tclockid_t, ts uintptr) (r int32) +func Yclock_gettime(tls *TLS, clk Tclockid_t, ts uintptr) (r int32) +func Yclock_nanosleep(tls *TLS, clk Tclockid_t, flags int32, req uintptr, rem uintptr) (r int32) +func Yclock_settime(tls *TLS, clk Tclockid_t, ts uintptr) (r int32) +func Yclog(tls *TLS, z complex128) (r1 complex128) +func Yclogf(tls *TLS, z complex64) (r1 complex64) +func Yclogl(tls *TLS, z complex128) (r complex128) +func Yclose(tls *TLS, fd int32) (r1 int32) +func Yclosedir(tls *TLS, dir uintptr) (r int32) +func Ycloselog(tls *TLS) +func Yconfstr(tls *TLS, name int32, buf uintptr, len1 Tsize_t) (r Tsize_t) +func Yconj(tls *TLS, z complex128) (r complex128) +func Yconjf(tls *TLS, z complex64) (r complex64) +func Yconjl(tls *TLS, z complex128) (r complex128) +func Yconnect(tls *TLS, fd int32, addr uintptr, len1 Tsocklen_t) (r1 int32) +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) +func Ycopysign(tls *TLS, x float64, y float64) (r float64) +func Ycopysignf(tls *TLS, x float32, y float32) (r float32) +func Ycopysignl(tls *TLS, x float64, y float64) (r float64) +func Ycos(tls *TLS, x3 float64) (r float64) +func Ycosf(tls *TLS, x3 float32) (r float32) +func Ycosh(tls *TLS, x3 float64) (r float64) +func Ycoshf(tls *TLS, x3 float32) (r float32) +func Ycoshl(tls *TLS, x float64) (r float64) +func Ycosl(tls *TLS, x float64) (r float64) +func Ycpow(tls *TLS, z complex128, c complex128) (r complex128) +func Ycpowf(tls *TLS, z complex64, c complex64) (r complex64) +func Ycpowl(tls *TLS, z complex128, c complex128) (r complex128) +func Ycproj(tls *TLS, z complex128) (r complex128) +func Ycprojf(tls *TLS, z complex64) (r complex64) +func Ycprojl(tls *TLS, z complex128) (r complex128) +func Ycreal(tls *TLS, z complex128) (r float64) +func Ycrealf(tls *TLS, z complex64) (r float32) +func Ycreall(tls *TLS, z complex128) (r float64) +func Ycreat(tls *TLS, filename uintptr, mode Tmode_t) (r int32) +func Ycrypt(tls *TLS, key uintptr, salt uintptr) (r uintptr) +func Ycrypt_r(tls *TLS, key uintptr, salt uintptr, data uintptr) (r uintptr) +func Ycsin(tls *TLS, z complex128) (r complex128) +func Ycsinf(tls *TLS, z complex64) (r complex64) +func Ycsinh(tls *TLS, z complex128) (r complex128) +func Ycsinhf(tls *TLS, z complex64) (r complex64) +func Ycsinhl(tls *TLS, z complex128) (r complex128) +func Ycsinl(tls *TLS, z complex128) (r complex128) +func Ycsqrt(tls *TLS, z complex128) (r complex128) +func Ycsqrtf(tls *TLS, z complex64) (r complex64) +func Ycsqrtl(tls *TLS, z complex128) (r complex128) +func Yctan(tls *TLS, z complex128) (r complex128) +func Yctanf(tls *TLS, z complex64) (r complex64) +func Yctanh(tls *TLS, z complex128) (r complex128) +func Yctanhf(tls *TLS, z complex64) (r complex64) +func Yctanhl(tls *TLS, z complex128) (r complex128) +func Yctanl(tls *TLS, z complex128) (r complex128) +func Yctermid(tls *TLS, s uintptr) (r uintptr) +func Yctime(tls *TLS, t uintptr) (r uintptr) +func Yctime_r(tls *TLS, t uintptr, buf uintptr) (r uintptr) +func Ycuserid(tls *TLS, buf uintptr) (r uintptr) +func Ydcgettext(tls *TLS, domainname uintptr, msgid uintptr, category int32) (r uintptr) +func Ydcngettext(tls *TLS, domainname uintptr, msgid1 uintptr, msgid2 uintptr, n uint64, category int32) (r1 uintptr) +func Ydelete_module(tls *TLS, a uintptr, b uint32) (r int32) +func Ydgettext(tls *TLS, domainname uintptr, msgid uintptr) (r uintptr) +func Ydifftime(tls *TLS, t1 Ttime_t, t0 Ttime_t) (r float64) +func Ydirfd(tls *TLS, d uintptr) (r int32) +func Ydirname(tls *TLS, s uintptr) (r uintptr) +func Ydiv(tls *TLS, num int32, den int32) (r Tdiv_t) +func Ydlclose(t *TLS, handle uintptr) int32 +func Ydlerror(t *TLS) uintptr +func Ydlopen(t *TLS, filename uintptr, flags int32) uintptr +func Ydlsym(t *TLS, handle, symbol uintptr) uintptr +func Ydn_comp(tls *TLS, src uintptr, dst uintptr, space int32, dnptrs uintptr, lastdnptr uintptr) (r int32) +func Ydn_expand(tls *TLS, base uintptr, end uintptr, src uintptr, dest uintptr, space int32) (r int32) +func Ydn_skipname(tls *TLS, s uintptr, end uintptr) (r int32) +func Ydngettext(tls *TLS, domainname uintptr, msgid1 uintptr, msgid2 uintptr, n uint64) (r uintptr) +func Ydprintf(tls *TLS, fd int32, fmt uintptr, va uintptr) (r int32) +func Ydrand48(tls *TLS) (r float64) +func Ydrem(tls *TLS, x float64, y float64) (r float64) +func Ydremf(tls *TLS, x float32, y float32) (r float32) +func Ydup(tls *TLS, fd int32) (r int32) +func Ydup2(tls *TLS, old int32, new1 int32) (r1 int32) +func Ydup3(tls *TLS, old int32, new1 int32, flags int32) (r int32) +func Yduplocale(tls *TLS, old Tlocale_t) (r Tlocale_t) +func Yeaccess(tls *TLS, filename uintptr, amode int32) (r int32) +func Yecvt(tls *TLS, x float64, n int32, dp uintptr, sign uintptr) (r uintptr) +func Yencrypt(tls *TLS, block uintptr, edflag int32) +func Yendgrent(tls *TLS) +func Yendhostent(tls *TLS) +func Yendmntent(tls *TLS, f uintptr) (r int32) +func Yendnetent(tls *TLS) +func Yendprotoent(tls *TLS) +func Yendpwent(tls *TLS) +func Yendservent(tls *TLS) +func Yendspent(tls *TLS) +func Yendusershell(tls *TLS) +func Yendutent(tls *TLS) +func Yendutxent(tls *TLS) +func Yepoll_create(tls *TLS, size int32) (r int32) +func Yepoll_create1(tls *TLS, flags int32) (r1 int32) +func Yepoll_ctl(tls *TLS, fd int32, op int32, fd2 int32, ev uintptr) (r int32) +func Yepoll_pwait(tls *TLS, fd int32, ev uintptr, cnt int32, to int32, sigs uintptr) (r1 int32) +func Yepoll_wait(tls *TLS, fd int32, ev uintptr, cnt int32, to int32) (r int32) +func Yerand48(tls *TLS, s uintptr) (r float64) +func Yerf(tls *TLS, x float64) (r1 float64) +func Yerfc(tls *TLS, x float64) (r1 float64) +func Yerfcf(tls *TLS, x float32) (r1 float32) +func Yerfcl(tls *TLS, x float64) (r float64) +func Yerff(tls *TLS, x float32) (r1 float32) +func Yerfl(tls *TLS, x float64) (r float64) +func Yerr(tls *TLS, status int32, fmt uintptr, va uintptr) +func Yerrx(tls *TLS, status int32, fmt uintptr, va uintptr) +func Yether_aton(tls *TLS, x uintptr) (r uintptr) +func Yether_aton_r(tls *TLS, x uintptr, p_a uintptr) (r uintptr) +func Yether_hostton(tls *TLS, hostname uintptr, e uintptr) (r int32) +func Yether_line(tls *TLS, l uintptr, e uintptr, hostname uintptr) (r int32) +func Yether_ntoa(tls *TLS, p_a uintptr) (r uintptr) +func Yether_ntoa_r(tls *TLS, p_a uintptr, x uintptr) (r uintptr) +func Yether_ntohost(tls *TLS, hostname uintptr, e uintptr) (r int32) +func Yeuidaccess(tls *TLS, filename uintptr, amode int32) (r int32) +func Yeventfd(tls *TLS, count uint32, flags int32) (r1 int32) +func Yeventfd_read(tls *TLS, fd int32, value uintptr) (r int32) +func Yeventfd_write(tls *TLS, fd int32, _value Teventfd_t) (r int32) +func Yexecl(tls *TLS, path uintptr, argv0 uintptr, va uintptr) (r int32) +func Yexecle(tls *TLS, path uintptr, argv0 uintptr, va uintptr) (r int32) +func Yexeclp(tls *TLS, file uintptr, argv0 uintptr, va uintptr) (r int32) +func Yexecv(tls *TLS, path uintptr, argv uintptr) (r int32) +func Yexecve(tls *TLS, path uintptr, argv uintptr, envp uintptr) (r int32) +func Yexecvp(tls *TLS, file uintptr, argv uintptr) (r int32) +func Yexecvpe(tls *TLS, file uintptr, argv uintptr, envp uintptr) (r int32) +func Yexit(tls *TLS, code int32) +func Yexp(tls *TLS, x1 float64) (r1 float64) +func Yexp10(tls *TLS, x float64) (r float64) +func Yexp10f(tls *TLS, x float32) (r float32) +func Yexp10l(tls *TLS, x float64) (r float64) +func Yexp2(tls *TLS, x1 float64) (r1 float64) +func Yexp2f(tls *TLS, x2 float32) (r1 float32) +func Yexp2l(tls *TLS, x float64) (r float64) +func Yexpf(tls *TLS, x2 float32) (r1 float32) +func Yexpl(tls *TLS, x float64) (r float64) +func Yexplicit_bzero(tls *TLS, d uintptr, n Tsize_t) +func Yexpm1(tls *TLS, x3 float64) (r float64) +func Yexpm1f(tls *TLS, x3 float32) (r float32) +func Yexpm1l(tls *TLS, x float64) (r float64) +func Yfabs(tls *TLS, x float64) (r float64) +func Yfabsf(tls *TLS, x float32) (r float32) +func Yfabsl(tls *TLS, x float64) (r float64) +func Yfaccessat(tls *TLS, fd int32, filename uintptr, amode int32, flag int32) (r int32) +func Yfallocate(tls *TLS, fd int32, mode int32, base Toff_t, len1 Toff_t) (r int32) +func Yfanotify_init(tls *TLS, flags uint32, event_f_flags uint32) (r int32) +func Yfanotify_mark(tls *TLS, fanotify_fd int32, flags uint32, mask uint64, dfd int32, pathname uintptr) (r int32) +func Yfchdir(tls *TLS, fd int32) (r int32) +func Yfchmod(tls *TLS, fd int32, mode Tmode_t) (r int32) +func Yfchmodat(tls *TLS, fd int32, path uintptr, mode Tmode_t, flag int32) (r int32) +func Yfchown(tls *TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) +func Yfchownat(tls *TLS, fd int32, path uintptr, uid Tuid_t, gid Tgid_t, flag int32) (r int32) +func Yfclose(tls *TLS, f uintptr) (r1 int32) +func Yfcntl(tls *TLS, fd int32, cmd int32, va uintptr) (r int32) +func Yfcntl64(tls *TLS, fd int32, cmd int32, va uintptr) (r int32) +func Yfcvt(tls *TLS, x float64, n int32, dp uintptr, sign uintptr) (r uintptr) +func Yfdatasync(tls *TLS, fd int32) (r int32) +func Yfdim(tls *TLS, x float64, y float64) (r float64) +func Yfdimf(tls *TLS, x float32, y float32) (r float32) +func Yfdiml(tls *TLS, x float64, y float64) (r float64) +func Yfdopen(tls *TLS, fd int32, mode uintptr) (r uintptr) +func Yfdopendir(tls *TLS, fd int32) (r uintptr) +func Yfeclearexcept(tls *TLS, mask int32) (r int32) +func Yfegetenv(tls *TLS, envp uintptr) (r int32) +func Yfegetround(tls *TLS) (r int32) +func Yfeof(tls *TLS, f uintptr) (r int32) +func Yfeof_unlocked(tls *TLS, f uintptr) (r int32) +func Yferaiseexcept(tls *TLS, mask int32) (r int32) +func Yferror(tls *TLS, f uintptr) (r int32) +func Yferror_unlocked(tls *TLS, f uintptr) (r int32) +func Yfesetenv(tls *TLS, envp uintptr) (r int32) +func Yfetestexcept(tls *TLS, mask int32) (r int32) +func Yfexecve(tls *TLS, fd int32, argv uintptr, envp uintptr) (r1 int32) +func Yfflush(tls *TLS, f uintptr) (r1 int32) +func Yfflush_unlocked(tls *TLS, f uintptr) (r int32) +func Yffs(tls *TLS, i int32) (r int32) +func Yffsl(tls *TLS, i int64) (r int32) +func Yffsll(tls *TLS, i int64) (r int32) +func Yfgetc(tls *TLS, f1 uintptr) (r int32) +func Yfgetc_unlocked(tls *TLS, f uintptr) (r int32) +func Yfgetgrent(tls *TLS, f uintptr) (r uintptr) +func Yfgetln(tls *TLS, f uintptr, plen uintptr) (r uintptr) +func Yfgetpos(tls *TLS, f uintptr, pos uintptr) (r int32) +func Yfgetpwent(tls *TLS, f uintptr) (r uintptr) +func Yfgets(tls *TLS, s uintptr, n int32, f uintptr) (r uintptr) +func Yfgets_unlocked(tls *TLS, s uintptr, n int32, f uintptr) (r uintptr) +func Yfgetwc(tls *TLS, f uintptr) (r Twint_t) +func Yfgetwc_unlocked(tls *TLS, f uintptr) (r Twint_t) +func Yfgetws(tls *TLS, s uintptr, n int32, f uintptr) (r uintptr) +func Yfgetws_unlocked(tls *TLS, s uintptr, n int32, f uintptr) (r uintptr) +func Yfgetxattr(tls *TLS, filedes int32, name uintptr, value uintptr, size Tsize_t) (r Tssize_t) +func Yfileno(tls *TLS, f uintptr) (r int32) +func Yfileno_unlocked(tls *TLS, f uintptr) (r int32) +func Yfinite(tls *TLS, x float64) (r int32) +func Yfinitef(tls *TLS, x float32) (r int32) +func Yflistxattr(tls *TLS, filedes int32, list uintptr, size Tsize_t) (r Tssize_t) +func Yflock(tls *TLS, fd int32, op int32) (r int32) +func Yflockfile(tls *TLS, f uintptr) +func Yfloor(tls *TLS, x3 float64) (r float64) +func Yfloorf(tls *TLS, x3 float32) (r float32) +func Yfloorl(tls *TLS, x float64) (r float64) +func Yfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) +func Yfmal(tls *TLS, x float64, y float64, z float64) (r float64) +func Yfmax(tls *TLS, x float64, y float64) (r float64) +func Yfmaxf(tls *TLS, x float32, y float32) (r float32) +func Yfmaxl(tls *TLS, x float64, y float64) (r float64) +func Yfmemopen(tls *TLS, buf uintptr, size Tsize_t, mode uintptr) (r uintptr) +func Yfmin(tls *TLS, x float64, y float64) (r float64) +func Yfminf(tls *TLS, x float32, y float32) (r float32) +func Yfminl(tls *TLS, x float64, y float64) (r float64) +func Yfmod(tls *TLS, x float64, y float64) (r float64) +func Yfmodf(tls *TLS, x float32, y float32) (r float32) +func Yfmodl(tls *TLS, x float64, y float64) (r float64) +func Yfmtmsg(tls *TLS, classification int64, label uintptr, severity int32, text uintptr, action uintptr, tag uintptr) (r int32) +func Yfnmatch(tls *TLS, pat uintptr, str uintptr, flags int32) (r int32) +func Yfopen(tls *TLS, filename uintptr, mode uintptr) (r uintptr) +func Yfopen64(tls *TLS, filename uintptr, mode uintptr) (r uintptr) +func Yfopencookie(tls *TLS, cookie uintptr, mode uintptr, iofuncs Tcookie_io_functions_t) (r uintptr) +func Yfork(t *TLS) int32 +func Yfpathconf(tls *TLS, fd int32, name int32) (r int64) +func Yfprintf(tls *TLS, f uintptr, fmt uintptr, va uintptr) (r int32) +func Yfpurge(tls *TLS, f uintptr) (r int32) +func Yfputc(tls *TLS, c1 int32, f1 uintptr) (r int32) +func Yfputc_unlocked(tls *TLS, c int32, f uintptr) (r int32) +func Yfputs(tls *TLS, s uintptr, f uintptr) (r int32) +func Yfputs_unlocked(tls *TLS, s uintptr, f uintptr) (r int32) +func Yfputwc(tls *TLS, c Twchar_t, f uintptr) (r Twint_t) +func Yfputwc_unlocked(tls *TLS, c Twchar_t, f uintptr) (r Twint_t) +func Yfputws(tls *TLS, _ws uintptr, f uintptr) (r int32) +func Yfputws_unlocked(tls *TLS, _ws uintptr, f uintptr) (r int32) +func Yfread(tls *TLS, destv uintptr, size Tsize_t, nmemb Tsize_t, f uintptr) (r Tsize_t) +func Yfread_unlocked(tls *TLS, destv uintptr, size Tsize_t, nmemb Tsize_t, f uintptr) (r Tsize_t) +func Yfree(tls *TLS, p uintptr) +func Yfreeaddrinfo(tls *TLS, p uintptr) +func Yfreeifaddrs(tls *TLS, ifp uintptr) +func Yfreelocale(tls *TLS, l Tlocale_t) +func Yfremovexattr(tls *TLS, fd int32, name uintptr) (r int32) +func Yfreopen(tls *TLS, filename uintptr, mode uintptr, f uintptr) (r uintptr) +func Yfrexp(tls *TLS, x float64, e uintptr) (r float64) +func Yfrexpf(tls *TLS, x float32, e uintptr) (r float32) +func Yfrexpl(tls *TLS, x float64, e uintptr) (r float64) +func Yfscanf(tls *TLS, f uintptr, fmt uintptr, va uintptr) (r int32) +func Yfseek(tls *TLS, f uintptr, off int64, whence int32) (r int32) +func Yfseeko(tls *TLS, f uintptr, off Toff_t, whence int32) (r int32) +func Yfsetpos(tls *TLS, f uintptr, pos uintptr) (r int32) +func Yfsetxattr(tls *TLS, filedes int32, name uintptr, value uintptr, size Tsize_t, flags int32) (r int32) +func Yfstat(tls *TLS, fd int32, st uintptr) (r int32) +func Yfstat64(tls *TLS, fd int32, st uintptr) (r int32) +func Yfstatat(tls *TLS, fd int32, path uintptr, st uintptr, flag int32) (r int32) +func Yfstatfs(tls *TLS, fd int32, buf uintptr) (r int32) +func Yfstatvfs(tls *TLS, fd int32, buf uintptr) (r int32) +func Yfsync(tls *TLS, fd int32) (r int32) +func Yftell(tls *TLS, f uintptr) (r int64) +func Yftello(tls *TLS, f uintptr) (r Toff_t) +func Yftime(tls *TLS, tp uintptr) (r int32) +func Yftok(tls *TLS, path uintptr, id int32) (r Tkey_t) +func Yftruncate(tls *TLS, fd int32, length Toff_t) (r int32) +func Yftruncate64(tls *TLS, fd int32, length Toff_t) (r int32) +func Yftrylockfile(tls *TLS, f uintptr) (r int32) +func Yfts64_close(t *TLS, ftsp uintptr) int32 +func Yfts64_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr +func Yfts64_read(t *TLS, ftsp uintptr) uintptr +func Yfts_close(t *TLS, ftsp uintptr) int32 +func Yfts_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr +func Yfts_read(t *TLS, ftsp uintptr) uintptr +func Yftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32) (r int32) +func Yfunlockfile(tls *TLS, f uintptr) +func Yfutimens(tls *TLS, fd int32, times uintptr) (r int32) +func Yfutimes(tls *TLS, fd int32, tv uintptr) (r int32) +func Yfutimesat(tls *TLS, dirfd int32, pathname uintptr, times uintptr) (r int32) +func Yfwide(tls *TLS, f uintptr, mode int32) (r int32) +func Yfwprintf(tls *TLS, f uintptr, fmt uintptr, va uintptr) (r int32) +func Yfwrite(tls *TLS, src uintptr, size Tsize_t, nmemb Tsize_t, f uintptr) (r Tsize_t) +func Yfwrite_unlocked(tls *TLS, src uintptr, size Tsize_t, nmemb Tsize_t, f uintptr) (r Tsize_t) +func Yfwscanf(tls *TLS, f uintptr, fmt uintptr, va uintptr) (r int32) +func Ygai_strerror(tls *TLS, ecode int32) (r uintptr) +func Ygcvt(tls *TLS, x float64, n int32, b uintptr) (r uintptr) +func Yget_avphys_pages(tls *TLS) (r int64) +func Yget_current_dir_name(tls *TLS) (r uintptr) +func Yget_nprocs(tls *TLS) (r int32) +func Yget_nprocs_conf(tls *TLS) (r int32) +func Yget_phys_pages(tls *TLS) (r int64) +func Ygetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) (r1 int32) +func Ygetauxval(tls *TLS, item uint64) (r uint64) +func Ygetc(tls *TLS, f1 uintptr) (r int32) +func Ygetc_unlocked(tls *TLS, f uintptr) (r int32) +func Ygetchar(tls *TLS) (r int32) +func Ygetchar_unlocked(tls *TLS) (r int32) +func Ygetcwd(tls *TLS, buf uintptr, size Tsize_t) (r uintptr) +func Ygetdate(tls *TLS, s uintptr) (r uintptr) +func Ygetdelim(tls *TLS, s uintptr, n uintptr, delim int32, f uintptr) (r Tssize_t) +func Ygetdents(tls *TLS, fd int32, buf uintptr, len1 Tsize_t) (r int32) +func Ygetdomainname(tls *TLS, name uintptr, len1 Tsize_t) (r int32) +func Ygetdtablesize(tls *TLS) (r int32) +func Ygetegid(tls *TLS) (r Tgid_t) +func Ygetentropy(tls *TLS, buffer uintptr, len1 Tsize_t) (r int32) +func Ygetenv(tls *TLS, name uintptr) (r uintptr) +func Ygeteuid(tls *TLS) (r Tuid_t) +func Ygetgid(tls *TLS) (r Tgid_t) +func Ygetgrent(tls *TLS) (r uintptr) +func Ygetgrgid(tls *TLS, gid Tgid_t) (r uintptr) +func Ygetgrgid_r(tls *TLS, gid Tgid_t, gr uintptr, buf uintptr, size Tsize_t, res uintptr) (r int32) +func Ygetgrnam(tls *TLS, name uintptr) (r uintptr) +func Ygetgrnam_r(tls *TLS, name uintptr, gr uintptr, buf uintptr, size Tsize_t, res uintptr) (r int32) +func Ygetgrouplist(tls *TLS, user uintptr, gid Tgid_t, groups uintptr, ngroups uintptr) (r int32) +func Ygetgroups(tls *TLS, count int32, list uintptr) (r int32) +func Ygethostbyaddr(tls *TLS, a uintptr, l Tsocklen_t, af int32) (r uintptr) +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) +func Ygethostbyname(tls *TLS, name uintptr) (r uintptr) +func Ygethostbyname2(tls *TLS, name uintptr, af int32) (r uintptr) +func Ygethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen Tsize_t, res uintptr, err uintptr) (r int32) +func Ygethostbyname_r(tls *TLS, name uintptr, h uintptr, buf uintptr, buflen Tsize_t, res uintptr, err uintptr) (r int32) +func Ygethostent(tls *TLS) (r uintptr) +func Ygethostid(tls *TLS) (r int64) +func Ygethostname(tls *TLS, name uintptr, len1 Tsize_t) (r int32) +func Ygetifaddrs(tls *TLS, ifap uintptr) (r1 int32) +func Ygetitimer(tls *TLS, which int32, old uintptr) (r1 int32) +func Ygetline(tls *TLS, s uintptr, n uintptr, f uintptr) (r Tssize_t) +func Ygetloadavg(tls *TLS, a uintptr, n int32) (r int32) +func Ygetlogin(tls *TLS) (r uintptr) +func Ygetlogin_r(tls *TLS, name uintptr, size Tsize_t) (r int32) +func Ygetmntent(tls *TLS, f uintptr) (r uintptr) +func Ygetmntent_r(tls *TLS, f uintptr, mnt uintptr, linebuf uintptr, buflen int32) (r uintptr) +func Ygetnameinfo(tls *TLS, sa uintptr, sl Tsocklen_t, node uintptr, nodelen Tsocklen_t, serv uintptr, servlen Tsocklen_t, flags int32) (r int32) +func Ygetnetbyaddr(tls *TLS, net Tuint32_t, type1 int32) (r uintptr) +func Ygetnetbyname(tls *TLS, name uintptr) (r uintptr) +func Ygetnetent(tls *TLS) (r uintptr) +func Ygetopt(tls *TLS, argc int32, argv uintptr, optstring uintptr) (r int32) +func Ygetopt_long(tls *TLS, argc int32, argv uintptr, optstring uintptr, longopts uintptr, idx uintptr) (r int32) +func Ygetopt_long_only(tls *TLS, argc int32, argv uintptr, optstring uintptr, longopts uintptr, idx uintptr) (r int32) +func Ygetpagesize(tls *TLS) (r int32) +func Ygetpass(tls *TLS, prompt uintptr) (r uintptr) +func Ygetpeername(tls *TLS, fd int32, addr uintptr, len1 uintptr) (r1 int32) +func Ygetpgid(tls *TLS, pid Tpid_t) (r Tpid_t) +func Ygetpgrp(tls *TLS) (r Tpid_t) +func Ygetpid(tls *TLS) (r Tpid_t) +func Ygetppid(tls *TLS) (r Tpid_t) +func Ygetpriority(tls *TLS, which int32, who Tid_t) (r int32) +func Ygetprotobyname(tls *TLS, name uintptr) (r uintptr) +func Ygetprotobynumber(tls *TLS, num int32) (r uintptr) +func Ygetprotoent(tls *TLS) (r uintptr) +func Ygetpwent(tls *TLS) (r uintptr) +func Ygetpwnam(tls *TLS, name uintptr) (r uintptr) +func Ygetpwnam_r(tls *TLS, name uintptr, pw uintptr, buf uintptr, size Tsize_t, res uintptr) (r int32) +func Ygetpwuid(tls *TLS, uid Tuid_t) (r uintptr) +func Ygetpwuid_r(tls *TLS, uid Tuid_t, pw uintptr, buf uintptr, size Tsize_t, res uintptr) (r int32) +func Ygetrandom(tls *TLS, buf uintptr, buflen Tsize_t, flags uint32) (r Tssize_t) +func Ygetresgid(tls *TLS, rgid uintptr, egid uintptr, sgid uintptr) (r int32) +func Ygetresuid(tls *TLS, ruid uintptr, euid uintptr, suid uintptr) (r int32) +func Ygetrlimit(tls *TLS, resource int32, rlim uintptr) (r int32) +func Ygetrlimit64(tls *TLS, resource int32, rlim uintptr) (r int32) +func Ygetrusage(tls *TLS, who int32, ru uintptr) (r1 int32) +func Ygets(tls *TLS, s uintptr) (r uintptr) +func Ygetservbyname(tls *TLS, name uintptr, prots uintptr) (r uintptr) +func Ygetservbyname_r(tls *TLS, name uintptr, prots uintptr, se uintptr, buf uintptr, buflen Tsize_t, res uintptr) (r int32) +func Ygetservent(tls *TLS) (r uintptr) +func Ygetsid(tls *TLS, pid Tpid_t) (r Tpid_t) +func Ygetsockname(tls *TLS, fd int32, addr uintptr, len1 uintptr) (r1 int32) +func Ygetsockopt(tls *TLS, fd int32, level int32, optname int32, optval uintptr, optlen uintptr) (r2 int32) +func Ygetspent(tls *TLS) (r uintptr) +func Ygetsubopt(tls *TLS, opt uintptr, keys uintptr, val uintptr) (r int32) +func Ygettext(tls *TLS, msgid uintptr) (r uintptr) +func Ygettimeofday(tls *TLS, tv uintptr, tz uintptr) (r int32) +func Ygetuid(tls *TLS) (r Tuid_t) +func Ygetusershell(tls *TLS) (r uintptr) +func Ygetutent(tls *TLS) (r uintptr) +func Ygetutid(tls *TLS, ut uintptr) (r uintptr) +func Ygetutline(tls *TLS, ut uintptr) (r uintptr) +func Ygetutxent(tls *TLS) (r uintptr) +func Ygetutxid(tls *TLS, ut uintptr) (r uintptr) +func Ygetutxline(tls *TLS, ut uintptr) (r uintptr) +func Ygetw(tls *TLS, f uintptr) (r int32) +func Ygetwc(tls *TLS, f uintptr) (r Twint_t) +func Ygetwc_unlocked(tls *TLS, f uintptr) (r Twint_t) +func Ygetwchar(tls *TLS) (r Twint_t) +func Ygetwchar_unlocked(tls *TLS) (r Twint_t) +func Ygetxattr(tls *TLS, path uintptr, name uintptr, value uintptr, size Tsize_t) (r Tssize_t) +func Yglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g_ uintptr) (r int32) +func Yglobfree(tls *TLS, g_ uintptr) +func Ygmtime(tls *TLS, t uintptr) (r uintptr) +func Ygmtime_r(tls *TLS, t uintptr, tm uintptr) (r uintptr) +func Ygrantpt(tls *TLS, fd int32) (r int32) +func Yhasmntopt(tls *TLS, mnt uintptr, opt uintptr) (r uintptr) +func Yhcreate(tls *TLS, nel Tsize_t) (r int32) +func Yhdestroy(tls *TLS) +func Yherror(tls *TLS, msg uintptr) +func Yhsearch(tls *TLS, item TENTRY, action TACTION) (r uintptr) +func Yhstrerror(tls *TLS, ecode int32) (r uintptr) +func Yhtonl(tls *TLS, n Tuint32_t) (r Tuint32_t) +func Yhtons(tls *TLS, n Tuint16_t) (r Tuint16_t) +func Yhypot(tls *TLS, x float64, y float64) (r float64) +func Yhypotf(tls *TLS, x float32, y float32) (r float32) +func Yhypotl(tls *TLS, x float64, y float64) (r float64) +func Yiconv(tls *TLS, cd Ticonv_t, in uintptr, inb uintptr, out uintptr, outb uintptr) (r Tsize_t) +func Yiconv_close(tls *TLS, cd Ticonv_t) (r int32) +func Yiconv_open(tls *TLS, to uintptr, from uintptr) (r Ticonv_t) +func Yif_freenameindex(tls *TLS, idx uintptr) +func Yif_indextoname(tls *TLS, index uint32, name uintptr) (r1 uintptr) +func Yif_nameindex(tls *TLS) (r uintptr) +func Yif_nametoindex(tls *TLS, name uintptr) (r1 uint32) +func Yilogb(tls *TLS, x3 float64) (r int32) +func Yilogbf(tls *TLS, x3 float32) (r int32) +func Yilogbl(tls *TLS, x float64) (r int32) +func Yimaxabs(tls *TLS, a Tintmax_t) (r Tintmax_t) +func Yimaxdiv(tls *TLS, num Tintmax_t, den Tintmax_t) (r Timaxdiv_t) +func Yindex(tls *TLS, s uintptr, c int32) (r uintptr) +func Yinet_addr(tls *TLS, p uintptr) (r Tin_addr_t) +func Yinet_aton(tls *TLS, s0 uintptr, dest uintptr) (r int32) +func Yinet_lnaof(tls *TLS, in Tin_addr) (r Tin_addr_t) +func Yinet_makeaddr(tls *TLS, n Tin_addr_t, h Tin_addr_t) (r Tin_addr) +func Yinet_netof(tls *TLS, in Tin_addr) (r Tin_addr_t) +func Yinet_network(tls *TLS, p uintptr) (r Tin_addr_t) +func Yinet_ntoa(tls *TLS, _in Tin_addr) (r uintptr) +func Yinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l Tsocklen_t) (r uintptr) +func Yinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) (r int32) +func Yinit_module(tls *TLS, a uintptr, b uint64, c uintptr) (r int32) +func Yinitstate(tls *TLS, seed uint32, state uintptr, size Tsize_t) (r uintptr) +func Yinitstate_r(t *TLS, seed uint32, statebuf uintptr, statelen Tsize_t, buf uintptr) int32 +func Yinotify_add_watch(tls *TLS, fd int32, pathname uintptr, mask Tuint32_t) (r int32) +func Yinotify_init(tls *TLS) (r int32) +func Yinotify_init1(tls *TLS, flags int32) (r1 int32) +func Yinotify_rm_watch(tls *TLS, fd int32, wd int32) (r int32) +func Yinsque(tls *TLS, element uintptr, pred uintptr) +func Yioctl(tls *TLS, fd int32, req int32, va uintptr) (r1 int32) +func Yioperm(tls *TLS, from uint64, num uint64, turn_on int32) (r int32) +func Yiopl(tls *TLS, level int32) (r int32) +func Yisalnum(tls *TLS, c int32) (r int32) +func Yisalnum_l(tls *TLS, c int32, l Tlocale_t) (r int32) +func Yisalpha(tls *TLS, c int32) (r int32) +func Yisalpha_l(tls *TLS, c int32, l Tlocale_t) (r int32) +func Yisascii(tls *TLS, c int32) (r int32) +func Yisastream(tls *TLS, fd int32) (r int32) +func Yisatty(tls *TLS, fd int32) (r1 int32) +func Yisblank(tls *TLS, c int32) (r int32) +func Yisblank_l(tls *TLS, c int32, l Tlocale_t) (r int32) +func Yiscntrl(tls *TLS, c int32) (r int32) +func Yiscntrl_l(tls *TLS, c int32, l Tlocale_t) (r int32) +func Yisdigit(tls *TLS, c int32) (r int32) +func Yisdigit_l(tls *TLS, c int32, l Tlocale_t) (r int32) +func Yisgraph(tls *TLS, c int32) (r int32) +func Yisgraph_l(tls *TLS, c int32, l Tlocale_t) (r int32) +func Yislower(tls *TLS, c int32) (r int32) +func Yislower_l(tls *TLS, c int32, l Tlocale_t) (r int32) +func Yisnan(t *TLS, x float64) int32 +func Yisnanf(t *TLS, arg float32) int32 +func Yisnanl(t *TLS, arg float64) int32 +func Yisprint(tls *TLS, c int32) (r int32) +func Yisprint_l(tls *TLS, c int32, l Tlocale_t) (r int32) +func Yispunct(tls *TLS, c int32) (r int32) +func Yispunct_l(tls *TLS, c int32, l Tlocale_t) (r int32) +func Yissetugid(tls *TLS) (r int32) +func Yisspace(tls *TLS, c int32) (r int32) +func Yisspace_l(tls *TLS, c int32, l Tlocale_t) (r int32) +func Yisupper(tls *TLS, c int32) (r int32) +func Yisupper_l(tls *TLS, c int32, l Tlocale_t) (r int32) +func Yiswalnum(tls *TLS, wc Twint_t) (r int32) +func Yiswalnum_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +func Yiswalpha(tls *TLS, wc Twint_t) (r int32) +func Yiswalpha_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +func Yiswblank(tls *TLS, wc Twint_t) (r int32) +func Yiswblank_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +func Yiswcntrl(tls *TLS, wc Twint_t) (r int32) +func Yiswcntrl_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +func Yiswctype(tls *TLS, wc Twint_t, type1 Twctype_t) (r int32) +func Yiswctype_l(tls *TLS, c Twint_t, t Twctype_t, l Tlocale_t) (r int32) +func Yiswdigit(tls *TLS, wc Twint_t) (r int32) +func Yiswdigit_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +func Yiswgraph(tls *TLS, wc Twint_t) (r int32) +func Yiswgraph_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +func Yiswlower(tls *TLS, wc Twint_t) (r int32) +func Yiswlower_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +func Yiswprint(tls *TLS, wc Twint_t) (r int32) +func Yiswprint_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +func Yiswpunct(tls *TLS, wc Twint_t) (r int32) +func Yiswpunct_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +func Yiswspace(tls *TLS, wc Twint_t) (r int32) +func Yiswspace_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +func Yiswupper(tls *TLS, wc Twint_t) (r int32) +func Yiswupper_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +func Yiswxdigit(tls *TLS, wc Twint_t) (r int32) +func Yiswxdigit_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +func Yisxdigit(tls *TLS, c int32) (r int32) +func Yisxdigit_l(tls *TLS, c int32, l Tlocale_t) (r int32) +func Yj0(tls *TLS, x float64) (r1 float64) +func Yj0f(tls *TLS, x float32) (r1 float32) +func Yj1(tls *TLS, x float64) (r1 float64) +func Yj1f(tls *TLS, x float32) (r1 float32) +func Yjn(tls *TLS, n int32, x float64) (r float64) +func Yjnf(tls *TLS, n int32, x float32) (r float32) +func Yjrand48(tls *TLS, s uintptr) (r int64) +func Ykill(tls *TLS, pid Tpid_t, sig int32) (r int32) +func Ykillpg(tls *TLS, pgid Tpid_t, sig int32) (r int32) +func Yklogctl(tls *TLS, type1 int32, buf uintptr, len1 int32) (r int32) +func Yl64a(tls *TLS, x0 int64) (r uintptr) +func Ylabs(tls *TLS, a int64) (r int64) +func Ylchmod(tls *TLS, path uintptr, mode Tmode_t) (r int32) +func Ylchown(tls *TLS, path uintptr, uid Tuid_t, gid Tgid_t) (r int32) +func Ylckpwdf(tls *TLS) (r int32) +func Ylcong48(tls *TLS, p uintptr) +func Yldexp(tls *TLS, x float64, n int32) (r float64) +func Yldexpf(tls *TLS, x float32, n int32) (r float32) +func Yldexpl(tls *TLS, x float64, n int32) (r float64) +func Yldiv(tls *TLS, num int64, den int64) (r Tldiv_t) +func Ylfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) +func Ylgamma(tls *TLS, x float64) (r float64) +func Ylgamma_r(tls *TLS, x float64, signgamp uintptr) (r float64) +func Ylgammaf(tls *TLS, x float32) (r float32) +func Ylgammaf_r(tls *TLS, x float32, signgamp uintptr) (r float32) +func Ylgammal(tls *TLS, x float64) (r float64) +func Ylgammal_r(tls *TLS, x float64, sg uintptr) (r float64) +func Ylgetxattr(tls *TLS, path uintptr, name uintptr, value uintptr, size Tsize_t) (r Tssize_t) +func Ylink(tls *TLS, existing uintptr, new1 uintptr) (r int32) +func Ylinkat(tls *TLS, fd1 int32, existing uintptr, fd2 int32, new1 uintptr, flag int32) (r int32) +func Ylisten(tls *TLS, fd int32, backlog int32) (r1 int32) +func Ylistxattr(tls *TLS, path uintptr, list uintptr, size Tsize_t) (r Tssize_t) +func Yllabs(tls *TLS, a int64) (r int64) +func Ylldiv(tls *TLS, num int64, den int64) (r Tlldiv_t) +func Yllistxattr(tls *TLS, path uintptr, list uintptr, size Tsize_t) (r Tssize_t) +func Yllrint(tls *TLS, x float64) (r int64) +func Yllrintf(tls *TLS, x float32) (r int64) +func Yllrintl(tls *TLS, x float64) (r int64) +func Yllround(tls *TLS, x float64) (r int64) +func Yllroundf(tls *TLS, x float32) (r int64) +func Yllroundl(tls *TLS, x float64) (r int64) +func Ylocaleconv(tls *TLS) (r uintptr) +func Ylocaltime(tls *TLS, t uintptr) (r uintptr) +func Ylocaltime_r(tls *TLS, t uintptr, tm uintptr) (r uintptr) +func Ylockf(tls *TLS, fd int32, op int32, size Toff_t) (r int32) +func Ylog(tls *TLS, x1 float64) (r1 float64) +func Ylog10(tls *TLS, x float64) (r float64) +func Ylog10f(tls *TLS, x float32) (r float32) +func Ylog10l(tls *TLS, x float64) (r float64) +func Ylog1p(tls *TLS, x3 float64) (r float64) +func Ylog1pf(tls *TLS, x3 float32) (r float32) +func Ylog1pl(tls *TLS, x float64) (r float64) +func Ylog2(tls *TLS, x1 float64) (r1 float64) +func Ylog2f(tls *TLS, x1 float32) (r1 float32) +func Ylog2l(tls *TLS, x float64) (r float64) +func Ylogb(tls *TLS, x float64) (r float64) +func Ylogbf(tls *TLS, x float32) (r float32) +func Ylogbl(tls *TLS, x float64) (r float64) +func Ylogf(tls *TLS, x1 float32) (r1 float32) +func Ylogin_tty(tls *TLS, fd int32) (r int32) +func Ylogl(tls *TLS, x float64) (r float64) +func Ylongjmp(t *TLS, env uintptr, val int32) +func Ylrand48(tls *TLS) (r int64) +func Ylremovexattr(tls *TLS, path uintptr, name uintptr) (r int32) +func Ylrint(tls *TLS, x float64) (r int64) +func Ylrintf(tls *TLS, x float32) (r int64) +func Ylrintl(tls *TLS, x float64) (r int64) +func Ylround(tls *TLS, x float64) (r int64) +func Ylroundf(tls *TLS, x float32) (r int64) +func Ylroundl(tls *TLS, x float64) (r int64) +func Ylsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) +func Ylseek(tls *TLS, fd int32, offset Toff_t, whence int32) (r Toff_t) +func Ylseek64(tls *TLS, fd int32, offset Toff_t, whence int32) (r Toff_t) +func Ylsetxattr(tls *TLS, path uintptr, name uintptr, value uintptr, size Tsize_t, flags int32) (r int32) +func Ylstat(tls *TLS, path uintptr, buf uintptr) (r int32) +func Ylstat64(tls *TLS, path uintptr, buf uintptr) (r int32) +func Ylutimes(tls *TLS, filename uintptr, tv uintptr) (r int32) +func Ymadvise(tls *TLS, addr uintptr, len1 Tsize_t, advice int32) (r int32) +func Ymalloc(tls *TLS, n Tsize_t) (r uintptr) +func Ymalloc_usable_size(tls *TLS, p uintptr) (r Tsize_t) +func Ymblen(tls *TLS, s uintptr, n Tsize_t) (r int32) +func Ymbrlen(tls *TLS, s uintptr, n Tsize_t, st uintptr) (r Tsize_t) +func Ymbrtoc16(tls *TLS, pc16 uintptr, s uintptr, n Tsize_t, ps uintptr) (r Tsize_t) +func Ymbrtoc32(tls *TLS, pc32 uintptr, s uintptr, n Tsize_t, ps uintptr) (r Tsize_t) +func Ymbrtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t, st uintptr) (r Tsize_t) +func Ymbsinit(tls *TLS, st uintptr) (r int32) +func Ymbsnrtowcs(tls *TLS, wcs uintptr, src uintptr, n Tsize_t, wn Tsize_t, st uintptr) (r Tsize_t) +func Ymbsrtowcs(tls *TLS, ws uintptr, src uintptr, wn Tsize_t, st uintptr) (r Tsize_t) +func Ymbstowcs(tls *TLS, ws uintptr, _s uintptr, wn Tsize_t) (r Tsize_t) +func Ymbtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t) (r int32) +func Ymemccpy(tls *TLS, dest uintptr, src uintptr, c int32, n Tsize_t) (r uintptr) +func Ymemchr(tls *TLS, src uintptr, c int32, n Tsize_t) (r uintptr) +func Ymemcmp(tls *TLS, vl uintptr, vr uintptr, n Tsize_t) (r1 int32) +func Ymemcpy(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r uintptr) +func Ymemfd_create(tls *TLS, name uintptr, flags uint32) (r int32) +func Ymemmem(tls *TLS, h0 uintptr, k Tsize_t, n0 uintptr, l Tsize_t) (r uintptr) +func Ymemmove(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r uintptr) +func Ymempcpy(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r uintptr) +func Ymemrchr(tls *TLS, m uintptr, c int32, n Tsize_t) (r uintptr) +func Ymemset(tls *TLS, dest uintptr, c int32, n Tsize_t) (r uintptr) +func Ymincore(tls *TLS, addr uintptr, len1 Tsize_t, vec uintptr) (r int32) +func Ymkdir(tls *TLS, path uintptr, mode Tmode_t) (r int32) +func Ymkdirat(tls *TLS, fd int32, path uintptr, mode Tmode_t) (r int32) +func Ymkdtemp(tls *TLS, template uintptr) (r uintptr) +func Ymkfifo(tls *TLS, path uintptr, mode Tmode_t) (r int32) +func Ymkfifoat(tls *TLS, fd int32, path uintptr, mode Tmode_t) (r int32) +func Ymknod(tls *TLS, path uintptr, mode Tmode_t, dev Tdev_t) (r int32) +func Ymknodat(tls *TLS, fd int32, path uintptr, mode Tmode_t, dev Tdev_t) (r int32) +func Ymkostemp(tls *TLS, template uintptr, flags int32) (r int32) +func Ymkostemps(tls *TLS, template uintptr, len1 int32, flags int32) (r int32) +func Ymkstemp(tls *TLS, template uintptr) (r int32) +func Ymkstemp64(tls *TLS, template uintptr) (r int32) +func Ymkstemps(tls *TLS, template uintptr, len1 int32) (r int32) +func Ymkstemps64(tls *TLS, template uintptr, len1 int32) (r int32) +func Ymktemp(tls *TLS, template uintptr) (r uintptr) +func Ymktime(tls *TLS, tm uintptr) (r Ttime_t) +func Ymlock(tls *TLS, addr uintptr, len1 Tsize_t) (r int32) +func Ymlock2(tls *TLS, addr uintptr, len1 Tsize_t, flags uint32) (r int32) +func Ymlockall(tls *TLS, flags int32) (r int32) +func Ymmap(tls *TLS, start uintptr, len1 Tsize_t, prot int32, flags int32, fd int32, off Toff_t) (r uintptr) +func Ymmap64(tls *TLS, start uintptr, len1 Tsize_t, prot int32, flags int32, fd int32, off Toff_t) (r uintptr) +func Ymodf(tls *TLS, x float64, iptr uintptr) (r float64) +func Ymodff(tls *TLS, x float32, iptr uintptr) (r float32) +func Ymodfl(tls *TLS, x float64, iptr uintptr) (r1 float64) +func Ymount(tls *TLS, special uintptr, dir uintptr, fstype uintptr, flags uint64, data uintptr) (r int32) +func Ymprotect(tls *TLS, addr uintptr, len1 Tsize_t, prot int32) (r int32) +func Ymrand48(tls *TLS) (r int64) +func Ymremap(tls *TLS, old_addr uintptr, old_len Tsize_t, new_len Tsize_t, flags int32, va uintptr) (r uintptr) +func Ymsgctl(tls *TLS, q int32, cmd int32, buf uintptr) (r1 int32) +func Ymsgget(tls *TLS, k Tkey_t, flag int32) (r int32) +func Ymsgrcv(tls *TLS, q int32, m uintptr, len1 Tsize_t, type1 int64, flag int32) (r Tssize_t) +func Ymsgsnd(tls *TLS, q int32, m uintptr, len1 Tsize_t, flag int32) (r int32) +func Ymsync(tls *TLS, start uintptr, len1 Tsize_t, flags int32) (r int32) +func Ymunlock(tls *TLS, addr uintptr, len1 Tsize_t) (r int32) +func Ymunlockall(tls *TLS) (r int32) +func Ymunmap(tls *TLS, start uintptr, len1 Tsize_t) (r int32) +func Yname_to_handle_at(tls *TLS, dirfd int32, pathname uintptr, handle uintptr, mount_id uintptr, flags int32) (r int32) +func Ynan(tls *TLS, s uintptr) (r float64) +func Ynanf(tls *TLS, s uintptr) (r float32) +func Ynanl(tls *TLS, s uintptr) (r float64) +func Ynanosleep(tls *TLS, req uintptr, rem uintptr) (r int32) +func Ynewlocale(tls *TLS, mask int32, name uintptr, loc Tlocale_t) (r Tlocale_t) +func Ynextafter(tls *TLS, x3 float64, y3 float64) (r float64) +func Ynextafterf(tls *TLS, x3 float32, y3 float32) (r float32) +func Ynextafterl(tls *TLS, x float64, y float64) (r float64) +func Ynexttoward(tls *TLS, x float64, y float64) (r float64) +func Ynexttowardf(tls *TLS, x3 float32, y3 float64) (r float32) +func Ynexttowardl(tls *TLS, x float64, y float64) (r float64) +func Ynftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32) (r1 int32) +func Yngettext(tls *TLS, msgid1 uintptr, msgid2 uintptr, n uint64) (r uintptr) +func Ynice(tls *TLS, inc int32) (r int32) +func Ynl_langinfo(tls *TLS, item Tnl_item) (r uintptr) +func Ynl_langinfo_l(tls *TLS, item Tnl_item, loc Tlocale_t) (r uintptr) +func Ynrand48(tls *TLS, s uintptr) (r int64) +func Yns_get16(tls *TLS, cp uintptr) (r uint32) +func Yns_get32(tls *TLS, cp uintptr) (r uint64) +func Yns_initparse(tls *TLS, msg uintptr, msglen int32, handle uintptr) (r1 int32) +func Yns_name_uncompress(tls *TLS, msg uintptr, eom uintptr, src uintptr, dst uintptr, dstsiz Tsize_t) (r1 int32) +func Yns_parserr(tls *TLS, handle uintptr, section Tns_sect, rrnum int32, rr uintptr) (r1 int32) +func Yns_put16(tls *TLS, s uint32, cp uintptr) +func Yns_put32(tls *TLS, l uint64, cp uintptr) +func Yns_skiprr(tls *TLS, ptr uintptr, eom uintptr, section Tns_sect, count int32) (r1 int32) +func Yntohl(tls *TLS, n Tuint32_t) (r Tuint32_t) +func Yntohs(tls *TLS, n Tuint16_t) (r Tuint16_t) +func Yobstack_free(t *TLS, obstack, obj uintptr) +func Yobstack_vprintf(t *TLS, obstack, template, va uintptr) int32 +func Yopen(tls *TLS, filename uintptr, flags int32, va uintptr) (r int32) +func Yopen64(tls *TLS, filename uintptr, flags int32, va uintptr) (r int32) +func Yopen_by_handle_at(tls *TLS, mount_fd int32, handle uintptr, flags int32) (r int32) +func Yopen_memstream(tls *TLS, bufp uintptr, sizep uintptr) (r uintptr) +func Yopen_wmemstream(tls *TLS, bufp uintptr, sizep uintptr) (r uintptr) +func Yopenat(tls *TLS, fd int32, filename uintptr, flags int32, va uintptr) (r int32) +func Yopendir(tls *TLS, name uintptr) (r uintptr) +func Yopenlog(tls *TLS, ident uintptr, opt int32, facility int32) +func Yopenpty(tls *TLS, pm uintptr, ps uintptr, name uintptr, tio uintptr, ws uintptr) (r int32) +func Ypathconf(tls *TLS, path uintptr, name int32) (r int64) +func Ypause(tls *TLS) (r int32) +func Ypclose(tls *TLS, f uintptr) (r1 int32) +func Yperror(tls *TLS, msg uintptr) +func Ypersonality(tls *TLS, persona uint64) (r int32) +func Ypipe(tls *TLS, fd uintptr) (r int32) +func Ypipe2(tls *TLS, fd uintptr, flag int32) (r int32) +func Ypivot_root(tls *TLS, new1 uintptr, old uintptr) (r int32) +func Ypoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) +func Ypopen(t *TLS, command, type1 uintptr) uintptr +func Yposix_close(tls *TLS, fd int32, flags int32) (r int32) +func Yposix_fadvise(tls *TLS, fd int32, base Toff_t, len1 Toff_t, advice int32) (r int32) +func Yposix_fallocate(tls *TLS, fd int32, base Toff_t, len1 Toff_t) (r int32) +func Yposix_madvise(tls *TLS, addr uintptr, len1 Tsize_t, advice int32) (r int32) +func Yposix_openpt(tls *TLS, flags int32) (r1 int32) +func Yposix_spawn_file_actions_addchdir_np(tls *TLS, fa uintptr, path uintptr) (r int32) +func Yposix_spawn_file_actions_addclose(tls *TLS, fa uintptr, fd int32) (r int32) +func Yposix_spawn_file_actions_adddup2(tls *TLS, fa uintptr, srcfd int32, fd int32) (r int32) +func Yposix_spawn_file_actions_addfchdir_np(tls *TLS, fa uintptr, fd int32) (r int32) +func Yposix_spawn_file_actions_addopen(tls *TLS, fa uintptr, fd int32, path uintptr, flags int32, mode Tmode_t) (r int32) +func Yposix_spawn_file_actions_destroy(tls *TLS, fa uintptr) (r int32) +func Yposix_spawn_file_actions_init(tls *TLS, fa uintptr) (r int32) +func Yposix_spawnattr_destroy(tls *TLS, attr uintptr) (r int32) +func Yposix_spawnattr_getflags(tls *TLS, attr uintptr, flags uintptr) (r int32) +func Yposix_spawnattr_getpgroup(tls *TLS, attr uintptr, pgrp uintptr) (r int32) +func Yposix_spawnattr_getschedparam(tls *TLS, attr uintptr, schedparam uintptr) (r int32) +func Yposix_spawnattr_getschedpolicy(tls *TLS, attr uintptr, policy uintptr) (r int32) +func Yposix_spawnattr_getsigdefault(tls *TLS, attr uintptr, def uintptr) (r int32) +func Yposix_spawnattr_getsigmask(tls *TLS, attr uintptr, mask uintptr) (r int32) +func Yposix_spawnattr_init(tls *TLS, attr uintptr) (r int32) +func Yposix_spawnattr_setflags(tls *TLS, attr uintptr, flags int16) (r int32) +func Yposix_spawnattr_setpgroup(tls *TLS, attr uintptr, pgrp Tpid_t) (r int32) +func Yposix_spawnattr_setschedparam(tls *TLS, attr uintptr, schedparam uintptr) (r int32) +func Yposix_spawnattr_setschedpolicy(tls *TLS, attr uintptr, policy int32) (r int32) +func Yposix_spawnattr_setsigdefault(tls *TLS, attr uintptr, def uintptr) (r int32) +func Yposix_spawnattr_setsigmask(tls *TLS, attr uintptr, mask uintptr) (r int32) +func Ypow(tls *TLS, x1 float64, y1 float64) (r float64) +func Ypow10(tls *TLS, x float64) (r float64) +func Ypow10f(tls *TLS, x float32) (r float32) +func Ypow10l(tls *TLS, x float64) (r float64) +func Ypowf(tls *TLS, x1 float32, y1 float32) (r float32) +func Ypowl(tls *TLS, x float64, y float64) (r float64) +func Yppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r int32) +func Yprctl(tls *TLS, op int32, va uintptr) (r int32) +func Ypread(tls *TLS, fd int32, buf uintptr, size Tsize_t, ofs Toff_t) (r Tssize_t) +func Ypreadv(tls *TLS, fd int32, iov uintptr, count int32, ofs Toff_t) (r Tssize_t) +func Ypreadv2(tls *TLS, fd int32, iov uintptr, count int32, ofs Toff_t, flags int32) (r Tssize_t) +func Yprintf(tls *TLS, fmt uintptr, va uintptr) (r int32) +func Yprlimit(tls *TLS, pid Tpid_t, resource int32, new_limit uintptr, old_limit uintptr) (r1 int32) +func Yprocess_vm_readv(tls *TLS, pid Tpid_t, lvec uintptr, liovcnt uint64, rvec uintptr, riovcnt uint64, flags uint64) (r Tssize_t) +func Yprocess_vm_writev(tls *TLS, pid Tpid_t, lvec uintptr, liovcnt uint64, rvec uintptr, riovcnt uint64, flags uint64) (r Tssize_t) +func Ypselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts uintptr, mask uintptr) (r int32) +func Ypsiginfo(tls *TLS, si uintptr, msg uintptr) +func Ypsignal(tls *TLS, sig int32, msg uintptr) +func Ypthread_atfork(tls *TLS, prepare, parent, child uintptr) int32 +func Ypthread_attr_destroy(tls *TLS, a uintptr) int32 +func Ypthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 +func Ypthread_attr_init(tls *TLS, a uintptr) int32 +func Ypthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) (r int32) +func Ypthread_attr_setscope(tls *TLS, a uintptr, scope int32) int32 +func Ypthread_attr_setstacksize(tls *TLS, a uintptr, stacksite Tsize_t) int32 +func Ypthread_cleanup_pop(tls *TLS, run int32) +func Ypthread_cleanup_push(tls *TLS, f, x uintptr) +func Ypthread_cond_broadcast(tls *TLS, c uintptr) int32 +func Ypthread_cond_destroy(tls *TLS, c uintptr) int32 +func Ypthread_cond_init(tls *TLS, c, a uintptr) int32 +func Ypthread_cond_signal(tls *TLS, c uintptr) int32 +func Ypthread_cond_timedwait(tls *TLS, c, m, ts uintptr) (r int32) +func Ypthread_cond_wait(tls *TLS, c, m uintptr) int32 +func Ypthread_create(tls *TLS, res, attrp, entry, arg uintptr) int32 +func Ypthread_detach(tls *TLS, t uintptr) int32 +func Ypthread_equal(tls *TLS, t, u uintptr) int32 +func Ypthread_exit(tls *TLS, result uintptr) +func Ypthread_getspecific(tls *TLS, k Tpthread_key_t) uintptr +func Ypthread_join(tls *TLS, t Tpthread_t, res uintptr) (r int32) +func Ypthread_key_create(tls *TLS, k uintptr, dtor uintptr) int32 +func Ypthread_key_delete(tls *TLS, k Tpthread_key_t) int32 +func Ypthread_mutex_destroy(tls *TLS, m uintptr) int32 +func Ypthread_mutex_init(tls *TLS, m, a uintptr) int32 +func Ypthread_mutex_lock(tls *TLS, m uintptr) int32 +func Ypthread_mutex_trylock(tls *TLS, m uintptr) int32 +func Ypthread_mutex_unlock(tls *TLS, m uintptr) int32 +func Ypthread_mutexattr_destroy(tls *TLS, a uintptr) int32 +func Ypthread_mutexattr_init(tls *TLS, a uintptr) int32 +func Ypthread_mutexattr_settype(tls *TLS, a uintptr, typ int32) int32 +func Ypthread_self(tls *TLS) uintptr +func Ypthread_setcancelstate(tls *TLS, new int32, old uintptr) int32 +func Ypthread_setspecific(tls *TLS, k Tpthread_key_t, x uintptr) int32 +func Ypthread_sigmask(tls *TLS, now int32, set, old uintptr) int32 +func Yptrace(tls *TLS, req int32, va uintptr) (r int64) +func Yptsname(tls *TLS, fd int32) (r uintptr) +func Yptsname_r(tls *TLS, fd int32, buf uintptr, len1 Tsize_t) (r int32) +func Yputc(tls *TLS, c1 int32, f1 uintptr) (r int32) +func Yputc_unlocked(tls *TLS, c int32, f uintptr) (r int32) +func Yputchar(tls *TLS, c1 int32) (r int32) +func Yputchar_unlocked(tls *TLS, c int32) (r int32) +func Yputenv(tls *TLS, s uintptr) (r int32) +func Yputgrent(tls *TLS, gr uintptr, f uintptr) (r1 int32) +func Yputpwent(tls *TLS, pw uintptr, f uintptr) (r int32) +func Yputs(tls *TLS, s uintptr) (r1 int32) +func Yputspent(tls *TLS, sp uintptr, f uintptr) (r int32) +func Ypututline(tls *TLS, ut uintptr) (r uintptr) +func Ypututxline(tls *TLS, ut uintptr) (r uintptr) +func Yputw(tls *TLS, _x int32, f uintptr) (r int32) +func Yputwc(tls *TLS, c Twchar_t, f uintptr) (r Twint_t) +func Yputwc_unlocked(tls *TLS, c Twchar_t, f uintptr) (r Twint_t) +func Yputwchar(tls *TLS, c Twchar_t) (r Twint_t) +func Yputwchar_unlocked(tls *TLS, c Twchar_t) (r Twint_t) +func Ypwrite(tls *TLS, fd int32, buf uintptr, size Tsize_t, ofs Toff_t) (r Tssize_t) +func Ypwritev(tls *TLS, fd int32, iov uintptr, count int32, ofs Toff_t) (r Tssize_t) +func Ypwritev2(tls *TLS, fd int32, iov uintptr, count int32, ofs Toff_t, flags int32) (r Tssize_t) +func Yqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun) +func Yqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) +func Yquick_exit(tls *TLS, code int32) +func Yquotactl(tls *TLS, cmd int32, special uintptr, id int32, addr uintptr) (r int32) +func Yraise(tls *TLS, sig int32) (r int32) +func Yrand(tls *TLS) (r int32) +func Yrand_r(tls *TLS, seed uintptr) (r int32) +func Yrandom(tls *TLS) (r int64) +func Yrandom_r(t *TLS, buf, result uintptr) int32 +func Yread(tls *TLS, fd int32, buf uintptr, count Tsize_t) (r Tssize_t) +func Yreadahead(tls *TLS, fd int32, pos Toff_t, len1 Tsize_t) (r Tssize_t) +func Yreaddir(tls *TLS, dir uintptr) (r uintptr) +func Yreaddir64(tls *TLS, dir uintptr) (r uintptr) +func Yreaddir_r(tls *TLS, dir uintptr, buf uintptr, result uintptr) (r int32) +func Yreadlink(tls *TLS, path uintptr, buf uintptr, bufsize Tsize_t) (r1 Tssize_t) +func Yreadlinkat(tls *TLS, fd int32, path uintptr, buf uintptr, bufsize Tsize_t) (r1 Tssize_t) +func Yreadv(tls *TLS, fd int32, iov uintptr, count int32) (r Tssize_t) +func Yrealloc(tls *TLS, p uintptr, n Tsize_t) (r uintptr) +func Yreallocarray(tls *TLS, ptr uintptr, m Tsize_t, n Tsize_t) (r uintptr) +func Yrealpath(tls *TLS, filename uintptr, resolved uintptr) (r uintptr) +func Yreboot(tls *TLS, type1 int32) (r int32) +func Yrecv(tls *TLS, fd int32, buf uintptr, len1 Tsize_t, flags int32) (r Tssize_t) +func Yrecvfrom(tls *TLS, fd int32, buf uintptr, len1 Tsize_t, flags int32, addr uintptr, alen uintptr) (r1 Tssize_t) +func Yrecvmmsg(tls *TLS, fd int32, msgvec uintptr, vlen uint32, flags uint32, timeout uintptr) (r int32) +func Yrecvmsg(tls *TLS, fd int32, msg uintptr, flags int32) (r2 Tssize_t) +func Yregcomp(tls *TLS, preg uintptr, regex uintptr, cflags int32) (r int32) +func Yregerror(tls *TLS, e int32, preg uintptr, buf uintptr, size Tsize_t) (r Tsize_t) +func Yregexec(tls *TLS, preg uintptr, string1 uintptr, nmatch Tsize_t, pmatch uintptr, eflags int32) (r int32) +func Yregfree(tls *TLS, preg uintptr) +func Yremainder(tls *TLS, x float64, y float64) (r float64) +func Yremainderf(tls *TLS, x float32, y float32) (r float32) +func Yremainderl(tls *TLS, x float64, y float64) (r float64) +func Yremap_file_pages(tls *TLS, addr uintptr, size Tsize_t, prot int32, pgoff Tsize_t, flags int32) (r int32) +func Yremove(tls *TLS, path uintptr) (r1 int32) +func Yremovexattr(tls *TLS, path uintptr, name uintptr) (r int32) +func Yremque(tls *TLS, element uintptr) +func Yremquo(tls *TLS, x float64, y float64, quo uintptr) (r float64) +func Yremquof(tls *TLS, x float32, y float32, quo uintptr) (r float32) +func Yremquol(tls *TLS, x float64, y float64, quo uintptr) (r float64) +func Yrename(tls *TLS, old uintptr, new1 uintptr) (r int32) +func Yrenameat(tls *TLS, oldfd int32, old uintptr, newfd int32, new1 uintptr) (r int32) +func Yrenameat2(t *TLS, olddirfd int32, oldpath uintptr, newdirfd int32, newpath uintptr, flags int32) int32 +func Yres_init(tls *TLS) (r int32) +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) +func Yres_send(tls *TLS, _msg uintptr, _msglen int32, _answer uintptr, _anslen int32) (r int32) +func Yrewind(tls *TLS, f uintptr) +func Yrewinddir(tls *TLS, dir uintptr) +func Yrindex(tls *TLS, s uintptr, c int32) (r uintptr) +func Yrint(tls *TLS, x float64) (r float64) +func Yrintf(tls *TLS, x float32) (r float32) +func Yrintl(tls *TLS, x float64) (r float64) +func Yrmdir(tls *TLS, path uintptr) (r int32) +func Yround(tls *TLS, x3 float64) (r float64) +func Yroundf(tls *TLS, x3 float32) (r float32) +func Yroundl(tls *TLS, x float64) (r float64) +func Ysbrk(tls *TLS, inc Tintptr_t) (r uintptr) +func Yscalb(tls *TLS, x float64, fn float64) (r float64) +func Yscalbf(tls *TLS, x float32, fn float32) (r float32) +func Yscalbln(tls *TLS, x float64, n int64) (r float64) +func Yscalblnf(tls *TLS, x float32, n int64) (r float32) +func Yscalblnl(tls *TLS, x float64, n int64) (r float64) +func Yscalbn(tls *TLS, x float64, n int32) (r float64) +func Yscalbnf(tls *TLS, x float32, n int32) (r float32) +func Yscalbnl(tls *TLS, x float64, n int32) (r float64) +func Yscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r int32) +func Yscanf(tls *TLS, fmt uintptr, va uintptr) (r int32) +func Ysched_yield(tls *TLS) int32 +func Ysecure_getenv(tls *TLS, name uintptr) (r uintptr) +func Yseed48(tls *TLS, s uintptr) (r uintptr) +func Yseekdir(tls *TLS, dir uintptr, off int64) +func Yselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, tv uintptr) (r int32) +func Ysemctl(tls *TLS, id int32, num int32, cmd int32, va uintptr) (r1 int32) +func Ysemget(tls *TLS, key Tkey_t, n int32, fl int32) (r int32) +func Ysemop(tls *TLS, id int32, buf uintptr, n Tsize_t) (r int32) +func Ysemtimedop(tls *TLS, id int32, buf uintptr, n Tsize_t, ts uintptr) (r int32) +func Ysend(tls *TLS, fd int32, buf uintptr, len1 Tsize_t, flags int32) (r Tssize_t) +func Ysendfile(tls *TLS, out_fd int32, in_fd int32, ofs uintptr, count Tsize_t) (r Tssize_t) +func Ysendmmsg(tls *TLS, fd int32, msgvec uintptr, vlen uint32, flags uint32) (r1 int32) +func Ysendmsg(tls *TLS, fd int32, msg uintptr, flags int32) (r1 Tssize_t) +func Ysendto(tls *TLS, fd int32, buf uintptr, len1 Tsize_t, flags int32, addr uintptr, alen Tsocklen_t) (r1 Tssize_t) +func Ysetbuf(tls *TLS, f uintptr, buf uintptr) +func Ysetbuffer(tls *TLS, f uintptr, buf uintptr, size Tsize_t) +func Ysetdomainname(tls *TLS, name uintptr, len1 Tsize_t) (r int32) +func Ysetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) (r int32) +func Ysetfsgid(tls *TLS, gid Tgid_t) (r int32) +func Ysetfsuid(tls *TLS, uid Tuid_t) (r int32) +func Ysetgid(tls *TLS, gid Tgid_t) (r int32) +func Ysetgrent(tls *TLS) +func Ysethostent(tls *TLS, x int32) +func Ysethostname(tls *TLS, name uintptr, len1 Tsize_t) (r int32) +func Ysetitimer(tls *TLS, which int32, new1 uintptr, old uintptr) (r1 int32) +func Ysetjmp(t *TLS, env uintptr) int32 +func Ysetkey(tls *TLS, key uintptr) +func Ysetlinebuf(tls *TLS, f uintptr) +func Ysetlocale(tls *TLS, cat int32, name uintptr) (r uintptr) +func Ysetlogmask(tls *TLS, maskpri int32) (r int32) +func Ysetmntent(tls *TLS, name uintptr, mode uintptr) (r uintptr) +func Ysetnetent(tls *TLS, x int32) +func Ysetns(tls *TLS, fd int32, nstype int32) (r int32) +func Ysetpgid(tls *TLS, pid Tpid_t, pgid Tpid_t) (r int32) +func Ysetpgrp(tls *TLS) (r Tpid_t) +func Ysetpriority(tls *TLS, which int32, who Tid_t, prio int32) (r int32) +func Ysetprotoent(tls *TLS, stayopen int32) +func Ysetpwent(tls *TLS) +func Ysetrlimit(tls *TLS, resource int32, rlim uintptr) (r int32) +func Ysetrlimit64(tls *TLS, resource int32, rlim uintptr) (r int32) +func Ysetservent(tls *TLS, stayopen int32) +func Ysetsid(tls *TLS) (r Tpid_t) +func Ysetsockopt(tls *TLS, fd int32, level int32, optname int32, optval uintptr, optlen Tsocklen_t) (r2 int32) +func Ysetspent(tls *TLS) +func Ysetstate(tls *TLS, state uintptr) (r uintptr) +func Ysettimeofday(tls *TLS, tv uintptr, tz uintptr) (r int32) +func Ysetuid(tls *TLS, uid Tuid_t) (r int32) +func Ysetusershell(tls *TLS) +func Ysetutent(tls *TLS) +func Ysetutxent(tls *TLS) +func Ysetvbuf(tls *TLS, f uintptr, buf uintptr, type1 int32, size Tsize_t) (r int32) +func Ysetxattr(tls *TLS, path uintptr, name uintptr, value uintptr, size Tsize_t, flags int32) (r int32) +func Yshm_open(tls *TLS, name uintptr, flag int32, mode Tmode_t) (r int32) +func Yshm_unlink(tls *TLS, name uintptr) (r int32) +func Yshmat(tls *TLS, id int32, addr uintptr, flag int32) (r uintptr) +func Yshmctl(tls *TLS, id int32, cmd int32, buf uintptr) (r1 int32) +func Yshmdt(tls *TLS, addr uintptr) (r int32) +func Yshmget(tls *TLS, key Tkey_t, size Tsize_t, flag int32) (r int32) +func Yshutdown(tls *TLS, fd int32, how int32) (r1 int32) +func Ysigaction(tls *TLS, sig int32, sa uintptr, old uintptr) (r int32) +func Ysigaddset(tls *TLS, set uintptr, sig int32) (r int32) +func Ysigaltstack(tls *TLS, ss uintptr, old uintptr) (r int32) +func Ysigandset(tls *TLS, dest uintptr, left uintptr, right uintptr) (r1 int32) +func Ysigdelset(tls *TLS, set uintptr, sig int32) (r int32) +func Ysigemptyset(tls *TLS, set uintptr) (r int32) +func Ysigfillset(tls *TLS, set uintptr) (r int32) +func Ysigisemptyset(tls *TLS, set uintptr) (r int32) +func Ysigismember(tls *TLS, set uintptr, sig int32) (r int32) +func Ysignal(tls *TLS, signum int32, handler uintptr) (r uintptr) +func Ysignalfd(tls *TLS, fd int32, sigs uintptr, flags int32) (r int32) +func Ysignificand(tls *TLS, x float64) (r float64) +func Ysignificandf(tls *TLS, x float32) (r float32) +func Ysigorset(tls *TLS, dest uintptr, left uintptr, right uintptr) (r1 int32) +func Ysigpending(tls *TLS, set uintptr) (r int32) +func Ysigprocmask(tls *TLS, how int32, set uintptr, old uintptr) (r1 int32) +func Ysigqueue(tls *TLS, pid Tpid_t, sig int32, value Tsigval) (r1 int32) +func Ysigsuspend(tls *TLS, mask uintptr) (r int32) +func Ysigtimedwait(tls *TLS, mask uintptr, si uintptr, timeout uintptr) (r int32) +func Ysigwait(tls *TLS, mask uintptr, sig uintptr) (r int32) +func Ysigwaitinfo(tls *TLS, mask uintptr, si uintptr) (r int32) +func Ysin(tls *TLS, x3 float64) (r float64) +func Ysincos(tls *TLS, x3 float64, sin uintptr, cos uintptr) +func Ysincosf(tls *TLS, x3 float32, sin uintptr, cos uintptr) +func Ysincosl(tls *TLS, x float64, sin uintptr, cos uintptr) +func Ysinf(tls *TLS, x3 float32) (r float32) +func Ysinh(tls *TLS, x float64) (r float64) +func Ysinhf(tls *TLS, x float32) (r float32) +func Ysinhl(tls *TLS, x float64) (r float64) +func Ysinl(tls *TLS, x float64) (r float64) +func Ysleep(tls *TLS, seconds uint32) (r uint32) +func Ysnprintf(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, va uintptr) (r int32) +func Ysockatmark(tls *TLS, s int32) (r int32) +func Ysocket(tls *TLS, domain int32, type1 int32, protocol int32) (r1 int32) +func Ysocketpair(tls *TLS, domain int32, type1 int32, protocol int32, fd uintptr) (r2 int32) +func Ysplice(tls *TLS, fd_in int32, off_in uintptr, fd_out int32, off_out uintptr, len1 Tsize_t, flags uint32) (r Tssize_t) +func Ysprintf(tls *TLS, s uintptr, fmt uintptr, va uintptr) (r int32) +func Ysqrt(tls *TLS, x1 float64) (r1 float64) +func Ysqrtf(tls *TLS, x1 float32) (r1 float32) +func Ysqrtl(tls *TLS, x float64) (r float64) +func Ysrand(tls *TLS, s uint32) +func Ysrand48(tls *TLS, seed int64) +func Ysrandom(tls *TLS, seed uint32) +func Ysscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) (r int32) +func Ystat(tls *TLS, path uintptr, buf uintptr) (r int32) +func Ystat64(tls *TLS, path uintptr, buf uintptr) (r int32) +func Ystatvfs(tls *TLS, path uintptr, buf uintptr) (r int32) +func Ystatx(tls *TLS, dirfd int32, path uintptr, flags int32, mask uint32, stx uintptr) (r int32) +func Ystime(tls *TLS, t uintptr) (r int32) +func Ystpcpy(tls *TLS, d uintptr, s uintptr) (r uintptr) +func Ystpncpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +func Ystrcasecmp(tls *TLS, _l uintptr, _r uintptr) (r1 int32) +func Ystrcasecmp_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) +func Ystrcasestr(tls *TLS, h uintptr, n uintptr) (r uintptr) +func Ystrcat(tls *TLS, dest uintptr, src uintptr) (r uintptr) +func Ystrchr(tls *TLS, s uintptr, c int32) (r1 uintptr) +func Ystrchrnul(tls *TLS, s uintptr, c int32) (r uintptr) +func Ystrcmp(tls *TLS, l uintptr, r uintptr) (r1 int32) +func Ystrcoll(tls *TLS, l uintptr, r uintptr) (r1 int32) +func Ystrcoll_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) +func Ystrcpy(tls *TLS, dest uintptr, src uintptr) (r uintptr) +func Ystrcspn(tls *TLS, s uintptr, c uintptr) (r Tsize_t) +func Ystrdup(tls *TLS, s uintptr) (r uintptr) +func Ystrerror(tls *TLS, e int32) (r uintptr) +func Ystrerror_l(tls *TLS, e int32, loc Tlocale_t) (r uintptr) +func Ystrerror_r(tls *TLS, err int32, buf uintptr, buflen Tsize_t) (r int32) +func Ystrfmon(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, va uintptr) (r Tssize_t) +func Ystrfmon_l(tls *TLS, s uintptr, n Tsize_t, loc Tlocale_t, fmt uintptr, va uintptr) (r Tssize_t) +func Ystrftime(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize_t) +func Ystrftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) +func Ystrlcat(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r Tsize_t) +func Ystrlcpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r Tsize_t) +func Ystrlen(tls *TLS, s uintptr) (r Tsize_t) +func Ystrncasecmp(tls *TLS, _l uintptr, _r uintptr, n Tsize_t) (r1 int32) +func Ystrncasecmp_l(tls *TLS, l uintptr, r uintptr, n Tsize_t, loc Tlocale_t) (r1 int32) +func Ystrncat(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +func Ystrncmp(tls *TLS, _l uintptr, _r uintptr, n Tsize_t) (r1 int32) +func Ystrncpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +func Ystrndup(tls *TLS, s uintptr, n Tsize_t) (r uintptr) +func Ystrnlen(tls *TLS, s uintptr, n Tsize_t) (r Tsize_t) +func Ystrpbrk(tls *TLS, s uintptr, b uintptr) (r uintptr) +func Ystrptime(tls *TLS, s uintptr, f uintptr, tm uintptr) (r uintptr) +func Ystrrchr(tls *TLS, s uintptr, c int32) (r uintptr) +func Ystrsep(tls *TLS, str uintptr, sep uintptr) (r uintptr) +func Ystrsignal(tls *TLS, signum int32) (r uintptr) +func Ystrspn(tls *TLS, s uintptr, c uintptr) (r Tsize_t) +func Ystrstr(tls *TLS, h uintptr, n uintptr) (r uintptr) +func Ystrtod(tls *TLS, s uintptr, p uintptr) (r float64) +func Ystrtod_l(tls *TLS, s uintptr, p uintptr, l Tlocale_t) (r float64) +func Ystrtof(tls *TLS, s uintptr, p uintptr) (r float32) +func Ystrtof_l(tls *TLS, s uintptr, p uintptr, l Tlocale_t) (r float32) +func Ystrtoimax(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) +func Ystrtok(tls *TLS, s uintptr, sep uintptr) (r uintptr) +func Ystrtok_r(tls *TLS, s uintptr, sep uintptr, p uintptr) (r uintptr) +func Ystrtol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) +func Ystrtold(tls *TLS, s uintptr, p uintptr) (r float64) +func Ystrtold_l(tls *TLS, s uintptr, p uintptr, l Tlocale_t) (r float64) +func Ystrtoll(tls *TLS, s uintptr, p uintptr, base int32) (r int64) +func Ystrtoul(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) +func Ystrtoull(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) +func Ystrtoumax(tls *TLS, s uintptr, p uintptr, base int32) (r Tuintmax_t) +func Ystrverscmp(tls *TLS, l0 uintptr, r0 uintptr) (r1 int32) +func Ystrxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) +func Ystrxfrm_l(tls *TLS, dest uintptr, src uintptr, n Tsize_t, loc Tlocale_t) (r Tsize_t) +func Yswab(tls *TLS, _src uintptr, _dest uintptr, n Tssize_t) +func Yswapoff(tls *TLS, path uintptr) (r int32) +func Yswapon(tls *TLS, path uintptr, flags int32) (r int32) +func Yswprintf(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, va uintptr) (r int32) +func Yswscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) (r int32) +func Ysymlink(tls *TLS, existing uintptr, new1 uintptr) (r int32) +func Ysymlinkat(tls *TLS, existing uintptr, fd int32, new1 uintptr) (r int32) +func Ysync(tls *TLS) +func Ysync_file_range(tls *TLS, fd int32, pos Toff_t, len1 Toff_t, flags uint32) (r int32) +func Ysyncfs(tls *TLS, fd int32) (r int32) +func Ysyscall(tls *TLS, n int64, va uintptr) (r int64) +func Ysysconf(tls *TLS, name int32) (r int64) +func Ysysctlbyname(t *TLS, name, oldp, oldlenp, newp uintptr, newlen Tsize_t) int32 +func Ysysinfo(tls *TLS, info uintptr) (r int32) +func Ysyslog(tls *TLS, priority int32, message uintptr, va uintptr) +func Ysystem(t *TLS, command uintptr) int32 +func Ytan(tls *TLS, x3 float64) (r float64) +func Ytanf(tls *TLS, x3 float32) (r float32) +func Ytanh(tls *TLS, x3 float64) (r float64) +func Ytanhf(tls *TLS, x3 float32) (r float32) +func Ytanhl(tls *TLS, x float64) (r float64) +func Ytanl(tls *TLS, x float64) (r float64) +func Ytcdrain(tls *TLS, fd int32) (r int32) +func Ytcflow(tls *TLS, fd int32, action int32) (r int32) +func Ytcflush(tls *TLS, fd int32, queue int32) (r int32) +func Ytcgetattr(tls *TLS, fd int32, tio uintptr) (r int32) +func Ytcgetpgrp(tls *TLS, fd int32) (r Tpid_t) +func Ytcgetsid(tls *TLS, fd int32) (r Tpid_t) +func Ytcgetwinsize(tls *TLS, fd int32, wsz uintptr) (r int32) +func Ytcsendbreak(tls *TLS, fd int32, dur int32) (r int32) +func Ytcsetattr(tls *TLS, fd int32, act int32, tio uintptr) (r int32) +func Ytcsetpgrp(tls *TLS, fd int32, pgrp Tpid_t) (r int32) +func Ytcsetwinsize(tls *TLS, fd int32, wsz uintptr) (r int32) +func Ytdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) +func Ytdestroy(tls *TLS, root uintptr, freekey uintptr) +func Ytee(tls *TLS, src int32, dest int32, len1 Tsize_t, flags uint32) (r Tssize_t) +func Ytelldir(tls *TLS, dir uintptr) (r int64) +func Ytempnam(tls *TLS, dir uintptr, pfx uintptr) (r1 uintptr) +func Ytextdomain(tls *TLS, domainname uintptr) (r uintptr) +func Ytfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) +func Ytgamma(tls *TLS, x3 float64) (r1 float64) +func Ytgammaf(tls *TLS, x float32) (r float32) +func Ytgammal(tls *TLS, x float64) (r float64) +func Ytime(tls *TLS, t uintptr) (r Ttime_t) +func Ytimegm(tls *TLS, tm uintptr) (r Ttime_t) +func Ytimer_delete(tls *TLS, t Ttimer_t) (r int32) +func Ytimer_getoverrun(tls *TLS, t Ttimer_t) (r int32) +func Ytimer_gettime(tls *TLS, t Ttimer_t, val uintptr) (r int32) +func Ytimer_settime(tls *TLS, t Ttimer_t, flags int32, val uintptr, old uintptr) (r int32) +func Ytimerfd_create(tls *TLS, clockid int32, flags int32) (r int32) +func Ytimerfd_gettime(tls *TLS, fd int32, cur uintptr) (r int32) +func Ytimerfd_settime(tls *TLS, fd int32, flags int32, new1 uintptr, old uintptr) (r int32) +func Ytimes(tls *TLS, tms uintptr) (r Tclock_t) +func Ytimespec_get(tls *TLS, ts uintptr, base int32) (r int32) +func Ytmpfile(tls *TLS) (r uintptr) +func Ytmpnam(tls *TLS, buf uintptr) (r1 uintptr) +func Ytoascii(tls *TLS, c int32) (r int32) +func Ytolower(tls *TLS, c int32) (r int32) +func Ytolower_l(tls *TLS, c int32, l Tlocale_t) (r int32) +func Ytoupper(tls *TLS, c int32) (r int32) +func Ytoupper_l(tls *TLS, c int32, l Tlocale_t) (r int32) +func Ytowctrans(tls *TLS, wc Twint_t, trans Twctrans_t) (r Twint_t) +func Ytowctrans_l(tls *TLS, c Twint_t, t Twctrans_t, l Tlocale_t) (r Twint_t) +func Ytowlower(tls *TLS, wc Twint_t) (r Twint_t) +func Ytowlower_l(tls *TLS, c Twint_t, l Tlocale_t) (r Twint_t) +func Ytowupper(tls *TLS, wc Twint_t) (r Twint_t) +func Ytowupper_l(tls *TLS, c Twint_t, l Tlocale_t) (r Twint_t) +func Ytrunc(tls *TLS, x3 float64) (r float64) +func Ytruncate(tls *TLS, path uintptr, length Toff_t) (r int32) +func Ytruncf(tls *TLS, x3 float32) (r float32) +func Ytruncl(tls *TLS, x float64) (r float64) +func Ytsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) +func Yttyname(tls *TLS, fd int32) (r uintptr) +func Yttyname_r(tls *TLS, fd int32, name uintptr, size Tsize_t) (r int32) +func Ytwalk(tls *TLS, root uintptr, action uintptr) +func Ytzset(tls *TLS) +func Yualarm(tls *TLS, value uint32, interval uint32) (r uint32) +func Yulckpwdf(tls *TLS) (r int32) +func Yulimit(tls *TLS, cmd int32, va uintptr) (r int64) +func Yumask(tls *TLS, mode Tmode_t) (r Tmode_t) +func Yumount(tls *TLS, special uintptr) (r int32) +func Yumount2(tls *TLS, special uintptr, flags int32) (r int32) +func Yuname(tls *TLS, uts uintptr) (r int32) +func Yungetc(tls *TLS, c int32, f uintptr) (r int32) +func Yungetwc(tls *TLS, c Twint_t, f uintptr) (r Twint_t) +func Yunlink(tls *TLS, path uintptr) (r int32) +func Yunlinkat(tls *TLS, fd int32, path uintptr, flag int32) (r int32) +func Yunlockpt(tls *TLS, fd int32) (r int32) +func Yunsetenv(tls *TLS, name uintptr) (r int32) +func Yunshare(tls *TLS, flags int32) (r int32) +func Yupdwtmp(tls *TLS, f uintptr, u uintptr) +func Yupdwtmpx(tls *TLS, f uintptr, u uintptr) +func Yuselocale(tls *TLS, new1 Tlocale_t) (r Tlocale_t) +func Yusleep(tls *TLS, useconds uint32) (r int32) +func Yutime(tls *TLS, path uintptr, times uintptr) (r int32) +func Yutimensat(tls *TLS, fd int32, path uintptr, times uintptr, flags int32) (r1 int32) +func Yutimes(tls *TLS, path uintptr, times uintptr) (r int32) +func Yuuid_copy(t *TLS, dst, src uintptr) +func Yuuid_generate_random(t *TLS, out uintptr) +func Yuuid_parse(t *TLS, in uintptr, uu uintptr) int32 +func Yuuid_unparse(t *TLS, uu, out uintptr) +func Yvasprintf(tls *TLS, s uintptr, fmt uintptr, ap Tva_list) (r int32) +func Yvdprintf(tls *TLS, fd int32, fmt uintptr, ap Tva_list) (r int32) +func Yverr(tls *TLS, status int32, fmt uintptr, ap Tva_list) +func Yverrx(tls *TLS, status int32, fmt uintptr, ap Tva_list) +func Yversionsort(tls *TLS, a uintptr, b uintptr) (r int32) +func Yvfork(tls *TLS) (r Tpid_t) +func Yvfprintf(tls *TLS, f uintptr, fmt uintptr, ap Tva_list) (r int32) +func Yvfscanf(tls *TLS, f uintptr, fmt uintptr, ap Tva_list) (r int32) +func Yvfwprintf(tls *TLS, f uintptr, fmt uintptr, ap Tva_list) (r int32) +func Yvfwscanf(tls *TLS, f uintptr, fmt uintptr, ap Tva_list) (r int32) +func Yvhangup(tls *TLS) (r int32) +func Yvmsplice(tls *TLS, fd int32, iov uintptr, cnt Tsize_t, flags uint32) (r Tssize_t) +func Yvprintf(tls *TLS, fmt uintptr, ap Tva_list) (r int32) +func Yvscanf(tls *TLS, fmt uintptr, ap Tva_list) (r int32) +func Yvsnprintf(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, ap Tva_list) (r int32) +func Yvsprintf(tls *TLS, s uintptr, fmt uintptr, ap Tva_list) (r int32) +func Yvsscanf(tls *TLS, s uintptr, fmt uintptr, ap Tva_list) (r int32) +func Yvswprintf(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, ap Tva_list) (r1 int32) +func Yvswscanf(tls *TLS, s uintptr, fmt uintptr, ap Tva_list) (r int32) +func Yvwarn(tls *TLS, fmt uintptr, ap Tva_list) +func Yvwarnx(tls *TLS, fmt uintptr, ap Tva_list) +func Yvwprintf(tls *TLS, fmt uintptr, ap Tva_list) (r int32) +func Yvwscanf(tls *TLS, fmt uintptr, ap Tva_list) (r int32) +func Ywait(tls *TLS, status uintptr) (r Tpid_t) +func Ywait3(tls *TLS, status uintptr, options int32, usage uintptr) (r Tpid_t) +func Ywait4(tls *TLS, pid Tpid_t, status uintptr, options int32, ru uintptr) (r1 Tpid_t) +func Ywaitid(tls *TLS, type1 Tidtype_t, id Tid_t, info uintptr, options int32) (r int32) +func Ywaitpid(tls *TLS, pid Tpid_t, status uintptr, options int32) (r Tpid_t) +func Ywarn(tls *TLS, fmt uintptr, va uintptr) +func Ywarnx(tls *TLS, fmt uintptr, va uintptr) +func Ywcpcpy(tls *TLS, d uintptr, s uintptr) (r uintptr) +func Ywcpncpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +func Ywcrtomb(tls *TLS, s uintptr, wc Twchar_t, st uintptr) (r Tsize_t) +func Ywcscasecmp(tls *TLS, l uintptr, r uintptr) (r1 int32) +func Ywcscasecmp_l(tls *TLS, l uintptr, r uintptr, locale Tlocale_t) (r1 int32) +func Ywcscat(tls *TLS, dest uintptr, src uintptr) (r uintptr) +func Ywcschr(tls *TLS, s uintptr, c Twchar_t) (r uintptr) +func Ywcscmp(tls *TLS, l uintptr, r uintptr) (r1 int32) +func Ywcscoll(tls *TLS, l uintptr, r uintptr) (r1 int32) +func Ywcscoll_l(tls *TLS, l uintptr, r uintptr, locale Tlocale_t) (r1 int32) +func Ywcscpy(tls *TLS, d uintptr, s uintptr) (r uintptr) +func Ywcscspn(tls *TLS, s uintptr, c uintptr) (r Tsize_t) +func Ywcsdup(tls *TLS, s uintptr) (r uintptr) +func Ywcsftime(tls *TLS, wcs uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize_t) +func Ywcsftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) +func Ywcslen(tls *TLS, s uintptr) (r Tsize_t) +func Ywcsncasecmp(tls *TLS, l uintptr, r uintptr, n Tsize_t) (r1 int32) +func Ywcsncasecmp_l(tls *TLS, l uintptr, r uintptr, n Tsize_t, locale Tlocale_t) (r1 int32) +func Ywcsncat(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +func Ywcsncmp(tls *TLS, l uintptr, r uintptr, n Tsize_t) (r1 int32) +func Ywcsncpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +func Ywcsnlen(tls *TLS, s uintptr, n Tsize_t) (r Tsize_t) +func Ywcsnrtombs(tls *TLS, dst uintptr, wcs uintptr, wn Tsize_t, n Tsize_t, st uintptr) (r Tsize_t) +func Ywcspbrk(tls *TLS, s uintptr, b uintptr) (r uintptr) +func Ywcsrchr(tls *TLS, s uintptr, c Twchar_t) (r uintptr) +func Ywcsrtombs(tls *TLS, s uintptr, ws uintptr, n Tsize_t, st uintptr) (r Tsize_t) +func Ywcsspn(tls *TLS, s uintptr, c uintptr) (r Tsize_t) +func Ywcsstr(tls *TLS, h uintptr, n uintptr) (r uintptr) +func Ywcstod(tls *TLS, s uintptr, p uintptr) (r float64) +func Ywcstof(tls *TLS, s uintptr, p uintptr) (r float32) +func Ywcstoimax(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) +func Ywcstok(tls *TLS, s uintptr, sep uintptr, p uintptr) (r uintptr) +func Ywcstol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) +func Ywcstold(tls *TLS, s uintptr, p uintptr) (r float64) +func Ywcstoll(tls *TLS, s uintptr, p uintptr, base int32) (r int64) +func Ywcstombs(tls *TLS, s uintptr, ws uintptr, n Tsize_t) (r Tsize_t) +func Ywcstoul(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) +func Ywcstoull(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) +func Ywcstoumax(tls *TLS, s uintptr, p uintptr, base int32) (r Tuintmax_t) +func Ywcswcs(tls *TLS, haystack uintptr, needle uintptr) (r uintptr) +func Ywcswidth(tls *TLS, wcs uintptr, n Tsize_t) (r int32) +func Ywcsxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) +func Ywcsxfrm_l(tls *TLS, dest uintptr, src uintptr, n Tsize_t, loc Tlocale_t) (r Tsize_t) +func Ywctob(tls *TLS, c Twint_t) (r int32) +func Ywctomb(tls *TLS, s uintptr, wc Twchar_t) (r int32) +func Ywctrans(tls *TLS, class uintptr) (r Twctrans_t) +func Ywctrans_l(tls *TLS, s uintptr, l Tlocale_t) (r Twctrans_t) +func Ywctype(tls *TLS, s uintptr) (r Twctype_t) +func Ywctype_l(tls *TLS, s uintptr, l Tlocale_t) (r Twctype_t) +func Ywcwidth(tls *TLS, wc Twchar_t) (r int32) +func Ywmemchr(tls *TLS, s uintptr, c Twchar_t, n Tsize_t) (r uintptr) +func Ywmemcmp(tls *TLS, l uintptr, r uintptr, n Tsize_t) (r1 int32) +func Ywmemcpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +func Ywmemmove(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +func Ywmemset(tls *TLS, d uintptr, c Twchar_t, n Tsize_t) (r uintptr) +func Ywprintf(tls *TLS, fmt uintptr, va uintptr) (r int32) +func Ywrite(tls *TLS, fd int32, buf uintptr, count Tsize_t) (r Tssize_t) +func Ywritev(tls *TLS, fd int32, iov uintptr, count int32) (r Tssize_t) +func Ywscanf(tls *TLS, fmt uintptr, va uintptr) (r int32) +func Yy0(tls *TLS, x float64) (r float64) +func Yy0f(tls *TLS, x float32) (r float32) +func Yy1(tls *TLS, x float64) (r float64) +func Yy1f(tls *TLS, x float32) (r float32) +func Yyn(tls *TLS, n int32, x float64) (r float64) +func Yynf(tls *TLS, n int32, x float32) (r float32) diff --git a/vendor/modernc.org/libc/asm_linux_amd64.s b/vendor/modernc.org/libc/asm_linux_amd64.s new file mode 100644 index 0000000..25927f6 --- /dev/null +++ b/vendor/modernc.org/libc/asm_linux_amd64.s @@ -0,0 +1,17055 @@ +// Code generated for linux/amd64 by 'genasm', DO NOT EDIT. + +#include "textflag.h" + +// func Ya64l(tls *TLS, s uintptr) (r int64) +TEXT ·Ya64l(SB),$24-24 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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) uintptr +TEXT ·Yalloca(SB),$24-24 + 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, ret+16(FP) + RET + +// func Yalphasort(tls *TLS, a uintptr, b uintptr) (r int32) +TEXT ·Yalphasort(SB),$32-28 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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, func1 uintptr) (r1 int32) +TEXT ·Yat_quick_exit(SB),$24-20 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ func1+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xat_quick_exit(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yatan(tls *TLS, x3 float64) (r float64) +TEXT ·Yatan(SB),$24-24 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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) int32 +TEXT ·Ybacktrace(SB),$32-28 + 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, ret+24(FP) + RET + +// func Ybacktrace_symbols_fd(t *TLS, buffer uintptr, size, fd int32) +TEXT ·Ybacktrace_symbols_fd(SB),$24-24 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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, cmp uintptr) (r uintptr) +TEXT ·Ybsearch(SB),$56-56 + 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 cmp+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xbsearch(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Ybtowc(tls *TLS, c int32) (r Twint_t) +TEXT ·Ybtowc(SB),$24-20 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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) int32 +TEXT ·Ydlclose(SB),$24-20 + 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, ret+16(FP) + RET + +// func Ydlerror(t *TLS) uintptr +TEXT ·Ydlerror(SB),$16-16 + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xdlerror(SB) + MOVQ 8(SP), AX + MOVQ AX, ret+8(FP) + RET + +// func Ydlopen(t *TLS, filename uintptr, flags int32) uintptr +TEXT ·Ydlopen(SB),$32-32 + 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, ret+24(FP) + RET + +// func Ydlsym(t *TLS, handle, symbol uintptr) uintptr +TEXT ·Ydlsym(SB),$32-32 + 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, ret+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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendgrent(SB) + RET + +// func Yendhostent(tls *TLS) +TEXT ·Yendhostent(SB),$8-8 + 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 + 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 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendnetent(SB) + RET + +// func Yendprotoent(tls *TLS) +TEXT ·Yendprotoent(SB),$8-8 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendprotoent(SB) + RET + +// func Yendpwent(tls *TLS) +TEXT ·Yendpwent(SB),$8-8 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendpwent(SB) + RET + +// func Yendservent(tls *TLS) +TEXT ·Yendservent(SB),$8-8 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendservent(SB) + RET + +// func Yendspent(tls *TLS) +TEXT ·Yendspent(SB),$8-8 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendspent(SB) + RET + +// func Yendusershell(tls *TLS) +TEXT ·Yendusershell(SB),$8-8 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendusershell(SB) + RET + +// func Yendutent(tls *TLS) +TEXT ·Yendutent(SB),$8-8 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendutent(SB) + RET + +// func Yendutxent(tls *TLS) +TEXT ·Yendutxent(SB),$8-8 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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) int32 +TEXT ·Yfork(SB),$16-12 + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xfork(SB) + MOVL 8(SP), AX + MOVL AX, ret+8(FP) + RET + +// func Yfpathconf(tls *TLS, fd int32, name int32) (r int64) +TEXT ·Yfpathconf(SB),$24-24 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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) int32 +TEXT ·Yfts64_close(SB),$24-20 + 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, ret+16(FP) + RET + +// func Yfts64_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr +TEXT ·Yfts64_open(SB),$40-40 + 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, ret+32(FP) + RET + +// func Yfts64_read(t *TLS, ftsp uintptr) uintptr +TEXT ·Yfts64_read(SB),$24-24 + 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, ret+16(FP) + RET + +// func Yfts_close(t *TLS, ftsp uintptr) int32 +TEXT ·Yfts_close(SB),$24-20 + 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, ret+16(FP) + RET + +// func Yfts_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr +TEXT ·Yfts_open(SB),$40-40 + 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, ret+32(FP) + RET + +// func Yfts_read(t *TLS, ftsp uintptr) uintptr +TEXT ·Yfts_read(SB),$24-24 + 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, ret+16(FP) + RET + +// func Yftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32) (r int32) +TEXT ·Yftw(SB),$40-36 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fn+16(FP), AX + 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) + RET + +// func Yfunlockfile(tls *TLS, f uintptr) +TEXT ·Yfunlockfile(SB),$16-16 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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, errfunc uintptr, g_ uintptr) (r int32) +TEXT ·Yglob(SB),$48-44 + 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 errfunc+24(FP), AX + 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) + RET + +// func Yglobfree(tls *TLS, g_ uintptr) +TEXT ·Yglobfree(SB),$16-16 + 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 + 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 + 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 + 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 + 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 + 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 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xhdestroy(SB) + RET + +// func Yherror(tls *TLS, msg uintptr) +TEXT ·Yherror(SB),$16-16 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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) int32 +TEXT ·Yinitstate_r(SB),$48-44 + 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, ret+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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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) int32 +TEXT ·Yisnan(SB),$24-20 + 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, ret+16(FP) + RET + +// func Yisnanf(t *TLS, arg float32) int32 +TEXT ·Yisnanf(SB),$24-20 + 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, ret+16(FP) + RET + +// func Yisnanl(t *TLS, arg float64) int32 +TEXT ·Yisnanl(SB),$24-20 + 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, ret+16(FP) + RET + +// func Yisprint(tls *TLS, c int32) (r int32) +TEXT ·Yisprint(SB),$24-20 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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, compar uintptr) (r uintptr) +TEXT ·Ylfind(SB),$56-56 + 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 compar+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xlfind(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Ylgamma(tls *TLS, x float64) (r float64) +TEXT ·Ylgamma(SB),$24-24 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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, compar uintptr) (r uintptr) +TEXT ·Ylsearch(SB),$56-56 + 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 compar+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xlsearch(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Ylseek(tls *TLS, fd int32, offset Toff_t, whence int32) (r Toff_t) +TEXT ·Ylseek(SB),$40-40 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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, fn uintptr, fd_limit int32, flags int32) (r1 int32) +TEXT ·Ynftw(SB),$40-36 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fn+16(FP), AX + 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) + RET + +// func Yngettext(tls *TLS, msgid1 uintptr, msgid2 uintptr, n uint64) (r uintptr) +TEXT ·Yngettext(SB),$40-40 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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) int32 +TEXT ·Yobstack_vprintf(SB),$40-36 + 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, ret+32(FP) + RET + +// func Yopen(tls *TLS, filename uintptr, flags int32, va uintptr) (r int32) +TEXT ·Yopen(SB),$40-36 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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) uintptr +TEXT ·Ypopen(SB),$32-32 + 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, ret+24(FP) + RET + +// func Yposix_close(tls *TLS, fd int32, flags int32) (r int32) +TEXT ·Yposix_close(SB),$24-20 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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) int32 +TEXT ·Ypthread_atfork(SB),$40-36 + 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, ret+32(FP) + RET + +// func Ypthread_attr_destroy(tls *TLS, a uintptr) int32 +TEXT ·Ypthread_attr_destroy(SB),$24-20 + 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, ret+16(FP) + RET + +// func Ypthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 +TEXT ·Ypthread_attr_getdetachstate(SB),$32-28 + 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, ret+24(FP) + RET + +// func Ypthread_attr_init(tls *TLS, a uintptr) int32 +TEXT ·Ypthread_attr_init(SB),$24-20 + 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, ret+16(FP) + RET + +// func Ypthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) (r int32) +TEXT ·Ypthread_attr_setdetachstate(SB),$32-28 + 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) int32 +TEXT ·Ypthread_attr_setscope(SB),$32-28 + 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, ret+24(FP) + RET + +// func Ypthread_attr_setstacksize(tls *TLS, a uintptr, stacksite Tsize_t) int32 +TEXT ·Ypthread_attr_setstacksize(SB),$32-28 + 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, ret+24(FP) + RET + +// func Ypthread_cleanup_pop(tls *TLS, run int32) +TEXT ·Ypthread_cleanup_pop(SB),$16-12 + 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 + 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) int32 +TEXT ·Ypthread_cond_broadcast(SB),$24-20 + 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, ret+16(FP) + RET + +// func Ypthread_cond_destroy(tls *TLS, c uintptr) int32 +TEXT ·Ypthread_cond_destroy(SB),$24-20 + 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, ret+16(FP) + RET + +// func Ypthread_cond_init(tls *TLS, c, a uintptr) int32 +TEXT ·Ypthread_cond_init(SB),$32-28 + 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, ret+24(FP) + RET + +// func Ypthread_cond_signal(tls *TLS, c uintptr) int32 +TEXT ·Ypthread_cond_signal(SB),$24-20 + 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, ret+16(FP) + RET + +// func Ypthread_cond_timedwait(tls *TLS, c, m, ts uintptr) (r int32) +TEXT ·Ypthread_cond_timedwait(SB),$40-36 + 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) int32 +TEXT ·Ypthread_cond_wait(SB),$32-28 + 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, ret+24(FP) + RET + +// func Ypthread_create(tls *TLS, res, attrp, entry, arg uintptr) int32 +TEXT ·Ypthread_create(SB),$48-44 + 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, ret+40(FP) + RET + +// func Ypthread_detach(tls *TLS, t uintptr) int32 +TEXT ·Ypthread_detach(SB),$24-20 + 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, ret+16(FP) + RET + +// func Ypthread_equal(tls *TLS, t, u uintptr) int32 +TEXT ·Ypthread_equal(SB),$32-28 + 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, ret+24(FP) + RET + +// func Ypthread_exit(tls *TLS, result uintptr) +TEXT ·Ypthread_exit(SB),$16-16 + 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) uintptr +TEXT ·Ypthread_getspecific(SB),$24-24 + 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, ret+16(FP) + RET + +// func Ypthread_join(tls *TLS, t Tpthread_t, res uintptr) (r int32) +TEXT ·Ypthread_join(SB),$32-28 + 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) int32 +TEXT ·Ypthread_key_create(SB),$32-28 + 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, ret+24(FP) + RET + +// func Ypthread_key_delete(tls *TLS, k Tpthread_key_t) int32 +TEXT ·Ypthread_key_delete(SB),$24-20 + 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, ret+16(FP) + RET + +// func Ypthread_mutex_destroy(tls *TLS, m uintptr) int32 +TEXT ·Ypthread_mutex_destroy(SB),$24-20 + 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, ret+16(FP) + RET + +// func Ypthread_mutex_init(tls *TLS, m, a uintptr) int32 +TEXT ·Ypthread_mutex_init(SB),$32-28 + 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, ret+24(FP) + RET + +// func Ypthread_mutex_lock(tls *TLS, m uintptr) int32 +TEXT ·Ypthread_mutex_lock(SB),$24-20 + 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, ret+16(FP) + RET + +// func Ypthread_mutex_trylock(tls *TLS, m uintptr) int32 +TEXT ·Ypthread_mutex_trylock(SB),$24-20 + 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, ret+16(FP) + RET + +// func Ypthread_mutex_unlock(tls *TLS, m uintptr) int32 +TEXT ·Ypthread_mutex_unlock(SB),$24-20 + 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, ret+16(FP) + RET + +// func Ypthread_mutexattr_destroy(tls *TLS, a uintptr) int32 +TEXT ·Ypthread_mutexattr_destroy(SB),$24-20 + 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, ret+16(FP) + RET + +// func Ypthread_mutexattr_init(tls *TLS, a uintptr) int32 +TEXT ·Ypthread_mutexattr_init(SB),$24-20 + 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, ret+16(FP) + RET + +// func Ypthread_mutexattr_settype(tls *TLS, a uintptr, typ int32) int32 +TEXT ·Ypthread_mutexattr_settype(SB),$32-28 + 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, ret+24(FP) + RET + +// func Ypthread_self(tls *TLS) uintptr +TEXT ·Ypthread_self(SB),$16-16 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xpthread_self(SB) + MOVQ 8(SP), AX + MOVQ AX, ret+8(FP) + RET + +// func Ypthread_setcancelstate(tls *TLS, new int32, old uintptr) int32 +TEXT ·Ypthread_setcancelstate(SB),$32-28 + 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, ret+24(FP) + RET + +// func Ypthread_setspecific(tls *TLS, k Tpthread_key_t, x uintptr) int32 +TEXT ·Ypthread_setspecific(SB),$32-28 + 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, ret+24(FP) + RET + +// func Ypthread_sigmask(tls *TLS, now int32, set, old uintptr) int32 +TEXT ·Ypthread_sigmask(SB),$40-36 + 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, ret+32(FP) + RET + +// func Yptrace(tls *TLS, req int32, va uintptr) (r int64) +TEXT ·Yptrace(SB),$32-32 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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, cmp Tcmpfun) +TEXT ·Yqsort(SB),$40-40 + 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 cmp+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xqsort(SB) + RET + +// func Yqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) +TEXT ·Yqsort_r(SB),$48-48 + 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 cmp+32(FP), AX + MOVQ AX, 32(SP) + MOVQ arg+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xqsort_r(SB) + RET + +// func Yquick_exit(tls *TLS, code int32) +TEXT ·Yquick_exit(SB),$16-12 + 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 + 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 + 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 + 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 + 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 + 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) int32 +TEXT ·Yrandom_r(SB),$32-28 + 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, ret+24(FP) + RET + +// func Yread(tls *TLS, fd int32, buf uintptr, count Tsize_t) (r Tssize_t) +TEXT ·Yread(SB),$40-40 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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) int32 +TEXT ·Yrenameat2(SB),$56-52 + 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, ret+48(FP) + RET + +// func Yres_init(tls *TLS) (r int32) +TEXT ·Yres_init(SB),$16-12 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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, sel uintptr, cmp uintptr) (r int32) +TEXT ·Yscandir(SB),$48-44 + 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 sel+24(FP), AX + MOVQ AX, 24(SP) + MOVQ cmp+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xscandir(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Yscanf(tls *TLS, fmt uintptr, va uintptr) (r int32) +TEXT ·Yscanf(SB),$32-28 + 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) int32 +TEXT ·Ysched_yield(SB),$16-12 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xsched_yield(SB) + MOVL 8(SP), AX + MOVL AX, ret+8(FP) + RET + +// func Ysecure_getenv(tls *TLS, name uintptr) (r uintptr) +TEXT ·Ysecure_getenv(SB),$24-24 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xsetgrent(SB) + RET + +// func Ysethostent(tls *TLS, x int32) +TEXT ·Ysethostent(SB),$16-12 + 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 + 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 + 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) int32 +TEXT ·Ysetjmp(SB),$24-20 + 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, ret+16(FP) + RET + +// func Ysetkey(tls *TLS, key uintptr) +TEXT ·Ysetkey(SB),$16-16 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xsetusershell(SB) + RET + +// func Ysetutent(tls *TLS) +TEXT ·Ysetutent(SB),$8-8 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xsetutent(SB) + RET + +// func Ysetutxent(tls *TLS) +TEXT ·Ysetutxent(SB),$8-8 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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) int32 +TEXT ·Ysysctlbyname(SB),$56-52 + 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, ret+48(FP) + RET + +// func Ysysinfo(tls *TLS, info uintptr) (r int32) +TEXT ·Ysysinfo(SB),$24-20 + 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 + 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) int32 +TEXT ·Ysystem(SB),$24-20 + 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, ret+16(FP) + RET + +// func Ytan(tls *TLS, x3 float64) (r float64) +TEXT ·Ytan(SB),$24-24 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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, cmp uintptr) (r uintptr) +TEXT ·Ytdelete(SB),$40-40 + 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 cmp+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xtdelete(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ytdestroy(tls *TLS, root uintptr, freekey uintptr) +TEXT ·Ytdestroy(SB),$24-24 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ root+8(FP), AX + MOVQ AX, 8(SP) + MOVQ freekey+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xtdestroy(SB) + RET + +// func Ytee(tls *TLS, src int32, dest int32, len1 Tsize_t, flags uint32) (r Tssize_t) +TEXT ·Ytee(SB),$40-40 + 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 + 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 + 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 + 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, cmp uintptr) (r uintptr) +TEXT ·Ytfind(SB),$40-40 + 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 cmp+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xtfind(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ytgamma(tls *TLS, x3 float64) (r1 float64) +TEXT ·Ytgamma(SB),$24-24 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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, cmp uintptr) (r1 uintptr) +TEXT ·Ytsearch(SB),$40-40 + 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 cmp+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xtsearch(SB) + MOVQ 32(SP), AX + MOVQ AX, r1+32(FP) + RET + +// func Yttyname(tls *TLS, fd int32) (r uintptr) +TEXT ·Yttyname(SB),$24-24 + 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 + 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, action uintptr) +TEXT ·Ytwalk(SB),$24-24 + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ root+8(FP), AX + MOVQ AX, 8(SP) + MOVQ action+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xtwalk(SB) + RET + +// func Ytzset(tls *TLS) +TEXT ·Ytzset(SB),$8-8 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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) int32 +TEXT ·Yuuid_parse(SB),$32-28 + 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, ret+24(FP) + RET + +// func Yuuid_unparse(t *TLS, uu, out uintptr) +TEXT ·Yuuid_unparse(SB),$24-24 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 f0b66aa..dede3ce 100644 --- a/vendor/modernc.org/libc/build_all_targets.sh +++ b/vendor/modernc.org/libc/build_all_targets.sh @@ -8,15 +8,18 @@ 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 + #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 +35,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/etc.go b/vendor/modernc.org/libc/etc.go index 2d76cc4..db01023 100644 --- a/vendor/modernc.org/libc/etc.go +++ b/vendor/modernc.org/libc/etc.go @@ -237,6 +237,7 @@ func (t *TLS) Close() { // t.Free(11) // t.Free(22) func (t *TLS) Alloc(n int) (r uintptr) { + t.sp++ if memgrind { if atomic.SwapInt32(&t.reentryGuard, 1) != 0 { panic(todo("concurrent use of TLS instance %p", t)) @@ -321,6 +322,7 @@ const stackFrameKeepalive = 2 // Free deallocates n bytes of thread-local storage. See TLS.Alloc for details // on correct usage. func (t *TLS) Free(n int) { + t.sp-- if memgrind { if atomic.SwapInt32(&t.reentryGuard, 1) != 0 { panic(todo("concurrent use of TLS instance %p", t)) diff --git a/vendor/modernc.org/libc/libc.go b/vendor/modernc.org/libc/libc.go index d198722..dab50eb 100644 --- a/vendor/modernc.org/libc/libc.go +++ b/vendor/modernc.org/libc/libc.go @@ -1950,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)) } @@ -1967,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); @@ -2312,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. @@ -2648,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_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..0da77b0 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 } @@ -1563,12 +1605,167 @@ func fcntlCmdStr(cmd int32) string { } } -// int setenv(const char *name, const char *value, int overwrite); -func Xsetenv(t *TLS, name, value uintptr, overwrite int32) int32 { +func X__strchrnul(tls *TLS, s uintptr, c int32) uintptr { /* strchrnul.c:10:6: */ if __ccgo_strace { - trc("t=%v value=%v overwrite=%v, (%v:)", t, value, overwrite, origin(2)) + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) } - panic(todo("")) + 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(tls *TLS, var1 uintptr, value uintptr, overwrite int32) int32 { /* setenv.c:26:5: */ + if __ccgo_strace { + trc("tls=%v var1=%v value=%v overwrite=%v, (%v:)", tls, var1, value, overwrite, origin(2)) + } + 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 +2233,238 @@ __3: ; return Xtolower(tls, int32(*(*uint8)(unsafe.Pointer(l)))) - Xtolower(tls, int32(*(*uint8)(unsafe.Pointer(r)))) } + +func X__isfinite(tls *TLS, d float64) int32 { + if !math.IsInf(d, 0) && !math.IsNaN(d) { + return 1 + } + + return 0 +} + +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..79f80c9 100644 --- a/vendor/modernc.org/libc/libc_illumos.go +++ b/vendor/modernc.org/libc/libc_illumos.go @@ -2094,3 +2094,11 @@ 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("")) +} diff --git a/vendor/modernc.org/libc/libc_musl.go b/vendor/modernc.org/libc/libc_musl.go index 530df51..fc58b07 100644 --- a/vendor/modernc.org/libc/libc_musl.go +++ b/vendor/modernc.org/libc/libc_musl.go @@ -296,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..5328252 100644 --- a/vendor/modernc.org/libc/libc_unix.go +++ b/vendor/modernc.org/libc/libc_unix.go @@ -1386,3 +1386,19 @@ func x___secs_to_tm(tls *TLS, t int64, tm uintptr) (r int32) { (*ctime.Tm)(unsafe.Pointer(tm)).Ftm_sec = remsecs % int32(60) return 0 } + +// 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 +} 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("")) - // } + if tv == 0 { + return 0 + } - // var tvs unix.Timeval - // err := unix.Gettimeofday(&tvs) - // if err != nil { - // t.setErrno(err) - // return -1 - // } - - // *(*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: - return x - case x >= 0: - return math.Floor(x + 0.5) - default: - return math.Ceil(x - 0.5) + 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 + } + 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 df852c2..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 diff --git a/vendor/modernc.org/libc/mem_brk.go b/vendor/modernc.org/libc/mem_brk.go index eb2032d..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) } diff --git a/vendor/modernc.org/libc/memgrind.go b/vendor/modernc.org/libc/memgrind.go index ccf5d8a..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,10 @@ 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 diff --git a/vendor/modernc.org/libc/memgrind_musl.go b/vendor/modernc.org/libc/memgrind_musl.go index 1dc25ef..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) // } 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/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/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__c11_atomic_exchangeInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) { + return atomic.SwapInt32((*int32)(unsafe.Pointer(ptr)), val) +} + func X__atomic_exchangeInt32(t *TLS, ptr, val, ret uintptr, _ int32) { - int32Mu.Lock() + *(*int32)(unsafe.Pointer(ret)) = atomic.SwapInt32((*int32)(unsafe.Pointer(ptr)), *(*int32)(unsafe.Pointer(val))) +} - defer int32Mu.Unlock() - - *(*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() + *(*uint32)(unsafe.Pointer(ret)) = atomic.SwapUint32((*uint32)(unsafe.Pointer(ptr)), *(*uint32)(unsafe.Pointer(val))) +} - defer int32Mu.Unlock() - - *(*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() + *(*int64)(unsafe.Pointer(ret)) = atomic.SwapInt64((*int64)(unsafe.Pointer(ptr)), *(*int64)(unsafe.Pointer(val))) +} - defer int64Mu.Unlock() - - *(*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__c11_atomic_loadInt32(t *TLS, ptr uintptr, memorder int32) (r int32) { + return atomic.LoadInt32((*int32)(unsafe.Pointer(ptr))) +} + func X__atomic_loadInt32(t *TLS, ptr, ret uintptr, memorder int32) { - int32Mu.Lock() + *(*int32)(unsafe.Pointer(ret)) = atomic.LoadInt32((*int32)(unsafe.Pointer(ptr))) +} - defer int32Mu.Unlock() - - *(*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__c11_atomic_loadInt64(t *TLS, ptr uintptr, memorder int32) (r int64) { + return atomic.LoadInt64((*int64)(unsafe.Pointer(ptr))) +} + func X__atomic_loadInt64(t *TLS, ptr, ret uintptr, memorder int32) { - int64Mu.Lock() + *(*int64)(unsafe.Pointer(ret)) = atomic.LoadInt64((*int64)(unsafe.Pointer(ptr))) +} - defer int64Mu.Unlock() - - *(*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__c11_atomic_storeInt32(t *TLS, ptr uintptr, val int32, memorder int32) { + atomic.StoreInt32((*int32)(unsafe.Pointer(ptr)), val) +} + func X__atomic_storeInt32(t *TLS, ptr, val uintptr, memorder int32) { - int32Mu.Lock() + atomic.StoreInt32((*int32)(unsafe.Pointer(ptr)), *(*int32)(unsafe.Pointer(val))) +} - defer int32Mu.Unlock() - - *(*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) { - int64Mu.Lock() + atomic.StoreInt64((*int64)(unsafe.Pointer(ptr)), *(*int64)(unsafe.Pointer(val))) +} - defer int64Mu.Unlock() - - *(*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() + + if r = *(*int64)(unsafe.Pointer(ptr)); r == oldval { + *(*int64)(unsafe.Pointer(ptr)) = newval + } + + return r +} + +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..4d0ce4e --- /dev/null +++ b/vendor/modernc.org/libc/tls_linux_amd64.go @@ -0,0 +1,16 @@ +// 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" + +func TLSAlloc(p0 *TLS, p1 int) uintptr +func TLSFree(p0 *TLS, p1 int) + +func tlsAlloc(tls *TLS, n int) uintptr { + return tls.Alloc(n) +} + +func tlsFree(tls *TLS, n int) { + tls.Free(n) +} 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..490eafa --- /dev/null +++ b/vendor/modernc.org/libc/tls_linux_amd64.s @@ -0,0 +1,21 @@ +// Code generated for linux/amd64 by 'genasm []', DO NOT EDIT. + +#include "textflag.h" + +TEXT ·TLSAlloc(SB),$24-24 + 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 + MOVQ p0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ p1+8(FP), AX + MOVQ AX, 8(SP) + CALL ·tlsFree(SB) + RET diff --git a/vendor/modernc.org/memory/memory.go b/vendor/modernc.org/memory/memory.go index e25acda..6593c42 100644 --- a/vendor/modernc.org/memory/memory.go +++ b/vendor/modernc.org/memory/memory.go @@ -109,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 diff --git a/vendor/modernc.org/memory/mmap_unix.go b/vendor/modernc.org/memory/mmap_unix.go index 86324b4..8ee9915 100644 --- a/vendor/modernc.org/memory/mmap_unix.go +++ b/vendor/modernc.org/memory/mmap_unix.go @@ -28,21 +28,23 @@ func unmap(addr uintptr, size int) error { // pageSize aligned. func mmap(size int) (uintptr, int, error) { size = roundup(size, osPageSize) - up, err := unix.MmapPtr(-1, 0, nil, uintptr(size+pageSize), unix.PROT_READ|unix.PROT_WRITE, unix.MAP_PRIVATE|unix.MAP_ANON) + // 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 } p := uintptr(up) - n := size + pageSize 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 } @@ -54,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/sqlite/Makefile b/vendor/modernc.org/sqlite/Makefile index a72da1c..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 @@ -59,7 +59,6 @@ edit: @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 ./... cd vendor_libsqlite3 && go build -o /dev/null main.go 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/doc.go b/vendor/modernc.org/sqlite/doc.go index 0efdc9b..af3de2c 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.1 +// darwin arm64 3.50.1 +// freebsd amd64 3.50.1 +// freebsd arm64 3.50.1 +// linux 386 3.50.1 +// linux amd64 3.50.1 +// linux arm 3.50.1 +// linux arm64 3.50.1 +// linux loong64 3.50.1 +// linux ppc64le 3.50.1 +// linux riscv64 3.50.1 +// linux s390x 3.50.1 +// windows 386 3.50.1 +// windows amd64 3.50.1 +// windows arm64 3.50.1 +// +// # Benchmarks +// +// [The SQLite Drivers Benchmarks Game] // // # Builders // @@ -51,6 +55,8 @@ // // # Changelog // +// - 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 +295,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/sqlite_darwin_amd64.go b/vendor/modernc.org/sqlite/lib/sqlite_darwin_amd64.go index 9408168..74b5b1a 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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70" +const SQLITE_SOURCE_ID = "2025-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95" 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.1" -const SQLITE_VERSION_NUMBER = 3049001 +const SQLITE_VERSION = "3.50.1" +const SQLITE_VERSION_NUMBER = 3050001 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 @@ -5827,6 +5907,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 @@ -6259,7 +6340,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -8000,11 +8080,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,6 +8464,7 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem @@ -8423,6 +8510,7 @@ type THashElem1 = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem1 = THashElem1 @@ -10069,6 +10157,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 +10220,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 @@ -10430,7 +10534,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData = TDbClientData @@ -10500,9 +10603,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 +10620,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -10566,8 +10668,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 +10733,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -10703,19 +10804,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 +10833,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 +10845,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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 +10897,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -10807,6 +10909,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -10955,9 +11058,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 @@ -11012,6 +11115,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -11192,7 +11296,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -11234,7 +11337,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -11804,8 +11906,8 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. +/* Use SQLITE_ENABLE_EXPLAIN_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 @@ -12652,6 +12754,7 @@ type TTable1 = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table1 = TTable1 @@ -12733,11 +12836,13 @@ type TFKey1 = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey1 = TFKey1 +/* The size (in bytes) of an FKey object holding N columns. The answer +** does NOT include space to hold the zTo name. */ + /* ** SQLite supports many different ways to resolve a constraint ** error. ROLLBACK processing means that a constraint violation @@ -12786,11 +12891,12 @@ type TKeyInfo1 = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo1 = TKeyInfo1 +/* The size (in bytes) of a KeyInfo object with up to N fields */ + /* ** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. */ @@ -13192,13 +13298,16 @@ type Expr1 = TExpr1 ** expression. */ type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList1 = TExprList1 +/* The size (in bytes) of an ExprList object that is big enough to hold +** as many as N expressions. */ + /* ** Allowed values for Expr.a.eEName */ @@ -13219,12 +13328,14 @@ type ExprList1 = TExprList1 ** 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 + F__ccgo_align [0]uint64 + FnId int32 } type IdList1 = TIdList1 +/* The size (in bytes) of an IdList object that can hold up to N IDs. */ + /* ** Allowed values for IdList.eType, which determines which value of the a.u4 ** is valid. @@ -13330,13 +13441,19 @@ type OnOrUsing1 = TOnOrUsing1 ** */ type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList1 = TSrcList1 +/* Size (in bytes) of a SrcList object that can hold as many as N +** SrcItem objects. */ + +/* Size (in bytes( of a SrcList object that holds 1 SrcItem. This is a +** special case of SZ_SRCITEM(1) that comes up often. */ + /* ** Permitted values of the SrcList.a.jointype field */ @@ -13697,19 +13814,22 @@ type TParse1 = 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 @@ -13723,11 +13843,8 @@ type TParse1 = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -13738,40 +13855,41 @@ type TParse1 = 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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -14137,11 +14255,13 @@ type TWith1 = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With1 = TWith1 +/* The size (in bytes) of a With object that can hold as many +** as N different CTEs. */ + /* ** The Cte object is not guaranteed to persist for the entire duration ** of code generation. (The query flattener or other parser tree @@ -14171,11 +14291,13 @@ type TDbClientData1 = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData1 = TDbClientData1 +/* The size (in bytes) of a DbClientData object that can has a name +** that is N bytes long, including the zero-terminator. */ + /* ** This object is used in various ways, most (but not all) related to window ** functions. @@ -15341,7 +15463,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -15419,7 +15540,6 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor @@ -15457,11 +15577,16 @@ type TVdbeCursor1 = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor1 = TVdbeCursor1 +/* +** The size (in bytes) of a VdbeCursor object that has an nField value of N +** or less. The value of SZ_VDBECURSOR(n) is guaranteed to be a multiple +** of 8. + */ + /* Return true if P is a null-only cursor */ @@ -15672,21 +15797,14 @@ type Tsqlite3_context1 = struct { 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 */ +/* +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. + */ // C documentation // @@ -15819,7 +15937,7 @@ type TPreUpdate1 = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -15831,6 +15949,7 @@ type TPreUpdate1 = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate1 = TPreUpdate1 @@ -15968,7 +16087,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(24453)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -16140,7 +16259,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)) @@ -16521,7 +16640,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 +16711,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 +16850,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 +16947,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 +17088,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 +17102,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 +17180,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 +17328,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 +17631,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 +17788,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 +17836,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 +17941,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) @@ -18551,7 +18670,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 } @@ -19200,7 +19319,8 @@ func init() { // /* // ** Initialize the mutex system. // */ -func _sqlite3MutexInit(tls *libc.TLS) (r int32) { +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 @@ -20525,17 +20645,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 +20852,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 +21117,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 +21149,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 +21171,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 +21598,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 +21713,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 = v98 + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) + } + } + 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 +21743,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 +21762,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 +21815,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 - } - 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 + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + 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++ + } + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 + j1++ + 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 +21931,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 +21947,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 +21957,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 +22210,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 +22509,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 +22528,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)) } @@ -22965,6 +23166,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 +23967,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 +24142,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 +24354,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 +24594,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 +24684,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 +24911,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 +25071,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 +25180,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 +25591,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 +25620,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 +25634,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 +25719,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 +26074,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 +26143,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 +26177,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 +26198,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 +26211,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 +26227,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 +26239,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 +26288,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 +26298,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 +26329,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 +27898,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 +27917,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 @@ -28258,91 +28488,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, - }, - 14: { - FzName: __ccgo_ts + 3553, - }, - 15: { - FzName: __ccgo_ts + 3560, - }, - 16: { FzName: __ccgo_ts + 3570, }, + 14: { + FzName: __ccgo_ts + 3579, + }, + 15: { + FzName: __ccgo_ts + 3586, + }, + 16: { + FzName: __ccgo_ts + 3596, + }, 17: { - FzName: __ccgo_ts + 3577, - }, - 18: { - FzName: __ccgo_ts + 3591, - }, - 19: { - FzName: __ccgo_ts + 3597, - }, - 20: { FzName: __ccgo_ts + 3603, }, - 21: { - FzName: __ccgo_ts + 3610, + 18: { + FzName: __ccgo_ts + 3617, }, - 22: { - FzName: __ccgo_ts + 3618, - }, - 23: { + 19: { FzName: __ccgo_ts + 3623, }, - 24: { - FzName: __ccgo_ts + 3630, + 20: { + FzName: __ccgo_ts + 3629, }, - 25: { - FzName: __ccgo_ts + 3637, + 21: { + FzName: __ccgo_ts + 3636, }, - 26: { + 22: { + FzName: __ccgo_ts + 3644, + }, + 23: { FzName: __ccgo_ts + 3649, }, + 24: { + FzName: __ccgo_ts + 3656, + }, + 25: { + FzName: __ccgo_ts + 3663, + }, + 26: { + FzName: __ccgo_ts + 3675, + }, 27: { - FzName: __ccgo_ts + 3658, + FzName: __ccgo_ts + 3684, }, 28: { - FzName: __ccgo_ts + 3664, + FzName: __ccgo_ts + 3690, }, } @@ -28579,9 +28809,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 } } @@ -28902,7 +29132,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 +29160,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 +29878,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(40995)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -30304,7 +30534,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 +31095,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(42576)), __ccgo_ts+3603, bp, int32(42576)) } // C documentation @@ -30902,7 +31132,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)<= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43393)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -31517,7 +31747,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)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44803)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -32790,10 +33019,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 +33031,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 +33094,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 +33266,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 +33423,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(45251)), __ccgo_ts+3486, zName, int32(45251)) if rc == SQLITE_OK { rc = rc2 } @@ -33230,13 +33459,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(45305)) 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(45502)) 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(45507)), __ccgo_ts+3675, zIn, int32(45507)) return } (*(*[1026]int8)(unsafe.Pointer(bp + 144)))[got] = 0 @@ -33508,14 +33737,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(45565)), __ccgo_ts+3504, zPath, int32(45565)) } _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(45571)) } 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(46234)) (*TunixFile)(unsafe.Pointer(conchFile)).Fh = fd (*TunixFile)(unsafe.Pointer(conchFile)).FopenFlags = libc.Int32FromInt32(O_RDWR) | libc.Int32FromInt32(O_CREAT) goto end_breaklock @@ -34175,9 +34404,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(46242)) } - 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 +34627,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(46495)) } (*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(46503)) /* SQLITE_BUSY? proxyTakeConch called during locking */ } } @@ -34528,7 +34757,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 +34777,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 +34816,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 +34851,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 +34926,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 +34951,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 +35220,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, }, } @@ -35403,7 +35632,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 +35978,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 +36073,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 +36153,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 +36300,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 +36318,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 +36381,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 { @@ -36465,7 +36694,7 @@ 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)) - uint32(1)) / uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { @@ -36519,7 +36748,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 +36792,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 +36867,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 +36921,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) } } @@ -37979,7 +38208,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) - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 0) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0)) for { v4 = n n-- @@ -38262,17 +38491,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 +38521,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 +38533,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 +38734,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 @@ -40651,7 +40883,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 +40901,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 +41474,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 +42129,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 +42142,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 +42163,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 +42197,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 +42430,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 +42567,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 +42583,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)< int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65269)) } 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 +46690,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 +47254,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 @@ -47217,6 +47460,11 @@ type WalCkptInfo1 = TWalCkptInfo1 /* ** An open write-ahead log file is represented by an instance of the ** following object. +** +** writeLock: +** This is usually set to 1 whenever the WRITER lock is held. However, +** if it is set to 2, then the WRITER lock is held but must be released +** by walHandleException() if a SEH exception is thrown. */ type TWal1 = struct { FpVfs uintptr @@ -47283,13 +47531,15 @@ type ht_slot = Tht_slot ** This functionality is used by the checkpoint code (see walCheckpoint()). */ type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } 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 ** is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -47347,7 +47597,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 +47609,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 +47698,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 @@ -47889,7 +48140,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(67209)) } goto _1 _1: @@ -47977,12 +48228,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(67341)) 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 +48367,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 { @@ -48747,7 +48998,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(68150)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -48863,7 +49114,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 +49329,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 +49362,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(68601)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -49827,8 +50085,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 +50173,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(69451)) } iKey = _walNextHash(tls, iKey) } @@ -50412,7 +50670,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(69974)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -50661,7 +50919,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, /* 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(70234)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -51433,6 +51691,11 @@ type CellInfo1 = TCellInfo1 ** assumed that the database is corrupt. */ +/* +** Maximum amount of storage local to a database page, regardless of +** page size. + */ + /* ** A cursor is a pointer to a particular entry within a particular ** b-tree within a database file. @@ -51799,10 +52062,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 +52075,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,7 +52782,7 @@ 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(72422)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } @@ -52696,7 +52960,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(72620)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -52709,12 +52973,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(72633)) 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(72638)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -52758,7 +53022,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(72683)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -52766,7 +53030,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(72691)) } return SQLITE_OK } @@ -52954,7 +53218,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 +53251,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 +53450,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(73136)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -53226,12 +53490,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(73194)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73197)) } 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 +53503,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(73205)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73208)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73210)) } 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(73214)) } } cbrk = top + sz @@ -53300,12 +53564,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(73247)) } 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(73253)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -53321,7 +53585,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(73267)) } *(*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 +53645,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(73324)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -53398,14 +53662,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(73339)) } 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(73346)) } return uintptr(0) } @@ -53448,11 +53712,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(73394)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73397)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -53466,7 +53730,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(73414)) } else { return SQLITE_OK } @@ -53519,42 +53783,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(73498)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -53562,70 +53824,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(73510)) } - 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(73513)) } - 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(73526)) } - 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(73532)) } 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) + *(*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)) += libc.Int32FromUint16(iOrigSize) + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -53671,7 +53933,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(73602)) } } } else { @@ -53697,7 +53959,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(73626)) } } } @@ -53736,12 +53998,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(73677)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73682)) } 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(73692)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73696)) } } /* At this point, nFree contains the sum of the offset to the start @@ -53768,7 +54030,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(73708)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -53799,11 +54061,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(73739)) } 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(73744)) } goto _1 _1: @@ -53832,11 +54094,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(73776)) } (*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 +54107,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(73790)) } /* 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 +54129,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 +54143,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 +54258,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(73933)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -54060,7 +54320,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(74005)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -54148,7 +54408,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 +55032,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 +55194,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 +55232,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(74943)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -55413,7 +55673,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(75398)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -55437,7 +55697,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(75417)) } 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 +55706,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(75426)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -55460,7 +55720,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(75438)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -55490,7 +55750,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(75473)) } /* 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 +55846,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(75571)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -55624,7 +55884,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(75623)) } } 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 +55951,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(75691)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -55734,7 +55994,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(75742)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -55764,7 +56024,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(75769)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -56230,7 +56490,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(76233)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -56622,7 +56882,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(76657)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -56632,7 +56892,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(76672)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -56663,7 +56923,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 +56949,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(76743)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -56763,7 +57023,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(76827)) } return rc } @@ -56898,7 +57158,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(76965)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -56910,7 +57170,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(76979)) } if rc != 0 { v3 = pCur + 84 @@ -57026,7 +57286,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(77114)) } goto skip_init skip_init: @@ -57040,7 +57300,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(77126)) } 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 +57534,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(77375)) } } } @@ -57478,7 +57738,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes p3 = pCur + 1 *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(BTCF_ValidOvfl) | libc.Int32FromInt32(BTCF_AtLast))) if !((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76795)) + return _sqlite3CorruptError(tls, int32(77571)) } goto bypass_moveto_root /* Start search on the current page */ } @@ -57541,10 +57801,10 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ if nCell < int32(2) || libc.Uint32FromInt32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77658)) 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 +57832,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(77690)) } goto moveto_index_finish } @@ -57605,7 +57865,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(77721)) } *(*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 +57874,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(77732)) } if rc != 0 { v11 = pCur + 84 @@ -57743,7 +58003,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(77833)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -57853,7 +58113,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(77926)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -57941,7 +58201,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(78016)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -57996,7 +58256,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(78072)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -58022,7 +58282,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(78101)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -58049,7 +58309,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(78135)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -58120,7 +58380,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(78200)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -58258,7 +58518,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(78327)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -58309,7 +58569,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(78374)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -58318,7 +58578,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(78385)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -58408,7 +58668,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(78474)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -58426,7 +58686,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(78491)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -58449,7 +58709,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(78511)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -58670,10 +58930,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(78767)) 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 @@ -59064,12 +59324,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(79157)) } 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(79162)) } } pData -= uintptr(sz) @@ -59077,7 +59337,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(79168)) } libc.X__builtin___memmove_chk(tls, pData, pCell, uint64(sz), ^t__predefined_size_t(0)) i++ @@ -59172,7 +59432,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(79255)) 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 +59513,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 +59540,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 +59580,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(79377)) } 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 +59651,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(79455)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -59436,7 +59696,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(79495)) } /* 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 +59892,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 +60019,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 +60060,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(79919)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -59822,7 +60083,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(79943)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -59953,7 +60214,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(80044)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -59996,7 +60257,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(80077)) goto balance_cleanup } } @@ -60055,7 +60316,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(80121)) goto balance_cleanup } goto _11 @@ -60087,7 +60348,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(80154)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -60317,7 +60578,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(80355)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -60563,7 +60824,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(80587)) } goto _1 _1: @@ -60636,7 +60897,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(80647)) } 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 +61056,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(80811)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -60826,7 +61087,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(80839)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -60911,7 +61172,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(80920)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -61003,7 +61264,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(81043)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -61039,7 +61300,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(81085)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -61069,10 +61330,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(81112)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81115)) } 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 +61451,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(81217)) } 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 +61466,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(81242)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -61312,21 +61573,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(81338)) } } 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(81347)) } 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(81561)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -61571,7 +61832,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(81609)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -61652,14 +61913,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(81699)) } *(*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(81706)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -61796,7 +62057,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(81810)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -62061,7 +62322,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 +62370,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 +62400,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 +62476,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 +62616,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 +62706,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 +62729,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 +62806,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 +62820,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 +62911,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 +62935,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 +62976,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: @@ -63157,7 +63418,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 +63428,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 +63457,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 +63487,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 +64163,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 +64301,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 +64475,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 +64503,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 @@ -65002,7 +65260,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(85108)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -65166,7 +65424,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 +65433,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 +65491,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 +65512,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 +65537,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 +65644,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 +65659,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 +65963,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(85794)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -65720,7 +65979,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(85800)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -65730,7 +65989,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(85806)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -66191,12 +66450,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 +66628,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 +66645,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 +66713,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 +66727,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 +66768,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 +66808,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 +67310,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 +67323,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 +67372,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 +67394,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 +67421,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 +68221,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 } @@ -68114,7 +68375,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 +68383,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 +68625,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(90646))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -69752,7 +70013,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(90727))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -69787,7 +70048,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(90757))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -69841,7 +70102,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(90808))) return 0 /* Corrupt index */ } } @@ -69973,7 +70234,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(90971))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -70125,7 +70386,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(91129)) } // C documentation @@ -70156,7 +70417,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(91162)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -70307,15 +70568,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 +70671,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 +70684,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 +70766,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 +70776,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 +70834,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(91560)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -71075,7 +71337,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 +71538,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(92354)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -71406,7 +71668,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(92475)) } 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) @@ -71866,18 +72128,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 +72394,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(93091)) } 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(93095))) 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(93099)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -72290,7 +72552,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, 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) } @@ -72713,11 +72975,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(93642)) 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 +72988,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 +73002,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 +73037,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(93701)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -72810,7 +73072,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 +73138,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(93797)) 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 +73165,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 +73187,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 +73314,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 +73352,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 +73367,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 +73552,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 +73580,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 +73592,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 +74004,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 +74026,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 +74044,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 +74758,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 +75984,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 +76000,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 +76499,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(97561)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -76336,7 +76602,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 +77198,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 +77228,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 +77325,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. @@ -78170,7 +78436,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(99822)) } else { goto jump_to_p2 } @@ -78629,7 +78895,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 +79328,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(101119)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -79392,7 +79658,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 +79689,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 +79710,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(101412)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -79681,7 +79947,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 +79964,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 +80053,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 +80269,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 +80319,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 +80375,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 +80454,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 +80611,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 +80773,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 +80853,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 +80869,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 +80963,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 +80991,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 +81123,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 +81274,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 +81361,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 +81827,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) @@ -81659,7 +81917,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103962)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -81758,7 +82016,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(104062)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -81772,7 +82030,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) } @@ -82219,11 +82477,12 @@ type TVdbeSorter1 = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter1 = TVdbeSorter1 +/* Size (in bytes) of a VdbeSorter object that works with N or fewer subtasks */ + /* ** An instance of the following object is used to read records out of a ** PMA, in sorted order. The next key to be read is cached in nKey/aKey. @@ -82830,8 +83089,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 +83104,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) @@ -83045,18 +83304,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 { @@ -83344,6 +83604,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: @@ -85889,25 +86152,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 +86209,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 +86256,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 +86350,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 +86372,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 +86454,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 +86467,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 +86514,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 +86572,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 +86591,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 +86632,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 +86652,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 +86661,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 +86671,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 +86739,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -86576,19 +86814,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 +86852,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 +86998,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 +87053,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 +87077,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 +87091,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 +87117,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 +87134,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 +87250,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 +87262,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 +87308,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 +87433,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 +87468,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 +87506,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 +87576,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 +87610,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 +87923,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 +87990,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 +88001,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 +88011,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 +88233,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 +88313,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 +88521,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 +88996,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 +89075,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 +89262,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 +89420,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)) @@ -89233,7 +89473,7 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt 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)) { _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 +89501,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 +89521,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 +89592,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 +89644,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 +89677,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) } } @@ -89820,7 +90060,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 +90200,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 +90220,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 +90279,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 +90291,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 +90306,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 +90357,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 +90438,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 +90456,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 +90537,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 +90666,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 +90764,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 +91445,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 +91466,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 +91687,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 +91740,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 +91840,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 +92438,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 +92534,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 +92569,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 +92704,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 +92834,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)<= (*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 +93632,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 +93647,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 +93676,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 +93752,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 +93815,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 +93825,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) { @@ -93626,9 +93846,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 +93930,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 +94001,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 +94020,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 @@ -93831,7 +94051,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 +94121,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 +94165,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 @@ -94212,7 +94432,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 +94643,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 +95352,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) } @@ -95649,7 +95873,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) 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 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 @@ -95665,7 +95889,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) (*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 + v9 = pParse + 60 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 @@ -95750,7 +95974,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 +95982,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 +96000,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 +96019,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 +96141,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+8884, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -95936,10 +96160,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+8912, 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+9087, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -95955,9 +96179,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+9261, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9383, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9408, 0) } } @@ -96013,7 +96237,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+9559, 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 +96246,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+9618, 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+9624, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -96056,21 +96280,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+9651, 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+9835, 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+10140, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10156, 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+10214, 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 +96302,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 +96310,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+10479, 0) goto exit_rename_table exit_rename_table: ; @@ -96103,7 +96327,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+10492, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -96143,11 +96367,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+10530, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10537, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10562, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -96163,10 +96387,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+10589) } 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+10648) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -96178,13 +96402,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+10701) } _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+10747) } } /* Modify the CREATE TABLE statement. */ @@ -96198,7 +96422,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+10774, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -96226,7 +96450,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+10920, libc.VaList(bp+16, zTab, zDb)) } } } @@ -96264,12 +96488,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+11273, 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+11307, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -96284,7 +96508,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 +96516,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+11337, 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 +96578,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 + 11356 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 11336 + zType = __ccgo_ts + 11361 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11350 + v1 = __ccgo_ts + 11375 } else { - v1 = __ccgo_ts + 11367 + v1 = __ccgo_ts + 11392 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11385, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11410, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -96412,21 +96636,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+11428, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -96442,11 +96654,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+11449, 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+11631, 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+10479, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -96922,11 +97134,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 + 11762 } 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+11764, 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 +97209,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+11787, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118867)) } 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(118888)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -97041,9 +97257,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 +97274,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+11795, 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 +97293,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 +97319,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 + 11762 } 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+11801, 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 +97359,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 +97669,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 +97936,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 +98119,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 +98203,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 +98221,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 +98300,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(119856)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -98101,7 +98317,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+11806, 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 +98372,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+11428, 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 + 11813 } 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+11825, 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+11853, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -98184,31 +98400,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+11901, 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+12022, 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 +98438,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 +98449,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 +98511,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 + 12040, }, 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 + 12061, }, 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 + 12081, }, 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 + 12100, }, 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 + 12119, }, } @@ -98526,8 +98742,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+12222, 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 +98758,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+12245, 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+12275, 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 +98793,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 12117, - FzCols: __ccgo_ts + 12130, + FzName: __ccgo_ts + 12142, + FzCols: __ccgo_ts + 12155, }, 1: { - FzName: __ccgo_ts + 12143, - FzCols: __ccgo_ts + 12156, + FzName: __ccgo_ts + 12168, + FzCols: __ccgo_ts + 12181, }, 2: { - FzName: __ccgo_ts + 12184, + FzName: __ccgo_ts + 12209, }, } @@ -98794,7 +99015,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 +99032,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 +99045,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 +99104,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 + 12293, } func init() { @@ -99256,7 +99478,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 + 12303, } func init() { @@ -99306,7 +99528,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+12313, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -99317,7 +99539,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+12318, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -99356,7 +99578,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+12324, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -99374,7 +99596,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 + 12330, } func init() { @@ -99440,7 +99662,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+12339, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -99449,12 +99671,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+12142, 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 +99798,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 +99878,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 +99909,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+12349, 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 +100000,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+12349, 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 +100037,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 +100070,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+12353) } 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+12357) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -100016,17 +100238,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+12361, 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+12372, 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+12382, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -100038,13 +100260,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 +100310,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 +100513,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 +100620,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+12168, 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+12394, __ccgo_ts+12463, zDb) } return rc } @@ -100475,10 +100690,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+12142, (*(*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+12515, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -100591,7 +100806,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 +100858,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+12556, 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 +100893,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+12559, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -100687,7 +100902,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+12596, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -100699,13 +100914,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 +100958,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+12626, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -100751,7 +100966,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+12655, 0) rc = int32(SQLITE_ERROR) } } @@ -100798,7 +101013,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+12723, libc.VaList(bp+56, zFile)) } } } @@ -100860,15 +101075,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+12751, 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+12772, 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+12798, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -100963,7 +101178,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 + 12820, } func init() { @@ -100985,7 +101200,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 + 12834, } func init() { @@ -101011,7 +101226,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+12848, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -101045,7 +101260,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+12872, 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))) @@ -101262,7 +101477,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+12918, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -101290,11 +101505,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+12941, 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+12947, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12928, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12953, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -101354,7 +101569,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 +101604,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+12980, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -101507,7 +101722,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 +101820,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 +101900,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 +101914,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 +102029,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 +102073,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 +102116,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+12995, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -101907,7 +102126,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 +102134,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 + 13003 } else { - v1 = __ccgo_ts + 12991 + v1 = __ccgo_ts + 13016 } 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 +102180,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 @@ -102491,7 +102710,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 +102742,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 +102800,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+13030, 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+13047, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -102635,8 +102854,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+13067, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -102672,23 +102891,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 +103029,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 +103072,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 +103087,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+13109, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -102882,9 +103103,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 11331 + v2 = __ccgo_ts + 11356 } else { - v2 = __ccgo_ts + 9593 + v2 = __ccgo_ts + 9618 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -102894,9 +103115,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 +103141,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 + 11356 } else { - v4 = __ccgo_ts + 9593 + v4 = __ccgo_ts + 9618 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13125, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13150, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -102932,11 +103153,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+13171, 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 +103189,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 +103231,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 +103259,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 +103320,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+13206, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -103093,14 +103329,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+13240, 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 +103370,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 +103385,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+13260, 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 +103395,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+13283, 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+13290, 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 +103442,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+13300, 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 +103456,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 +103469,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 +103655,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+13326, 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+13371, 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 +103716,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+13412, 0) } } @@ -103508,8 +103744,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 +103753,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+13464, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -103536,21 +103772,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 +103798,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+13505, 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 +103826,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 +103919,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+13561, 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+13604, (*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+13612, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -103731,7 +103961,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+13619, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -103872,9 +104102,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 +104116,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 + 13650 + zEnd = __ccgo_ts + 5545 } else { - zSep = __ccgo_ts + 13627 - zSep2 = __ccgo_ts + 13631 - zEnd = __ccgo_ts + 13636 + zSep = __ccgo_ts + 13652 + zSep2 = __ccgo_ts + 13656 + zEnd = __ccgo_ts + 13661 } - 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+13664, 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 +104151,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 +104166,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 + 13678, + 2: __ccgo_ts + 13684, + 3: __ccgo_ts + 13689, + 4: __ccgo_ts + 13694, + 5: __ccgo_ts + 13684, } // C documentation @@ -103953,15 +104186,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 +104210,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 +104443,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 +104554,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 +104567,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 +104598,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 +104817,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+13700, 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+13733, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -104596,11 +104840,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+13760, 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+13810, 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 +104891,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+13842, 0) return } } @@ -104681,16 +104925,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 + 9618 + zType2 = __ccgo_ts + 13886 } else { /* A view */ - zType = __ccgo_ts + 11331 - zType2 = __ccgo_ts + 13867 + zType = __ccgo_ts + 11356 + zType2 = __ccgo_ts + 13892 } /* 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 +104951,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 +105021,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+13897, 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+13912, 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 +105046,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+14010, 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+14052, 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+14086, 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 +105072,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+10140) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -104846,7 +105105,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+14107, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -104863,7 +105122,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+11356, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -104960,7 +105219,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+14143, 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 +105403,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+14173, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -105157,7 +105416,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+14188, 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 +105499,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+14255, 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+12245, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -105283,7 +105542,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+14269, 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 +105551,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+14314, 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 +105586,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 +105645,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 +105680,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+14381, 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+14409, 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+14443, 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 +105701,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+12357, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -105490,19 +105749,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+14475, 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+14538, 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 +105818,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+14632, 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 +105933,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 +105959,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 +106004,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 +106033,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 +106078,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 + 14678 } else { - v2 = __ccgo_ts + 14659 + v2 = __ccgo_ts + 14684 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14664, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14689, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -105901,7 +106160,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+14717, *(*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 +106170,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+14723, 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 +106184,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+14773, 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+14801, 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+14826, 0) goto exit_create_index } /* @@ -105955,19 +106214,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+14717, (*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+14860, 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+14894, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -105988,7 +106247,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+14918, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -106006,9 +106265,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 +106295,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+14717) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -106068,7 +106327,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 +106379,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+14941, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -106135,6 +106394,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { j = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) } else { if int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16 + 8))&0xf>>0)) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) @@ -106219,7 +106479,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 +106527,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+15002, 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 +106557,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+15044, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127335)) goto exit_create_index } } @@ -106311,7 +106571,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 +106600,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 + 15061 } - 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+15069, 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 +106610,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+15089, 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 +106618,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+15148, 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 +106781,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+15175, 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+15193, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -106538,9 +106798,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 +106816,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+15266, 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+12353, (*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 +106890,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 +107007,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+15326, 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 +107094,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 +107144,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 +107315,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 + 15362 } else { - v1 = __ccgo_ts + 15340 + v1 = __ccgo_ts + 15365 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15346, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15371, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -107258,7 +107518,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+15407, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -107305,9 +107565,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 + 15413 } else { - v1 = __ccgo_ts + 15397 + v1 = __ccgo_ts + 15422 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -107339,9 +107599,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 + 15407, + 1: __ccgo_ts + 15429, + 2: __ccgo_ts + 15413, } // C documentation @@ -107361,7 +107621,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+15437, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -107386,7 +107646,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+12941, 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 +108077,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+15637, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -108699,11 +108957,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+15670, 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+15699, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -108807,7 +109065,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 +109122,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+15773, -int32(1)) return } if argc == int32(3) { @@ -110583,7 +110846,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+15806, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -110665,7 +110928,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 +111000,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+15851, 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+15859, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -110790,13 +111053,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 + 15867 + } else { + v2 = __ccgo_ts + 15871 + } + 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+15874, -int32(1)) + return +} + // C documentation // // /* @@ -110808,6 +111207,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 +111221,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 +111656,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 +111745,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11737, + 0: __ccgo_ts + 11762, } // C documentation @@ -111502,7 +111905,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+15897, int32(4), libc.UintptrFromInt32(0)) } } @@ -111563,7 +111966,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+12980, -int32(1)) return } if argc == int32(2) { @@ -111673,7 +112076,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 +112158,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+15750, -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) @@ -111987,7 +112390,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 +112401,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 +112508,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+15902, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -112134,8 +112537,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+15908, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15908, 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 +112718,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 +112826,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 +112839,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 + 15913, }, 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 + 15933, }, 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 + 15946, }, 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 + 15964, }, 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 + 15973, }, 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 + 15981, }, 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 + 15981, }, 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 + 15996, }, 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 + 16022, }, 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 + 16047, }, 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 + 16056, }, 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 + 16067, }, 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 + 16074, }, 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 + 16088, }, 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 + 16088, }, 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 + 16094, }, 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 + 16094, }, 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 + 16100, }, 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 + 16100, }, 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 + 16105, }, 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 + 16105, }, 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 + 16109, }, 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 + 16109, }, 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 + 16113, }, 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 + 16120, }, 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 + 16128, }, 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 + 16135, }, 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 + 16148, }, 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 + 16154, }, 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 + 16161, }, 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 + 16168, }, 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 + 16176, }, 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 + 16181, }, 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 + 16185, }, 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 + 16185, }, 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 + 16191, }, 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 + 16197, }, 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 + 16203, }, 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 + 16207, }, 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 + 16207, }, 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 + 16213, }, 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 + 16220, }, 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 + 16230, }, 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 + 16237, }, 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 + 16244, }, 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 + 16255, }, 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 + 16262, }, 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 + 16277, }, 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 + 16294, }, 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 + 16305, }, 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 + 16312, }, 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 + 16318, }, 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 + 16331, }, 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 + 16349, }, 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 + 16357, }, 55: { - 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 + 16316, - }, - 56: { 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 + 16371, + }, + 56: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16379, }, 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 + 16388, }, 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 + 16388, }, 59: { - 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, + 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 + 16395, }, 60: { - 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, + 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 + 16395, }, 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 + 16343, + FzName: __ccgo_ts + 16405, }, 62: { - 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, + 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 + 16409, }, 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(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16347, + 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 + 16415, }, 64: { - 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, + 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 + 16419, }, 65: { - 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, + 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 + 16419, }, 66: { - FnArg: int16(2), + 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 + 16366, + FzName: __ccgo_ts + 16425, }, 67: { 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, + 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 + 16425, }, 68: { 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, + 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 + 16438, }, 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 + 16449, + }, + 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 + 15908, + }, + 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, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16382, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1238, + FzName: __ccgo_ts + 15908, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1246, + FzName: __ccgo_ts + 16454, }, 73: { 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 + 1238, }, 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 + 16393, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1246, }, 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 + 16396, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16459, }, 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 + 16400, + FzName: __ccgo_ts + 16465, }, 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 + 16406, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16468, }, 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 + 16396, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16472, }, 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, + FfuncFlags: 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 + 16478, }, 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 + 16468, }, 81: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16419, - }, - 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, - }, - 83: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16429, - }, - 84: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16434, - }, - 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, - }, - 86: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16444, - }, - 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, - }, - 88: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16454, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, }, + 82: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16487, + }, + 83: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16491, + }, + 84: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16497, + }, + 85: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16501, + }, + 86: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16506, + }, + 87: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16511, + }, + 88: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16516, + }, + 89: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16522, + }, + 90: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16526, + }, + 91: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16530, + }, + 92: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16534, + }, + 93: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16539, + }, + 94: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16544, + }, 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 + 16549, }, 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 + 16555, }, 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 + 16561, }, 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 + 16567, }, 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 + 16572, }, 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 + 16580, }, 101: { - 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, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16588, }, 102: { - 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, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16591, }, 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 + 7229, + }, + 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 + 16528, + FzName: __ccgo_ts + 16596, + }, + 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 + 16600, }, } @@ -113030,109 +113444,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 +113772,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 +113865,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+16603, 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 +114689,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 +114976,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 +115044,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 +115060,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 @@ -115210,7 +115626,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 +115692,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 +116021,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 +116035,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 +116070,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 +116083,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 +116210,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 +116311,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 +116338,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 +116347,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+16648, 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+16689, 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 +116390,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+16721, 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 +116438,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 +116482,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 +116500,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+16729, 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+16781, 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 +116634,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 +116655,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 +116672,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 +116696,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 +116816,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 +116879,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16801) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16873) } goto insert_cleanup insert_cleanup: @@ -116875,7 +117275,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+12941, 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 +119511,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+16925, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -119129,19 +119531,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+16929, 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+16935, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -119156,14 +119558,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+16978, 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 +119589,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+17010, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -119196,7 +119598,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 + 16887, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -119429,7 +119831,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+17047, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -119483,63 +119885,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 + 17086, + 2: __ccgo_ts + 9618, + 3: __ccgo_ts + 17090, + 4: __ccgo_ts + 17095, + 5: __ccgo_ts + 17098, + 6: __ccgo_ts + 17108, + 7: __ccgo_ts + 17118, + 8: __ccgo_ts + 17124, + 9: __ccgo_ts + 17128, + 10: __ccgo_ts + 17133, + 11: __ccgo_ts + 17138, + 12: __ccgo_ts + 17146, + 13: __ccgo_ts + 17157, + 14: __ccgo_ts + 17160, + 15: __ccgo_ts + 17128, + 16: __ccgo_ts + 17167, + 17: __ccgo_ts + 17133, + 18: __ccgo_ts + 17175, + 19: __ccgo_ts + 17179, + 20: __ccgo_ts + 17184, + 21: __ccgo_ts + 17190, + 22: __ccgo_ts + 17128, + 23: __ccgo_ts + 17133, + 24: __ccgo_ts + 17197, + 25: __ccgo_ts + 17202, + 26: __ccgo_ts + 17205, + 27: __ccgo_ts + 17212, + 28: __ccgo_ts + 17124, + 29: __ccgo_ts + 17128, + 30: __ccgo_ts + 17218, + 31: __ccgo_ts + 17223, + 32: __ccgo_ts + 17228, + 33: __ccgo_ts + 17086, + 34: __ccgo_ts + 17128, + 35: __ccgo_ts + 17232, + 36: __ccgo_ts + 17239, + 37: __ccgo_ts + 17246, + 38: __ccgo_ts + 12357, + 39: __ccgo_ts + 12353, + 40: __ccgo_ts + 17254, + 41: __ccgo_ts + 17259, + 42: __ccgo_ts + 17264, + 43: __ccgo_ts + 9618, + 44: __ccgo_ts + 17269, + 45: __ccgo_ts + 5939, + 46: __ccgo_ts + 17275, + 47: __ccgo_ts + 17280, + 48: __ccgo_ts + 16468, + 49: __ccgo_ts + 17285, + 50: __ccgo_ts + 17086, + 51: __ccgo_ts + 17128, + 52: __ccgo_ts + 17298, + 53: __ccgo_ts + 17303, + 54: __ccgo_ts + 17312, + 55: __ccgo_ts + 17319, + 56: __ccgo_ts + 17330, } // C documentation @@ -119558,343 +119960,343 @@ type PragmaName = TPragmaName var _aPragmaName = [67]TPragmaName{ 0: { - FzName: __ccgo_ts + 17266, + FzName: __ccgo_ts + 17338, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 17281, + FzName: __ccgo_ts + 17353, 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 + 17368, 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 + 17380, 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 + 17396, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 17247, + FzName: __ccgo_ts + 17319, 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 + 17409, 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 + 17421, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17369, + FzName: __ccgo_ts + 17441, 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 + 17457, 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 + 17478, 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 + 17493, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17437, + FzName: __ccgo_ts + 17509, 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 + 17523, 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 + 17536, 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 + 17550, 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 + 17569, 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 + 17588, 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 + 17611, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17548, + FzName: __ccgo_ts + 17620, 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 + 17638, 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 + 17655, 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 + 17668, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17611, + FzName: __ccgo_ts + 17683, 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 + 17701, 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 + 17711, 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 + 17725, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17669, + FzName: __ccgo_ts + 17741, 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 + 17766, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17713, + FzName: __ccgo_ts + 17785, 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 + 17796, 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 + 17807, 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 + 17819, 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 + 17835, 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 + 17848, 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 + 17867, 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 + 17886, FePragTyp: uint8(PragTyp_LOCK_PROXY_FILE), FmPragFlg: uint8(PragFlg_NoColumns1), }, 37: { - FzName: __ccgo_ts + 17830, + FzName: __ccgo_ts + 17902, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17843, + FzName: __ccgo_ts + 17915, 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 + 17930, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 40: { - FzName: __ccgo_ts + 17868, + FzName: __ccgo_ts + 17940, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 41: { - FzName: __ccgo_ts + 17880, + FzName: __ccgo_ts + 17952, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 42: { - FzName: __ccgo_ts + 17889, + FzName: __ccgo_ts + 17961, 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 + 17972, 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 + 17982, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 45: { - FzName: __ccgo_ts + 17922, + FzName: __ccgo_ts + 17994, 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 + 18005, 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 + 18017, 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 + 18034, 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 + 18053, 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 + 18079, 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 + 18094, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 52: { - FzName: __ccgo_ts + 18036, + FzName: __ccgo_ts + 18108, 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 + 18127, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 54: { - FzName: __ccgo_ts + 18069, + FzName: __ccgo_ts + 18141, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 55: { - FzName: __ccgo_ts + 18085, + FzName: __ccgo_ts + 18157, 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 + 18169, 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 + 18180, 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 + 18191, 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 +120304,45 @@ var _aPragmaName = [67]TPragmaName{ FiArg: uint64(1), }, 59: { - FzName: __ccgo_ts + 18131, + FzName: __ccgo_ts + 18203, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 60: { - FzName: __ccgo_ts + 18142, + FzName: __ccgo_ts + 18214, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 61: { - FzName: __ccgo_ts + 18163, + FzName: __ccgo_ts + 18235, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 62: { - FzName: __ccgo_ts + 18171, + FzName: __ccgo_ts + 18243, 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 + 18258, 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 + 18271, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 65: { - FzName: __ccgo_ts + 18218, + FzName: __ccgo_ts + 18290, 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 + 18305, 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 +120360,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 +120468,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+18321) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18259) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18331) { return PAGER_LOCKINGMODE_NORMAL } } @@ -120087,13 +120489,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+18338) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18271) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18343) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -120116,10 +120518,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+17298) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+18283) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18355) == 0 { return int32(2) } else { return 0 @@ -120141,7 +120543,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+18362, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -120271,15 +120673,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 + 18424 case int32(OE_SetDflt): - zName = __ccgo_ts + 18361 + zName = __ccgo_ts + 18433 case int32(OE_Cascade): - zName = __ccgo_ts + 18373 + zName = __ccgo_ts + 18445 case int32(OE_Restrict): - zName = __ccgo_ts + 18381 + zName = __ccgo_ts + 18453 default: - zName = __ccgo_ts + 18390 + zName = __ccgo_ts + 18462 break } return zName @@ -120300,12 +120702,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 + 18472, + 1: __ccgo_ts + 18479, + 2: __ccgo_ts + 18487, + 3: __ccgo_ts + 18491, + 4: __ccgo_ts + 18355, + 5: __ccgo_ts + 18500, } // C documentation @@ -120367,15 +120769,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 + 18525 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18455 + zType = __ccgo_ts + 18527 } 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+18529, 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 +120786,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 + 18504, + 2: __ccgo_ts + 18509, + 3: __ccgo_ts + 18517, } // C documentation @@ -120486,7 +120888,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+18536, libc.VaList(bp+184, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -120529,7 +120931,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 +120976,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 +121035,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+18540) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -120676,7 +121078,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 +121106,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 + 18331 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 +121134,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 + 18321 } _returnSingleText(tls, v, zRet) break @@ -121022,7 +121424,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+18545, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -121032,7 +121434,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 +121466,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+18570, 0) goto pragma_out } } @@ -121084,7 +121486,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+18600, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -121116,8 +121518,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+18653) == 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 +121600,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 + 18659 } else { - v14 = __ccgo_ts + 18595 + v14 = __ccgo_ts + 18667 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -121270,7 +121673,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+18674, 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 +121703,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 + 11356 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13579 + zType = __ccgo_ts + 13604 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18618 + zType = __ccgo_ts + 18690 } else { - zType = __ccgo_ts + 9593 + zType = __ccgo_ts + 9618 } } } - _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+18697, 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 +121762,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+18704, 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+18709, 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 +121788,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 + 18714, + 1: __ccgo_ts + 18716, + 2: __ccgo_ts + 17157, } - _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+18718, 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 +121811,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+18724, 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 +121828,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+18728, libc.VaList(bp+184, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -121475,7 +121878,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 +121890,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 +121916,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+18731, 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+18740)) goto _32 _32: ; @@ -121527,8 +121930,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 +122057,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+18745, 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 +122153,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 +122197,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 +122248,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+18749, 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 +122259,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+18773) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -121992,7 +122395,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+18802, 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 +122457,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 +122479,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+18838, 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 +122492,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+18858, 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 +122500,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+18880, 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 +122511,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+18903, -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+18905, 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 +122548,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+18925, 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 +122572,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+18955) _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+18960) _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 +122587,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+18981) _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+19017) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -122214,9 +122617,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+18955) _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+19028) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -122244,7 +122647,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+19055) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -122341,7 +122744,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 + 19082 (*(*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 +122823,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+19143, libc.VaList(bp+184, zRight)) } } } @@ -122525,13 +122928,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+18338) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19096) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19168) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18419) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18491) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -122666,7 +123069,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 +123099,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 +123161,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+19176, 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 +123434,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 19013, + FzName: __ccgo_ts + 19085, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 19018, + FzName: __ccgo_ts + 19090, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 19024, + FzName: __ccgo_ts + 19096, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 19033, + FzName: __ccgo_ts + 19105, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 19042, + FzName: __ccgo_ts + 19114, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 19050, + FzName: __ccgo_ts + 19122, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 19058, + FzName: __ccgo_ts + 19130, }, 7: { - FzName: __ccgo_ts + 19065, + FzName: __ccgo_ts + 19137, }, 8: {}, } @@ -123154,14 +123557,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+19194) 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+19209, libc.VaList(bp+240, int32(cSep), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -123170,19 +123573,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+19216, 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+19222) 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+19234) 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 +123600,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 +123781,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 +123793,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+19249) 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+19257, 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+19261, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -123405,7 +123808,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 +123934,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+19295, 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(143745)) } 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+19323, 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+19354, 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(143752)) } } } @@ -123556,9 +123959,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 + 19265, + 1: __ccgo_ts + 19272, + 2: __ccgo_ts + 19284, } // C documentation @@ -123634,7 +124037,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+15044) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -123667,11 +124070,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+19362) } 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+15044) } } } @@ -123710,18 +124113,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 + 9618 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 + 19375 (*(*[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 +124208,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+12655) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -123831,7 +124234,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+19447) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -123846,7 +124249,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+19471, 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)) @@ -124175,7 +124578,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 +124607,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 +124667,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+19505, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -124280,7 +124683,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+19535, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -124303,10 +124706,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 +124717,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 +124747,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(144552)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -124478,7 +124881,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(144701)) } /* 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 @@ -124738,7 +125141,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 +125149,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 +125305,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 + 11762 + zSp2 = __ccgo_ts + 11762 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+19554, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -124967,25 +125370,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 +125523,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 +125607,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+19584, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -125251,12 +125657,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+19634, 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 +125677,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+19698, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -125283,6 +125690,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 +125731,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), } @@ -125365,7 +125779,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 +125824,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 +125848,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 +125869,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 +125992,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 +126119,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 +126130,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 +126307,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+19735, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -126004,8 +126418,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 +126427,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 +126512,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19683 + z = __ccgo_ts + 19755 case int32(TK_INTERSECT): - z = __ccgo_ts + 19693 + z = __ccgo_ts + 19765 case int32(TK_EXCEPT): - z = __ccgo_ts + 19703 + z = __ccgo_ts + 19775 default: - z = __ccgo_ts + 19710 + z = __ccgo_ts + 19782 break } return z @@ -126125,7 +126539,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+19788, libc.VaList(bp+8, zUsage)) } /* @@ -126162,13 +126576,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 + 19811 } 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+19825, 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+19856, 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 +126606,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 +126826,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 + 17269 } 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 +126939,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 +126948,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 +126972,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 + 17269 } 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+12941, 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 +126986,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+19902, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -126626,7 +127040,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 +127078,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 + 17269 } zName = v3 } else { @@ -126679,7 +127093,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+19902, 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 +127129,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+19911, 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 +127248,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 + 19919 } else { zType = uintptr(0) j = int32(1) @@ -126900,7 +127314,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 +127342,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 +127392,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 +127415,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 +127563,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+19923, 0) return } /* Obtain authorization to do a recursive query */ @@ -127186,7 +127600,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 +127611,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 +127625,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 +127656,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+19972, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -127257,7 +127671,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+20014, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -127285,7 +127699,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+20020, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -127340,9 +127754,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+20035, 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 +127864,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+20058, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20073, 0) } /* Generate code for the left and right SELECT statements. */ @@ -127476,7 +127890,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+19755, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -127502,7 +127916,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 +127942,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+20092, 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 +127974,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 +128000,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+20092, 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 +128107,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 +128124,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+20113, 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+20159, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -127782,7 +128197,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+19735, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -127998,7 +128413,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 +128445,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 +128499,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 +128526,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+20241, 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+20252, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -128149,7 +128564,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+20257, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -128359,11 +128774,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 +128939,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 +129129,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 +129343,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 +129490,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) @@ -129365,11 +129780,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 +129849,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 +129867,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 +130354,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 +130400,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+16105) == 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+16109) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -130079,8 +130494,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+20263, 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 +130519,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 +130601,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 +130619,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+20281, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -130352,7 +130767,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 +130795,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+20304, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -130402,12 +130817,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+20324, 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 +130839,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 + 20367 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 +130870,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+20390, 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 +130879,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 + 20428 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20390 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20462 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -130515,7 +130930,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 +130940,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+20500, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -130621,7 +131036,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 +131045,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 +131096,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+20504, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -130696,7 +131111,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+20543, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -130711,7 +131126,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+15637, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -130835,7 +131250,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 +131267,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+20574, 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 +131346,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+20579, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -130944,7 +131359,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+12941, 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 +131379,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+20588, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20534, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20606, 0) } } } @@ -130980,7 +131395,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+20626, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -131229,7 +131644,7 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint (*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))) + *(*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 +131697,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 +131734,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+20657, 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+20708, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -131345,7 +131760,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+20741, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -131484,7 +131899,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 +132007,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 @@ -131659,7 +132074,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 + 20774 } else { v1 = __ccgo_ts + 1665 } @@ -131668,7 +132083,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+20797, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -131700,7 +132115,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 +132244,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 +132273,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+16419) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -131890,9 +132306,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 +132318,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 +132344,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 +132517,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 +132527,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 +132547,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 +132571,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+20809, 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 +132679,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+20863, 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 +132880,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+20903, 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 +132919,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 +132934,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+20918, 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 +132988,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 +133021,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 +133080,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 +133109,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 +133138,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 +133175,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 +133191,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 +133221,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++ } @@ -132829,11 +133252,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.Uint16FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -132867,47 +133290,47 @@ 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)) /* 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)) /* Begin a loop that will extract all source rows in GROUP BY order. @@ -132917,16 +133340,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 +133367,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 + 20934 } else { - v46 = __ccgo_ts + 20871 + v47 = __ccgo_ts + 20943 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19716, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19788, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -132962,8 +133385,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -132981,8 +133404,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -132993,12 +133416,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 +133470,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 +133549,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 +133568,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 +133598,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 +133639,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 +133706,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+20934) } /* 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 +133812,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 +133828,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+20952, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -133491,7 +133918,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 +134080,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+21017, 0) goto trigger_cleanup } iDb = int32(1) @@ -133693,7 +134120,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+21063, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -133703,11 +134130,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+21071, 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+21112, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -133716,13 +134143,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+21063, (*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+21152, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -133730,8 +134157,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+21178, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -133739,15 +134166,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 + 21216 } else { - v1 = __ccgo_ts + 21151 + v1 = __ccgo_ts + 21223 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21157, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21229, 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+21266, 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 +134194,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 +134296,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+21063, 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 +134318,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+21312, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -133907,10 +134334,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+21360, 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+21435, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -134178,11 +134605,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+21464, 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 +134647,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 +134664,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+21484, 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 +134797,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 + 21546 } else { - v1 = __ccgo_ts + 21481 + v1 = __ccgo_ts + 21553 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21488, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21560, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -134476,7 +134903,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+21608, 0) return int32(1) } @@ -134624,12 +135051,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 +135064,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 +135090,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 +135104,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 +135172,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 +135271,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+21650, 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 +135298,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 +135370,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 +135786,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 +135800,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 +135861,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 +135900,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 +135944,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+21664, 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+21700, 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 +136013,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 +136035,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 +136055,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 +136068,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 +136088,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 +136115,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 +136158,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 +136499,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -136130,8 +136550,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 +136598,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 +136614,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 +136661,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+21719) } goto update_cleanup update_cleanup: @@ -136298,13 +136718,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 +136766,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 +137095,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+21732, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21664, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21736, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -136766,13 +137186,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 +137200,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+13030, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -136862,7 +137282,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+21809, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21813, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -136953,7 +137373,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 +137412,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+21817) 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+21857) 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+21900) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -137019,7 +137439,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+21949) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -137072,7 +137492,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+15407) if rc != SQLITE_OK { goto end_of_vacuum } @@ -137103,11 +137523,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+21976, 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+22084, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -137116,7 +137536,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+22138, 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 +137546,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+22275, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -137269,7 +137689,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) @@ -137653,7 +138073,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+13260, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -137776,24 +138196,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+22398, 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+22422, 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+22521, 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 @@ -137877,7 +138302,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+22540, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -137919,9 +138344,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+22582, 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 +138359,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 + 22612 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -137968,7 +138393,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+17160, 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 +138474,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+22658, 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 +138561,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+22658, 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 +138609,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+22677, 0) return int32(SQLITE_ERROR) } goto _1 @@ -138195,9 +138620,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(158352))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158354)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -138239,7 +138664,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 +139030,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 +139120,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 +139140,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 +139204,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(158849)) } else { ap = va switch op { @@ -138792,7 +139217,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(158871)) break } _ = ap @@ -139477,7 +139902,6 @@ type TWhereInfo1 = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo1 = TWhereInfo1 @@ -139513,10 +139937,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 + 22690 } if i == -int32(1) { - return __ccgo_ts + 17197 + return __ccgo_ts + 17269 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -139535,10 +139959,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+22697, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22631, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22703, int32(1)) } i = 0 for { @@ -139546,7 +139970,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+13650, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -139555,11 +139979,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+22703, int32(1)) } i = 0 for { @@ -139567,16 +139991,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+13650, 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 +140047,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+22705, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -139631,12 +140055,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+22697, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22636 + v2 = __ccgo_ts + 22708 } else { - v2 = __ccgo_ts + 22641 + v2 = __ccgo_ts + 22713 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -139653,7 +140077,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+22721) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -139664,9 +140088,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+22723) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5519, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5545, int32(1)) } // C documentation @@ -139711,11 +140135,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 + 22725 } else { - v2 = __ccgo_ts + 22660 + v2 = __ccgo_ts + 22732 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22665, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22737, 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 +140152,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 + 11813 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22671 + zFmt = __ccgo_ts + 22743 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22704 + zFmt = __ccgo_ts + 22776 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22729 + zFmt = __ccgo_ts + 22801 } else { - zFmt = __ccgo_ts + 22747 + zFmt = __ccgo_ts + 22819 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22756, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22828, 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 + 17269 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22836, 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+22867, libc.VaList(bp+144, zRowid)) cRangeOp = int8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -139768,14 +140192,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+22877, 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+22882) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22832 + v3 = __ccgo_ts + 22904 } else { - v3 = __ccgo_ts + 22840 + v3 = __ccgo_ts + 22912 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -139796,7 +140220,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+22918, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -139862,14 +140286,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+22929, 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+22708, 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+22950, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -139893,16 +140317,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+22697, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22636, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22708, 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 +140531,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 @@ -140186,7 +140610,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 */ @@ -140306,7 +140730,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i 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)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(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)) } @@ -140318,7 +140742,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } else { v3 = n } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(v3))) eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } pX = pExpr @@ -140356,10 +140780,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 @@ -140548,7 +140972,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 +141103,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 @@ -140961,7 +141385,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 +141446,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 +141481,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 +141622,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 +141702,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 +141736,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 +141858,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 +142051,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 +142065,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 +142109,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 +142133,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 +142169,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 +142201,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 +142256,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+22958, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -141851,7 +142279,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+22973, 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 +142768,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,7 +142779,7 @@ 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+22982, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { @@ -142397,15 +142825,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 +142846,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 +142919,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 +143317,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 17046, + FzOp: __ccgo_ts + 17118, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16377, + FzOp: __ccgo_ts + 16449, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15856, + FzOp: __ccgo_ts + 15908, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22924, + FzOp: __ccgo_ts + 22996, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -143688,7 +144117,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+23003, 0) return } } else { @@ -143700,10 +144129,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+23003, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -143784,7 +144213,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 +144314,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 + 23044 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -144416,7 +144845,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+23051, 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,7 +144917,6 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo @@ -144499,7 +144927,6 @@ type THiddenIndexInfo1 = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo1 = THiddenIndexInfo1 @@ -145532,7 +145959,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)<>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 @@ -148149,7 +148572,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { + })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0)) { if libc.Int32FromUint16((*(*struct { FnEq Tu16 FnBtm Tu16 @@ -148353,7 +148776,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 @@ -148637,7 +149060,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 +149238,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)) @@ -149156,7 +149579,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+23124, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -149231,7 +149654,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+23124, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -149385,7 +149808,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(168893)) /* 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 +150244,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+23150, 0) rc = SQLITE_OK } else { break @@ -151029,7 +151452,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+23185, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -151607,7 +152030,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 +152186,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+23203, 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 +152207,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 +152256,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+23231, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -151981,7 +152401,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 +152436,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. @@ -152141,7 +152562,7 @@ 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 @@ -152172,16 +152593,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 @@ -152360,7 +152781,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 { @@ -152567,7 +152988,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 +152998,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+23249, 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 +153048,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 +153317,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+23278, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -153078,7 +153499,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+23334, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -153404,7 +153825,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+23379, libc.VaList(bp+8, zName)) } return p } @@ -153455,12 +153876,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+23398, 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+23469, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -153533,7 +153954,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 } @@ -153671,7 +154092,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( 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 { @@ -153815,7 +154236,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+23532, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -153851,7 +154272,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 +154287,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 +154306,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 +154356,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 +154377,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 +154399,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 +154523,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+23558, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -154170,18 +154591,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 + 23590 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23535 + zErr = __ccgo_ts + 23607 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23551 + zErr = __ccgo_ts + 23623 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23571, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23643, 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 +154626,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+23676, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -154311,24 +154732,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 +154767,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 +154784,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 +154844,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 + 23723, + 1: __ccgo_ts + 23776, + 2: __ccgo_ts + 23278, + 3: __ccgo_ts + 23827, + 4: __ccgo_ts + 23879, } var _aOp1 = [5]int32{ @@ -155007,7 +155428,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 +155524,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 +156241,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 +156254,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 +156280,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 +156313,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 +156532,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 +156596,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+23929, libc.VaList(bp+8, p)) } // C documentation @@ -156185,6 +156610,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 +156644,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 + 23953 } else { - v1 = __ccgo_ts + 23890 + v1 = __ccgo_ts + 23962 } - _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+23968, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -156231,7 +156657,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+24010, 0) } } } @@ -156337,7 +156763,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+24044, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -162858,13 +163284,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) } @@ -164794,20 +165220,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+17269, 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+24082, 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+17205, 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+24082, 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 +165274,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 +165424,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 +165519,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 +165876,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+24109) 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) { @@ -165790,9 +166226,9 @@ _237: */ _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 + v347 = __ccgo_ts + 8446 } else { - v347 = __ccgo_ts + 8426 + v347 = __ccgo_ts + 8451 } *(*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 { @@ -166034,15 +166470,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+24118, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24141, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24213, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24225, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24297, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -166184,7 +166620,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 +166814,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+24382, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -169109,14 +169545,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)< int32(65528) { sz = int32(65528) } - if cnt < 0 { + /* 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 > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } szAlloc = int64(sz) * int64(cnt) - if sz == 0 || cnt == 0 { + 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)) @@ -170590,7 +171035,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182779)) + return _sqlite3MisuseError(tls, int32(183820)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -170610,7 +171055,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+24469, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -170911,14 +171356,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 + 25012 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -170930,31 +171375,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 + 24537, + 1: __ccgo_ts + 24550, + 3: __ccgo_ts + 24566, + 4: __ccgo_ts + 24591, + 5: __ccgo_ts + 24605, + 6: __ccgo_ts + 24624, 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 + 24649, + 9: __ccgo_ts + 24686, + 10: __ccgo_ts + 24698, + 11: __ccgo_ts + 24713, + 12: __ccgo_ts + 24746, + 13: __ccgo_ts + 24764, + 14: __ccgo_ts + 24789, + 15: __ccgo_ts + 24818, + 17: __ccgo_ts + 6474, + 18: __ccgo_ts + 5878, + 19: __ccgo_ts + 24835, + 20: __ccgo_ts + 24853, + 21: __ccgo_ts + 24871, + 23: __ccgo_ts + 24905, + 25: __ccgo_ts + 24926, + 26: __ccgo_ts + 24952, + 27: __ccgo_ts + 24975, + 28: __ccgo_ts + 24996, } // C documentation @@ -171101,6 +171546,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 // // /* @@ -171133,7 +171592,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i 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(183430)) + return _sqlite3MisuseError(tls, int32(184509)) } 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) @@ -171176,7 +171635,7 @@ 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+25093, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -171302,7 +171761,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+25156, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -171333,7 +171792,7 @@ 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) } @@ -171577,7 +172036,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(184046)) + return _sqlite3MisuseError(tls, int32(185125)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -171587,7 +172046,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+25207, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -171709,7 +172168,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(184182))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185261))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -171841,7 +172300,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(184261)) + return _sqlite3MisuseError(tls, int32(185340)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -171851,7 +172310,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(184270)) + return _sqlite3MisuseError(tls, int32(185349)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -171900,7 +172359,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(184318)) + return _sqlite3MisuseError(tls, int32(185397)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -171909,7 +172368,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+25228, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -172056,7 +172515,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+25296, 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 @@ -172086,8 +172545,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+25302, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25312, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -172176,24 +172635,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+25340, 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+25344, 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 + 25344 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25293, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25365, 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 @@ -172222,12 +172681,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+25380, 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+25400, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -172251,7 +172710,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+25424, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -172271,11 +172730,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 25278, + Fz: __ccgo_ts + 25350, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 25285, + Fz: __ccgo_ts + 25357, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -172286,19 +172745,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 25298, + Fz: __ccgo_ts + 25370, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 25301, + Fz: __ccgo_ts + 25373, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 25304, + Fz: __ccgo_ts + 25376, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 18283, + Fz: __ccgo_ts + 18355, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -172426,8 +172885,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+23044, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25440, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -172448,10 +172907,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(184993)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186072)) /* 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) } @@ -172460,7 +172919,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) } @@ -172487,9 +172946,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 + 24442 (*(*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 { @@ -172583,7 +173042,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 + 25446 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -172743,7 +173202,7 @@ 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) @@ -172800,20 +173259,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+25449, 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+25474) } 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+25494) } 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+25501) } // C documentation @@ -172838,9 +173297,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) @@ -172867,29 +173326,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 @@ -172944,15 +173392,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+25518, 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) @@ -173131,8 +173579,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 @@ -173576,7 +174024,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: ; @@ -173972,7 +174420,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+25546, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -174190,7 +174638,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 + 25554 } else { v2 = uintptr(0) } @@ -174269,7 +174717,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) @@ -174436,7 +174884,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 @@ -174653,6 +175101,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -174965,8 +175420,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 @@ -175023,7 +175478,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 @@ -175033,7 +175488,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 @@ -175071,18 +175526,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 + 25577, + 12: __ccgo_ts + 25583, 13: __ccgo_ts + 1665, 14: __ccgo_ts + 1665, 15: __ccgo_ts + 1665, @@ -175569,7 +176024,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) { @@ -175867,8 +176322,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) } } @@ -176004,7 +176459,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+15851, 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)) @@ -176018,14 +176473,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+25590, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -176079,7 +176532,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+25619, -int32(1)) } } } @@ -176362,8 +176815,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 + 25634, + FzRepl: __ccgo_ts + 25638, }, 1: { Fc1: int8('i'), @@ -176371,8 +176824,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 + 25646, + FzRepl: __ccgo_ts + 25638, }, 2: { Fc1: int8('n'), @@ -176387,7 +176840,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25600, + FzMatch: __ccgo_ts + 25655, FzRepl: __ccgo_ts + 1651, }, 4: { @@ -176395,7 +176848,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25605, + FzMatch: __ccgo_ts + 25660, FzRepl: __ccgo_ts + 1651, }, } @@ -176411,7 +176864,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+25665, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -176429,23 +176882,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 } @@ -176523,7 +176976,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 @@ -176594,7 +177047,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) + } } } } @@ -176869,7 +177326,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+25708, 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') { @@ -177299,7 +177756,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 { @@ -177338,7 +177795,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)) } @@ -177346,7 +177803,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)) } @@ -177423,14 +177880,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+25634, 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+25717) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25669) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25724) } - 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+25730, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -177615,7 +178072,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+25724) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -177660,7 +178117,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+25619, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -177673,7 +178130,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+25619, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -177722,10 +178179,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) @@ -177759,15 +178212,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 @@ -177840,11 +178293,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: ; @@ -177893,9 +178346,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25583 + v19 = __ccgo_ts + 25638 } else { - v19 = __ccgo_ts + 12288 + v19 = __ccgo_ts + 12313 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -177931,9 +178384,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: ; @@ -177960,7 +178416,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25681, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25736, uint32(2)) zIn2++ sz2-- continue @@ -177983,7 +178439,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25684, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25739, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -177991,12 +178447,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25691, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25746, 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+25751, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -178176,7 +178632,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+25758, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -178199,12 +178655,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+25761, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25703, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25758, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -178219,50 +178675,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 // // /* @@ -178314,6 +178726,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 // // /* @@ -178334,6 +178824,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)) @@ -178406,9 +178899,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 @@ -178451,7 +178944,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 @@ -178939,7 +179443,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+25619, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -179074,7 +179578,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 } @@ -179175,7 +179679,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+25619, -int32(1)) return } @@ -179212,11 +179716,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+25590, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -179229,7 +179730,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+25619, -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) @@ -179248,10 +179749,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+25724) } 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+25717) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -179290,7 +179791,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+25764, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -179306,7 +179807,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. // ** @@ -179387,7 +179888,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+25619, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -179399,34 +179900,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; +// ** 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. +// ** 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) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { + 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 (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) - return 0 + 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 (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - 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 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) @@ -179509,7 +180030,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 @@ -179569,7 +180090,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+25619, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -179704,7 +180225,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 + 25782 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -179714,7 +180235,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+25619, -int32(1)) } } eErr = uint8(1) @@ -179824,23 +180345,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+25784, uint32(1)) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25731, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25786, 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+25788, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25736, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25791, uint32(1)) } } } @@ -179880,7 +180401,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+25619, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -180148,7 +180669,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+25619, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -180172,7 +180693,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+25793, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -180183,7 +180704,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+25844, -int32(1)) _jsonStringReset(tls, bp) return } @@ -180255,7 +180776,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+25619, -int32(1)) } } goto json_remove_done @@ -180292,7 +180813,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+16371) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -180323,9 +180844,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 + 25878 } else { - v1 = __ccgo_ts + 25827 + v1 = __ccgo_ts + 25882 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -180373,7 +180894,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+25619, -int32(1)) } } goto json_type_done @@ -180420,7 +180941,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 + 25889 (*(*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)) @@ -180494,17 +181015,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+25894, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -180513,18 +181033,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 @@ -180586,9 +181105,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))) @@ -180695,7 +181212,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+25951, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -180787,20 +181304,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))) + } } } @@ -180844,7 +181363,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+25954, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -180947,7 +181466,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+25957) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -181081,7 +181600,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+26040, 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 @@ -181107,9 +181626,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+26047, 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+26055, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -181420,9 +181939,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))) @@ -181495,7 +182013,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+26061, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -181519,7 +182037,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+25619, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -181580,186 +182098,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 + 26063, }, 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 + 26068, }, 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 + 26074, }, 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 + 26085, }, 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 + 26097, }, 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 + 26097, }, 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 + 26115, }, 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 + 26135, }, 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 + 26148, }, 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 + 26162, }, 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 + 26165, }, 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 + 26169, }, 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 + 26181, }, 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 + 26194, }, 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 + 26206, }, 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 + 26219, }, 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 + 26230, }, 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 + 26242, }, 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 + 26242, }, 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 + 26254, }, 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 + 26265, }, 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 + 26277, }, 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 + 26290, }, 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 + 26303, }, 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 + 26317, }, 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 + 26326, }, 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 + 26336, }, 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 + 26336, }, 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 + 26346, }, 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 + 26346, }, 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 + 26357, }, 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 + 26374, }, 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 + 26392, }, 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 + 26410, }, } @@ -181842,17 +182360,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 26374, + FzName: __ccgo_ts + 26429, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 26384, + FzName: __ccgo_ts + 26439, 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 @@ -181960,7 +182480,6 @@ type TRtreeMatchArg = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - FaParam [1]TRtreeDValue } type RtreeMatchArg = TRtreeMatchArg @@ -182243,11 +182762,12 @@ type TRtreeMatchArg1 = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - 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 ** clang, since clang works hard to be gcc compatible. So the gcc @@ -182430,7 +182950,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 @@ -182493,7 +183013,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+26449, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -182504,7 +183024,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 { @@ -182798,7 +183318,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+26454, 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 { @@ -183339,7 +183859,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) } @@ -183719,7 +184239,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+26536) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -183797,7 +184317,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) @@ -184028,7 +184548,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 } @@ -184036,7 +184556,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 @@ -184274,7 +184794,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: @@ -184696,7 +185216,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 @@ -185209,7 +185729,7 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -185226,7 +185746,7 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -185254,7 +185774,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+26550, 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 { @@ -185264,11 +185784,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+26570, 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+26602, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185482,7 +186002,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+26639, 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)) @@ -185536,9 +186056,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 + 26784 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+12142, 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) { @@ -185596,9 +186116,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 + 26840, + 1: __ccgo_ts + 5939, + 2: __ccgo_ts + 17269, } var _rtreeModule = Tsqlite3_module{ @@ -185642,21 +186162,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+27254, 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+27316, 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+27321, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27385, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27455, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -185686,7 +186206,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 + 27504 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -185701,31 +186221,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+27612, 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+27657, 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+13650, 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+27684, 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+27706, 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+27714, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -185739,14 +186259,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 + 26845, + 1: __ccgo_ts + 26898, + 2: __ccgo_ts + 26943, + 3: __ccgo_ts + 26995, + 4: __ccgo_ts + 27049, + 5: __ccgo_ts + 27094, + 6: __ccgo_ts + 27152, + 7: __ccgo_ts + 27207, } // C documentation @@ -185804,7 +186324,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+27730, 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) @@ -185812,17 +186332,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+27750, 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))) @@ -185885,7 +186405,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) } @@ -185899,13 +186419,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+27993, 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+27999, 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) { @@ -185914,7 +186434,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+28023, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -185928,19 +186448,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+28050, 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))) } } } @@ -185963,7 +186483,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)) @@ -185974,7 +186494,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 @@ -185990,8 +186510,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27974, - 1: __ccgo_ts + 27985, + 0: __ccgo_ts + 28029, + 1: __ccgo_ts + 28040, } // C documentation @@ -186049,21 +186569,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+11762, 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+28053, 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+28059, 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+28063, int32(1)) goto _1 _1: ; @@ -186090,7 +186610,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+28065, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -186193,7 +186713,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) @@ -186208,11 +186728,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+28098, 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) } @@ -186246,7 +186766,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+28105, 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) @@ -186263,7 +186783,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+28150, libc.VaList(bp+8, iNode)) } } return pRet @@ -186292,8 +186812,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 + 28182, + 1: __ccgo_ts + 28236, } 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)) @@ -186306,21 +186826,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 + 28284 } else { - v1 = __ccgo_ts + 28237 + v1 = __ccgo_ts + 28292 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28246, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28301, 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 + 28284 } else { - v2 = __ccgo_ts + 28237 + v2 = __ccgo_ts + 28292 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28291, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28346, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -186365,7 +186885,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+28404, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -186383,7 +186903,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+28452, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -186416,19 +186936,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+28519, 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+28553, 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+28583, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -186473,12 +186993,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+28638, 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+28669, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -186507,7 +187027,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+28736, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -186517,11 +187037,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+26550, 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+28764, 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)) @@ -186537,8 +187057,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+28795, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28802, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -186565,7 +187085,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+28810, 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) } @@ -186616,13 +187136,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+28829, -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))) } @@ -186631,7 +187151,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 + 19082 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -186898,7 +187418,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++ @@ -186943,7 +187463,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 @@ -187005,7 +187525,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 } @@ -187373,7 +187893,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 @@ -187388,9 +187908,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: ; @@ -187475,7 +187995,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 { @@ -187616,7 +188136,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 // ** @@ -187655,7 +188175,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) } @@ -187759,7 +188279,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 @@ -187843,7 +188363,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 @@ -188127,7 +188647,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) { @@ -188284,7 +188804,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 @@ -188296,13 +188816,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+27993, 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+28953, 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) @@ -188311,13 +188831,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+28975, 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+28050, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -188325,7 +188845,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) @@ -188340,7 +188860,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 @@ -188552,7 +189072,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 + 17269 (*(*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) @@ -188562,7 +189082,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 + 28979 (*(*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) @@ -188570,7 +189090,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 + 28985 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -188690,7 +189210,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+28994, 0) } goto geopoly_update_end } @@ -188793,12 +189313,12 @@ geopoly_update_end: func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28979) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+29034) == 0 { *(*uintptr)(unsafe.Pointer(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 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+29050) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) @@ -188869,7 +189389,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+29227, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -188883,61 +189403,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29010, + FzName: __ccgo_ts + 29065, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29023, + FzName: __ccgo_ts + 29078, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29036, + FzName: __ccgo_ts + 29091, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 29049, + FzName: __ccgo_ts + 29104, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28995, + FzName: __ccgo_ts + 29050, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 29061, + FzName: __ccgo_ts + 29116, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28979, + FzName: __ccgo_ts + 29034, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 29084, + FzName: __ccgo_ts + 29139, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29098, + FzName: __ccgo_ts + 29153, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 29111, + FzName: __ccgo_ts + 29166, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 29125, + FzName: __ccgo_ts + 29180, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29141, + FzName: __ccgo_ts + 29196, }, } @@ -188963,7 +189483,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 29153, + FzName: __ccgo_ts + 29208, }, } @@ -188988,20 +189508,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+29235, 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+29245, 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+29256, -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+28979, 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+29267, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -189075,7 +189595,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) @@ -189103,7 +189623,7 @@ 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+26536, __ccgo_fp(_rtreeMatchArgFree)) } } } @@ -189344,7 +189864,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 @@ -190320,7 +190840,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+29277, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -190330,7 +190850,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+29277, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -190356,7 +190876,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 @@ -190379,7 +190899,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 } @@ -190511,7 +191031,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+29298, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -190600,7 +191120,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+26449, 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')) { @@ -190637,13 +191157,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 + 29469 } 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+29510, 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+29660) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -190810,7 +191330,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))) } } @@ -190871,7 +191391,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+29785, 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 @@ -190881,7 +191401,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+29904, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -190889,7 +191409,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+29925, 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) @@ -190901,7 +191421,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+29976, 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 { @@ -190945,7 +191465,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+29997, 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))) { @@ -190958,7 +191478,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+30025, 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 { @@ -191011,7 +191531,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+20588, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -191022,7 +191542,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+30054, 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) @@ -191033,7 +191553,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+30073, 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 @@ -191041,7 +191561,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+30078, zName) { bRbuRowid = int32(1) } } @@ -191055,17 +191575,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 + 30088 } else { - v4 = __ccgo_ts + 30046 + v4 = __ccgo_ts + 30101 } - (*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+30110, 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+30139, 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)) @@ -191087,7 +191607,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+30161, 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)) @@ -191133,8 +191653,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+30188, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15518 goto _1 _1: ; @@ -191168,7 +191688,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+30197, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -191216,21 +191736,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+30210, 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+30242, 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+15518, __ccgo_ts+30265) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+30271, __ccgo_ts+30278, __ccgo_ts+5545) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15518, __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+30286, 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+30328, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -191282,7 +191802,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+30025, 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)) @@ -191304,15 +191824,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 + 30348 } } 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+30356, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30377, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30413, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15518 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -191321,7 +191841,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+30440, 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 @@ -191338,15 +191858,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+30488, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15518 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+30495, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -191404,7 +191924,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+30025, 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)) @@ -191413,7 +191933,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+30507, 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 { @@ -191433,9 +191953,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 + 30348 } else { - zCol = __ccgo_ts + 30023 + zCol = __ccgo_ts + 30078 } } zType = __ccgo_ts + 1139 @@ -191443,24 +191963,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+30529, 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 + 30265 } 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+30549, 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+30570, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30603, 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 + 15518 + zAnd = __ccgo_ts + 22697 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -191514,11 +192034,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+30627, 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+30639, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15493 + zS = __ccgo_ts + 15518 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -191530,7 +192050,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+30648, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -191556,7 +192076,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+30663, 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 @@ -191566,15 +192086,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+30677, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22697 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30634, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30689, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1665 i1 = 0 @@ -191584,8 +192104,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+30739, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22697 } goto _2 _2: @@ -191608,7 +192128,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+30752, 0) } // C documentation @@ -191650,16 +192170,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+30739, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15518 } 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+30778, 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 + 15518 } 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+30808, 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 + 15518 } } } @@ -191743,16 +192263,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 + 30845 *(*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+29997, 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+17157) == 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+30025, libc.VaList(bp+24, zIdx))) } break } @@ -191763,16 +192283,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 + 30265 } 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+30858, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15518 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30814, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30869, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -191818,7 +192338,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+30873) 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))) { @@ -191826,7 +192346,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+30025, 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))) { @@ -191835,21 +192355,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+30923, 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 + 30265 } 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+30945, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15518 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30900, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30955, 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+30970, 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)) } } @@ -191886,7 +192406,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) { @@ -191895,19 +192415,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 + 31032 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30990 + v2 = __ccgo_ts + 31045 } 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+31055, 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 + 15518 goto _1 _1: ; @@ -191916,17 +192436,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+31082, 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 + 31089 } 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+31104, 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)) } } @@ -191952,7 +192472,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+31136, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -191998,7 +192518,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+31193) } 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)) @@ -192167,7 +192687,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+31259, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -192184,18 +192704,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+31279, 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+31344, 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+31380, 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 { @@ -192210,26 +192730,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 + 31414 } else { - v2 = __ccgo_ts + 31363 + v2 = __ccgo_ts + 31418 } 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+31424, 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+31485, 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 + 31414 } else { - v3 = __ccgo_ts + 31363 + v3 = __ccgo_ts + 31418 } - 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+31546, 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 { @@ -192248,8 +192768,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). */ @@ -192258,39 +192778,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 + 31705 } 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 + 31714 } 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+31724, 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+31760, 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 + 31788 } /* 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 + 31800 } 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+31817, 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+31893, 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+32192, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -192301,9 +192821,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 + 32291 } else { - v7 = __ccgo_ts + 32246 + v7 = __ccgo_ts + 32301 } zRbuRowid1 = v7 } @@ -192316,14 +192836,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+30348, 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+15518, __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 + 32312 } else { v8 = __ccgo_ts + 1665 } @@ -192333,11 +192853,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 + 23953 } 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+32318, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -192425,9 +192945,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 + 31705 } - 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+32366, 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 } @@ -192454,7 +192974,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) } @@ -192501,7 +193021,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+32396, 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): @@ -192560,27 +193080,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+32426, 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+32454, 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+32472, 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 } @@ -192613,10 +193133,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+32538, 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+25296, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -192632,14 +193152,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 + 32570 } 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+32572, 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 @@ -192650,27 +193170,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+32604, -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+32619, 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+32636, -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+32652, 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+32680, 0) } } @@ -192756,7 +193276,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { if pState == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32597, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32652, uintptr(0), uintptr(0), uintptr(0)) } } /* Assuming no error has occurred, run a "restart" checkpoint with the @@ -192789,7 +193309,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CAPTURE) - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32643, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32698, uintptr(0), uintptr(0), uintptr(0)) if rc2 != int32(SQLITE_NOTICE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -192852,7 +193372,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) } @@ -192922,16 +193442,16 @@ 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) + 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_methods1)(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) } - 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)) @@ -192953,7 +193473,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+32733, 0) } // C documentation @@ -192970,13 +193490,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+32758, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32765, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -193108,7 +193628,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+24853, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -193244,7 +193764,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+32772) 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 @@ -193257,7 +193777,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+32794, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -193284,7 +193804,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+32821, 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))) @@ -193320,9 +193840,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+32981, 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+32996, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -193345,9 +193865,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+33016, 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+33041) } 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) @@ -193358,10 +193878,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+33149) } 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+33214) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -193379,7 +193899,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+33258, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -193406,8 +193926,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+18258) + _rbuCopyPragma(tls, p, __ccgo_ts+17353) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -193415,7 +193935,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+33283, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -193437,10 +193957,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+15422, 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+15422, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -193527,7 +194047,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+33311, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -193550,10 +194070,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+32758, 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) } @@ -193575,7 +194095,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+33336, 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) @@ -193622,7 +194142,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+33347, 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 { @@ -193667,11 +194187,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+33419, 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+33433) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -193680,7 +194200,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+33490) 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) @@ -193728,7 +194248,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 @@ -193760,7 +194280,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+33564, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -193782,17 +194302,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 + 33596 } else { - v3 = __ccgo_ts + 33548 + v3 = __ccgo_ts + 33603 } - (*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+33610, 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+15407, 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) @@ -193804,21 +194324,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+17972) + _rbuCopyPragma(tls, p, __ccgo_ts+17368) } /* 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+33642, 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+33658, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -193896,7 +194416,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+33682, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -193943,7 +194463,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+31705, 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++ @@ -193971,7 +194491,7 @@ 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+15422, 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) { @@ -193980,7 +194500,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { } _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+15422, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -193990,7 +194510,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+33690, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -194091,7 +194611,7 @@ 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+15422, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ @@ -194104,19 +194624,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { 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+15422, 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 + 15407 } else { - v1 = __ccgo_ts + 33587 + v1 = __ccgo_ts + 33642 } 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+33642, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -194602,7 +195122,7 @@ func _rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileSize})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, pSize) /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existence of a *-wal file. rbuVfsRead() contains ** similar logic. */ if rc == SQLITE_OK && *(*Tsqlite_int64)(unsafe.Pointer(pSize)) == 0 && (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpRbu)).FzTarget == uintptr(0) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_MAIN_DB) != 0 { *(*Tsqlite_int64)(unsafe.Pointer(pSize)) = int64(1024) @@ -194683,7 +195203,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xControl})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, int32(SQLITE_FCNTL_ZIPVFS), bp) if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33662, 0) + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33717, 0) } else { if rc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p @@ -194709,7 +195229,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r if rc == SQLITE_OK && op == int32(SQLITE_FCNTL_VFSNAME) { pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs zIn = *(*uintptr)(unsafe.Pointer(pArg)) - zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33685, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33740, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -194904,7 +195424,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag if pDb != 0 { if (*Trbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == int32(RBU_STAGE_OAL) { if (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) { - zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+7059) + zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+7084) zOpen = Xsqlite3_filename_wal(tls, zOpen) } nOpen = libc.Xstrlen(tls, zOpen) @@ -194918,7 +195438,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag } else { (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu } - if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33696, 0) != 0 { + if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33751, 0) != 0 { oflags = libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) } @@ -195474,7 +195994,7 @@ func _statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint _sqlite3TokenInit(tls, bp, *(*uintptr)(unsafe.Pointer(argv + 3*8))) iDb = _sqlite3FindDb(tls, db, bp) if iDb < 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12726, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12751, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) return int32(SQLITE_ERROR) } } else { @@ -195786,7 +196306,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { _sqlite3BtreeEnter(tls, pBt) nUsable = szPage - _sqlite3BtreeGetReserveNoMutex(tls, pBt) _sqlite3BtreeLeave(tls, pBt) - (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32)) + (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32))) if (*TStatPage)(unsafe.Pointer(p)).FaCell == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -195833,7 +196353,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } (*TStatCell)(unsafe.Pointer(pCell)).FnLastOvfl = libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp)) - libc.Uint32FromInt32(nLocal) - libc.Uint32FromInt32((nOvfl-int32(1))*(nUsable-int32(4)))) (*TStatCell)(unsafe.Pointer(pCell)).FnOvfl = nOvfl - (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(4)*libc.Uint64FromInt32(nOvfl)) + (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(uint64(4)*libc.Uint64FromInt32(nOvfl))) if (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -195974,7 +196494,7 @@ statNextRestart: (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiPgno = iRoot (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v1 = Xsqlite3_mprintf(tls, __ccgo_ts+4098, 0) + v1 = Xsqlite3_mprintf(tls, __ccgo_ts+4124, 0) z = v1 (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FzPath = v1 if z == uintptr(0) { @@ -196012,8 +196532,8 @@ statNextRestart: if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { (*TStatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33707 - v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33716, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33762 + v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33771, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) z = v2 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v2 if z == uintptr(0) { @@ -196042,7 +196562,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage++ if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226029)) + return _sqlite3CorruptError(tls, int32(227304)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -196053,7 +196573,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+33783, 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) { @@ -196076,13 +196596,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 + 33791 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 + 33800 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33750 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33805 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -196091,7 +196611,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) { @@ -196180,12 +196700,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+33815, 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+33970, 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+33984, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -196262,7 +196782,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+33999, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -197463,7 +197983,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) { @@ -197556,11 +198076,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+12142, 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+34006, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1665, 0) @@ -197569,7 +198089,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+34136, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -197595,10 +198115,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+30348))) 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) @@ -197619,8 +198139,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+30348) + libc.X__builtin___memcpy_chk(tls, pAlloc, __ccgo_ts+30348, 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) @@ -197684,7 +198204,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 @@ -197701,6 +198221,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 { @@ -197722,12 +198244,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+12142, (*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))) } } } @@ -198017,10 +198539,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 + 11762 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+34111, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+34166, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -198032,8 +198554,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 + 15518 goto _1 _1: ; @@ -198687,8 +199209,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+34173, 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 + 22697 if zRet == uintptr(0) { break } @@ -198717,8 +199239,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+34207, 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 + 34248 if zRet == uintptr(0) { break } @@ -198729,7 +199251,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 } @@ -198740,12 +199262,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 + 34253 } 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+34264, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -198806,11 +199328,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15493 + v2 = __ccgo_ts + 15518 } 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+34343, 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 } @@ -198838,7 +199360,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+34362, 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 { @@ -198867,17 +199389,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)) @@ -198890,7 +199413,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 } @@ -198901,18 +199426,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+34419, 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+34450, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -198938,7 +199489,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+34471, 0) } rc = int32(SQLITE_SCHEMA) } @@ -198986,7 +199537,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) } @@ -199270,7 +199821,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) } @@ -199570,12 +200121,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+34498, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+12142, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34502, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34526, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34535, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34580, bp) } else { i = 0 for { @@ -199583,17 +200134,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+15518, 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 + 15518 _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+34594, 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+34598, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -199607,7 +200158,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+34625, 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) } @@ -199749,7 +200300,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, 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+34667, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -199855,7 +200406,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } } 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+34687, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -200110,13 +200661,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 } } @@ -200272,7 +200824,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(230285)) + rc = _sqlite3CorruptError(tls, int32(231591)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -200296,7 +200848,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(230305)) + rc = _sqlite3CorruptError(tls, int32(231611)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -200311,7 +200863,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(230315)) + rc = _sqlite3CorruptError(tls, int32(231621)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -200367,7 +200919,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(230363)) + rc = _sqlite3CorruptError(tls, int32(231669)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -200472,7 +201024,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(230451)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231757)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -200543,8 +201095,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) @@ -200578,7 +201130,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(230537)) + v7 = _sqlite3CorruptError(tls, int32(231843)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -200588,7 +201140,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(230543)) + v10 = _sqlite3CorruptError(tls, int32(231849)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -200667,7 +201219,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(230587)) + v16 = _sqlite3CorruptError(tls, int32(231893)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -201005,7 +201557,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 @@ -201077,7 +201629,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230952)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232258)) goto finished_invert } if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { @@ -201280,7 +201832,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+12142) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -201289,9 +201841,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+34705, 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+34718, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -201301,9 +201853,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+34724, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15493 + zSep = __ccgo_ts + 15518 } goto _2 _2: @@ -201312,7 +201864,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+34729, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -201321,13 +201873,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+34737, 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+34812, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22625 + zSep = __ccgo_ts + 22697 } goto _3 _3: @@ -201414,9 +201966,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+34818, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34622, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34729, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -201426,9 +201978,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+34724, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22625 + zSep = __ccgo_ts + 22697 } goto _1 _1: @@ -201436,9 +201988,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+34836, 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+34248, bp) zSep = __ccgo_ts + 1665 i = 0 for { @@ -201448,16 +202000,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+34812, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34737 + zSep = __ccgo_ts + 34844 } 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)) @@ -201483,7 +202035,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 @@ -201506,16 +202058,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+34849, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22631, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22703, 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+15518, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -201523,19 +202075,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+34867, 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+34878, 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)) } @@ -201558,12 +202110,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+12142, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34775) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34882) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34888) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34995) } return rc } @@ -201629,7 +202181,7 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231434)) + rc = _sqlite3CorruptError(tls, int32(232740)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -202045,7 +202597,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+35139, 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)) @@ -202058,7 +202610,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+35160, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -202158,10 +202710,10 @@ 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+35179, 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+35205, 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)) @@ -202192,7 +202744,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui ** 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)))) 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 @@ -202202,7 +202754,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 } @@ -202221,18 +202773,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+35235, 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+35279, 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+35350, 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+12142) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -202289,17 +202841,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35303, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35410, 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+35440, 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+35464, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35440, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -202413,7 +202965,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) } @@ -202783,7 +203335,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) } @@ -203075,7 +203627,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 { @@ -203111,11 +203663,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 @@ -203700,6 +204258,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 @@ -203745,8 +204304,7 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset @@ -203758,12 +204316,13 @@ type Fts5Colset = TFts5Colset ** This object is used by fts5_expr.c and fts5_index.c. */ type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 + FnCol 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 ** to parse the arguments passed to the CREATE VIRTUAL TABLE statement. @@ -204140,7 +204699,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -204168,16 +204726,14 @@ 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 @@ -204219,7 +204775,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 @@ -205023,7 +205579,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+35492, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -205379,7 +205935,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+35520, 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 */ } @@ -205684,7 +206240,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+35551, 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) } @@ -205783,7 +206339,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 + 35558 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -205871,7 +206427,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) } @@ -206038,7 +206594,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 + 35608 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -206309,7 +206865,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))) @@ -206401,13 +206957,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) } @@ -206433,13 +206989,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 + 35656 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 + 35712 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -206472,19 +207028,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35663, + FzFunc: __ccgo_ts + 35770, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35671, + FzFunc: __ccgo_ts + 35778, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35681, + FzFunc: __ccgo_ts + 35788, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35686, + FzFunc: __ccgo_ts + 35793, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -206872,7 +207428,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 @@ -207348,7 +207904,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+35809, 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) { @@ -207374,12 +207930,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+35816, 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+35847, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -207388,7 +207944,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+35880, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -207398,14 +207954,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+35917, 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+35926, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -207432,7 +207988,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+35959, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -207444,76 +208000,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+35993, 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+36001, 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+36033, 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+36039, 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+36058, 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+36101, 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+36058, 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+36123, 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+36137, 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+36175, 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+36186, 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+36221, 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+36228, 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 + 18338, }, 2: { - FzName: __ccgo_ts + 36152, + FzName: __ccgo_ts + 36259, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -207521,20 +208077,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+36267, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36191, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36298, 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+36308, 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+36342, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -207595,16 +208151,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+36370) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+17269) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36375, 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+36405) { *(*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+36415, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -207630,7 +208186,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+36446, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -207638,12 +208194,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+36451, 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+36458, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36359, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36466, 0) } } goto _1 @@ -207659,9 +208215,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+36473, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36359, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36466, 0) } goto _2 _2: @@ -207724,8 +208280,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+36370) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36481, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -207756,7 +208312,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+36510, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -207786,7 +208342,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+36530, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -207794,37 +208350,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+36580, 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+36635, 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 + 35993 } 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 + 35993 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36581 + zTail = __ccgo_ts + 36688 } } } 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+36696, 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+17269, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -207893,7 +208449,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+36707, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -207902,16 +208458,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 + 15518 } 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+36723, 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+36730, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36370)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -208069,7 +208625,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+36756) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -208080,7 +208636,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+36761) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -208091,7 +208647,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+36770) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -208105,7 +208661,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+36780) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -208116,7 +208672,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+36790) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -208133,7 +208689,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+36802) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -208148,7 +208704,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+36370) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -208163,7 +208719,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+36814) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -208179,7 +208735,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+36828) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -208222,7 +208778,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 + 36838 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -208242,7 +208798,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+36870) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -208253,7 +208809,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+36878, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -208357,11 +208913,12 @@ type TFts5ExprNode1 = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode1 = TFts5ExprNode1 +/* Size (in bytes) of an Fts5ExprNode object that holds up to N children */ + /* ** 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. @@ -208391,24 +208948,26 @@ type TFts5ExprPhrase1 = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase1 = TFts5ExprPhrase1 +/* Size (in bytes) of an Fts5ExprPhrase object that holds up to N terms */ + /* ** 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 + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset1 = TFts5ExprNearset1 +/* Size (in bytes) of an Fts5ExprNearset object covering up to N phrases */ + /* ** Parse context. */ @@ -208499,7 +209058,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+36949, 0) return FTS5_EOF } goto _1 @@ -208510,7 +209069,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+36969, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -208525,13 +209084,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+37000, 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+37003, 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+31414, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -208575,7 +209134,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) @@ -210214,7 +210773,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) @@ -210224,7 +210783,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) @@ -210330,12 +210889,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 @@ -210469,7 +211028,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) @@ -210509,15 +211068,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)) @@ -210558,7 +211117,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 { @@ -210596,8 +211155,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+37007, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35520, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -210617,10 +211176,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+37012, 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: ; @@ -210654,7 +211216,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 { @@ -210704,7 +211266,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 @@ -210755,7 +211317,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+21700, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -210782,7 +211344,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)) @@ -210879,7 +211441,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+37041, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -210964,7 +211526,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) @@ -210977,7 +211539,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) @@ -211051,7 +211613,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 @@ -211077,11 +211639,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 + 37094 } else { - v2 = __ccgo_ts + 36900 + v2 = __ccgo_ts + 37007 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36994, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37101, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -211094,7 +211656,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+37151, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -211238,7 +211800,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 @@ -211571,7 +212133,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) { @@ -211635,7 +212197,7 @@ 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 +** to accumulate "term -> doclist" content before it is flushed to a level-0 ** segment. */ @@ -211694,7 +212256,7 @@ type TFts5HashEntry1 = struct { type Fts5HashEntry1 = TFts5HashEntry1 /* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -211832,7 +212394,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) } @@ -212144,7 +212706,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) } @@ -212576,9 +213138,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 @@ -212615,7 +213177,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -212688,7 +213249,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -212723,7 +213283,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -212738,9 +213297,9 @@ 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 @@ -212837,11 +213396,12 @@ type TFts5Structure1 = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure1 = TFts5Structure1 +/* Size (in bytes) of an Fts5Structure object holding up to N levels */ + /* ** An object of type Fts5SegWriter is used to write to segments. */ @@ -212974,13 +213534,15 @@ type Fts5SegIter1 = TFts5SegIter1 ** Array of tombstone pages. Reference counted. */ type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray1 = TFts5TombstoneArray1 +/* Size (in bytes) of an Fts5TombstoneArray holding up to N tombstones */ + /* ** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. @@ -213033,11 +213595,12 @@ type TFts5Iter1 = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter1 = TFts5Iter1 +/* Size (in bytes) of an Fts5Iter object holding up to N segment iterators */ + /* ** An instance of the following type is used to iterate through the contents ** of a doclist-index record. @@ -213063,13 +213626,15 @@ type TFts5DlidxLvl1 = struct { type Fts5DlidxLvl1 = TFts5DlidxLvl1 type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } 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)) *(*Tu8)(unsafe.Pointer(aOut + 1)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) & libc.Int32FromInt32(0xFF)) @@ -213248,7 +213813,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+37204, 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. @@ -213353,7 +213918,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+37210, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -213382,7 +213947,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+37261, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -213416,7 +213981,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+37310, 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) @@ -213494,7 +214059,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)) @@ -213585,7 +214150,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+37350, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -213596,7 +214161,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+37350, 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)) @@ -214277,7 +214842,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) @@ -214527,7 +215092,7 @@ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _ = nByte, nTomb, pNew nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(nTomb+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) if pNew != 0 { (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb @@ -214631,7 +215196,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 @@ -215237,7 +215802,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+37378, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -215326,7 +215891,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+37462, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -215973,7 +216538,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 @@ -216883,7 +217448,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 { @@ -217297,7 +217862,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+37544, 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. */ @@ -217803,7 +218368,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+37601, 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) @@ -217972,7 +218537,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 } @@ -218290,7 +218855,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+37662, 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))) @@ -218565,7 +219130,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: @@ -218600,7 +219165,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)) @@ -219214,11 +219779,12 @@ type TFts5TokenDataIter1 = struct { 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 // // /* @@ -219286,7 +219852,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) { @@ -219530,7 +220096,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) @@ -219580,7 +220146,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 @@ -219662,15 +220228,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) } @@ -219696,11 +220265,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+37713, 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+26449, __ccgo_ts+37721, 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+12353, __ccgo_ts+37756, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -219898,7 +220467,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) @@ -220153,7 +220722,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+37800) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -220504,7 +221073,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') @@ -220626,7 +221195,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 { @@ -220746,7 +221315,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+37204, 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))) @@ -221340,7 +221909,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+37802, 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)) @@ -221571,7 +222140,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+37888) 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)) @@ -221710,7 +222279,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -221867,11 +222435,12 @@ type TFts5Sorter1 = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter1 = TFts5Sorter1 +/* Size (int bytes) of an Fts5Sorter object with N indexes */ + /* ** Virtual-table cursor object. ** @@ -222193,7 +222762,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+37893, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -222230,7 +222799,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++ @@ -222249,7 +222818,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 @@ -222699,7 +223268,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 @@ -222727,7 +223296,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) } @@ -222747,7 +223316,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) @@ -222762,7 +223331,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 + 15518 } else { v1 = __ccgo_ts + 1665 } @@ -222772,11 +223341,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 + 37932 } else { - v3 = __ccgo_ts + 37830 + v3 = __ccgo_ts + 37937 } - 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+37941, 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 @@ -222834,14 +223403,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+37996, 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+38002, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -222891,7 +223460,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+38030, 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)) @@ -222924,7 +223493,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+38040, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -222958,7 +223527,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+38061, libc.VaList(bp+24, z)) } } } else { @@ -222966,7 +223535,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 + 35788 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -223123,7 +223692,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+38094, 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))) } @@ -223323,7 +223892,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+38099, 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 @@ -223456,10 +224025,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. @@ -225995,12 +226564,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+39448, 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+39552, 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+39590, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -226009,7 +226578,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+39628, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -226021,14 +226590,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+26449, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12353, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38782, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36581, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36688, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35886, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35993, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -226048,13 +226617,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 + 31089 } 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+39670, 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+39700, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -226095,7 +226664,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+39744, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -226103,7 +226672,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+39767, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -226118,7 +226687,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+39773, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -226127,22 +226696,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+35993, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39672 + zCols = __ccgo_ts + 39779 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39704 + zCols = __ccgo_ts + 39811 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36581, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36688, 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+38782, __ccgo_ts+39859, 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+36870, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -226562,12 +227131,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+39876, 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+39926, 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+39955, 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. */ @@ -226575,7 +227144,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+36870, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -226877,7 +227446,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+39984, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -227007,7 +227576,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) } @@ -227109,14 +227678,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+35993, 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 @@ -227768,11 +228337,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 + 40038 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) } @@ -227782,7 +228351,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+40047) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -227799,20 +228368,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+40058) { 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+40016) { 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+40027) { 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+40047) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -228104,7 +228673,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 + 40076 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -228321,64 +228890,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+40086, 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+40089, 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+40094, 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+40099, 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+40102, 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+40105, 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+40110, 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+40115, 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+40119, 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+40125, 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+40130, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -228387,49 +228956,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+40134, 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+40138, 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+40141, 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+40145, 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+40149, 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+40153, 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+40157, 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+40161, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -228446,20 +229015,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+40165, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40145, 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+40168, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40171, 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+40175, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40161, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -228475,75 +229044,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+40178, 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+40145, 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+40186, 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+40193, 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+40198, 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+40094, 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+40203, 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+40089, 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+40208, 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+40161, 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+40213, 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+16468, 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+40218, 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+40171, 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+40222, 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+40086, 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+40227, 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+40130, 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+40233, 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+40237, 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+40239, 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+40153, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -228552,48 +229121,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+40245, 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+40161, 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+40253, 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+40145, 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+40259, 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+40145, 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+40264, 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+40086, 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+40270, 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+40157, 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+40278, 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+40286, 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+40290, 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+40153, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -228601,21 +229170,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+40298, 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+40086, 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+40304, 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+40157, 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+40310, 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+40171, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -228633,48 +229202,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+40317, 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+40102, 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+40322, 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+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+39995, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40102, 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+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+39995, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40102, 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+40286, 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+40339, 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+40345, 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+40086, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -228690,13 +229259,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+40351, 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+40355, 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+40358, 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) @@ -228704,7 +229273,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+40361, 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) @@ -228869,14 +229438,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+40365) { 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+40058) { 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 { @@ -229144,7 +229713,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+40380)) } // C documentation @@ -229170,7 +229739,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39969, + FzName: __ccgo_ts + 40076, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -229178,7 +229747,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 40281, + FzName: __ccgo_ts + 40388, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -229186,7 +229755,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 40273, + FzName: __ccgo_ts + 40380, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -229216,7 +229785,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+40394, pApi, bp+96, uintptr(0)) } return rc } @@ -234732,16 +235301,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+40401) == 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+40405) == 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+40409) == 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+40418, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -234804,21 +235373,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 + 40452, + 1: __ccgo_ts + 40492, + 2: __ccgo_ts + 40527, } 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+24442, *(*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+40570, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -234839,23 +235409,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) } @@ -234988,10 +235558,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+40603, 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+40634, 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)) } @@ -235010,7 +235580,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+40685, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -235460,7 +236030,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+40711, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -235515,7 +236085,7 @@ 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 + 40721 } type TAggInfo_col = struct { @@ -235688,9 +236258,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 -------------------=== * @@ -235776,7 +236344,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 @@ -235824,11 +236392,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]int8{'3', '.', '4', '9', '.', '1'} +var Xsqlite3_version = [7]int8{'3', '.', '5', '0', '.', '1'} 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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods @@ -235838,3 +236406,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + diff --git a/vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go b/vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go index 101cfcd..05e464e 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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70" +const SQLITE_SOURCE_ID = "2025-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95" 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.1" -const SQLITE_VERSION_NUMBER = 3049001 +const SQLITE_VERSION = "3.50.1" +const SQLITE_VERSION_NUMBER = 3050001 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 @@ -5852,6 +5935,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 @@ -6284,7 +6368,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -8025,11 +8108,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,6 +8492,7 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem @@ -8448,6 +8538,7 @@ type THashElem1 = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem1 = THashElem1 @@ -8868,6 +8959,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 +9763,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 +9826,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 @@ -10007,7 +10140,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData = TDbClientData @@ -10077,9 +10209,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 +10226,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -10143,8 +10274,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 +10339,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -10280,19 +10410,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 +10439,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 +10451,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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 +10503,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -10384,6 +10515,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -10532,9 +10664,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 @@ -10589,6 +10721,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -10769,7 +10902,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -10811,7 +10943,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -11381,8 +11512,8 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. +/* Use SQLITE_ENABLE_EXPLAIN_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 @@ -12229,6 +12360,7 @@ type TTable1 = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table1 = TTable1 @@ -12310,11 +12442,13 @@ type TFKey1 = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey1 = TFKey1 +/* The size (in bytes) of an FKey object holding N columns. The answer +** does NOT include space to hold the zTo name. */ + /* ** SQLite supports many different ways to resolve a constraint ** error. ROLLBACK processing means that a constraint violation @@ -12363,11 +12497,12 @@ type TKeyInfo1 = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo1 = TKeyInfo1 +/* The size (in bytes) of a KeyInfo object with up to N fields */ + /* ** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. */ @@ -12769,13 +12904,16 @@ type Expr1 = TExpr1 ** expression. */ type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList1 = TExprList1 +/* The size (in bytes) of an ExprList object that is big enough to hold +** as many as N expressions. */ + /* ** Allowed values for Expr.a.eEName */ @@ -12796,12 +12934,14 @@ type ExprList1 = TExprList1 ** 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 + F__ccgo_align [0]uint64 + FnId int32 } type IdList1 = TIdList1 +/* The size (in bytes) of an IdList object that can hold up to N IDs. */ + /* ** Allowed values for IdList.eType, which determines which value of the a.u4 ** is valid. @@ -12907,13 +13047,19 @@ type OnOrUsing1 = TOnOrUsing1 ** */ type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList1 = TSrcList1 +/* Size (in bytes) of a SrcList object that can hold as many as N +** SrcItem objects. */ + +/* Size (in bytes( of a SrcList object that holds 1 SrcItem. This is a +** special case of SZ_SRCITEM(1) that comes up often. */ + /* ** Permitted values of the SrcList.a.jointype field */ @@ -13274,19 +13420,22 @@ type TParse1 = 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 @@ -13300,11 +13449,8 @@ type TParse1 = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -13315,40 +13461,41 @@ type TParse1 = 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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -13714,11 +13861,13 @@ type TWith1 = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With1 = TWith1 +/* The size (in bytes) of a With object that can hold as many +** as N different CTEs. */ + /* ** The Cte object is not guaranteed to persist for the entire duration ** of code generation. (The query flattener or other parser tree @@ -13748,11 +13897,13 @@ type TDbClientData1 = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData1 = TDbClientData1 +/* The size (in bytes) of a DbClientData object that can has a name +** that is N bytes long, including the zero-terminator. */ + /* ** This object is used in various ways, most (but not all) related to window ** functions. @@ -14918,7 +15069,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -14996,7 +15146,6 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor @@ -15034,11 +15183,16 @@ type TVdbeCursor1 = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor1 = TVdbeCursor1 +/* +** The size (in bytes) of a VdbeCursor object that has an nField value of N +** or less. The value of SZ_VDBECURSOR(n) is guaranteed to be a multiple +** of 8. + */ + /* Return true if P is a null-only cursor */ @@ -15249,21 +15403,14 @@ type Tsqlite3_context1 = struct { 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 */ +/* +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. + */ // C documentation // @@ -15396,7 +15543,7 @@ type TPreUpdate1 = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -15408,6 +15555,7 @@ type TPreUpdate1 = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate1 = TPreUpdate1 @@ -15545,7 +15693,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(24453)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -15717,7 +15865,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)) @@ -16098,7 +16246,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 +16317,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 +16456,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 +16553,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 +16694,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 +16708,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 +16786,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 +16934,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 +17237,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 +17394,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 +17442,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 +17547,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) @@ -18128,7 +18276,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 } @@ -18777,7 +18925,8 @@ func init() { // /* // ** Initialize the mutex system. // */ -func _sqlite3MutexInit(tls *libc.TLS) (r int32) { +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 @@ -20102,17 +20251,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 +20458,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 +20723,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 +20755,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 +20777,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 +21204,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 +21319,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 = v98 + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) + } + } + 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 +21349,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 +21368,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 +21421,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 - } - 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 + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + 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++ + } + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 + j1++ + 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 +21537,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 +21553,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 +21563,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 +21816,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 +22115,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 +22134,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)) } @@ -22542,6 +22772,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 +23573,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 +23748,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 +23960,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 +24200,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 +24290,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 +24517,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 +24677,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 +24786,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 +25197,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 +25226,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 +25240,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 +25325,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 +25680,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 +25749,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 +25783,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 +25804,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 +25817,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 +25833,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 +25845,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 +25894,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 +25904,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 +25935,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 +27493,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 +27512,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 @@ -27802,91 +28061,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, - }, - 14: { - FzName: __ccgo_ts + 3553, - }, - 15: { - FzName: __ccgo_ts + 3560, - }, - 16: { FzName: __ccgo_ts + 3570, }, + 14: { + FzName: __ccgo_ts + 3579, + }, + 15: { + FzName: __ccgo_ts + 3586, + }, + 16: { + FzName: __ccgo_ts + 3596, + }, 17: { - FzName: __ccgo_ts + 3577, - }, - 18: { - FzName: __ccgo_ts + 3591, - }, - 19: { - FzName: __ccgo_ts + 3597, - }, - 20: { FzName: __ccgo_ts + 3603, }, - 21: { - FzName: __ccgo_ts + 3610, + 18: { + FzName: __ccgo_ts + 3617, }, - 22: { - FzName: __ccgo_ts + 3618, - }, - 23: { + 19: { FzName: __ccgo_ts + 3623, }, - 24: { - FzName: __ccgo_ts + 3630, + 20: { + FzName: __ccgo_ts + 3629, }, - 25: { - FzName: __ccgo_ts + 3637, + 21: { + FzName: __ccgo_ts + 3636, }, - 26: { + 22: { + FzName: __ccgo_ts + 3644, + }, + 23: { FzName: __ccgo_ts + 3649, }, + 24: { + FzName: __ccgo_ts + 3656, + }, + 25: { + FzName: __ccgo_ts + 3663, + }, + 26: { + FzName: __ccgo_ts + 3675, + }, 27: { - FzName: __ccgo_ts + 3658, + FzName: __ccgo_ts + 3684, }, 28: { - FzName: __ccgo_ts + 3664, + FzName: __ccgo_ts + 3690, }, } @@ -28123,9 +28382,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 } } @@ -28446,7 +28705,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 +28733,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 +29451,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(40995)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -29848,7 +30107,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 +30668,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(42576)), __ccgo_ts+3603, bp, int32(42576)) } // C documentation @@ -30446,7 +30705,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)<= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43393)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -31061,7 +31320,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)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44803)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -32334,10 +32592,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 +32604,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 +32667,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 +32839,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 +32996,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(45251)), __ccgo_ts+3486, zName, int32(45251)) if rc == SQLITE_OK { rc = rc2 } @@ -32774,13 +33032,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(45305)) 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(45502)) 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(45507)), __ccgo_ts+3675, zIn, int32(45507)) return } (*(*[1026]int8)(unsafe.Pointer(bp + 144)))[got] = 0 @@ -33052,14 +33310,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(45565)), __ccgo_ts+3504, zPath, int32(45565)) } _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(45571)) } 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(46234)) (*TunixFile)(unsafe.Pointer(conchFile)).Fh = fd (*TunixFile)(unsafe.Pointer(conchFile)).FopenFlags = libc.Int32FromInt32(O_RDWR) | libc.Int32FromInt32(O_CREAT) goto end_breaklock @@ -33719,9 +33977,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(46242)) } - 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 +34200,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(46495)) } (*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(46503)) /* SQLITE_BUSY? proxyTakeConch called during locking */ } } @@ -34072,7 +34330,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 +34350,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 +34389,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 +34424,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 +34499,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 +34524,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 +34793,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, }, } @@ -34947,7 +35205,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 +35551,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 +35646,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 +35726,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 +35873,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 +35891,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 +35954,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 { @@ -36009,7 +36267,7 @@ 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)) - uint32(1)) / uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { @@ -36063,7 +36321,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 +36365,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 +36440,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 +36494,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) } } @@ -37523,7 +37781,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) - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 0) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0)) for { v4 = n n-- @@ -37806,17 +38064,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 +38094,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 +38106,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 +38307,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 @@ -40195,7 +40456,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 +40474,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 +41047,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 +41702,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 +41715,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 +41736,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 +41770,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 +42003,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 +42140,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 +42156,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)< int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65269)) } 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 +46263,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 +46827,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 @@ -46761,6 +47033,11 @@ type WalCkptInfo1 = TWalCkptInfo1 /* ** An open write-ahead log file is represented by an instance of the ** following object. +** +** writeLock: +** This is usually set to 1 whenever the WRITER lock is held. However, +** if it is set to 2, then the WRITER lock is held but must be released +** by walHandleException() if a SEH exception is thrown. */ type TWal1 = struct { FpVfs uintptr @@ -46827,13 +47104,15 @@ type ht_slot = Tht_slot ** This functionality is used by the checkpoint code (see walCheckpoint()). */ type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } 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 ** is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -46891,7 +47170,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 +47182,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 +47271,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 @@ -47433,7 +47713,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(67209)) } goto _1 _1: @@ -47521,12 +47801,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(67341)) 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 +47940,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 { @@ -48291,7 +48571,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(68150)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -48407,7 +48687,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 +48902,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 +48935,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(68601)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -49371,8 +49658,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 +49746,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(69451)) } iKey = _walNextHash(tls, iKey) } @@ -49956,7 +50243,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(69974)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -50205,7 +50492,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, /* 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(70234)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -50977,6 +51264,11 @@ type CellInfo1 = TCellInfo1 ** assumed that the database is corrupt. */ +/* +** Maximum amount of storage local to a database page, regardless of +** page size. + */ + /* ** A cursor is a pointer to a particular entry within a particular ** b-tree within a database file. @@ -51343,10 +51635,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 +51648,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,7 +52355,7 @@ 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(72422)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } @@ -52240,7 +52533,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(72620)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -52253,12 +52546,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(72633)) 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(72638)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -52302,7 +52595,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(72683)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -52310,7 +52603,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(72691)) } return SQLITE_OK } @@ -52498,7 +52791,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 +52824,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 +53023,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(73136)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -52770,12 +53063,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(73194)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73197)) } 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 +53076,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(73205)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73208)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73210)) } 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(73214)) } } cbrk = top + sz @@ -52844,12 +53137,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(73247)) } 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(73253)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -52865,7 +53158,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(73267)) } *(*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 +53218,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(73324)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -52942,14 +53235,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(73339)) } 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(73346)) } return uintptr(0) } @@ -52992,11 +53285,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(73394)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73397)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -53010,7 +53303,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(73414)) } else { return SQLITE_OK } @@ -53063,42 +53356,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(73498)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -53106,70 +53397,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(73510)) } - 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(73513)) } - 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(73526)) } - 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(73532)) } 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) + *(*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)) += libc.Int32FromUint16(iOrigSize) + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -53215,7 +53506,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(73602)) } } } else { @@ -53241,7 +53532,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(73626)) } } } @@ -53280,12 +53571,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(73677)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73682)) } 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(73692)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73696)) } } /* At this point, nFree contains the sum of the offset to the start @@ -53312,7 +53603,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(73708)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -53343,11 +53634,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(73739)) } 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(73744)) } goto _1 _1: @@ -53376,11 +53667,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(73776)) } (*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 +53680,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(73790)) } /* 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 +53702,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 +53716,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 +53831,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(73933)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -53604,7 +53893,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(74005)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -53692,7 +53981,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 +54605,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 +54767,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 +54805,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(74943)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -54957,7 +55246,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(75398)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -54981,7 +55270,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(75417)) } 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 +55279,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(75426)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -55004,7 +55293,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(75438)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -55034,7 +55323,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(75473)) } /* 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 +55419,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(75571)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -55168,7 +55457,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(75623)) } } 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 +55524,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(75691)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -55278,7 +55567,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(75742)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -55308,7 +55597,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(75769)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -55774,7 +56063,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(76233)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -56166,7 +56455,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(76657)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -56176,7 +56465,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(76672)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -56207,7 +56496,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 +56522,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(76743)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -56307,7 +56596,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(76827)) } return rc } @@ -56442,7 +56731,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(76965)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -56454,7 +56743,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(76979)) } if rc != 0 { v3 = pCur + 84 @@ -56570,7 +56859,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(77114)) } goto skip_init skip_init: @@ -56584,7 +56873,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(77126)) } 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 +57107,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(77375)) } } } @@ -57022,7 +57311,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes p3 = pCur + 1 *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(BTCF_ValidOvfl) | libc.Int32FromInt32(BTCF_AtLast))) if !((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76795)) + return _sqlite3CorruptError(tls, int32(77571)) } goto bypass_moveto_root /* Start search on the current page */ } @@ -57085,10 +57374,10 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ if nCell < int32(2) || libc.Uint32FromInt32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77658)) 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 +57405,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(77690)) } goto moveto_index_finish } @@ -57149,7 +57438,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(77721)) } *(*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 +57447,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(77732)) } if rc != 0 { v11 = pCur + 84 @@ -57287,7 +57576,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(77833)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -57397,7 +57686,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(77926)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -57485,7 +57774,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(78016)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -57540,7 +57829,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(78072)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -57566,7 +57855,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(78101)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -57593,7 +57882,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(78135)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -57664,7 +57953,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(78200)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -57802,7 +58091,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(78327)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -57853,7 +58142,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(78374)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -57862,7 +58151,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(78385)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -57952,7 +58241,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(78474)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -57970,7 +58259,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(78491)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -57993,7 +58282,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(78511)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -58214,10 +58503,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(78767)) 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 @@ -58608,12 +58897,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(79157)) } 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(79162)) } } pData -= uintptr(sz) @@ -58621,7 +58910,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(79168)) } libc.X__builtin___memmove_chk(tls, pData, pCell, uint64(sz), ^t__predefined_size_t(0)) i++ @@ -58716,7 +59005,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(79255)) 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 +59086,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 +59113,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 +59153,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(79377)) } 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 +59224,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(79455)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -58980,7 +59269,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(79495)) } /* 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 +59465,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 +59592,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 +59633,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(79919)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -59366,7 +59656,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(79943)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -59497,7 +59787,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(80044)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -59540,7 +59830,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(80077)) goto balance_cleanup } } @@ -59599,7 +59889,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(80121)) goto balance_cleanup } goto _11 @@ -59631,7 +59921,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(80154)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -59861,7 +60151,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(80355)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -60107,7 +60397,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(80587)) } goto _1 _1: @@ -60180,7 +60470,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(80647)) } 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 +60629,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(80811)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -60370,7 +60660,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(80839)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -60455,7 +60745,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(80920)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -60547,7 +60837,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(81043)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -60583,7 +60873,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(81085)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -60613,10 +60903,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(81112)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81115)) } 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 +61024,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(81217)) } 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 +61039,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(81242)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -60856,21 +61146,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(81338)) } } 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(81347)) } 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(81561)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -61115,7 +61405,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(81609)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -61196,14 +61486,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(81699)) } *(*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(81706)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -61340,7 +61630,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(81810)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -61605,7 +61895,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 +61943,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 +61973,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 +62049,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 +62189,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 +62279,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 +62302,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 +62379,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 +62393,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 +62484,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 +62508,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 +62549,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: @@ -62701,7 +62991,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 +63001,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 +63030,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 +63060,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 +63736,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 +63874,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 +64048,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 +64076,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 @@ -64546,7 +64833,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(85108)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -64710,7 +64997,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 +65006,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 +65064,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 +65085,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 +65110,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 +65217,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 +65232,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 +65536,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(85794)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -65264,7 +65552,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(85800)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -65274,7 +65562,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(85806)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -65735,12 +66023,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 +66201,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 +66218,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 +66286,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 +66300,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 +66341,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 +66381,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 +66883,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 +66896,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 +66945,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 +66967,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 +66994,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 +67794,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 } @@ -67658,7 +67948,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 +67956,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 +68198,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(90646))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -69296,7 +69586,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(90727))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -69331,7 +69621,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(90757))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -69385,7 +69675,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(90808))) return 0 /* Corrupt index */ } } @@ -69517,7 +69807,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(90971))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -69669,7 +69959,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(91129)) } // C documentation @@ -69700,7 +69990,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(91162)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -69851,15 +70141,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 +70244,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 +70257,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 +70339,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 +70349,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 +70407,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(91560)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -70619,7 +70910,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 +71111,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(92354)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -70950,7 +71241,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(92475)) } 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) @@ -71410,18 +71701,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 +71967,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(93091)) } 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(93095))) 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(93099)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -71834,7 +72125,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, 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) } @@ -72257,11 +72548,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(93642)) 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 +72561,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 +72575,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 +72610,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(93701)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -72354,7 +72645,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 +72711,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(93797)) 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 +72738,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 +72760,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 +72887,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 +72925,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 +72940,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 +73125,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 +73153,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 +73165,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 +73577,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 +73599,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 +73617,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 +74331,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 +75557,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 +75573,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 +76072,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(97561)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -75880,7 +76175,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 +76771,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 +76801,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 +76898,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. @@ -77714,7 +78009,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(99822)) } else { goto jump_to_p2 } @@ -78173,7 +78468,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 +78901,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(101119)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -78936,7 +79231,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 +79262,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 +79283,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(101412)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -79225,7 +79520,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 +79537,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 +79626,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 +79842,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 +79892,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 +79948,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 +80027,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 +80184,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 +80346,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 +80426,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 +80442,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 +80536,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 +80564,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 +80696,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 +80847,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 +80934,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 +81400,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) @@ -81203,7 +81490,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103962)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -81302,7 +81589,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(104062)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -81316,7 +81603,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) } @@ -81763,11 +82050,12 @@ type TVdbeSorter1 = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter1 = TVdbeSorter1 +/* Size (in bytes) of a VdbeSorter object that works with N or fewer subtasks */ + /* ** An instance of the following object is used to read records out of a ** PMA, in sorted order. The next key to be read is cached in nKey/aKey. @@ -82374,8 +82662,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 +82677,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) @@ -82589,18 +82877,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 { @@ -82888,6 +83177,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: @@ -85433,25 +85725,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 +85782,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 +85829,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 +85923,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 +85945,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 +86027,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 +86040,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 +86087,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 +86145,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 +86164,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 +86205,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 +86225,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 +86234,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 +86244,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 +86312,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -86120,19 +86387,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 +86425,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 +86571,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 +86626,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 +86650,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 +86664,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 +86690,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 +86707,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 +86823,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 +86835,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 +86881,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 +87006,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 +87041,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 +87079,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 +87149,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 +87183,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 +87496,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 +87563,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 +87574,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 +87584,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 +87806,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 +87886,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 +88094,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 +88569,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 +88648,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 +88835,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 +88993,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)) @@ -88777,7 +89046,7 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt 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)) { _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 +89074,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 +89094,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 +89165,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 +89217,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 +89250,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) } } @@ -89364,7 +89633,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 +89773,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 +89793,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 +89852,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 +89864,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 +89879,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 +89930,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 +90011,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 +90029,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 +90110,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 +90239,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 +90337,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 +91018,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 +91039,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 +91260,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 +91313,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 +91413,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 +92011,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 +92107,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 +92142,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 +92277,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 +92407,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)<= (*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 +93205,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 +93220,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 +93249,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 +93325,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 +93388,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 +93398,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) { @@ -93170,9 +93419,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 +93503,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 +93574,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 +93593,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 @@ -93375,7 +93624,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 +93694,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 +93738,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 @@ -93756,7 +94005,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 +94216,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 +94925,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) } @@ -95193,7 +95446,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) 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 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 @@ -95209,7 +95462,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) (*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 + v9 = pParse + 60 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 @@ -95294,7 +95547,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 +95555,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 +95573,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 +95592,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 +95714,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+8884, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -95480,10 +95733,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+8912, 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+9087, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -95499,9 +95752,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+9261, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9383, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9408, 0) } } @@ -95557,7 +95810,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+9559, 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 +95819,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+9618, 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+9624, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -95600,21 +95853,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+9651, 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+9835, 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+10140, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10156, 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+10214, 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 +95875,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 +95883,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+10479, 0) goto exit_rename_table exit_rename_table: ; @@ -95647,7 +95900,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+10492, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -95687,11 +95940,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+10530, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10537, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10562, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -95707,10 +95960,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+10589) } 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+10648) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -95722,13 +95975,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+10701) } _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+10747) } } /* Modify the CREATE TABLE statement. */ @@ -95742,7 +95995,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+10774, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -95770,7 +96023,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+10920, libc.VaList(bp+16, zTab, zDb)) } } } @@ -95808,12 +96061,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+11273, 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+11307, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -95828,7 +96081,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 +96089,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+11337, 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 +96151,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 + 11356 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 11336 + zType = __ccgo_ts + 11361 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11350 + v1 = __ccgo_ts + 11375 } else { - v1 = __ccgo_ts + 11367 + v1 = __ccgo_ts + 11392 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11385, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11410, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -95956,21 +96209,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+11428, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -95986,11 +96227,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+11449, 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+11631, 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+10479, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -96466,11 +96707,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 + 11762 } 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+11764, 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 +96782,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+11787, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118867)) } 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(118888)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -96585,9 +96830,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 +96847,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+11795, 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 +96866,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 +96892,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 + 11762 } 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+11801, 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 +96932,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 +97242,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 +97509,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 +97692,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 +97776,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 +97794,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 +97873,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(119856)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -97645,7 +97890,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+11806, 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 +97945,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+11428, 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 + 11813 } 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+11825, 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+11853, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -97728,31 +97973,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+11901, 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+12022, 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 +98011,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 +98022,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 +98084,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 + 12040, }, 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 + 12061, }, 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 + 12081, }, 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 + 12100, }, 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 + 12119, }, } @@ -98070,8 +98315,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+12222, 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 +98331,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+12245, 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+12275, 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 +98366,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 12117, - FzCols: __ccgo_ts + 12130, + FzName: __ccgo_ts + 12142, + FzCols: __ccgo_ts + 12155, }, 1: { - FzName: __ccgo_ts + 12143, - FzCols: __ccgo_ts + 12156, + FzName: __ccgo_ts + 12168, + FzCols: __ccgo_ts + 12181, }, 2: { - FzName: __ccgo_ts + 12184, + FzName: __ccgo_ts + 12209, }, } @@ -98338,7 +98588,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 +98605,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 +98618,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 +98677,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 + 12293, } func init() { @@ -98800,7 +99051,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 + 12303, } func init() { @@ -98850,7 +99101,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+12313, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -98861,7 +99112,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+12318, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -98900,7 +99151,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+12324, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -98918,7 +99169,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 + 12330, } func init() { @@ -98984,7 +99235,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+12339, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -98993,12 +99244,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+12142, 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 +99371,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 +99451,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 +99482,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+12349, 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 +99573,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+12349, 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 +99610,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 +99643,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+12353) } 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+12357) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -99560,17 +99811,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+12361, 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+12372, 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+12382, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -99582,13 +99833,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 +99883,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 +100086,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 +100193,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+12168, 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+12394, __ccgo_ts+12463, zDb) } return rc } @@ -100019,10 +100263,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+12142, (*(*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+12515, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -100135,7 +100379,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 +100431,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+12556, 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 +100466,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+12559, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -100231,7 +100475,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+12596, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -100243,13 +100487,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 +100531,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+12626, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -100295,7 +100539,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+12655, 0) rc = int32(SQLITE_ERROR) } } @@ -100342,7 +100586,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+12723, libc.VaList(bp+56, zFile)) } } } @@ -100404,15 +100648,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+12751, 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+12772, 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+12798, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -100507,7 +100751,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 + 12820, } func init() { @@ -100529,7 +100773,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 + 12834, } func init() { @@ -100555,7 +100799,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+12848, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -100589,7 +100833,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+12872, 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))) @@ -100806,7 +101050,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+12918, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -100834,11 +101078,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+12941, 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+12947, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12928, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12953, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -100898,7 +101142,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 +101177,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+12980, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -101051,7 +101295,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 +101393,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 +101473,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 +101487,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 +101602,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 +101646,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 +101689,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+12995, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -101451,7 +101699,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 +101707,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 + 13003 } else { - v1 = __ccgo_ts + 12991 + v1 = __ccgo_ts + 13016 } 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 +101753,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 @@ -102035,7 +102283,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 +102315,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 +102373,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+13030, 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+13047, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -102179,8 +102427,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+13067, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -102216,23 +102464,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 +102602,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 +102645,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 +102660,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+13109, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -102426,9 +102676,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 11331 + v2 = __ccgo_ts + 11356 } else { - v2 = __ccgo_ts + 9593 + v2 = __ccgo_ts + 9618 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -102438,9 +102688,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 +102714,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 + 11356 } else { - v4 = __ccgo_ts + 9593 + v4 = __ccgo_ts + 9618 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13125, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13150, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -102476,11 +102726,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+13171, 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 +102762,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 +102804,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 +102832,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 +102893,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+13206, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -102637,14 +102902,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+13240, 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 +102943,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 +102958,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+13260, 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 +102968,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+13283, 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+13290, 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 +103015,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+13300, 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 +103029,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 +103042,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 +103228,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+13326, 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+13371, 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 +103289,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+13412, 0) } } @@ -103052,8 +103317,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 +103326,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+13464, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -103080,21 +103345,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 +103371,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+13505, 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 +103399,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 +103492,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+13561, 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+13604, (*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+13612, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -103275,7 +103534,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+13619, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -103416,9 +103675,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 +103689,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 + 13650 + zEnd = __ccgo_ts + 5545 } else { - zSep = __ccgo_ts + 13627 - zSep2 = __ccgo_ts + 13631 - zEnd = __ccgo_ts + 13636 + zSep = __ccgo_ts + 13652 + zSep2 = __ccgo_ts + 13656 + zEnd = __ccgo_ts + 13661 } - 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+13664, 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 +103724,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 +103739,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 + 13678, + 2: __ccgo_ts + 13684, + 3: __ccgo_ts + 13689, + 4: __ccgo_ts + 13694, + 5: __ccgo_ts + 13684, } // C documentation @@ -103497,15 +103759,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 +103783,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 +104016,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 +104127,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 +104140,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 +104171,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 +104390,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+13700, 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+13733, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -104140,11 +104413,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+13760, 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+13810, 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 +104464,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+13842, 0) return } } @@ -104225,16 +104498,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 + 9618 + zType2 = __ccgo_ts + 13886 } else { /* A view */ - zType = __ccgo_ts + 11331 - zType2 = __ccgo_ts + 13867 + zType = __ccgo_ts + 11356 + zType2 = __ccgo_ts + 13892 } /* 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 +104524,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 +104594,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+13897, 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+13912, 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 +104619,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+14010, 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+14052, 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+14086, 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 +104645,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+10140) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -104390,7 +104678,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+14107, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -104407,7 +104695,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+11356, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -104504,7 +104792,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+14143, 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 +104976,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+14173, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -104701,7 +104989,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+14188, 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 +105072,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+14255, 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+12245, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -104827,7 +105115,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+14269, 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 +105124,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+14314, 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 +105159,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 +105218,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 +105253,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+14381, 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+14409, 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+14443, 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 +105274,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+12357, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -105034,19 +105322,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+14475, 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+14538, 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 +105391,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+14632, 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 +105506,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 +105532,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 +105577,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 +105606,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 +105651,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 + 14678 } else { - v2 = __ccgo_ts + 14659 + v2 = __ccgo_ts + 14684 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14664, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14689, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -105445,7 +105733,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+14717, *(*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 +105743,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+14723, 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 +105757,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+14773, 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+14801, 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+14826, 0) goto exit_create_index } /* @@ -105499,19 +105787,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+14717, (*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+14860, 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+14894, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -105532,7 +105820,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+14918, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -105550,9 +105838,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 +105868,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+14717) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -105612,7 +105900,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 +105952,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+14941, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -105679,6 +105967,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { j = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) } else { if int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16 + 8))&0xf>>0)) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) @@ -105763,7 +106052,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 +106100,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+15002, 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 +106130,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+15044, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127335)) goto exit_create_index } } @@ -105855,7 +106144,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 +106173,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 + 15061 } - 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+15069, 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 +106183,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+15089, 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 +106191,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+15148, 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 +106354,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+15175, 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+15193, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -106082,9 +106371,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 +106389,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+15266, 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+12353, (*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 +106463,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 +106580,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+15326, 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 +106667,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 +106717,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 +106888,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 + 15362 } else { - v1 = __ccgo_ts + 15340 + v1 = __ccgo_ts + 15365 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15346, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15371, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -106802,7 +107091,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+15407, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -106849,9 +107138,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 + 15413 } else { - v1 = __ccgo_ts + 15397 + v1 = __ccgo_ts + 15422 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -106883,9 +107172,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 + 15407, + 1: __ccgo_ts + 15429, + 2: __ccgo_ts + 15413, } // C documentation @@ -106905,7 +107194,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+15437, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -106930,7 +107219,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+12941, 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 +107650,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+15637, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -108243,11 +108530,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+15670, 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+15699, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -108351,7 +108638,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 +108695,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+15773, -int32(1)) return } if argc == int32(3) { @@ -110127,7 +110419,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+15806, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -110209,7 +110501,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 +110573,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+15851, 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+15859, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -110334,13 +110626,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 + 15867 + } else { + v2 = __ccgo_ts + 15871 + } + 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+15874, -int32(1)) + return +} + // C documentation // // /* @@ -110352,6 +110780,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 +110794,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 +111229,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 +111318,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11737, + 0: __ccgo_ts + 11762, } // C documentation @@ -111046,7 +111478,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+15897, int32(4), libc.UintptrFromInt32(0)) } } @@ -111107,7 +111539,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+12980, -int32(1)) return } if argc == int32(2) { @@ -111217,7 +111649,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 +111731,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+15750, -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) @@ -111531,7 +111963,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 +111974,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 +112081,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+15902, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -111678,8 +112110,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+15908, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15908, 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 +112291,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 +112399,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 +112412,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 + 15913, }, 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 + 15933, }, 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 + 15946, }, 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 + 15964, }, 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 + 15973, }, 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 + 15981, }, 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 + 15981, }, 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 + 15996, }, 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 + 16022, }, 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 + 16047, }, 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 + 16056, }, 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 + 16067, }, 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 + 16074, }, 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 + 16088, }, 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 + 16088, }, 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 + 16094, }, 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 + 16094, }, 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 + 16100, }, 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 + 16100, }, 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 + 16105, }, 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 + 16105, }, 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 + 16109, }, 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 + 16109, }, 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 + 16113, }, 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 + 16120, }, 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 + 16128, }, 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 + 16135, }, 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 + 16148, }, 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 + 16154, }, 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 + 16161, }, 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 + 16168, }, 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 + 16176, }, 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 + 16181, }, 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 + 16185, }, 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 + 16185, }, 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 + 16191, }, 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 + 16197, }, 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 + 16203, }, 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 + 16207, }, 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 + 16207, }, 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 + 16213, }, 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 + 16220, }, 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 + 16230, }, 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 + 16237, }, 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 + 16244, }, 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 + 16255, }, 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 + 16262, }, 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 + 16277, }, 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 + 16294, }, 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 + 16305, }, 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 + 16312, }, 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 + 16318, }, 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 + 16331, }, 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 + 16349, }, 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 + 16357, }, 55: { - 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 + 16316, - }, - 56: { 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 + 16371, + }, + 56: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16379, }, 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 + 16388, }, 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 + 16388, }, 59: { - 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, + 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 + 16395, }, 60: { - 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, + 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 + 16395, }, 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 + 16343, + FzName: __ccgo_ts + 16405, }, 62: { - 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, + 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 + 16409, }, 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(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16347, + 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 + 16415, }, 64: { - 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, + 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 + 16419, }, 65: { - 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, + 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 + 16419, }, 66: { - FnArg: int16(2), + 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 + 16366, + FzName: __ccgo_ts + 16425, }, 67: { 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, + 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 + 16425, }, 68: { 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, + 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 + 16438, }, 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 + 16449, + }, + 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 + 15908, + }, + 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, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16382, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1238, + FzName: __ccgo_ts + 15908, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1246, + FzName: __ccgo_ts + 16454, }, 73: { 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 + 1238, }, 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 + 16393, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1246, }, 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 + 16396, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16459, }, 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 + 16400, + FzName: __ccgo_ts + 16465, }, 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 + 16406, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16468, }, 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 + 16396, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16472, }, 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, + FfuncFlags: 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 + 16478, }, 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 + 16468, }, 81: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16419, - }, - 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, - }, - 83: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16429, - }, - 84: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16434, - }, - 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, - }, - 86: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16444, - }, - 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, - }, - 88: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16454, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, }, + 82: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16487, + }, + 83: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16491, + }, + 84: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16497, + }, + 85: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16501, + }, + 86: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16506, + }, + 87: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16511, + }, + 88: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16516, + }, + 89: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16522, + }, + 90: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16526, + }, + 91: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16530, + }, + 92: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16534, + }, + 93: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16539, + }, + 94: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16544, + }, 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 + 16549, }, 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 + 16555, }, 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 + 16561, }, 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 + 16567, }, 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 + 16572, }, 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 + 16580, }, 101: { - 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, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16588, }, 102: { - 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, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16591, }, 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 + 7229, + }, + 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 + 16528, + FzName: __ccgo_ts + 16596, + }, + 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 + 16600, }, } @@ -112574,109 +113017,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 +113345,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 +113438,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+16603, 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 +114262,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 +114549,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 +114617,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 +114633,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 @@ -114754,7 +115199,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 +115265,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 +115594,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 +115608,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 +115643,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 +115656,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 +115783,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 +115884,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 +115911,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 +115920,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+16648, 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+16689, 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 +115963,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+16721, 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 +116011,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 +116055,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 +116073,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+16729, 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+16781, 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 +116207,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 +116228,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 +116245,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 +116269,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 +116389,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 +116452,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16801) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16873) } goto insert_cleanup insert_cleanup: @@ -116419,7 +116848,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+12941, 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 +119084,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+16925, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -118673,19 +119104,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+16929, 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+16935, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -118700,14 +119131,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+16978, 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 +119162,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+17010, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -118740,7 +119171,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 + 16887, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -118973,7 +119404,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+17047, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -119027,63 +119458,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 + 17086, + 2: __ccgo_ts + 9618, + 3: __ccgo_ts + 17090, + 4: __ccgo_ts + 17095, + 5: __ccgo_ts + 17098, + 6: __ccgo_ts + 17108, + 7: __ccgo_ts + 17118, + 8: __ccgo_ts + 17124, + 9: __ccgo_ts + 17128, + 10: __ccgo_ts + 17133, + 11: __ccgo_ts + 17138, + 12: __ccgo_ts + 17146, + 13: __ccgo_ts + 17157, + 14: __ccgo_ts + 17160, + 15: __ccgo_ts + 17128, + 16: __ccgo_ts + 17167, + 17: __ccgo_ts + 17133, + 18: __ccgo_ts + 17175, + 19: __ccgo_ts + 17179, + 20: __ccgo_ts + 17184, + 21: __ccgo_ts + 17190, + 22: __ccgo_ts + 17128, + 23: __ccgo_ts + 17133, + 24: __ccgo_ts + 17197, + 25: __ccgo_ts + 17202, + 26: __ccgo_ts + 17205, + 27: __ccgo_ts + 17212, + 28: __ccgo_ts + 17124, + 29: __ccgo_ts + 17128, + 30: __ccgo_ts + 17218, + 31: __ccgo_ts + 17223, + 32: __ccgo_ts + 17228, + 33: __ccgo_ts + 17086, + 34: __ccgo_ts + 17128, + 35: __ccgo_ts + 17232, + 36: __ccgo_ts + 17239, + 37: __ccgo_ts + 17246, + 38: __ccgo_ts + 12357, + 39: __ccgo_ts + 12353, + 40: __ccgo_ts + 17254, + 41: __ccgo_ts + 17259, + 42: __ccgo_ts + 17264, + 43: __ccgo_ts + 9618, + 44: __ccgo_ts + 17269, + 45: __ccgo_ts + 5939, + 46: __ccgo_ts + 17275, + 47: __ccgo_ts + 17280, + 48: __ccgo_ts + 16468, + 49: __ccgo_ts + 17285, + 50: __ccgo_ts + 17086, + 51: __ccgo_ts + 17128, + 52: __ccgo_ts + 17298, + 53: __ccgo_ts + 17303, + 54: __ccgo_ts + 17312, + 55: __ccgo_ts + 17319, + 56: __ccgo_ts + 17330, } // C documentation @@ -119102,343 +119533,343 @@ type PragmaName = TPragmaName var _aPragmaName = [67]TPragmaName{ 0: { - FzName: __ccgo_ts + 17266, + FzName: __ccgo_ts + 17338, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 17281, + FzName: __ccgo_ts + 17353, 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 + 17368, 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 + 17380, 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 + 17396, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 17247, + FzName: __ccgo_ts + 17319, 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 + 17409, 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 + 17421, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17369, + FzName: __ccgo_ts + 17441, 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 + 17457, 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 + 17478, 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 + 17493, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17437, + FzName: __ccgo_ts + 17509, 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 + 17523, 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 + 17536, 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 + 17550, 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 + 17569, 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 + 17588, 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 + 17611, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17548, + FzName: __ccgo_ts + 17620, 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 + 17638, 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 + 17655, 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 + 17668, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17611, + FzName: __ccgo_ts + 17683, 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 + 17701, 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 + 17711, 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 + 17725, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17669, + FzName: __ccgo_ts + 17741, 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 + 17766, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17713, + FzName: __ccgo_ts + 17785, 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 + 17796, 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 + 17807, 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 + 17819, 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 + 17835, 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 + 17848, 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 + 17867, 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 + 17886, FePragTyp: uint8(PragTyp_LOCK_PROXY_FILE), FmPragFlg: uint8(PragFlg_NoColumns1), }, 37: { - FzName: __ccgo_ts + 17830, + FzName: __ccgo_ts + 17902, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17843, + FzName: __ccgo_ts + 17915, 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 + 17930, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 40: { - FzName: __ccgo_ts + 17868, + FzName: __ccgo_ts + 17940, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 41: { - FzName: __ccgo_ts + 17880, + FzName: __ccgo_ts + 17952, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 42: { - FzName: __ccgo_ts + 17889, + FzName: __ccgo_ts + 17961, 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 + 17972, 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 + 17982, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 45: { - FzName: __ccgo_ts + 17922, + FzName: __ccgo_ts + 17994, 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 + 18005, 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 + 18017, 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 + 18034, 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 + 18053, 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 + 18079, 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 + 18094, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 52: { - FzName: __ccgo_ts + 18036, + FzName: __ccgo_ts + 18108, 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 + 18127, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 54: { - FzName: __ccgo_ts + 18069, + FzName: __ccgo_ts + 18141, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 55: { - FzName: __ccgo_ts + 18085, + FzName: __ccgo_ts + 18157, 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 + 18169, 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 + 18180, 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 + 18191, 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 +119877,45 @@ var _aPragmaName = [67]TPragmaName{ FiArg: uint64(1), }, 59: { - FzName: __ccgo_ts + 18131, + FzName: __ccgo_ts + 18203, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 60: { - FzName: __ccgo_ts + 18142, + FzName: __ccgo_ts + 18214, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 61: { - FzName: __ccgo_ts + 18163, + FzName: __ccgo_ts + 18235, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 62: { - FzName: __ccgo_ts + 18171, + FzName: __ccgo_ts + 18243, 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 + 18258, 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 + 18271, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 65: { - FzName: __ccgo_ts + 18218, + FzName: __ccgo_ts + 18290, 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 + 18305, 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 +119933,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 +120041,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+18321) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18259) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18331) { return PAGER_LOCKINGMODE_NORMAL } } @@ -119631,13 +120062,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+18338) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18271) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18343) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -119660,10 +120091,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+17298) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+18283) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18355) == 0 { return int32(2) } else { return 0 @@ -119685,7 +120116,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+18362, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -119815,15 +120246,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 + 18424 case int32(OE_SetDflt): - zName = __ccgo_ts + 18361 + zName = __ccgo_ts + 18433 case int32(OE_Cascade): - zName = __ccgo_ts + 18373 + zName = __ccgo_ts + 18445 case int32(OE_Restrict): - zName = __ccgo_ts + 18381 + zName = __ccgo_ts + 18453 default: - zName = __ccgo_ts + 18390 + zName = __ccgo_ts + 18462 break } return zName @@ -119844,12 +120275,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 + 18472, + 1: __ccgo_ts + 18479, + 2: __ccgo_ts + 18487, + 3: __ccgo_ts + 18491, + 4: __ccgo_ts + 18355, + 5: __ccgo_ts + 18500, } // C documentation @@ -119911,15 +120342,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 + 18525 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18455 + zType = __ccgo_ts + 18527 } 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+18529, 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 +120359,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 + 18504, + 2: __ccgo_ts + 18509, + 3: __ccgo_ts + 18517, } // C documentation @@ -120030,7 +120461,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+18536, libc.VaList(bp+184, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -120073,7 +120504,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 +120549,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 +120608,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+18540) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -120220,7 +120651,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 +120679,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 + 18331 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 +120707,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 + 18321 } _returnSingleText(tls, v, zRet) break @@ -120566,7 +120997,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+18545, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -120576,7 +121007,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 +121039,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+18570, 0) goto pragma_out } } @@ -120628,7 +121059,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+18600, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -120660,8 +121091,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+18653) == 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 +121173,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 + 18659 } else { - v14 = __ccgo_ts + 18595 + v14 = __ccgo_ts + 18667 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -120814,7 +121246,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+18674, 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 +121276,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 + 11356 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13579 + zType = __ccgo_ts + 13604 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18618 + zType = __ccgo_ts + 18690 } else { - zType = __ccgo_ts + 9593 + zType = __ccgo_ts + 9618 } } } - _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+18697, 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 +121335,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+18704, 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+18709, 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 +121361,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 + 18714, + 1: __ccgo_ts + 18716, + 2: __ccgo_ts + 17157, } - _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+18718, 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 +121384,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+18724, 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 +121401,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+18728, libc.VaList(bp+184, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -121019,7 +121451,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 +121463,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 +121489,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+18731, 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+18740)) goto _32 _32: ; @@ -121071,8 +121503,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 +121630,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+18745, 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 +121726,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 +121770,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 +121821,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+18749, 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 +121832,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+18773) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -121536,7 +121968,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+18802, 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 +122030,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 +122052,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+18838, 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 +122065,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+18858, 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 +122073,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+18880, 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 +122084,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+18903, -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+18905, 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 +122121,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+18925, 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 +122145,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+18955) _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+18960) _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 +122160,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+18981) _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+19017) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -121758,9 +122190,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+18955) _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+19028) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -121788,7 +122220,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+19055) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -121885,7 +122317,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 + 19082 (*(*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 +122396,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+19143, libc.VaList(bp+184, zRight)) } } } @@ -122069,13 +122501,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+18338) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19096) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19168) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18419) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18491) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -122210,7 +122642,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 +122672,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 +122734,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+19176, 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 +123007,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 19013, + FzName: __ccgo_ts + 19085, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 19018, + FzName: __ccgo_ts + 19090, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 19024, + FzName: __ccgo_ts + 19096, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 19033, + FzName: __ccgo_ts + 19105, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 19042, + FzName: __ccgo_ts + 19114, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 19050, + FzName: __ccgo_ts + 19122, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 19058, + FzName: __ccgo_ts + 19130, }, 7: { - FzName: __ccgo_ts + 19065, + FzName: __ccgo_ts + 19137, }, 8: {}, } @@ -122698,14 +123130,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+19194) 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+19209, libc.VaList(bp+240, int32(cSep), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -122714,19 +123146,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+19216, 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+19222) 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+19234) 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 +123173,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 +123354,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 +123366,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+19249) 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+19257, 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+19261, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -122949,7 +123381,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 +123507,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+19295, 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(143745)) } 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+19323, 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+19354, 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(143752)) } } } @@ -123100,9 +123532,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 + 19265, + 1: __ccgo_ts + 19272, + 2: __ccgo_ts + 19284, } // C documentation @@ -123178,7 +123610,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+15044) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -123211,11 +123643,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+19362) } 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+15044) } } } @@ -123254,18 +123686,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 + 9618 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 + 19375 (*(*[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 +123781,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+12655) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -123375,7 +123807,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+19447) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -123390,7 +123822,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+19471, 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)) @@ -123719,7 +124151,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 +124180,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 +124240,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+19505, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -123824,7 +124256,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+19535, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -123847,10 +124279,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 +124290,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 +124320,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(144552)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -124022,7 +124454,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(144701)) } /* 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 @@ -124282,7 +124714,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 +124722,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 +124878,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 + 11762 + zSp2 = __ccgo_ts + 11762 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+19554, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -124511,25 +124943,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 +125096,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 +125180,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+19584, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -124795,12 +125230,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+19634, 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 +125250,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+19698, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -124827,6 +125263,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 +125304,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), } @@ -124909,7 +125352,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 +125397,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 +125421,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 +125442,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 +125565,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 +125692,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 +125703,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 +125880,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+19735, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -125548,8 +125991,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 +126000,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 +126085,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19683 + z = __ccgo_ts + 19755 case int32(TK_INTERSECT): - z = __ccgo_ts + 19693 + z = __ccgo_ts + 19765 case int32(TK_EXCEPT): - z = __ccgo_ts + 19703 + z = __ccgo_ts + 19775 default: - z = __ccgo_ts + 19710 + z = __ccgo_ts + 19782 break } return z @@ -125669,7 +126112,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+19788, libc.VaList(bp+8, zUsage)) } /* @@ -125706,13 +126149,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 + 19811 } 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+19825, 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+19856, 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 +126179,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 +126399,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 + 17269 } 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 +126512,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 +126521,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 +126545,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 + 17269 } 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+12941, 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 +126559,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+19902, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -126170,7 +126613,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 +126651,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 + 17269 } zName = v3 } else { @@ -126223,7 +126666,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+19902, 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 +126702,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+19911, 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 +126821,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 + 19919 } else { zType = uintptr(0) j = int32(1) @@ -126444,7 +126887,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 +126915,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 +126965,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 +126988,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 +127136,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+19923, 0) return } /* Obtain authorization to do a recursive query */ @@ -126730,7 +127173,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 +127184,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 +127198,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 +127229,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+19972, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -126801,7 +127244,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+20014, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -126829,7 +127272,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+20020, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -126884,9 +127327,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+20035, 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 +127437,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+20058, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20073, 0) } /* Generate code for the left and right SELECT statements. */ @@ -127020,7 +127463,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+19755, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -127046,7 +127489,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 +127515,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+20092, 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 +127547,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 +127573,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+20092, 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 +127680,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 +127697,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+20113, 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+20159, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -127326,7 +127770,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+19735, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -127542,7 +127986,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 +128018,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 +128072,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 +128099,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+20241, 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+20252, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -127693,7 +128137,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+20257, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -127903,11 +128347,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 +128512,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 +128702,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 +128916,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 +129063,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) @@ -128909,11 +129353,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 +129422,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 +129440,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 +129927,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 +129973,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+16105) == 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+16109) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -129623,8 +130067,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+20263, 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 +130092,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 +130174,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 +130192,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+20281, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -129896,7 +130340,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 +130368,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+20304, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -129946,12 +130390,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+20324, 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 +130412,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 + 20367 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 +130443,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+20390, 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 +130452,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 + 20428 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20390 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20462 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -130059,7 +130503,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 +130513,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+20500, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -130165,7 +130609,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 +130618,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 +130669,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+20504, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -130240,7 +130684,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+20543, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -130255,7 +130699,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+15637, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -130379,7 +130823,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 +130840,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+20574, 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 +130919,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+20579, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -130488,7 +130932,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+12941, 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 +130952,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+20588, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20534, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20606, 0) } } } @@ -130524,7 +130968,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+20626, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -130773,7 +131217,7 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint (*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))) + *(*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 +131270,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 +131307,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+20657, 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+20708, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -130889,7 +131333,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+20741, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -131028,7 +131472,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 +131580,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 @@ -131203,7 +131647,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 + 20774 } else { v1 = __ccgo_ts + 1665 } @@ -131212,7 +131656,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+20797, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -131244,7 +131688,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 +131817,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 +131846,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+16419) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -131434,9 +131879,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 +131891,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 +131917,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 +132090,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 +132100,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 +132120,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 +132144,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+20809, 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 +132252,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+20863, 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 +132453,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+20903, 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 +132492,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 +132507,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+20918, 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 +132561,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 +132594,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 +132653,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 +132682,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 +132711,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 +132748,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 +132764,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 +132794,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++ } @@ -132373,11 +132825,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.Uint16FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -132411,47 +132863,47 @@ 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)) /* 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)) /* Begin a loop that will extract all source rows in GROUP BY order. @@ -132461,16 +132913,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 +132940,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 + 20934 } else { - v46 = __ccgo_ts + 20871 + v47 = __ccgo_ts + 20943 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19716, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19788, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -132506,8 +132958,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -132525,8 +132977,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -132537,12 +132989,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 +133043,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 +133122,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 +133141,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 +133171,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 +133212,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 +133279,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+20934) } /* 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 +133385,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 +133401,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+20952, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -133035,7 +133491,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 +133653,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+21017, 0) goto trigger_cleanup } iDb = int32(1) @@ -133237,7 +133693,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+21063, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -133247,11 +133703,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+21071, 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+21112, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -133260,13 +133716,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+21063, (*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+21152, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -133274,8 +133730,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+21178, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -133283,15 +133739,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 + 21216 } else { - v1 = __ccgo_ts + 21151 + v1 = __ccgo_ts + 21223 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21157, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21229, 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+21266, 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 +133767,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 +133869,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+21063, 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 +133891,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+21312, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -133451,10 +133907,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+21360, 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+21435, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -133722,11 +134178,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+21464, 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 +134220,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 +134237,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+21484, 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 +134370,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 + 21546 } else { - v1 = __ccgo_ts + 21481 + v1 = __ccgo_ts + 21553 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21488, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21560, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -134020,7 +134476,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+21608, 0) return int32(1) } @@ -134168,12 +134624,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 +134637,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 +134663,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 +134677,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 +134745,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 +134844,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+21650, 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 +134871,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 +134943,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 +135359,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 +135373,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 +135434,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 +135473,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 +135517,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+21664, 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+21700, 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 +135586,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 +135608,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 +135628,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 +135641,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 +135661,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 +135688,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 +135731,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 +136072,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -135674,8 +136123,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 +136171,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 +136187,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 +136234,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+21719) } goto update_cleanup update_cleanup: @@ -135842,13 +136291,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 +136339,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 +136668,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+21732, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21664, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21736, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -136310,13 +136759,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 +136773,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+13030, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -136406,7 +136855,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+21809, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21813, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -136497,7 +136946,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 +136985,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+21817) 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+21857) 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+21900) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -136563,7 +137012,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+21949) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -136616,7 +137065,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+15407) if rc != SQLITE_OK { goto end_of_vacuum } @@ -136647,11 +137096,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+21976, 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+22084, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -136660,7 +137109,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+22138, 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 +137119,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+22275, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -136813,7 +137262,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) @@ -137197,7 +137646,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+13260, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -137320,24 +137769,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+22398, 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+22422, 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+22521, 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 @@ -137421,7 +137875,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+22540, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -137463,9 +137917,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+22582, 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 +137932,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 + 22612 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -137512,7 +137966,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+17160, 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 +138047,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+22658, 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 +138134,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+22658, 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 +138182,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+22677, 0) return int32(SQLITE_ERROR) } goto _1 @@ -137739,9 +138193,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(158352))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158354)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -137783,7 +138237,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 +138603,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 +138693,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 +138713,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 +138777,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(158849)) } else { ap = va switch op { @@ -138336,7 +138790,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(158871)) break } _ = ap @@ -139021,7 +139475,6 @@ type TWhereInfo1 = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo1 = TWhereInfo1 @@ -139057,10 +139510,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 + 22690 } if i == -int32(1) { - return __ccgo_ts + 17197 + return __ccgo_ts + 17269 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -139079,10 +139532,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+22697, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22631, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22703, int32(1)) } i = 0 for { @@ -139090,7 +139543,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+13650, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -139099,11 +139552,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+22703, int32(1)) } i = 0 for { @@ -139111,16 +139564,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+13650, 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 +139620,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+22705, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -139175,12 +139628,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+22697, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22636 + v2 = __ccgo_ts + 22708 } else { - v2 = __ccgo_ts + 22641 + v2 = __ccgo_ts + 22713 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -139197,7 +139650,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+22721) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -139208,9 +139661,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+22723) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5519, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5545, int32(1)) } // C documentation @@ -139255,11 +139708,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 + 22725 } else { - v2 = __ccgo_ts + 22660 + v2 = __ccgo_ts + 22732 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22665, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22737, 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 +139725,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 + 11813 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22671 + zFmt = __ccgo_ts + 22743 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22704 + zFmt = __ccgo_ts + 22776 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22729 + zFmt = __ccgo_ts + 22801 } else { - zFmt = __ccgo_ts + 22747 + zFmt = __ccgo_ts + 22819 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22756, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22828, 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 + 17269 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22836, 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+22867, libc.VaList(bp+144, zRowid)) cRangeOp = int8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -139312,14 +139765,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+22877, 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+22882) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22832 + v3 = __ccgo_ts + 22904 } else { - v3 = __ccgo_ts + 22840 + v3 = __ccgo_ts + 22912 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -139340,7 +139793,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+22918, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -139406,14 +139859,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+22929, 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+22708, 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+22950, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -139437,16 +139890,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+22697, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22636, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22708, 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 +140104,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 @@ -139730,7 +140183,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 */ @@ -139850,7 +140303,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i 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)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(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)) } @@ -139862,7 +140315,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } else { v3 = n } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(v3))) eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } pX = pExpr @@ -139900,10 +140353,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 @@ -140092,7 +140545,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 +140676,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 @@ -140505,7 +140958,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 +141019,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 +141054,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 +141195,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 +141275,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 +141309,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 +141431,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 +141624,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 +141638,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 +141682,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 +141706,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 +141742,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 +141774,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 +141829,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+22958, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -141395,7 +141852,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+22973, 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 +142341,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,7 +142352,7 @@ 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+22982, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { @@ -141941,15 +142398,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 +142419,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 +142492,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 +142890,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 17046, + FzOp: __ccgo_ts + 17118, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16377, + FzOp: __ccgo_ts + 16449, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15856, + FzOp: __ccgo_ts + 15908, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22924, + FzOp: __ccgo_ts + 22996, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -143232,7 +143690,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+23003, 0) return } } else { @@ -143244,10 +143702,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+23003, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -143328,7 +143786,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 +143887,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 + 23044 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -143960,7 +144418,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+23051, 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,7 +144490,6 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo @@ -144043,7 +144500,6 @@ type THiddenIndexInfo1 = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo1 = THiddenIndexInfo1 @@ -145076,7 +145532,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)<>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 @@ -147693,7 +148145,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { + })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0)) { if libc.Int32FromUint16((*(*struct { FnEq Tu16 FnBtm Tu16 @@ -147897,7 +148349,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 @@ -148181,7 +148633,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 +148811,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)) @@ -148700,7 +149152,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+23124, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -148775,7 +149227,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+23124, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -148929,7 +149381,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(168893)) /* 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 +149817,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+23150, 0) rc = SQLITE_OK } else { break @@ -150573,7 +151025,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+23185, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -151151,7 +151603,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 +151759,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+23203, 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 +151780,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 +151829,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+23231, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -151525,7 +151974,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 +152009,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. @@ -151685,7 +152135,7 @@ 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 @@ -151716,16 +152166,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 @@ -151904,7 +152354,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 { @@ -152111,7 +152561,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 +152571,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+23249, 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 +152621,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 +152890,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+23278, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -152622,7 +153072,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+23334, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -152948,7 +153398,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+23379, libc.VaList(bp+8, zName)) } return p } @@ -152999,12 +153449,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+23398, 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+23469, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -153077,7 +153527,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 } @@ -153215,7 +153665,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( 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 { @@ -153359,7 +153809,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+23532, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -153395,7 +153845,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 +153860,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 +153879,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 +153929,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 +153950,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 +153972,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 +154096,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+23558, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -153714,18 +154164,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 + 23590 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23535 + zErr = __ccgo_ts + 23607 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23551 + zErr = __ccgo_ts + 23623 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23571, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23643, 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 +154199,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+23676, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -153855,24 +154305,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 +154340,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 +154357,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 +154417,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 + 23723, + 1: __ccgo_ts + 23776, + 2: __ccgo_ts + 23278, + 3: __ccgo_ts + 23827, + 4: __ccgo_ts + 23879, } var _aOp1 = [5]int32{ @@ -154551,7 +155001,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 +155097,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 +155814,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 +155827,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 +155853,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 +155886,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 +156105,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 +156169,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+23929, libc.VaList(bp+8, p)) } // C documentation @@ -155729,6 +156183,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 +156217,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 + 23953 } else { - v1 = __ccgo_ts + 23890 + v1 = __ccgo_ts + 23962 } - _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+23968, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -155775,7 +156230,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+24010, 0) } } } @@ -155881,7 +156336,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+24044, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -162402,13 +162857,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) } @@ -164338,20 +164793,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+17269, 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+24082, 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+17205, 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+24082, 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 +164847,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 +164997,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 +165092,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 +165449,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+24109) 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) { @@ -165334,9 +165799,9 @@ _237: */ _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 + v347 = __ccgo_ts + 8446 } else { - v347 = __ccgo_ts + 8426 + v347 = __ccgo_ts + 8451 } *(*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 { @@ -165578,15 +166043,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+24118, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24141, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24213, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24225, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24297, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -165728,7 +166193,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 +166387,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+24382, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -168653,14 +169118,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)< int32(65528) { sz = int32(65528) } - if cnt < 0 { + /* 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 > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } szAlloc = int64(sz) * int64(cnt) - if sz == 0 || cnt == 0 { + 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)) @@ -170134,7 +170608,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182779)) + return _sqlite3MisuseError(tls, int32(183820)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -170154,7 +170628,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+24469, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -170455,14 +170929,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 + 25012 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -170474,31 +170948,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 + 24537, + 1: __ccgo_ts + 24550, + 3: __ccgo_ts + 24566, + 4: __ccgo_ts + 24591, + 5: __ccgo_ts + 24605, + 6: __ccgo_ts + 24624, 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 + 24649, + 9: __ccgo_ts + 24686, + 10: __ccgo_ts + 24698, + 11: __ccgo_ts + 24713, + 12: __ccgo_ts + 24746, + 13: __ccgo_ts + 24764, + 14: __ccgo_ts + 24789, + 15: __ccgo_ts + 24818, + 17: __ccgo_ts + 6474, + 18: __ccgo_ts + 5878, + 19: __ccgo_ts + 24835, + 20: __ccgo_ts + 24853, + 21: __ccgo_ts + 24871, + 23: __ccgo_ts + 24905, + 25: __ccgo_ts + 24926, + 26: __ccgo_ts + 24952, + 27: __ccgo_ts + 24975, + 28: __ccgo_ts + 24996, } // C documentation @@ -170645,6 +171119,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 // // /* @@ -170677,7 +171165,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i 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(183430)) + return _sqlite3MisuseError(tls, int32(184509)) } 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) @@ -170720,7 +171208,7 @@ 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+25093, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -170846,7 +171334,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+25156, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -170877,7 +171365,7 @@ 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) } @@ -171121,7 +171609,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(184046)) + return _sqlite3MisuseError(tls, int32(185125)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -171131,7 +171619,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+25207, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -171253,7 +171741,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(184182))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185261))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -171385,7 +171873,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(184261)) + return _sqlite3MisuseError(tls, int32(185340)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -171395,7 +171883,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(184270)) + return _sqlite3MisuseError(tls, int32(185349)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -171444,7 +171932,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(184318)) + return _sqlite3MisuseError(tls, int32(185397)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -171453,7 +171941,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+25228, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -171600,7 +172088,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+25296, 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 @@ -171630,8 +172118,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+25302, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25312, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -171720,24 +172208,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+25340, 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+25344, 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 + 25344 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25293, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25365, 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 @@ -171766,12 +172254,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+25380, 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+25400, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -171795,7 +172283,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+25424, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -171815,11 +172303,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 25278, + Fz: __ccgo_ts + 25350, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 25285, + Fz: __ccgo_ts + 25357, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -171830,19 +172318,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 25298, + Fz: __ccgo_ts + 25370, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 25301, + Fz: __ccgo_ts + 25373, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 25304, + Fz: __ccgo_ts + 25376, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 18283, + Fz: __ccgo_ts + 18355, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -171970,8 +172458,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+23044, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25440, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -171992,10 +172480,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(184993)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186072)) /* 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) } @@ -172004,7 +172492,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) } @@ -172031,9 +172519,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 + 24442 (*(*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 { @@ -172127,7 +172615,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 + 25446 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -172287,7 +172775,7 @@ 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) @@ -172344,20 +172832,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+25449, 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+25474) } 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+25494) } 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+25501) } // C documentation @@ -172382,9 +172870,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) @@ -172411,29 +172899,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 @@ -172488,15 +172965,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+25518, 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) @@ -172675,8 +173152,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 @@ -173120,7 +173597,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: ; @@ -173516,7 +173993,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+25546, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -173734,7 +174211,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 + 25554 } else { v2 = uintptr(0) } @@ -173813,7 +174290,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) @@ -173980,7 +174457,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 @@ -174197,6 +174674,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -174509,8 +174993,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 @@ -174567,7 +175051,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 @@ -174577,7 +175061,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 @@ -174615,18 +175099,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 + 25577, + 12: __ccgo_ts + 25583, 13: __ccgo_ts + 1665, 14: __ccgo_ts + 1665, 15: __ccgo_ts + 1665, @@ -175113,7 +175597,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) { @@ -175411,8 +175895,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) } } @@ -175548,7 +176032,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+15851, 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)) @@ -175562,14 +176046,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+25590, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -175623,7 +176105,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+25619, -int32(1)) } } } @@ -175906,8 +176388,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 + 25634, + FzRepl: __ccgo_ts + 25638, }, 1: { Fc1: int8('i'), @@ -175915,8 +176397,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 + 25646, + FzRepl: __ccgo_ts + 25638, }, 2: { Fc1: int8('n'), @@ -175931,7 +176413,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25600, + FzMatch: __ccgo_ts + 25655, FzRepl: __ccgo_ts + 1651, }, 4: { @@ -175939,7 +176421,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25605, + FzMatch: __ccgo_ts + 25660, FzRepl: __ccgo_ts + 1651, }, } @@ -175955,7 +176437,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+25665, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -175973,23 +176455,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 } @@ -176067,7 +176549,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 @@ -176138,7 +176620,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) + } } } } @@ -176413,7 +176899,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+25708, 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') { @@ -176843,7 +177329,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 { @@ -176882,7 +177368,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)) } @@ -176890,7 +177376,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)) } @@ -176967,14 +177453,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+25634, 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+25717) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25669) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25724) } - 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+25730, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -177159,7 +177645,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+25724) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -177204,7 +177690,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+25619, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -177217,7 +177703,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+25619, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -177266,10 +177752,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) @@ -177303,15 +177785,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 @@ -177384,11 +177866,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: ; @@ -177437,9 +177919,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25583 + v19 = __ccgo_ts + 25638 } else { - v19 = __ccgo_ts + 12288 + v19 = __ccgo_ts + 12313 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -177475,9 +177957,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: ; @@ -177504,7 +177989,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25681, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25736, uint32(2)) zIn2++ sz2-- continue @@ -177527,7 +178012,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25684, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25739, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -177535,12 +178020,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25691, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25746, 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+25751, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -177720,7 +178205,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+25758, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -177743,12 +178228,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+25761, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25703, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25758, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -177763,50 +178248,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 // // /* @@ -177858,6 +178299,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 // // /* @@ -177878,6 +178397,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)) @@ -177950,9 +178472,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 @@ -177995,7 +178517,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 @@ -178483,7 +179016,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+25619, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -178618,7 +179151,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 } @@ -178719,7 +179252,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+25619, -int32(1)) return } @@ -178756,11 +179289,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+25590, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -178773,7 +179303,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+25619, -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) @@ -178792,10 +179322,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+25724) } 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+25717) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -178834,7 +179364,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+25764, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -178850,7 +179380,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. // ** @@ -178931,7 +179461,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+25619, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -178943,34 +179473,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; +// ** 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. +// ** 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) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { + 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 (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) - return 0 + 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 (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - 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 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) @@ -179053,7 +179603,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 @@ -179113,7 +179663,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+25619, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -179248,7 +179798,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 + 25782 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -179258,7 +179808,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+25619, -int32(1)) } } eErr = uint8(1) @@ -179368,23 +179918,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+25784, uint32(1)) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25731, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25786, 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+25788, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25736, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25791, uint32(1)) } } } @@ -179424,7 +179974,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+25619, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -179692,7 +180242,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+25619, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -179716,7 +180266,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+25793, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -179727,7 +180277,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+25844, -int32(1)) _jsonStringReset(tls, bp) return } @@ -179799,7 +180349,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+25619, -int32(1)) } } goto json_remove_done @@ -179836,7 +180386,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+16371) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -179867,9 +180417,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 + 25878 } else { - v1 = __ccgo_ts + 25827 + v1 = __ccgo_ts + 25882 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -179917,7 +180467,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+25619, -int32(1)) } } goto json_type_done @@ -179964,7 +180514,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 + 25889 (*(*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)) @@ -180038,17 +180588,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+25894, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -180057,18 +180606,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 @@ -180130,9 +180678,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))) @@ -180239,7 +180785,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+25951, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -180331,20 +180877,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))) + } } } @@ -180388,7 +180936,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+25954, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -180491,7 +181039,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+25957) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -180625,7 +181173,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+26040, 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 @@ -180651,9 +181199,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+26047, 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+26055, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -180964,9 +181512,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))) @@ -181039,7 +181586,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+26061, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -181063,7 +181610,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+25619, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -181124,186 +181671,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 + 26063, }, 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 + 26068, }, 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 + 26074, }, 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 + 26085, }, 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 + 26097, }, 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 + 26097, }, 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 + 26115, }, 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 + 26135, }, 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 + 26148, }, 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 + 26162, }, 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 + 26165, }, 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 + 26169, }, 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 + 26181, }, 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 + 26194, }, 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 + 26206, }, 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 + 26219, }, 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 + 26230, }, 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 + 26242, }, 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 + 26242, }, 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 + 26254, }, 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 + 26265, }, 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 + 26277, }, 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 + 26290, }, 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 + 26303, }, 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 + 26317, }, 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 + 26326, }, 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 + 26336, }, 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 + 26336, }, 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 + 26346, }, 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 + 26346, }, 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 + 26357, }, 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 + 26374, }, 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 + 26392, }, 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 + 26410, }, } @@ -181386,17 +181933,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 26374, + FzName: __ccgo_ts + 26429, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 26384, + FzName: __ccgo_ts + 26439, 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 @@ -181504,7 +182053,6 @@ type TRtreeMatchArg = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - FaParam [1]TRtreeDValue } type RtreeMatchArg = TRtreeMatchArg @@ -181787,11 +182335,12 @@ type TRtreeMatchArg1 = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - 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 ** clang, since clang works hard to be gcc compatible. So the gcc @@ -181974,7 +182523,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 @@ -182037,7 +182586,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+26449, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -182048,7 +182597,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 { @@ -182342,7 +182891,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+26454, 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 { @@ -182883,7 +183432,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) } @@ -183263,7 +183812,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+26536) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -183341,7 +183890,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) @@ -183572,7 +184121,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 } @@ -183580,7 +184129,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 @@ -183818,7 +184367,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: @@ -184240,7 +184789,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 @@ -184753,7 +185302,7 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -184770,7 +185319,7 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -184798,7 +185347,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+26550, 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 { @@ -184808,11 +185357,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+26570, 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+26602, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185026,7 +185575,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+26639, 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)) @@ -185080,9 +185629,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 + 26784 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+12142, 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) { @@ -185140,9 +185689,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 + 26840, + 1: __ccgo_ts + 5939, + 2: __ccgo_ts + 17269, } var _rtreeModule = Tsqlite3_module{ @@ -185186,21 +185735,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+27254, 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+27316, 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+27321, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27385, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27455, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -185230,7 +185779,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 + 27504 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -185245,31 +185794,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+27612, 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+27657, 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+13650, 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+27684, 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+27706, 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+27714, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -185283,14 +185832,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 + 26845, + 1: __ccgo_ts + 26898, + 2: __ccgo_ts + 26943, + 3: __ccgo_ts + 26995, + 4: __ccgo_ts + 27049, + 5: __ccgo_ts + 27094, + 6: __ccgo_ts + 27152, + 7: __ccgo_ts + 27207, } // C documentation @@ -185348,7 +185897,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+27730, 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) @@ -185356,17 +185905,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+27750, 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))) @@ -185429,7 +185978,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) } @@ -185443,13 +185992,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+27993, 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+27999, 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) { @@ -185458,7 +186007,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+28023, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -185472,19 +186021,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+28050, 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))) } } } @@ -185507,7 +186056,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)) @@ -185518,7 +186067,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 @@ -185534,8 +186083,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27974, - 1: __ccgo_ts + 27985, + 0: __ccgo_ts + 28029, + 1: __ccgo_ts + 28040, } // C documentation @@ -185593,21 +186142,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+11762, 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+28053, 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+28059, 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+28063, int32(1)) goto _1 _1: ; @@ -185634,7 +186183,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+28065, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -185737,7 +186286,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) @@ -185752,11 +186301,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+28098, 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) } @@ -185790,7 +186339,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+28105, 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) @@ -185807,7 +186356,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+28150, libc.VaList(bp+8, iNode)) } } return pRet @@ -185836,8 +186385,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 + 28182, + 1: __ccgo_ts + 28236, } 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)) @@ -185850,21 +186399,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 + 28284 } else { - v1 = __ccgo_ts + 28237 + v1 = __ccgo_ts + 28292 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28246, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28301, 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 + 28284 } else { - v2 = __ccgo_ts + 28237 + v2 = __ccgo_ts + 28292 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28291, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28346, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -185909,7 +186458,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+28404, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -185927,7 +186476,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+28452, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -185960,19 +186509,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+28519, 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+28553, 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+28583, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -186017,12 +186566,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+28638, 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+28669, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -186051,7 +186600,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+28736, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -186061,11 +186610,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+26550, 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+28764, 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)) @@ -186081,8 +186630,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+28795, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28802, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -186109,7 +186658,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+28810, 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) } @@ -186160,13 +186709,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+28829, -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))) } @@ -186175,7 +186724,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 + 19082 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -186442,7 +186991,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++ @@ -186487,7 +187036,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 @@ -186549,7 +187098,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 } @@ -186917,7 +187466,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 @@ -186932,9 +187481,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: ; @@ -187019,7 +187568,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 { @@ -187160,7 +187709,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 // ** @@ -187199,7 +187748,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) } @@ -187303,7 +187852,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 @@ -187387,7 +187936,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 @@ -187671,7 +188220,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) { @@ -187828,7 +188377,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 @@ -187840,13 +188389,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+27993, 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+28953, 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) @@ -187855,13 +188404,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+28975, 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+28050, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -187869,7 +188418,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) @@ -187884,7 +188433,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 @@ -188096,7 +188645,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 + 17269 (*(*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) @@ -188106,7 +188655,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 + 28979 (*(*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) @@ -188114,7 +188663,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 + 28985 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -188234,7 +188783,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+28994, 0) } goto geopoly_update_end } @@ -188337,12 +188886,12 @@ geopoly_update_end: func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28979) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+29034) == 0 { *(*uintptr)(unsafe.Pointer(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 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+29050) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) @@ -188413,7 +188962,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+29227, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -188427,61 +188976,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29010, + FzName: __ccgo_ts + 29065, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29023, + FzName: __ccgo_ts + 29078, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29036, + FzName: __ccgo_ts + 29091, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 29049, + FzName: __ccgo_ts + 29104, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28995, + FzName: __ccgo_ts + 29050, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 29061, + FzName: __ccgo_ts + 29116, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28979, + FzName: __ccgo_ts + 29034, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 29084, + FzName: __ccgo_ts + 29139, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29098, + FzName: __ccgo_ts + 29153, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 29111, + FzName: __ccgo_ts + 29166, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 29125, + FzName: __ccgo_ts + 29180, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29141, + FzName: __ccgo_ts + 29196, }, } @@ -188507,7 +189056,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 29153, + FzName: __ccgo_ts + 29208, }, } @@ -188532,20 +189081,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+29235, 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+29245, 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+29256, -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+28979, 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+29267, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -188619,7 +189168,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) @@ -188647,7 +189196,7 @@ 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+26536, __ccgo_fp(_rtreeMatchArgFree)) } } } @@ -188888,7 +189437,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 @@ -189864,7 +190413,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+29277, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -189874,7 +190423,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+29277, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -189900,7 +190449,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 @@ -189923,7 +190472,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 } @@ -190055,7 +190604,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+29298, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -190144,7 +190693,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+26449, 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')) { @@ -190181,13 +190730,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 + 29469 } 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+29510, 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+29660) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -190354,7 +190903,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))) } } @@ -190415,7 +190964,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+29785, 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 @@ -190425,7 +190974,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+29904, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -190433,7 +190982,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+29925, 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) @@ -190445,7 +190994,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+29976, 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 { @@ -190489,7 +191038,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+29997, 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))) { @@ -190502,7 +191051,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+30025, 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 { @@ -190555,7 +191104,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+20588, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -190566,7 +191115,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+30054, 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) @@ -190577,7 +191126,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+30073, 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 @@ -190585,7 +191134,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+30078, zName) { bRbuRowid = int32(1) } } @@ -190599,17 +191148,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 + 30088 } else { - v4 = __ccgo_ts + 30046 + v4 = __ccgo_ts + 30101 } - (*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+30110, 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+30139, 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)) @@ -190631,7 +191180,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+30161, 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)) @@ -190677,8 +191226,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+30188, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15518 goto _1 _1: ; @@ -190712,7 +191261,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+30197, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -190760,21 +191309,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+30210, 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+30242, 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+15518, __ccgo_ts+30265) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+30271, __ccgo_ts+30278, __ccgo_ts+5545) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15518, __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+30286, 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+30328, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -190826,7 +191375,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+30025, 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)) @@ -190848,15 +191397,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 + 30348 } } 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+30356, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30377, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30413, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15518 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -190865,7 +191414,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+30440, 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 @@ -190882,15 +191431,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+30488, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15518 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+30495, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -190948,7 +191497,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+30025, 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)) @@ -190957,7 +191506,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+30507, 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 { @@ -190977,9 +191526,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 + 30348 } else { - zCol = __ccgo_ts + 30023 + zCol = __ccgo_ts + 30078 } } zType = __ccgo_ts + 1139 @@ -190987,24 +191536,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+30529, 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 + 30265 } 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+30549, 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+30570, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30603, 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 + 15518 + zAnd = __ccgo_ts + 22697 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -191058,11 +191607,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+30627, 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+30639, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15493 + zS = __ccgo_ts + 15518 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -191074,7 +191623,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+30648, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -191100,7 +191649,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+30663, 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 @@ -191110,15 +191659,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+30677, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22697 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30634, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30689, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1665 i1 = 0 @@ -191128,8 +191677,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+30739, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22697 } goto _2 _2: @@ -191152,7 +191701,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+30752, 0) } // C documentation @@ -191194,16 +191743,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+30739, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15518 } 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+30778, 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 + 15518 } 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+30808, 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 + 15518 } } } @@ -191287,16 +191836,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 + 30845 *(*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+29997, 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+17157) == 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+30025, libc.VaList(bp+24, zIdx))) } break } @@ -191307,16 +191856,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 + 30265 } 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+30858, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15518 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30814, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30869, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -191362,7 +191911,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+30873) 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))) { @@ -191370,7 +191919,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+30025, 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))) { @@ -191379,21 +191928,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+30923, 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 + 30265 } 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+30945, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15518 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30900, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30955, 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+30970, 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)) } } @@ -191430,7 +191979,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) { @@ -191439,19 +191988,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 + 31032 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30990 + v2 = __ccgo_ts + 31045 } 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+31055, 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 + 15518 goto _1 _1: ; @@ -191460,17 +192009,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+31082, 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 + 31089 } 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+31104, 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)) } } @@ -191496,7 +192045,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+31136, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -191542,7 +192091,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+31193) } 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)) @@ -191711,7 +192260,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+31259, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -191728,18 +192277,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+31279, 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+31344, 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+31380, 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 { @@ -191754,26 +192303,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 + 31414 } else { - v2 = __ccgo_ts + 31363 + v2 = __ccgo_ts + 31418 } 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+31424, 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+31485, 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 + 31414 } else { - v3 = __ccgo_ts + 31363 + v3 = __ccgo_ts + 31418 } - 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+31546, 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 { @@ -191792,8 +192341,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). */ @@ -191802,39 +192351,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 + 31705 } 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 + 31714 } 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+31724, 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+31760, 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 + 31788 } /* 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 + 31800 } 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+31817, 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+31893, 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+32192, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -191845,9 +192394,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 + 32291 } else { - v7 = __ccgo_ts + 32246 + v7 = __ccgo_ts + 32301 } zRbuRowid1 = v7 } @@ -191860,14 +192409,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+30348, 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+15518, __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 + 32312 } else { v8 = __ccgo_ts + 1665 } @@ -191877,11 +192426,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 + 23953 } 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+32318, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -191969,9 +192518,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 + 31705 } - 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+32366, 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 } @@ -191998,7 +192547,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) } @@ -192045,7 +192594,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+32396, 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): @@ -192104,27 +192653,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+32426, 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+32454, 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+32472, 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 } @@ -192157,10 +192706,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+32538, 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+25296, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -192176,14 +192725,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 + 32570 } 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+32572, 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 @@ -192194,27 +192743,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+32604, -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+32619, 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+32636, -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+32652, 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+32680, 0) } } @@ -192300,7 +192849,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { if pState == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32597, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32652, uintptr(0), uintptr(0), uintptr(0)) } } /* Assuming no error has occurred, run a "restart" checkpoint with the @@ -192333,7 +192882,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CAPTURE) - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32643, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32698, uintptr(0), uintptr(0), uintptr(0)) if rc2 != int32(SQLITE_NOTICE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -192396,7 +192945,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) } @@ -192466,16 +193015,16 @@ 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) + 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_methods1)(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) } - 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)) @@ -192497,7 +193046,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+32733, 0) } // C documentation @@ -192514,13 +193063,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+32758, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32765, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -192652,7 +193201,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+24853, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -192788,7 +193337,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+32772) 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 @@ -192801,7 +193350,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+32794, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -192828,7 +193377,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+32821, 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))) @@ -192864,9 +193413,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+32981, 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+32996, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -192889,9 +193438,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+33016, 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+33041) } 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) @@ -192902,10 +193451,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+33149) } 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+33214) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -192923,7 +193472,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+33258, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -192950,8 +193499,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+18258) + _rbuCopyPragma(tls, p, __ccgo_ts+17353) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -192959,7 +193508,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+33283, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -192981,10 +193530,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+15422, 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+15422, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -193071,7 +193620,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+33311, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -193094,10 +193643,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+32758, 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) } @@ -193119,7 +193668,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+33336, 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) @@ -193166,7 +193715,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+33347, 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 { @@ -193211,11 +193760,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+33419, 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+33433) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -193224,7 +193773,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+33490) 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) @@ -193272,7 +193821,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 @@ -193304,7 +193853,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+33564, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -193326,17 +193875,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 + 33596 } else { - v3 = __ccgo_ts + 33548 + v3 = __ccgo_ts + 33603 } - (*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+33610, 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+15407, 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) @@ -193348,21 +193897,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+17972) + _rbuCopyPragma(tls, p, __ccgo_ts+17368) } /* 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+33642, 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+33658, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -193440,7 +193989,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+33682, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -193487,7 +194036,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+31705, 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++ @@ -193515,7 +194064,7 @@ 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+15422, 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) { @@ -193524,7 +194073,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { } _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+15422, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -193534,7 +194083,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+33690, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -193635,7 +194184,7 @@ 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+15422, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ @@ -193648,19 +194197,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { 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+15422, 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 + 15407 } else { - v1 = __ccgo_ts + 33587 + v1 = __ccgo_ts + 33642 } 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+33642, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -194146,7 +194695,7 @@ func _rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileSize})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, pSize) /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existence of a *-wal file. rbuVfsRead() contains ** similar logic. */ if rc == SQLITE_OK && *(*Tsqlite_int64)(unsafe.Pointer(pSize)) == 0 && (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpRbu)).FzTarget == uintptr(0) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_MAIN_DB) != 0 { *(*Tsqlite_int64)(unsafe.Pointer(pSize)) = int64(1024) @@ -194227,7 +194776,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xControl})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, int32(SQLITE_FCNTL_ZIPVFS), bp) if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33662, 0) + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33717, 0) } else { if rc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p @@ -194253,7 +194802,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r if rc == SQLITE_OK && op == int32(SQLITE_FCNTL_VFSNAME) { pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs zIn = *(*uintptr)(unsafe.Pointer(pArg)) - zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33685, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33740, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -194448,7 +194997,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag if pDb != 0 { if (*Trbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == int32(RBU_STAGE_OAL) { if (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) { - zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+7059) + zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+7084) zOpen = Xsqlite3_filename_wal(tls, zOpen) } nOpen = libc.Xstrlen(tls, zOpen) @@ -194462,7 +195011,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag } else { (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu } - if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33696, 0) != 0 { + if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33751, 0) != 0 { oflags = libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) } @@ -195018,7 +195567,7 @@ func _statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint _sqlite3TokenInit(tls, bp, *(*uintptr)(unsafe.Pointer(argv + 3*8))) iDb = _sqlite3FindDb(tls, db, bp) if iDb < 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12726, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12751, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) return int32(SQLITE_ERROR) } } else { @@ -195330,7 +195879,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { _sqlite3BtreeEnter(tls, pBt) nUsable = szPage - _sqlite3BtreeGetReserveNoMutex(tls, pBt) _sqlite3BtreeLeave(tls, pBt) - (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32)) + (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32))) if (*TStatPage)(unsafe.Pointer(p)).FaCell == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -195377,7 +195926,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } (*TStatCell)(unsafe.Pointer(pCell)).FnLastOvfl = libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp)) - libc.Uint32FromInt32(nLocal) - libc.Uint32FromInt32((nOvfl-int32(1))*(nUsable-int32(4)))) (*TStatCell)(unsafe.Pointer(pCell)).FnOvfl = nOvfl - (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(4)*libc.Uint64FromInt32(nOvfl)) + (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(uint64(4)*libc.Uint64FromInt32(nOvfl))) if (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -195518,7 +196067,7 @@ statNextRestart: (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiPgno = iRoot (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v1 = Xsqlite3_mprintf(tls, __ccgo_ts+4098, 0) + v1 = Xsqlite3_mprintf(tls, __ccgo_ts+4124, 0) z = v1 (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FzPath = v1 if z == uintptr(0) { @@ -195556,8 +196105,8 @@ statNextRestart: if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { (*TStatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33707 - v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33716, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33762 + v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33771, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) z = v2 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v2 if z == uintptr(0) { @@ -195586,7 +196135,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage++ if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226029)) + return _sqlite3CorruptError(tls, int32(227304)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -195597,7 +196146,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+33783, 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) { @@ -195620,13 +196169,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 + 33791 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 + 33800 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33750 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33805 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -195635,7 +196184,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) { @@ -195724,12 +196273,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+33815, 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+33970, 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+33984, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -195806,7 +196355,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+33999, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -197007,7 +197556,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) { @@ -197100,11 +197649,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+12142, 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+34006, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1665, 0) @@ -197113,7 +197662,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+34136, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -197139,10 +197688,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+30348))) 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) @@ -197163,8 +197712,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+30348) + libc.X__builtin___memcpy_chk(tls, pAlloc, __ccgo_ts+30348, 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) @@ -197228,7 +197777,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 @@ -197245,6 +197794,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 { @@ -197266,12 +197817,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+12142, (*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))) } } } @@ -197561,10 +198112,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 + 11762 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+34111, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+34166, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -197576,8 +198127,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 + 15518 goto _1 _1: ; @@ -198231,8 +198782,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+34173, 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 + 22697 if zRet == uintptr(0) { break } @@ -198261,8 +198812,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+34207, 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 + 34248 if zRet == uintptr(0) { break } @@ -198273,7 +198824,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 } @@ -198284,12 +198835,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 + 34253 } 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+34264, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -198350,11 +198901,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15493 + v2 = __ccgo_ts + 15518 } 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+34343, 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 } @@ -198382,7 +198933,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+34362, 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 { @@ -198411,17 +198962,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)) @@ -198434,7 +198986,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 } @@ -198445,18 +198999,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+34419, 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+34450, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -198482,7 +199062,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+34471, 0) } rc = int32(SQLITE_SCHEMA) } @@ -198530,7 +199110,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) } @@ -198814,7 +199394,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) } @@ -199114,12 +199694,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+34498, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+12142, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34502, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34526, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34535, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34580, bp) } else { i = 0 for { @@ -199127,17 +199707,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+15518, 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 + 15518 _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+34594, 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+34598, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -199151,7 +199731,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+34625, 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) } @@ -199293,7 +199873,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, 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+34667, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -199399,7 +199979,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } } 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+34687, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -199654,13 +200234,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 } } @@ -199816,7 +200397,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(230285)) + rc = _sqlite3CorruptError(tls, int32(231591)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -199840,7 +200421,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(230305)) + rc = _sqlite3CorruptError(tls, int32(231611)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -199855,7 +200436,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(230315)) + rc = _sqlite3CorruptError(tls, int32(231621)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -199911,7 +200492,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(230363)) + rc = _sqlite3CorruptError(tls, int32(231669)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -200016,7 +200597,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(230451)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231757)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -200087,8 +200668,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) @@ -200122,7 +200703,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(230537)) + v7 = _sqlite3CorruptError(tls, int32(231843)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -200132,7 +200713,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(230543)) + v10 = _sqlite3CorruptError(tls, int32(231849)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -200211,7 +200792,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(230587)) + v16 = _sqlite3CorruptError(tls, int32(231893)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -200549,7 +201130,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 @@ -200621,7 +201202,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230952)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232258)) goto finished_invert } if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { @@ -200824,7 +201405,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+12142) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -200833,9 +201414,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+34705, 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+34718, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -200845,9 +201426,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+34724, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15493 + zSep = __ccgo_ts + 15518 } goto _2 _2: @@ -200856,7 +201437,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+34729, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -200865,13 +201446,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+34737, 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+34812, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22625 + zSep = __ccgo_ts + 22697 } goto _3 _3: @@ -200958,9 +201539,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+34818, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34622, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34729, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -200970,9 +201551,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+34724, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22625 + zSep = __ccgo_ts + 22697 } goto _1 _1: @@ -200980,9 +201561,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+34836, 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+34248, bp) zSep = __ccgo_ts + 1665 i = 0 for { @@ -200992,16 +201573,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+34812, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34737 + zSep = __ccgo_ts + 34844 } 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)) @@ -201027,7 +201608,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 @@ -201050,16 +201631,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+34849, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22631, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22703, 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+15518, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -201067,19 +201648,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+34867, 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+34878, 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)) } @@ -201102,12 +201683,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+12142, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34775) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34882) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34888) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34995) } return rc } @@ -201173,7 +201754,7 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231434)) + rc = _sqlite3CorruptError(tls, int32(232740)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -201589,7 +202170,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+35139, 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)) @@ -201602,7 +202183,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+35160, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -201702,10 +202283,10 @@ 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+35179, 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+35205, 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)) @@ -201736,7 +202317,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui ** 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)))) 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 @@ -201746,7 +202327,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 } @@ -201765,18 +202346,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+35235, 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+35279, 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+35350, 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+12142) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -201833,17 +202414,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35303, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35410, 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+35440, 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+35464, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35440, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -201957,7 +202538,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) } @@ -202327,7 +202908,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) } @@ -202619,7 +203200,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 { @@ -202655,11 +203236,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 @@ -203244,6 +203831,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 @@ -203289,8 +203877,7 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset @@ -203302,12 +203889,13 @@ type Fts5Colset = TFts5Colset ** This object is used by fts5_expr.c and fts5_index.c. */ type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 + FnCol 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 ** to parse the arguments passed to the CREATE VIRTUAL TABLE statement. @@ -203684,7 +204272,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -203712,16 +204299,14 @@ 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 @@ -203763,7 +204348,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 @@ -204567,7 +205152,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+35492, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -204923,7 +205508,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+35520, 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 */ } @@ -205228,7 +205813,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+35551, 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) } @@ -205327,7 +205912,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 + 35558 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -205415,7 +206000,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) } @@ -205582,7 +206167,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 + 35608 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -205853,7 +206438,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))) @@ -205945,13 +206530,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) } @@ -205977,13 +206562,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 + 35656 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 + 35712 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -206016,19 +206601,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35663, + FzFunc: __ccgo_ts + 35770, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35671, + FzFunc: __ccgo_ts + 35778, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35681, + FzFunc: __ccgo_ts + 35788, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35686, + FzFunc: __ccgo_ts + 35793, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -206416,7 +207001,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 @@ -206892,7 +207477,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+35809, 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) { @@ -206918,12 +207503,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+35816, 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+35847, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -206932,7 +207517,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+35880, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -206942,14 +207527,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+35917, 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+35926, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -206976,7 +207561,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+35959, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -206988,76 +207573,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+35993, 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+36001, 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+36033, 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+36039, 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+36058, 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+36101, 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+36058, 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+36123, 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+36137, 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+36175, 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+36186, 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+36221, 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+36228, 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 + 18338, }, 2: { - FzName: __ccgo_ts + 36152, + FzName: __ccgo_ts + 36259, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -207065,20 +207650,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+36267, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36191, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36298, 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+36308, 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+36342, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -207139,16 +207724,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+36370) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+17269) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36375, 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+36405) { *(*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+36415, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -207174,7 +207759,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+36446, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -207182,12 +207767,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+36451, 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+36458, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36359, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36466, 0) } } goto _1 @@ -207203,9 +207788,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+36473, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36359, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36466, 0) } goto _2 _2: @@ -207268,8 +207853,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+36370) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36481, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -207300,7 +207885,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+36510, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -207330,7 +207915,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+36530, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -207338,37 +207923,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+36580, 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+36635, 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 + 35993 } 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 + 35993 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36581 + zTail = __ccgo_ts + 36688 } } } 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+36696, 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+17269, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -207437,7 +208022,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+36707, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -207446,16 +208031,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 + 15518 } 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+36723, 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+36730, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36370)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -207613,7 +208198,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+36756) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -207624,7 +208209,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+36761) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -207635,7 +208220,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+36770) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -207649,7 +208234,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+36780) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -207660,7 +208245,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+36790) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -207677,7 +208262,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+36802) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -207692,7 +208277,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+36370) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -207707,7 +208292,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+36814) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -207723,7 +208308,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+36828) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -207766,7 +208351,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 + 36838 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -207786,7 +208371,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+36870) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -207797,7 +208382,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+36878, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -207901,11 +208486,12 @@ type TFts5ExprNode1 = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode1 = TFts5ExprNode1 +/* Size (in bytes) of an Fts5ExprNode object that holds up to N children */ + /* ** 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. @@ -207935,24 +208521,26 @@ type TFts5ExprPhrase1 = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase1 = TFts5ExprPhrase1 +/* Size (in bytes) of an Fts5ExprPhrase object that holds up to N terms */ + /* ** 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 + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset1 = TFts5ExprNearset1 +/* Size (in bytes) of an Fts5ExprNearset object covering up to N phrases */ + /* ** Parse context. */ @@ -208043,7 +208631,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+36949, 0) return FTS5_EOF } goto _1 @@ -208054,7 +208642,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+36969, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -208069,13 +208657,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+37000, 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+37003, 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+31414, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -208119,7 +208707,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) @@ -209758,7 +210346,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) @@ -209768,7 +210356,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) @@ -209874,12 +210462,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 @@ -210013,7 +210601,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) @@ -210053,15 +210641,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)) @@ -210102,7 +210690,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 { @@ -210140,8 +210728,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+37007, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35520, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -210161,10 +210749,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+37012, 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: ; @@ -210198,7 +210789,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 { @@ -210248,7 +210839,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 @@ -210299,7 +210890,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+21700, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -210326,7 +210917,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)) @@ -210423,7 +211014,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+37041, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -210508,7 +211099,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) @@ -210521,7 +211112,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) @@ -210595,7 +211186,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 @@ -210621,11 +211212,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 + 37094 } else { - v2 = __ccgo_ts + 36900 + v2 = __ccgo_ts + 37007 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36994, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37101, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -210638,7 +211229,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+37151, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -210782,7 +211373,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 @@ -211115,7 +211706,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) { @@ -211179,7 +211770,7 @@ 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 +** to accumulate "term -> doclist" content before it is flushed to a level-0 ** segment. */ @@ -211238,7 +211829,7 @@ type TFts5HashEntry1 = struct { type Fts5HashEntry1 = TFts5HashEntry1 /* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -211376,7 +211967,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) } @@ -211688,7 +212279,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) } @@ -212120,9 +212711,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 @@ -212159,7 +212750,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -212232,7 +212822,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -212267,7 +212856,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -212282,9 +212870,9 @@ 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 @@ -212381,11 +212969,12 @@ type TFts5Structure1 = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure1 = TFts5Structure1 +/* Size (in bytes) of an Fts5Structure object holding up to N levels */ + /* ** An object of type Fts5SegWriter is used to write to segments. */ @@ -212518,13 +213107,15 @@ type Fts5SegIter1 = TFts5SegIter1 ** Array of tombstone pages. Reference counted. */ type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray1 = TFts5TombstoneArray1 +/* Size (in bytes) of an Fts5TombstoneArray holding up to N tombstones */ + /* ** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. @@ -212577,11 +213168,12 @@ type TFts5Iter1 = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter1 = TFts5Iter1 +/* Size (in bytes) of an Fts5Iter object holding up to N segment iterators */ + /* ** An instance of the following type is used to iterate through the contents ** of a doclist-index record. @@ -212607,13 +213199,15 @@ type TFts5DlidxLvl1 = struct { type Fts5DlidxLvl1 = TFts5DlidxLvl1 type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } 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)) *(*Tu8)(unsafe.Pointer(aOut + 1)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) & libc.Int32FromInt32(0xFF)) @@ -212792,7 +213386,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+37204, 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. @@ -212897,7 +213491,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+37210, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -212926,7 +213520,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+37261, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -212960,7 +213554,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+37310, 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) @@ -213038,7 +213632,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)) @@ -213129,7 +213723,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+37350, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -213140,7 +213734,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+37350, 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)) @@ -213821,7 +214415,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) @@ -214071,7 +214665,7 @@ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _ = nByte, nTomb, pNew nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(nTomb+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) if pNew != 0 { (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb @@ -214175,7 +214769,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 @@ -214781,7 +215375,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+37378, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -214870,7 +215464,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+37462, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -215517,7 +216111,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 @@ -216427,7 +217021,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 { @@ -216841,7 +217435,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+37544, 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. */ @@ -217347,7 +217941,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+37601, 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) @@ -217516,7 +218110,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 } @@ -217834,7 +218428,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+37662, 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))) @@ -218109,7 +218703,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: @@ -218144,7 +218738,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)) @@ -218758,11 +219352,12 @@ type TFts5TokenDataIter1 = struct { 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 // // /* @@ -218830,7 +219425,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) { @@ -219074,7 +219669,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) @@ -219124,7 +219719,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 @@ -219206,15 +219801,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) } @@ -219240,11 +219838,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+37713, 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+26449, __ccgo_ts+37721, 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+12353, __ccgo_ts+37756, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -219442,7 +220040,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) @@ -219697,7 +220295,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+37800) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -220048,7 +220646,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') @@ -220170,7 +220768,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 { @@ -220290,7 +220888,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+37204, 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))) @@ -220884,7 +221482,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+37802, 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)) @@ -221115,7 +221713,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+37888) 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)) @@ -221254,7 +221852,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -221411,11 +222008,12 @@ type TFts5Sorter1 = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter1 = TFts5Sorter1 +/* Size (int bytes) of an Fts5Sorter object with N indexes */ + /* ** Virtual-table cursor object. ** @@ -221737,7 +222335,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+37893, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -221774,7 +222372,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++ @@ -221793,7 +222391,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 @@ -222243,7 +222841,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 @@ -222271,7 +222869,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) } @@ -222291,7 +222889,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) @@ -222306,7 +222904,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 + 15518 } else { v1 = __ccgo_ts + 1665 } @@ -222316,11 +222914,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 + 37932 } else { - v3 = __ccgo_ts + 37830 + v3 = __ccgo_ts + 37937 } - 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+37941, 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 @@ -222378,14 +222976,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+37996, 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+38002, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -222435,7 +223033,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+38030, 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)) @@ -222468,7 +223066,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+38040, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -222502,7 +223100,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+38061, libc.VaList(bp+24, z)) } } } else { @@ -222510,7 +223108,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 + 35788 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -222667,7 +223265,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+38094, 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))) } @@ -222867,7 +223465,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+38099, 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 @@ -223000,10 +223598,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. @@ -225539,12 +226137,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+39448, 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+39552, 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+39590, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -225553,7 +226151,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+39628, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -225565,14 +226163,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+26449, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12353, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38782, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36581, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36688, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35886, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35993, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -225592,13 +226190,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 + 31089 } 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+39670, 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+39700, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -225639,7 +226237,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+39744, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -225647,7 +226245,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+39767, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -225662,7 +226260,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+39773, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -225671,22 +226269,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+35993, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39672 + zCols = __ccgo_ts + 39779 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39704 + zCols = __ccgo_ts + 39811 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36581, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36688, 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+38782, __ccgo_ts+39859, 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+36870, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -226106,12 +226704,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+39876, 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+39926, 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+39955, 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. */ @@ -226119,7 +226717,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+36870, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -226421,7 +227019,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+39984, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -226551,7 +227149,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) } @@ -226653,14 +227251,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+35993, 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 @@ -227312,11 +227910,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 + 40038 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) } @@ -227326,7 +227924,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+40047) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -227343,20 +227941,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+40058) { 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+40016) { 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+40027) { 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+40047) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -227648,7 +228246,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 + 40076 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -227865,64 +228463,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+40086, 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+40089, 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+40094, 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+40099, 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+40102, 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+40105, 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+40110, 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+40115, 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+40119, 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+40125, 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+40130, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -227931,49 +228529,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+40134, 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+40138, 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+40141, 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+40145, 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+40149, 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+40153, 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+40157, 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+40161, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -227990,20 +228588,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+40165, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40145, 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+40168, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40171, 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+40175, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40161, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -228019,75 +228617,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+40178, 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+40145, 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+40186, 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+40193, 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+40198, 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+40094, 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+40203, 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+40089, 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+40208, 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+40161, 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+40213, 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+16468, 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+40218, 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+40171, 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+40222, 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+40086, 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+40227, 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+40130, 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+40233, 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+40237, 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+40239, 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+40153, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -228096,48 +228694,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+40245, 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+40161, 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+40253, 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+40145, 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+40259, 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+40145, 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+40264, 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+40086, 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+40270, 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+40157, 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+40278, 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+40286, 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+40290, 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+40153, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -228145,21 +228743,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+40298, 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+40086, 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+40304, 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+40157, 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+40310, 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+40171, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -228177,48 +228775,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+40317, 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+40102, 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+40322, 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+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+39995, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40102, 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+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+39995, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40102, 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+40286, 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+40339, 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+40345, 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+40086, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -228234,13 +228832,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+40351, 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+40355, 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+40358, 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) @@ -228248,7 +228846,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+40361, 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) @@ -228413,14 +229011,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+40365) { 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+40058) { 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 { @@ -228688,7 +229286,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+40380)) } // C documentation @@ -228714,7 +229312,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39969, + FzName: __ccgo_ts + 40076, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -228722,7 +229320,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 40281, + FzName: __ccgo_ts + 40388, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -228730,7 +229328,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 40273, + FzName: __ccgo_ts + 40380, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -228760,7 +229358,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+40394, pApi, bp+96, uintptr(0)) } return rc } @@ -234276,16 +234874,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+40401) == 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+40405) == 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+40409) == 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+40418, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -234348,21 +234946,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 + 40452, + 1: __ccgo_ts + 40492, + 2: __ccgo_ts + 40527, } 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+24442, *(*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+40570, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -234383,23 +234982,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) } @@ -234532,10 +235131,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+40603, 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+40634, 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)) } @@ -234554,7 +235153,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+40685, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -235004,7 +235603,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+40711, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -235059,7 +235658,7 @@ 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 + 40721 } type TAggInfo_col = struct { @@ -235232,9 +235831,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 -------------------=== * @@ -235320,7 +235917,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 @@ -235368,11 +235965,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]int8{'3', '.', '4', '9', '.', '1'} +var Xsqlite3_version = [7]int8{'3', '.', '5', '0', '.', '1'} 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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods @@ -235382,3 +235979,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + diff --git a/vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go b/vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go index 4b7b1d5..543b39b 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 @@ -1421,6 +1423,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 +1663,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 +1874,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 +2037,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 +2046,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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70" +const SQLITE_SOURCE_ID = "2025-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2150,8 +2156,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.1" -const SQLITE_VERSION_NUMBER = 3049001 +const SQLITE_VERSION = "3.50.1" +const SQLITE_VERSION_NUMBER = 3050001 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3369,6 +3375,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 @@ -3378,9 +3387,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 @@ -4424,6 +4430,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 @@ -4856,7 +4863,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -6597,11 +6603,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. */ /* @@ -6975,6 +6987,7 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem @@ -7020,6 +7033,7 @@ type THashElem1 = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem1 = THashElem1 @@ -7291,6 +7305,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. */ @@ -7349,6 +7368,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 @@ -7652,7 +7682,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData = TDbClientData @@ -7722,9 +7751,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 @@ -7739,7 +7768,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -7788,8 +7816,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 @@ -7853,7 +7881,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -7925,19 +7952,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 @@ -7951,11 +7981,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 @@ -7966,40 +7993,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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -8017,7 +8045,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -8029,6 +8057,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -8177,9 +8206,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 @@ -8234,6 +8263,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8414,7 +8444,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8456,7 +8485,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -9026,8 +9054,8 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. +/* Use SQLITE_ENABLE_EXPLAIN_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 @@ -9874,6 +9902,7 @@ type TTable1 = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table1 = TTable1 @@ -9955,11 +9984,13 @@ type TFKey1 = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey1 = TFKey1 +/* The size (in bytes) of an FKey object holding N columns. The answer +** does NOT include space to hold the zTo name. */ + /* ** SQLite supports many different ways to resolve a constraint ** error. ROLLBACK processing means that a constraint violation @@ -10008,11 +10039,12 @@ type TKeyInfo1 = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo1 = TKeyInfo1 +/* The size (in bytes) of a KeyInfo object with up to N fields */ + /* ** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. */ @@ -10414,13 +10446,16 @@ type Expr1 = TExpr1 ** expression. */ type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList1 = TExprList1 +/* The size (in bytes) of an ExprList object that is big enough to hold +** as many as N expressions. */ + /* ** Allowed values for Expr.a.eEName */ @@ -10441,12 +10476,14 @@ type ExprList1 = TExprList1 ** 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 + F__ccgo_align [0]uint64 + FnId int32 } type IdList1 = TIdList1 +/* The size (in bytes) of an IdList object that can hold up to N IDs. */ + /* ** Allowed values for IdList.eType, which determines which value of the a.u4 ** is valid. @@ -10552,13 +10589,19 @@ type OnOrUsing1 = TOnOrUsing1 ** */ type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList1 = TSrcList1 +/* Size (in bytes) of a SrcList object that can hold as many as N +** SrcItem objects. */ + +/* Size (in bytes( of a SrcList object that holds 1 SrcItem. This is a +** special case of SZ_SRCITEM(1) that comes up often. */ + /* ** Permitted values of the SrcList.a.jointype field */ @@ -10919,19 +10962,22 @@ type TParse1 = 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 @@ -10945,11 +10991,8 @@ type TParse1 = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -10960,40 +11003,41 @@ type TParse1 = 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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -11359,11 +11403,13 @@ type TWith1 = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With1 = TWith1 +/* The size (in bytes) of a With object that can hold as many +** as N different CTEs. */ + /* ** The Cte object is not guaranteed to persist for the entire duration ** of code generation. (The query flattener or other parser tree @@ -11393,11 +11439,13 @@ type TDbClientData1 = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData1 = TDbClientData1 +/* The size (in bytes) of a DbClientData object that can has a name +** that is N bytes long, including the zero-terminator. */ + /* ** This object is used in various ways, most (but not all) related to window ** functions. @@ -12563,7 +12611,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12641,7 +12688,6 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor @@ -12679,11 +12725,16 @@ type TVdbeCursor1 = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor1 = TVdbeCursor1 +/* +** The size (in bytes) of a VdbeCursor object that has an nField value of N +** or less. The value of SZ_VDBECURSOR(n) is guaranteed to be a multiple +** of 8. + */ + /* Return true if P is a null-only cursor */ @@ -12894,21 +12945,14 @@ type Tsqlite3_context1 = struct { 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 */ +/* +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. + */ // C documentation // @@ -13041,7 +13085,7 @@ type TPreUpdate1 = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -13053,6 +13097,7 @@ type TPreUpdate1 = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate1 = TPreUpdate1 @@ -13190,7 +13235,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(24453)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13362,7 +13407,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)) @@ -13749,7 +13794,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++ } @@ -13820,10 +13865,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 @@ -13959,7 +14004,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) } } @@ -14056,7 +14101,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) @@ -14197,10 +14242,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)) @@ -14211,7 +14256,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 @@ -14289,7 +14334,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) @@ -14437,7 +14482,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)) @@ -14740,7 +14785,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 } @@ -14897,7 +14942,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('.') @@ -14945,7 +14990,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('.') @@ -15050,7 +15095,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) @@ -15779,7 +15824,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 } @@ -16428,7 +16473,8 @@ func init() { // /* // ** Initialize the mutex system. // */ -func _sqlite3MutexInit(tls *libc.TLS) (r int32) { +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 @@ -17753,17 +17799,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'), @@ -17960,22 +18006,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. */ @@ -18224,11 +18271,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 @@ -18256,7 +18303,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)) @@ -18278,7 +18325,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)) @@ -18705,29 +18752,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) @@ -18842,25 +18867,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 = v98 + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) + } + } + 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. @@ -18868,15 +18897,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) { @@ -18887,13 +18916,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) @@ -18907,35 +18969,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 - } - 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 + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + 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++ + } + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 + j1++ + 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) @@ -18960,9 +19085,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: ; @@ -18976,7 +19101,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 { @@ -18986,21 +19111,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: ; @@ -19239,7 +19364,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 @@ -19538,6 +19663,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 // // /* @@ -19555,11 +19682,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)) } @@ -20193,6 +20320,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 // // /* @@ -20943,7 +21101,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 { @@ -21118,7 +21276,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 @@ -21330,11 +21488,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 @@ -21570,7 +21728,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)) @@ -21660,7 +21818,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)) { @@ -21887,7 +22045,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++ } @@ -22047,7 +22205,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('+') @@ -22156,7 +22314,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-- } } @@ -22567,7 +22725,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 @@ -22596,7 +22754,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 { @@ -22610,7 +22768,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) @@ -22695,7 +22853,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) { @@ -23050,23 +23208,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 @@ -23121,8 +23277,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)) } @@ -23155,9 +23311,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: ; @@ -23177,13 +23332,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 } @@ -23191,7 +23345,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 @@ -23207,7 +23361,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 { @@ -23219,7 +23373,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 } @@ -23268,7 +23422,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 @@ -23278,20 +23432,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) } @@ -23310,196 +23463,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 { @@ -24255,91 +24408,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, - }, - 14: { - FzName: __ccgo_ts + 3553, - }, - 15: { - FzName: __ccgo_ts + 3560, - }, - 16: { FzName: __ccgo_ts + 3570, }, + 14: { + FzName: __ccgo_ts + 3579, + }, + 15: { + FzName: __ccgo_ts + 3586, + }, + 16: { + FzName: __ccgo_ts + 3596, + }, 17: { - FzName: __ccgo_ts + 3577, - }, - 18: { - FzName: __ccgo_ts + 3591, - }, - 19: { - FzName: __ccgo_ts + 3597, - }, - 20: { FzName: __ccgo_ts + 3603, }, - 21: { - FzName: __ccgo_ts + 3610, + 18: { + FzName: __ccgo_ts + 3617, }, - 22: { - FzName: __ccgo_ts + 3618, - }, - 23: { + 19: { FzName: __ccgo_ts + 3623, }, - 24: { - FzName: __ccgo_ts + 3630, + 20: { + FzName: __ccgo_ts + 3629, }, - 25: { - FzName: __ccgo_ts + 3637, + 21: { + FzName: __ccgo_ts + 3636, }, - 26: { + 22: { + FzName: __ccgo_ts + 3644, + }, + 23: { FzName: __ccgo_ts + 3649, }, + 24: { + FzName: __ccgo_ts + 3656, + }, + 25: { + FzName: __ccgo_ts + 3663, + }, + 26: { + FzName: __ccgo_ts + 3675, + }, 27: { - FzName: __ccgo_ts + 3658, + FzName: __ccgo_ts + 3684, }, 28: { - FzName: __ccgo_ts + 3664, + FzName: __ccgo_ts + 3690, }, } @@ -24574,9 +24727,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 } } @@ -24896,7 +25049,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 } @@ -24924,7 +25077,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 } } @@ -25583,7 +25736,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(40995)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -25938,7 +26091,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) @@ -26042,7 +26195,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 @@ -26200,7 +26353,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('/')) { @@ -26226,7 +26379,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(42576)), __ccgo_ts+3603, bp, int32(42576)) } // C documentation @@ -26263,7 +26416,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)<= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43393)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -26874,7 +27027,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)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44803)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -27883,10 +28035,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 @@ -27895,8 +28047,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 @@ -27958,7 +28110,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++ @@ -28130,7 +28282,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) } @@ -28285,7 +28437,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(45251)), __ccgo_ts+3486, zName, int32(45251)) if rc == SQLITE_OK { rc = rc2 } @@ -28362,7 +28514,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(45502)) 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(45507)), __ccgo_ts+3675, zIn, int32(45507)) return } (*(*[1026]int8)(unsafe.Pointer(bp + 224)))[got] = 0 @@ -28560,14 +28712,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(45565)), __ccgo_ts+3504, zPath, int32(45565)) } _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(45571)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<>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) } } @@ -31921,7 +32073,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) - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 0) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0)) for { v4 = n n-- @@ -32204,17 +32356,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) } @@ -32232,7 +32386,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 @@ -32244,7 +32398,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) } } @@ -32445,10 +32599,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 @@ -34593,7 +34748,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 @@ -34611,7 +34766,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 } @@ -35184,6 +35339,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 { @@ -35830,7 +35994,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 @@ -35842,7 +36007,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) @@ -35863,11 +36028,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 @@ -35896,7 +36062,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 @@ -36129,7 +36295,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) } @@ -36266,7 +36432,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)) @@ -36282,7 +36448,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)< int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65269)) } 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)) @@ -40389,7 +40555,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 { @@ -40953,9 +41119,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 @@ -41159,6 +41325,11 @@ type WalCkptInfo1 = TWalCkptInfo1 /* ** An open write-ahead log file is represented by an instance of the ** following object. +** +** writeLock: +** This is usually set to 1 whenever the WRITER lock is held. However, +** if it is set to 2, then the WRITER lock is held but must be released +** by walHandleException() if a SEH exception is thrown. */ type TWal1 = struct { FpVfs uintptr @@ -41225,13 +41396,15 @@ type ht_slot = Tht_slot ** This functionality is used by the checkpoint code (see walCheckpoint()). */ type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } 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 ** is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -41289,7 +41462,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) @@ -41301,7 +41474,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) } @@ -41390,6 +41563,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 @@ -41831,7 +42005,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(67209)) } goto _1 _1: @@ -41919,12 +42093,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(67341)) 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 @@ -42058,7 +42232,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 { @@ -42689,7 +42863,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(68150)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -42805,7 +42979,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)) } } @@ -43020,7 +43194,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 { @@ -43046,7 +43227,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(68601)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43769,8 +43950,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)) } @@ -43857,7 +44038,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(69451)) } iKey = _walNextHash(tls, iKey) } @@ -44354,7 +44535,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(69974)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44603,7 +44784,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, /* 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(70234)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -45375,6 +45556,11 @@ type CellInfo1 = TCellInfo1 ** assumed that the database is corrupt. */ +/* +** Maximum amount of storage local to a database page, regardless of +** page size. + */ + /* ** A cursor is a pointer to a particular entry within a particular ** b-tree within a database file. @@ -45741,10 +45927,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) { @@ -45753,14 +45940,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) { @@ -46460,7 +46647,7 @@ 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(72422)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } @@ -46638,7 +46825,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(72620)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46651,12 +46838,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(72633)) 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(72638)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46700,7 +46887,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(72683)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46708,7 +46895,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(72691)) } return SQLITE_OK } @@ -46896,7 +47083,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) } @@ -46929,7 +47116,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) } @@ -47128,7 +47315,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(73136)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -47168,12 +47355,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(73194)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73197)) } 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)) @@ -47181,21 +47368,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(73205)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73208)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73210)) } 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(73214)) } } cbrk = top + sz @@ -47242,12 +47429,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(73247)) } 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(73253)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -47263,7 +47450,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(73267)) } *(*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) @@ -47323,7 +47510,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(73324)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -47340,14 +47527,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(73339)) } 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(73346)) } return uintptr(0) } @@ -47390,11 +47577,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(73394)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73397)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -47408,7 +47595,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(73414)) } else { return SQLITE_OK } @@ -47461,42 +47648,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(73498)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47504,70 +47689,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(73510)) } - 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(73513)) } - 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(73526)) } - 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(73532)) } 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) + *(*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)) += libc.Int32FromUint16(iOrigSize) + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47613,7 +47798,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(73602)) } } } else { @@ -47639,7 +47824,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(73626)) } } } @@ -47678,12 +47863,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(73677)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73682)) } 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(73692)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73696)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47710,7 +47895,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(73708)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47741,11 +47926,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(73739)) } 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(73744)) } goto _1 _1: @@ -47774,11 +47959,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(73776)) } (*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) @@ -47787,7 +47972,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(73790)) } /* 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 @@ -47809,15 +47994,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 { @@ -47825,14 +48008,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) @@ -47940,7 +48123,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(73933)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -48002,7 +48185,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(74005)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -48090,7 +48273,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 */ @@ -48714,7 +48897,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) @@ -48876,7 +49059,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 @@ -48914,7 +49097,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(74943)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -49355,7 +49538,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(75398)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -49379,7 +49562,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(75417)) } 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) @@ -49388,7 +49571,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(75426)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -49402,7 +49585,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(75438)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -49432,7 +49615,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(75473)) } /* 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) @@ -49528,7 +49711,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(75571)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49566,7 +49749,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(75623)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -49633,7 +49816,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(75691)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49676,7 +49859,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(75742)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49706,7 +49889,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(75769)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -50172,7 +50355,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(76233)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50564,7 +50747,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(76657)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50574,7 +50757,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(76672)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50605,7 +50788,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) @@ -50631,7 +50814,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(76743)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50705,7 +50888,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(76827)) } return rc } @@ -50840,7 +51023,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(76965)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -50852,7 +51035,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(76979)) } if rc != 0 { v3 = pCur + 84 @@ -50968,7 +51151,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(77114)) } goto skip_init skip_init: @@ -50982,7 +51165,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(77126)) } 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) @@ -51216,7 +51399,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(77375)) } } } @@ -51420,7 +51603,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes p3 = pCur + 1 *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(BTCF_ValidOvfl) | libc.Int32FromInt32(BTCF_AtLast))) if !((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76795)) + return _sqlite3CorruptError(tls, int32(77571)) } goto bypass_moveto_root /* Start search on the current page */ } @@ -51483,10 +51666,10 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ if nCell < int32(2) || libc.Uint32FromInt32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77658)) 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 @@ -51514,7 +51697,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(77690)) } goto moveto_index_finish } @@ -51547,7 +51730,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(77721)) } *(*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 @@ -51556,7 +51739,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(77732)) } if rc != 0 { v11 = pCur + 84 @@ -51685,7 +51868,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(77833)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51795,7 +51978,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(77926)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -51883,7 +52066,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(78016)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -51938,7 +52121,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(78072)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -51964,7 +52147,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(78101)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -51991,7 +52174,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(78135)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -52062,7 +52245,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(78200)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52200,7 +52383,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(78327)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -52251,7 +52434,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(78374)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -52260,7 +52443,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(78385)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -52350,7 +52533,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(78474)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -52368,7 +52551,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(78491)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -52391,7 +52574,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(78511)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -52612,10 +52795,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(78767)) 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 @@ -53006,12 +53189,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(79157)) } 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(79162)) } } pData -= uintptr(sz) @@ -53019,7 +53202,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(79168)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -53114,7 +53297,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(79255)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -53195,7 +53378,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: ; @@ -53222,7 +53405,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: ; @@ -53262,7 +53445,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(79377)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2))) nCell -= nShift @@ -53333,7 +53516,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(79455)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -53378,7 +53561,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(79495)) } /* 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 @@ -53574,10 +53757,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 @@ -53700,8 +53884,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 @@ -53741,7 +53925,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(79919)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53764,7 +53948,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(79943)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -53895,7 +54079,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(80044)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -53938,7 +54122,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(80077)) goto balance_cleanup } } @@ -53997,7 +54181,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(80121)) goto balance_cleanup } goto _11 @@ -54029,7 +54213,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(80154)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -54259,7 +54443,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(80355)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54505,7 +54689,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(80587)) } goto _1 _1: @@ -54578,7 +54762,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(80647)) } 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))) @@ -54737,7 +54921,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(80811)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54768,7 +54952,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(80839)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -54853,7 +55037,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(80920)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -54945,7 +55129,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(81043)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -54981,7 +55165,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(81085)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55011,10 +55195,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(81112)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81115)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -55132,12 +55316,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(81217)) } 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 @@ -55147,14 +55331,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(81242)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -55254,21 +55438,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(81338)) } } 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(81347)) } 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(81561)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55513,7 +55697,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(81609)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55594,14 +55778,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(81699)) } *(*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(81706)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55738,7 +55922,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(81810)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -56003,7 +56187,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)) @@ -56051,11 +56235,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) @@ -56081,11 +56265,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 @@ -56157,11 +56341,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)) } } @@ -56297,12 +56481,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 } @@ -56387,7 +56571,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 */ @@ -56410,7 +56594,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 { @@ -56487,7 +56671,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))) @@ -56501,7 +56685,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 @@ -56592,7 +56776,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) } @@ -56616,11 +56800,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) } } } @@ -56657,10 +56841,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: @@ -57099,7 +57283,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) @@ -57109,7 +57293,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 @@ -57138,7 +57322,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 @@ -57168,7 +57352,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... @@ -57844,7 +58028,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) } @@ -57982,9 +58166,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 @@ -58159,20 +58340,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 } @@ -58187,10 +58368,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 @@ -58944,7 +59125,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(85108)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -59108,7 +59289,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 { @@ -59116,8 +59298,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 { @@ -59174,14 +59356,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 */ @@ -59195,7 +59377,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 @@ -59220,14 +59402,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)) @@ -59327,7 +59509,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 } } } @@ -59342,7 +59524,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 } @@ -59646,7 +59828,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(85794)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59662,7 +59844,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(85800)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59672,7 +59854,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(85806)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -60133,12 +60315,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 @@ -60312,7 +60493,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 @@ -60329,7 +60510,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 { @@ -60397,8 +60578,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. @@ -60411,11 +60592,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 */ @@ -60452,13 +60633,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 @@ -60489,7 +60673,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 @@ -60991,7 +61175,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)) { @@ -61004,39 +61188,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): @@ -61053,14 +61237,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 @@ -61075,20 +61259,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)) } @@ -61102,10 +61286,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 @@ -61902,7 +62086,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 } @@ -62056,7 +62240,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) } @@ -62064,18 +62248,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) @@ -62306,7 +62490,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(90646))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63694,7 +63878,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(90727))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -63729,7 +63913,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(90757))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63783,7 +63967,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(90808))) return 0 /* Corrupt index */ } } @@ -63915,7 +64099,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(90971))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -64067,7 +64251,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(91129)) } // C documentation @@ -64098,7 +64282,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(91162)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -64249,15 +64433,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 @@ -64352,10 +64536,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 @@ -64364,9 +64549,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 { @@ -64446,7 +64631,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 @@ -64456,7 +64641,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) @@ -64514,7 +64699,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(91560)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -65017,7 +65202,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 @@ -65218,7 +65403,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(92354)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -65348,7 +65533,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(92475)) } 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) @@ -65808,18 +65993,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'), @@ -66074,14 +66259,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(93091)) } 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(93095))) 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(93099)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -66232,7 +66417,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, 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) } @@ -66655,11 +66840,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(93642)) 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))) } @@ -66668,7 +66853,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) @@ -66682,7 +66867,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) } @@ -66717,7 +66902,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(93701)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66752,7 +66937,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 } @@ -66818,11 +67003,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(93797)) 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))) } @@ -66845,7 +67030,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 @@ -66867,7 +67052,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 @@ -66994,7 +67179,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 { @@ -67032,7 +67217,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 @@ -67047,28 +67232,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)) } } } @@ -67232,9 +67417,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 { @@ -67260,12 +67445,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) @@ -67274,28 +67457,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 @@ -67686,12 +67869,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 @@ -67708,7 +67891,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 @@ -67726,7 +67909,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 @@ -68440,19 +68623,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) { @@ -69666,7 +69849,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 @@ -69682,6 +69865,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 */ @@ -70175,7 +70364,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(97561)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -70278,7 +70467,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, @@ -70874,7 +71063,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 { @@ -70904,12 +71093,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 } @@ -71001,7 +71190,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. @@ -72112,7 +72301,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(99822)) } else { goto jump_to_p2 } @@ -72571,7 +72760,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(). @@ -73004,7 +73193,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(101119)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -73334,7 +73523,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 @@ -73365,13 +73554,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 { @@ -73386,7 +73575,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(101412)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73623,7 +73812,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 @@ -73640,15 +73829,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 @@ -73729,11 +73918,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) } @@ -73945,7 +74134,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 @@ -73995,7 +74184,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 { @@ -74051,7 +74240,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)) @@ -74130,11 +74319,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) { @@ -74287,7 +74476,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 } @@ -74449,7 +74638,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' @@ -74529,12 +74718,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)) @@ -74545,7 +74734,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)) @@ -74639,7 +74828,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 } @@ -74667,11 +74856,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) { @@ -74799,7 +74988,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) @@ -74950,7 +75139,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 { @@ -75037,15 +75226,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) @@ -75511,11 +75692,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) @@ -75601,7 +75782,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103962)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75700,7 +75881,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(104062)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75714,7 +75895,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) } @@ -76161,11 +76342,12 @@ type TVdbeSorter1 = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter1 = TVdbeSorter1 +/* Size (in bytes) of a VdbeSorter object that works with N or fewer subtasks */ + /* ** An instance of the following object is used to read records out of a ** PMA, in sorted order. The next key to be read is cached in nKey/aKey. @@ -76772,8 +76954,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 @@ -76787,9 +76969,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) @@ -76987,18 +77169,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 { @@ -77286,6 +77469,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: @@ -79831,25 +80017,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) } } @@ -79888,23 +80074,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 */ @@ -79936,7 +80121,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 @@ -80030,7 +80215,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 } } @@ -80052,57 +80237,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 @@ -80147,11 +80319,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 } @@ -80160,36 +80332,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++ @@ -80218,18 +80379,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 } } } @@ -80276,15 +80437,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) @@ -80295,8 +80456,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -80336,7 +80497,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) @@ -80356,7 +80517,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) @@ -80365,7 +80526,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 @@ -80375,26 +80536,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) } @@ -80443,8 +80604,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80518,19 +80679,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) } @@ -80556,7 +80717,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 @@ -80702,7 +80863,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) { @@ -80757,7 +80918,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 { @@ -80781,7 +80942,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) @@ -80795,13 +80956,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: ; @@ -80821,16 +80982,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 @@ -80841,35 +80999,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 { @@ -80954,7 +81115,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))) } @@ -80966,7 +81127,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 @@ -81012,7 +81173,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 @@ -81137,7 +81298,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) } @@ -81172,7 +81333,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 @@ -81210,7 +81371,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 { @@ -81280,7 +81441,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 @@ -81314,7 +81475,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 @@ -81627,7 +81788,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 { @@ -81694,7 +81855,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 { @@ -81705,7 +81866,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 @@ -81715,7 +81876,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 @@ -81937,33 +82098,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 } @@ -82015,7 +82178,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) { @@ -82223,7 +82386,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 } @@ -82698,7 +82861,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) { @@ -82777,7 +82940,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 @@ -82964,7 +83127,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) @@ -83122,11 +83285,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)) @@ -83175,7 +83338,7 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt 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)) { _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) } @@ -83203,7 +83366,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)) @@ -83223,7 +83386,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 @@ -83294,7 +83457,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)) } } } @@ -83346,7 +83509,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 } @@ -83379,7 +83542,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) } } @@ -83762,7 +83925,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 @@ -83902,7 +84065,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: @@ -83923,27 +84085,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) { @@ -83989,9 +84144,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++ } @@ -84001,8 +84156,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++ } @@ -84016,7 +84171,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) } @@ -84067,7 +84222,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 @@ -84148,7 +84303,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) @@ -84166,7 +84321,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) @@ -84247,7 +84402,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 @@ -84376,7 +84531,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)) } } @@ -84474,10 +84629,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) @@ -85155,13 +85310,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 @@ -85176,32 +85331,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 @@ -85410,7 +85552,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 @@ -85463,7 +85605,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) @@ -85563,12 +85705,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) @@ -86160,7 +86303,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 @@ -86256,14 +86399,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 } @@ -86291,9 +86434,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) { @@ -86426,7 +86569,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) } } @@ -86556,13 +86699,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)<= (*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) } @@ -87354,7 +87497,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)) @@ -87369,7 +87512,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) { @@ -87398,7 +87541,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) } @@ -87474,7 +87617,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): @@ -87537,7 +87680,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 @@ -87547,7 +87690,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) { @@ -87568,9 +87711,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 /* @@ -87652,7 +87795,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) { @@ -87723,17 +87866,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 { @@ -87742,7 +87885,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 @@ -87773,7 +87916,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 { @@ -87843,7 +87986,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) @@ -87887,7 +88030,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 @@ -88154,7 +88297,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: @@ -88363,7 +88508,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: @@ -89070,7 +89217,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) } @@ -89591,7 +89738,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) 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 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 @@ -89607,7 +89754,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) (*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 + v9 = pParse + 60 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 @@ -89692,7 +89839,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 @@ -89700,7 +89847,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 @@ -89718,7 +89865,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 } } } @@ -89737,11 +89884,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 } @@ -89859,8 +90006,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+8538, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -89878,10 +90025,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+8566, 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+8741, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -89897,9 +90044,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+8915, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9037, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9062, 0) } } @@ -89955,7 +90102,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+9213, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -89964,11 +90111,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+9272, 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+9278, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -89998,21 +90145,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+9305, 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+9489, 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+9794, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9810, 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+9868, 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 @@ -90020,7 +90167,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 @@ -90028,7 +90175,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+10133, 0) goto exit_rename_table exit_rename_table: ; @@ -90045,7 +90192,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+10146, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -90085,11 +90232,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+10184, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10191, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10216, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -90105,10 +90252,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+10243) } 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+10302) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -90120,13 +90267,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+10355) } _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+10401) } } /* Modify the CREATE TABLE statement. */ @@ -90140,7 +90287,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+10428, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -90168,7 +90315,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+10574, libc.VaList(bp+16, zTab, zDb)) } } } @@ -90206,12 +90353,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+10927, 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+10961, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -90226,7 +90373,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 } @@ -90234,8 +90381,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+10991, 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 } @@ -90296,18 +90443,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 + 11010 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10990 + zType = __ccgo_ts + 11015 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11004 + v1 = __ccgo_ts + 11029 } else { - v1 = __ccgo_ts + 11021 + v1 = __ccgo_ts + 11046 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11039, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11064, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90354,21 +90501,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+11082, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -90384,11 +90519,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+11103, 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+11285, 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+10133, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -90864,11 +90999,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 + 11416 } 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+11418, 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) } @@ -90939,30 +91074,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+11441, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118867)) } 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(118888)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -90983,9 +91122,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)) @@ -91001,15 +91139,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+11449, 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)) @@ -91020,16 +91158,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++ @@ -91046,21 +91184,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 + 11416 } 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+11455, 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))) @@ -91086,7 +91224,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: ; @@ -91396,7 +91534,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 { @@ -91663,7 +91801,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) @@ -91846,7 +91984,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 { @@ -91930,8 +92068,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 @@ -91947,12 +92086,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)) @@ -92026,7 +92165,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(119856)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -92043,7 +92182,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+11460, 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 @@ -92098,23 +92237,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+11082, 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 + 11467 } 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+11479, 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+11507, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -92126,31 +92265,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+11555, 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+11676, 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)) { @@ -92164,7 +92303,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 @@ -92175,8 +92314,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 } @@ -92237,27 +92376,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 + 11694, }, 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 + 11715, }, 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 + 11735, }, 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 + 11754, }, 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 + 11773, }, } @@ -92468,8 +92607,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+11876, 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 { @@ -92479,10 +92623,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+11899, 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+11929, 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) @@ -92514,15 +92658,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11771, - FzCols: __ccgo_ts + 11784, + FzName: __ccgo_ts + 11796, + FzCols: __ccgo_ts + 11809, }, 1: { - FzName: __ccgo_ts + 11797, - FzCols: __ccgo_ts + 11810, + FzName: __ccgo_ts + 11822, + FzCols: __ccgo_ts + 11835, }, 2: { - FzName: __ccgo_ts + 11838, + FzName: __ccgo_ts + 11863, }, } @@ -92736,7 +92880,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) { @@ -92752,12 +92897,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 @@ -92765,7 +92910,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) @@ -92824,7 +92969,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 + 11947, } func init() { @@ -93198,7 +93343,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 + 11957, } func init() { @@ -93248,7 +93393,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+11967, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -93259,7 +93404,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+11972, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -93298,7 +93443,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+11978, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -93316,7 +93461,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 + 11984, } func init() { @@ -93382,7 +93527,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+11993, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -93391,12 +93536,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+11796, 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)) @@ -93518,7 +93663,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 } @@ -93598,7 +93743,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: @@ -93629,7 +93774,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+12003, 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)) @@ -93720,7 +93865,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+12003, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -93757,7 +93902,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 @@ -93790,11 +93935,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+12007) } 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+12011) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -93958,17 +94103,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+12015, 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+12026, 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+12036, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -93980,13 +94125,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) - } } } @@ -94037,7 +94175,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) } @@ -94240,8 +94378,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))) @@ -94347,11 +94485,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+11822, 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+12048, __ccgo_ts+12117, zDb) } return rc } @@ -94417,10 +94555,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+11796, (*(*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+12169, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94533,7 +94671,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 @@ -94585,11 +94723,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+12210, 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 { @@ -94620,7 +94758,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+12213, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -94629,7 +94767,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+12250, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -94641,13 +94779,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 } @@ -94685,7 +94823,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+12280, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94693,7 +94831,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+12309, 0) rc = int32(SQLITE_ERROR) } } @@ -94740,7 +94878,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+12377, libc.VaList(bp+56, zFile)) } } } @@ -94802,15 +94940,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+12405, 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+12426, 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+12452, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -94905,7 +95043,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 + 12474, } func init() { @@ -94927,7 +95065,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 + 12488, } func init() { @@ -94953,7 +95091,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+12502, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -94987,7 +95125,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+12526, 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))) @@ -95204,7 +95342,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+12572, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -95232,11 +95370,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+12595, 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+12601, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12582, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12607, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -95296,7 +95434,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) { @@ -95331,7 +95469,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+12634, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -95449,7 +95587,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 @@ -95547,7 +95685,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) @@ -95625,7 +95765,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) { @@ -95639,7 +95779,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) } @@ -95752,21 +95894,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) } } } @@ -95796,12 +95938,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) } } } @@ -95839,7 +95981,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+12649, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -95849,7 +95991,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) @@ -95857,15 +95999,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 + 12657 } else { - v1 = __ccgo_ts + 12645 + v1 = __ccgo_ts + 12670 } 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 { } @@ -95903,12 +96045,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 @@ -96433,7 +96575,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) @@ -96465,7 +96607,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 @@ -96523,13 +96665,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+12684, 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+12701, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96577,8 +96719,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+12721, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96614,23 +96756,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 @@ -96750,7 +96894,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 @@ -96793,9 +96937,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 @@ -96808,7 +96952,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+12763, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -96824,9 +96968,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10985 + v2 = __ccgo_ts + 11010 } else { - v2 = __ccgo_ts + 9247 + v2 = __ccgo_ts + 9272 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -96836,9 +96980,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 @@ -96862,11 +97006,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 + 11010 } else { - v4 = __ccgo_ts + 9247 + v4 = __ccgo_ts + 9272 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12779, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12804, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -96874,11 +97018,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+12825, 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++ @@ -96910,19 +97054,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 @@ -96942,15 +97096,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) @@ -96965,7 +97124,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 } @@ -97026,7 +97185,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+12860, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -97035,14 +97194,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+12894, 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) @@ -97074,11 +97235,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) @@ -97089,7 +97250,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+12914, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -97099,12 +97260,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+12937, 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+12944, 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-- @@ -97146,21 +97307,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+12954, 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) { @@ -97171,7 +97321,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. */ @@ -97184,12 +97334,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 @@ -97361,10 +97520,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+12980, 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+13025, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -97422,7 +97581,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+13066, 0) } } @@ -97450,8 +97609,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) @@ -97459,7 +97618,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+13118, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -97478,21 +97637,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 @@ -97515,7 +97663,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+13159, 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) @@ -97543,8 +97691,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 { @@ -97631,17 +97784,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+13215, 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+13258, (*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+13266, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97673,7 +97826,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+13273, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -97814,9 +97967,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 @@ -97827,31 +97981,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 + 13304 + zEnd = __ccgo_ts + 5199 } else { - zSep = __ccgo_ts + 13281 - zSep2 = __ccgo_ts + 13285 - zEnd = __ccgo_ts + 13290 + zSep = __ccgo_ts + 13306 + zSep2 = __ccgo_ts + 13310 + zEnd = __ccgo_ts + 13315 } - 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+13318, 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))++ @@ -97862,8 +98016,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)] @@ -97876,17 +98031,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 + 13332, + 2: __ccgo_ts + 13338, + 3: __ccgo_ts + 13343, + 4: __ccgo_ts + 13348, + 5: __ccgo_ts + 13338, } // C documentation @@ -97895,15 +98051,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) } @@ -97918,7 +98075,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 } @@ -98151,8 +98308,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. @@ -98252,7 +98419,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 @@ -98265,8 +98432,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++ } @@ -98296,7 +98463,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 @@ -98515,9 +98682,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+13354, 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+13387, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98538,11 +98705,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+13414, 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+13464, 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)) @@ -98589,7 +98756,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+13496, 0) return } } @@ -98623,16 +98790,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 + 9272 + zType2 = __ccgo_ts + 13540 } else { /* A view */ - zType = __ccgo_ts + 10985 - zType2 = __ccgo_ts + 13521 + zType = __ccgo_ts + 11010 + zType2 = __ccgo_ts + 13546 } /* 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 @@ -98649,24 +98816,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) @@ -98714,13 +98886,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+13551, 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+13566, 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 @@ -98729,15 +98911,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+13664, 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+13706, 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+13740, 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. @@ -98755,7 +98937,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+9794) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -98788,7 +98970,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+13761, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -98805,7 +98987,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+11010, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -98902,7 +99084,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+13797, 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. @@ -99086,7 +99268,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+13827, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -99099,7 +99281,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+13842, 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) } @@ -99182,9 +99364,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+13909, 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+11899, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -99225,7 +99407,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+13923, 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 @@ -99234,7 +99416,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+13968, 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) } @@ -99269,11 +99451,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) @@ -99328,9 +99510,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 @@ -99363,18 +99545,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+14035, 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+14063, 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+14097, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -99384,7 +99566,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+12011, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -99432,19 +99614,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+14129, 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+14192, 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 { @@ -99501,7 +99683,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+14286, 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) { @@ -99616,11 +99798,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 */ @@ -99642,7 +99824,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 @@ -99687,13 +99869,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) } @@ -99716,23 +99898,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 @@ -99761,11 +99943,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 + 14332 } else { - v2 = __ccgo_ts + 14313 + v2 = __ccgo_ts + 14338 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14318, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14343, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -99843,7 +100025,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+14371, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -99853,7 +100035,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+14377, 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)) { @@ -99867,16 +100049,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+14427, 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+14455, 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+14480, 0) goto exit_create_index } /* @@ -99897,19 +100079,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+14371, (*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+14514, 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+14548, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -99930,7 +100112,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+14572, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -99948,9 +100130,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 @@ -99978,7 +100160,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+14371) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -100010,7 +100192,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 } @@ -100062,7 +100244,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+14595, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -100077,6 +100259,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { j = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) } else { if int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16 + 8))&0xf>>0)) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) @@ -100161,7 +100344,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) @@ -100209,7 +100392,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+14656, 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 @@ -100239,8 +100422,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+14698, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127335)) goto exit_create_index } } @@ -100253,7 +100436,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 @@ -100282,9 +100465,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 + 14715 } - 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+14723, 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(""); */ @@ -100292,7 +100475,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+14743, 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. @@ -100300,7 +100483,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+14802, 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)) @@ -100463,16 +100646,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+14829, 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+14847, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100480,9 +100663,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 { @@ -100498,8 +100681,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+14920, 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+12007, (*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) @@ -100572,12 +100755,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) @@ -100689,13 +100872,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+14980, 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) } @@ -100776,7 +100959,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) } @@ -100826,7 +101009,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 @@ -100997,11 +101180,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 + 15016 } else { - v1 = __ccgo_ts + 14994 + v1 = __ccgo_ts + 15019 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15000, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15025, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -101200,7 +101383,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+15061, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -101247,9 +101430,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 + 15067 } else { - v1 = __ccgo_ts + 15051 + v1 = __ccgo_ts + 15076 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -101281,9 +101464,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 + 15061, + 1: __ccgo_ts + 15083, + 2: __ccgo_ts + 15067, } // C documentation @@ -101303,7 +101486,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+15091, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -101328,7 +101511,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+12595, 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 @@ -101759,7 +101942,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+15291, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102641,11 +102822,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+15324, 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+15353, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102749,7 +102930,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 @@ -102806,7 +102987,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+15427, -int32(1)) return } if argc == int32(3) { @@ -104525,7 +104711,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+15460, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -104607,7 +104793,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 @@ -104679,28 +104865,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+15505, 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+15513, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -104732,13 +104918,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 + 15521 + } else { + v2 = __ccgo_ts + 15525 + } + 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+15528, -int32(1)) + return +} + // C documentation // // /* @@ -104750,6 +105072,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) @@ -104760,7 +105086,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) @@ -105195,7 +105521,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 } @@ -105284,7 +105610,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11391, + 0: __ccgo_ts + 11416, } // C documentation @@ -105444,7 +105770,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+15551, int32(4), libc.UintptrFromInt32(0)) } } @@ -105505,7 +105831,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+12634, -int32(1)) return } if argc == int32(2) { @@ -105615,7 +105941,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) { @@ -105697,7 +106023,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+15404, -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) @@ -105929,7 +106255,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) @@ -105940,7 +106266,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 { @@ -106047,7 +106373,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+15556, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -106076,8 +106402,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+15562, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15562, 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 @@ -106257,11 +106583,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 @@ -106365,7 +106691,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))) } /* @@ -106378,542 +106704,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 + 15567, }, 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 + 15587, }, 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 + 15600, }, 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 + 15618, }, 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 + 15627, }, 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 + 15635, }, 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 + 15635, }, 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 + 15650, }, 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 + 15676, }, 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 + 15701, }, 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 + 15710, }, 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 + 15721, }, 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 + 15728, }, 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 + 15742, }, 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 + 15742, }, 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 + 15748, }, 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 + 15748, }, 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 + 15754, }, 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 + 15754, }, 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 + 15759, }, 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 + 15759, }, 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 + 15763, }, 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 + 15763, }, 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 + 15767, }, 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 + 15774, }, 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 + 15782, }, 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 + 15789, }, 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 + 15802, }, 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 + 15808, }, 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 + 15815, }, 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 + 15822, }, 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 + 15830, }, 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 + 15835, }, 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 + 15839, }, 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 + 15839, }, 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 + 15845, }, 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 + 15851, }, 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 + 15857, }, 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 + 15861, }, 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 + 15861, }, 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 + 15867, }, 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 + 15874, }, 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 + 15884, }, 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 + 15891, }, 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 + 15898, }, 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 + 15909, }, 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 + 15916, }, 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 + 15931, }, 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 + 15948, }, 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 + 15959, }, 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 + 15966, }, 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 + 15972, }, 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 + 15985, }, 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 + 16003, }, 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 + 16011, }, 55: { - 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 + 15970, - }, - 56: { 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 + 16025, + }, + 56: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16033, }, 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 + 16042, }, 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 + 16042, }, 59: { - 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, + 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 + 16049, }, 60: { - 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, + 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 + 16049, }, 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 + 15997, + FzName: __ccgo_ts + 16059, }, 62: { - 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, + 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 + 16063, }, 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(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16001, + 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 + 16069, }, 64: { - 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, + 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 + 16073, }, 65: { - 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, + 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 + 16073, }, 66: { - FnArg: int16(2), + 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 + 16020, + FzName: __ccgo_ts + 16079, }, 67: { 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, + 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 + 16079, }, 68: { 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, + 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 + 16092, }, 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 + 16103, + }, + 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 + 15562, + }, + 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, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16036, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1238, + FzName: __ccgo_ts + 15562, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1246, + FzName: __ccgo_ts + 16108, }, 73: { 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 + 1238, }, 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 + 16047, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1246, }, 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 + 16050, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16113, }, 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 + 16054, + FzName: __ccgo_ts + 16119, }, 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 + 16060, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16122, }, 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 + 16050, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16126, }, 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, + FfuncFlags: 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 + 16132, }, 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 + 16122, }, 81: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16073, - }, - 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, - }, - 83: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16083, - }, - 84: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16088, - }, - 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, - }, - 86: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16098, - }, - 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, - }, - 88: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16108, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, }, + 82: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16141, + }, + 83: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16145, + }, + 84: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16151, + }, + 85: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16155, + }, + 86: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16160, + }, + 87: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16165, + }, + 88: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16170, + }, + 89: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16176, + }, + 90: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16180, + }, + 91: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16184, + }, + 92: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16188, + }, + 93: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16193, + }, + 94: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16198, + }, 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 + 16203, }, 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 + 16209, }, 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 + 16215, }, 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 + 16221, }, 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 + 16226, }, 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 + 16234, }, 101: { - 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, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16242, }, 102: { - 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, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16245, }, 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 + 6883, + }, + 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 + 16182, + FzName: __ccgo_ts + 16250, + }, + 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 + 16254, }, } @@ -106972,109 +107309,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 ************************************************/ @@ -107298,7 +107637,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) } @@ -107391,7 +107730,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+16257, 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) @@ -108215,7 +108554,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 @@ -108502,11 +108841,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 { @@ -108570,7 +108909,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) @@ -108586,7 +108925,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 @@ -109152,7 +109491,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 } @@ -109218,11 +109557,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 } @@ -109547,7 +109886,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) @@ -109561,7 +109900,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 @@ -109596,7 +109935,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 @@ -109609,7 +109948,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 @@ -109736,27 +110075,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 */ @@ -109837,7 +110176,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++ @@ -109864,7 +110203,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 } @@ -109873,44 +110212,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+16302, 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+16343, 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 } } @@ -109932,31 +110255,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+16375, 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 @@ -109980,10 +110303,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) @@ -110024,8 +110347,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-- } @@ -110042,34 +110365,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+16383, 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+16435, 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 @@ -110176,18 +110499,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 @@ -110197,13 +110520,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 } } } @@ -110214,14 +110537,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 } @@ -110238,16 +110561,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++ @@ -110358,11 +110681,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 */ @@ -110421,7 +110744,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16455) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16527) } goto insert_cleanup insert_cleanup: @@ -110817,7 +111140,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+12595, 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('/'))) { @@ -113051,7 +113376,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+16576, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -113071,19 +113396,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+16580, 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+16586, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113098,14 +113423,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+16629, 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) } @@ -113129,7 +113454,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+16661, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113138,7 +113463,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 + 16541, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -113371,7 +113696,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+16698, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -113425,63 +113750,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 + 16737, + 2: __ccgo_ts + 9272, + 3: __ccgo_ts + 16741, + 4: __ccgo_ts + 16746, + 5: __ccgo_ts + 16749, + 6: __ccgo_ts + 16759, + 7: __ccgo_ts + 16769, + 8: __ccgo_ts + 16775, + 9: __ccgo_ts + 16779, + 10: __ccgo_ts + 16784, + 11: __ccgo_ts + 16789, + 12: __ccgo_ts + 16797, + 13: __ccgo_ts + 16808, + 14: __ccgo_ts + 16811, + 15: __ccgo_ts + 16779, + 16: __ccgo_ts + 16818, + 17: __ccgo_ts + 16784, + 18: __ccgo_ts + 16826, + 19: __ccgo_ts + 16830, + 20: __ccgo_ts + 16835, + 21: __ccgo_ts + 16841, + 22: __ccgo_ts + 16779, + 23: __ccgo_ts + 16784, + 24: __ccgo_ts + 16848, + 25: __ccgo_ts + 16853, + 26: __ccgo_ts + 16856, + 27: __ccgo_ts + 16863, + 28: __ccgo_ts + 16775, + 29: __ccgo_ts + 16779, + 30: __ccgo_ts + 16869, + 31: __ccgo_ts + 16874, + 32: __ccgo_ts + 16879, + 33: __ccgo_ts + 16737, + 34: __ccgo_ts + 16779, + 35: __ccgo_ts + 16883, + 36: __ccgo_ts + 16890, + 37: __ccgo_ts + 16897, + 38: __ccgo_ts + 12011, + 39: __ccgo_ts + 12007, + 40: __ccgo_ts + 16905, + 41: __ccgo_ts + 16910, + 42: __ccgo_ts + 16915, + 43: __ccgo_ts + 9272, + 44: __ccgo_ts + 16920, + 45: __ccgo_ts + 5593, + 46: __ccgo_ts + 16926, + 47: __ccgo_ts + 16931, + 48: __ccgo_ts + 16122, + 49: __ccgo_ts + 16936, + 50: __ccgo_ts + 16737, + 51: __ccgo_ts + 16779, + 52: __ccgo_ts + 16949, + 53: __ccgo_ts + 16954, + 54: __ccgo_ts + 16963, + 55: __ccgo_ts + 16970, + 56: __ccgo_ts + 16981, } // C documentation @@ -113500,338 +113825,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16917, + FzName: __ccgo_ts + 16989, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16932, + FzName: __ccgo_ts + 17004, 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 + 17019, 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 + 17031, 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 + 17047, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16898, + FzName: __ccgo_ts + 16970, 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 + 17060, 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 + 17072, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17020, + FzName: __ccgo_ts + 17092, 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 + 17108, 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 + 17129, 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 + 17144, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17088, + FzName: __ccgo_ts + 17160, 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 + 17174, 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 + 17187, 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 + 17201, 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 + 17220, 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 + 17239, 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 + 17262, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17199, + FzName: __ccgo_ts + 17271, 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 + 17289, 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 + 17306, 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 + 17319, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17262, + FzName: __ccgo_ts + 17334, 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 + 17352, 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 + 17362, 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 + 17376, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17320, + FzName: __ccgo_ts + 17392, 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 + 17417, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17364, + FzName: __ccgo_ts + 17436, 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 + 17447, 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 + 17458, 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 + 17470, 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 + 17486, 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 + 17499, 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 + 17518, 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 + 17537, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17478, + FzName: __ccgo_ts + 17550, 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 + 17565, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17503, + FzName: __ccgo_ts + 17575, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17515, + FzName: __ccgo_ts + 17587, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17524, + FzName: __ccgo_ts + 17596, 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 + 17607, 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 + 17617, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17557, + FzName: __ccgo_ts + 17629, 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 + 17640, 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 + 17652, 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 + 17669, 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 + 17688, 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 + 17714, 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 + 17729, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17671, + FzName: __ccgo_ts + 17743, 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 + 17762, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17704, + FzName: __ccgo_ts + 17776, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17720, + FzName: __ccgo_ts + 17792, 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 + 17804, 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 + 17815, 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 + 17826, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -113839,45 +114164,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17766, + FzName: __ccgo_ts + 17838, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17777, + FzName: __ccgo_ts + 17849, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17798, + FzName: __ccgo_ts + 17870, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17806, + FzName: __ccgo_ts + 17878, 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 + 17893, 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 + 17906, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17853, + FzName: __ccgo_ts + 17925, 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 + 17940, 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)), @@ -113895,7 +114220,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 @@ -114003,10 +114328,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+17956) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17894) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17966) { return PAGER_LOCKINGMODE_NORMAL } } @@ -114024,13 +114349,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+17973) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17906) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17978) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -114053,10 +114378,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+16949) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17918) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+17990) == 0 { return int32(2) } else { return 0 @@ -114078,7 +114403,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+17997, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -114208,15 +114533,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 + 18059 case int32(OE_SetDflt): - zName = __ccgo_ts + 17996 + zName = __ccgo_ts + 18068 case int32(OE_Cascade): - zName = __ccgo_ts + 18008 + zName = __ccgo_ts + 18080 case int32(OE_Restrict): - zName = __ccgo_ts + 18016 + zName = __ccgo_ts + 18088 default: - zName = __ccgo_ts + 18025 + zName = __ccgo_ts + 18097 break } return zName @@ -114237,12 +114562,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 + 18107, + 1: __ccgo_ts + 18114, + 2: __ccgo_ts + 18122, + 3: __ccgo_ts + 18126, + 4: __ccgo_ts + 17990, + 5: __ccgo_ts + 18135, } // C documentation @@ -114304,15 +114629,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 + 18160 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18090 + zType = __ccgo_ts + 18162 } 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+18164, 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: ; @@ -114321,9 +114646,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 + 18139, + 2: __ccgo_ts + 18144, + 3: __ccgo_ts + 18152, } // C documentation @@ -114422,7 +114747,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+18171, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114465,7 +114790,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++ @@ -114510,7 +114835,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 @@ -114569,7 +114894,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+18175) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114612,7 +114937,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 @@ -114640,7 +114965,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 + 17966 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 @@ -114668,7 +114993,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 + 17956 } _returnSingleText(tls, v, zRet) break @@ -114958,7 +115283,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+18180, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -114968,7 +115293,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) } @@ -114990,7 +115315,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+18205, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -115022,8 +115347,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+18258) == 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. */ @@ -115103,9 +115429,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 + 18264 } else { - v14 = __ccgo_ts + 18200 + v14 = __ccgo_ts + 18272 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -115176,7 +115502,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+18279, 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)) @@ -115206,19 +115532,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 + 11010 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13233 + zType = __ccgo_ts + 13258 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18223 + zType = __ccgo_ts + 18295 } else { - zType = __ccgo_ts + 9247 + zType = __ccgo_ts + 9272 } } } - _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+18302, 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: ; @@ -115265,9 +115591,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+18309, 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+18314, 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 @@ -115291,11 +115617,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 + 18319, + 1: __ccgo_ts + 18321, + 2: __ccgo_ts + 16808, } - _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+18323, 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: ; @@ -115314,7 +115640,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+18329, 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: ; @@ -115331,7 +115657,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+18333, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -115381,7 +115707,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: ; @@ -115393,7 +115719,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: ; @@ -115419,7 +115745,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+18336, 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+18345)) goto _32 _32: ; @@ -115433,8 +115759,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 @@ -115560,7 +115886,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+18350, 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))) @@ -115656,7 +115982,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 @@ -115700,7 +116026,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 } @@ -115751,7 +116077,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+18354, 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) @@ -115762,7 +116088,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+18378) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -115898,7 +116224,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+18407, 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) @@ -115960,7 +116286,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))) } @@ -115982,7 +116308,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+18443, 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) @@ -115995,7 +116321,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+18463, 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) { @@ -116003,7 +116329,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+18485, 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) { @@ -116014,10 +116340,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+18508, -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+18510, 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)) } } @@ -116051,7 +116377,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+18530, 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) @@ -116075,9 +116401,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+18560) _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+18565) _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)) @@ -116090,9 +116416,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+18586) _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+18622) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -116120,9 +116446,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+18560) _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+18633) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -116150,7 +116476,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+18660) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -116247,7 +116573,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 + 18687 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -116326,7 +116652,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+18748, libc.VaList(bp+176, zRight)) } } } @@ -116431,13 +116757,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+17973) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18701) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18773) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18054) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18126) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116572,7 +116898,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 @@ -116602,7 +116928,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. @@ -116664,7 +116990,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+18781, 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)) @@ -116937,34 +117263,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18618, + FzName: __ccgo_ts + 18690, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18623, + FzName: __ccgo_ts + 18695, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18629, + FzName: __ccgo_ts + 18701, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18638, + FzName: __ccgo_ts + 18710, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18647, + FzName: __ccgo_ts + 18719, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18655, + FzName: __ccgo_ts + 18727, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18663, + FzName: __ccgo_ts + 18735, }, 7: { - FzName: __ccgo_ts + 18670, + FzName: __ccgo_ts + 18742, }, 8: {}, } @@ -117060,14 +117386,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+18799) 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+18814, libc.VaList(bp+240, int32(cSep), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -117076,19 +117402,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+18821, 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+18827) 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+18839) 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 { @@ -117103,7 +117429,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 @@ -117284,7 +117610,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) } @@ -117296,13 +117622,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+18854) 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+18862, 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+18866, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -117311,7 +117637,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) @@ -117437,24 +117763,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+18900, 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(143745)) } 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+18928, 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+18959, 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(143752)) } } } @@ -117462,9 +117788,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 + 18870, + 1: __ccgo_ts + 18877, + 2: __ccgo_ts + 18889, } // C documentation @@ -117540,7 +117866,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+14698) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117573,11 +117899,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+18967) } 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+14698) } } } @@ -117616,18 +117942,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 + 9272 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 + 18980 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -117711,7 +118037,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+12309) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117737,7 +118063,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+19052) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117752,7 +118078,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+19076, 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)) @@ -118081,7 +118407,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 @@ -118110,7 +118436,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 @@ -118170,7 +118496,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+19110, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -118186,7 +118512,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+19140, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -118209,10 +118535,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 { @@ -118220,7 +118546,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) @@ -118250,7 +118576,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(144552)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -118384,7 +118710,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(144701)) } /* 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 @@ -118644,7 +118970,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) @@ -118652,7 +118978,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 @@ -118808,15 +119134,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 + 11416 + zSp2 = __ccgo_ts + 11416 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+19159, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -118873,25 +119199,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) } @@ -119023,13 +119352,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 { @@ -119107,7 +119436,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+19189, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -119157,12 +119486,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+19239, 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. @@ -119177,9 +119506,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+19303, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -119189,6 +119519,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) @@ -119223,7 +119560,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), } @@ -119271,7 +119608,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 @@ -119316,7 +119653,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) @@ -119340,7 +119677,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) @@ -119361,7 +119698,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 @@ -119484,7 +119821,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 { @@ -119611,10 +119948,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 @@ -119622,7 +119959,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 @@ -119799,7 +120136,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+19340, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -119910,8 +120247,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) @@ -119919,7 +120256,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) } @@ -120004,13 +120341,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19288 + z = __ccgo_ts + 19360 case int32(TK_INTERSECT): - z = __ccgo_ts + 19298 + z = __ccgo_ts + 19370 case int32(TK_EXCEPT): - z = __ccgo_ts + 19308 + z = __ccgo_ts + 19380 default: - z = __ccgo_ts + 19315 + z = __ccgo_ts + 19387 break } return z @@ -120031,7 +120368,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+19393, libc.VaList(bp+8, zUsage)) } /* @@ -120068,13 +120405,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 + 19416 } 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+19430, 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+19461, 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) @@ -120098,11 +120435,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 @@ -120318,7 +120655,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 + 16920 } 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)) @@ -120431,7 +120768,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 */ @@ -120440,7 +120777,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) @@ -120464,13 +120801,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 + 16920 } 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+12595, 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))) @@ -120478,7 +120815,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+19507, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120532,7 +120869,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) } @@ -120570,7 +120907,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 + 16920 } zName = v3 } else { @@ -120585,7 +120922,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+19507, 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. @@ -120621,7 +120958,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+19516, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -120740,7 +121077,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 + 19524 } else { zType = uintptr(0) j = int32(1) @@ -120806,7 +121143,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) } @@ -120834,7 +121171,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) } @@ -120884,7 +121221,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 @@ -120907,7 +121244,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 @@ -121055,7 +121392,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+19528, 0) return } /* Obtain authorization to do a recursive query */ @@ -121092,7 +121429,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 @@ -121103,7 +121440,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 @@ -121117,7 +121454,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 @@ -121148,7 +121485,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+19577, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -121163,7 +121500,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+19619, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -121191,7 +121528,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+19625, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -121246,9 +121583,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 + 19640 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19570, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19642, 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) { @@ -121356,8 +121693,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+19665, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19680, 0) } /* Generate code for the left and right SELECT statements. */ @@ -121382,7 +121719,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+19360, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121408,7 +121745,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 @@ -121434,7 +121771,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+19699, 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 @@ -121466,11 +121803,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 @@ -121492,7 +121829,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+19699, 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 @@ -121599,6 +121936,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) } @@ -121615,9 +121953,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+19720, 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+19766, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121688,7 +122026,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+19340, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -121904,7 +122242,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) @@ -121936,7 +122274,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 { @@ -121990,16 +122328,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 @@ -122017,32 +122355,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+19848, 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+19859, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -122055,7 +122393,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+19864, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -122265,11 +122603,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))) } @@ -122430,7 +122768,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 @@ -122620,9 +122958,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. @@ -122834,7 +123172,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) @@ -122981,7 +123319,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) @@ -123271,11 +123609,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 { @@ -123340,7 +123678,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 @@ -123358,12 +123696,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 { @@ -123845,7 +124183,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 @@ -123891,13 +124229,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+15759) == 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+15763) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -123985,8 +124323,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+19870, 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 @@ -124010,7 +124348,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 @@ -124092,7 +124430,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) @@ -124110,7 +124448,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+19888, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -124258,7 +124596,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) } @@ -124286,7 +124624,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+19911, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -124308,12 +124646,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+19931, 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 @@ -124330,7 +124668,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 + 19974 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 { @@ -124361,7 +124699,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+19997, 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) } @@ -124370,9 +124708,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 + 20035 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19997 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20069 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -124421,7 +124759,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) { @@ -124431,7 +124769,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+20107, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124527,7 +124865,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) @@ -124536,7 +124874,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) } @@ -124587,7 +124925,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+20111, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124602,7 +124940,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+20150, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124617,7 +124955,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+15291, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124741,7 +125079,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 } @@ -124758,7 +125096,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+20181, 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) } @@ -124837,7 +125175,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+20186, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -124850,7 +125188,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+12595, 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) @@ -124870,9 +125208,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+20195, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20141, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20213, 0) } } } @@ -124886,7 +125224,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+20233, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -125135,7 +125473,7 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint (*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))) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -125188,7 +125526,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 @@ -125225,12 +125563,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+20264, 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+20315, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -125251,7 +125589,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+20348, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -125390,7 +125728,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 @@ -125498,7 +125836,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 @@ -125565,7 +125903,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 + 20381 } else { v1 = __ccgo_ts + 1665 } @@ -125574,7 +125912,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+20404, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125606,7 +125944,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)) @@ -125735,6 +126073,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. // */ @@ -125763,7 +126102,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+16073) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -125796,9 +126135,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 */ } @@ -125808,13 +126147,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 { @@ -125834,7 +126173,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) } @@ -126007,8 +126346,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 @@ -126017,11 +126356,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 { @@ -126037,7 +126376,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)) @@ -126061,14 +126400,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+20416, 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) @@ -126169,7 +126508,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+20470, 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 @@ -126370,14 +126709,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+20510, 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) @@ -126409,7 +126748,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 @@ -126424,7 +126763,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+20525, 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 { @@ -126478,7 +126817,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 @@ -126511,7 +126850,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 @@ -126570,7 +126909,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 @@ -126599,6 +126938,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)) @@ -126621,10 +126967,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) @@ -126658,8 +127004,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 @@ -126674,8 +127020,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 @@ -126704,8 +127050,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++ } @@ -126735,11 +127081,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.Uint16FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -126773,47 +127119,47 @@ 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)) /* 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)) /* Begin a loop that will extract all source rows in GROUP BY order. @@ -126823,16 +127169,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 @@ -126850,11 +127196,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 + 20541 } else { - v46 = __ccgo_ts + 20478 + v47 = __ccgo_ts + 20550 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19321, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19393, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -126868,8 +127214,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -126887,8 +127233,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -126899,12 +127245,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) @@ -126953,12 +127299,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++ } @@ -127028,9 +127378,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 @@ -127047,10 +127397,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 */ @@ -127077,8 +127427,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 } @@ -127118,32 +127468,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) @@ -127185,7 +127535,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+20541) } /* 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 @@ -127291,7 +127641,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 } @@ -127307,7 +127657,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+20559, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -127397,7 +127747,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) } @@ -127559,7 +127909,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+20624, 0) goto trigger_cleanup } iDb = int32(1) @@ -127599,7 +127949,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+20670, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -127609,11 +127959,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+20678, 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+20719, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127622,13 +127972,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+20670, (*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+20759, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127636,8 +127986,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+20785, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127645,15 +127995,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 + 20823 } else { - v1 = __ccgo_ts + 20758 + v1 = __ccgo_ts + 20830 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20764, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20836, 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+20873, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127673,9 +128023,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 @@ -127775,7 +128125,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+20670, 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 } @@ -127797,7 +128147,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+20919, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -127813,10 +128163,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+20967, 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+21042, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -128084,11 +128434,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+21071, 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) @@ -128126,9 +128476,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) { @@ -128143,7 +128493,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+21091, 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) } @@ -128276,11 +128626,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 + 21153 } else { - v1 = __ccgo_ts + 21088 + v1 = __ccgo_ts + 21160 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21095, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21167, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -128382,7 +128732,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+21215, 0) return int32(1) } @@ -128530,12 +128880,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) { @@ -128543,19 +128893,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) @@ -128566,7 +128919,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 @@ -128580,7 +128933,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 { @@ -128648,7 +129001,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): @@ -128747,10 +129100,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+21257, 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 @@ -128772,7 +129127,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 @@ -128844,7 +129199,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)) @@ -129260,13 +129615,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 @@ -129274,21 +129629,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 */ @@ -129335,7 +129690,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 @@ -129374,7 +129729,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 } @@ -129418,58 +129773,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+21271, 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+21307, 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 { @@ -129499,17 +129842,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++ } @@ -129521,11 +129864,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 @@ -129541,11 +129884,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 @@ -129554,18 +129897,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++ } @@ -129574,16 +129917,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. */ @@ -129601,24 +129944,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 { @@ -129644,50 +129987,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) @@ -129985,8 +130328,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -130036,8 +130379,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++ @@ -130084,11 +130427,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)) } @@ -130100,11 +130443,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. */ @@ -130147,7 +130490,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+21326) } goto update_cleanup update_cleanup: @@ -130204,13 +130547,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) { @@ -130252,11 +130595,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 @@ -130581,9 +130924,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+21339, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21271, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21343, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -130672,13 +131015,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: @@ -130686,7 +131029,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+12684, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130768,7 +131111,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+21416, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21420, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -130859,7 +131202,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 @@ -130898,17 +131241,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+21424) 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+21464) 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+21507) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -130925,7 +131268,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+21556) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -130978,7 +131321,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+15061) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131009,11 +131352,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+21583, 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+21691, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131022,7 +131365,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+21745, 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 @@ -131032,7 +131375,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+21882, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -131175,7 +131518,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) @@ -131559,7 +131902,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+12914, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131682,24 +132025,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+22005, 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+22029, 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+22128, 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 @@ -131783,7 +132131,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+22147, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -131825,9 +132173,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+22189, 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) @@ -131840,7 +132188,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 + 22219 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -131874,7 +132222,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+16811, 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 @@ -131955,13 +132303,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+22265, 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))) @@ -132042,7 +132390,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+22265, 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) @@ -132090,7 +132438,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+22284, 0) return int32(SQLITE_ERROR) } goto _1 @@ -132101,9 +132449,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(158352))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158354)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -132145,7 +132493,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) } @@ -132511,7 +132859,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 } @@ -132601,7 +132949,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 } @@ -132621,7 +132969,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) } @@ -132685,7 +133033,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(158849)) } else { ap = va switch op { @@ -132698,7 +133046,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(158871)) break } _ = ap @@ -133383,7 +133731,6 @@ type TWhereInfo1 = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo1 = TWhereInfo1 @@ -133419,10 +133766,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 + 22297 } if i == -int32(1) { - return __ccgo_ts + 16848 + return __ccgo_ts + 16920 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -133441,10 +133788,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+22304, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22238, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22310, int32(1)) } i = 0 for { @@ -133452,7 +133799,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+13304, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133461,11 +133808,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+22310, int32(1)) } i = 0 for { @@ -133473,16 +133820,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+13304, 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)) } } @@ -133529,7 +133876,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+22312, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133537,12 +133884,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+22304, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22243 + v2 = __ccgo_ts + 22315 } else { - v2 = __ccgo_ts + 22248 + v2 = __ccgo_ts + 22320 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133559,7 +133906,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+22328) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133570,9 +133917,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+22330) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5199, int32(1)) } // C documentation @@ -133617,11 +133964,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 + 22332 } else { - v2 = __ccgo_ts + 22267 + v2 = __ccgo_ts + 22339 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22272, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22344, 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 { @@ -133634,37 +133981,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 + 11467 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22278 + zFmt = __ccgo_ts + 22350 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22311 + zFmt = __ccgo_ts + 22383 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22336 + zFmt = __ccgo_ts + 22408 } else { - zFmt = __ccgo_ts + 22354 + zFmt = __ccgo_ts + 22426 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22363, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22435, 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 + 16920 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22443, 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+22474, libc.VaList(bp+144, zRowid)) cRangeOp = int8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133674,14 +134021,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+22484, 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+22489) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22439 + v3 = __ccgo_ts + 22511 } else { - v3 = __ccgo_ts + 22447 + v3 = __ccgo_ts + 22519 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -133702,7 +134049,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+22525, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133768,14 +134115,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+22536, 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+22315, 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+22557, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -133799,16 +134146,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+22304, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22243, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22315, 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 @@ -134013,7 +134360,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 @@ -134092,7 +134439,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 */ @@ -134212,7 +134559,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i 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)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(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)) } @@ -134224,7 +134571,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } else { v3 = n } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(v3))) eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } pX = pExpr @@ -134262,10 +134609,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 @@ -134454,7 +134801,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 @@ -134585,7 +134932,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 @@ -134867,7 +135214,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 @@ -134928,11 +135275,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 @@ -134963,6 +135310,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 { @@ -135101,7 +135451,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 @@ -135181,7 +135531,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 @@ -135215,7 +135565,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 @@ -135337,7 +135687,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 @@ -135530,7 +135880,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: @@ -135544,12 +135894,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 { @@ -135587,11 +135938,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 */ @@ -135611,7 +135962,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 } @@ -135647,21 +135998,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 @@ -135679,7 +136030,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, @@ -135734,7 +136085,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+22565, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135757,7 +136108,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+22580, 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)) @@ -136246,9 +136597,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 @@ -136257,7 +136608,7 @@ 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+22589, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { @@ -136303,15 +136654,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 @@ -136323,7 +136675,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) { @@ -136396,7 +136748,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) @@ -136794,19 +137146,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16697, + FzOp: __ccgo_ts + 16769, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16031, + FzOp: __ccgo_ts + 16103, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15510, + FzOp: __ccgo_ts + 15562, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22531, + FzOp: __ccgo_ts + 22603, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -137594,7 +137946,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+22610, 0) return } } else { @@ -137606,10 +137958,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+22610, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137690,7 +138042,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) @@ -137791,7 +138143,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 + 22651 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -138322,7 +138674,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+22658, 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) @@ -138394,7 +138746,6 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo @@ -138405,7 +138756,6 @@ type THiddenIndexInfo1 = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo1 = THiddenIndexInfo1 @@ -139438,7 +139788,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)<>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 @@ -142055,7 +142401,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { + })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0)) { if libc.Int32FromUint16((*(*struct { FnEq Tu16 FnBtm Tu16 @@ -142259,7 +142605,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 @@ -142543,7 +142889,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) } } @@ -142721,7 +143067,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)) @@ -143062,7 +143408,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+22731, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143137,7 +143483,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+22731, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143291,7 +143637,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(168893)) /* 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) @@ -143727,7 +144073,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+22757, 0) rc = SQLITE_OK } else { break @@ -144935,7 +145281,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+22792, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145513,7 +145859,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 @@ -145669,7 +146015,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+22810, 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 @@ -145690,11 +146036,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) @@ -145742,7 +146085,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+22838, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -145887,7 +146230,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 @@ -145921,7 +146265,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. @@ -146047,7 +146391,7 @@ 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 @@ -146078,16 +146422,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 @@ -146266,7 +146610,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 { @@ -146473,7 +146817,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 @@ -146483,7 +146827,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+22856, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146533,7 +146877,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 } @@ -146802,7 +147146,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+22885, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -146984,7 +147328,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+22941, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -147310,7 +147654,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+22986, libc.VaList(bp+8, zName)) } return p } @@ -147361,12 +147705,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+23005, 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+23076, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -147439,7 +147783,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 } @@ -147577,7 +147921,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( 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 { @@ -147721,7 +148065,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+23139, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147757,7 +148101,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)) } @@ -147772,7 +148116,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 @@ -147791,11 +148135,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 { @@ -147841,11 +148185,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 @@ -147862,7 +148206,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)) @@ -147884,7 +148228,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 @@ -148008,7 +148352,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+23165, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -148076,18 +148420,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 + 23197 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23142 + zErr = __ccgo_ts + 23214 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23158 + zErr = __ccgo_ts + 23230 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23178, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23250, 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 { @@ -148111,7 +148455,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+23283, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -148217,24 +148561,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 @@ -148252,12 +148596,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) } @@ -148269,15 +148613,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 @@ -148329,11 +148673,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 + 23330, + 1: __ccgo_ts + 23383, + 2: __ccgo_ts + 22885, + 3: __ccgo_ts + 23434, + 4: __ccgo_ts + 23486, } var _aOp1 = [5]int32{ @@ -148913,7 +149257,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 } @@ -149009,7 +149353,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 '' */ @@ -149726,12 +150070,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 @@ -149739,13 +150083,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 @@ -149765,13 +150109,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 @@ -149798,7 +150142,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 @@ -150017,6 +150361,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. @@ -150077,7 +150425,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+23536, libc.VaList(bp+8, p)) } // C documentation @@ -150091,6 +150439,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) } @@ -150124,11 +150473,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 + 23560 } else { - v1 = __ccgo_ts + 23497 + v1 = __ccgo_ts + 23569 } - _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+23575, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -150137,7 +150486,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+23617, 0) } } } @@ -150243,7 +150592,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+23651, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -156764,13 +157113,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) } @@ -158700,20 +159049,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+16920, 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+23689, 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+16856, 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+23689, 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 @@ -158754,7 +159103,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 */ @@ -158899,7 +159253,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 */ @@ -158989,9 +159348,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) } @@ -159346,7 +159705,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+23716) 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) { @@ -159696,9 +160055,9 @@ _237: */ _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 + v347 = __ccgo_ts + 8100 } else { - v347 = __ccgo_ts + 8080 + v347 = __ccgo_ts + 8105 } *(*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 { @@ -159940,15 +160299,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+23725, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23748, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23820, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23832, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23904, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -160090,7 +160449,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 */ @@ -160284,7 +160643,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+23989, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -163015,14 +163374,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)< int32(65528) { sz = int32(65528) } - if cnt < 0 { + /* 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 > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } szAlloc = int64(sz) * int64(cnt) - if sz == 0 || cnt == 0 { + 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)) @@ -164496,7 +164864,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182779)) + return _sqlite3MisuseError(tls, int32(183820)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164516,7 +164884,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+24076, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -164817,14 +165185,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 + 24619 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -164836,31 +165204,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 + 24144, + 1: __ccgo_ts + 24157, + 3: __ccgo_ts + 24173, + 4: __ccgo_ts + 24198, + 5: __ccgo_ts + 24212, + 6: __ccgo_ts + 24231, 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 + 24256, + 9: __ccgo_ts + 24293, + 10: __ccgo_ts + 24305, + 11: __ccgo_ts + 24320, + 12: __ccgo_ts + 24353, + 13: __ccgo_ts + 24371, + 14: __ccgo_ts + 24396, + 15: __ccgo_ts + 24425, + 17: __ccgo_ts + 6128, + 18: __ccgo_ts + 5532, + 19: __ccgo_ts + 24442, + 20: __ccgo_ts + 24460, + 21: __ccgo_ts + 24478, + 23: __ccgo_ts + 24512, + 25: __ccgo_ts + 24533, + 26: __ccgo_ts + 24559, + 27: __ccgo_ts + 24582, + 28: __ccgo_ts + 24603, } // C documentation @@ -165007,6 +165375,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 // // /* @@ -165039,7 +165421,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i 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(183430)) + return _sqlite3MisuseError(tls, int32(184509)) } 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) @@ -165082,7 +165464,7 @@ 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+24700, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165208,7 +165590,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+24763, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -165239,7 +165621,7 @@ 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) } @@ -165483,7 +165865,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(184046)) + return _sqlite3MisuseError(tls, int32(185125)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -165493,7 +165875,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+24814, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165615,7 +165997,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(184182))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185261))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165747,7 +166129,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(184261)) + return _sqlite3MisuseError(tls, int32(185340)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165757,7 +166139,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(184270)) + return _sqlite3MisuseError(tls, int32(185349)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165806,7 +166188,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(184318)) + return _sqlite3MisuseError(tls, int32(185397)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -165815,7 +166197,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+24835, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165962,7 +166344,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+24903, 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 @@ -165992,8 +166374,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+24909, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24919, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -166082,24 +166464,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+24947, 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+24951, 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 + 24951 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24900, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24972, 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 @@ -166128,12 +166510,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+24987, 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+25007, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -166157,7 +166539,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+25031, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -166177,11 +166559,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24885, + Fz: __ccgo_ts + 24957, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24892, + Fz: __ccgo_ts + 24964, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -166192,19 +166574,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24905, + Fz: __ccgo_ts + 24977, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24908, + Fz: __ccgo_ts + 24980, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24911, + Fz: __ccgo_ts + 24983, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17918, + Fz: __ccgo_ts + 17990, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -166332,8 +166714,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+22651, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25047, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -166354,10 +166736,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(184993)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186072)) /* 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) } @@ -166366,7 +166748,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) } @@ -166393,9 +166775,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 + 24049 (*(*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 { @@ -166489,7 +166871,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 + 25053 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166649,7 +167031,7 @@ 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) @@ -166706,20 +167088,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+25056, 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+25081) } 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+25101) } 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+25108) } // C documentation @@ -166744,9 +167126,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) @@ -166773,29 +167155,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 @@ -166850,15 +167221,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+25125, 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) @@ -167037,8 +167408,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 @@ -167482,7 +167853,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: ; @@ -167878,7 +168249,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+25153, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -168096,7 +168467,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 + 25161 } else { v2 = uintptr(0) } @@ -168175,7 +168546,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) @@ -168342,7 +168713,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 @@ -168559,6 +168930,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -168871,8 +169249,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 @@ -168929,7 +169307,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 @@ -168939,7 +169317,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 @@ -168977,18 +169355,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 + 25184, + 12: __ccgo_ts + 25190, 13: __ccgo_ts + 1665, 14: __ccgo_ts + 1665, 15: __ccgo_ts + 1665, @@ -169475,7 +169853,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) { @@ -169773,8 +170151,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) } } @@ -169910,7 +170288,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+15505, 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)) @@ -169924,14 +170302,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+25197, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -169985,7 +170361,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+25226, -int32(1)) } } } @@ -170268,8 +170644,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 + 25241, + FzRepl: __ccgo_ts + 25245, }, 1: { Fc1: int8('i'), @@ -170277,8 +170653,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 + 25253, + FzRepl: __ccgo_ts + 25245, }, 2: { Fc1: int8('n'), @@ -170293,7 +170669,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25207, + FzMatch: __ccgo_ts + 25262, FzRepl: __ccgo_ts + 1651, }, 4: { @@ -170301,7 +170677,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25212, + FzMatch: __ccgo_ts + 25267, FzRepl: __ccgo_ts + 1651, }, } @@ -170317,7 +170693,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+25272, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -170335,23 +170711,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 } @@ -170429,7 +170805,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 @@ -170500,7 +170876,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) + } } } } @@ -170775,7 +171155,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+25315, 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') { @@ -171205,7 +171585,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 { @@ -171244,7 +171624,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)) } @@ -171252,7 +171632,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)) } @@ -171329,14 +171709,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+25241, 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+25324) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25276) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25331) } - 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+25337, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171521,7 +171901,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+25331) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171566,7 +171946,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+25226, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171579,7 +171959,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+25226, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171628,10 +172008,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) @@ -171665,15 +172041,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 @@ -171746,11 +172122,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: ; @@ -171799,9 +172175,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25190 + v19 = __ccgo_ts + 25245 } else { - v19 = __ccgo_ts + 11942 + v19 = __ccgo_ts + 11967 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -171837,9 +172213,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: ; @@ -171866,7 +172245,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25288, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25343, uint32(2)) zIn2++ sz2-- continue @@ -171889,7 +172268,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25291, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25346, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -171897,12 +172276,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25298, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25353, 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+25358, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -172082,7 +172461,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+25365, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172105,12 +172484,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+25368, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25310, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25365, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172125,50 +172504,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 // // /* @@ -172220,6 +172555,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 // // /* @@ -172240,6 +172653,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)) @@ -172312,9 +172728,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 @@ -172357,7 +172773,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 @@ -172845,7 +173272,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+25226, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -172980,7 +173407,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 } @@ -173081,7 +173508,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+25226, -int32(1)) return } @@ -173118,11 +173545,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+25197, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -173135,7 +173559,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+25226, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -173154,10 +173578,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+25331) } 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+25324) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -173196,7 +173620,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+25371, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -173212,7 +173636,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. // ** @@ -173293,7 +173717,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+25226, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -173305,34 +173729,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; +// ** 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. +// ** 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) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { + 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 (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) - return 0 + 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 (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - 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 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) @@ -173415,7 +173859,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 @@ -173475,7 +173919,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+25226, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173610,7 +174054,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 + 25389 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173620,7 +174064,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+25226, -int32(1)) } } eErr = uint8(1) @@ -173730,23 +174174,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+25391, uint32(1)) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25338, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25393, 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+25395, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25343, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25398, uint32(1)) } } } @@ -173786,7 +174230,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+25226, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -174054,7 +174498,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+25226, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -174078,7 +174522,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+25400, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -174089,7 +174533,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+25451, -int32(1)) _jsonStringReset(tls, bp) return } @@ -174161,7 +174605,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+25226, -int32(1)) } } goto json_remove_done @@ -174198,7 +174642,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+16025) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -174229,9 +174673,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 + 25485 } else { - v1 = __ccgo_ts + 25434 + v1 = __ccgo_ts + 25489 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -174279,7 +174723,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+25226, -int32(1)) } } goto json_type_done @@ -174326,7 +174770,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 + 25496 (*(*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)) @@ -174400,17 +174844,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+25501, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -174419,18 +174862,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 @@ -174492,9 +174934,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))) @@ -174601,7 +175041,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+25558, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174693,20 +175133,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))) + } } } @@ -174750,7 +175192,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+25561, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174853,7 +175295,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+25564) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -174987,7 +175429,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+25647, 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 @@ -175013,9 +175455,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+25654, 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+25662, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -175326,9 +175768,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))) @@ -175401,7 +175842,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+25668, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -175425,7 +175866,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+25226, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175486,186 +175927,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 + 25670, }, 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 + 25675, }, 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 + 25681, }, 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 + 25692, }, 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 + 25704, }, 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 + 25704, }, 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 + 25722, }, 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 + 25742, }, 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 + 25755, }, 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 + 25769, }, 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 + 25772, }, 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 + 25776, }, 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 + 25788, }, 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 + 25801, }, 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 + 25813, }, 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 + 25826, }, 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 + 25837, }, 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 + 25849, }, 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 + 25849, }, 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 + 25861, }, 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 + 25872, }, 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 + 25884, }, 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 + 25897, }, 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 + 25910, }, 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 + 25924, }, 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 + 25933, }, 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 + 25943, }, 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 + 25943, }, 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 + 25953, }, 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 + 25953, }, 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 + 25964, }, 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 + 25981, }, 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 + 25999, }, 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 + 26017, }, } @@ -175748,17 +176189,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25981, + FzName: __ccgo_ts + 26036, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25991, + FzName: __ccgo_ts + 26046, 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 @@ -175866,7 +176309,6 @@ type TRtreeMatchArg = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - FaParam [1]TRtreeDValue } type RtreeMatchArg = TRtreeMatchArg @@ -176149,11 +176591,12 @@ type TRtreeMatchArg1 = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - 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 ** clang, since clang works hard to be gcc compatible. So the gcc @@ -176336,7 +176779,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 @@ -176399,7 +176842,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+26056, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -176410,7 +176853,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 { @@ -176704,7 +177147,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+26061, 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 { @@ -177246,7 +177689,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) } @@ -177626,7 +178069,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+26143) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177704,7 +178147,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) @@ -177935,7 +178378,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 } @@ -177943,7 +178386,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 @@ -178181,7 +178624,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: @@ -178603,7 +179046,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 @@ -179116,7 +179559,7 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179133,7 +179576,7 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179161,7 +179604,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+26157, 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 { @@ -179171,11 +179614,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+26177, 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+26209, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -179389,7 +179832,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+26246, 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)) @@ -179443,9 +179886,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 + 26391 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+11796, 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) { @@ -179503,9 +179946,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 + 26447, + 1: __ccgo_ts + 5593, + 2: __ccgo_ts + 16920, } var _rtreeModule = Tsqlite3_module{ @@ -179549,21 +179992,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+26861, 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+26923, 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+26928, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26992, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27062, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179593,7 +180036,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 + 27111 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179608,31 +180051,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+27219, 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+27264, 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+13304, 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+27291, 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+27313, 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+27321, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179646,14 +180089,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 + 26452, + 1: __ccgo_ts + 26505, + 2: __ccgo_ts + 26550, + 3: __ccgo_ts + 26602, + 4: __ccgo_ts + 26656, + 5: __ccgo_ts + 26701, + 6: __ccgo_ts + 26759, + 7: __ccgo_ts + 26814, } // C documentation @@ -179711,7 +180154,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+27337, 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) @@ -179719,17 +180162,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+27357, 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))) @@ -179792,7 +180235,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) } @@ -179806,13 +180249,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+27600, 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+27606, 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) { @@ -179821,7 +180264,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+27630, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -179835,19 +180278,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+27657, 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))) } } } @@ -179870,7 +180313,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)) @@ -179881,7 +180324,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 @@ -179897,8 +180340,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27581, - 1: __ccgo_ts + 27592, + 0: __ccgo_ts + 27636, + 1: __ccgo_ts + 27647, } // C documentation @@ -179956,21 +180399,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+11416, 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+27660, 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+27666, 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+27670, int32(1)) goto _1 _1: ; @@ -179997,7 +180440,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+27672, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -180100,7 +180543,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) @@ -180115,11 +180558,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+27705, 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) } @@ -180153,7 +180596,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+27712, 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) @@ -180170,7 +180613,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+27757, libc.VaList(bp+8, iNode)) } } return pRet @@ -180199,8 +180642,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 + 27789, + 1: __ccgo_ts + 27843, } 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)) @@ -180213,21 +180656,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 + 27891 } else { - v1 = __ccgo_ts + 27844 + v1 = __ccgo_ts + 27899 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27853, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27908, 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 + 27891 } else { - v2 = __ccgo_ts + 27844 + v2 = __ccgo_ts + 27899 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27898, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27953, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -180272,7 +180715,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+28011, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -180290,7 +180733,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+28059, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -180323,19 +180766,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+28126, 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+28160, 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+28190, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -180380,12 +180823,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+28245, 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+28276, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -180414,7 +180857,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+28343, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -180424,11 +180867,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+26157, 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+28371, 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)) @@ -180444,8 +180887,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+28402, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28409, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -180472,7 +180915,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+28417, 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) } @@ -180523,13 +180966,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+28436, -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))) } @@ -180538,7 +180981,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 + 18687 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -180805,7 +181248,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++ @@ -180850,7 +181293,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 @@ -180912,7 +181355,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 } @@ -181280,7 +181723,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 @@ -181295,9 +181738,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: ; @@ -181382,7 +181825,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 { @@ -181523,7 +181966,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 // ** @@ -181562,7 +182005,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) } @@ -181666,7 +182109,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 @@ -181750,7 +182193,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 @@ -182034,7 +182477,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) { @@ -182191,7 +182634,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 @@ -182203,13 +182646,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+27600, 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+28560, 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) @@ -182218,13 +182661,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+28582, 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+27657, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -182232,7 +182675,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) @@ -182247,7 +182690,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 @@ -182459,7 +182902,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 + 16920 (*(*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) @@ -182469,7 +182912,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 + 28586 (*(*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) @@ -182477,7 +182920,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 + 28592 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182597,7 +183040,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+28601, 0) } goto geopoly_update_end } @@ -182700,12 +183143,12 @@ geopoly_update_end: func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28586) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28641) == 0 { *(*uintptr)(unsafe.Pointer(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 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28657) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) @@ -182776,7 +183219,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+28834, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -182790,61 +183233,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28617, + FzName: __ccgo_ts + 28672, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28630, + FzName: __ccgo_ts + 28685, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28643, + FzName: __ccgo_ts + 28698, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28656, + FzName: __ccgo_ts + 28711, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28602, + FzName: __ccgo_ts + 28657, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28668, + FzName: __ccgo_ts + 28723, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28586, + FzName: __ccgo_ts + 28641, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28691, + FzName: __ccgo_ts + 28746, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28705, + FzName: __ccgo_ts + 28760, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28718, + FzName: __ccgo_ts + 28773, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28732, + FzName: __ccgo_ts + 28787, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28748, + FzName: __ccgo_ts + 28803, }, } @@ -182870,7 +183313,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28760, + FzName: __ccgo_ts + 28815, }, } @@ -182895,20 +183338,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+28842, 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+28852, 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+28863, -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+28586, 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+28874, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -182982,7 +183425,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) @@ -183010,7 +183453,7 @@ 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+26143, __ccgo_fp(_rtreeMatchArgFree)) } } } @@ -183251,7 +183694,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 @@ -184227,7 +184670,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+28884, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -184237,7 +184680,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+28884, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -184263,7 +184706,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 @@ -184286,7 +184729,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 } @@ -184418,7 +184861,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+28905, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184507,7 +184950,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+26056, 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')) { @@ -184544,13 +184987,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 + 29076 } 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+29117, 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+29267) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184717,7 +185160,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))) } } @@ -184778,7 +185221,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+29392, 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 @@ -184788,7 +185231,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+29511, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -184796,7 +185239,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+29532, 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) @@ -184808,7 +185251,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+29583, 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 { @@ -184852,7 +185295,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+29604, 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))) { @@ -184865,7 +185308,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+29632, 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 { @@ -184918,7 +185361,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+20195, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -184929,7 +185372,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+29661, 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) @@ -184940,7 +185383,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+29680, 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 @@ -184948,7 +185391,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+29685, zName) { bRbuRowid = int32(1) } } @@ -184962,17 +185405,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 + 29695 } else { - v4 = __ccgo_ts + 29653 + v4 = __ccgo_ts + 29708 } - (*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+29717, 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+29746, 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)) @@ -184994,7 +185437,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+29768, 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)) @@ -185040,8 +185483,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+29795, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15172 goto _1 _1: ; @@ -185075,7 +185518,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+29804, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -185123,21 +185566,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+29817, 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+29849, 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+15172, __ccgo_ts+29872) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29878, __ccgo_ts+29885, __ccgo_ts+5199) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15172, __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+29893, 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+29935, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -185189,7 +185632,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+29632, 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)) @@ -185211,15 +185654,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 + 29955 } } 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+29963, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29984, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30020, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15172 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -185228,7 +185671,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+30047, 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 @@ -185245,15 +185688,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+30095, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15172 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+30102, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -185311,7 +185754,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+29632, 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)) @@ -185320,7 +185763,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+30114, 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 { @@ -185340,9 +185783,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 + 29955 } else { - zCol = __ccgo_ts + 29630 + zCol = __ccgo_ts + 29685 } } zType = __ccgo_ts + 1139 @@ -185350,24 +185793,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+30136, 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 + 29872 } 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+30156, 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+30177, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30210, 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 + 15172 + zAnd = __ccgo_ts + 22304 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185421,11 +185864,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+30234, 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+30246, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15147 + zS = __ccgo_ts + 15172 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -185437,7 +185880,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+30255, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -185463,7 +185906,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+30270, 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 @@ -185473,15 +185916,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+30284, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22304 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30241, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30296, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1665 i1 = 0 @@ -185491,8 +185934,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+30346, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22304 } goto _2 _2: @@ -185515,7 +185958,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+30359, 0) } // C documentation @@ -185557,16 +186000,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+30346, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15172 } 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+30385, 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 + 15172 } 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+30415, 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 + 15172 } } } @@ -185650,16 +186093,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 + 30452 *(*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+29604, 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+16808) == 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+29632, libc.VaList(bp+24, zIdx))) } break } @@ -185670,16 +186113,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 + 29872 } 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+30465, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15172 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30421, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30476, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -185725,7 +186168,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+30480) 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))) { @@ -185733,7 +186176,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+29632, 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))) { @@ -185742,21 +186185,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+30530, 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 + 29872 } 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+30552, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15172 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30507, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30562, 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+30577, 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)) } } @@ -185793,7 +186236,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) { @@ -185802,19 +186245,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 + 30639 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30597 + v2 = __ccgo_ts + 30652 } 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+30662, 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 + 15172 goto _1 _1: ; @@ -185823,17 +186266,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+30689, 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 + 30696 } 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+30711, 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)) } } @@ -185859,7 +186302,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+30743, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -185905,7 +186348,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+30800) } 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)) @@ -186074,7 +186517,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+30866, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -186091,18 +186534,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+30886, 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+30951, 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+30987, 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 { @@ -186117,26 +186560,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 + 31021 } else { - v2 = __ccgo_ts + 30970 + v2 = __ccgo_ts + 31025 } 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+31031, 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+31092, 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 + 31021 } else { - v3 = __ccgo_ts + 30970 + v3 = __ccgo_ts + 31025 } - 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+31153, 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 { @@ -186155,8 +186598,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). */ @@ -186165,39 +186608,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 + 31312 } 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 + 31321 } 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+31331, 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+31367, 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 + 31395 } /* 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 + 31407 } 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+31424, 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+31500, 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+31799, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -186208,9 +186651,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 + 31898 } else { - v7 = __ccgo_ts + 31853 + v7 = __ccgo_ts + 31908 } zRbuRowid1 = v7 } @@ -186223,14 +186666,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+29955, 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+15172, __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 + 31919 } else { v8 = __ccgo_ts + 1665 } @@ -186240,11 +186683,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 + 23560 } 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+31925, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -186332,9 +186775,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 + 31312 } - 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+31973, 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 } @@ -186361,7 +186804,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) } @@ -186408,7 +186851,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+32003, 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): @@ -186467,27 +186910,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+32033, 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+32061, 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+32079, 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 } @@ -186520,10 +186963,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+32145, 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+24903, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186539,14 +186982,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 + 32177 } 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+32179, 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 @@ -186557,27 +187000,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+32211, -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+32226, 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+32243, -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+32259, 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+32287, 0) } } @@ -186663,7 +187106,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { if pState == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32204, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32259, uintptr(0), uintptr(0), uintptr(0)) } } /* Assuming no error has occurred, run a "restart" checkpoint with the @@ -186696,7 +187139,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CAPTURE) - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32250, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32305, uintptr(0), uintptr(0), uintptr(0)) if rc2 != int32(SQLITE_NOTICE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -186759,7 +187202,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) } @@ -186829,16 +187272,16 @@ 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) + 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_methods1)(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) } - 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)) @@ -186860,7 +187303,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+32340, 0) } // C documentation @@ -186877,13 +187320,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+32365, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32372, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -187015,7 +187458,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+24460, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -187151,7 +187594,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+32379) 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 @@ -187164,7 +187607,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+32401, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -187191,7 +187634,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+32428, 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))) @@ -187227,9 +187670,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+32588, 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+32603, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -187252,9 +187695,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+32623, 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+32648) } 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) @@ -187265,10 +187708,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+32756) } 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+32821) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -187286,7 +187729,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+32865, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -187313,8 +187756,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+17893) + _rbuCopyPragma(tls, p, __ccgo_ts+17004) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -187322,7 +187765,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+32890, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -187344,10 +187787,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+15076, 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+15076, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -187434,7 +187877,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+32918, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -187457,10 +187900,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+32365, 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) } @@ -187482,7 +187925,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+32943, 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) @@ -187529,7 +187972,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+32954, 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 { @@ -187574,11 +188017,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+33026, 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+33040) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187587,7 +188030,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+33097) 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) @@ -187635,7 +188078,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 @@ -187667,7 +188110,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+33171, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187689,17 +188132,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 + 33203 } else { - v3 = __ccgo_ts + 33155 + v3 = __ccgo_ts + 33210 } - (*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+33217, 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+15061, 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) @@ -187711,21 +188154,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+17607) + _rbuCopyPragma(tls, p, __ccgo_ts+17019) } /* 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+33249, 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+33265, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -187803,7 +188246,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+33289, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -187850,7 +188293,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+31312, 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++ @@ -187878,7 +188321,7 @@ 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+15076, 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) { @@ -187887,7 +188330,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { } _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+15076, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -187897,7 +188340,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+33297, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -187998,7 +188441,7 @@ 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+15076, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ @@ -188011,19 +188454,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { 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+15076, 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 + 15061 } else { - v1 = __ccgo_ts + 33194 + v1 = __ccgo_ts + 33249 } 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+33249, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -188509,7 +188952,7 @@ func _rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileSize})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, pSize) /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existence of a *-wal file. rbuVfsRead() contains ** similar logic. */ if rc == SQLITE_OK && *(*Tsqlite_int64)(unsafe.Pointer(pSize)) == 0 && (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpRbu)).FzTarget == uintptr(0) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_MAIN_DB) != 0 { *(*Tsqlite_int64)(unsafe.Pointer(pSize)) = int64(1024) @@ -188590,7 +189033,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xControl})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, int32(SQLITE_FCNTL_ZIPVFS), bp) if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33269, 0) + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33324, 0) } else { if rc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p @@ -188616,7 +189059,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r if rc == SQLITE_OK && op == int32(SQLITE_FCNTL_VFSNAME) { pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs zIn = *(*uintptr)(unsafe.Pointer(pArg)) - zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33292, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33347, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -188811,7 +189254,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag if pDb != 0 { if (*Trbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == int32(RBU_STAGE_OAL) { if (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) { - zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6713) + zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6738) zOpen = Xsqlite3_filename_wal(tls, zOpen) } nOpen = libc.Xstrlen(tls, zOpen) @@ -188825,7 +189268,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag } else { (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu } - if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33303, 0) != 0 { + if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33358, 0) != 0 { oflags = libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) } @@ -189381,7 +189824,7 @@ func _statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint _sqlite3TokenInit(tls, bp, *(*uintptr)(unsafe.Pointer(argv + 3*8))) iDb = _sqlite3FindDb(tls, db, bp) if iDb < 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12380, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12405, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) return int32(SQLITE_ERROR) } } else { @@ -189693,7 +190136,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { _sqlite3BtreeEnter(tls, pBt) nUsable = szPage - _sqlite3BtreeGetReserveNoMutex(tls, pBt) _sqlite3BtreeLeave(tls, pBt) - (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32)) + (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32))) if (*TStatPage)(unsafe.Pointer(p)).FaCell == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -189740,7 +190183,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } (*TStatCell)(unsafe.Pointer(pCell)).FnLastOvfl = libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp)) - libc.Uint32FromInt32(nLocal) - libc.Uint32FromInt32((nOvfl-int32(1))*(nUsable-int32(4)))) (*TStatCell)(unsafe.Pointer(pCell)).FnOvfl = nOvfl - (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(4)*libc.Uint64FromInt32(nOvfl)) + (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(uint64(4)*libc.Uint64FromInt32(nOvfl))) if (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -189881,7 +190324,7 @@ statNextRestart: (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiPgno = iRoot (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33314, 0) + v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33369, 0) z = v1 (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FzPath = v1 if z == uintptr(0) { @@ -189919,8 +190362,8 @@ statNextRestart: if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { (*TStatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33316 - v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33325, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33371 + v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33380, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) z = v2 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v2 if z == uintptr(0) { @@ -189949,7 +190392,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage++ if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226029)) + return _sqlite3CorruptError(tls, int32(227304)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -189960,7 +190403,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+33392, 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) { @@ -189983,13 +190426,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 + 33400 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 + 33409 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33359 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33414 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -189998,7 +190441,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) { @@ -190087,12 +190530,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+33424, 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+33579, 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+33593, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -190169,7 +190612,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+33608, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -191370,7 +191813,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) { @@ -191463,11 +191906,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+11796, 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+33615, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1665, 0) @@ -191476,7 +191919,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+33745, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191502,10 +191945,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+29955))) 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) @@ -191526,8 +191969,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+29955) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29955, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191591,7 +192034,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 @@ -191608,6 +192051,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 { @@ -191629,12 +192074,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+11796, (*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))) } } } @@ -191924,10 +192369,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 + 11416 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33720, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33775, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -191939,8 +192384,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 + 15172 goto _1 _1: ; @@ -192594,8 +193039,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+33782, 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 + 22304 if zRet == uintptr(0) { break } @@ -192624,8 +193069,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+33816, 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 + 33857 if zRet == uintptr(0) { break } @@ -192636,7 +193081,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 } @@ -192647,12 +193092,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 + 33862 } 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+33873, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192713,11 +193158,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15147 + v2 = __ccgo_ts + 15172 } 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+33952, 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 } @@ -192745,7 +193190,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+33971, 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 { @@ -192774,17 +193219,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)) @@ -192797,7 +193243,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 } @@ -192808,18 +193256,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+34028, 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+34059, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -192845,7 +193319,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+34080, 0) } rc = int32(SQLITE_SCHEMA) } @@ -192893,7 +193367,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) } @@ -193177,7 +193651,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) } @@ -193477,12 +193951,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+34107, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11796, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34111, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34135, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34144, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34189, bp) } else { i = 0 for { @@ -193490,17 +193964,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+15172, 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 + 15172 _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+34203, 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+34207, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -193514,7 +193988,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+34234, 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) } @@ -193656,7 +194130,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, 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+34276, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193762,7 +194236,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } } 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+34296, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -194017,13 +194491,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 } } @@ -194179,7 +194654,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(230285)) + rc = _sqlite3CorruptError(tls, int32(231591)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -194203,7 +194678,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(230305)) + rc = _sqlite3CorruptError(tls, int32(231611)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -194218,7 +194693,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(230315)) + rc = _sqlite3CorruptError(tls, int32(231621)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -194274,7 +194749,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(230363)) + rc = _sqlite3CorruptError(tls, int32(231669)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -194379,7 +194854,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(230451)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231757)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -194450,8 +194925,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) @@ -194485,7 +194960,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(230537)) + v7 = _sqlite3CorruptError(tls, int32(231843)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194495,7 +194970,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(230543)) + v10 = _sqlite3CorruptError(tls, int32(231849)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194574,7 +195049,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(230587)) + v16 = _sqlite3CorruptError(tls, int32(231893)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -194912,7 +195387,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 @@ -194984,7 +195459,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230952)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232258)) goto finished_invert } if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { @@ -195187,7 +195662,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+11796) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -195196,9 +195671,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+34314, 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+34327, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -195208,9 +195683,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+34333, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15147 + zSep = __ccgo_ts + 15172 } goto _2 _2: @@ -195219,7 +195694,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+34338, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -195228,13 +195703,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+34346, 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+34421, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22232 + zSep = __ccgo_ts + 22304 } goto _3 _3: @@ -195321,9 +195796,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+34427, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34231, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34338, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -195333,9 +195808,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+34333, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22232 + zSep = __ccgo_ts + 22304 } goto _1 _1: @@ -195343,9 +195818,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+34445, 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+33857, bp) zSep = __ccgo_ts + 1665 i = 0 for { @@ -195355,16 +195830,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+34421, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34346 + zSep = __ccgo_ts + 34453 } 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)) @@ -195390,7 +195865,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 @@ -195413,16 +195888,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+34458, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22238, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22310, 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+15172, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -195430,19 +195905,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+34476, 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+34487, 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)) } @@ -195465,12 +195940,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+11796, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34384) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34491) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34497) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34604) } return rc } @@ -195536,7 +196011,7 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231434)) + rc = _sqlite3CorruptError(tls, int32(232740)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -195952,7 +196427,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+34748, 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)) @@ -195965,7 +196440,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+34769, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -196065,10 +196540,10 @@ 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+34788, 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+34814, 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)) @@ -196099,7 +196574,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui ** 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)))) 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 @@ -196109,7 +196584,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 } @@ -196128,18 +196603,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+34844, 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+34888, 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+34959, 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+11796) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -196196,17 +196671,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34912, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35019, 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+35049, 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+35073, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35049, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -196320,7 +196795,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) } @@ -196690,7 +197165,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) } @@ -196982,7 +197457,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 { @@ -197018,11 +197493,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 @@ -197607,6 +198088,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 @@ -197652,8 +198134,7 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset @@ -197665,12 +198146,13 @@ type Fts5Colset = TFts5Colset ** This object is used by fts5_expr.c and fts5_index.c. */ type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 + FnCol 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 ** to parse the arguments passed to the CREATE VIRTUAL TABLE statement. @@ -198047,7 +198529,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -198075,16 +198556,14 @@ 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 @@ -198126,7 +198605,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 @@ -198930,7 +199409,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+35101, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -199286,7 +199765,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+35129, 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 */ } @@ -199584,7 +200063,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+35160, 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) } @@ -199683,7 +200162,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 + 35167 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199771,7 +200250,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) } @@ -199938,7 +200417,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 + 35217 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200209,7 +200688,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))) @@ -200301,13 +200780,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) } @@ -200333,13 +200812,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 + 35265 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 + 35321 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -200372,19 +200851,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35272, + FzFunc: __ccgo_ts + 35379, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35280, + FzFunc: __ccgo_ts + 35387, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35290, + FzFunc: __ccgo_ts + 35397, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35295, + FzFunc: __ccgo_ts + 35402, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200772,7 +201251,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 @@ -201248,7 +201727,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+35418, 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) { @@ -201274,12 +201753,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+35425, 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+35456, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201288,7 +201767,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+35489, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201298,14 +201777,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+35526, 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+35535, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -201332,7 +201811,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+35568, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -201344,76 +201823,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+35602, 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+35610, 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+35642, 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+35648, 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+35667, 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+35710, 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+35667, 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+35732, 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+35746, 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+35784, 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+35795, 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+35830, 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+35837, 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 + 17973, }, 2: { - FzName: __ccgo_ts + 35761, + FzName: __ccgo_ts + 35868, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -201421,20 +201900,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+35876, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35800, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35907, 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+35917, 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+35951, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201495,16 +201974,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+35979) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16920) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35984, 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+36014) { *(*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+36024, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201530,7 +202009,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+36055, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201538,12 +202017,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+36060, 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+36067, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35968, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36075, 0) } } goto _1 @@ -201559,9 +202038,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+36082, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35968, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36075, 0) } goto _2 _2: @@ -201624,8 +202103,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+35979) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36090, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201656,7 +202135,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+36119, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -201686,7 +202165,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+36139, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201694,37 +202173,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+36189, 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+36244, 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 + 35602 } 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 + 35602 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36190 + zTail = __ccgo_ts + 36297 } } } 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+36305, 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+16920, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201793,7 +202272,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+36316, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -201802,16 +202281,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 + 15172 } 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+36332, 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+36339, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35979)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -201969,7 +202448,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+36365) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -201980,7 +202459,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+36370) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -201991,7 +202470,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+36379) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -202005,7 +202484,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+36389) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -202016,7 +202495,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+36399) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -202033,7 +202512,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+36411) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -202048,7 +202527,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+35979) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -202063,7 +202542,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+36423) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -202079,7 +202558,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+36437) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -202122,7 +202601,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 + 36447 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -202142,7 +202621,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+36479) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -202153,7 +202632,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+36487, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -202257,11 +202736,12 @@ type TFts5ExprNode1 = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode1 = TFts5ExprNode1 +/* Size (in bytes) of an Fts5ExprNode object that holds up to N children */ + /* ** 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. @@ -202291,24 +202771,26 @@ type TFts5ExprPhrase1 = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase1 = TFts5ExprPhrase1 +/* Size (in bytes) of an Fts5ExprPhrase object that holds up to N terms */ + /* ** 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 + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset1 = TFts5ExprNearset1 +/* Size (in bytes) of an Fts5ExprNearset object covering up to N phrases */ + /* ** Parse context. */ @@ -202399,7 +202881,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+36558, 0) return FTS5_EOF } goto _1 @@ -202410,7 +202892,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+36578, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -202425,13 +202907,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+36609, 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+36612, 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+31021, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -202475,7 +202957,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) @@ -204114,7 +204596,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) @@ -204124,7 +204606,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) @@ -204230,12 +204712,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 @@ -204369,7 +204851,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) @@ -204409,15 +204891,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)) @@ -204458,7 +204940,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 { @@ -204496,8 +204978,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+36616, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35129, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204517,10 +204999,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+36621, 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: ; @@ -204554,7 +205039,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 { @@ -204604,7 +205089,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 @@ -204655,7 +205140,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+21307, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204682,7 +205167,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)) @@ -204779,7 +205264,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+36650, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -204864,7 +205349,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) @@ -204877,7 +205362,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) @@ -204951,7 +205436,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 @@ -204977,11 +205462,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 + 36703 } else { - v2 = __ccgo_ts + 36509 + v2 = __ccgo_ts + 36616 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36603, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36710, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -204994,7 +205479,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+36760, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -205138,7 +205623,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 @@ -205471,7 +205956,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) { @@ -205535,7 +206020,7 @@ 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 +** to accumulate "term -> doclist" content before it is flushed to a level-0 ** segment. */ @@ -205594,7 +206079,7 @@ type TFts5HashEntry1 = struct { type Fts5HashEntry1 = TFts5HashEntry1 /* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -205732,7 +206217,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) } @@ -206044,7 +206529,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) } @@ -206476,9 +206961,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 @@ -206515,7 +207000,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206588,7 +207072,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206623,7 +207106,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206638,9 +207120,9 @@ 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 @@ -206737,11 +207219,12 @@ type TFts5Structure1 = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure1 = TFts5Structure1 +/* Size (in bytes) of an Fts5Structure object holding up to N levels */ + /* ** An object of type Fts5SegWriter is used to write to segments. */ @@ -206874,13 +207357,15 @@ type Fts5SegIter1 = TFts5SegIter1 ** Array of tombstone pages. Reference counted. */ type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray1 = TFts5TombstoneArray1 +/* Size (in bytes) of an Fts5TombstoneArray holding up to N tombstones */ + /* ** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. @@ -206933,11 +207418,12 @@ type TFts5Iter1 = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter1 = TFts5Iter1 +/* Size (in bytes) of an Fts5Iter object holding up to N segment iterators */ + /* ** An instance of the following type is used to iterate through the contents ** of a doclist-index record. @@ -206963,13 +207449,15 @@ type TFts5DlidxLvl1 = struct { type Fts5DlidxLvl1 = TFts5DlidxLvl1 type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } 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)) *(*Tu8)(unsafe.Pointer(aOut + 1)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) & libc.Int32FromInt32(0xFF)) @@ -207148,7 +207636,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+36813, 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. @@ -207253,7 +207741,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+36819, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -207282,7 +207770,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+36870, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -207316,7 +207804,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+36919, 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) @@ -207394,7 +207882,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)) @@ -207485,7 +207973,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+36959, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207496,7 +207984,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+36959, 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)) @@ -208177,7 +208665,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) @@ -208427,7 +208915,7 @@ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _ = nByte, nTomb, pNew nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(nTomb+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) if pNew != 0 { (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb @@ -208531,7 +209019,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 @@ -209137,7 +209625,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+36987, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -209226,7 +209714,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+37071, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -209873,7 +210361,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 @@ -210783,7 +211271,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 { @@ -211197,7 +211685,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+37153, 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. */ @@ -211703,7 +212191,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+37210, 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) @@ -211872,7 +212360,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 } @@ -212190,7 +212678,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+37271, 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))) @@ -212465,7 +212953,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: @@ -212500,7 +212988,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)) @@ -213114,11 +213602,12 @@ type TFts5TokenDataIter1 = struct { 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 // // /* @@ -213186,7 +213675,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) { @@ -213430,7 +213919,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) @@ -213480,7 +213969,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 @@ -213562,15 +214051,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) } @@ -213596,11 +214088,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+37322, 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+26056, __ccgo_ts+37330, 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+12007, __ccgo_ts+37365, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -213798,7 +214290,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) @@ -214053,7 +214545,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+37409) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -214404,7 +214896,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') @@ -214526,7 +215018,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 { @@ -214646,7 +215138,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+36813, 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))) @@ -215240,7 +215732,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+37411, 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)) @@ -215471,7 +215963,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+37497) 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)) @@ -215610,7 +216102,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215767,11 +216258,12 @@ type TFts5Sorter1 = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter1 = TFts5Sorter1 +/* Size (int bytes) of an Fts5Sorter object with N indexes */ + /* ** Virtual-table cursor object. ** @@ -216093,7 +216585,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+37502, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -216130,7 +216622,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++ @@ -216149,7 +216641,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 @@ -216599,7 +217091,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 @@ -216627,7 +217119,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) } @@ -216647,7 +217139,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) @@ -216662,7 +217154,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 + 15172 } else { v1 = __ccgo_ts + 1665 } @@ -216672,11 +217164,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 + 37541 } else { - v3 = __ccgo_ts + 37439 + v3 = __ccgo_ts + 37546 } - 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+37550, 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 @@ -216734,14 +217226,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+37605, 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+37611, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216791,7 +217283,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+37639, 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)) @@ -216824,7 +217316,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+37649, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -216858,7 +217350,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+37670, libc.VaList(bp+24, z)) } } } else { @@ -216866,7 +217358,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 + 35397 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -217023,7 +217515,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+37703, 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))) } @@ -217223,7 +217715,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+37708, 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 @@ -217356,10 +217848,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. @@ -219895,12 +220387,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+39057, 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+39161, 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+39199, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -219909,7 +220401,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+39237, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -219921,14 +220413,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+26056, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12007, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38391, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36190, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36297, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35495, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35602, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -219948,13 +220440,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 + 30696 } 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+39279, 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+39309, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -219995,7 +220487,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+39353, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -220003,7 +220495,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+39376, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -220018,7 +220510,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+39382, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -220027,22 +220519,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+35602, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39281 + zCols = __ccgo_ts + 39388 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39313 + zCols = __ccgo_ts + 39420 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36190, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36297, 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+38391, __ccgo_ts+39468, 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+36479, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -220462,12 +220954,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+39485, 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+39535, 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+39564, 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. */ @@ -220475,7 +220967,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+36479, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220777,7 +221269,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+39593, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -220907,7 +221399,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) } @@ -221009,14 +221501,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+35602, 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 @@ -221668,11 +222160,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 + 39647 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) } @@ -221682,7 +222174,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+39656) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -221699,20 +222191,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+39667) { 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+39625) { 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+39636) { 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+39656) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -222004,7 +222496,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 + 39685 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -222221,64 +222713,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+39695, 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+39698, 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+39703, 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+39708, 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+39711, 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+39714, 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+39719, 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+39724, 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+39728, 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+39734, 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+39739, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222287,49 +222779,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+39743, 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+39747, 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+39750, 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+39754, 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+39758, 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+39762, 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+39766, 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+39770, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222346,20 +222838,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+39774, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39754, 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+39777, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39780, 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+39784, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39770, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -222375,75 +222867,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+39787, 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+39754, 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+39795, 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+39802, 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+39807, 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+39703, 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+39812, 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+39698, 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+39817, 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+39770, 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+39822, 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+16122, 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+39827, 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+39780, 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+39831, 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+39695, 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+39836, 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+39739, 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+39842, 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+39846, 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+39848, 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+39762, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -222452,48 +222944,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+39854, 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+39770, 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+39862, 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+39754, 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+39868, 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+39754, 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+39873, 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+39695, 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+39879, 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+39766, 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+39887, 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+39895, 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+39899, 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+39762, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222501,21 +222993,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+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+39588, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39695, 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+39913, 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+39766, 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+39919, 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+39780, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222533,48 +223025,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+39926, 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+39711, 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+39931, 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+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+39604, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39711, 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+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+39604, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39711, 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+39895, 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+39948, 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+39954, 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+39695, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222590,13 +223082,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+39960, 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+39964, 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+39967, 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) @@ -222604,7 +223096,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+39970, 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) @@ -222769,14 +223261,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+39974) { 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+39667) { 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 { @@ -223044,7 +223536,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+39989)) } // C documentation @@ -223070,7 +223562,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39578, + FzName: __ccgo_ts + 39685, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -223078,7 +223570,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39890, + FzName: __ccgo_ts + 39997, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -223086,7 +223578,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39882, + FzName: __ccgo_ts + 39989, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -223116,7 +223608,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+40003, pApi, bp+96, uintptr(0)) } return rc } @@ -228632,16 +229124,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+40010) == 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+40014) == 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+40018) == 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+40027, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228704,21 +229196,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 + 40061, + 1: __ccgo_ts + 40101, + 2: __ccgo_ts + 40136, } 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+24049, *(*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+40179, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228739,23 +229232,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) } @@ -228888,10 +229381,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+40212, 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+40243, 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)) } @@ -228910,7 +229403,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+40294, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -229360,7 +229853,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+40320, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -229415,7 +229908,7 @@ 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 + 40330 } type TAggInfo_col = struct { @@ -229645,7 +230138,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 @@ -229693,11 +230186,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]int8{'3', '.', '4', '9', '.', '1'} +var Xsqlite3_version = [7]int8{'3', '.', '5', '0', '.', '1'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=0\x00COMPILER=clang-18.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_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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=0\x00COMPILER=clang-18.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_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\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods @@ -229707,3 +230200,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + diff --git a/vendor/modernc.org/sqlite/lib/sqlite_freebsd_arm64.go b/vendor/modernc.org/sqlite/lib/sqlite_freebsd_arm64.go index 4e78aff..467b8a2 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 @@ -1421,6 +1423,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 +1663,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 +1874,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 +2037,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 +2046,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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70" +const SQLITE_SOURCE_ID = "2025-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2150,8 +2156,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.1" -const SQLITE_VERSION_NUMBER = 3049001 +const SQLITE_VERSION = "3.50.1" +const SQLITE_VERSION_NUMBER = 3050001 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3382,6 +3388,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 @@ -3391,9 +3400,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 @@ -4437,6 +4443,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 @@ -4869,7 +4876,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -6610,11 +6616,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. */ /* @@ -6988,6 +7000,7 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem @@ -7033,6 +7046,7 @@ type THashElem1 = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem1 = THashElem1 @@ -7304,6 +7318,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. */ @@ -7362,6 +7381,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 @@ -7665,7 +7695,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData = TDbClientData @@ -7735,9 +7764,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 @@ -7752,7 +7781,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -7801,8 +7829,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 @@ -7866,7 +7894,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -7938,19 +7965,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 @@ -7964,11 +7994,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 @@ -7979,40 +8006,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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -8030,7 +8058,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -8042,6 +8070,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -8190,9 +8219,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 @@ -8247,6 +8276,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8427,7 +8457,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8469,7 +8498,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -9039,8 +9067,8 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. +/* Use SQLITE_ENABLE_EXPLAIN_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 @@ -9887,6 +9915,7 @@ type TTable1 = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table1 = TTable1 @@ -9968,11 +9997,13 @@ type TFKey1 = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey1 = TFKey1 +/* The size (in bytes) of an FKey object holding N columns. The answer +** does NOT include space to hold the zTo name. */ + /* ** SQLite supports many different ways to resolve a constraint ** error. ROLLBACK processing means that a constraint violation @@ -10021,11 +10052,12 @@ type TKeyInfo1 = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo1 = TKeyInfo1 +/* The size (in bytes) of a KeyInfo object with up to N fields */ + /* ** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. */ @@ -10427,13 +10459,16 @@ type Expr1 = TExpr1 ** expression. */ type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList1 = TExprList1 +/* The size (in bytes) of an ExprList object that is big enough to hold +** as many as N expressions. */ + /* ** Allowed values for Expr.a.eEName */ @@ -10454,12 +10489,14 @@ type ExprList1 = TExprList1 ** 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 + F__ccgo_align [0]uint64 + FnId int32 } type IdList1 = TIdList1 +/* The size (in bytes) of an IdList object that can hold up to N IDs. */ + /* ** Allowed values for IdList.eType, which determines which value of the a.u4 ** is valid. @@ -10565,13 +10602,19 @@ type OnOrUsing1 = TOnOrUsing1 ** */ type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList1 = TSrcList1 +/* Size (in bytes) of a SrcList object that can hold as many as N +** SrcItem objects. */ + +/* Size (in bytes( of a SrcList object that holds 1 SrcItem. This is a +** special case of SZ_SRCITEM(1) that comes up often. */ + /* ** Permitted values of the SrcList.a.jointype field */ @@ -10932,19 +10975,22 @@ type TParse1 = 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 @@ -10958,11 +11004,8 @@ type TParse1 = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -10973,40 +11016,41 @@ type TParse1 = 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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -11372,11 +11416,13 @@ type TWith1 = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With1 = TWith1 +/* The size (in bytes) of a With object that can hold as many +** as N different CTEs. */ + /* ** The Cte object is not guaranteed to persist for the entire duration ** of code generation. (The query flattener or other parser tree @@ -11406,11 +11452,13 @@ type TDbClientData1 = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData1 = TDbClientData1 +/* The size (in bytes) of a DbClientData object that can has a name +** that is N bytes long, including the zero-terminator. */ + /* ** This object is used in various ways, most (but not all) related to window ** functions. @@ -12576,7 +12624,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12654,7 +12701,6 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor @@ -12692,11 +12738,16 @@ type TVdbeCursor1 = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor1 = TVdbeCursor1 +/* +** The size (in bytes) of a VdbeCursor object that has an nField value of N +** or less. The value of SZ_VDBECURSOR(n) is guaranteed to be a multiple +** of 8. + */ + /* Return true if P is a null-only cursor */ @@ -12907,21 +12958,14 @@ type Tsqlite3_context1 = struct { 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 */ +/* +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. + */ // C documentation // @@ -13054,7 +13098,7 @@ type TPreUpdate1 = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -13066,6 +13110,7 @@ type TPreUpdate1 = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate1 = TPreUpdate1 @@ -13203,7 +13248,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(24453)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13375,7 +13420,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)) @@ -14210,10 +14255,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)) @@ -15063,7 +15108,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) @@ -16441,7 +16486,8 @@ func init() { // /* // ** Initialize the mutex system. // */ -func _sqlite3MutexInit(tls *libc.TLS) (r int32) { +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 @@ -17766,17 +17812,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'), @@ -17973,22 +18019,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. */ @@ -18237,11 +18284,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 @@ -18269,7 +18316,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)) @@ -18291,7 +18338,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)) @@ -18718,29 +18765,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) @@ -18855,25 +18880,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 = 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. @@ -18881,15 +18910,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) { @@ -18900,13 +18929,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) @@ -18920,35 +18982,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 - } - 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 + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + 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++ + } + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 + j1++ + 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) @@ -18973,9 +19098,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: ; @@ -18989,7 +19114,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 { @@ -18999,21 +19124,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: ; @@ -19252,7 +19377,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 @@ -19551,6 +19676,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 // // /* @@ -19568,11 +19695,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)) } @@ -20206,6 +20333,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 // // /* @@ -20956,7 +21114,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 { @@ -21131,7 +21289,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 @@ -21673,7 +21831,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)) { @@ -21900,7 +22058,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++ } @@ -22060,7 +22218,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('+') @@ -22169,7 +22327,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-- } } @@ -22580,7 +22738,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 @@ -22609,7 +22767,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 { @@ -22623,7 +22781,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) @@ -22708,7 +22866,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) { @@ -23063,23 +23221,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 @@ -23134,8 +23290,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)) } @@ -23168,9 +23324,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: ; @@ -23190,13 +23345,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 } @@ -23204,7 +23358,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 @@ -23220,7 +23374,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 { @@ -23232,7 +23386,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 } @@ -23281,7 +23435,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 @@ -23291,20 +23445,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) } @@ -23323,196 +23476,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 { @@ -24268,91 +24421,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, - }, - 14: { - FzName: __ccgo_ts + 3553, - }, - 15: { - FzName: __ccgo_ts + 3560, - }, - 16: { FzName: __ccgo_ts + 3570, }, + 14: { + FzName: __ccgo_ts + 3579, + }, + 15: { + FzName: __ccgo_ts + 3586, + }, + 16: { + FzName: __ccgo_ts + 3596, + }, 17: { - FzName: __ccgo_ts + 3577, - }, - 18: { - FzName: __ccgo_ts + 3591, - }, - 19: { - FzName: __ccgo_ts + 3597, - }, - 20: { FzName: __ccgo_ts + 3603, }, - 21: { - FzName: __ccgo_ts + 3610, + 18: { + FzName: __ccgo_ts + 3617, }, - 22: { - FzName: __ccgo_ts + 3618, - }, - 23: { + 19: { FzName: __ccgo_ts + 3623, }, - 24: { - FzName: __ccgo_ts + 3630, + 20: { + FzName: __ccgo_ts + 3629, }, - 25: { - FzName: __ccgo_ts + 3637, + 21: { + FzName: __ccgo_ts + 3636, }, - 26: { + 22: { + FzName: __ccgo_ts + 3644, + }, + 23: { FzName: __ccgo_ts + 3649, }, + 24: { + FzName: __ccgo_ts + 3656, + }, + 25: { + FzName: __ccgo_ts + 3663, + }, + 26: { + FzName: __ccgo_ts + 3675, + }, 27: { - FzName: __ccgo_ts + 3658, + FzName: __ccgo_ts + 3684, }, 28: { - FzName: __ccgo_ts + 3664, + FzName: __ccgo_ts + 3690, }, } @@ -24587,9 +24740,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 } } @@ -24909,7 +25062,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 } @@ -24937,7 +25090,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 } } @@ -25596,7 +25749,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(40995)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -25951,7 +26104,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) @@ -26055,7 +26208,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 @@ -26213,7 +26366,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('/')) { @@ -26239,7 +26392,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(42576)), __ccgo_ts+3603, bp, int32(42576)) } // C documentation @@ -26276,7 +26429,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)<= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43393)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -26887,7 +27040,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)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44803)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -27896,10 +28048,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 @@ -27908,8 +28060,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 @@ -27971,7 +28123,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++ @@ -28143,7 +28295,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) } @@ -28298,7 +28450,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(45251)), __ccgo_ts+3486, zName, int32(45251)) if rc == SQLITE_OK { rc = rc2 } @@ -28375,7 +28527,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(45502)) 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(45507)), __ccgo_ts+3675, zIn, int32(45507)) return } (*(*[1026]uint8)(unsafe.Pointer(bp + 224)))[got] = uint8(0) @@ -28573,14 +28725,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(45565)), __ccgo_ts+3504, zPath, int32(45565)) } _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(45571)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<>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) } } @@ -31934,7 +32086,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) - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 0) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0)) for { v4 = n n-- @@ -32217,17 +32369,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) } @@ -32245,7 +32399,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 @@ -32257,7 +32411,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) } } @@ -32458,10 +32612,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 @@ -34606,7 +34761,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 @@ -34624,7 +34779,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 } @@ -35197,6 +35352,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 { @@ -35843,7 +36007,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 @@ -35855,7 +36020,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) @@ -35876,11 +36041,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 @@ -35909,7 +36075,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 @@ -36142,7 +36308,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) } @@ -36279,7 +36445,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)) @@ -36295,7 +36461,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)< int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65269)) } 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)) @@ -40402,7 +40568,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 { @@ -40966,9 +41132,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 @@ -41172,6 +41338,11 @@ type WalCkptInfo1 = TWalCkptInfo1 /* ** An open write-ahead log file is represented by an instance of the ** following object. +** +** writeLock: +** This is usually set to 1 whenever the WRITER lock is held. However, +** if it is set to 2, then the WRITER lock is held but must be released +** by walHandleException() if a SEH exception is thrown. */ type TWal1 = struct { FpVfs uintptr @@ -41238,13 +41409,15 @@ type ht_slot = Tht_slot ** This functionality is used by the checkpoint code (see walCheckpoint()). */ type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } 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 ** is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -41302,7 +41475,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) @@ -41314,7 +41487,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) } @@ -41403,6 +41576,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 @@ -41844,7 +42018,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(67209)) } goto _1 _1: @@ -41932,12 +42106,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(67341)) 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 @@ -42071,7 +42245,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 { @@ -42702,7 +42876,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(68150)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -42818,7 +42992,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)) } } @@ -43033,7 +43207,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 { @@ -43059,7 +43240,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(68601)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43782,8 +43963,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)) } @@ -43870,7 +44051,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(69451)) } iKey = _walNextHash(tls, iKey) } @@ -44367,7 +44548,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(69974)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44616,7 +44797,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, /* 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(70234)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -45388,6 +45569,11 @@ type CellInfo1 = TCellInfo1 ** assumed that the database is corrupt. */ +/* +** Maximum amount of storage local to a database page, regardless of +** page size. + */ + /* ** A cursor is a pointer to a particular entry within a particular ** b-tree within a database file. @@ -45754,10 +45940,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) { @@ -45766,14 +45953,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) { @@ -46473,7 +46660,7 @@ 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(72422)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } @@ -46651,7 +46838,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(72620)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46664,12 +46851,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(72633)) 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(72638)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46713,7 +46900,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(72683)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46721,7 +46908,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(72691)) } return SQLITE_OK } @@ -46909,7 +47096,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) } @@ -46942,7 +47129,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) } @@ -47141,7 +47328,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(73136)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -47181,12 +47368,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(73194)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73197)) } 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)) @@ -47194,21 +47381,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(73205)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73208)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73210)) } 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(73214)) } } cbrk = top + sz @@ -47255,12 +47442,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(73247)) } 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(73253)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -47276,7 +47463,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(73267)) } *(*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) @@ -47336,7 +47523,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(73324)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -47353,14 +47540,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(73339)) } 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(73346)) } return uintptr(0) } @@ -47403,11 +47590,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(73394)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73397)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -47421,7 +47608,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(73414)) } else { return SQLITE_OK } @@ -47474,42 +47661,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(73498)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47517,70 +47702,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(73510)) } - 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(73513)) } - 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(73526)) } - 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(73532)) } 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) + *(*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)) += libc.Int32FromUint16(iOrigSize) + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47626,7 +47811,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(73602)) } } } else { @@ -47652,7 +47837,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(73626)) } } } @@ -47691,12 +47876,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(73677)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73682)) } 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(73692)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73696)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47723,7 +47908,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(73708)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47754,11 +47939,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(73739)) } 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(73744)) } goto _1 _1: @@ -47787,11 +47972,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(73776)) } (*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) @@ -47800,7 +47985,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(73790)) } /* 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 @@ -47822,30 +48007,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) @@ -47953,7 +48136,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(73933)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -48015,7 +48198,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(74005)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -48103,7 +48286,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 */ @@ -48727,7 +48910,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) @@ -48889,7 +49072,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 @@ -48927,7 +49110,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(74943)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -49368,7 +49551,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(75398)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -49392,7 +49575,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(75417)) } 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) @@ -49401,7 +49584,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(75426)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -49415,7 +49598,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(75438)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -49445,7 +49628,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(75473)) } /* 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) @@ -49541,7 +49724,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(75571)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49579,7 +49762,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(75623)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -49646,7 +49829,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(75691)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49689,7 +49872,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(75742)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49719,7 +49902,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(75769)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -50185,7 +50368,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(76233)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50577,7 +50760,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(76657)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50587,7 +50770,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(76672)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50618,7 +50801,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) @@ -50644,7 +50827,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(76743)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50718,7 +50901,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(76827)) } return rc } @@ -50853,7 +51036,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(76965)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -50865,7 +51048,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(76979)) } if rc != 0 { v3 = pCur + 84 @@ -50981,7 +51164,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(77114)) } goto skip_init skip_init: @@ -50995,7 +51178,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(77126)) } 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) @@ -51229,7 +51412,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(77375)) } } } @@ -51433,7 +51616,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes p3 = pCur + 1 *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(BTCF_ValidOvfl) | libc.Int32FromInt32(BTCF_AtLast))) if !((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76795)) + return _sqlite3CorruptError(tls, int32(77571)) } goto bypass_moveto_root /* Start search on the current page */ } @@ -51496,10 +51679,10 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ if nCell < int32(2) || libc.Uint32FromInt32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77658)) 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 @@ -51527,7 +51710,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(77690)) } goto moveto_index_finish } @@ -51560,7 +51743,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(77721)) } *(*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 @@ -51569,7 +51752,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(77732)) } if rc != 0 { v11 = pCur + 84 @@ -51698,7 +51881,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(77833)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51808,7 +51991,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(77926)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -51896,7 +52079,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(78016)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -51951,7 +52134,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(78072)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -51977,7 +52160,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(78101)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52004,7 +52187,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(78135)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -52075,7 +52258,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(78200)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52213,7 +52396,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(78327)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -52264,7 +52447,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(78374)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -52273,7 +52456,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(78385)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -52363,7 +52546,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(78474)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -52381,7 +52564,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(78491)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -52404,7 +52587,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(78511)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -52625,10 +52808,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(78767)) 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 @@ -53019,12 +53202,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(79157)) } 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(79162)) } } pData -= uintptr(sz) @@ -53032,7 +53215,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(79168)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -53127,7 +53310,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(79255)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -53208,7 +53391,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: ; @@ -53235,7 +53418,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: ; @@ -53275,7 +53458,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(79377)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2))) nCell -= nShift @@ -53346,7 +53529,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(79455)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -53391,7 +53574,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(79495)) } /* 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 @@ -53587,10 +53770,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 @@ -53713,8 +53897,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 @@ -53754,7 +53938,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(79919)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53777,7 +53961,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(79943)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -53908,7 +54092,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(80044)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -53951,7 +54135,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(80077)) goto balance_cleanup } } @@ -54010,7 +54194,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(80121)) goto balance_cleanup } goto _11 @@ -54042,7 +54226,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(80154)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -54272,7 +54456,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(80355)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54518,7 +54702,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(80587)) } goto _1 _1: @@ -54591,7 +54775,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(80647)) } 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))) @@ -54750,7 +54934,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(80811)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54781,7 +54965,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(80839)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -54866,7 +55050,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(80920)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -54958,7 +55142,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(81043)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -54994,7 +55178,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(81085)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55024,10 +55208,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(81112)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81115)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -55145,12 +55329,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(81217)) } 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 @@ -55160,14 +55344,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(81242)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -55267,21 +55451,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(81338)) } } 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(81347)) } 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(81561)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55526,7 +55710,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(81609)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55607,14 +55791,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(81699)) } *(*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(81706)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55751,7 +55935,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(81810)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -56016,7 +56200,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)) @@ -56064,11 +56248,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) @@ -56094,11 +56278,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 @@ -56170,11 +56354,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)) } } @@ -56310,12 +56494,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 } @@ -56400,7 +56584,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 */ @@ -56423,7 +56607,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 { @@ -56500,7 +56684,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))) @@ -56514,7 +56698,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 @@ -56605,7 +56789,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) } @@ -56629,11 +56813,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) } } } @@ -56670,10 +56854,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: @@ -57112,7 +57296,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) @@ -57122,7 +57306,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 @@ -57151,7 +57335,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 @@ -57181,7 +57365,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... @@ -57857,7 +58041,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) } @@ -57995,9 +58179,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) @@ -58172,20 +58353,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 } @@ -58200,10 +58381,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 @@ -58957,7 +59138,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(85108)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -59121,7 +59302,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 { @@ -59129,8 +59311,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 { @@ -59187,14 +59369,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 */ @@ -59208,7 +59390,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 @@ -59233,14 +59415,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)) @@ -59340,7 +59522,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 } } } @@ -59355,7 +59537,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 } @@ -59659,7 +59841,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(85794)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59675,7 +59857,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(85800)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59685,7 +59867,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(85806)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -60146,12 +60328,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 @@ -60325,7 +60506,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 @@ -60342,7 +60523,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 { @@ -60410,8 +60591,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. @@ -60424,11 +60605,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 */ @@ -60465,13 +60646,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 @@ -60502,7 +60686,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 @@ -61004,7 +61188,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)) { @@ -61017,39 +61201,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): @@ -61066,14 +61250,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 @@ -61088,20 +61272,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)) } @@ -61115,10 +61299,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 @@ -61915,7 +62099,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 } @@ -62069,7 +62253,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) } @@ -62077,18 +62261,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) @@ -62319,7 +62503,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(90646))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63707,7 +63891,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(90727))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -63742,7 +63926,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(90757))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63796,7 +63980,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(90808))) return 0 /* Corrupt index */ } } @@ -63928,7 +64112,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(90971))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -64080,7 +64264,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(91129)) } // C documentation @@ -64111,7 +64295,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(91162)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -64262,15 +64446,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 @@ -64365,10 +64549,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 @@ -64377,9 +64562,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 { @@ -64459,7 +64644,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 @@ -64469,7 +64654,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) @@ -64527,7 +64712,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(91560)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -65030,7 +65215,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 @@ -65231,7 +65416,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(92354)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -65361,7 +65546,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(92475)) } 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) @@ -65821,18 +66006,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'), @@ -66087,14 +66272,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(93091)) } 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(93095))) 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(93099)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -66245,7 +66430,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, 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) } @@ -66668,11 +66853,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(93642)) 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))) } @@ -66681,7 +66866,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) @@ -66695,7 +66880,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) } @@ -66730,7 +66915,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(93701)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66765,7 +66950,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 } @@ -66831,11 +67016,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(93797)) 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))) } @@ -66858,7 +67043,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 @@ -66880,7 +67065,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 @@ -67007,7 +67192,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 { @@ -67045,7 +67230,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 @@ -67060,28 +67245,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)) } } } @@ -67245,9 +67430,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 { @@ -67273,12 +67458,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) @@ -67287,28 +67470,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 @@ -67699,12 +67882,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 @@ -67721,7 +67904,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 @@ -67739,7 +67922,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 @@ -68453,19 +68636,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) { @@ -69679,7 +69862,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 @@ -69695,6 +69878,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 */ @@ -70188,7 +70377,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(97561)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -70291,7 +70480,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, @@ -70887,7 +71076,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 { @@ -70917,12 +71106,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 } @@ -71014,7 +71203,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. @@ -72125,7 +72314,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(99822)) } else { goto jump_to_p2 } @@ -72584,7 +72773,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(). @@ -73017,7 +73206,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(101119)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -73347,7 +73536,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 @@ -73378,13 +73567,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 { @@ -73399,7 +73588,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(101412)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73636,7 +73825,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 @@ -73653,15 +73842,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 @@ -73742,11 +73931,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) } @@ -73958,7 +74147,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 @@ -74008,7 +74197,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 { @@ -74064,7 +74253,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)) @@ -74143,11 +74332,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) { @@ -74300,7 +74489,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 } @@ -74462,7 +74651,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' @@ -74542,12 +74731,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)) @@ -74558,7 +74747,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)) @@ -74652,7 +74841,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 } @@ -74680,11 +74869,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) { @@ -74812,7 +75001,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) @@ -74963,7 +75152,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 { @@ -75050,15 +75239,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) @@ -75524,11 +75705,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) @@ -75614,7 +75795,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103962)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75713,7 +75894,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(104062)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75727,7 +75908,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) } @@ -76174,11 +76355,12 @@ type TVdbeSorter1 = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter1 = TVdbeSorter1 +/* Size (in bytes) of a VdbeSorter object that works with N or fewer subtasks */ + /* ** An instance of the following object is used to read records out of a ** PMA, in sorted order. The next key to be read is cached in nKey/aKey. @@ -76785,8 +76967,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 @@ -76800,9 +76982,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) @@ -77000,18 +77182,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 { @@ -77299,6 +77482,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: @@ -79844,25 +80030,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) } } @@ -79901,23 +80087,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 */ @@ -79949,7 +80134,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 @@ -80043,7 +80228,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 } } @@ -80065,57 +80250,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 @@ -80160,11 +80332,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 } @@ -80173,36 +80345,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++ @@ -80231,18 +80392,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 } } } @@ -80289,15 +80450,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) @@ -80308,8 +80469,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -80349,7 +80510,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) @@ -80369,7 +80530,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) @@ -80378,7 +80539,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 @@ -80388,26 +80549,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) } @@ -80456,8 +80617,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80531,19 +80692,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) } @@ -80715,7 +80876,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) { @@ -80770,7 +80931,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 { @@ -80794,7 +80955,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) @@ -80808,13 +80969,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: ; @@ -80834,16 +80995,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 @@ -80854,35 +81012,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 { @@ -80967,7 +81128,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))) } @@ -80979,7 +81140,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 @@ -81025,7 +81186,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 @@ -81150,7 +81311,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) } @@ -81185,7 +81346,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 @@ -81223,7 +81384,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 { @@ -81293,7 +81454,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 @@ -81327,7 +81488,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 @@ -81640,7 +81801,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 { @@ -81707,7 +81868,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 { @@ -81718,7 +81879,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 @@ -81728,7 +81889,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 @@ -81950,33 +82111,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 } @@ -82028,7 +82191,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) { @@ -82236,7 +82399,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 } @@ -82711,7 +82874,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) { @@ -82790,7 +82953,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 @@ -82977,7 +83140,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) @@ -83135,11 +83298,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)) @@ -83188,7 +83351,7 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt 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)) { _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) } @@ -83216,7 +83379,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)) @@ -83236,7 +83399,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 @@ -83307,7 +83470,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)) } } } @@ -83359,7 +83522,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 } @@ -83392,7 +83555,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) } } @@ -83775,7 +83938,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 @@ -83915,7 +84078,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: @@ -83936,27 +84098,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) { @@ -84002,9 +84157,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++ } @@ -84014,8 +84169,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++ } @@ -84029,7 +84184,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) } @@ -84080,7 +84235,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 @@ -84161,7 +84316,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) @@ -84179,7 +84334,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) @@ -84260,7 +84415,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 @@ -84389,7 +84544,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)) } } @@ -84487,10 +84642,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) @@ -85168,13 +85323,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 @@ -85189,32 +85344,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 @@ -85423,7 +85565,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 @@ -85476,7 +85618,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) @@ -85576,12 +85718,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) @@ -86173,7 +86316,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 @@ -86269,14 +86412,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 } @@ -86304,9 +86447,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) { @@ -86439,7 +86582,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) } } @@ -86569,13 +86712,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)<= (*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) } @@ -87367,7 +87510,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)) @@ -87382,7 +87525,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) { @@ -87411,7 +87554,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) } @@ -87487,7 +87630,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): @@ -87550,7 +87693,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 @@ -87560,7 +87703,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) { @@ -87581,9 +87724,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 /* @@ -87665,7 +87808,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) { @@ -87736,17 +87879,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 { @@ -87755,7 +87898,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 @@ -87786,7 +87929,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 { @@ -87856,7 +87999,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) @@ -87900,7 +88043,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 @@ -88167,7 +88310,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: @@ -88376,7 +88521,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: @@ -89083,7 +89230,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) } @@ -89604,7 +89751,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) 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 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 @@ -89620,7 +89767,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) (*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 + v9 = pParse + 60 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 @@ -89705,7 +89852,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 @@ -89713,7 +89860,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 @@ -89731,7 +89878,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 } } } @@ -89750,11 +89897,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 } @@ -89872,8 +90019,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+8538, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -89891,10 +90038,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+8566, 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+8741, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -89910,9 +90057,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+8915, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9037, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9062, 0) } } @@ -89968,7 +90115,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+9213, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -89977,11 +90124,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+9272, 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+9278, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -90011,21 +90158,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+9305, 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+9489, 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+9794, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9810, 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+9868, 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 @@ -90033,7 +90180,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 @@ -90041,7 +90188,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+10133, 0) goto exit_rename_table exit_rename_table: ; @@ -90058,7 +90205,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+10146, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -90098,11 +90245,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+10184, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10191, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10216, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -90118,10 +90265,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+10243) } 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+10302) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -90133,13 +90280,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+10355) } _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+10401) } } /* Modify the CREATE TABLE statement. */ @@ -90153,7 +90300,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+10428, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -90181,7 +90328,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+10574, libc.VaList(bp+16, zTab, zDb)) } } } @@ -90219,12 +90366,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+10927, 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+10961, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -90239,7 +90386,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 } @@ -90247,8 +90394,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+10991, 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 } @@ -90309,18 +90456,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 + 11010 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10990 + zType = __ccgo_ts + 11015 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11004 + v1 = __ccgo_ts + 11029 } else { - v1 = __ccgo_ts + 11021 + v1 = __ccgo_ts + 11046 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11039, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11064, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90367,21 +90514,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+11082, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -90397,11 +90532,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+11103, 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+11285, 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+10133, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -90877,11 +91012,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 + 11416 } 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+11418, 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) } @@ -90952,30 +91087,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+11441, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118867)) } 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(118888)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -90996,9 +91135,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)) @@ -91014,15 +91152,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+11449, 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)) @@ -91033,16 +91171,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++ @@ -91059,21 +91197,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 + 11416 } 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+11455, 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))) @@ -91099,7 +91237,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: ; @@ -91409,7 +91547,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 { @@ -91676,7 +91814,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) @@ -91859,7 +91997,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 { @@ -91943,8 +92081,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 @@ -91960,12 +92099,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)) @@ -92039,7 +92178,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(119856)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -92056,7 +92195,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+11460, 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 @@ -92111,23 +92250,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+11082, 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 + 11467 } 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+11479, 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+11507, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -92139,31 +92278,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+11555, 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+11676, 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)) { @@ -92177,7 +92316,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 @@ -92188,8 +92327,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 } @@ -92250,27 +92389,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 + 11694, }, 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 + 11715, }, 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 + 11735, }, 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 + 11754, }, 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 + 11773, }, } @@ -92481,8 +92620,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+11876, 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 { @@ -92492,10 +92636,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+11899, 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+11929, 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) @@ -92527,15 +92671,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11771, - FzCols: __ccgo_ts + 11784, + FzName: __ccgo_ts + 11796, + FzCols: __ccgo_ts + 11809, }, 1: { - FzName: __ccgo_ts + 11797, - FzCols: __ccgo_ts + 11810, + FzName: __ccgo_ts + 11822, + FzCols: __ccgo_ts + 11835, }, 2: { - FzName: __ccgo_ts + 11838, + FzName: __ccgo_ts + 11863, }, } @@ -92749,7 +92893,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) { @@ -92765,12 +92910,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 @@ -92778,7 +92923,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) @@ -92837,7 +92982,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 + 11947, } func init() { @@ -93211,7 +93356,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 + 11957, } func init() { @@ -93261,7 +93406,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+11967, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -93272,7 +93417,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+11972, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -93311,7 +93456,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+11978, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -93329,7 +93474,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 + 11984, } func init() { @@ -93395,7 +93540,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+11993, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -93404,12 +93549,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+11796, 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)) @@ -93531,7 +93676,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 } @@ -93611,7 +93756,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: @@ -93642,7 +93787,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+12003, 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)) @@ -93733,7 +93878,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+12003, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -93770,7 +93915,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 @@ -93803,11 +93948,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+12007) } 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+12011) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -93971,17 +94116,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+12015, 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+12026, 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+12036, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -93993,13 +94138,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) - } } } @@ -94050,7 +94188,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) } @@ -94253,8 +94391,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))) @@ -94360,11 +94498,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+11822, 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+12048, __ccgo_ts+12117, zDb) } return rc } @@ -94430,10 +94568,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+11796, (*(*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+12169, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94546,7 +94684,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 @@ -94598,11 +94736,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+12210, 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 { @@ -94633,7 +94771,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+12213, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -94642,7 +94780,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+12250, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -94654,13 +94792,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 } @@ -94698,7 +94836,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+12280, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94706,7 +94844,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+12309, 0) rc = int32(SQLITE_ERROR) } } @@ -94753,7 +94891,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+12377, libc.VaList(bp+56, zFile)) } } } @@ -94815,15 +94953,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+12405, 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+12426, 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+12452, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -94918,7 +95056,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 + 12474, } func init() { @@ -94940,7 +95078,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 + 12488, } func init() { @@ -94966,7 +95104,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+12502, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -95000,7 +95138,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+12526, 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))) @@ -95217,7 +95355,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+12572, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -95245,11 +95383,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+12595, 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+12601, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12582, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12607, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -95309,7 +95447,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) { @@ -95344,7 +95482,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+12634, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -95462,7 +95600,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 @@ -95560,7 +95698,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) @@ -95638,7 +95778,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) { @@ -95652,7 +95792,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) } @@ -95765,21 +95907,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) } } } @@ -95809,12 +95951,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) } } } @@ -95852,7 +95994,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+12649, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -95862,7 +96004,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) @@ -95870,15 +96012,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 + 12657 } else { - v1 = __ccgo_ts + 12645 + v1 = __ccgo_ts + 12670 } 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 { } @@ -95916,12 +96058,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 @@ -96446,7 +96588,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) @@ -96478,7 +96620,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 @@ -96536,13 +96678,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+12684, 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+12701, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96590,8 +96732,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+12721, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96627,23 +96769,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 @@ -96763,7 +96907,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 @@ -96806,9 +96950,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 @@ -96821,7 +96965,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+12763, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -96837,9 +96981,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10985 + v2 = __ccgo_ts + 11010 } else { - v2 = __ccgo_ts + 9247 + v2 = __ccgo_ts + 9272 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -96849,9 +96993,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 @@ -96875,11 +97019,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 + 11010 } else { - v4 = __ccgo_ts + 9247 + v4 = __ccgo_ts + 9272 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12779, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12804, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -96887,11 +97031,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+12825, 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++ @@ -96923,19 +97067,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 @@ -96955,15 +97109,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) @@ -96978,7 +97137,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 } @@ -97039,7 +97198,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+12860, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -97048,14 +97207,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+12894, 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) @@ -97087,11 +97248,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) @@ -97102,7 +97263,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+12914, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -97112,12 +97273,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+12937, 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+12944, 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-- @@ -97159,21 +97320,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+12954, 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) { @@ -97184,7 +97334,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. */ @@ -97197,12 +97347,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 @@ -97374,10 +97533,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+12980, 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+13025, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -97435,7 +97594,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+13066, 0) } } @@ -97463,8 +97622,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) @@ -97472,7 +97631,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+13118, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -97491,21 +97650,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 @@ -97528,7 +97676,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+13159, 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) @@ -97556,8 +97704,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 { @@ -97644,17 +97797,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+13215, 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+13258, (*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+13266, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97686,7 +97839,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+13273, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -97827,9 +97980,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 @@ -97840,31 +97994,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 + 13304 + zEnd = __ccgo_ts + 5199 } else { - zSep = __ccgo_ts + 13281 - zSep2 = __ccgo_ts + 13285 - zEnd = __ccgo_ts + 13290 + zSep = __ccgo_ts + 13306 + zSep2 = __ccgo_ts + 13310 + zEnd = __ccgo_ts + 13315 } - 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+13318, 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))++ @@ -97875,8 +98029,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)] @@ -97889,17 +98044,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 + 13332, + 2: __ccgo_ts + 13338, + 3: __ccgo_ts + 13343, + 4: __ccgo_ts + 13348, + 5: __ccgo_ts + 13338, } // C documentation @@ -97908,15 +98064,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) } @@ -97931,7 +98088,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 } @@ -98164,8 +98321,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. @@ -98265,7 +98432,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 @@ -98278,8 +98445,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++ } @@ -98309,7 +98476,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 @@ -98528,9 +98695,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+13354, 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+13387, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98551,11 +98718,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+13414, 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+13464, 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)) @@ -98602,7 +98769,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+13496, 0) return } } @@ -98636,16 +98803,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 + 9272 + zType2 = __ccgo_ts + 13540 } else { /* A view */ - zType = __ccgo_ts + 10985 - zType2 = __ccgo_ts + 13521 + zType = __ccgo_ts + 11010 + zType2 = __ccgo_ts + 13546 } /* 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 @@ -98662,24 +98829,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) @@ -98727,13 +98899,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+13551, 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+13566, 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 @@ -98742,15 +98924,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+13664, 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+13706, 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+13740, 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. @@ -98768,7 +98950,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+9794) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -98801,7 +98983,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+13761, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -98818,7 +99000,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+11010, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -98915,7 +99097,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+13797, 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. @@ -99099,7 +99281,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+13827, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -99112,7 +99294,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+13842, 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) } @@ -99195,9 +99377,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+13909, 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+11899, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -99238,7 +99420,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+13923, 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 @@ -99247,7 +99429,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+13968, 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) } @@ -99282,11 +99464,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) @@ -99341,9 +99523,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 @@ -99376,18 +99558,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+14035, 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+14063, 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+14097, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -99397,7 +99579,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+12011, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -99445,19 +99627,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+14129, 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+14192, 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 { @@ -99514,7 +99696,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+14286, 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) { @@ -99629,11 +99811,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 */ @@ -99655,7 +99837,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 @@ -99700,13 +99882,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) } @@ -99729,23 +99911,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 @@ -99774,11 +99956,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 + 14332 } else { - v2 = __ccgo_ts + 14313 + v2 = __ccgo_ts + 14338 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14318, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14343, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -99856,7 +100038,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+14371, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -99866,7 +100048,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+14377, 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)) { @@ -99880,16 +100062,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+14427, 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+14455, 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+14480, 0) goto exit_create_index } /* @@ -99910,19 +100092,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+14371, (*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+14514, 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+14548, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -99943,7 +100125,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+14572, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -99961,9 +100143,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 @@ -99991,7 +100173,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+14371) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -100023,7 +100205,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 } @@ -100075,7 +100257,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+14595, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -100090,6 +100272,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { j = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) } else { if int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16 + 8))&0xf>>0)) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) @@ -100174,7 +100357,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) @@ -100222,7 +100405,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+14656, 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 @@ -100252,8 +100435,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+14698, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127335)) goto exit_create_index } } @@ -100266,7 +100449,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 @@ -100295,9 +100478,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 + 14715 } - 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+14723, 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(""); */ @@ -100305,7 +100488,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+14743, 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. @@ -100313,7 +100496,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+14802, 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)) @@ -100476,16 +100659,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+14829, 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+14847, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100493,9 +100676,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 { @@ -100511,8 +100694,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+14920, 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+12007, (*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) @@ -100585,12 +100768,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) @@ -100702,13 +100885,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+14980, 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) } @@ -100789,7 +100972,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) } @@ -100839,7 +101022,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 @@ -101010,11 +101193,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 + 15016 } else { - v1 = __ccgo_ts + 14994 + v1 = __ccgo_ts + 15019 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15000, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15025, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -101213,7 +101396,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+15061, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -101260,9 +101443,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 + 15067 } else { - v1 = __ccgo_ts + 15051 + v1 = __ccgo_ts + 15076 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -101294,9 +101477,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 + 15061, + 1: __ccgo_ts + 15083, + 2: __ccgo_ts + 15067, } // C documentation @@ -101316,7 +101499,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+15091, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -101341,7 +101524,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+12595, 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 @@ -101772,7 +101955,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+15291, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102654,11 +102835,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+15324, 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+15353, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102762,7 +102943,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 @@ -102819,7 +103000,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+15427, -int32(1)) return } if argc == int32(3) { @@ -104538,7 +104724,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+15460, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -104620,7 +104806,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 @@ -104692,28 +104878,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+15505, 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+15513, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -104745,13 +104931,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 + 15521 + } else { + v2 = __ccgo_ts + 15525 + } + 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+15528, -int32(1)) + return +} + // C documentation // // /* @@ -104763,6 +105085,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) @@ -104773,7 +105099,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) @@ -105208,7 +105534,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 } @@ -105297,7 +105623,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11391, + 0: __ccgo_ts + 11416, } // C documentation @@ -105457,7 +105783,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+15551, int32(4), libc.UintptrFromInt32(0)) } } @@ -105518,7 +105844,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+12634, -int32(1)) return } if argc == int32(2) { @@ -105628,7 +105954,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) { @@ -105710,7 +106036,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+15404, -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) @@ -105942,7 +106268,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) @@ -105953,7 +106279,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 { @@ -106060,7 +106386,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+15556, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -106089,8 +106415,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+15562, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15562, 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 @@ -106378,7 +106704,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))) } /* @@ -106391,542 +106717,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 + 15567, }, 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 + 15587, }, 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 + 15600, }, 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 + 15618, }, 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 + 15627, }, 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 + 15635, }, 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 + 15635, }, 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 + 15650, }, 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 + 15676, }, 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 + 15701, }, 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 + 15710, }, 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 + 15721, }, 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 + 15728, }, 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 + 15742, }, 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 + 15742, }, 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 + 15748, }, 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 + 15748, }, 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 + 15754, }, 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 + 15754, }, 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 + 15759, }, 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 + 15759, }, 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 + 15763, }, 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 + 15763, }, 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 + 15767, }, 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 + 15774, }, 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 + 15782, }, 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 + 15789, }, 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 + 15802, }, 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 + 15808, }, 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 + 15815, }, 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 + 15822, }, 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 + 15830, }, 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 + 15835, }, 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 + 15839, }, 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 + 15839, }, 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 + 15845, }, 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 + 15851, }, 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 + 15857, }, 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 + 15861, }, 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 + 15861, }, 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 + 15867, }, 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 + 15874, }, 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 + 15884, }, 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 + 15891, }, 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 + 15898, }, 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 + 15909, }, 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 + 15916, }, 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 + 15931, }, 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 + 15948, }, 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 + 15959, }, 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 + 15966, }, 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 + 15972, }, 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 + 15985, }, 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 + 16003, }, 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 + 16011, }, 55: { - 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 + 15970, - }, - 56: { 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 + 16025, + }, + 56: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16033, }, 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 + 16042, }, 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 + 16042, }, 59: { - 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, + 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 + 16049, }, 60: { - 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, + 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 + 16049, }, 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 + 15997, + FzName: __ccgo_ts + 16059, }, 62: { - 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, + 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 + 16063, }, 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(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16001, + 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 + 16069, }, 64: { - 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, + 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 + 16073, }, 65: { - 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, + 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 + 16073, }, 66: { - FnArg: int16(2), + 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 + 16020, + FzName: __ccgo_ts + 16079, }, 67: { 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, + 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 + 16079, }, 68: { 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, + 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 + 16092, }, 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 + 16103, + }, + 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 + 15562, + }, + 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, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16036, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1238, + FzName: __ccgo_ts + 15562, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1246, + FzName: __ccgo_ts + 16108, }, 73: { 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 + 1238, }, 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 + 16047, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1246, }, 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 + 16050, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16113, }, 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 + 16054, + FzName: __ccgo_ts + 16119, }, 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 + 16060, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16122, }, 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 + 16050, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16126, }, 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, + FfuncFlags: 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 + 16132, }, 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 + 16122, }, 81: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16073, - }, - 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, - }, - 83: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16083, - }, - 84: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16088, - }, - 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, - }, - 86: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16098, - }, - 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, - }, - 88: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16108, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, }, + 82: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16141, + }, + 83: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16145, + }, + 84: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16151, + }, + 85: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16155, + }, + 86: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16160, + }, + 87: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16165, + }, + 88: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16170, + }, + 89: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16176, + }, + 90: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16180, + }, + 91: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16184, + }, + 92: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16188, + }, + 93: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16193, + }, + 94: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16198, + }, 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 + 16203, }, 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 + 16209, }, 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 + 16215, }, 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 + 16221, }, 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 + 16226, }, 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 + 16234, }, 101: { - 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, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16242, }, 102: { - 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, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16245, }, 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 + 6883, + }, + 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 + 16182, + FzName: __ccgo_ts + 16250, + }, + 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 + 16254, }, } @@ -106985,109 +107322,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 ************************************************/ @@ -107311,7 +107650,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) } @@ -107404,7 +107743,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+16257, 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) @@ -108228,7 +108567,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 @@ -108515,11 +108854,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 { @@ -108583,7 +108922,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) @@ -108599,7 +108938,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 @@ -109165,7 +109504,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 } @@ -109231,11 +109570,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 } @@ -109560,7 +109899,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) @@ -109574,7 +109913,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 @@ -109609,7 +109948,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 @@ -109622,7 +109961,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 @@ -109749,27 +110088,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 */ @@ -109850,7 +110189,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++ @@ -109877,7 +110216,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 } @@ -109886,44 +110225,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+16302, 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+16343, 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 } } @@ -109945,31 +110268,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+16375, 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 @@ -109993,10 +110316,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) @@ -110037,8 +110360,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-- } @@ -110055,34 +110378,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+16383, 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+16435, 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 @@ -110189,18 +110512,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 @@ -110210,13 +110533,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 } } } @@ -110227,14 +110550,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 } @@ -110251,16 +110574,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++ @@ -110371,11 +110694,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 */ @@ -110434,7 +110757,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16455) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16527) } goto insert_cleanup insert_cleanup: @@ -110830,7 +111153,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+12595, 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('/'))) { @@ -113064,7 +113389,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+16576, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -113084,19 +113409,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+16580, 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+16586, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113111,14 +113436,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+16629, 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) } @@ -113142,7 +113467,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+16661, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113151,7 +113476,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 + 16541, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -113384,7 +113709,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+16698, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -113438,63 +113763,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 + 16737, + 2: __ccgo_ts + 9272, + 3: __ccgo_ts + 16741, + 4: __ccgo_ts + 16746, + 5: __ccgo_ts + 16749, + 6: __ccgo_ts + 16759, + 7: __ccgo_ts + 16769, + 8: __ccgo_ts + 16775, + 9: __ccgo_ts + 16779, + 10: __ccgo_ts + 16784, + 11: __ccgo_ts + 16789, + 12: __ccgo_ts + 16797, + 13: __ccgo_ts + 16808, + 14: __ccgo_ts + 16811, + 15: __ccgo_ts + 16779, + 16: __ccgo_ts + 16818, + 17: __ccgo_ts + 16784, + 18: __ccgo_ts + 16826, + 19: __ccgo_ts + 16830, + 20: __ccgo_ts + 16835, + 21: __ccgo_ts + 16841, + 22: __ccgo_ts + 16779, + 23: __ccgo_ts + 16784, + 24: __ccgo_ts + 16848, + 25: __ccgo_ts + 16853, + 26: __ccgo_ts + 16856, + 27: __ccgo_ts + 16863, + 28: __ccgo_ts + 16775, + 29: __ccgo_ts + 16779, + 30: __ccgo_ts + 16869, + 31: __ccgo_ts + 16874, + 32: __ccgo_ts + 16879, + 33: __ccgo_ts + 16737, + 34: __ccgo_ts + 16779, + 35: __ccgo_ts + 16883, + 36: __ccgo_ts + 16890, + 37: __ccgo_ts + 16897, + 38: __ccgo_ts + 12011, + 39: __ccgo_ts + 12007, + 40: __ccgo_ts + 16905, + 41: __ccgo_ts + 16910, + 42: __ccgo_ts + 16915, + 43: __ccgo_ts + 9272, + 44: __ccgo_ts + 16920, + 45: __ccgo_ts + 5593, + 46: __ccgo_ts + 16926, + 47: __ccgo_ts + 16931, + 48: __ccgo_ts + 16122, + 49: __ccgo_ts + 16936, + 50: __ccgo_ts + 16737, + 51: __ccgo_ts + 16779, + 52: __ccgo_ts + 16949, + 53: __ccgo_ts + 16954, + 54: __ccgo_ts + 16963, + 55: __ccgo_ts + 16970, + 56: __ccgo_ts + 16981, } // C documentation @@ -113513,338 +113838,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16917, + FzName: __ccgo_ts + 16989, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16932, + FzName: __ccgo_ts + 17004, 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 + 17019, 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 + 17031, 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 + 17047, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16898, + FzName: __ccgo_ts + 16970, 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 + 17060, 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 + 17072, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17020, + FzName: __ccgo_ts + 17092, 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 + 17108, 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 + 17129, 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 + 17144, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17088, + FzName: __ccgo_ts + 17160, 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 + 17174, 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 + 17187, 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 + 17201, 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 + 17220, 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 + 17239, 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 + 17262, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17199, + FzName: __ccgo_ts + 17271, 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 + 17289, 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 + 17306, 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 + 17319, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17262, + FzName: __ccgo_ts + 17334, 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 + 17352, 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 + 17362, 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 + 17376, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17320, + FzName: __ccgo_ts + 17392, 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 + 17417, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17364, + FzName: __ccgo_ts + 17436, 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 + 17447, 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 + 17458, 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 + 17470, 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 + 17486, 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 + 17499, 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 + 17518, 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 + 17537, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17478, + FzName: __ccgo_ts + 17550, 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 + 17565, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17503, + FzName: __ccgo_ts + 17575, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17515, + FzName: __ccgo_ts + 17587, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17524, + FzName: __ccgo_ts + 17596, 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 + 17607, 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 + 17617, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17557, + FzName: __ccgo_ts + 17629, 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 + 17640, 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 + 17652, 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 + 17669, 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 + 17688, 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 + 17714, 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 + 17729, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17671, + FzName: __ccgo_ts + 17743, 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 + 17762, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17704, + FzName: __ccgo_ts + 17776, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17720, + FzName: __ccgo_ts + 17792, 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 + 17804, 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 + 17815, 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 + 17826, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -113852,45 +114177,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17766, + FzName: __ccgo_ts + 17838, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17777, + FzName: __ccgo_ts + 17849, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17798, + FzName: __ccgo_ts + 17870, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17806, + FzName: __ccgo_ts + 17878, 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 + 17893, 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 + 17906, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17853, + FzName: __ccgo_ts + 17925, 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 + 17940, 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)), @@ -113908,7 +114233,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 @@ -114016,10 +114341,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+17956) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17894) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17966) { return PAGER_LOCKINGMODE_NORMAL } } @@ -114037,13 +114362,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+17973) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17906) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17978) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -114066,10 +114391,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+16949) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17918) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+17990) == 0 { return int32(2) } else { return 0 @@ -114091,7 +114416,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+17997, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -114221,15 +114546,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 + 18059 case int32(OE_SetDflt): - zName = __ccgo_ts + 17996 + zName = __ccgo_ts + 18068 case int32(OE_Cascade): - zName = __ccgo_ts + 18008 + zName = __ccgo_ts + 18080 case int32(OE_Restrict): - zName = __ccgo_ts + 18016 + zName = __ccgo_ts + 18088 default: - zName = __ccgo_ts + 18025 + zName = __ccgo_ts + 18097 break } return zName @@ -114250,12 +114575,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 + 18107, + 1: __ccgo_ts + 18114, + 2: __ccgo_ts + 18122, + 3: __ccgo_ts + 18126, + 4: __ccgo_ts + 17990, + 5: __ccgo_ts + 18135, } // C documentation @@ -114317,15 +114642,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 + 18160 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18090 + zType = __ccgo_ts + 18162 } 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+18164, 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: ; @@ -114334,9 +114659,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 + 18139, + 2: __ccgo_ts + 18144, + 3: __ccgo_ts + 18152, } // C documentation @@ -114435,7 +114760,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+18171, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114478,7 +114803,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++ @@ -114523,7 +114848,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 @@ -114582,7 +114907,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+18175) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114625,7 +114950,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 @@ -114653,7 +114978,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 + 17966 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 @@ -114681,7 +115006,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 + 17956 } _returnSingleText(tls, v, zRet) break @@ -114971,7 +115296,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+18180, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -114981,7 +115306,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) } @@ -115003,7 +115328,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+18205, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -115035,8 +115360,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+18258) == 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. */ @@ -115116,9 +115442,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 + 18264 } else { - v14 = __ccgo_ts + 18200 + v14 = __ccgo_ts + 18272 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -115189,7 +115515,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+18279, 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)) @@ -115219,19 +115545,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 + 11010 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13233 + zType = __ccgo_ts + 13258 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18223 + zType = __ccgo_ts + 18295 } else { - zType = __ccgo_ts + 9247 + zType = __ccgo_ts + 9272 } } } - _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+18302, 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: ; @@ -115278,9 +115604,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+18309, 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+18314, 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 @@ -115304,11 +115630,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 + 18319, + 1: __ccgo_ts + 18321, + 2: __ccgo_ts + 16808, } - _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+18323, 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: ; @@ -115327,7 +115653,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+18329, 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: ; @@ -115344,7 +115670,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+18333, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -115394,7 +115720,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: ; @@ -115406,7 +115732,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: ; @@ -115432,7 +115758,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+18336, 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+18345)) goto _32 _32: ; @@ -115446,8 +115772,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 @@ -115573,7 +115899,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+18350, 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))) @@ -115669,7 +115995,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 @@ -115713,7 +116039,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 } @@ -115764,7 +116090,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+18354, 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) @@ -115775,7 +116101,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+18378) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -115911,7 +116237,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+18407, 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) @@ -115973,7 +116299,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))) } @@ -115995,7 +116321,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+18443, 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) @@ -116008,7 +116334,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+18463, 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) { @@ -116016,7 +116342,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+18485, 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) { @@ -116027,10 +116353,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+18508, -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+18510, 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)) } } @@ -116064,7 +116390,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+18530, 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) @@ -116088,9 +116414,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+18560) _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+18565) _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)) @@ -116103,9 +116429,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+18586) _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+18622) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -116133,9 +116459,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+18560) _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+18633) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -116163,7 +116489,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+18660) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -116260,7 +116586,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 + 18687 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -116339,7 +116665,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+18748, libc.VaList(bp+176, zRight)) } } } @@ -116444,13 +116770,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+17973) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18701) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18773) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18054) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18126) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116585,7 +116911,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 @@ -116615,7 +116941,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. @@ -116677,7 +117003,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+18781, 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)) @@ -116950,34 +117276,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18618, + FzName: __ccgo_ts + 18690, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18623, + FzName: __ccgo_ts + 18695, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18629, + FzName: __ccgo_ts + 18701, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18638, + FzName: __ccgo_ts + 18710, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18647, + FzName: __ccgo_ts + 18719, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18655, + FzName: __ccgo_ts + 18727, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18663, + FzName: __ccgo_ts + 18735, }, 7: { - FzName: __ccgo_ts + 18670, + FzName: __ccgo_ts + 18742, }, 8: {}, } @@ -117073,14 +117399,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+18799) 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+18814, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) cSep = uint8(',') goto _1 _1: @@ -117089,19 +117415,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+18821, 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+18827) 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+18839) 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 { @@ -117116,7 +117442,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 @@ -117297,7 +117623,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) } @@ -117309,13 +117635,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+18854) 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+18862, 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+18866, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -117324,7 +117650,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) @@ -117450,24 +117776,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+18900, 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(143745)) } 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+18928, 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+18959, 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(143752)) } } } @@ -117475,9 +117801,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 + 18870, + 1: __ccgo_ts + 18877, + 2: __ccgo_ts + 18889, } // C documentation @@ -117553,7 +117879,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+14698) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117586,11 +117912,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+18967) } 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+14698) } } } @@ -117629,18 +117955,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 + 9272 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 + 18980 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -117724,7 +118050,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+12309) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117750,7 +118076,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+19052) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117765,7 +118091,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+19076, 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)) @@ -118094,7 +118420,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 @@ -118123,7 +118449,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 @@ -118183,7 +118509,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+19110, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -118199,7 +118525,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+19140, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -118222,10 +118548,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 { @@ -118233,7 +118559,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) @@ -118263,7 +118589,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(144552)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -118397,7 +118723,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(144701)) } /* 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 @@ -118657,7 +118983,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) @@ -118665,7 +118991,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 @@ -118821,15 +119147,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 + 11416 + zSp2 = __ccgo_ts + 11416 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+19159, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -118886,25 +119212,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) } @@ -119036,13 +119365,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 { @@ -119120,7 +119449,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+19189, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -119170,12 +119499,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+19239, 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. @@ -119190,9 +119519,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+19303, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -119202,6 +119532,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) @@ -119236,7 +119573,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), } @@ -119284,7 +119621,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 @@ -119329,7 +119666,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) @@ -119353,7 +119690,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) @@ -119374,7 +119711,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 @@ -119497,7 +119834,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 { @@ -119624,10 +119961,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 @@ -119635,7 +119972,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 @@ -119812,7 +120149,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+19340, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -119923,8 +120260,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) @@ -119932,7 +120269,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) } @@ -120017,13 +120354,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19288 + z = __ccgo_ts + 19360 case int32(TK_INTERSECT): - z = __ccgo_ts + 19298 + z = __ccgo_ts + 19370 case int32(TK_EXCEPT): - z = __ccgo_ts + 19308 + z = __ccgo_ts + 19380 default: - z = __ccgo_ts + 19315 + z = __ccgo_ts + 19387 break } return z @@ -120044,7 +120381,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+19393, libc.VaList(bp+8, zUsage)) } /* @@ -120081,13 +120418,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 + 19416 } 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+19430, 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+19461, 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) @@ -120111,11 +120448,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 @@ -120331,7 +120668,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 + 16920 } 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)) @@ -120444,7 +120781,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 */ @@ -120453,7 +120790,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) @@ -120477,13 +120814,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 + 16920 } 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+12595, 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))) @@ -120491,7 +120828,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+19507, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120545,7 +120882,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) } @@ -120583,7 +120920,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 + 16920 } zName = v3 } else { @@ -120598,7 +120935,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+19507, 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. @@ -120634,7 +120971,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+19516, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -120753,7 +121090,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 + 19524 } else { zType = uintptr(0) j = int32(1) @@ -120819,7 +121156,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) } @@ -120847,7 +121184,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) } @@ -120897,7 +121234,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 @@ -120920,7 +121257,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 @@ -121068,7 +121405,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+19528, 0) return } /* Obtain authorization to do a recursive query */ @@ -121105,7 +121442,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 @@ -121116,7 +121453,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 @@ -121130,7 +121467,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 @@ -121161,7 +121498,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+19577, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -121176,7 +121513,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+19619, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -121204,7 +121541,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+19625, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -121259,9 +121596,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 + 19640 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19570, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19642, 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) { @@ -121369,8 +121706,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+19665, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19680, 0) } /* Generate code for the left and right SELECT statements. */ @@ -121395,7 +121732,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+19360, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121421,7 +121758,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 @@ -121447,7 +121784,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+19699, 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 @@ -121479,11 +121816,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 @@ -121505,7 +121842,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+19699, 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 @@ -121612,6 +121949,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) } @@ -121628,9 +121966,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+19720, 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+19766, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121701,7 +122039,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+19340, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -121917,7 +122255,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) @@ -121949,7 +122287,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 { @@ -122003,16 +122341,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 @@ -122030,32 +122368,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+19848, 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+19859, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -122068,7 +122406,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+19864, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -122278,11 +122616,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))) } @@ -122443,7 +122781,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 @@ -122633,9 +122971,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. @@ -122847,7 +123185,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) @@ -122994,7 +123332,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) @@ -123284,11 +123622,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 { @@ -123353,7 +123691,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 @@ -123371,12 +123709,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 { @@ -123858,7 +124196,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 @@ -123904,13 +124242,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+15759) == 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+15763) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -123998,8 +124336,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+19870, 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 @@ -124023,7 +124361,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 @@ -124105,7 +124443,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) @@ -124123,7 +124461,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+19888, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -124271,7 +124609,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) } @@ -124299,7 +124637,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+19911, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -124321,12 +124659,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+19931, 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 @@ -124343,7 +124681,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 + 19974 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 { @@ -124374,7 +124712,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+19997, 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) } @@ -124383,9 +124721,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 + 20035 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19997 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20069 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -124434,7 +124772,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) { @@ -124444,7 +124782,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+20107, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124540,7 +124878,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) @@ -124549,7 +124887,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) } @@ -124600,7 +124938,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+20111, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124615,7 +124953,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+20150, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124630,7 +124968,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+15291, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124754,7 +125092,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 } @@ -124771,7 +125109,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+20181, 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) } @@ -124850,7 +125188,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+20186, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -124863,7 +125201,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+12595, 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) @@ -124883,9 +125221,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+20195, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20141, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20213, 0) } } } @@ -124899,7 +125237,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+20233, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -125148,7 +125486,7 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint (*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))) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -125201,7 +125539,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 @@ -125238,12 +125576,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+20264, 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+20315, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -125264,7 +125602,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+20348, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -125403,7 +125741,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 @@ -125511,7 +125849,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 @@ -125578,7 +125916,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 + 20381 } else { v1 = __ccgo_ts + 1665 } @@ -125587,7 +125925,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+20404, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125619,7 +125957,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)) @@ -125748,6 +126086,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. // */ @@ -125776,7 +126115,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+16073) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -125809,9 +126148,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 */ } @@ -125821,13 +126160,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 { @@ -125847,7 +126186,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) } @@ -126020,8 +126359,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 @@ -126030,11 +126369,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 { @@ -126050,7 +126389,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)) @@ -126074,14 +126413,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+20416, 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) @@ -126182,7 +126521,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+20470, 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 @@ -126383,14 +126722,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+20510, 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) @@ -126422,7 +126761,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 @@ -126437,7 +126776,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+20525, 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 { @@ -126491,7 +126830,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 @@ -126524,7 +126863,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 @@ -126583,7 +126922,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 @@ -126612,6 +126951,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)) @@ -126634,10 +126980,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) @@ -126671,8 +127017,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 @@ -126687,8 +127033,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 @@ -126717,8 +127063,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++ } @@ -126748,11 +127094,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.Uint16FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -126786,47 +127132,47 @@ 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)) /* 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)) /* Begin a loop that will extract all source rows in GROUP BY order. @@ -126836,16 +127182,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 @@ -126863,11 +127209,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 + 20541 } else { - v46 = __ccgo_ts + 20478 + v47 = __ccgo_ts + 20550 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19321, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19393, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -126881,8 +127227,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -126900,8 +127246,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -126912,12 +127258,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) @@ -126966,12 +127312,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++ } @@ -127041,9 +127391,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 @@ -127060,10 +127410,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 */ @@ -127090,8 +127440,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 } @@ -127131,32 +127481,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) @@ -127198,7 +127548,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+20541) } /* 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 @@ -127304,7 +127654,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 } @@ -127320,7 +127670,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+20559, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -127410,7 +127760,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) } @@ -127572,7 +127922,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+20624, 0) goto trigger_cleanup } iDb = int32(1) @@ -127612,7 +127962,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+20670, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -127622,11 +127972,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+20678, 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+20719, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127635,13 +127985,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+20670, (*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+20759, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127649,8 +127999,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+20785, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127658,15 +128008,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 + 20823 } else { - v1 = __ccgo_ts + 20758 + v1 = __ccgo_ts + 20830 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20764, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20836, 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+20873, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127686,9 +128036,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 @@ -127788,7 +128138,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+20670, 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 } @@ -127810,7 +128160,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+20919, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -127826,10 +128176,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+20967, 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+21042, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -128097,11 +128447,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+21071, 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) @@ -128139,9 +128489,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) { @@ -128156,7 +128506,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+21091, 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) } @@ -128289,11 +128639,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 + 21153 } else { - v1 = __ccgo_ts + 21088 + v1 = __ccgo_ts + 21160 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21095, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21167, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -128395,7 +128745,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+21215, 0) return int32(1) } @@ -128543,12 +128893,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) { @@ -128556,19 +128906,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) @@ -128579,7 +128932,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 @@ -128593,7 +128946,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 { @@ -128661,7 +129014,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): @@ -128760,10 +129113,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+21257, 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 @@ -128785,7 +129140,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 @@ -128857,7 +129212,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)) @@ -129273,13 +129628,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 @@ -129287,21 +129642,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 */ @@ -129348,7 +129703,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 @@ -129387,7 +129742,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 } @@ -129431,58 +129786,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+21271, 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+21307, 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 { @@ -129512,17 +129855,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++ } @@ -129534,11 +129877,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 @@ -129554,11 +129897,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 @@ -129567,18 +129910,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++ } @@ -129587,16 +129930,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. */ @@ -129614,24 +129957,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 { @@ -129657,50 +130000,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) @@ -129998,8 +130341,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -130049,8 +130392,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++ @@ -130097,11 +130440,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)) } @@ -130113,11 +130456,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. */ @@ -130160,7 +130503,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+21326) } goto update_cleanup update_cleanup: @@ -130217,13 +130560,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) { @@ -130265,11 +130608,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 @@ -130594,9 +130937,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+21339, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21271, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21343, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -130685,13 +131028,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: @@ -130699,7 +131042,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+12684, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130781,7 +131124,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+21416, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21420, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -130872,7 +131215,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 @@ -130911,17 +131254,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+21424) 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+21464) 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+21507) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -130938,7 +131281,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+21556) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -130991,7 +131334,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+15061) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131022,11 +131365,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+21583, 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+21691, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131035,7 +131378,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+21745, 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 @@ -131045,7 +131388,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+21882, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -131188,7 +131531,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) @@ -131572,7 +131915,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+12914, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131695,24 +132038,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+22005, 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+22029, 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+22128, 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 @@ -131796,7 +132144,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+22147, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -131838,9 +132186,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+22189, 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) @@ -131853,7 +132201,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 + 22219 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -131887,7 +132235,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+16811, 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 @@ -131968,13 +132316,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+22265, 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))) @@ -132055,7 +132403,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+22265, 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) @@ -132103,7 +132451,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+22284, 0) return int32(SQLITE_ERROR) } goto _1 @@ -132114,9 +132462,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(158352))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158354)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -132158,7 +132506,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) } @@ -132524,7 +132872,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 } @@ -132614,7 +132962,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 } @@ -132634,7 +132982,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) } @@ -132698,7 +133046,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(158849)) } else { ap = va switch op { @@ -132711,7 +133059,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(158871)) break } _ = ap @@ -133396,7 +133744,6 @@ type TWhereInfo1 = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo1 = TWhereInfo1 @@ -133432,10 +133779,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 + 22297 } if i == -int32(1) { - return __ccgo_ts + 16848 + return __ccgo_ts + 16920 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -133454,10 +133801,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+22304, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22238, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22310, int32(1)) } i = 0 for { @@ -133465,7 +133812,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+13304, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133474,11 +133821,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+22310, int32(1)) } i = 0 for { @@ -133486,16 +133833,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+13304, 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)) } } @@ -133542,7 +133889,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+22312, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133550,12 +133897,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+22304, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22243 + v2 = __ccgo_ts + 22315 } else { - v2 = __ccgo_ts + 22248 + v2 = __ccgo_ts + 22320 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133572,7 +133919,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+22328) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133583,9 +133930,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+22330) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5199, int32(1)) } // C documentation @@ -133630,11 +133977,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 + 22332 } else { - v2 = __ccgo_ts + 22267 + v2 = __ccgo_ts + 22339 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22272, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22344, 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 { @@ -133647,37 +133994,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 + 11467 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22278 + zFmt = __ccgo_ts + 22350 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22311 + zFmt = __ccgo_ts + 22383 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22336 + zFmt = __ccgo_ts + 22408 } else { - zFmt = __ccgo_ts + 22354 + zFmt = __ccgo_ts + 22426 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22363, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22435, 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 + 16920 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22443, 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+22474, libc.VaList(bp+144, zRowid)) cRangeOp = uint8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133687,14 +134034,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+22484, 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+22489) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22439 + v3 = __ccgo_ts + 22511 } else { - v3 = __ccgo_ts + 22447 + v3 = __ccgo_ts + 22519 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -133715,7 +134062,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+22525, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133781,14 +134128,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+22536, 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+22315, 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+22557, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -133812,16 +134159,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+22304, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22243, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22315, 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 @@ -134026,7 +134373,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 @@ -134105,7 +134452,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 */ @@ -134225,7 +134572,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i 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)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(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)) } @@ -134237,7 +134584,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } else { v3 = n } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(v3))) eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } pX = pExpr @@ -134275,10 +134622,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 @@ -134467,7 +134814,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 @@ -134598,7 +134945,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 @@ -134880,7 +135227,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 @@ -134941,11 +135288,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 @@ -134976,6 +135323,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 { @@ -135114,7 +135464,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 @@ -135194,7 +135544,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 @@ -135228,7 +135578,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 @@ -135350,7 +135700,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 @@ -135543,7 +135893,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: @@ -135557,12 +135907,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 { @@ -135600,11 +135951,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 */ @@ -135624,7 +135975,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 } @@ -135660,21 +136011,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 @@ -135692,7 +136043,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, @@ -135747,7 +136098,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+22565, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135770,7 +136121,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+22580, 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)) @@ -136259,9 +136610,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 @@ -136270,7 +136621,7 @@ 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+22589, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { @@ -136316,15 +136667,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 @@ -136336,7 +136688,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) { @@ -136409,7 +136761,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) @@ -136807,19 +137159,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16697, + FzOp: __ccgo_ts + 16769, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16031, + FzOp: __ccgo_ts + 16103, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15510, + FzOp: __ccgo_ts + 15562, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22531, + FzOp: __ccgo_ts + 22603, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -137607,7 +137959,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+22610, 0) return } } else { @@ -137619,10 +137971,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+22610, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137703,7 +138055,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) @@ -137804,7 +138156,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 + 22651 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -138335,7 +138687,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+22658, 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) @@ -138407,7 +138759,6 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo @@ -138418,7 +138769,6 @@ type THiddenIndexInfo1 = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo1 = THiddenIndexInfo1 @@ -139451,7 +139801,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)<>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 @@ -142068,7 +142414,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { + })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0)) { if libc.Int32FromUint16((*(*struct { FnEq Tu16 FnBtm Tu16 @@ -142272,7 +142618,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 @@ -142556,7 +142902,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) } } @@ -142734,7 +143080,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)) @@ -143075,7 +143421,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+22731, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143150,7 +143496,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+22731, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143304,7 +143650,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(168893)) /* 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) @@ -143740,7 +144086,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+22757, 0) rc = SQLITE_OK } else { break @@ -144948,7 +145294,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+22792, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145526,7 +145872,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 @@ -145682,7 +146028,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+22810, 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 @@ -145703,11 +146049,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) @@ -145755,7 +146098,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+22838, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -145900,7 +146243,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 @@ -145934,7 +146278,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. @@ -146060,7 +146404,7 @@ 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 @@ -146091,16 +146435,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 @@ -146279,7 +146623,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 { @@ -146486,7 +146830,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 @@ -146496,7 +146840,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+22856, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146546,7 +146890,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 } @@ -146815,7 +147159,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+22885, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -146997,7 +147341,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+22941, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -147323,7 +147667,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+22986, libc.VaList(bp+8, zName)) } return p } @@ -147374,12 +147718,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+23005, 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+23076, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -147452,7 +147796,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 } @@ -147590,7 +147934,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( 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 { @@ -147734,7 +148078,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+23139, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147770,7 +148114,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)) } @@ -147785,7 +148129,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 @@ -147804,11 +148148,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 { @@ -147854,11 +148198,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 @@ -147875,7 +148219,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)) @@ -147897,7 +148241,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 @@ -148021,7 +148365,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+23165, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -148089,18 +148433,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 + 23197 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23142 + zErr = __ccgo_ts + 23214 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23158 + zErr = __ccgo_ts + 23230 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23178, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23250, 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 { @@ -148124,7 +148468,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+23283, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -148230,24 +148574,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 @@ -148265,12 +148609,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) } @@ -148282,15 +148626,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 @@ -148342,11 +148686,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 + 23330, + 1: __ccgo_ts + 23383, + 2: __ccgo_ts + 22885, + 3: __ccgo_ts + 23434, + 4: __ccgo_ts + 23486, } var _aOp1 = [5]int32{ @@ -148926,7 +149270,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 } @@ -149022,7 +149366,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 '' */ @@ -149739,12 +150083,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 @@ -149752,13 +150096,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 @@ -149778,13 +150122,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 @@ -149811,7 +150155,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 @@ -150030,6 +150374,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. @@ -150090,7 +150438,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+23536, libc.VaList(bp+8, p)) } // C documentation @@ -150104,6 +150452,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) } @@ -150137,11 +150486,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 + 23560 } else { - v1 = __ccgo_ts + 23497 + v1 = __ccgo_ts + 23569 } - _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+23575, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -150150,7 +150499,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+23617, 0) } } } @@ -150256,7 +150605,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+23651, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -156777,13 +157126,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) } @@ -158713,20 +159062,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+16920, 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+23689, 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+16856, 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+23689, 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 @@ -158767,7 +159116,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 */ @@ -158912,7 +159266,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 */ @@ -159002,9 +159361,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) } @@ -159359,7 +159718,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+23716) 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) { @@ -159709,9 +160068,9 @@ _237: */ _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 + v347 = __ccgo_ts + 8100 } else { - v347 = __ccgo_ts + 8080 + v347 = __ccgo_ts + 8105 } *(*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 { @@ -159953,15 +160312,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+23725, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23748, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23820, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23832, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23904, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -160103,7 +160462,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 */ @@ -160297,7 +160656,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+23989, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -163028,14 +163387,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)< int32(65528) { sz = int32(65528) } - if cnt < 0 { + /* 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 > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } szAlloc = int64(sz) * int64(cnt) - if sz == 0 || cnt == 0 { + 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)) @@ -164509,7 +164877,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182779)) + return _sqlite3MisuseError(tls, int32(183820)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164529,7 +164897,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+24076, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -164830,14 +165198,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 + 24619 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -164849,31 +165217,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 + 24144, + 1: __ccgo_ts + 24157, + 3: __ccgo_ts + 24173, + 4: __ccgo_ts + 24198, + 5: __ccgo_ts + 24212, + 6: __ccgo_ts + 24231, 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 + 24256, + 9: __ccgo_ts + 24293, + 10: __ccgo_ts + 24305, + 11: __ccgo_ts + 24320, + 12: __ccgo_ts + 24353, + 13: __ccgo_ts + 24371, + 14: __ccgo_ts + 24396, + 15: __ccgo_ts + 24425, + 17: __ccgo_ts + 6128, + 18: __ccgo_ts + 5532, + 19: __ccgo_ts + 24442, + 20: __ccgo_ts + 24460, + 21: __ccgo_ts + 24478, + 23: __ccgo_ts + 24512, + 25: __ccgo_ts + 24533, + 26: __ccgo_ts + 24559, + 27: __ccgo_ts + 24582, + 28: __ccgo_ts + 24603, } // C documentation @@ -165020,6 +165388,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 // // /* @@ -165052,7 +165434,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i 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(183430)) + return _sqlite3MisuseError(tls, int32(184509)) } 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) @@ -165095,7 +165477,7 @@ 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+24700, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165221,7 +165603,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+24763, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -165252,7 +165634,7 @@ 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) } @@ -165496,7 +165878,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(184046)) + return _sqlite3MisuseError(tls, int32(185125)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*uint8)(unsafe.Pointer(zDb)) != 0 { @@ -165506,7 +165888,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+24814, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165628,7 +166010,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(184182))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185261))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165760,7 +166142,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(184261)) + return _sqlite3MisuseError(tls, int32(185340)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165770,7 +166152,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(184270)) + return _sqlite3MisuseError(tls, int32(185349)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165819,7 +166201,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(184318)) + return _sqlite3MisuseError(tls, int32(185397)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -165828,7 +166210,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+24835, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165975,7 +166357,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+24903, 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 @@ -166005,8 +166387,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+24909, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24919, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -166095,24 +166477,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+24947, 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+24951, 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 + 24951 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24900, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24972, 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 @@ -166141,12 +166523,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+24987, 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+25007, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -166170,7 +166552,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+25031, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -166190,11 +166572,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24885, + Fz: __ccgo_ts + 24957, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24892, + Fz: __ccgo_ts + 24964, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -166205,19 +166587,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24905, + Fz: __ccgo_ts + 24977, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24908, + Fz: __ccgo_ts + 24980, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24911, + Fz: __ccgo_ts + 24983, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17918, + Fz: __ccgo_ts + 17990, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -166345,8 +166727,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+22651, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25047, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -166367,10 +166749,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(184993)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186072)) /* 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) } @@ -166379,7 +166761,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) } @@ -166406,9 +166788,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 + 24049 (*(*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 { @@ -166502,7 +166884,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 + 25053 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166662,7 +167044,7 @@ 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) @@ -166719,20 +167101,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+25056, 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+25081) } 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+25101) } 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+25108) } // C documentation @@ -166757,9 +167139,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) @@ -166786,29 +167168,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 @@ -166863,15 +167234,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+25125, 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) @@ -167050,8 +167421,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 @@ -167495,7 +167866,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: ; @@ -167891,7 +168262,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+25153, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -168109,7 +168480,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 + 25161 } else { v2 = uintptr(0) } @@ -168188,7 +168559,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) @@ -168355,7 +168726,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 @@ -168572,6 +168943,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -168884,8 +169262,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 @@ -168942,7 +169320,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 @@ -168952,7 +169330,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 @@ -168990,18 +169368,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 + 25184, + 12: __ccgo_ts + 25190, 13: __ccgo_ts + 1665, 14: __ccgo_ts + 1665, 15: __ccgo_ts + 1665, @@ -169488,7 +169866,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) { @@ -169786,8 +170164,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) } } @@ -169923,7 +170301,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+15505, 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)) @@ -169937,14 +170315,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+25197, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -169998,7 +170374,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+25226, -int32(1)) } } } @@ -170281,8 +170657,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 + 25241, + FzRepl: __ccgo_ts + 25245, }, 1: { Fc1: uint8('i'), @@ -170290,8 +170666,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 + 25253, + FzRepl: __ccgo_ts + 25245, }, 2: { Fc1: uint8('n'), @@ -170306,7 +170682,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: uint8('Q'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25207, + FzMatch: __ccgo_ts + 25262, FzRepl: __ccgo_ts + 1651, }, 4: { @@ -170314,7 +170690,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: uint8('S'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25212, + FzMatch: __ccgo_ts + 25267, FzRepl: __ccgo_ts + 1651, }, } @@ -170330,7 +170706,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+25272, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -170348,23 +170724,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 } @@ -170442,7 +170818,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 @@ -170513,7 +170889,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) + } } } } @@ -170788,7 +171168,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+25315, 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') { @@ -171218,7 +171598,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 { @@ -171257,7 +171637,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)) } @@ -171265,7 +171645,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)) } @@ -171342,14 +171722,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+25241, 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+25324) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25276) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25331) } - 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+25337, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171534,7 +171914,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+25331) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171579,7 +171959,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+25226, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171592,7 +171972,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+25226, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171641,10 +172021,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) @@ -171678,15 +172054,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 @@ -171759,11 +172135,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: ; @@ -171812,9 +172188,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25190 + v19 = __ccgo_ts + 25245 } else { - v19 = __ccgo_ts + 11942 + v19 = __ccgo_ts + 11967 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -171850,9 +172226,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: ; @@ -171879,7 +172258,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+25343, uint32(2)) zIn2++ sz2-- continue @@ -171902,7 +172281,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, uint8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25291, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25346, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -171910,12 +172289,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25298, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25353, 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+25358, uint32(6)) case int32('\r'): if sz2 > uint32(2) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -172095,7 +172474,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+25365, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172118,12 +172497,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+25368, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25310, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25365, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172138,50 +172517,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 // // /* @@ -172233,6 +172568,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 // // /* @@ -172253,6 +172666,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)) @@ -172325,9 +172741,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 @@ -172370,7 +172786,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 @@ -172858,7 +173285,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+25226, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -172993,7 +173420,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 } @@ -173094,7 +173521,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+25226, -int32(1)) return } @@ -173131,11 +173558,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+25197, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -173148,7 +173572,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+25226, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -173167,10 +173591,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+25331) } 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+25324) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -173209,7 +173633,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+25371, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -173225,7 +173649,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. // ** @@ -173306,7 +173730,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+25226, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -173318,34 +173742,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; +// ** 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. +// ** 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) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { + 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 (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) - return 0 + 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 (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - 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 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) @@ -173428,7 +173872,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 @@ -173488,7 +173932,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+25226, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173623,7 +174067,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 + 25389 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173633,7 +174077,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+25226, -int32(1)) } } eErr = uint8(1) @@ -173743,23 +174187,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+25391, uint32(1)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25338, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25393, 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+25395, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25343, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25398, uint32(1)) } } } @@ -173799,7 +174243,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+25226, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -174067,7 +174511,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+25226, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -174091,7 +174535,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+25400, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -174102,7 +174546,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+25451, -int32(1)) _jsonStringReset(tls, bp) return } @@ -174174,7 +174618,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+25226, -int32(1)) } } goto json_remove_done @@ -174211,7 +174655,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+16025) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -174242,9 +174686,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 + 25485 } else { - v1 = __ccgo_ts + 25434 + v1 = __ccgo_ts + 25489 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -174292,7 +174736,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+25226, -int32(1)) } } goto json_type_done @@ -174339,7 +174783,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 + 25496 (*(*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)) @@ -174413,17 +174857,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+25501, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -174432,18 +174875,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 @@ -174505,9 +174947,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))) @@ -174614,7 +175054,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+25558, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174706,20 +175146,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))) + } } } @@ -174763,7 +175205,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+25561, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174866,7 +175308,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+25564) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -175000,7 +175442,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+25647, 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 @@ -175026,9 +175468,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+25654, 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+25662, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -175339,9 +175781,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))) @@ -175414,7 +175855,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+25668, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -175438,7 +175879,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+25226, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175499,186 +175940,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 + 25670, }, 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 + 25675, }, 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 + 25681, }, 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 + 25692, }, 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 + 25704, }, 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 + 25704, }, 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 + 25722, }, 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 + 25742, }, 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 + 25755, }, 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 + 25769, }, 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 + 25772, }, 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 + 25776, }, 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 + 25788, }, 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 + 25801, }, 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 + 25813, }, 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 + 25826, }, 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 + 25837, }, 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 + 25849, }, 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 + 25849, }, 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 + 25861, }, 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 + 25872, }, 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 + 25884, }, 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 + 25897, }, 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 + 25910, }, 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 + 25924, }, 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 + 25933, }, 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 + 25943, }, 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 + 25943, }, 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 + 25953, }, 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 + 25953, }, 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 + 25964, }, 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 + 25981, }, 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 + 25999, }, 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 + 26017, }, } @@ -175761,17 +176202,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25981, + FzName: __ccgo_ts + 26036, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25991, + FzName: __ccgo_ts + 26046, 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 @@ -175879,7 +176322,6 @@ type TRtreeMatchArg = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - FaParam [1]TRtreeDValue } type RtreeMatchArg = TRtreeMatchArg @@ -176162,11 +176604,12 @@ type TRtreeMatchArg1 = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - 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 ** clang, since clang works hard to be gcc compatible. So the gcc @@ -176349,7 +176792,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 @@ -176412,7 +176855,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+26056, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -176423,7 +176866,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 { @@ -176717,7 +177160,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+26061, 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 { @@ -177259,7 +177702,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) } @@ -177639,7 +178082,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+26143) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177717,7 +178160,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) @@ -177956,7 +178399,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 @@ -178616,7 +179059,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 @@ -179174,7 +179617,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+26157, 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 { @@ -179184,11 +179627,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+26177, 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+26209, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -179402,7 +179845,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+26246, 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)) @@ -179456,9 +179899,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 + 26391 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+11796, 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) { @@ -179516,9 +179959,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 + 26447, + 1: __ccgo_ts + 5593, + 2: __ccgo_ts + 16920, } var _rtreeModule = Tsqlite3_module{ @@ -179562,21 +180005,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+26861, 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+26923, 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+26928, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26992, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27062, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179606,7 +180049,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 + 27111 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179621,31 +180064,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+27219, 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+27264, 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+13304, 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+27291, 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+27313, 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+27321, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179659,14 +180102,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 + 26452, + 1: __ccgo_ts + 26505, + 2: __ccgo_ts + 26550, + 3: __ccgo_ts + 26602, + 4: __ccgo_ts + 26656, + 5: __ccgo_ts + 26701, + 6: __ccgo_ts + 26759, + 7: __ccgo_ts + 26814, } // C documentation @@ -179724,7 +180167,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+27337, 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) @@ -179732,17 +180175,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+27357, 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))) @@ -179805,7 +180248,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) } @@ -179819,13 +180262,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+27600, 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+27606, 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) { @@ -179834,7 +180277,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+27630, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -179848,19 +180291,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+27657, 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))) } } } @@ -179883,7 +180326,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)) @@ -179894,7 +180337,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 @@ -179910,8 +180353,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27581, - 1: __ccgo_ts + 27592, + 0: __ccgo_ts + 27636, + 1: __ccgo_ts + 27647, } // C documentation @@ -179969,21 +180412,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+11416, 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+27660, 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+27666, 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+27670, int32(1)) goto _1 _1: ; @@ -180010,7 +180453,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+27672, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -180113,7 +180556,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) @@ -180128,11 +180571,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+27705, 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) } @@ -180166,7 +180609,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+27712, 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) @@ -180183,7 +180626,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+27757, libc.VaList(bp+8, iNode)) } } return pRet @@ -180212,8 +180655,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 + 27789, + 1: __ccgo_ts + 27843, } 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)) @@ -180226,21 +180669,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 + 27891 } else { - v1 = __ccgo_ts + 27844 + v1 = __ccgo_ts + 27899 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27853, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27908, 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 + 27891 } else { - v2 = __ccgo_ts + 27844 + v2 = __ccgo_ts + 27899 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27898, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27953, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -180285,7 +180728,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+28011, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -180303,7 +180746,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+28059, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -180336,19 +180779,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+28126, 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+28160, 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+28190, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -180393,12 +180836,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+28245, 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+28276, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -180427,7 +180870,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+28343, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -180437,11 +180880,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+26157, 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+28371, 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)) @@ -180457,8 +180900,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+28402, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28409, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -180485,7 +180928,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+28417, 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) } @@ -180536,13 +180979,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+28436, -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))) } @@ -180551,7 +180994,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 + 18687 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -180818,7 +181261,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++ @@ -180863,7 +181306,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 @@ -180925,7 +181368,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 @@ -181395,7 +181838,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 { @@ -181536,7 +181979,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 // ** @@ -181679,7 +182122,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 @@ -182204,7 +182647,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 @@ -182216,13 +182659,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+27600, 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+28560, 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) @@ -182231,13 +182674,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+28582, 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+27657, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -182245,7 +182688,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) @@ -182260,7 +182703,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 @@ -182472,7 +182915,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 + 16920 (*(*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) @@ -182482,7 +182925,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 + 28586 (*(*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) @@ -182490,7 +182933,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 + 28592 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182610,7 +183053,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+28601, 0) } goto geopoly_update_end } @@ -182713,12 +183156,12 @@ geopoly_update_end: func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28586) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28641) == 0 { *(*uintptr)(unsafe.Pointer(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 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28657) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) @@ -182789,7 +183232,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+28834, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -182803,61 +183246,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28617, + FzName: __ccgo_ts + 28672, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28630, + FzName: __ccgo_ts + 28685, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28643, + FzName: __ccgo_ts + 28698, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28656, + FzName: __ccgo_ts + 28711, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28602, + FzName: __ccgo_ts + 28657, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28668, + FzName: __ccgo_ts + 28723, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28586, + FzName: __ccgo_ts + 28641, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28691, + FzName: __ccgo_ts + 28746, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28705, + FzName: __ccgo_ts + 28760, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28718, + FzName: __ccgo_ts + 28773, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28732, + FzName: __ccgo_ts + 28787, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28748, + FzName: __ccgo_ts + 28803, }, } @@ -182883,7 +183326,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28760, + FzName: __ccgo_ts + 28815, }, } @@ -182908,20 +183351,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+28842, 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+28852, 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+28863, -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+28586, 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+28874, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -182995,7 +183438,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) @@ -183023,7 +183466,7 @@ 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+26143, __ccgo_fp(_rtreeMatchArgFree)) } } } @@ -183264,7 +183707,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 @@ -184240,7 +184683,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+28884, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -184250,7 +184693,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+28884, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -184276,7 +184719,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 @@ -184299,7 +184742,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 } @@ -184431,7 +184874,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+28905, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184520,7 +184963,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+26056, 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')) { @@ -184557,13 +185000,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 + 29076 } 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+29117, 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+29267) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184730,7 +185173,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))) } } @@ -184791,7 +185234,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+29392, 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 @@ -184801,7 +185244,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+29511, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -184809,7 +185252,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+29532, 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) @@ -184821,7 +185264,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+29583, 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 { @@ -184865,7 +185308,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+29604, 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))) { @@ -184878,7 +185321,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+29632, 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 { @@ -184931,7 +185374,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+20195, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -184942,7 +185385,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+29661, 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) @@ -184953,7 +185396,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+29680, 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 @@ -184961,7 +185404,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+29685, zName) { bRbuRowid = int32(1) } } @@ -184975,17 +185418,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 + 29695 } else { - v4 = __ccgo_ts + 29653 + v4 = __ccgo_ts + 29708 } - (*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+29717, 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+29746, 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)) @@ -185007,7 +185450,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+29768, 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)) @@ -185053,8 +185496,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+29795, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15172 goto _1 _1: ; @@ -185088,7 +185531,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+29804, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -185136,21 +185579,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+29817, 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+29849, 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+15172, __ccgo_ts+29872) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29878, __ccgo_ts+29885, __ccgo_ts+5199) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15172, __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+29893, 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+29935, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -185202,7 +185645,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+29632, 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)) @@ -185224,15 +185667,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 + 29955 } } 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+29963, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29984, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30020, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15172 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -185241,7 +185684,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+30047, 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 @@ -185258,15 +185701,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+30095, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15172 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+30102, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -185324,7 +185767,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+29632, 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)) @@ -185333,7 +185776,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+30114, 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 { @@ -185353,9 +185796,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 + 29955 } else { - zCol = __ccgo_ts + 29630 + zCol = __ccgo_ts + 29685 } } zType = __ccgo_ts + 1139 @@ -185363,24 +185806,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+30136, 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 + 29872 } 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+30156, 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+30177, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30210, 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 + 15172 + zAnd = __ccgo_ts + 22304 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185434,11 +185877,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+30234, 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+30246, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15147 + zS = __ccgo_ts + 15172 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -185450,7 +185893,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+30255, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -185476,7 +185919,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+30270, 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 @@ -185486,15 +185929,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+30284, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22304 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30241, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30296, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1665 i1 = 0 @@ -185504,8 +185947,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+30346, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22304 } goto _2 _2: @@ -185528,7 +185971,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+30359, 0) } // C documentation @@ -185570,16 +186013,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+30346, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15172 } 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+30385, 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 + 15172 } 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+30415, 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 + 15172 } } } @@ -185663,16 +186106,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 + 30452 *(*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+29604, 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+16808) == 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+29632, libc.VaList(bp+24, zIdx))) } break } @@ -185683,16 +186126,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 + 29872 } 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+30465, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15172 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30421, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30476, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -185738,7 +186181,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+30480) 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))) { @@ -185746,7 +186189,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+29632, 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))) { @@ -185755,21 +186198,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+30530, 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 + 29872 } 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+30552, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15172 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30507, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30562, 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+30577, 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)) } } @@ -185806,7 +186249,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) { @@ -185815,19 +186258,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 + 30639 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30597 + v2 = __ccgo_ts + 30652 } 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+30662, 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 + 15172 goto _1 _1: ; @@ -185836,17 +186279,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+30689, 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 + 30696 } 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+30711, 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)) } } @@ -185872,7 +186315,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+30743, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -185918,7 +186361,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+30800) } 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)) @@ -186087,7 +186530,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+30866, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -186104,18 +186547,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+30886, 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+30951, 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+30987, 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 { @@ -186130,26 +186573,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 + 31021 } else { - v2 = __ccgo_ts + 30970 + v2 = __ccgo_ts + 31025 } 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+31031, 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+31092, 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 + 31021 } else { - v3 = __ccgo_ts + 30970 + v3 = __ccgo_ts + 31025 } - 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+31153, 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 { @@ -186168,8 +186611,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). */ @@ -186178,39 +186621,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 + 31312 } 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 + 31321 } 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+31331, 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+31367, 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 + 31395 } /* 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 + 31407 } 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+31424, 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+31500, 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+31799, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -186221,9 +186664,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 + 31898 } else { - v7 = __ccgo_ts + 31853 + v7 = __ccgo_ts + 31908 } zRbuRowid1 = v7 } @@ -186236,14 +186679,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+29955, 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+15172, __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 + 31919 } else { v8 = __ccgo_ts + 1665 } @@ -186253,11 +186696,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 + 23560 } 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+31925, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -186345,9 +186788,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 + 31312 } - 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+31973, 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 } @@ -186374,7 +186817,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) } @@ -186421,7 +186864,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+32003, 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): @@ -186480,27 +186923,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+32033, 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+32061, 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+32079, 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 } @@ -186533,10 +186976,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+32145, 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+24903, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*uint8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186552,14 +186995,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 + 32177 } 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+32179, 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 @@ -186570,27 +187013,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+32211, -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+32226, 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+32243, -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+32259, 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+32287, 0) } } @@ -186676,7 +187119,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { if pState == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32204, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32259, uintptr(0), uintptr(0), uintptr(0)) } } /* Assuming no error has occurred, run a "restart" checkpoint with the @@ -186709,7 +187152,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CAPTURE) - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32250, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32305, uintptr(0), uintptr(0), uintptr(0)) if rc2 != int32(SQLITE_NOTICE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -186772,7 +187215,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) } @@ -186842,16 +187285,16 @@ 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) + 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_methods1)(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) } - 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)) @@ -186873,7 +187316,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+32340, 0) } // C documentation @@ -186890,13 +187333,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+32365, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32372, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -187028,7 +187471,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+24460, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -187164,7 +187607,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+32379) 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 @@ -187177,7 +187620,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+32401, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -187204,7 +187647,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+32428, 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))) @@ -187240,9 +187683,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+32588, 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+32603, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -187265,9 +187708,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+32623, 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+32648) } 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) @@ -187278,10 +187721,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+32756) } 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+32821) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -187299,7 +187742,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+32865, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -187326,8 +187769,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+17893) + _rbuCopyPragma(tls, p, __ccgo_ts+17004) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -187335,7 +187778,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+32890, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -187357,10 +187800,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+15076, 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+15076, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -187447,7 +187890,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+32918, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -187470,10 +187913,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+32365, 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) } @@ -187495,7 +187938,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+32943, 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) @@ -187542,7 +187985,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+32954, 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 { @@ -187587,11 +188030,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+33026, 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+33040) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187600,7 +188043,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+33097) 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) @@ -187648,7 +188091,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 @@ -187680,7 +188123,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+33171, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187702,17 +188145,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 + 33203 } else { - v3 = __ccgo_ts + 33155 + v3 = __ccgo_ts + 33210 } - (*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+33217, 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+15061, 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) @@ -187724,21 +188167,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+17607) + _rbuCopyPragma(tls, p, __ccgo_ts+17019) } /* 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+33249, 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+33265, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -187816,7 +188259,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+33289, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -187863,7 +188306,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+31312, 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++ @@ -187891,7 +188334,7 @@ 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+15076, 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) { @@ -187900,7 +188343,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { } _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+15076, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -187910,7 +188353,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+33297, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -188011,7 +188454,7 @@ 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+15076, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ @@ -188024,19 +188467,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { 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+15076, 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 + 15061 } else { - v1 = __ccgo_ts + 33194 + v1 = __ccgo_ts + 33249 } 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+33249, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -188522,7 +188965,7 @@ func _rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileSize})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, pSize) /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existence of a *-wal file. rbuVfsRead() contains ** similar logic. */ if rc == SQLITE_OK && *(*Tsqlite_int64)(unsafe.Pointer(pSize)) == 0 && (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpRbu)).FzTarget == uintptr(0) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_MAIN_DB) != 0 { *(*Tsqlite_int64)(unsafe.Pointer(pSize)) = int64(1024) @@ -188603,7 +189046,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xControl})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, int32(SQLITE_FCNTL_ZIPVFS), bp) if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33269, 0) + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33324, 0) } else { if rc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p @@ -188629,7 +189072,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r if rc == SQLITE_OK && op == int32(SQLITE_FCNTL_VFSNAME) { pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs zIn = *(*uintptr)(unsafe.Pointer(pArg)) - zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33292, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33347, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -188824,7 +189267,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag if pDb != 0 { if (*Trbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == int32(RBU_STAGE_OAL) { if (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) { - zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6713) + zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6738) zOpen = Xsqlite3_filename_wal(tls, zOpen) } nOpen = libc.Xstrlen(tls, zOpen) @@ -188838,7 +189281,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag } else { (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu } - if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33303, 0) != 0 { + if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33358, 0) != 0 { oflags = libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) } @@ -189394,7 +189837,7 @@ func _statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint _sqlite3TokenInit(tls, bp, *(*uintptr)(unsafe.Pointer(argv + 3*8))) iDb = _sqlite3FindDb(tls, db, bp) if iDb < 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12380, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12405, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) return int32(SQLITE_ERROR) } } else { @@ -189706,7 +190149,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { _sqlite3BtreeEnter(tls, pBt) nUsable = szPage - _sqlite3BtreeGetReserveNoMutex(tls, pBt) _sqlite3BtreeLeave(tls, pBt) - (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32)) + (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32))) if (*TStatPage)(unsafe.Pointer(p)).FaCell == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -189753,7 +190196,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } (*TStatCell)(unsafe.Pointer(pCell)).FnLastOvfl = libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp)) - libc.Uint32FromInt32(nLocal) - libc.Uint32FromInt32((nOvfl-int32(1))*(nUsable-int32(4)))) (*TStatCell)(unsafe.Pointer(pCell)).FnOvfl = nOvfl - (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(4)*libc.Uint64FromInt32(nOvfl)) + (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(uint64(4)*libc.Uint64FromInt32(nOvfl))) if (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -189894,7 +190337,7 @@ statNextRestart: (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiPgno = iRoot (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33314, 0) + v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33369, 0) z = v1 (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FzPath = v1 if z == uintptr(0) { @@ -189932,8 +190375,8 @@ statNextRestart: if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { (*TStatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33316 - v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33325, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33371 + v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33380, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) z = v2 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v2 if z == uintptr(0) { @@ -189962,7 +190405,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage++ if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226029)) + return _sqlite3CorruptError(tls, int32(227304)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -189973,7 +190416,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+33392, 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) { @@ -189996,13 +190439,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 + 33400 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 + 33409 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33359 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33414 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -190011,7 +190454,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) { @@ -190100,12 +190543,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+33424, 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+33579, 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+33593, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -190182,7 +190625,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+33608, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -191383,7 +191826,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) { @@ -191476,11 +191919,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+11796, 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+33615, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1665, 0) @@ -191489,7 +191932,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+33745, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191515,10 +191958,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+29955))) 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) @@ -191539,8 +191982,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+29955) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29955, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191604,7 +192047,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 @@ -191621,6 +192064,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 { @@ -191642,12 +192087,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+11796, (*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))) } } } @@ -191937,10 +192382,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 + 11416 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33720, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33775, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -191952,8 +192397,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 + 15172 goto _1 _1: ; @@ -192607,8 +193052,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+33782, 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 + 22304 if zRet == uintptr(0) { break } @@ -192637,8 +193082,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+33816, 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 + 33857 if zRet == uintptr(0) { break } @@ -192649,7 +193094,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 } @@ -192660,12 +193105,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 + 33862 } 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+33873, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192726,11 +193171,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15147 + v2 = __ccgo_ts + 15172 } 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+33952, 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 } @@ -192758,7 +193203,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+33971, 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 { @@ -192787,17 +193232,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)) @@ -192810,7 +193256,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 } @@ -192821,18 +193269,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+34028, 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+34059, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -192858,7 +193332,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+34080, 0) } rc = int32(SQLITE_SCHEMA) } @@ -192906,7 +193380,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) } @@ -193190,7 +193664,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) } @@ -193490,12 +193964,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+34107, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11796, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34111, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34135, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34144, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34189, bp) } else { i = 0 for { @@ -193503,17 +193977,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+15172, 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 + 15172 _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+34203, 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+34207, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -193527,7 +194001,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+34234, 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) } @@ -193669,7 +194143,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, 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+34276, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193775,7 +194249,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } } 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+34296, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -194030,13 +194504,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 } } @@ -194192,7 +194667,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(230285)) + rc = _sqlite3CorruptError(tls, int32(231591)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -194216,7 +194691,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(230305)) + rc = _sqlite3CorruptError(tls, int32(231611)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -194231,7 +194706,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(230315)) + rc = _sqlite3CorruptError(tls, int32(231621)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -194287,7 +194762,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(230363)) + rc = _sqlite3CorruptError(tls, int32(231669)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -194392,7 +194867,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(230451)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231757)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -194463,8 +194938,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) @@ -194498,7 +194973,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(230537)) + v7 = _sqlite3CorruptError(tls, int32(231843)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194508,7 +194983,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(230543)) + v10 = _sqlite3CorruptError(tls, int32(231849)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194587,7 +195062,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(230587)) + v16 = _sqlite3CorruptError(tls, int32(231893)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -194925,7 +195400,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 @@ -194997,7 +195472,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230952)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232258)) goto finished_invert } if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { @@ -195200,7 +195675,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+11796) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -195209,9 +195684,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+34314, 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+34327, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -195221,9 +195696,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+34333, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15147 + zSep = __ccgo_ts + 15172 } goto _2 _2: @@ -195232,7 +195707,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+34338, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -195241,13 +195716,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+34346, 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+34421, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22232 + zSep = __ccgo_ts + 22304 } goto _3 _3: @@ -195334,9 +195809,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+34427, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34231, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34338, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -195346,9 +195821,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+34333, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22232 + zSep = __ccgo_ts + 22304 } goto _1 _1: @@ -195356,9 +195831,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+34445, 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+33857, bp) zSep = __ccgo_ts + 1665 i = 0 for { @@ -195368,16 +195843,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+34421, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34346 + zSep = __ccgo_ts + 34453 } 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)) @@ -195403,7 +195878,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 @@ -195426,16 +195901,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+34458, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22238, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22310, 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+15172, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -195443,19 +195918,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+34476, 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+34487, 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)) } @@ -195478,12 +195953,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+11796, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34384) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34491) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34497) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34604) } return rc } @@ -195549,7 +196024,7 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231434)) + rc = _sqlite3CorruptError(tls, int32(232740)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -195965,7 +196440,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+34748, 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)) @@ -195978,7 +196453,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+34769, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -196078,10 +196553,10 @@ 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+34788, 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+34814, 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)) @@ -196112,7 +196587,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui ** 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)))) 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 @@ -196122,7 +196597,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 } @@ -196141,18 +196616,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+34844, 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+34888, 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+34959, 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+11796) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -196209,17 +196684,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34912, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35019, 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+35049, 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+35073, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35049, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -196333,7 +196808,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) } @@ -196703,7 +197178,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) } @@ -196995,7 +197470,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 { @@ -197031,11 +197506,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 @@ -197620,6 +198101,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 @@ -197665,8 +198147,7 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset @@ -197678,12 +198159,13 @@ type Fts5Colset = TFts5Colset ** This object is used by fts5_expr.c and fts5_index.c. */ type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 + FnCol 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 ** to parse the arguments passed to the CREATE VIRTUAL TABLE statement. @@ -198060,7 +198542,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -198088,16 +198569,14 @@ 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 @@ -198139,7 +198618,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 @@ -198943,7 +199422,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+35101, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -199299,7 +199778,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+35129, 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 */ } @@ -199597,7 +200076,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+35160, 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) } @@ -199696,7 +200175,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 + 35167 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199784,7 +200263,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) } @@ -199951,7 +200430,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 + 35217 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200222,7 +200701,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))) @@ -200346,13 +200825,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 + 35265 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 + 35321 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -200385,19 +200864,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35272, + FzFunc: __ccgo_ts + 35379, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35280, + FzFunc: __ccgo_ts + 35387, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35290, + FzFunc: __ccgo_ts + 35397, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35295, + FzFunc: __ccgo_ts + 35402, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200785,7 +201264,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 @@ -201261,7 +201740,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+35418, 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) { @@ -201287,12 +201766,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+35425, 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+35456, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201301,7 +201780,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+35489, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201311,14 +201790,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+35526, 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+35535, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -201345,7 +201824,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+35568, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -201357,76 +201836,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+35602, 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+35610, 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+35642, 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+35648, 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+35667, 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+35710, 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+35667, 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+35732, 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+35746, 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+35784, 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+35795, 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+35830, 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+35837, 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 + 17973, }, 2: { - FzName: __ccgo_ts + 35761, + FzName: __ccgo_ts + 35868, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -201434,20 +201913,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+35876, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35800, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35907, 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+35917, 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+35951, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201508,16 +201987,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+35979) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16920) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35984, 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+36014) { *(*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+36024, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201543,7 +202022,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+36055, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201551,12 +202030,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+36060, 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+36067, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35968, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36075, 0) } } goto _1 @@ -201572,9 +202051,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+36082, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35968, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36075, 0) } goto _2 _2: @@ -201637,8 +202116,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+35979) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36090, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201669,7 +202148,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+36119, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -201699,7 +202178,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+36139, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201707,37 +202186,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+36189, 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+36244, 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 + 35602 } 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 + 35602 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36190 + zTail = __ccgo_ts + 36297 } } } 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+36305, 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+16920, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201806,7 +202285,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+36316, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -201815,16 +202294,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 + 15172 } 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+36332, 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+36339, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35979)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -201982,7 +202461,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+36365) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -201993,7 +202472,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+36370) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -202004,7 +202483,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+36379) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -202018,7 +202497,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+36389) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -202029,7 +202508,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+36399) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -202046,7 +202525,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+36411) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -202061,7 +202540,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+35979) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -202076,7 +202555,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+36423) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -202092,7 +202571,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+36437) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -202135,7 +202614,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 + 36447 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -202155,7 +202634,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+36479) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -202166,7 +202645,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+36487, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -202270,11 +202749,12 @@ type TFts5ExprNode1 = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode1 = TFts5ExprNode1 +/* Size (in bytes) of an Fts5ExprNode object that holds up to N children */ + /* ** 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. @@ -202304,24 +202784,26 @@ type TFts5ExprPhrase1 = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase1 = TFts5ExprPhrase1 +/* Size (in bytes) of an Fts5ExprPhrase object that holds up to N terms */ + /* ** 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 + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset1 = TFts5ExprNearset1 +/* Size (in bytes) of an Fts5ExprNearset object covering up to N phrases */ + /* ** Parse context. */ @@ -202412,7 +202894,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+36558, 0) return FTS5_EOF } goto _1 @@ -202423,7 +202905,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+36578, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -202438,13 +202920,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+36609, 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+36612, 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+31021, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -202488,7 +202970,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) @@ -204127,7 +204609,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) @@ -204137,7 +204619,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) @@ -204243,12 +204725,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 @@ -204382,7 +204864,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) @@ -204422,15 +204904,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)) @@ -204471,7 +204953,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 { @@ -204509,8 +204991,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+36616, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35129, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204530,10 +205012,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+36621, 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: ; @@ -204567,7 +205052,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 { @@ -204617,7 +205102,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 @@ -204668,7 +205153,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+21307, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204695,7 +205180,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)) @@ -204792,7 +205277,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+36650, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -204877,7 +205362,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) @@ -204890,7 +205375,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) @@ -204964,7 +205449,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 @@ -204990,11 +205475,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 + 36703 } else { - v2 = __ccgo_ts + 36509 + v2 = __ccgo_ts + 36616 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36603, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36710, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -205007,7 +205492,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+36760, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -205151,7 +205636,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 @@ -205484,7 +205969,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) { @@ -205548,7 +206033,7 @@ 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 +** to accumulate "term -> doclist" content before it is flushed to a level-0 ** segment. */ @@ -205607,7 +206092,7 @@ type TFts5HashEntry1 = struct { type Fts5HashEntry1 = TFts5HashEntry1 /* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -205745,7 +206230,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) } @@ -206057,7 +206542,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) } @@ -206489,9 +206974,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 @@ -206528,7 +207013,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206601,7 +207085,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206636,7 +207119,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206651,9 +207133,9 @@ 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 @@ -206750,11 +207232,12 @@ type TFts5Structure1 = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure1 = TFts5Structure1 +/* Size (in bytes) of an Fts5Structure object holding up to N levels */ + /* ** An object of type Fts5SegWriter is used to write to segments. */ @@ -206887,13 +207370,15 @@ type Fts5SegIter1 = TFts5SegIter1 ** Array of tombstone pages. Reference counted. */ type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray1 = TFts5TombstoneArray1 +/* Size (in bytes) of an Fts5TombstoneArray holding up to N tombstones */ + /* ** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. @@ -206946,11 +207431,12 @@ type TFts5Iter1 = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter1 = TFts5Iter1 +/* Size (in bytes) of an Fts5Iter object holding up to N segment iterators */ + /* ** An instance of the following type is used to iterate through the contents ** of a doclist-index record. @@ -206976,13 +207462,15 @@ type TFts5DlidxLvl1 = struct { type Fts5DlidxLvl1 = TFts5DlidxLvl1 type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } 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)) *(*Tu8)(unsafe.Pointer(aOut + 1)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) & libc.Int32FromInt32(0xFF)) @@ -207161,7 +207649,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+36813, 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. @@ -207266,7 +207754,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+36819, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -207295,7 +207783,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+36870, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -207329,7 +207817,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+36919, 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) @@ -207407,7 +207895,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)) @@ -207498,7 +207986,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+36959, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207509,7 +207997,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+36959, 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)) @@ -208190,7 +208678,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) @@ -208440,7 +208928,7 @@ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _ = nByte, nTomb, pNew nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(nTomb+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) if pNew != 0 { (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb @@ -208544,7 +209032,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 @@ -209150,7 +209638,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+36987, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -209239,7 +209727,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+37071, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -209886,7 +210374,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 @@ -210796,7 +211284,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 { @@ -211210,7 +211698,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+37153, 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. */ @@ -211716,7 +212204,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+37210, 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) @@ -211885,7 +212373,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 } @@ -212203,7 +212691,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+37271, 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))) @@ -212478,7 +212966,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: @@ -212513,7 +213001,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)) @@ -213127,11 +213615,12 @@ type TFts5TokenDataIter1 = struct { 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 // // /* @@ -213199,7 +213688,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) { @@ -213443,7 +213932,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) @@ -213493,7 +213982,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 @@ -213575,15 +214064,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) } @@ -213609,11 +214101,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+37322, 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+26056, __ccgo_ts+37330, 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+12007, __ccgo_ts+37365, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -213811,7 +214303,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) @@ -214066,7 +214558,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+37409) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -214417,7 +214909,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') @@ -214539,7 +215031,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 { @@ -214659,7 +215151,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+36813, 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))) @@ -215253,7 +215745,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+37411, 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)) @@ -215484,7 +215976,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+37497) 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)) @@ -215623,7 +216115,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215780,11 +216271,12 @@ type TFts5Sorter1 = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter1 = TFts5Sorter1 +/* Size (int bytes) of an Fts5Sorter object with N indexes */ + /* ** Virtual-table cursor object. ** @@ -216106,7 +216598,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+37502, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -216143,7 +216635,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++ @@ -216162,7 +216654,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 @@ -216612,7 +217104,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 @@ -216640,7 +217132,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) } @@ -216660,7 +217152,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) @@ -216675,7 +217167,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 + 15172 } else { v1 = __ccgo_ts + 1665 } @@ -216685,11 +217177,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 + 37541 } else { - v3 = __ccgo_ts + 37439 + v3 = __ccgo_ts + 37546 } - 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+37550, 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 @@ -216747,14 +217239,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+37605, 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+37611, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216804,7 +217296,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+37639, 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)) @@ -216837,7 +217329,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+37649, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -216871,7 +217363,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+37670, libc.VaList(bp+24, z)) } } } else { @@ -216879,7 +217371,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 + 35397 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -217036,7 +217528,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+37703, 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))) } @@ -217236,7 +217728,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+37708, 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 @@ -217369,10 +217861,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. @@ -219908,12 +220400,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+39057, 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+39161, 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+39199, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -219922,7 +220414,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+39237, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -219934,14 +220426,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+26056, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12007, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38391, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36190, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36297, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35495, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35602, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -219961,13 +220453,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 + 30696 } 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+39279, 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+39309, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -220008,7 +220500,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+39353, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -220016,7 +220508,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+39376, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -220031,7 +220523,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+39382, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -220040,22 +220532,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+35602, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39281 + zCols = __ccgo_ts + 39388 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39313 + zCols = __ccgo_ts + 39420 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36190, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36297, 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+38391, __ccgo_ts+39468, 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+36479, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -220475,12 +220967,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+39485, 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+39535, 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+39564, 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. */ @@ -220488,7 +220980,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+36479, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220790,7 +221282,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+39593, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -220920,7 +221412,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) } @@ -221022,14 +221514,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+35602, 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 @@ -221681,11 +222173,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 + 39647 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) } @@ -221695,7 +222187,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+39656) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -221712,20 +222204,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+39667) { 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+39625) { 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+39636) { 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+39656) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -222017,7 +222509,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 + 39685 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -222234,64 +222726,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+39695, 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+39698, 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+39703, 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+39708, 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+39711, 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+39714, 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+39719, 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+39724, 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+39728, 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+39734, 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+39739, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222300,49 +222792,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+39743, 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+39747, 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+39750, 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+39754, 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+39758, 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+39762, 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+39766, 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+39770, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222359,20 +222851,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+39774, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39754, 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+39777, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39780, 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+39784, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39770, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -222388,75 +222880,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+39787, 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+39754, 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+39795, 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+39802, 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+39807, 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+39703, 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+39812, 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+39698, 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+39817, 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+39770, 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+39822, 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+16122, 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+39827, 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+39780, 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+39831, 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+39695, 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+39836, 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+39739, 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+39842, 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+39846, 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+39848, 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+39762, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -222465,48 +222957,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+39854, 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+39770, 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+39862, 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+39754, 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+39868, 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+39754, 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+39873, 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+39695, 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+39879, 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+39766, 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+39887, 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+39895, 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+39899, 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+39762, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222514,21 +223006,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+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+39588, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39695, 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+39913, 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+39766, 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+39919, 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+39780, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222546,48 +223038,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+39926, 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+39711, 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+39931, 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+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+39604, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39711, 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+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+39604, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39711, 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+39895, 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+39948, 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+39954, 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+39695, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222603,13 +223095,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+39960, 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+39964, 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+39967, 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) @@ -222617,7 +223109,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+39970, 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) @@ -222782,14 +223274,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+39974) { 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+39667) { 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 { @@ -223057,7 +223549,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+39989)) } // C documentation @@ -223083,7 +223575,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39578, + FzName: __ccgo_ts + 39685, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -223091,7 +223583,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39890, + FzName: __ccgo_ts + 39997, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -223099,7 +223591,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39882, + FzName: __ccgo_ts + 39989, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -223129,7 +223621,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+40003, pApi, bp+96, uintptr(0)) } return rc } @@ -228645,16 +229137,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+40010) == 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+40014) == 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+40018) == 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+40027, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228717,21 +229209,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 + 40061, + 1: __ccgo_ts + 40101, + 2: __ccgo_ts + 40136, } 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+24049, *(*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+40179, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228752,23 +229245,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) } @@ -228901,10 +229394,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+40212, 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+40243, 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)) } @@ -228923,7 +229416,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+40294, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -229373,7 +229866,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+40320, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -229428,7 +229921,7 @@ 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 + 40330 } type TAggInfo_col = struct { @@ -229658,7 +230151,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 @@ -229706,11 +230199,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]uint8{'3', '.', '4', '9', '.', '1'} +var Xsqlite3_version = [7]uint8{'3', '.', '5', '0', '.', '1'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=0\x00COMPILER=clang-18.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_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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=0\x00COMPILER=clang-18.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_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\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods @@ -229720,3 +230213,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_386.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_386.go index a522b7a..0840f85 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_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 @@ -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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70" +const SQLITE_SOURCE_ID = "2025-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95" 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.1" -const SQLITE_VERSION_NUMBER = 3049001 +const SQLITE_VERSION = "3.50.1" +const SQLITE_VERSION_NUMBER = 3050001 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3457,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 @@ -3466,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 @@ -4369,6 +4375,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. @@ -4725,6 +4737,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 @@ -5157,7 +5170,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -6898,11 +6910,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. */ /* @@ -7276,6 +7294,7 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem @@ -7321,6 +7340,7 @@ type THashElem1 = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem1 = THashElem1 @@ -7471,6 +7491,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. */ @@ -7529,6 +7554,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 @@ -7832,7 +7868,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData = TDbClientData @@ -7905,7 +7940,6 @@ type Expr = TExpr type TExprList = struct { FnExpr int32 FnAlloc int32 - Fa [1]TExprList_item } type ExprList = TExprList @@ -7920,7 +7954,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -7970,7 +8003,6 @@ type FuncDefHash = TFuncDefHash type TIdList = struct { FnId int32 - Fa [1]TIdList_item } type IdList = TIdList @@ -8034,7 +8066,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -8106,19 +8137,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 @@ -8132,11 +8166,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 @@ -8147,39 +8178,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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -8197,7 +8230,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -8209,6 +8242,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [20]Tu8 } type PreUpdate = TPreUpdate @@ -8361,7 +8395,6 @@ type SrcItem = TSrcItem type TSrcList = struct { FnSrc int32 FnAlloc Tu32 - Fa [1]TSrcItem } type SrcList = TSrcList @@ -8416,6 +8449,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8597,7 +8631,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8639,7 +8672,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -9209,8 +9241,8 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. +/* Use SQLITE_ENABLE_EXPLAIN_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 @@ -10057,6 +10089,7 @@ type TTable1 = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table1 = TTable1 @@ -10138,11 +10171,13 @@ type TFKey1 = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey1 = TFKey1 +/* The size (in bytes) of an FKey object holding N columns. The answer +** does NOT include space to hold the zTo name. */ + /* ** SQLite supports many different ways to resolve a constraint ** error. ROLLBACK processing means that a constraint violation @@ -10191,11 +10226,12 @@ type TKeyInfo1 = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo1 = TKeyInfo1 +/* The size (in bytes) of a KeyInfo object with up to N fields */ + /* ** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. */ @@ -10601,11 +10637,13 @@ type Expr1 = TExpr1 type TExprList1 = struct { FnExpr int32 FnAlloc int32 - Fa [1]TExprList_item } type ExprList1 = TExprList1 +/* The size (in bytes) of an ExprList object that is big enough to hold +** as many as N expressions. */ + /* ** Allowed values for Expr.a.eEName */ @@ -10627,11 +10665,12 @@ type ExprList1 = TExprList1 */ type TIdList1 = struct { FnId int32 - Fa [1]TIdList_item } type IdList1 = TIdList1 +/* The size (in bytes) of an IdList object that can hold up to N IDs. */ + /* ** Allowed values for IdList.eType, which determines which value of the a.u4 ** is valid. @@ -10739,11 +10778,16 @@ type OnOrUsing1 = TOnOrUsing1 type TSrcList1 = struct { FnSrc int32 FnAlloc Tu32 - Fa [1]TSrcItem } type SrcList1 = TSrcList1 +/* Size (in bytes) of a SrcList object that can hold as many as N +** SrcItem objects. */ + +/* Size (in bytes( of a SrcList object that holds 1 SrcItem. This is a +** special case of SZ_SRCITEM(1) that comes up often. */ + /* ** Permitted values of the SrcList.a.jointype field */ @@ -11104,19 +11148,22 @@ type TParse1 = 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 @@ -11130,11 +11177,8 @@ type TParse1 = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -11145,39 +11189,41 @@ type TParse1 = 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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -11543,11 +11589,13 @@ type TWith1 = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With1 = TWith1 +/* The size (in bytes) of a With object that can hold as many +** as N different CTEs. */ + /* ** The Cte object is not guaranteed to persist for the entire duration ** of code generation. (The query flattener or other parser tree @@ -11577,11 +11625,13 @@ type TDbClientData1 = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData1 = TDbClientData1 +/* The size (in bytes) of a DbClientData object that can has a name +** that is N bytes long, including the zero-terminator. */ + /* ** This object is used in various ways, most (but not all) related to window ** functions. @@ -12747,7 +12797,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12825,7 +12874,6 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor @@ -12863,11 +12911,16 @@ type TVdbeCursor1 = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor1 = TVdbeCursor1 +/* +** The size (in bytes) of a VdbeCursor object that has an nField value of N +** or less. The value of SZ_VDBECURSOR(n) is guaranteed to be a multiple +** of 8. + */ + /* Return true if P is a null-only cursor */ @@ -13078,21 +13131,14 @@ type Tsqlite3_context1 = struct { 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 */ +/* +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. + */ // C documentation // @@ -13225,7 +13271,7 @@ type TPreUpdate1 = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -13237,6 +13283,7 @@ type TPreUpdate1 = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [20]Tu8 } type PreUpdate1 = TPreUpdate1 @@ -13374,7 +13421,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(24453)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13546,7 +13593,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)) @@ -13934,7 +13981,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++ } @@ -14005,10 +14052,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 @@ -14144,7 +14191,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) } } @@ -14241,7 +14288,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) @@ -14396,7 +14443,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 @@ -14474,7 +14521,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) @@ -14622,7 +14669,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)) @@ -14925,7 +14972,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 } @@ -15082,7 +15129,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('.') @@ -15130,7 +15177,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('.') @@ -15235,7 +15282,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) @@ -15964,7 +16011,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 } @@ -16613,7 +16660,8 @@ func init() { // /* // ** Initialize the mutex system. // */ -func _sqlite3MutexInit(tls *libc.TLS) (r int32) { +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 @@ -18239,17 +18287,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'), @@ -18446,22 +18494,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. */ @@ -18710,11 +18759,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 @@ -19191,29 +19240,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) @@ -19328,25 +19355,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 = v98 + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) + } + } + 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. @@ -19354,15 +19385,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) { @@ -19373,13 +19404,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) @@ -19393,35 +19457,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 - } - 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 + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + 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++ + } + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 + j1++ + 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) @@ -19446,9 +19573,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: ; @@ -19462,7 +19589,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+1680, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1706, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -19472,21 +19599,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+1682, 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+1692, 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+1713, 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: ; @@ -19725,7 +19852,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 @@ -20024,6 +20151,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 // // /* @@ -20041,11 +20170,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)) } @@ -20697,6 +20826,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 // // /* @@ -21447,7 +21607,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 { @@ -21622,7 +21782,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 @@ -21834,11 +21994,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 @@ -22074,7 +22234,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)) @@ -22164,7 +22324,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)) { @@ -22391,7 +22551,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+1771)) + n = libc.Int32FromUint32(libc.Uint32FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1797)) if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -22551,7 +22711,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('+') @@ -22660,7 +22820,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-- } } @@ -23076,7 +23236,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 @@ -23105,7 +23265,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 { @@ -23119,7 +23279,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) @@ -23150,7 +23310,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) { @@ -23501,23 +23661,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 @@ -23572,8 +23730,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) } @@ -23606,9 +23764,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: ; @@ -23628,13 +23785,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 } @@ -23642,7 +23798,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 @@ -23658,7 +23814,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 { @@ -23670,7 +23826,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 } @@ -23719,7 +23875,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 @@ -23729,20 +23885,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) } @@ -23761,196 +23916,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 = int32 @@ -24499,91 +24654,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, - }, - 14: { - FzName: __ccgo_ts + 3555, - }, - 15: { - FzName: __ccgo_ts + 3562, - }, - 16: { FzName: __ccgo_ts + 3572, }, + 14: { + FzName: __ccgo_ts + 3581, + }, + 15: { + FzName: __ccgo_ts + 3588, + }, + 16: { + FzName: __ccgo_ts + 3598, + }, 17: { - FzName: __ccgo_ts + 3579, - }, - 18: { - FzName: __ccgo_ts + 3593, - }, - 19: { - FzName: __ccgo_ts + 3599, - }, - 20: { FzName: __ccgo_ts + 3605, }, - 21: { - FzName: __ccgo_ts + 3612, + 18: { + FzName: __ccgo_ts + 3619, }, - 22: { - FzName: __ccgo_ts + 3620, - }, - 23: { + 19: { FzName: __ccgo_ts + 3625, }, - 24: { - FzName: __ccgo_ts + 3632, + 20: { + FzName: __ccgo_ts + 3631, }, - 25: { - FzName: __ccgo_ts + 3639, + 21: { + FzName: __ccgo_ts + 3638, }, - 26: { + 22: { + FzName: __ccgo_ts + 3646, + }, + 23: { FzName: __ccgo_ts + 3651, }, + 24: { + FzName: __ccgo_ts + 3658, + }, + 25: { + FzName: __ccgo_ts + 3665, + }, + 26: { + FzName: __ccgo_ts + 3677, + }, 27: { - FzName: __ccgo_ts + 3660, + FzName: __ccgo_ts + 3686, }, 28: { - FzName: __ccgo_ts + 3666, + FzName: __ccgo_ts + 3692, }, } @@ -24822,9 +24977,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 } } @@ -25144,7 +25299,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 } @@ -25172,7 +25327,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+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 } } @@ -25831,7 +25986,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(40995)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -26436,7 +26591,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.Int32FromUint32(libc.Xstrlen(tls, bp)) for { if !(ii > 0 && int32((*(*[513]int8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { @@ -26462,7 +26617,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(42576)), __ccgo_ts+3605, bp, int32(42576)) } // C documentation @@ -26499,7 +26654,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)<= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43393)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -27110,7 +27265,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)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44803)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -28111,10 +28265,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 @@ -28123,8 +28277,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 @@ -28186,7 +28340,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++ @@ -28358,7 +28512,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) } @@ -28513,7 +28667,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(45251)), __ccgo_ts+3488, zName, int32(45251)) if rc == SQLITE_OK { rc = rc2 } @@ -28590,7 +28744,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(45502)) 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+3651, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45507)), __ccgo_ts+3677, zIn, int32(45507)) return } (*(*[4098]int8)(unsafe.Pointer(bp + 144)))[got] = 0 @@ -28788,14 +28942,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+3480, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45565)), __ccgo_ts+3506, zPath, int32(45565)) } _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(45571)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<>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) } } @@ -32114,7 +32268,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) - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, 0) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -32208,7 +32362,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-- - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, 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)) } @@ -32249,7 +32403,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, 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 @@ -32377,7 +32531,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 libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g)) + 96) + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -32397,17 +32551,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) } @@ -32425,7 +32581,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 @@ -32437,7 +32593,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) } } @@ -32638,10 +32794,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 @@ -34786,7 +34943,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 @@ -34804,7 +34961,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 } @@ -35377,6 +35534,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 { @@ -36023,7 +36189,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 @@ -36035,7 +36202,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) @@ -36056,11 +36223,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 @@ -36089,7 +36257,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 @@ -36322,7 +36490,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) } @@ -36459,7 +36627,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)) @@ -36475,7 +36643,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)< int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65269)) } 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)) @@ -40582,7 +40750,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 { @@ -41148,7 +41316,6 @@ type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { FiPrior Tu32 FnSegment int32 - FaSegment [1]TWalSegment } type WalIterator = TWalIterator @@ -41352,6 +41519,11 @@ type WalCkptInfo1 = TWalCkptInfo1 /* ** An open write-ahead log file is represented by an instance of the ** following object. +** +** writeLock: +** This is usually set to 1 whenever the WRITER lock is held. However, +** if it is set to 2, then the WRITER lock is held but must be released +** by walHandleException() if a SEH exception is thrown. */ type TWal1 = struct { FpVfs uintptr @@ -41420,11 +41592,12 @@ type ht_slot = Tht_slot 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 ** is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -41482,7 +41655,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) @@ -41583,6 +41756,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 @@ -42024,7 +42198,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(67209)) } goto _1 _1: @@ -42112,7 +42286,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(67341)) goto finished } /* Malloc a buffer to read frames into. */ @@ -42251,7 +42425,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 { @@ -42882,7 +43056,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(68150)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -42998,7 +43172,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)) } } @@ -43213,7 +43387,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 { @@ -43239,7 +43420,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(68601)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43962,8 +44143,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)) } @@ -44050,7 +44231,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(69451)) } iKey = _walNextHash(tls, iKey) } @@ -44547,7 +44728,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(69974)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44796,7 +44977,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, /* 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(70234)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -45568,6 +45749,11 @@ type CellInfo1 = TCellInfo1 ** assumed that the database is corrupt. */ +/* +** Maximum amount of storage local to a database page, regardless of +** page size. + */ + /* ** A cursor is a pointer to a particular entry within a particular ** b-tree within a database file. @@ -45934,10 +46120,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) { @@ -45946,14 +46133,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) { @@ -46653,7 +46840,7 @@ 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(72422)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } @@ -46831,7 +47018,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(72620)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46844,12 +47031,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(72633)) 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(72638)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46893,7 +47080,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(72683)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46901,7 +47088,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(72691)) } return SQLITE_OK } @@ -47089,7 +47276,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) } @@ -47122,7 +47309,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) } @@ -47321,7 +47508,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(73136)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -47361,12 +47548,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(73194)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73197)) } 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)) @@ -47374,21 +47561,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(73205)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73208)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73210)) } 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(73214)) } } cbrk = top + sz @@ -47435,12 +47622,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(73247)) } 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(73253)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -47456,7 +47643,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(73267)) } *(*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) @@ -47516,7 +47703,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(73324)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -47533,14 +47720,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(73339)) } 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(73346)) } return uintptr(0) } @@ -47583,11 +47770,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(73394)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73397)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -47601,7 +47788,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(73414)) } else { return SQLITE_OK } @@ -47654,42 +47841,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(73498)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47697,70 +47882,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(73510)) } - 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(73513)) } - 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(73526)) } - 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(73532)) } 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) + *(*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)) += libc.Int32FromUint16(iOrigSize) + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47806,7 +47991,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(73602)) } } } else { @@ -47832,7 +48017,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(73626)) } } } @@ -47871,12 +48056,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(73677)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73682)) } 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(73692)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73696)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47903,7 +48088,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(73708)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47934,11 +48119,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(73739)) } 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(73744)) } goto _1 _1: @@ -47967,11 +48152,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(73776)) } (*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) @@ -47980,7 +48165,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(73790)) } /* 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 @@ -48002,15 +48187,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 { @@ -48018,14 +48201,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) @@ -48133,7 +48316,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(73933)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -48195,7 +48378,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(74005)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -48283,7 +48466,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 */ @@ -48907,7 +49090,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) @@ -49069,7 +49252,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, 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 @@ -49107,7 +49290,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(74943)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 4)) @@ -49548,7 +49731,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(75398)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -49572,7 +49755,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(75417)) } 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) @@ -49581,7 +49764,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(75426)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -49595,7 +49778,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(75438)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -49625,7 +49808,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(75473)) } /* 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) @@ -49721,7 +49904,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(75571)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49759,7 +49942,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(75623)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 20)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 16)), bCommit) @@ -49826,7 +50009,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(75691)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49869,7 +50052,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(75742)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49899,7 +50082,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(75769)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -50365,7 +50548,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(76233)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50757,7 +50940,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(76657)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50767,7 +50950,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(76672)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50824,7 +51007,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(76743)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50898,7 +51081,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(76827)) } return rc } @@ -51033,7 +51216,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(76965)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -51045,7 +51228,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(76979)) } if rc != 0 { v3 = pCur + 60 @@ -51161,7 +51344,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(77114)) } goto skip_init skip_init: @@ -51175,7 +51358,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(77126)) } 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) @@ -51409,7 +51592,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(77375)) } } } @@ -51613,7 +51796,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes p3 = pCur + 1 *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(BTCF_ValidOvfl) | libc.Int32FromInt32(BTCF_AtLast))) if !((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76795)) + return _sqlite3CorruptError(tls, int32(77571)) } goto bypass_moveto_root /* Start search on the current page */ } @@ -51676,10 +51859,10 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ if nCell < int32(2) || libc.Uint32FromInt32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77658)) 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 @@ -51707,7 +51890,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(77690)) } goto moveto_index_finish } @@ -51740,7 +51923,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(77721)) } *(*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 @@ -51749,7 +51932,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(77732)) } if rc != 0 { v11 = pCur + 60 @@ -51878,7 +52061,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(77833)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51988,7 +52171,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(77926)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -52076,7 +52259,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(78016)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -52131,7 +52314,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(78072)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -52157,7 +52340,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(78101)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52184,7 +52367,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(78135)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+8, 0) @@ -52255,7 +52438,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(78200)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52393,7 +52576,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(78327)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 4)) = pMemPage @@ -52444,7 +52627,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(78374)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 8)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -52453,7 +52636,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(78385)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -52543,7 +52726,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(78474)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -52561,7 +52744,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(78491)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+4, bp) @@ -52584,7 +52767,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(78511)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 4)), ovflPgno) } @@ -52805,10 +52988,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(78767)) 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 @@ -53199,12 +53382,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(79157)) } 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(79162)) } } pData -= uintptr(sz) @@ -53212,7 +53395,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(79168)) } libc.Xmemmove(tls, pData, pCell, uint32(sz)) i++ @@ -53307,7 +53490,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(79255)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4)), libc.Uint32FromInt32(sz)) @@ -53388,7 +53571,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: ; @@ -53415,7 +53598,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: ; @@ -53455,7 +53638,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(79377)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint32FromInt32(nCell*int32(2))) nCell -= nShift @@ -53526,7 +53709,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(79455)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -53571,7 +53754,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(79495)) } /* 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 @@ -53767,10 +53950,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 @@ -53893,8 +54077,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 @@ -53934,7 +54118,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(79919)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53957,7 +54141,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(79943)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -54088,7 +54272,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(80044)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 36)))[k-int32(1)] = 0 @@ -54131,7 +54315,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(80077)) goto balance_cleanup } } @@ -54190,7 +54374,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(80121)) goto balance_cleanup } goto _11 @@ -54222,7 +54406,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(80154)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -54452,7 +54636,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(80355)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54698,7 +54882,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(80587)) } goto _1 _1: @@ -54771,7 +54955,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(80647)) } 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))) @@ -54930,7 +55114,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(80811)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54961,7 +55145,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(80839)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -55046,7 +55230,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(80920)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -55138,7 +55322,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(81043)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -55174,7 +55358,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(81085)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55204,10 +55388,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(81112)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81115)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -55325,7 +55509,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(81217)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { @@ -55340,14 +55524,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(81242)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -55447,21 +55631,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(81338)) } } 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(81347)) } 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(81351)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81354)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -55555,7 +55739,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(81445)) } 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 @@ -55665,7 +55849,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(81561)) } *(*TPgno)(unsafe.Pointer(bp + 4))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55706,7 +55890,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(81609)) } if *(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55787,14 +55971,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(81699)) } *(*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(81706)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55931,7 +56115,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(81810)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -56196,7 +56380,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+4272, 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)) @@ -56244,11 +56428,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) @@ -56274,11 +56458,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 @@ -56350,11 +56534,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)) } } @@ -56490,12 +56674,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+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+4690, 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+4720, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4746, 0) doCoverageCheck = 0 goto _4 } @@ -56580,7 +56764,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+4744, 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 */ @@ -56603,7 +56787,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 { @@ -56680,7 +56864,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+4793, 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))) @@ -56694,7 +56878,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+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 @@ -56785,7 +56969,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) } @@ -56809,11 +56993,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+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+4938, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+4964, 0) } } } @@ -56850,10 +57034,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+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+5013, libc.VaList(bp+208, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5039, libc.VaList(bp+208, i)) } goto _3 _3: @@ -57292,7 +57476,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+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) @@ -57302,7 +57486,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+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 @@ -57331,7 +57515,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 @@ -57361,7 +57545,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... @@ -58039,7 +58223,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+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) } @@ -58177,9 +58361,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 @@ -58354,20 +58535,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 } @@ -58385,7 +58566,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 @@ -59139,7 +59320,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(85108)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -59303,7 +59484,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 { @@ -59311,8 +59493,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 { @@ -59376,7 +59558,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 */ @@ -59415,14 +59597,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+3864, 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)) @@ -59522,7 +59704,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 } } } @@ -59537,7 +59719,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 } @@ -59841,7 +60023,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(85794)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59857,7 +60039,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(85800)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59867,7 +60049,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(85806)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -60328,12 +60510,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 @@ -60507,7 +60688,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 @@ -60592,8 +60773,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. @@ -60606,11 +60787,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 */ @@ -60647,13 +60828,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 @@ -60684,7 +60868,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 @@ -61186,7 +61370,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+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)) { @@ -61199,39 +61383,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+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+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+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+5200, 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+5200, 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+1428, libc.VaList(bp+32, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5207, 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+1395, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): @@ -61248,14 +61432,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+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 @@ -61270,20 +61454,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+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+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+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)) } @@ -61297,10 +61481,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 @@ -62251,7 +62435,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) } @@ -62259,18 +62443,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+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+8) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5297, 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) @@ -62501,7 +62685,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(90646))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63889,7 +64073,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(90727))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 20 + uintptr(i)*4)) != 0 { @@ -63924,7 +64108,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(90757))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63978,7 +64162,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(90808))) return 0 /* Corrupt index */ } } @@ -64110,7 +64294,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(90971))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -64262,7 +64446,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(91129)) } // C documentation @@ -64293,7 +64477,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(91162)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -64444,15 +64628,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 + 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 @@ -64547,10 +64731,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 @@ -64559,9 +64744,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 { @@ -64641,7 +64826,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 @@ -64651,7 +64836,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) @@ -64709,7 +64894,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(91560)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -65212,7 +65397,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 @@ -65413,7 +65598,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(92354)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -65543,7 +65728,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(92475)) } 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) @@ -66003,18 +66188,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'), @@ -66269,14 +66454,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(93091)) } 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(93095))) 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(93099)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -66427,7 +66612,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, 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) } @@ -66850,11 +67035,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(93642)) 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))) } @@ -66863,7 +67048,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) @@ -66877,7 +67062,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) } @@ -66912,7 +67097,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(93701)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*4)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66947,7 +67132,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 } @@ -67013,11 +67198,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(93797)) 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))) } @@ -67040,7 +67225,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 @@ -67189,7 +67374,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(zRawSql)-int32(zStart)) } } else { @@ -67227,7 +67412,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr 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+5136, 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 @@ -67242,28 +67427,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+5635, 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+5642, 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+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+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+5663, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5689, int32(1)) } } } @@ -67427,9 +67612,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 { @@ -67455,12 +67640,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) @@ -67469,28 +67652,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 @@ -67881,12 +68064,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 @@ -67903,7 +68086,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 @@ -67921,7 +68104,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 @@ -68635,19 +68818,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+3864, 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+5699, 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+5720, 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+3864, 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+5727, 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) { @@ -69861,7 +70044,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 @@ -69877,6 +70060,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 */ @@ -70370,7 +70559,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(97561)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -70473,7 +70662,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+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+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, @@ -71069,7 +71258,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 { @@ -71099,12 +71288,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 } @@ -71196,7 +71385,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. @@ -72307,7 +72496,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(99822)) } else { goto jump_to_p2 } @@ -72766,7 +72955,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(). @@ -73199,7 +73388,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(101119)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+404, db, uint16(0)) @@ -73529,7 +73718,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+3864, 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 @@ -73560,13 +73749,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 + 6151 + 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+6165, 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 { @@ -73581,7 +73770,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(101412)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73818,7 +74007,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+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 @@ -73835,15 +74024,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 @@ -73924,11 +74113,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) } @@ -74140,7 +74329,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 @@ -74190,7 +74379,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+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 { @@ -74246,7 +74435,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+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)) @@ -74325,11 +74514,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+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) { @@ -74482,7 +74671,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+672, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6333, libc.VaList(bp+664, z1)) } goto abort_due_to_error } @@ -74644,7 +74833,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+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' @@ -74724,12 +74913,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)) @@ -74740,7 +74929,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+3864, 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)) @@ -74834,7 +75023,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 } @@ -74862,11 +75051,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) { @@ -74994,7 +75183,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+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) @@ -75145,7 +75334,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+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 { @@ -75232,15 +75421,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) @@ -75706,11 +75887,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+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) @@ -75796,7 +75977,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103962)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75895,7 +76076,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(104062)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75909,7 +76090,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) } @@ -76356,11 +76537,12 @@ type TVdbeSorter1 = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter1 = TVdbeSorter1 +/* Size (in bytes) of a VdbeSorter object that works with N or fewer subtasks */ + /* ** An instance of the following object is used to read records out of a ** PMA, in sorted order. The next key to be read is cached in nKey/aKey. @@ -76967,8 +77149,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 @@ -76982,9 +77164,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) @@ -77182,18 +77364,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 { @@ -77481,6 +77664,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: @@ -80026,25 +80212,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) } } @@ -80083,23 +80269,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 */ @@ -80131,7 +80316,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 @@ -80225,7 +80410,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 } } @@ -80247,57 +80432,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 @@ -80342,11 +80514,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 } @@ -80355,36 +80527,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+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 += 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++ @@ -80413,18 +80574,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 } } } @@ -80471,15 +80632,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+6739, 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+6770, 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+6807, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -80490,8 +80651,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -80531,7 +80692,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+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) @@ -80551,7 +80712,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) @@ -80560,7 +80721,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 + 20)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -80570,26 +80731,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+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+6919, 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+6929, libc.VaList(bp+16, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6954, libc.VaList(bp+16, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6990, 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) } @@ -80638,8 +80799,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80713,19 +80874,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) } @@ -80751,7 +80912,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 @@ -80897,7 +81058,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) { @@ -80952,7 +81113,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+7116, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7141, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -80976,7 +81137,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) @@ -80990,13 +81151,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: ; @@ -81016,16 +81177,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 @@ -81036,35 +81194,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 { @@ -81149,7 +81310,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 + 20))) } @@ -81161,7 +81322,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 @@ -81207,7 +81368,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 @@ -81332,7 +81493,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) } @@ -81367,7 +81528,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+7524, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7549, 0) return int32(1) } i = 0 @@ -81405,7 +81566,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 { @@ -81475,7 +81636,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+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 @@ -81509,7 +81670,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+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 @@ -81822,7 +81983,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 { @@ -81889,7 +82050,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 { @@ -81900,7 +82061,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 @@ -81910,7 +82071,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 @@ -82012,12 +82173,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) @@ -82060,12 +82221,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)) @@ -82132,33 +82293,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 } @@ -82210,7 +82373,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) { @@ -82418,7 +82581,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 } @@ -82893,7 +83056,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) { @@ -82972,7 +83135,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+7760, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7785, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -83317,11 +83480,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 + 20)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -83370,7 +83533,7 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt 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)) { _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) } @@ -83398,7 +83561,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+7854, 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)) @@ -83418,7 +83581,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 @@ -83489,7 +83652,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)) } } } @@ -83527,7 +83690,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 @@ -83541,7 +83704,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+7958, 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 } @@ -83561,7 +83724,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 @@ -83574,7 +83737,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+8001, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8026, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -83957,7 +84120,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 @@ -84097,7 +84260,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: @@ -84118,27 +84280,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) { @@ -84184,9 +84339,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++ } @@ -84196,8 +84351,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++ } @@ -84211,7 +84366,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) } @@ -84262,7 +84417,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 @@ -84343,7 +84498,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) @@ -84361,7 +84516,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) @@ -84442,7 +84597,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 @@ -84571,7 +84726,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+8054, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8079, libc.VaList(bp+8, zObject)) } } @@ -84669,10 +84824,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) @@ -85350,13 +85505,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 @@ -85371,32 +85526,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.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 @@ -85605,7 +85747,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 @@ -85658,7 +85800,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) @@ -85758,12 +85900,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) @@ -86355,7 +86498,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 @@ -86451,7 +86594,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 @@ -86486,9 +86629,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) { @@ -86621,7 +86764,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) } } @@ -86751,13 +86894,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)<= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8414, 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) } @@ -87549,7 +87692,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)) @@ -87564,7 +87707,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+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) { @@ -87593,7 +87736,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) } @@ -87669,7 +87812,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8024, 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): @@ -87732,7 +87875,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 @@ -87742,7 +87885,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) { @@ -87763,9 +87906,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 /* @@ -87847,7 +87990,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) { @@ -87918,17 +88061,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 { @@ -87937,7 +88080,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 @@ -87968,7 +88111,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 { @@ -88038,7 +88181,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) @@ -88082,7 +88225,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 @@ -88349,7 +88492,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: @@ -88558,7 +88703,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: @@ -89265,7 +89412,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) } @@ -89786,7 +89933,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) 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 + v7 = pParse + 48 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 @@ -89802,7 +89949,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) (*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 + v9 = pParse + 48 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 @@ -89887,7 +90034,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 @@ -89895,7 +90042,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 @@ -89913,7 +90060,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 } } } @@ -89932,11 +90079,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 } @@ -90054,8 +90201,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+8540, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90073,10 +90220,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+32, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8568, 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+8743, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -90092,9 +90239,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+8917, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9039, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9064, 0) } } @@ -90150,7 +90297,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+9215, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -90159,11 +90306,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+9274, 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+9280, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -90193,21 +90340,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+9307, 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+9491, 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+9796, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9812, 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+9870, 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 @@ -90215,7 +90362,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 @@ -90223,7 +90370,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+10135, 0) goto exit_rename_table exit_rename_table: ; @@ -90240,7 +90387,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+10148, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -90280,11 +90427,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+10186, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10193, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10218, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -90300,10 +90447,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+10220) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10245) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10279) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10304) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -90315,13 +90462,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+10357) } _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+10403) } } /* Modify the CREATE TABLE statement. */ @@ -90335,7 +90482,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+10430, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -90363,7 +90510,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+10551, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10576, libc.VaList(bp+16, zTab, zDb)) } } } @@ -90401,12 +90548,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+10929, 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+10963, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -90421,7 +90568,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 } @@ -90430,7 +90577,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+10968, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+10993, 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 } @@ -90491,18 +90638,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 + 11012 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10992 + zType = __ccgo_ts + 11017 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11006 + v1 = __ccgo_ts + 11031 } else { - v1 = __ccgo_ts + 11023 + v1 = __ccgo_ts + 11048 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11041, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11066, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90549,21 +90696,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)*12))).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+11084, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -90579,11 +90714,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+11105, 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+11287, 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+10135, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -90937,7 +91072,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 @@ -91059,11 +91194,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 + 11418 } 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+11420, 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) } @@ -91134,30 +91269,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+11443, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118867)) } 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(118888)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -91178,9 +91317,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)) @@ -91196,15 +91334,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+11451, 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)) @@ -91215,16 +91353,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++ @@ -91241,21 +91379,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 + 11418 } 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+11457, 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))) @@ -91281,7 +91419,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: ; @@ -91536,7 +91674,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))) @@ -91577,11 +91715,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 @@ -91591,7 +91729,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 { @@ -91601,7 +91739,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 @@ -91618,13 +91756,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: ; @@ -91635,7 +91773,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: ; @@ -91647,7 +91785,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: ; @@ -91688,8 +91826,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 { @@ -91721,7 +91859,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) @@ -91817,15 +91955,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))) @@ -91839,13 +91977,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)) @@ -91856,16 +91994,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) } @@ -91883,7 +92021,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: @@ -91895,35 +92033,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 @@ -91933,7 +92071,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: @@ -91952,7 +92090,7 @@ 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 { @@ -91966,7 +92104,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt } } _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 } @@ -92015,9 +92153,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))) @@ -92030,18 +92168,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 { @@ -92051,16 +92189,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: ; @@ -92069,19 +92207,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) { @@ -92123,12 +92261,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) @@ -92142,19 +92281,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 } @@ -92221,7 +92360,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(119856)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName) @@ -92238,7 +92377,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+296, int32((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int32(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11462, 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 @@ -92293,23 +92432,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+11084, 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 + 11444 + v1 = __ccgo_ts + 11469 } 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+11481, 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+11509, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -92321,31 +92460,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+11557, 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+11678, 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)) { @@ -92359,7 +92498,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 @@ -92370,8 +92509,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 } @@ -92432,27 +92571,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 + 11696, }, 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 + 11717, }, 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 + 11737, }, 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 + 11756, }, 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 + 11775, }, } @@ -92663,8 +92802,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+11878, 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 { @@ -92674,10 +92818,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+11901, 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+11931, 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) @@ -92709,15 +92853,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11773, - FzCols: __ccgo_ts + 11786, + FzName: __ccgo_ts + 11798, + FzCols: __ccgo_ts + 11811, }, 1: { - FzName: __ccgo_ts + 11799, - FzCols: __ccgo_ts + 11812, + FzName: __ccgo_ts + 11824, + FzCols: __ccgo_ts + 11837, }, 2: { - FzName: __ccgo_ts + 11840, + FzName: __ccgo_ts + 11865, }, } @@ -92931,7 +93075,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) { @@ -92947,12 +93092,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 @@ -92960,7 +93105,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) @@ -93019,7 +93164,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 + 11949, } func init() { @@ -93393,7 +93538,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 + 11959, } func init() { @@ -93443,7 +93588,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+56, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11969, libc.VaList(bp+56, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -93454,7 +93599,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+56, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11974, libc.VaList(bp+56, iVal)) goto _2 _2: ; @@ -93493,7 +93638,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+11955, libc.VaList(bp+56, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+24, __ccgo_ts+11980, libc.VaList(bp+56, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -93511,7 +93656,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 + 11986, } func init() { @@ -93577,7 +93722,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+11995, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -93586,12 +93731,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+11773, uint32(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*80 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11798, 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)) @@ -93793,7 +93938,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: @@ -93824,7 +93969,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+12005, 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)) @@ -93915,7 +94060,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+12005, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -93952,7 +94097,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 @@ -93985,11 +94130,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+11984) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12009) } 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+12013) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -94153,17 +94298,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+11992, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12017, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12003, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12028, 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+12038, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -94175,13 +94320,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) - } } } @@ -94542,11 +94680,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+11824, 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+12050, __ccgo_ts+12119, zDb) } return rc } @@ -94612,10 +94750,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+11773, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11798, (*(*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+16, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12171, libc.VaList(bp+16, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94728,7 +94866,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+6715, 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 @@ -94780,11 +94918,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 + 20)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 16)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4036) + *(*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+12187, db, bp+20, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), __ccgo_ts+12212, 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 { @@ -94815,7 +94953,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+12190, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(db + 116 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12215, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(db + 116 + 7*4)))) goto attach_error } i = 0 @@ -94824,7 +94962,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+12227, libc.VaList(bp+32, zName)) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12252, libc.VaList(bp+32, zName)) goto attach_error } goto _1 @@ -94842,7 +94980,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 } @@ -94880,7 +95018,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+12257, 0) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12282, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94888,7 +95026,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+12286, 0) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12311, 0) rc = int32(SQLITE_ERROR) } } @@ -94935,7 +95073,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+1637, 0) } else { if *(*uintptr)(unsafe.Pointer(bp + 12)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12354, libc.VaList(bp+32, zFile)) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12379, libc.VaList(bp+32, zFile)) } } } @@ -94997,15 +95135,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+12407, 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+12428, 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+12454, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -95100,7 +95238,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 + 12476, } func init() { @@ -95122,7 +95260,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 + 12490, } func init() { @@ -95148,7 +95286,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+12504, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -95182,7 +95320,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+12503, 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+12528, 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))) @@ -95399,7 +95537,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+12574, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -95427,11 +95565,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+12597, 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+12603, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12584, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12609, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -95491,7 +95629,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 + 8096 + zCol = __ccgo_ts + 8121 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -95526,7 +95664,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+12636, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -95644,7 +95782,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 @@ -95742,7 +95880,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) @@ -95820,7 +95960,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) { @@ -95834,7 +95974,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) } @@ -95900,13 +96042,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-- } @@ -95947,21 +96089,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)*16))).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*16))).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*16))).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)*16))).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)*16))).FpSchema+8, __ccgo_ts+6175) } } } @@ -95991,12 +96133,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*16))).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*16))).FpSchema+8, __ccgo_ts+6688) } } } @@ -96034,7 +96176,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+12626, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12651, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -96044,7 +96186,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) @@ -96052,15 +96194,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 + 12659 } else { - v1 = __ccgo_ts + 12647 + v1 = __ccgo_ts + 12672 } 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 { } @@ -96098,12 +96240,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 @@ -96628,7 +96770,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) @@ -96660,7 +96802,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 @@ -96718,13 +96860,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+12686, 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+12703, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96772,8 +96914,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+12723, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96809,23 +96951,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 @@ -96945,7 +97089,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 @@ -96988,9 +97132,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 @@ -97003,7 +97147,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+12765, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -97019,9 +97163,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10987 + v2 = __ccgo_ts + 11012 } else { - v2 = __ccgo_ts + 9249 + v2 = __ccgo_ts + 9274 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -97031,9 +97175,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 + 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 @@ -97057,11 +97201,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 + 11012 } else { - v4 = __ccgo_ts + 9249 + v4 = __ccgo_ts + 9274 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12781, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12806, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -97069,11 +97213,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+12827, 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++ @@ -97105,19 +97249,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 @@ -97137,15 +97291,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) @@ -97160,7 +97319,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 } @@ -97221,7 +97380,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+12862, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -97230,14 +97389,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+12871, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+104, __ccgo_ts+12896, 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) @@ -97269,11 +97430,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) @@ -97284,7 +97445,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+12891, libc.VaList(bp+24, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12916, libc.VaList(bp+24, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -97294,12 +97455,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+12914, 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+12939, 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+12921, 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+12946, 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-- @@ -97341,21 +97502,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+12931, 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+12956, 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) { @@ -97366,7 +97516,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. */ @@ -97379,12 +97529,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 @@ -97556,10 +97715,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+12957, libc.VaList(bp+64, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12982, 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+13002, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13027, 0) } else { libc.Xmemset(tls, bp, 0, uint32(52)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -97617,7 +97776,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+13043, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13068, 0) } } @@ -97645,8 +97804,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) @@ -97654,7 +97813,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+13120, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 28)) |= uint32(TF_HasPrimaryKey) @@ -97673,21 +97832,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 @@ -97710,7 +97858,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+13161, 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) @@ -97738,8 +97886,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 { @@ -97826,17 +97979,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+13192, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13217, 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+13260, (*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+13268, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97868,7 +98021,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+13275, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -98009,9 +98162,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 @@ -98022,31 +98176,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) { + 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 + 13306 + zEnd = __ccgo_ts + 5201 } else { - zSep = __ccgo_ts + 13283 - zSep2 = __ccgo_ts + 13287 - zEnd = __ccgo_ts + 13292 + zSep = __ccgo_ts + 13308 + zSep2 = __ccgo_ts + 13312 + zEnd = __ccgo_ts + 13317 } - 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+13320, 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))++ @@ -98057,8 +98211,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)] @@ -98071,17 +98226,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+3864, 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 + 1667, - 1: __ccgo_ts + 13309, - 2: __ccgo_ts + 13315, - 3: __ccgo_ts + 13320, - 4: __ccgo_ts + 13325, - 5: __ccgo_ts + 13315, + 1: __ccgo_ts + 13334, + 2: __ccgo_ts + 13340, + 3: __ccgo_ts + 13345, + 4: __ccgo_ts + 13350, + 5: __ccgo_ts + 13340, } // C documentation @@ -98090,15 +98246,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) } @@ -98113,7 +98270,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 } @@ -98346,8 +98503,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. @@ -98447,7 +98614,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 @@ -98460,8 +98627,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++ } @@ -98491,7 +98658,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 @@ -98710,9 +98877,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+13331, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1667))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13356, 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+13364, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13389, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98733,11 +98900,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+13416, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13441, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13466, 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)) @@ -98784,7 +98951,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+13498, 0) return } } @@ -98818,16 +98985,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 + 9274 + zType2 = __ccgo_ts + 13542 } else { /* A view */ - zType = __ccgo_ts + 10987 - zType2 = __ccgo_ts + 13523 + zType = __ccgo_ts + 11012 + zType2 = __ccgo_ts + 13548 } /* 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 @@ -98844,24 +99011,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) @@ -98900,7 +99072,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 } @@ -98909,13 +99081,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+40, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13553, 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+13543, 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+13568, 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 @@ -98924,15 +99106,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+13641, libc.VaList(bp+40, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13666, 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+13683, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13708, 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+13717, 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+13742, 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. @@ -98950,7 +99132,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+9796) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -98983,7 +99165,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+13738, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13763, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -99000,7 +99182,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+10987, *(*uintptr)(unsafe.Pointer(bp + 60))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+11012, *(*uintptr)(unsafe.Pointer(bp + 60))) if _sqlite3FixSelect(tls, bp+8, pSelect) != 0 { goto create_view_fail } @@ -99097,7 +99279,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+13799, 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. @@ -99281,7 +99463,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+13829, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -99294,7 +99476,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)*16))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13844, 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) } @@ -99377,9 +99559,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+13911, 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+11901, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -99420,7 +99602,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+13925, 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 @@ -99429,7 +99611,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+13970, 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) } @@ -99464,11 +99646,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) @@ -99523,9 +99705,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)*16))).FzDbSName @@ -99558,18 +99740,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+14037, 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+14065, 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+14099, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -99579,7 +99761,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+12013, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -99627,19 +99809,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)*12))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14131, 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+14169, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14194, 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 { @@ -99696,7 +99878,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)*20))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14288, 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) { @@ -99811,11 +99993,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 */ @@ -99837,7 +100019,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 @@ -99882,13 +100064,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) } @@ -99911,23 +100093,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 @@ -99956,11 +100138,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 + 14309 + v2 = __ccgo_ts + 14334 } else { - v2 = __ccgo_ts + 14315 + v2 = __ccgo_ts + 14340 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14320, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14345, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -100038,7 +100220,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 + 52))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14373, *(*uintptr)(unsafe.Pointer(bp + 52))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -100048,7 +100230,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+14354, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14379, 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)) { @@ -100062,16 +100244,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+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+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+14429, 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+14432, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14457, 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+14482, 0) goto exit_create_index } /* @@ -100092,19 +100274,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+14373, (*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+80, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14516, 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+14525, libc.VaList(bp+80, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14550, libc.VaList(bp+80, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -100125,7 +100307,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+80, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14574, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -100143,9 +100325,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 @@ -100173,7 +100355,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+14373) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -100205,7 +100387,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 } @@ -100257,7 +100439,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+14597, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -100272,6 +100454,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { j = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) + libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 10, 0x400) } else { if int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12 + 4))&0xf>>0)) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 3, 0x8) @@ -100356,7 +100539,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) @@ -100404,7 +100587,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+80, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14658, 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 @@ -100434,8 +100617,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+14700, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127335)) goto exit_create_index } } @@ -100448,7 +100631,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 @@ -100477,9 +100660,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 + 14717 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14700, libc.VaList(bp+80, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 52)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14725, 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(""); */ @@ -100487,7 +100670,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+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+14745, 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. @@ -100495,7 +100678,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+80, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14804, 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)) @@ -100658,16 +100841,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+14806, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14831, 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+14824, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14849, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100675,9 +100858,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 + 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 { @@ -100693,8 +100876,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)*16))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11984, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14922, 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+12009, (*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) @@ -100767,12 +100950,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) @@ -100884,13 +101067,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+14982, 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) } @@ -100971,7 +101154,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) } @@ -101021,7 +101204,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 @@ -101192,11 +101375,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 + 15018 } else { - v1 = __ccgo_ts + 14996 + v1 = __ccgo_ts + 15021 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15002, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15027, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -101395,7 +101578,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+15063, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -101442,9 +101625,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 + 15069 } else { - v1 = __ccgo_ts + 15053 + v1 = __ccgo_ts + 15078 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -101476,9 +101659,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 + 15063, + 1: __ccgo_ts + 15085, + 2: __ccgo_ts + 15069, } // C documentation @@ -101498,7 +101681,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+15068, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15093, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -101523,7 +101706,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)*12))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12597, 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 @@ -101954,7 +102137,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+15268, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15293, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102836,11 +103017,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+15326, 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+15355, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102944,7 +103125,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 @@ -103001,7 +103182,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+15404, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15429, -int32(1)) return } if argc == int32(3) { @@ -104720,7 +104906,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+15437, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15462, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+4) @@ -104802,7 +104988,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*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 @@ -104874,28 +105060,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+15507, 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+15515, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -104927,13 +105113,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 + 15523 + } else { + v2 = __ccgo_ts + 15527 + } + 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.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+15530, -int32(1)) + return +} + // C documentation // // /* @@ -104945,6 +105267,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) @@ -104955,7 +105281,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) @@ -105479,7 +105805,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11393, + 0: __ccgo_ts + 11418, } // C documentation @@ -105639,7 +105965,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+15553, int32(4), libc.UintptrFromInt32(0)) } } @@ -105700,7 +106026,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+12636, -int32(1)) return } if argc == int32(2) { @@ -105810,7 +106136,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) { @@ -105892,7 +106218,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+15406, -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) @@ -106242,7 +106568,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+15558, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -106271,8 +106597,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+15564, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15564, 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 @@ -106452,11 +106778,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 @@ -106560,7 +106886,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))) } /* @@ -106573,542 +106899,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 + 15517, + FzName: __ccgo_ts + 15569, }, 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 + 15537, + FzName: __ccgo_ts + 15589, }, 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 + 15550, + FzName: __ccgo_ts + 15602, }, 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 + 15568, + FzName: __ccgo_ts + 15620, }, 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 + 15629, }, 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 + 15637, }, 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 + 15637, }, 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 + 15652, }, 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 + 15678, }, 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 + 15651, + FzName: __ccgo_ts + 15703, }, 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 + 15660, + FzName: __ccgo_ts + 15712, }, 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 + 15671, + FzName: __ccgo_ts + 15723, }, 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 + 15678, + FzName: __ccgo_ts + 15730, }, 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 + 15692, + FzName: __ccgo_ts + 15744, }, 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 + 15692, + FzName: __ccgo_ts + 15744, }, 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 + 15698, + FzName: __ccgo_ts + 15750, }, 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 + 15698, + FzName: __ccgo_ts + 15750, }, 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 + 15704, + FzName: __ccgo_ts + 15756, }, 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 + 15704, + FzName: __ccgo_ts + 15756, }, 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 + 15761, }, 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 + 15761, }, 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 + 15713, + FzName: __ccgo_ts + 15765, }, 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 + 15713, + FzName: __ccgo_ts + 15765, }, 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 + 15769, }, 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 + 15776, }, 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 + 15784, }, 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 + 15791, }, 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 + 15804, }, 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 + 15810, }, 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 + 15817, }, 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 + 15824, }, 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 + 15832, }, 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 + 15837, }, 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 + 15841, }, 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 + 15841, }, 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 + 15847, }, 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 + 15853, }, 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 + 15859, }, 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 + 15863, }, 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 + 15863, }, 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 + 15869, }, 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 + 15876, }, 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 + 15886, }, 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 + 15893, }, 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 + 15900, }, 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 + 15911, }, 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 + 15918, }, 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 + 15933, }, 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 + 15950, }, 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 + 15961, }, 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 + 15968, }, 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(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 15974, }, 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 + 15987, }, 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 + 16005, }, 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 + 16013, }, 55: { - 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 + 15972, - }, - 56: { 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 + 16027, + }, + 56: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16035, }, 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 + 16044, }, 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 + 16044, }, 59: { - 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, + 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 + 16051, }, 60: { - 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, + 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 + 16051, }, 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 + 15999, + FzName: __ccgo_ts + 16061, }, 62: { - 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, + 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 + 16065, }, 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(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16003, + 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 + 16071, }, 64: { - 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, + 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 + 16075, }, 65: { - 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, + 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 + 16075, }, 66: { - FnArg: int16(2), + 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 + 16022, + FzName: __ccgo_ts + 16081, }, 67: { 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, + 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 + 16081, }, 68: { 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, + 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 + 16094, }, 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 + 16105, + }, + 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 + 15564, + }, + 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, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16038, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1240, + FzName: __ccgo_ts + 15564, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1248, + FzName: __ccgo_ts + 16110, }, 73: { 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 + 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 + 16049, + 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 + 16052, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16115, }, 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 + 16056, + FzName: __ccgo_ts + 16121, }, 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 + 16062, + FpUserData: uintptr(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 16124, }, 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 + 16052, + FpUserData: uintptr(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 16128, }, 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, + FfuncFlags: 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 + 16134, }, 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 + 16124, }, 81: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16075, - }, - 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, - }, - 83: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16085, - }, - 84: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16090, - }, - 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, - }, - 86: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16100, - }, - 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, - }, - 88: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16110, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, }, + 82: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16143, + }, + 83: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16147, + }, + 84: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16153, + }, + 85: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16157, + }, + 86: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16162, + }, + 87: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16167, + }, + 88: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16172, + }, + 89: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16178, + }, + 90: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16182, + }, + 91: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16186, + }, + 92: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16190, + }, + 93: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16195, + }, + 94: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16200, + }, 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 + 16205, }, 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 + 16211, }, 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 + 16217, }, 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 + 16223, }, 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 + 16228, }, 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 + 16236, }, 101: { - 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, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16244, }, 102: { - 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, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16247, }, 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 + 6885, + }, + 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 + 16184, + FzName: __ccgo_ts + 16252, + }, + 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 + 16256, }, } @@ -107167,109 +107504,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 ************************************************/ @@ -107586,7 +107925,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+16259, 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) @@ -108410,7 +108749,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 @@ -108697,11 +109036,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 8)) = TToken{ - Fz: __ccgo_ts + 6726, + Fz: __ccgo_ts + 6751, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 6722, + Fz: __ccgo_ts + 6747, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 { @@ -108765,7 +109104,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) @@ -109347,7 +109686,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8353, 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 } @@ -109413,11 +109752,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 } @@ -109742,7 +110081,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) @@ -109756,7 +110095,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 @@ -109791,7 +110130,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 @@ -109804,7 +110143,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 @@ -109931,27 +110270,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 */ @@ -110032,7 +110371,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++ @@ -110068,44 +110407,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+16232, 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+16304, 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+16273, 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+16345, 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 } } @@ -110127,31 +110450,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+88, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16377, 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 @@ -110175,10 +110498,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) @@ -110219,8 +110542,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-- } @@ -110237,28 +110560,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+16313, libc.VaList(bp+88, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16385, 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+16365, libc.VaList(bp+88, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16437, 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 @@ -110371,18 +110694,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 @@ -110392,13 +110715,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 } } } @@ -110409,14 +110732,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 } @@ -110433,16 +110756,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++ @@ -110553,11 +110876,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 */ @@ -110616,7 +110939,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16457) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16529) } goto insert_cleanup insert_cleanup: @@ -111012,7 +111335,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+48, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12597, 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('/'))) { @@ -113246,7 +113571,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+16578, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -113266,7 +113591,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16510, uint32(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16582, uint32(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } @@ -113278,7 +113603,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+16516, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16588, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113293,7 +113618,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+16559, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16631, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) @@ -113324,7 +113649,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+16663, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113333,7 +113658,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 + 16543, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -113566,7 +113891,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+16700, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -113620,63 +113945,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 + 16739, + 2: __ccgo_ts + 9274, + 3: __ccgo_ts + 16743, + 4: __ccgo_ts + 16748, + 5: __ccgo_ts + 16751, + 6: __ccgo_ts + 16761, + 7: __ccgo_ts + 16771, + 8: __ccgo_ts + 16777, + 9: __ccgo_ts + 16781, + 10: __ccgo_ts + 16786, + 11: __ccgo_ts + 16791, + 12: __ccgo_ts + 16799, + 13: __ccgo_ts + 16810, + 14: __ccgo_ts + 16813, + 15: __ccgo_ts + 16781, + 16: __ccgo_ts + 16820, + 17: __ccgo_ts + 16786, + 18: __ccgo_ts + 16828, + 19: __ccgo_ts + 16832, + 20: __ccgo_ts + 16837, + 21: __ccgo_ts + 16843, + 22: __ccgo_ts + 16781, + 23: __ccgo_ts + 16786, + 24: __ccgo_ts + 16850, + 25: __ccgo_ts + 16855, + 26: __ccgo_ts + 16858, + 27: __ccgo_ts + 16865, + 28: __ccgo_ts + 16777, + 29: __ccgo_ts + 16781, + 30: __ccgo_ts + 16871, + 31: __ccgo_ts + 16876, + 32: __ccgo_ts + 16881, + 33: __ccgo_ts + 16739, + 34: __ccgo_ts + 16781, + 35: __ccgo_ts + 16885, + 36: __ccgo_ts + 16892, + 37: __ccgo_ts + 16899, + 38: __ccgo_ts + 12013, + 39: __ccgo_ts + 12009, + 40: __ccgo_ts + 16907, + 41: __ccgo_ts + 16912, + 42: __ccgo_ts + 16917, + 43: __ccgo_ts + 9274, + 44: __ccgo_ts + 16922, + 45: __ccgo_ts + 5595, + 46: __ccgo_ts + 16928, + 47: __ccgo_ts + 16933, + 48: __ccgo_ts + 16124, + 49: __ccgo_ts + 16938, + 50: __ccgo_ts + 16739, + 51: __ccgo_ts + 16781, + 52: __ccgo_ts + 16951, + 53: __ccgo_ts + 16956, + 54: __ccgo_ts + 16965, + 55: __ccgo_ts + 16972, + 56: __ccgo_ts + 16983, } // C documentation @@ -113695,338 +114020,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16919, + FzName: __ccgo_ts + 16991, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16934, + FzName: __ccgo_ts + 17006, 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 + 17021, 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 + 17033, 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 + 17049, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16900, + FzName: __ccgo_ts + 16972, 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 + 17062, 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 + 17074, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17022, + FzName: __ccgo_ts + 17094, 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 + 17110, 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 + 17131, 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 + 17146, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17090, + FzName: __ccgo_ts + 17162, 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 + 17176, 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 + 17189, 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 + 17203, 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 + 17222, 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 + 17241, 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 + 17264, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17201, + FzName: __ccgo_ts + 17273, 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 + 17291, 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 + 17308, 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 + 17321, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17264, + FzName: __ccgo_ts + 17336, 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 + 17354, 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 + 17364, 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 + 17378, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17322, + FzName: __ccgo_ts + 17394, 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 + 17419, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17366, + FzName: __ccgo_ts + 17438, 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 + 17449, 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 + 17460, 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 + 17472, 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 + 17488, 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 + 17501, 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 + 17520, 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 + 17539, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17480, + FzName: __ccgo_ts + 17552, 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 + 17567, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17505, + FzName: __ccgo_ts + 17577, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17517, + FzName: __ccgo_ts + 17589, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17526, + FzName: __ccgo_ts + 17598, 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 + 17609, 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 + 17619, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17559, + FzName: __ccgo_ts + 17631, 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 + 17642, 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 + 17654, 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 + 17671, 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 + 17690, 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 + 17716, 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 + 17731, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17673, + FzName: __ccgo_ts + 17745, 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 + 17764, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17706, + FzName: __ccgo_ts + 17778, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17722, + FzName: __ccgo_ts + 17794, 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 + 17806, 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 + 17817, 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 + 17828, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -114034,45 +114359,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17768, + FzName: __ccgo_ts + 17840, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17779, + FzName: __ccgo_ts + 17851, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17800, + FzName: __ccgo_ts + 17872, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17808, + FzName: __ccgo_ts + 17880, 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 + 17895, 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 + 17908, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17855, + FzName: __ccgo_ts + 17927, 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 + 17942, 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)), @@ -114090,7 +114415,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 @@ -114198,10 +114523,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+17958) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17896) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17968) { return PAGER_LOCKINGMODE_NORMAL } } @@ -114219,13 +114544,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+17975) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17908) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17980) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -114248,10 +114573,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+16951) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17920) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+17992) == 0 { return int32(2) } else { return 0 @@ -114273,7 +114598,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+17927, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17999, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpBt) @@ -114403,15 +114728,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 + 18061 case int32(OE_SetDflt): - zName = __ccgo_ts + 17998 + zName = __ccgo_ts + 18070 case int32(OE_Cascade): - zName = __ccgo_ts + 18010 + zName = __ccgo_ts + 18082 case int32(OE_Restrict): - zName = __ccgo_ts + 18018 + zName = __ccgo_ts + 18090 default: - zName = __ccgo_ts + 18027 + zName = __ccgo_ts + 18099 break } return zName @@ -114432,12 +114757,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 + 18109, + 1: __ccgo_ts + 18116, + 2: __ccgo_ts + 18124, + 3: __ccgo_ts + 18128, + 4: __ccgo_ts + 17992, + 5: __ccgo_ts + 18137, } // C documentation @@ -114499,15 +114824,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 + 18162 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18092 + zType = __ccgo_ts + 18164 } 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+18166, 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: ; @@ -114516,9 +114841,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 + 18141, + 2: __ccgo_ts + 18146, + 3: __ccgo_ts + 18154, } // C documentation @@ -114617,7 +114942,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+136, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18173, libc.VaList(bp+136, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114660,7 +114985,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+3864, 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++ @@ -114705,7 +115030,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 @@ -114764,7 +115089,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+18177) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114807,7 +115132,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 @@ -114835,7 +115160,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 + 17968 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 @@ -114863,7 +115188,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 + 17958 } _returnSingleText(tls, v, zRet) break @@ -115153,7 +115478,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+18110, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18182, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -115163,7 +115488,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+136, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+136, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -115185,7 +115510,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+18207, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -115217,8 +115542,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+18188) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18260) == 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. */ @@ -115298,9 +115624,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 + 18266 } else { - v14 = __ccgo_ts + 18202 + v14 = __ccgo_ts + 18274 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 { v15 = int32(1) @@ -115371,7 +115697,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+136, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18281, 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)) @@ -115401,19 +115727,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 + 11012 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13235 + zType = __ccgo_ts + 13260 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18225 + zType = __ccgo_ts + 18297 } else { - zType = __ccgo_ts + 9249 + zType = __ccgo_ts + 9274 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18232, 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+18304, 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: ; @@ -115460,9 +115786,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+18239, libc.VaList(bp+136, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18311, libc.VaList(bp+136, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18244, 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+18316, 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 @@ -115486,11 +115812,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 + 18321, + 1: __ccgo_ts + 18323, + 2: __ccgo_ts + 16810, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18253, 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+18325, 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: ; @@ -115509,7 +115835,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+18259, 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+18331, 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: ; @@ -115526,7 +115852,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+136, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18335, libc.VaList(bp+136, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -115576,7 +115902,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+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: ; @@ -115588,7 +115914,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+7808, 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: ; @@ -115614,7 +115940,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+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+18275)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18338, 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+18347)) goto _32 _32: ; @@ -115628,8 +115954,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 @@ -115755,7 +116081,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+136, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18352, 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))) @@ -115851,7 +116177,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 @@ -115946,7 +116272,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+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+18356, 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) @@ -115957,7 +116283,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+18380) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -116093,7 +116419,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+18337, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18409, 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) @@ -116155,7 +116481,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))) } @@ -116177,7 +116503,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+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18445, 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) @@ -116190,7 +116516,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+18393, 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+18465, 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) { @@ -116198,7 +116524,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+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18487, 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) { @@ -116209,10 +116535,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+18438, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18510, -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+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18512, 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)) } } @@ -116246,7 +116572,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+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18532, 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) @@ -116270,9 +116596,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+18490) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18562) _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+18567) _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)) @@ -116285,9 +116611,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+18516) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18588) _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+18624) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -116315,9 +116641,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+18562) _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+18635) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -116345,7 +116671,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+18590) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18662) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -116442,7 +116768,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 + 18617 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*20 + 16)) = __ccgo_ts + 18689 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*20))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*20 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -116521,7 +116847,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+136, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18750, libc.VaList(bp+136, zRight)) } } } @@ -116626,13 +116952,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+17975) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18703) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18775) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18056) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18128) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116767,7 +117093,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 @@ -116797,7 +117123,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. @@ -116859,7 +117185,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+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18783, 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)) @@ -117132,34 +117458,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18620, + FzName: __ccgo_ts + 18692, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18625, + FzName: __ccgo_ts + 18697, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18631, + FzName: __ccgo_ts + 18703, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18640, + FzName: __ccgo_ts + 18712, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18649, + FzName: __ccgo_ts + 18721, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18657, + FzName: __ccgo_ts + 18729, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18665, + FzName: __ccgo_ts + 18737, }, 7: { - FzName: __ccgo_ts + 18672, + FzName: __ccgo_ts + 18744, }, 8: {}, } @@ -117255,14 +117581,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+18729) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18801) 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+232, int32(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18816, libc.VaList(bp+232, int32(cSep), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -117271,19 +117597,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+232, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18823, 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+18757) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18829) 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+18841) 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+24) if rc == SQLITE_OK { @@ -117298,7 +117624,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+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 @@ -117479,7 +117805,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+3864, 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) } @@ -117491,13 +117817,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+18784) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18856) if *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18792, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18864, 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+18796, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18868, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -117506,7 +117832,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+3864, 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) @@ -117632,24 +117958,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*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+18902, 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(143745)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*4)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*4)) } 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+18930, 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+18961, 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(143752)) } } } @@ -117657,9 +117983,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 + 18872, + 1: __ccgo_ts + 18879, + 2: __ccgo_ts + 18891, } // C documentation @@ -117735,7 +118061,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+14675) + _corruptSchema(tls, pData, argv, __ccgo_ts+14700) } } libc.SetBitFieldPtr8Uint32(db+168+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117768,11 +118094,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+18897) + _corruptSchema(tls, pData, argv, __ccgo_ts+18969) } 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+14675) + _corruptSchema(tls, pData, argv, __ccgo_ts+14700) } } } @@ -117811,18 +118137,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 + 9274 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 + 18982 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 44))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 44))).FiDb = iDb @@ -117906,7 +118232,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+12286) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12311) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117932,7 +118258,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+19054) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117947,7 +118273,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+19006, libc.VaList(bp+80, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19078, 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)) @@ -118276,8 +118602,8 @@ 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 @@ -118305,8 +118631,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 @@ -118365,7 +118691,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+19040, libc.VaList(bp+296, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19112, libc.VaList(bp+296, zDb)) goto end_prepare } } @@ -118381,7 +118707,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+19070, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19142, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -118404,10 +118730,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 { @@ -118415,7 +118741,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+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) @@ -118445,7 +118771,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(144552)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -118579,7 +118905,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(144701)) } /* 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 @@ -118839,7 +119165,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) @@ -118847,7 +119173,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 @@ -119003,15 +119329,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 + 11418 + zSp2 = __ccgo_ts + 11418 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+19161, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -119068,25 +119394,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) } @@ -119218,13 +119547,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 { @@ -119302,7 +119631,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+19119, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19191, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -119352,12 +119681,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+19169, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19241, 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. @@ -119372,9 +119701,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+19233, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19305, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -119384,6 +119714,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) @@ -119418,7 +119755,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), } @@ -119466,7 +119803,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 @@ -119511,7 +119848,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) @@ -119535,7 +119872,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) @@ -119556,7 +119893,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 @@ -119679,7 +120016,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 { @@ -119806,10 +120143,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 @@ -119817,7 +120154,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 @@ -119994,7 +120331,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+19342, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -120105,8 +120442,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) @@ -120114,7 +120451,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) } @@ -120199,13 +120536,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19290 + z = __ccgo_ts + 19362 case int32(TK_INTERSECT): - z = __ccgo_ts + 19300 + z = __ccgo_ts + 19372 case int32(TK_EXCEPT): - z = __ccgo_ts + 19310 + z = __ccgo_ts + 19382 default: - z = __ccgo_ts + 19317 + z = __ccgo_ts + 19389 break } return z @@ -120226,7 +120563,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+19395, libc.VaList(bp+8, zUsage)) } /* @@ -120263,13 +120600,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 + 19418 } 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+19432, 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+19463, 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) @@ -120293,11 +120630,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 @@ -120513,7 +120850,7 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr } if iCol < 0 { zType = __ccgo_ts + 1141 - *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 16850 + *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 16922 } 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)) @@ -120626,7 +120963,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 */ @@ -120635,7 +120972,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) @@ -120659,13 +120996,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 + 16922 } 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+12572, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12597, 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))) @@ -120673,7 +121010,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+19437, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19509, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120765,7 +121102,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 + 16850 + v3 = __ccgo_ts + 16922 } zName = v3 } else { @@ -120780,7 +121117,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+32, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19509, 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. @@ -120816,7 +121153,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+32, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19518, libc.VaList(bp+32, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -120935,7 +121272,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 + 19526 } else { zType = uintptr(0) j = int32(1) @@ -121001,7 +121338,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) } @@ -121029,7 +121366,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) } @@ -121079,7 +121416,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 @@ -121102,7 +121439,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 @@ -121250,7 +121587,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+19530, 0) return } /* Obtain authorization to do a recursive query */ @@ -121287,7 +121624,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 @@ -121298,7 +121635,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 @@ -121312,7 +121649,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 @@ -121343,7 +121680,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+19579, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -121358,7 +121695,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+19621, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -121386,7 +121723,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+19627, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -121441,9 +121778,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 + 19642 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19572, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19644, 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) { @@ -121551,8 +121888,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+19667, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19682, 0) } /* Generate code for the left and right SELECT statements. */ @@ -121577,7 +121914,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+19362, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121603,7 +121940,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 @@ -121629,7 +121966,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+19629, libc.VaList(bp+96, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19701, 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 @@ -121661,11 +121998,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 @@ -121687,7 +122024,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+19629, libc.VaList(bp+96, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19701, 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 @@ -121794,6 +122131,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) } @@ -121810,9 +122148,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+19722, 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+19768, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121883,7 +122221,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+19342, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -122131,7 +122469,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 { @@ -122185,16 +122523,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 + 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 @@ -122212,32 +122550,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+19778, libc.VaList(bp+64, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19850, 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+19789, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19861, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -122250,7 +122588,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+19866, 0) _sqlite3Select(tls, pParse, p, bp+28) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -122460,11 +122798,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 + 36)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } @@ -122625,7 +122963,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 @@ -122815,9 +123153,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. @@ -123029,7 +123367,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) @@ -123176,7 +123514,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) @@ -123466,7 +123804,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++ @@ -123535,7 +123873,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 @@ -123553,12 +123891,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 { @@ -124040,7 +124378,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 @@ -124086,13 +124424,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+15761) == 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+15765) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -124180,8 +124518,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+19872, 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 @@ -124205,7 +124543,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 @@ -124287,7 +124625,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) @@ -124305,7 +124643,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+19818, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19890, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -124453,7 +124791,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) } @@ -124481,7 +124819,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+19841, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 32)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19913, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 32)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+12+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -124503,12 +124841,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+19861, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19933, 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 @@ -124525,7 +124863,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 + 19976 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 { @@ -124556,7 +124894,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+19999, 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) } @@ -124565,9 +124903,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 + 19965 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20037 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19999 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20071 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -124616,7 +124954,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) { @@ -124626,7 +124964,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+20109, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124722,7 +125060,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) @@ -124731,7 +125069,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) } @@ -124782,7 +125120,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+20113, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124797,7 +125135,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+20080, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20152, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124812,7 +125150,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+15268, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15293, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124936,7 +125274,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 + 6720 + v10 = __ccgo_ts + 6745 } zSchemaName = v10 } @@ -124953,7 +125291,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+20111, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20183, 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) } @@ -125032,7 +125370,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+20116, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20188, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -125045,7 +125383,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+12597, 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) @@ -125065,9 +125403,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+20197, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20143, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20215, 0) } } } @@ -125081,7 +125419,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+20163, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20235, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -125330,7 +125668,7 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint (*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))) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -125383,7 +125721,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 @@ -125420,12 +125758,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+20194, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20266, 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+20245, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20317, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -125446,7 +125784,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+20350, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -125585,7 +125923,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 @@ -125693,7 +126031,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 @@ -125760,7 +126098,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 + 56))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 20311 + v1 = __ccgo_ts + 20383 } else { v1 = __ccgo_ts + 1667 } @@ -125769,7 +126107,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+20406, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125801,7 +126139,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)) @@ -125930,6 +126268,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. // */ @@ -125958,7 +126297,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+16075) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != uintptr(0) { @@ -125991,9 +126330,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 */ } @@ -126003,13 +126342,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 { @@ -126029,7 +126368,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) } @@ -126202,8 +126541,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 @@ -126212,11 +126551,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 { @@ -126232,7 +126571,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)) @@ -126256,14 +126595,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+128, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20418, 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) @@ -126364,7 +126703,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+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+20472, 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 @@ -126542,7 +126881,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 @@ -126565,14 +126904,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+20440, libc.VaList(bp+128, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20512, 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) @@ -126604,7 +126943,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 @@ -126619,7 +126958,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+20455, libc.VaList(bp+128, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20527, 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 { @@ -126641,7 +126980,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: @@ -126673,7 +127012,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 @@ -126706,7 +127045,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 @@ -126765,7 +127104,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 @@ -126794,6 +127133,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)) @@ -126816,10 +127162,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) @@ -126853,8 +127199,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 @@ -126869,8 +127215,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 @@ -126899,8 +127245,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++ } @@ -126930,11 +127276,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.Uint16FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+84, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+84, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy) @@ -126968,47 +127314,47 @@ 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)) /* 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)) /* Begin a loop that will extract all source rows in GROUP BY order. @@ -127018,16 +127364,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 @@ -127045,11 +127391,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 + 20543 } else { - v46 = __ccgo_ts + 20480 + v47 = __ccgo_ts + 20552 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19323, libc.VaList(bp+128, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19395, libc.VaList(bp+128, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -127063,8 +127409,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -127082,8 +127428,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -127094,12 +127440,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) @@ -127148,12 +127494,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++ } @@ -127223,9 +127573,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 @@ -127242,10 +127592,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 */ @@ -127272,8 +127622,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 } @@ -127313,32 +127663,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) @@ -127380,7 +127730,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+20543) } /* 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 @@ -127486,7 +127836,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)*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 } @@ -127502,7 +127852,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+20561, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -127592,7 +127942,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+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) } @@ -127754,7 +128104,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+20626, 0) goto trigger_cleanup } iDb = int32(1) @@ -127794,7 +128144,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+20600, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+4, pParse, iDb, __ccgo_ts+20672, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+4, pTableName) != 0 { goto trigger_cleanup } @@ -127804,11 +128154,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+20680, 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+20721, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127817,13 +128167,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+20672, (*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+20689, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20761, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127831,8 +128181,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+20787, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127840,15 +128190,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 + 20825 } else { - v1 = __ccgo_ts + 20760 + v1 = __ccgo_ts + 20832 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20766, libc.VaList(bp+64, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20838, 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+20803, libc.VaList(bp+64, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20875, libc.VaList(bp+64, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127868,9 +128218,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 @@ -127970,7 +128320,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+20600, bp+56) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20672, 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 } @@ -127992,7 +128342,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+72, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20921, libc.VaList(bp+72, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -128008,10 +128358,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+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+20969, 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+20972, libc.VaList(bp+72, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21044, libc.VaList(bp+72, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -128279,11 +128629,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+21073, 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) @@ -128321,9 +128671,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 + 6663 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6151 + v1 = __ccgo_ts + 6175 } zTab = v1 if iDb == int32(1) { @@ -128338,7 +128688,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)*16))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21093, 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) } @@ -128471,11 +128821,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 + 21155 } else { - v1 = __ccgo_ts + 21090 + v1 = __ccgo_ts + 21162 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21097, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21169, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -128577,7 +128927,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+21217, 0) return int32(1) } @@ -128725,12 +129075,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) { @@ -128738,19 +129088,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) @@ -128761,7 +129114,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 @@ -128775,7 +129128,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 { @@ -128843,7 +129196,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+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): @@ -128894,8 +129247,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 @@ -128942,10 +129295,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+21187, libc.VaList(bp+336, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21259, 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 @@ -128967,7 +129322,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 @@ -129039,7 +129394,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)) @@ -129455,13 +129810,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 @@ -129469,21 +129824,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 */ @@ -129530,7 +129885,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 @@ -129613,58 +129968,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+21201, 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+21273, 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+21237, 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+21309, 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 + 8096 + 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 { @@ -129694,17 +130037,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++ } @@ -129716,11 +130059,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 @@ -129736,11 +130079,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 @@ -129749,18 +130092,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++ } @@ -129769,16 +130112,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. */ @@ -129796,24 +130139,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 { @@ -129839,50 +130182,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) @@ -130180,8 +130523,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -130231,8 +130574,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++ @@ -130279,11 +130622,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)) } @@ -130295,11 +130638,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. */ @@ -130342,7 +130685,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+21328) } goto update_cleanup update_cleanup: @@ -130399,13 +130742,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) { @@ -130447,11 +130790,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 @@ -130776,9 +131119,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+21269, libc.VaList(bp+168, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+140, __ccgo_ts+21341, libc.VaList(bp+168, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21273, libc.VaList(bp+168, bp+140)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21345, libc.VaList(bp+168, bp+140)) return int32(SQLITE_ERROR) } goto _1 @@ -130867,13 +131210,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: @@ -130881,7 +131224,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+12686, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130963,7 +131306,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, uint32(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21350, uint32(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21418, uint32(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21422, uint32(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -131054,7 +131397,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 @@ -131093,17 +131436,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+21426) 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+21466) 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+21509) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -131120,7 +131463,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+21486) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21558) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_VacuumInto) @@ -131173,7 +131516,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+15063) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131204,11 +131547,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+21585, 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+21693, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131217,7 +131560,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+21747, 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 @@ -131227,7 +131570,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+21884, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -131754,7 +132097,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+12891, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12916, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131877,24 +132220,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+21935, libc.VaList(bp+8, pParse+204)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22007, 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+21959, 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+22031, 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+22058, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22130, 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 @@ -131935,7 +132283,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 @@ -131978,7 +132326,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+32, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22149, libc.VaList(bp+32, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -132020,9 +132368,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+22119, libc.VaList(bp+32, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22191, libc.VaList(bp+32, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3864, 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) @@ -132035,7 +132383,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 + 22221 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+32, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -132069,7 +132417,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+16813, 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 @@ -132150,13 +132498,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+22195, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22267, 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))) @@ -132237,7 +132585,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+22267, 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) @@ -132261,13 +132609,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 @@ -132280,12 +132628,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+22214, 0) + if *(*int32)(unsafe.Pointer(bp + 284)) != libc.Int32FromUint8(_aKeyword1[i]) { + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22286, 0) return int32(SQLITE_ERROR) } goto _1 @@ -132296,9 +132644,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(158352))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158354)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -132340,11 +132688,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 + 3864 + 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) } @@ -132754,7 +133102,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 @@ -132796,7 +133144,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 } @@ -132816,7 +133164,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) } @@ -132880,7 +133228,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(158849)) } else { ap = va switch op { @@ -132893,7 +133241,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(158871)) break } _ = ap @@ -133578,7 +133926,6 @@ type TWhereInfo1 = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo1 = TWhereInfo1 @@ -133614,10 +133961,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 + 22299 } if i == -int32(1) { - return __ccgo_ts + 16850 + return __ccgo_ts + 16922 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*12))).FzCnName } @@ -133636,10 +133983,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+22306, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22240, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22312, int32(1)) } i = 0 for { @@ -133647,7 +133994,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+13306, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133656,11 +134003,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+22312, int32(1)) } i = 0 for { @@ -133668,16 +134015,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+13306, 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)) } } @@ -133724,7 +134071,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+22314, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133732,12 +134079,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+22306, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22245 + v2 = __ccgo_ts + 22317 } else { - v2 = __ccgo_ts + 22250 + v2 = __ccgo_ts + 22322 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133754,7 +134101,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+22330) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133765,9 +134112,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+22332) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5175, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } // C documentation @@ -133812,11 +134159,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 + 22262 + v2 = __ccgo_ts + 22334 } else { - v2 = __ccgo_ts + 22269 + v2 = __ccgo_ts + 22341 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22274, libc.VaList(bp+136, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, 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 { @@ -133829,37 +134176,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 + 11444 + zFmt = __ccgo_ts + 11469 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22280 + zFmt = __ccgo_ts + 22352 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22313 + zFmt = __ccgo_ts + 22385 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22338 + zFmt = __ccgo_ts + 22410 } else { - zFmt = __ccgo_ts + 22356 + zFmt = __ccgo_ts + 22428 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22365, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22437, 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 + 16850 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22373, libc.VaList(bp+136, zRowid)) + zRowid = __ccgo_ts + 16922 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22445, 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+22404, libc.VaList(bp+136, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22476, libc.VaList(bp+136, zRowid)) cRangeOp = int8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133869,14 +134216,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22414, libc.VaList(bp+136, int32(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22486, libc.VaList(bp+136, 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+22491) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22441 + v3 = __ccgo_ts + 22513 } else { - v3 = __ccgo_ts + 22449 + v3 = __ccgo_ts + 22521 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+136, (*(*struct { FidxNum int32 @@ -133897,7 +134244,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+22527, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133963,14 +134310,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+22466, libc.VaList(bp+136, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22538, 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+22245, 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+22317, 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+22487, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22559, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -133994,16 +134341,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+22306, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22245, libc.VaList(bp+136, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22317, libc.VaList(bp+136, 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 @@ -134208,7 +134555,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 @@ -134287,7 +134634,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 */ @@ -134649,7 +134996,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 @@ -135062,7 +135409,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 @@ -135123,11 +135470,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 @@ -135158,6 +135505,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 { @@ -135296,7 +135646,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 @@ -135376,7 +135726,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 @@ -135410,7 +135760,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 @@ -135532,7 +135882,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 @@ -135725,7 +136075,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: @@ -135739,12 +136089,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 { @@ -135782,11 +136133,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 */ @@ -135806,7 +136157,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 } @@ -135842,21 +136193,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 @@ -135874,7 +136225,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, @@ -135929,7 +136280,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+22567, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135952,7 +136303,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+72, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22582, 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)) @@ -136441,9 +136792,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 @@ -136452,7 +136803,7 @@ 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+22519, libc.VaList(bp+64, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22591, libc.VaList(bp+64, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { @@ -136498,15 +136849,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 @@ -136518,7 +136870,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) { @@ -136989,19 +137341,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16699, + FzOp: __ccgo_ts + 16771, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16033, + FzOp: __ccgo_ts + 16105, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15512, + FzOp: __ccgo_ts + 15564, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22533, + FzOp: __ccgo_ts + 22605, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -137789,7 +138141,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+22612, 0) return } } else { @@ -137801,10 +138153,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+22612, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137885,7 +138237,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) @@ -137986,7 +138338,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 + 22581 + v13 = __ccgo_ts + 22653 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -138517,7 +138869,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+22660, 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) @@ -138589,7 +138941,6 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo @@ -138600,7 +138951,6 @@ type THiddenIndexInfo1 = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo1 = THiddenIndexInfo1 @@ -139633,7 +139983,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)<>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 @@ -142250,7 +142596,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { + })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x400>>10)) != 0)) { if libc.Int32FromUint16((*(*struct { FnEq Tu16 FnBtm Tu16 @@ -142454,7 +142800,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 @@ -142738,7 +143084,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) } } @@ -142916,7 +143262,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)) @@ -143257,7 +143603,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+22661, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22733, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143332,7 +143678,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+22661, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22733, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143486,7 +143832,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(168893)) /* 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) @@ -143922,7 +144268,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+22759, 0) rc = SQLITE_OK } else { break @@ -145130,7 +145476,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+22794, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145708,7 +146054,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 @@ -145864,7 +146210,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+22740, libc.VaList(bp+40, libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22812, 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 @@ -145885,10 +146231,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) @@ -145937,7 +146280,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+22840, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -146082,7 +146425,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 @@ -146116,7 +146460,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. @@ -146242,7 +146586,7 @@ 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 @@ -146273,16 +146617,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 @@ -146461,7 +146805,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 { @@ -146668,7 +147012,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 @@ -146678,7 +147022,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+22858, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146728,7 +147072,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 } @@ -146997,7 +147341,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+22887, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -147179,7 +147523,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+22943, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -147505,7 +147849,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+22988, libc.VaList(bp+8, zName)) } return p } @@ -147556,12 +147900,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+23007, 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+23078, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -147634,7 +147978,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 } @@ -147772,7 +148116,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( 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 { @@ -147916,7 +148260,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+23141, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147952,7 +148296,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)) } @@ -147967,7 +148311,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 @@ -147986,11 +148330,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 { @@ -148036,11 +148380,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 @@ -148057,7 +148401,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)) @@ -148079,7 +148423,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 @@ -148203,7 +148547,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+23167, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(100)) @@ -148271,18 +148615,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 + 23199 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23144 + zErr = __ccgo_ts + 23216 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23160 + zErr = __ccgo_ts + 23232 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23180, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23252, 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 { @@ -148306,7 +148650,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+23285, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -148412,24 +148756,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 @@ -148447,12 +148791,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) } @@ -148464,15 +148808,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 @@ -148524,11 +148868,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 + 23332, + 1: __ccgo_ts + 23385, + 2: __ccgo_ts + 22887, + 3: __ccgo_ts + 23436, + 4: __ccgo_ts + 23488, } var _aOp1 = [5]int32{ @@ -149108,7 +149452,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 } @@ -149204,7 +149548,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 '' */ @@ -149921,12 +150265,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 @@ -149934,13 +150278,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 @@ -149960,13 +150304,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 @@ -149993,7 +150337,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 @@ -150212,6 +150556,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. @@ -150272,7 +150620,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+23538, libc.VaList(bp+8, p)) } // C documentation @@ -150286,6 +150634,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) } @@ -150319,11 +150668,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 + 23562 } else { - v1 = __ccgo_ts + 23499 + v1 = __ccgo_ts + 23571 } - _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+23577, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -150332,7 +150681,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+23619, 0) } } } @@ -150438,7 +150787,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+23653, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -158895,20 +159244,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+16850, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+16922, 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+23619, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23691, 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+16763, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+16858, 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+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23691, 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 @@ -158949,7 +159298,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 */ @@ -159094,7 +159448,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 */ @@ -159184,9 +159543,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) } @@ -159541,7 +159900,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+23646) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), __ccgo_ts+23718) 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) { @@ -159891,9 +160250,9 @@ _237: */ _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 + 8077 + v347 = __ccgo_ts + 8102 } else { - v347 = __ccgo_ts + 8082 + v347 = __ccgo_ts + 8107 } *(*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 { @@ -160135,15 +160494,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+23655, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23727, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23750, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23822, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23834, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23906, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -160285,7 +160644,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 */ @@ -160479,7 +160838,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+23991, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -163210,14 +163569,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)< int32(65528) { sz = int32(65528) } - if cnt < 0 { + /* 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 > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } szAlloc = int64(sz) * int64(cnt) - if sz == 0 || cnt == 0 { + 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)) @@ -164693,7 +165061,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182779)) + return _sqlite3MisuseError(tls, int32(183820)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164713,7 +165081,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+24078, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -165014,14 +165382,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 + 24621 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint32(libc.Uint32FromInt64(116)/libc.Uint32FromInt64(4)) && _aMsg[rc] != uintptr(0) { @@ -165033,31 +165401,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 + 24146, + 1: __ccgo_ts + 24159, + 3: __ccgo_ts + 24175, + 4: __ccgo_ts + 24200, + 5: __ccgo_ts + 24214, + 6: __ccgo_ts + 24233, 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 + 24258, + 9: __ccgo_ts + 24295, + 10: __ccgo_ts + 24307, + 11: __ccgo_ts + 24322, + 12: __ccgo_ts + 24355, + 13: __ccgo_ts + 24373, + 14: __ccgo_ts + 24398, + 15: __ccgo_ts + 24427, + 17: __ccgo_ts + 6130, + 18: __ccgo_ts + 5534, + 19: __ccgo_ts + 24444, + 20: __ccgo_ts + 24462, + 21: __ccgo_ts + 24480, + 23: __ccgo_ts + 24514, + 25: __ccgo_ts + 24535, + 26: __ccgo_ts + 24561, + 27: __ccgo_ts + 24584, + 28: __ccgo_ts + 24605, } // C documentation @@ -165204,6 +165572,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 // // /* @@ -165236,7 +165618,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i 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(183430)) + return _sqlite3MisuseError(tls, int32(184509)) } 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) @@ -165279,7 +165661,7 @@ 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+24702, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165405,7 +165787,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+24765, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -165436,7 +165818,7 @@ 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) } @@ -165680,7 +166062,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(184046)) + return _sqlite3MisuseError(tls, int32(185125)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -165690,7 +166072,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+24816, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165812,7 +166194,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(184182))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185261))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165944,7 +166326,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(184261)) + return _sqlite3MisuseError(tls, int32(185340)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165954,7 +166336,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(184270)) + return _sqlite3MisuseError(tls, int32(185349)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -166003,7 +166385,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(184318)) + return _sqlite3MisuseError(tls, int32(185397)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -166012,7 +166394,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+24837, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -166159,7 +166541,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, 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+24905, 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 @@ -166189,8 +166571,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, uint32(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+24911, zUri+7, uint32(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24921, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -166279,24 +166661,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, uint32(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24949, 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+24881, zOpt, uint32(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24953, 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 + 24881 + zModeType = __ccgo_ts + 24953 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24902, zOpt, uint32(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24974, 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 + 3473 + zModeType = __ccgo_ts + 3499 } if aMode != 0 { mode = 0 @@ -166325,12 +166707,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+24989, 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+25009, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -166354,7 +166736,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+25033, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -166374,11 +166756,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24887, + Fz: __ccgo_ts + 24959, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24894, + Fz: __ccgo_ts + 24966, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -166389,19 +166771,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24907, + Fz: __ccgo_ts + 24979, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24910, + Fz: __ccgo_ts + 24982, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24913, + Fz: __ccgo_ts + 24985, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17920, + Fz: __ccgo_ts + 17992, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -166529,8 +166911,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+22653, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25049, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -166551,10 +166933,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(184993)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186072)) /* 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+4, bp+8) } @@ -166563,7 +166945,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 + 3864 + v2 = __ccgo_ts + 3890 } else { v2 = uintptr(0) } @@ -166590,9 +166972,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*16))).FzDbSName = __ccgo_ts + 23979 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FzDbSName = __ccgo_ts + 24051 (*(*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 { @@ -166686,7 +167068,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 + 25055 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166846,7 +167228,7 @@ 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) @@ -166903,20 +167285,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+25058, 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+25083) } 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+25103) } 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+25110) } // C documentation @@ -166941,9 +167323,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) @@ -166970,29 +167352,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 @@ -167047,15 +167418,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+25127, 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) @@ -167234,8 +167605,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 @@ -168075,7 +168446,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+25155, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -168293,7 +168664,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 + 25163 } else { v2 = uintptr(0) } @@ -168539,7 +168910,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 @@ -168756,6 +169127,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -169068,8 +169446,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 @@ -169126,7 +169504,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 @@ -169136,7 +169514,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 @@ -169174,18 +169552,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 + 25186, + 12: __ccgo_ts + 25192, 13: __ccgo_ts + 1667, 14: __ccgo_ts + 1667, 15: __ccgo_ts + 1667, @@ -169672,7 +170050,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) { @@ -169970,8 +170348,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 + 16)) += uint64(6) } } @@ -170107,7 +170485,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+64, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15507, 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)) @@ -170121,14 +170499,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+25144, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25199, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -170182,7 +170558,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+25228, -int32(1)) } } } @@ -170465,8 +170841,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 + 25243, + FzRepl: __ccgo_ts + 25247, }, 1: { Fc1: int8('i'), @@ -170474,8 +170850,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 + 25255, + FzRepl: __ccgo_ts + 25247, }, 2: { Fc1: int8('n'), @@ -170490,7 +170866,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25209, + FzMatch: __ccgo_ts + 25264, FzRepl: __ccgo_ts + 1653, }, 4: { @@ -170498,7 +170874,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25214, + FzMatch: __ccgo_ts + 25269, FzRepl: __ccgo_ts + 1653, }, } @@ -170514,7 +170890,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+25274, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -170532,23 +170908,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 } @@ -170626,7 +171002,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 @@ -170697,7 +171073,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) + } } } } @@ -170972,7 +171352,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+25317, 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') { @@ -171402,7 +171782,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 { @@ -171441,7 +171821,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8077, 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)) } @@ -171449,7 +171829,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8082, 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)) } @@ -171526,14 +171906,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+25243, 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+25326) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25278) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25333) } - 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+25339, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171718,7 +172098,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+25333) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171763,7 +172143,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+25228, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171776,7 +172156,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+25228, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171825,10 +172205,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) @@ -171862,15 +172238,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 @@ -171943,11 +172319,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: ; @@ -171996,9 +172372,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25192 + v19 = __ccgo_ts + 25247 } else { - v19 = __ccgo_ts + 11944 + v19 = __ccgo_ts + 11969 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -172034,9 +172410,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: ; @@ -172063,7 +172442,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25290, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25345, uint32(2)) zIn2++ sz2-- continue @@ -172086,7 +172465,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25293, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25348, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 25 @@ -172094,12 +172473,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25300, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25355, 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+25360, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -172279,7 +172658,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+25367, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172302,12 +172681,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+25370, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25312, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25367, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172322,50 +172701,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 // // /* @@ -172417,6 +172752,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 // // /* @@ -172437,6 +172850,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)) @@ -172509,9 +172925,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 @@ -172554,7 +172970,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 @@ -173042,7 +173469,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+25228, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -173177,7 +173604,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 } @@ -173278,7 +173705,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+25228, -int32(1)) return } @@ -173315,11 +173742,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+25199, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -173332,7 +173756,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+25228, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint32(56)) return int32(1) @@ -173351,10 +173775,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+25333) } 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+25326) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -173393,7 +173817,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+25373, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -173409,7 +173833,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. // ** @@ -173490,7 +173914,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+25228, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -173502,34 +173926,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; +// ** 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. +// ** 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) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { + 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 (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) - return 0 + 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 (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - 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 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) @@ -173612,7 +174056,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 @@ -173672,7 +174116,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+25228, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173807,7 +174251,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 + 25391 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173817,7 +174261,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+25228, -int32(1)) } } eErr = uint8(1) @@ -173927,23 +174371,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+25338, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25393, uint32(1)) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25340, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25395, 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+25397, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25345, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25400, uint32(1)) } } } @@ -173983,7 +174427,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+25228, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -174251,7 +174695,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+25228, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -174275,7 +174719,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+25402, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -174286,7 +174730,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+25398, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25453, -int32(1)) _jsonStringReset(tls, bp) return } @@ -174358,7 +174802,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+25228, -int32(1)) } } goto json_remove_done @@ -174395,7 +174839,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+16027) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -174426,9 +174870,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 + 25487 } else { - v1 = __ccgo_ts + 25436 + v1 = __ccgo_ts + 25491 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -174476,7 +174920,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+25228, -int32(1)) } } goto json_type_done @@ -174523,7 +174967,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 + 25443 + (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent = __ccgo_ts + 25498 (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FszIndent = libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent) @@ -174597,17 +175041,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+25448, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25503, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -174616,18 +175059,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 @@ -174689,9 +175131,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))) @@ -174798,7 +175238,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+25560, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174890,20 +175330,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))) + } } } @@ -174947,7 +175389,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+25563, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -175050,7 +175492,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+25566) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(16)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -175184,7 +175626,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+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+40, __ccgo_ts+25649, 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 @@ -175210,9 +175652,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+25601, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+40, __ccgo_ts+25656, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+40, __ccgo_ts+25609, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+40, __ccgo_ts+25664, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -175523,9 +175965,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))) @@ -175598,7 +176039,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+25615, uint32(1)) + _jsonAppendRaw(tls, p+40, __ccgo_ts+25670, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+168, i, bp) @@ -175622,7 +176063,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+25228, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175683,186 +176124,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 + 25672, }, 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 + 25622, + FzName: __ccgo_ts + 25677, }, 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 + 25683, }, 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 + 25639, + FzName: __ccgo_ts + 25694, }, 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 + 25706, }, 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 + 25706, }, 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 + 25724, }, 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 + 25744, }, 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 + 25702, + FzName: __ccgo_ts + 25757, }, 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 + 25716, + FzName: __ccgo_ts + 25771, }, 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 + 25719, + FzName: __ccgo_ts + 25774, }, 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 + 25778, }, 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 + 25735, + FzName: __ccgo_ts + 25790, }, 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 + 25803, }, 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 + 25760, + FzName: __ccgo_ts + 25815, }, 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 + 25828, }, 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 + 25784, + FzName: __ccgo_ts + 25839, }, 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 + 25851, }, 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 + 25851, }, 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 + 25863, }, 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 + 25874, }, 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 + 25831, + FzName: __ccgo_ts + 25886, }, 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 + 25899, }, 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 + 25857, + FzName: __ccgo_ts + 25912, }, 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 + 25871, + FzName: __ccgo_ts + 25926, }, 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 + 25880, + FzName: __ccgo_ts + 25935, }, 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 + 25945, }, 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 + 25945, }, 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 + 25955, }, 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 + 25955, }, 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 + 25966, }, 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 + 25928, + FzName: __ccgo_ts + 25983, }, 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 + 26001, }, 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 + 25964, + FzName: __ccgo_ts + 26019, }, } @@ -175945,17 +176386,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25983, + FzName: __ccgo_ts + 26038, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25993, + FzName: __ccgo_ts + 26048, 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 @@ -176063,7 +176506,6 @@ type TRtreeMatchArg = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - FaParam [1]TRtreeDValue } type RtreeMatchArg = TRtreeMatchArg @@ -176346,11 +176788,12 @@ type TRtreeMatchArg1 = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - 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 ** clang, since clang works hard to be gcc compatible. So the gcc @@ -176595,7 +177038,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+72) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26058, iNode, 0, pRtree+72) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -176900,7 +177343,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+26063, 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 { @@ -177817,7 +178260,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+26145) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -178126,7 +178569,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 } @@ -178134,7 +178577,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 @@ -178372,7 +178815,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: @@ -179307,7 +179750,7 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179324,7 +179767,7 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179352,7 +179795,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+26159, 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 { @@ -179362,11 +179805,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+26179, 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+26211, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -179580,7 +180023,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+26248, 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)) @@ -179634,9 +180077,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 + 26393 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+11798, 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) { @@ -179694,9 +180137,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 + 26449, + 1: __ccgo_ts + 5595, + 2: __ccgo_ts + 16922, } var _rtreeModule = Tsqlite3_module{ @@ -179740,21 +180183,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+26863, 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+26925, 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+26930, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26994, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27064, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179784,7 +180227,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 + 27113 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179799,31 +180242,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+27221, 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+27266, 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+13306, 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+27293, 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+27315, 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+27323, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179837,14 +180280,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 + 26454, + 1: __ccgo_ts + 26507, + 2: __ccgo_ts + 26552, + 3: __ccgo_ts + 26604, + 4: __ccgo_ts + 26658, + 5: __ccgo_ts + 26703, + 6: __ccgo_ts + 26761, + 7: __ccgo_ts + 26816, } // C documentation @@ -179902,7 +180345,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+27339, 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) @@ -179910,17 +180353,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+27359, 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+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))) @@ -179997,13 +180440,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+27547, uint32(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27602, 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+27553, 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+27608, 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) { @@ -180012,7 +180455,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+27577, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27632, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -180026,19 +180469,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+27659, 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))) } } } @@ -180061,7 +180504,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)) @@ -180072,7 +180515,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+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 @@ -180088,8 +180531,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27583, - 1: __ccgo_ts + 27594, + 0: __ccgo_ts + 27638, + 1: __ccgo_ts + 27649, } // C documentation @@ -180147,21 +180590,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+11393, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11418, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27607, libc.VaList(bp+584, (*(*TRtreeCell)(unsafe.Pointer(bp + 528))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27662, 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+27613, libc.VaList(bp+584, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 528 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27668, 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+27617, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+27672, int32(1)) goto _1 _1: ; @@ -180188,7 +180631,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+27674, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -180291,7 +180734,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) @@ -180306,11 +180749,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+27707, 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) } @@ -180344,7 +180787,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+27714, 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) @@ -180361,7 +180804,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+27759, libc.VaList(bp+8, iNode)) } } return pRet @@ -180390,8 +180833,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 + 27791, + 1: __ccgo_ts + 27845, } 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)) @@ -180404,21 +180847,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 + 27893 } else { - v1 = __ccgo_ts + 27846 + v1 = __ccgo_ts + 27901 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27855, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27910, 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 + 27893 } else { - v2 = __ccgo_ts + 27846 + v2 = __ccgo_ts + 27901 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27900, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27955, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -180463,7 +180906,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+28013, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -180481,7 +180924,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+28061, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -180514,19 +180957,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+28128, 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+28162, 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+28192, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -180571,12 +181014,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+28247, 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+28278, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -180605,7 +181048,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+64, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28345, libc.VaList(bp+64, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -180615,11 +181058,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+64, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26159, 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+28318, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28373, 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)) @@ -180635,8 +181078,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+28404, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28411, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -180663,7 +181106,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+28419, 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) } @@ -180714,13 +181157,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+28438, -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*4))) } @@ -180729,7 +181172,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 + 18689 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -181196,19 +181639,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+25338, int32(1)) + Xsqlite3_str_append(tls, x, __ccgo_ts+25393, int32(1)) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28434, 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+28489, 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+28445, 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+28500, 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) } @@ -181237,20 +181680,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+28456, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28511, 0) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28474, 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+28529, 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+28482, 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+28537, 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) { @@ -181258,14 +181701,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+28490, libc.VaList(bp+8, z)) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28545, libc.VaList(bp+8, z)) } goto _2 _2: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28494, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28549, 0) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -181311,8 +181754,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 @@ -181344,13 +181787,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 } @@ -181430,16 +181873,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 } @@ -181486,9 +181929,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: ; @@ -181714,7 +182157,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 // ** @@ -181753,7 +182196,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) } @@ -181857,7 +182300,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 @@ -181941,7 +182384,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 @@ -182225,7 +182668,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) { @@ -182394,13 +182837,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+27547, uint32(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27602, 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+28507, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28562, 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) @@ -182409,13 +182852,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)*4)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28584, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27604, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27659, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -182423,7 +182866,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) @@ -182438,7 +182881,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+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 @@ -182650,7 +183093,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 + 16922 (*(*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) @@ -182660,7 +183103,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 + 28588 (*(*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) @@ -182668,7 +183111,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 + 28594 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182788,7 +183231,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+28548, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28603, 0) } goto geopoly_update_end } @@ -182891,12 +183334,12 @@ geopoly_update_end: func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28588) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28643) == 0 { *(*uintptr)(unsafe.Pointer(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 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28659) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) @@ -182967,7 +183410,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+28836, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -182981,61 +183424,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28619, + FzName: __ccgo_ts + 28674, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28632, + FzName: __ccgo_ts + 28687, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28645, + FzName: __ccgo_ts + 28700, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28658, + FzName: __ccgo_ts + 28713, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28604, + FzName: __ccgo_ts + 28659, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28670, + FzName: __ccgo_ts + 28725, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28588, + FzName: __ccgo_ts + 28643, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28693, + FzName: __ccgo_ts + 28748, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28707, + FzName: __ccgo_ts + 28762, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28720, + FzName: __ccgo_ts + 28775, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28734, + FzName: __ccgo_ts + 28789, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28750, + FzName: __ccgo_ts + 28805, }, } @@ -183061,7 +183504,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28762, + FzName: __ccgo_ts + 28817, }, } @@ -183086,20 +183529,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+28844, 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+28854, 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+28865, -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+28588, 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+28876, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -183173,7 +183616,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) @@ -183201,7 +183644,7 @@ 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+26145, __ccgo_fp(_rtreeMatchArgFree)) } } } @@ -183442,7 +183885,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 @@ -184418,7 +184861,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+28886, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -184428,7 +184871,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+28886, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -184454,7 +184897,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 @@ -184477,7 +184920,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 } @@ -184609,7 +185052,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+36) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28907, uintptr(0), uintptr(0), p+36) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184698,7 +185141,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+26003, zIn, uint32(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+26058, 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')) { @@ -184735,13 +185178,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 + 29023 + v1 = __ccgo_ts + 29078 } else { v1 = __ccgo_ts + 1667 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29064, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29119, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+4, p+36, __ccgo_ts+29214) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+4, p+36, __ccgo_ts+29269) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184908,7 +185351,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))) } } @@ -184969,7 +185412,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+29339, 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+29394, 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 @@ -184979,7 +185422,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+29458, 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+29513, libc.VaList(bp+24, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -184987,7 +185430,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+29479, 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+29534, 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) @@ -184999,7 +185442,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+29530, 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+29585, 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 { @@ -185043,7 +185486,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+29551, 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+29606, 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))) { @@ -185056,7 +185499,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+29579, 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+29634, 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 { @@ -185109,7 +185552,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+20125, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20197, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -185120,7 +185563,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+29608, 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+29663, 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) @@ -185131,7 +185574,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+29682, 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 @@ -185139,7 +185582,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+29632, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29687, zName) { bRbuRowid = int32(1) } } @@ -185153,17 +185596,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 + 29697 } else { - v4 = __ccgo_ts + 29655 + v4 = __ccgo_ts + 29710 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29664, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29719, 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+29693, 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+29748, 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)) @@ -185185,7 +185628,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+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29770, 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)) @@ -185231,8 +185674,8 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+29742, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15149 + zList = _rbuMPrintf(tls, p, __ccgo_ts+29797, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15174 goto _1 _1: ; @@ -185266,7 +185709,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+29751, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29806, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -185314,21 +185757,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+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+36, Xsqlite3_mprintf(tls, __ccgo_ts+29819, 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+29851, 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+15174, __ccgo_ts+29874) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29880, __ccgo_ts+29887, __ccgo_ts+5201) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15174, __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+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+36, Xsqlite3_mprintf(tls, __ccgo_ts+29895, 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+29937, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -185380,7 +185823,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+36, Xsqlite3_mprintf(tls, __ccgo_ts+29579, 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+29634, 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)) @@ -185402,15 +185845,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 + 29902 + zCol = __ccgo_ts + 29957 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*4)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29910, libc.VaList(bp+16, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29931, libc.VaList(bp+16, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29967, libc.VaList(bp+16, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15149 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29965, libc.VaList(bp+16, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29986, libc.VaList(bp+16, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30022, libc.VaList(bp+16, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15174 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -185419,7 +185862,7 @@ 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+29994, 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+30049, 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 + 1667 iCol = 0 @@ -185436,15 +185879,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+30042, libc.VaList(bp+16, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15149 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30097, libc.VaList(bp+16, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15174 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30049, libc.VaList(bp+16, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30104, libc.VaList(bp+16, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -185502,7 +185945,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+36, 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+36, Xsqlite3_mprintf(tls, __ccgo_ts+29634, 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)) @@ -185511,7 +185954,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)*8))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FzSpan, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30116, 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 { @@ -185531,9 +185974,9 @@ 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 + 29902 + zCol = __ccgo_ts + 29957 } else { - zCol = __ccgo_ts + 29632 + zCol = __ccgo_ts + 29687 } } zType = __ccgo_ts + 1141 @@ -185541,24 +185984,24 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter 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+30083, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30138, 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 + 29874 } 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+30158, 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+30179, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30212, 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 + 15174 + zAnd = __ccgo_ts + 22306 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185612,11 +186055,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+30181, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30236, 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+30248, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15149 + zS = __ccgo_ts + 15174 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -185628,7 +186071,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+30257, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -185654,7 +186097,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+30272, 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 @@ -185664,15 +186107,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+30286, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22306 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30243, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30298, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1667 i1 = 0 @@ -185682,8 +186125,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+30293, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22234 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30348, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22306 } goto _2 _2: @@ -185706,7 +186149,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+30361, 0) } // C documentation @@ -185748,16 +186191,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)*4)), i+int32(1))) - zSep = __ccgo_ts + 15149 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30348, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) + zSep = __ccgo_ts + 15174 } 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)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) - zSep = __ccgo_ts + 15149 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30387, 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 + 15174 } 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)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) - zSep = __ccgo_ts + 15149 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30417, 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 + 15174 } } } @@ -185841,16 +186284,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 + 30454 *(*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+29551, 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+29606, 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+16738) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16810) == 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+29579, 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+29634, libc.VaList(bp+16, zIdx))) } break } @@ -185861,16 +186304,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 + 29819 + v1 = __ccgo_ts + 29874 } else { v1 = __ccgo_ts + 1667 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30412, libc.VaList(bp+16, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15149 + z = _rbuMPrintf(tls, p, __ccgo_ts+30467, libc.VaList(bp+16, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15174 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30423, libc.VaList(bp+16, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30478, libc.VaList(bp+16, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) } return z @@ -185916,7 +186359,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+36, __ccgo_ts+30427) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+30482) 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))) { @@ -185924,7 +186367,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+29579, 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+29634, 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))) { @@ -185933,21 +186376,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+30477, 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+30532, 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 + 29819 + v1 = __ccgo_ts + 29874 } else { v1 = __ccgo_ts + 1667 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30499, libc.VaList(bp+16, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15149 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30554, libc.VaList(bp+16, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15174 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30509, libc.VaList(bp+16, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30564, 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+6715, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30524, 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+6715, 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+30579, 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)) } } @@ -185984,7 +186427,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) { @@ -185993,19 +186436,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)*4)) *(*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 + 30641 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30599 + v2 = __ccgo_ts + 30654 } 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)*4)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 15149 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30664, 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 + 15174 goto _1 _1: ; @@ -186014,17 +186457,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+30691, 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 + 30698 } 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+30713, 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)) } } @@ -186050,7 +186493,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+30690, 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+30745, libc.VaList(bp+8, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -186096,7 +186539,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+30747) + *(*int32)(unsafe.Pointer(bp + 4)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+30802) } 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)) @@ -186265,7 +186708,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+24, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30868, libc.VaList(bp+24, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -186282,18 +186725,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+6715, 0, int32(1))) - 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+30833, 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+6715, 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+30888, 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+30898, 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+30953, 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+30934, 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+30989, 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 { @@ -186308,26 +186751,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 + 31023 } else { - v2 = __ccgo_ts + 30972 + v2 = __ccgo_ts + 31027 } v1 = v2 } else { v1 = __ccgo_ts + 1667 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30978, libc.VaList(bp+24, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31033, 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+31039, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31094, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 30968 + v3 = __ccgo_ts + 31023 } else { - v3 = __ccgo_ts + 30972 + v3 = __ccgo_ts + 31027 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31100, 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+31155, 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 { @@ -186346,8 +186789,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). */ @@ -186356,39 +186799,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 + 31314 } 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 + 31323 } else { v5 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31278, 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+31333, 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+31314, 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+31369, 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 + 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 + 31397 } /* 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 + 31409 } else { v6 = __ccgo_ts + 1667 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31371, 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+31447, libc.VaList(bp+24, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31426, 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+31502, 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+31746, libc.VaList(bp+24, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31801, libc.VaList(bp+24, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -186399,9 +186842,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 + 31900 } else { - v7 = __ccgo_ts + 31855 + v7 = __ccgo_ts + 31910 } zRbuRowid1 = v7 } @@ -186414,14 +186857,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+29957, 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+15174, __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 + 31921 } else { v8 = __ccgo_ts + 1667 } @@ -186431,11 +186874,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 + 23562 } else { v10 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+76, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31872, 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+31927, libc.VaList(bp+24, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -186523,9 +186966,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 + 31314 } - 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+31975, 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 } @@ -186552,7 +186995,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) } @@ -186599,7 +187042,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+31950, 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+32005, 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): @@ -186658,27 +187101,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+32035, 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+24, __ccgo_ts+3487, uint32(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32063, 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+6715, 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+32026, libc.VaList(bp+8, p+24)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32081, 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+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 } @@ -186711,10 +187154,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+32147, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24833, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint32(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24905, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint32(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186730,14 +187173,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 + 32179 } 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+32181, 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 @@ -186748,27 +187191,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+32213, -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+32228, 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+32245, -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+32261, 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+32289, 0) } } @@ -186854,7 +187297,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { if pState == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32206, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32261, uintptr(0), uintptr(0), uintptr(0)) } } /* Assuming no error has occurred, run a "restart" checkpoint with the @@ -186887,7 +187330,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CAPTURE) - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32252, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32307, uintptr(0), uintptr(0), uintptr(0)) if rc2 != int32(SQLITE_NOTICE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -187020,16 +187463,16 @@ 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) + 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_methods1)(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) } - 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)) @@ -187051,7 +187494,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+32342, 0) } // C documentation @@ -187068,13 +187511,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+32367, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32374, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -187206,7 +187649,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+24462, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -187342,7 +187785,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+32326) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+36, __ccgo_ts+32381) 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 @@ -187355,7 +187798,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+32403, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -187382,7 +187825,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+32375, 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+32430, 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))) @@ -187418,9 +187861,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+32535, 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+32590, 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+32605, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -187443,9 +187886,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+32570, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32625, 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+32595) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32650) } 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) @@ -187456,10 +187899,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+32703) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32758) } 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+32768) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, __ccgo_ts+32823) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -187477,7 +187920,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+32812, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32867, uintptr(0), uintptr(0), p+36) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -187504,8 +187947,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+17895) + _rbuCopyPragma(tls, p, __ccgo_ts+17006) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -187513,7 +187956,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+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32892, libc.VaList(bp+16, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -187535,10 +187978,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+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15078, 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+15053, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15078, uintptr(0), uintptr(0), p+36) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -187625,7 +188068,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+32920, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -187648,10 +188091,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+32367, 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) } @@ -187673,7 +188116,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+32945, 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) @@ -187720,7 +188163,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+32901, libc.VaList(bp+16, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+32956, 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 { @@ -187765,11 +188208,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+33028, 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+32987) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+33042) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187778,7 +188221,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+33044) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+33099) 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) @@ -187826,7 +188269,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+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 @@ -187858,7 +188301,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+33173, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187880,17 +188323,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 + 33205 } else { - v3 = __ccgo_ts + 33157 + v3 = __ccgo_ts + 33212 } - (*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+33219, 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+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15063, 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) @@ -187902,21 +188345,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+17609) + _rbuCopyPragma(tls, p, __ccgo_ts+17021) } /* 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+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33251, 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+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+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33267, uintptr(0), uintptr(0), p+36) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -187994,7 +188437,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+33236, zState+uintptr(n-uint32(7)), uint32(7)) { + if n >= uint32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33291, zState+uintptr(n-uint32(7)), uint32(7)) { return _rbuMisuseError(tls) } } @@ -188041,7 +188484,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+31259, uint32(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31314, 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++ @@ -188069,7 +188512,7 @@ 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+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15078, 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) { @@ -188078,7 +188521,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { } _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+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15078, uintptr(0), uintptr(0), p+36) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+52) @@ -188088,7 +188531,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+33299, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -188189,7 +188632,7 @@ 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+15078, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ @@ -188202,19 +188645,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { 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+15078, 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 + 15063 } else { - v1 = __ccgo_ts + 33196 + v1 = __ccgo_ts + 33251 } 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+33251, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -188700,7 +189143,7 @@ func _rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileSize})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, pSize) /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existence of a *-wal file. rbuVfsRead() contains ** similar logic. */ if rc == SQLITE_OK && *(*Tsqlite_int64)(unsafe.Pointer(pSize)) == 0 && (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpRbu)).FzTarget == uintptr(0) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_MAIN_DB) != 0 { *(*Tsqlite_int64)(unsafe.Pointer(pSize)) = int64(1024) @@ -188781,7 +189224,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xControl})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, int32(SQLITE_FCNTL_ZIPVFS), bp) if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33271, 0) + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33326, 0) } else { if rc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p @@ -188807,7 +189250,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r if rc == SQLITE_OK && op == int32(SQLITE_FCNTL_VFSNAME) { pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs zIn = *(*uintptr)(unsafe.Pointer(pArg)) - zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33294, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33349, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -189002,7 +189445,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag if pDb != 0 { if (*Trbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == int32(RBU_STAGE_OAL) { if (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) { - zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6715) + zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6740) zOpen = Xsqlite3_filename_wal(tls, zOpen) } nOpen = libc.Xstrlen(tls, zOpen) @@ -189016,7 +189459,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag } else { (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu } - if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33305, 0) != 0 { + if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33360, 0) != 0 { oflags = libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) } @@ -189572,7 +190015,7 @@ func _statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint _sqlite3TokenInit(tls, bp, *(*uintptr)(unsafe.Pointer(argv + 3*4))) iDb = _sqlite3FindDb(tls, db, bp) if iDb < 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12382, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + 3*4)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12407, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + 3*4)))) return int32(SQLITE_ERROR) } } else { @@ -190072,7 +190515,7 @@ statNextRestart: (*(*TStatPage)(unsafe.Pointer(pCsr + 16))).FiPgno = iRoot (*(*TStatPage)(unsafe.Pointer(pCsr + 16))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33316, 0) + v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33371, 0) z = v1 (*(*TStatPage)(unsafe.Pointer(pCsr + 16))).FzPath = v1 if z == uintptr(0) { @@ -190110,8 +190553,8 @@ statNextRestart: if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { (*TStatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33318 - v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33327, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33373 + v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33382, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) z = v2 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v2 if z == uintptr(0) { @@ -190140,7 +190583,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage++ if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= libc.Int32FromUint32(libc.Uint32FromInt64(1280)/libc.Uint32FromInt64(40)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226029)) + return _sqlite3CorruptError(tls, int32(227304)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*40))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -190151,7 +190594,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+33339, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33394, 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) { @@ -190174,13 +190617,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 + 33402 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 + 33411 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33361 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33416 break } *(*int32)(unsafe.Pointer(pCsr + 1320)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -190189,7 +190632,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) { @@ -190278,12 +190721,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)*16))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33426, 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+33526, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33581, 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+33595, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -190360,7 +190803,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+33610, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -191654,11 +192097,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+11798, 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+33617, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1667, 0) @@ -191667,7 +192110,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+33747, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191693,7 +192136,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte += libc.Int64FromUint32(libc.Xstrlen(tls, __ccgo_ts+29902)) + nByte += libc.Int64FromUint32(libc.Xstrlen(tls, __ccgo_ts+29957)) 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))) @@ -191717,8 +192160,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+uint32(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+29957) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29957, nName+uint32(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)) = pAlloc pAlloc += uintptr(nName + uint32(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191782,7 +192225,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 @@ -191799,6 +192242,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 { @@ -191820,7 +192265,7 @@ 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+11798, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { @@ -192114,10 +192559,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 + 11393 + zSep = __ccgo_ts + 11418 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+33722, 0) + _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+33777, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -192129,8 +192574,8 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin v2 = __ccgo_ts + 1668 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+5145, libc.VaList(bp+24, zSep, zDflt)) - zSep = __ccgo_ts + 15149 + _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+5171, libc.VaList(bp+24, zSep, zDflt)) + zSep = __ccgo_ts + 15174 goto _1 _1: ; @@ -192784,8 +193229,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)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) - zSep = __ccgo_ts + 22234 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33784, 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 + 22306 if zRet == uintptr(0) { break } @@ -192814,8 +193259,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)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) - zSep = __ccgo_ts + 33804 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33818, 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 + 33859 if zRet == uintptr(0) { break } @@ -192826,7 +193271,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 } @@ -192837,12 +193282,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 + 33864 } 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+33875, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192903,11 +193348,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15149 + v2 = __ccgo_ts + 15174 } 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)*4)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33954, 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 } @@ -192935,7 +193380,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+33973, 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 { @@ -192964,17 +193409,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)) @@ -192987,7 +193433,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 } @@ -192998,18 +193446,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+34030, 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+34061, libc.VaList(bp+48, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -193035,7 +193509,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+33975, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34082, 0) } rc = int32(SQLITE_SCHEMA) } @@ -193367,7 +193841,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+5207, 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) } @@ -193667,12 +194141,12 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt *(*TSessionBuffer)(unsafe.Pointer(bp + 16)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 28)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+16, __ccgo_ts+34002, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11773, zTab) { - _sessionAppendStr(tls, bp+16, __ccgo_ts+34006, bp) - _sessionAppendStr(tls, bp+28, __ccgo_ts+34030, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+34039, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34084, bp) + _sessionAppendStr(tls, bp+16, __ccgo_ts+34109, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11798, zTab) { + _sessionAppendStr(tls, bp+16, __ccgo_ts+34113, bp) + _sessionAppendStr(tls, bp+28, __ccgo_ts+34137, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34146, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34191, bp) } else { i = 0 for { @@ -193680,17 +194154,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+15149, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+15174, 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 + 15149 + zSep = __ccgo_ts + 15174 _sessionAppendIdent(tls, bp+28, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), bp) - _sessionAppendPrintf(tls, bp+40, bp, __ccgo_ts+34098, libc.VaList(bp+64, i+int32(1))) + _sessionAppendPrintf(tls, bp+40, bp, __ccgo_ts+34205, libc.VaList(bp+64, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+16, bp, __ccgo_ts+34102, 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+34209, libc.VaList(bp+64, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) } goto _1 _1: @@ -193704,7 +194178,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+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+34236, 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) } @@ -193846,7 +194320,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, 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+34171, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 12)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34278, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 12)) } @@ -193952,7 +194426,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } } 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+34298, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 12)) } @@ -194207,13 +194681,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 } } @@ -194369,7 +194844,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(230285)) + rc = _sqlite3CorruptError(tls, int32(231591)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -194393,7 +194868,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(230305)) + rc = _sqlite3CorruptError(tls, int32(231611)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -194408,7 +194883,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(230315)) + rc = _sqlite3CorruptError(tls, int32(231621)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -194464,7 +194939,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(230363)) + rc = _sqlite3CorruptError(tls, int32(231669)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -194569,7 +195044,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(230451)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231757)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -194640,8 +195115,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) @@ -194675,7 +195150,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(230537)) + v7 = _sqlite3CorruptError(tls, int32(231843)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194685,7 +195160,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(230543)) + v10 = _sqlite3CorruptError(tls, int32(231849)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194764,7 +195239,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(230587)) + v16 = _sqlite3CorruptError(tls, int32(231893)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -195174,7 +195649,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230952)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232258)) goto finished_invert } if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf >= _sessions_strm_chunk_size { @@ -195377,7 +195852,7 @@ 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+11773) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11798) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -195386,9 +195861,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 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+34209, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34316, bp) _sessionAppendIdent(tls, bp+4, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34222, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34329, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -195398,9 +195873,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+34228, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34335, bp) _sessionAppendInteger(tls, bp+4, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15149 + zSep = __ccgo_ts + 15174 } goto _2 _2: @@ -195409,7 +195884,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+4, __ccgo_ts+34233, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34340, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -195418,13 +195893,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+34241, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34348, bp) } else { _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34316, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34423, bp) _sessionAppendInteger(tls, bp+4, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22234 + zSep = __ccgo_ts + 22306 } goto _3 _3: @@ -195511,9 +195986,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 4)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+4, __ccgo_ts+34322, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34429, bp) _sessionAppendIdent(tls, bp+4, zTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34233, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34340, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -195523,9 +195998,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+34228, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34335, bp) _sessionAppendInteger(tls, bp+4, i+int32(1), bp) - zSep = __ccgo_ts + 22234 + zSep = __ccgo_ts + 22306 } goto _1 _1: @@ -195533,9 +196008,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+4, __ccgo_ts+34340, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34447, bp) _sessionAppendInteger(tls, bp+4, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+33804, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+33859, bp) zSep = __ccgo_ts + 1667 i = 0 for { @@ -195545,16 +196020,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+34316, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34423, bp) _sessionAppendInteger(tls, bp+4, i+int32(1), bp) - zSep = __ccgo_ts + 34348 + zSep = __ccgo_ts + 34455 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+5175, 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)) @@ -195580,7 +196055,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+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 @@ -195603,16 +196078,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+34353, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34460, bp) _sessionAppendIdent(tls, bp+4, zTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+22240, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+22312, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+4, __ccgo_ts+15149, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+15174, bp) } _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp) goto _1 @@ -195620,19 +196095,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+34371, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34478, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+4, __ccgo_ts+34382, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34489, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+5175, 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)) } @@ -195655,12 +196130,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+11798, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34386) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34493) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+4, __ccgo_ts+34499) + rc = _sessionPrepare(tls, db, p+4, __ccgo_ts+34606) } return rc } @@ -195726,7 +196201,7 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231434)) + rc = _sqlite3CorruptError(tls, int32(232740)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -196142,7 +196617,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+34750, 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)) @@ -196155,7 +196630,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+34771, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -196255,10 +196730,10 @@ 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+34683, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34790, 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+34816, 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)) @@ -196289,7 +196764,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui ** 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)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, 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 @@ -196299,7 +196774,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+6715, *(*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 } @@ -196318,18 +196793,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+34739, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34846, 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+34783, 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+34890, 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+34854, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34961, 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+11773) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11798) { v2 = _sessionStat1Sql(tls, db, bp+4) rc = v2 if v2 != 0 { @@ -196386,17 +196861,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34914, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35021, 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+35051, 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+35075, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35051, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FbRebase != 0 { @@ -197172,7 +197647,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 { @@ -197208,11 +197683,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 @@ -197797,6 +198278,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 @@ -197842,8 +198324,7 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset @@ -197855,12 +198336,13 @@ type Fts5Colset = TFts5Colset ** This object is used by fts5_expr.c and fts5_index.c. */ type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 + FnCol 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 ** to parse the arguments passed to the CREATE VIRTUAL TABLE statement. @@ -198237,7 +198719,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -198265,16 +198746,14 @@ 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 @@ -198316,7 +198795,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 @@ -199120,7 +199599,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+35103, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -199476,7 +199955,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+35131, 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 */ } @@ -199760,7 +200239,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+35055, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35162, 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) } @@ -199859,7 +200338,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 + 35062 + zErr = __ccgo_ts + 35169 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200114,7 +200593,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 + 35112 + zErr = __ccgo_ts + 35219 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200385,7 +200864,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))) @@ -200477,13 +200956,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) } @@ -200509,13 +200988,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 + 35160 + z = __ccgo_ts + 35267 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 + 35323 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -200548,19 +201027,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35274, + FzFunc: __ccgo_ts + 35381, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35282, + FzFunc: __ccgo_ts + 35389, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35292, + FzFunc: __ccgo_ts + 35399, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35297, + FzFunc: __ccgo_ts + 35404, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200948,7 +201427,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 @@ -201424,7 +201903,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+35313, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35420, 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) { @@ -201450,12 +201929,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+35427, 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+48, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35458, libc.VaList(bp+48, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201464,7 +201943,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+35491, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201474,14 +201953,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+35528, 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+35430, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35537, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -201508,7 +201987,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+35570, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -201520,76 +201999,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+35604, 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+35612, 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+48, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35644, 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+35543, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35650, 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+35669, 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+35712, 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+35669, 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+35734, 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+35748, 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+35786, 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+35797, 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+35832, 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+35839, 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 + 4)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 8409, + FzName: __ccgo_ts + 8434, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 17903, + FzName: __ccgo_ts + 17975, }, 2: { - FzName: __ccgo_ts + 35763, + FzName: __ccgo_ts + 35870, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -201597,20 +202076,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+35771, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35878, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35802, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35909, 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+35919, 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+48, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35953, libc.VaList(bp+48, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201671,16 +202150,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+35981) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16922) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35986, 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+36016) { *(*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+36026, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201706,7 +202185,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+35950, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36057, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201714,12 +202193,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+35955, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36062, 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+35962, libc.VaList(bp+24, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36069, libc.VaList(bp+24, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35970, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36077, 0) } } goto _1 @@ -201735,9 +202214,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+35977, libc.VaList(bp+24, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36084, libc.VaList(bp+24, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35970, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36077, 0) } goto _2 _2: @@ -201800,8 +202279,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+35874) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35985, 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+35981) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36092, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201832,7 +202311,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+32, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36121, libc.VaList(bp+32, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -201862,7 +202341,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+36141, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201870,37 +202349,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+36191, 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+36246, 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 + 35604 } 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 + 35604 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36192 + zTail = __ccgo_ts + 36299 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36200, 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+36307, 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+16850, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16922, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201969,7 +202448,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+36318, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -201978,16 +202457,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 + 15174 } 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)*4)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36334, 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+36234, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35874)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36341, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35981)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -202145,7 +202624,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+36260) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36367) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -202156,7 +202635,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+36372) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -202167,7 +202646,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+36381) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -202181,7 +202660,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+36391) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -202192,7 +202671,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+36401) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -202209,7 +202688,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+36413) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -202224,7 +202703,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+35981) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+4) if rc == SQLITE_OK { @@ -202239,7 +202718,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+36425) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -202255,7 +202734,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+36439) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -202298,7 +202777,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 + 36342 + zSelect = __ccgo_ts + 36449 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 4)) = SQLITE_OK iVersion = 0 @@ -202318,7 +202797,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+36481) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 8)) = 0 @@ -202329,7 +202808,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+36382, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36489, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -202433,11 +202912,12 @@ type TFts5ExprNode1 = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode1 = TFts5ExprNode1 +/* Size (in bytes) of an Fts5ExprNode object that holds up to N children */ + /* ** 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. @@ -202467,24 +202947,26 @@ type TFts5ExprPhrase1 = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase1 = TFts5ExprPhrase1 +/* Size (in bytes) of an Fts5ExprPhrase object that holds up to N terms */ + /* ** 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 + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset1 = TFts5ExprNearset1 +/* Size (in bytes) of an Fts5ExprNearset object covering up to N phrases */ + /* ** Parse context. */ @@ -202575,7 +203057,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+36560, 0) return FTS5_EOF } goto _1 @@ -202586,7 +203068,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+36473, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36580, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -202601,13 +203083,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+36504, uint32(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36611, 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+36507, uint32(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36614, 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+30968, uint32(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31023, uint32(3)) == 0 { tok = int32(FTS5_AND) } break @@ -202651,7 +203133,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) @@ -204290,7 +204772,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) @@ -204300,7 +204782,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) @@ -204406,12 +204888,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 @@ -204545,7 +205027,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) @@ -204585,15 +205067,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)) @@ -204634,7 +205116,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 { @@ -204672,8 +205154,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, uint32(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+36618, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint32(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35131, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204693,10 +205175,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+36623, 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: ; @@ -204730,7 +205215,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 { @@ -204780,7 +205265,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 @@ -204831,7 +205316,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+21309, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204858,7 +205343,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)) @@ -204955,7 +205440,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+36652, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -205040,7 +205525,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) @@ -205053,7 +205538,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) @@ -205127,7 +205612,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 @@ -205153,11 +205638,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 + 36598 + v2 = __ccgo_ts + 36705 } else { - v2 = __ccgo_ts + 36511 + v2 = __ccgo_ts + 36618 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36605, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36712, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -205170,7 +205655,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+36762, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -205647,7 +206132,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) { @@ -205711,7 +206196,7 @@ 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 +** to accumulate "term -> doclist" content before it is flushed to a level-0 ** segment. */ @@ -205770,7 +206255,7 @@ type TFts5HashEntry1 = struct { type Fts5HashEntry1 = TFts5HashEntry1 /* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -206654,7 +207139,6 @@ type Fts5Data = TFts5Data type TFts5DlidxIter = struct { FnLvl int32 FiSegid int32 - FaLvl [1]TFts5DlidxLvl } type Fts5DlidxIter = TFts5DlidxIter @@ -206691,7 +207175,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206764,7 +207247,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206799,7 +207281,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206814,9 +207295,8 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray @@ -206913,11 +207393,12 @@ type TFts5Structure1 = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure1 = TFts5Structure1 +/* Size (in bytes) of an Fts5Structure object holding up to N levels */ + /* ** An object of type Fts5SegWriter is used to write to segments. */ @@ -207050,13 +207531,14 @@ type Fts5SegIter1 = TFts5SegIter1 ** Array of tombstone pages. Reference counted. */ type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray1 = TFts5TombstoneArray1 +/* Size (in bytes) of an Fts5TombstoneArray holding up to N tombstones */ + /* ** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. @@ -207109,11 +207591,12 @@ type TFts5Iter1 = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter1 = TFts5Iter1 +/* Size (in bytes) of an Fts5Iter object holding up to N segment iterators */ + /* ** An instance of the following type is used to iterate through the contents ** of a doclist-index record. @@ -207141,11 +207624,12 @@ 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)) *(*Tu8)(unsafe.Pointer(aOut + 1)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) & libc.Int32FromInt32(0xFF)) @@ -207324,7 +207808,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+48) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36815, 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. @@ -207429,7 +207913,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+36714, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+52, Xsqlite3_mprintf(tls, __ccgo_ts+36821, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -207458,7 +207942,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+36872, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+56, zSql) != 0 { return } @@ -207492,7 +207976,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+36814, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+36921, 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) @@ -207570,7 +208054,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)) @@ -207661,7 +208145,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, uint32(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36961, uint32(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207672,7 +208156,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, uint32(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36961, 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)) @@ -208353,7 +208837,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) @@ -208603,7 +209087,7 @@ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _ = nByte, nTomb, pNew nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone if nTomb > 0 { - nByte = libc.Int32FromUint32(libc.Uint32FromInt32(nTomb)*uint32(4) + uint32(12)) + nByte = libc.Int32FromUint32(uint32(libc.UintptrFromInt32(0)+8) + libc.Uint32FromInt32(nTomb+libc.Int32FromInt32(1))*libc.Uint32FromInt64(4)) pNew = _sqlite3Fts5MallocZero(tls, p+40, int64(nByte)) if pNew != 0 { (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb @@ -209313,7 +209797,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+36882, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+68, Xsqlite3_mprintf(tls, __ccgo_ts+36989, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -209402,7 +209886,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+36966, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+72, Xsqlite3_mprintf(tls, __ccgo_ts+37073, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -210049,7 +210533,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 @@ -211372,7 +211856,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+37048, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+60, Xsqlite3_mprintf(tls, __ccgo_ts+37155, 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. */ @@ -211878,7 +212362,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+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+80, Xsqlite3_mprintf(tls, __ccgo_ts+37212, 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) @@ -212047,7 +212531,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 } @@ -212365,7 +212849,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+37166, 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+37273, 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))) @@ -212640,7 +213124,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: @@ -212675,7 +213159,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)) @@ -213289,11 +213773,12 @@ type TFts5TokenDataIter1 = struct { 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 // // /* @@ -213361,7 +213846,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) { @@ -213605,7 +214090,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) @@ -213655,7 +214140,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 @@ -213737,15 +214222,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+1667, 0) - _fts5StructureWrite(tls, p, bp) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -213771,11 +214259,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+37324, 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+26058, __ccgo_ts+37332, 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+12009, __ccgo_ts+37367, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -213973,7 +214461,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) @@ -214228,7 +214716,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+37304) + _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, uint32(1), __ccgo_ts+37411) } else { _sqlite3Fts5BufferSet(tls, p+40, bp, nToken, pToken) } @@ -214579,7 +215067,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') @@ -214701,7 +215189,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 { @@ -214821,7 +215309,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+36708, 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+36815, 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))) @@ -215415,7 +215903,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+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+37413, 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)) @@ -215646,7 +216134,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+37392) + _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, uint32(4), __ccgo_ts+37499) 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)) @@ -215785,7 +216273,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215942,11 +216429,12 @@ type TFts5Sorter1 = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter1 = TFts5Sorter1 +/* Size (int bytes) of an Fts5Sorter object with N indexes */ + /* ** Virtual-table cursor object. ** @@ -216268,7 +216756,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+37504, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -216305,7 +216793,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++ @@ -216324,7 +216812,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 @@ -216774,7 +217262,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+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 @@ -216802,7 +217290,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) } @@ -216822,7 +217310,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) @@ -216837,7 +217325,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 + 15174 } else { v1 = __ccgo_ts + 1667 } @@ -216847,11 +217335,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 + 37543 } else { - v3 = __ccgo_ts + 37441 + v3 = __ccgo_ts + 37548 } - 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+37552, 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 @@ -216909,14 +217397,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+37607, 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+37613, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216966,7 +217454,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+16, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37641, 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)) @@ -216999,7 +217487,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+16, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37651, libc.VaList(bp+16, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -217033,7 +217521,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+37565, libc.VaList(bp+16, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37672, libc.VaList(bp+16, z)) } } } else { @@ -217041,7 +217529,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 + 35399 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -217198,7 +217686,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+37598, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 4)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37705, 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))) } @@ -217398,7 +217886,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+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37710, 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 @@ -217531,10 +218019,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. @@ -220070,12 +220558,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+39059, 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+39163, 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+39201, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -220084,7 +220572,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+39239, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -220096,14 +220584,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+26058, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12009, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38393, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36192, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36299, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35497, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35604, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -220123,13 +220611,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 + 30698 } 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+39281, 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+39311, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -220170,7 +220658,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+39355, 0) iOff = libc.Int32FromUint32(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -220178,7 +220666,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+39378, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -220193,7 +220681,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+39384, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -220202,22 +220690,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+35604, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39283 + zCols = __ccgo_ts + 39390 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39315 + zCols = __ccgo_ts + 39422 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36192, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36299, 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+38393, __ccgo_ts+39470, 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+36481, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -220637,12 +221125,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+39487, 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+39537, 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+39566, 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. */ @@ -220650,7 +221138,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+36481, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220952,7 +221440,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+39595, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -221184,14 +221672,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+35497, bp+56) + rc = _fts5StorageCount(tls, p, __ccgo_ts+35604, 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)) @@ -222396,64 +222884,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)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39697, 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+39593, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39700, 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+39598, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39705, 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+39603, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39710, 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+39606, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39713, 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+39609, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39716, 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+39614, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39721, 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+39619, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39726, 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+39623, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39730, 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+39629, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39736, 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+39634, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39741, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222462,49 +222950,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)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39745, 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+39642, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39749, 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+39645, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39752, 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+39649, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39756, 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+39653, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39760, 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+39657, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39764, 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+39661, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39768, 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+39665, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39772, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222521,20 +223009,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)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39649, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39776, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39756, 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+39672, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39675, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39779, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39782, 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+39679, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39665, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39786, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39772, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -222550,75 +223038,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)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39789, 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+39649, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39756, uint32(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)), uint32(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39797, 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+39697, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39804, uint32(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)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39809, 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+39598, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39705, uint32(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)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39814, 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+39593, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39700, uint32(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)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39819, 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+39665, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39772, uint32(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)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39824, 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+16052, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16124, uint32(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)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39829, 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+39675, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39782, uint32(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)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39833, 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+39590, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39697, uint32(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)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39838, 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+39634, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39741, uint32(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)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39844, 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+39741, uint32(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39848, uint32(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)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39850, 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+39764, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -222627,48 +223115,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)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39856, 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+39665, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39772, uint32(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)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39864, 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+39649, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39756, uint32(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)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39870, 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+39649, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39756, uint32(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)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39875, 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+39590, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39697, uint32(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)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39881, 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+39768, uint32(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)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39889, 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+39790, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39897, uint32(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)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39901, 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+39764, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222676,21 +223164,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)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39909, 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+39590, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39697, uint32(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)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39915, 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+39661, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39768, uint32(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)), uint32(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39921, 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+39675, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39782, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222708,48 +223196,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)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39928, 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+39606, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39713, uint32(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)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39933, 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+39831, 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+39606, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39713, uint32(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)), 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+39606, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39713, uint32(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)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39897, 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+39843, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39950, 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+39849, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39956, 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+39590, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39697, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222765,13 +223253,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)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39962, 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+39859, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39966, uint32(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)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39969, 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) @@ -222779,7 +223267,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)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39972, 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) @@ -222944,14 +223432,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+39869) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+39976) { 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+39562) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+39669) { 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 { @@ -223219,7 +223707,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+39991)) } // C documentation @@ -223245,7 +223733,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39580, + FzName: __ccgo_ts + 39687, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -223253,7 +223741,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39892, + FzName: __ccgo_ts + 39999, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -223261,7 +223749,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39884, + FzName: __ccgo_ts + 39991, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -223291,7 +223779,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+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+40005, pApi, bp+48, uintptr(0)) } return rc } @@ -228807,16 +229295,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+40012) == 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+40016) == 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+40020) == 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+40029, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228879,21 +229367,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 + 40063, + 1: __ccgo_ts + 40103, + 2: __ccgo_ts + 40138, } 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+23979, *(*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+24051, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(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+40181, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228914,23 +229403,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) } @@ -229063,10 +229552,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+40107, 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+40214, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40138, 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+40245, 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)) } @@ -229085,7 +229574,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+40189, 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+40296, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -229535,7 +230024,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+40322, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -229590,7 +230079,7 @@ 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 + 40332 } type TAggInfo_col = struct { @@ -229819,7 +230308,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 @@ -229867,11 +230356,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]int8{'3', '.', '4', '9', '.', '1'} +var Xsqlite3_version = [7]int8{'3', '.', '5', '0', '.', '1'} 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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods @@ -229881,3 +230370,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_amd64.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_amd64.go index 7d8b352..0ad7c91 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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70" +const SQLITE_SOURCE_ID = "2025-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95" 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.1" -const SQLITE_VERSION_NUMBER = 3049001 +const SQLITE_VERSION = "3.50.1" +const SQLITE_VERSION_NUMBER = 3050001 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 @@ -4387,6 +4393,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 +4755,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 @@ -5175,7 +5188,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -6916,11 +6928,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,6 +7312,7 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem @@ -7339,6 +7358,7 @@ type THashElem1 = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem1 = THashElem1 @@ -7489,6 +7509,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 +7572,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 @@ -7850,7 +7886,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData = TDbClientData @@ -7920,9 +7955,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 +7972,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -7986,8 +8020,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 +8085,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -8123,19 +8156,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 +8185,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 +8197,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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 +8249,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -8227,6 +8261,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -8377,9 +8412,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 @@ -8434,6 +8469,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8614,7 +8650,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8656,7 +8691,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -9226,8 +9260,8 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. +/* Use SQLITE_ENABLE_EXPLAIN_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 @@ -10074,6 +10108,7 @@ type TTable1 = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table1 = TTable1 @@ -10155,11 +10190,13 @@ type TFKey1 = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey1 = TFKey1 +/* The size (in bytes) of an FKey object holding N columns. The answer +** does NOT include space to hold the zTo name. */ + /* ** SQLite supports many different ways to resolve a constraint ** error. ROLLBACK processing means that a constraint violation @@ -10208,11 +10245,12 @@ type TKeyInfo1 = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo1 = TKeyInfo1 +/* The size (in bytes) of a KeyInfo object with up to N fields */ + /* ** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. */ @@ -10614,13 +10652,16 @@ type Expr1 = TExpr1 ** expression. */ type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList1 = TExprList1 +/* The size (in bytes) of an ExprList object that is big enough to hold +** as many as N expressions. */ + /* ** Allowed values for Expr.a.eEName */ @@ -10641,12 +10682,14 @@ type ExprList1 = TExprList1 ** 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 + F__ccgo_align [0]uint64 + FnId int32 } type IdList1 = TIdList1 +/* The size (in bytes) of an IdList object that can hold up to N IDs. */ + /* ** Allowed values for IdList.eType, which determines which value of the a.u4 ** is valid. @@ -10752,13 +10795,19 @@ type OnOrUsing1 = TOnOrUsing1 ** */ type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList1 = TSrcList1 +/* Size (in bytes) of a SrcList object that can hold as many as N +** SrcItem objects. */ + +/* Size (in bytes( of a SrcList object that holds 1 SrcItem. This is a +** special case of SZ_SRCITEM(1) that comes up often. */ + /* ** Permitted values of the SrcList.a.jointype field */ @@ -11119,19 +11168,22 @@ type TParse1 = 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 @@ -11145,11 +11197,8 @@ type TParse1 = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -11160,40 +11209,41 @@ type TParse1 = 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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -11559,11 +11609,13 @@ type TWith1 = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With1 = TWith1 +/* The size (in bytes) of a With object that can hold as many +** as N different CTEs. */ + /* ** The Cte object is not guaranteed to persist for the entire duration ** of code generation. (The query flattener or other parser tree @@ -11593,11 +11645,13 @@ type TDbClientData1 = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData1 = TDbClientData1 +/* The size (in bytes) of a DbClientData object that can has a name +** that is N bytes long, including the zero-terminator. */ + /* ** This object is used in various ways, most (but not all) related to window ** functions. @@ -12763,7 +12817,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12841,7 +12894,6 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor @@ -12879,11 +12931,16 @@ type TVdbeCursor1 = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor1 = TVdbeCursor1 +/* +** The size (in bytes) of a VdbeCursor object that has an nField value of N +** or less. The value of SZ_VDBECURSOR(n) is guaranteed to be a multiple +** of 8. + */ + /* Return true if P is a null-only cursor */ @@ -13094,21 +13151,14 @@ type Tsqlite3_context1 = struct { 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 */ +/* +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. + */ // C documentation // @@ -13241,7 +13291,7 @@ type TPreUpdate1 = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -13253,6 +13303,7 @@ type TPreUpdate1 = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate1 = TPreUpdate1 @@ -13390,7 +13441,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(24453)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13562,7 +13613,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)) @@ -13949,7 +14000,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 +14071,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 +14210,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 +14307,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) @@ -14411,7 +14462,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 +14540,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 +14688,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 +14991,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 +15148,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 +15196,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 +15301,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) @@ -15979,7 +16030,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 } @@ -16628,7 +16679,8 @@ func init() { // /* // ** Initialize the mutex system. // */ -func _sqlite3MutexInit(tls *libc.TLS) (r int32) { +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 @@ -18256,17 +18308,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 +18515,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 +18780,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 @@ -19208,29 +19261,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 +19376,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 = v98 + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) + } + } + 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 +19406,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 +19425,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 +19478,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 - } - 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 + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + 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++ + } + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 + j1++ + 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 +19594,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 +19610,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 +19620,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 +19873,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 +20172,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 +20191,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)) } @@ -20714,6 +20847,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 +21628,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 +21803,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 +22015,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 +22255,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 +22345,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 +22572,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 +22732,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 +22841,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 +23257,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 +23286,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 +23300,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 +23331,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 +23682,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 +23751,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 +23785,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 +23806,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 +23819,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 +23835,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 +23847,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 +23896,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 +23906,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 +23937,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 @@ -24503,91 +24662,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, - }, - 14: { - FzName: __ccgo_ts + 3555, - }, - 15: { - FzName: __ccgo_ts + 3562, - }, - 16: { FzName: __ccgo_ts + 3572, }, + 14: { + FzName: __ccgo_ts + 3581, + }, + 15: { + FzName: __ccgo_ts + 3588, + }, + 16: { + FzName: __ccgo_ts + 3598, + }, 17: { - FzName: __ccgo_ts + 3579, - }, - 18: { - FzName: __ccgo_ts + 3593, - }, - 19: { - FzName: __ccgo_ts + 3599, - }, - 20: { FzName: __ccgo_ts + 3605, }, - 21: { - FzName: __ccgo_ts + 3612, + 18: { + FzName: __ccgo_ts + 3619, }, - 22: { - FzName: __ccgo_ts + 3620, - }, - 23: { + 19: { FzName: __ccgo_ts + 3625, }, - 24: { - FzName: __ccgo_ts + 3632, + 20: { + FzName: __ccgo_ts + 3631, }, - 25: { - FzName: __ccgo_ts + 3639, + 21: { + FzName: __ccgo_ts + 3638, }, - 26: { + 22: { + FzName: __ccgo_ts + 3646, + }, + 23: { FzName: __ccgo_ts + 3651, }, + 24: { + FzName: __ccgo_ts + 3658, + }, + 25: { + FzName: __ccgo_ts + 3665, + }, + 26: { + FzName: __ccgo_ts + 3677, + }, 27: { - FzName: __ccgo_ts + 3660, + FzName: __ccgo_ts + 3686, }, 28: { - FzName: __ccgo_ts + 3666, + FzName: __ccgo_ts + 3692, }, } @@ -24826,9 +24985,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 } } @@ -25148,7 +25307,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 +25335,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 +25994,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(40995)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -26440,7 +26599,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 +26625,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(42576)), __ccgo_ts+3605, bp, int32(42576)) } // C documentation @@ -26503,7 +26662,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)<= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43393)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -27114,7 +27273,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)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44803)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -28115,10 +28273,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 +28285,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 +28348,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 +28520,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 +28675,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(45251)), __ccgo_ts+3488, zName, int32(45251)) if rc == SQLITE_OK { rc = rc2 } @@ -28594,7 +28752,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(45502)) 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(45507)), __ccgo_ts+3677, zIn, int32(45507)) return } (*(*[4098]int8)(unsafe.Pointer(bp + 144)))[got] = 0 @@ -28792,14 +28950,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(45565)), __ccgo_ts+3506, zPath, int32(45565)) } _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(45571)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<>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) } } @@ -32118,7 +32276,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) - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 0) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -32212,7 +32370,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-- - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 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 +32411,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 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 +32539,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 libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g)) + 140) + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -32401,17 +32559,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 +32589,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 +32601,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 +32802,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 @@ -34790,7 +34951,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 +34969,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 +35542,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 +36197,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 +36210,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 +36231,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 +36265,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 +36498,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 +36635,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 +36651,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)< int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65269)) } 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 +40758,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 +41322,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 @@ -41356,6 +41528,11 @@ type WalCkptInfo1 = TWalCkptInfo1 /* ** An open write-ahead log file is represented by an instance of the ** following object. +** +** writeLock: +** This is usually set to 1 whenever the WRITER lock is held. However, +** if it is set to 2, then the WRITER lock is held but must be released +** by walHandleException() if a SEH exception is thrown. */ type TWal1 = struct { FpVfs uintptr @@ -41422,13 +41599,15 @@ type ht_slot = Tht_slot ** This functionality is used by the checkpoint code (see walCheckpoint()). */ type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } 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 ** is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -41486,7 +41665,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) @@ -41587,6 +41766,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 @@ -42028,7 +42208,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(67209)) } goto _1 _1: @@ -42116,7 +42296,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(67341)) goto finished } /* Malloc a buffer to read frames into. */ @@ -42255,7 +42435,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 { @@ -42886,7 +43066,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(68150)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -43002,7 +43182,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 +43397,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 +43430,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(68601)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43966,8 +44153,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 +44241,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(69451)) } iKey = _walNextHash(tls, iKey) } @@ -44551,7 +44738,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(69974)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44800,7 +44987,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, /* 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(70234)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -45572,6 +45759,11 @@ type CellInfo1 = TCellInfo1 ** assumed that the database is corrupt. */ +/* +** Maximum amount of storage local to a database page, regardless of +** page size. + */ + /* ** A cursor is a pointer to a particular entry within a particular ** b-tree within a database file. @@ -45938,10 +46130,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 +46143,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,7 +46850,7 @@ 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(72422)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } @@ -46835,7 +47028,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(72620)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46848,12 +47041,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(72633)) 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(72638)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46897,7 +47090,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(72683)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46905,7 +47098,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(72691)) } return SQLITE_OK } @@ -47093,7 +47286,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 +47319,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 +47518,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(73136)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -47365,12 +47558,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(73194)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73197)) } 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 +47571,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(73205)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73208)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73210)) } 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(73214)) } } cbrk = top + sz @@ -47439,12 +47632,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(73247)) } 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(73253)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -47460,7 +47653,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(73267)) } *(*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 +47713,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(73324)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -47537,14 +47730,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(73339)) } 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(73346)) } return uintptr(0) } @@ -47587,11 +47780,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(73394)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73397)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -47605,7 +47798,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(73414)) } else { return SQLITE_OK } @@ -47658,42 +47851,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(73498)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47701,70 +47892,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(73510)) } - 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(73513)) } - 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(73526)) } - 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(73532)) } 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) + *(*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)) += libc.Int32FromUint16(iOrigSize) + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47810,7 +48001,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(73602)) } } } else { @@ -47836,7 +48027,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(73626)) } } } @@ -47875,12 +48066,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(73677)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73682)) } 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(73692)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73696)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47907,7 +48098,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(73708)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47938,11 +48129,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(73739)) } 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(73744)) } goto _1 _1: @@ -47971,11 +48162,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(73776)) } (*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 +48175,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(73790)) } /* 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 +48197,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 +48211,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 +48326,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(73933)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -48199,7 +48388,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(74005)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -48287,7 +48476,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 +49100,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 +49262,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 +49300,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(74943)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -49552,7 +49741,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(75398)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -49576,7 +49765,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(75417)) } 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 +49774,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(75426)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -49599,7 +49788,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(75438)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -49629,7 +49818,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(75473)) } /* 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 +49914,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(75571)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49763,7 +49952,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(75623)) } } 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 +50019,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(75691)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49873,7 +50062,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(75742)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49903,7 +50092,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(75769)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -50369,7 +50558,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(76233)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50761,7 +50950,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(76657)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50771,7 +50960,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(76672)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50828,7 +51017,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(76743)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50902,7 +51091,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(76827)) } return rc } @@ -51037,7 +51226,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(76965)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -51049,7 +51238,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(76979)) } if rc != 0 { v3 = pCur + 84 @@ -51165,7 +51354,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(77114)) } goto skip_init skip_init: @@ -51179,7 +51368,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(77126)) } 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 +51602,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(77375)) } } } @@ -51617,7 +51806,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes p3 = pCur + 1 *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(BTCF_ValidOvfl) | libc.Int32FromInt32(BTCF_AtLast))) if !((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76795)) + return _sqlite3CorruptError(tls, int32(77571)) } goto bypass_moveto_root /* Start search on the current page */ } @@ -51680,10 +51869,10 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ if nCell < int32(2) || libc.Uint32FromInt32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77658)) 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 +51900,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(77690)) } goto moveto_index_finish } @@ -51744,7 +51933,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(77721)) } *(*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 +51942,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(77732)) } if rc != 0 { v11 = pCur + 84 @@ -51882,7 +52071,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(77833)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51992,7 +52181,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(77926)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -52080,7 +52269,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(78016)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -52135,7 +52324,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(78072)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -52161,7 +52350,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(78101)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52188,7 +52377,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(78135)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -52259,7 +52448,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(78200)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52397,7 +52586,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(78327)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -52448,7 +52637,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(78374)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -52457,7 +52646,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(78385)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -52547,7 +52736,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(78474)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -52565,7 +52754,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(78491)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -52588,7 +52777,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(78511)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -52809,10 +52998,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(78767)) 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 @@ -53203,12 +53392,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(79157)) } 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(79162)) } } pData -= uintptr(sz) @@ -53216,7 +53405,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(79168)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -53311,7 +53500,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(79255)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -53392,7 +53581,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 +53608,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 +53648,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(79377)) } 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 +53719,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(79455)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -53575,7 +53764,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(79495)) } /* 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 +53960,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 +54087,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 +54128,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(79919)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53961,7 +54151,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(79943)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -54092,7 +54282,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(80044)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -54135,7 +54325,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(80077)) goto balance_cleanup } } @@ -54194,7 +54384,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(80121)) goto balance_cleanup } goto _11 @@ -54226,7 +54416,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(80154)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -54456,7 +54646,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(80355)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54702,7 +54892,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(80587)) } goto _1 _1: @@ -54775,7 +54965,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(80647)) } 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 +55124,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(80811)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54965,7 +55155,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(80839)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -55050,7 +55240,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(80920)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -55142,7 +55332,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(81043)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -55178,7 +55368,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(81085)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55208,10 +55398,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(81112)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81115)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -55329,12 +55519,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(81217)) } 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 +55534,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(81242)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -55451,21 +55641,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(81338)) } } 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(81347)) } 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(81351)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81354)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -55559,7 +55749,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(81445)) } 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 +55859,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(81561)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55710,7 +55900,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(81609)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55791,14 +55981,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(81699)) } *(*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(81706)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55935,7 +56125,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(81810)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -56200,7 +56390,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 +56438,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 +56468,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 +56544,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 +56684,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 +56774,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 +56797,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 +56874,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 +56888,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 +56979,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 +57003,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 +57044,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: @@ -57296,7 +57486,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 +57496,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 +57525,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 +57555,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 +58233,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 +58371,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 +58545,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 +58573,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 @@ -59143,7 +59330,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(85108)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -59307,7 +59494,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 +59503,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 +59561,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 */ @@ -59419,14 +59607,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 +59714,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 +59729,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 +60033,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(85794)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59861,7 +60049,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(85800)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59871,7 +60059,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(85806)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -60332,12 +60520,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 +60698,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 @@ -60596,8 +60783,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 +60797,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 +60838,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 +60878,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 +61380,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 +61393,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 +61442,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 +61464,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 +61491,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 @@ -62255,7 +62445,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 +62453,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 +62695,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(90646))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63893,7 +64083,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(90727))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -63928,7 +64118,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(90757))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63982,7 +64172,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(90808))) return 0 /* Corrupt index */ } } @@ -64114,7 +64304,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(90971))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -64266,7 +64456,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(91129)) } // C documentation @@ -64297,7 +64487,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(91162)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -64448,15 +64638,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 +64741,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 +64754,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 +64836,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 +64846,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 +64904,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(91560)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -65216,7 +65407,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 +65608,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(92354)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -65547,7 +65738,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(92475)) } 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) @@ -66007,18 +66198,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 +66464,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(93091)) } 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(93095))) 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(93099)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -66431,7 +66622,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, 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) } @@ -66854,11 +67045,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(93642)) 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 +67058,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 +67072,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 +67107,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(93701)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66951,7 +67142,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 +67208,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(93797)) 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 +67235,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 @@ -67193,7 +67384,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 +67422,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 +67437,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 +67622,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 +67650,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 +67662,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 +68074,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 +68096,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 +68114,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 +68828,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 +70054,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 +70070,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 +70569,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(97561)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -70477,7 +70672,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 +71268,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 +71298,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 +71395,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. @@ -72311,7 +72506,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(99822)) } else { goto jump_to_p2 } @@ -72770,7 +72965,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 +73398,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(101119)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -73533,7 +73728,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 +73759,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 +73780,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(101412)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73822,7 +74017,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 +74034,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 +74123,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 +74339,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.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 +74389,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 +74445,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 +74524,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 +74681,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 +74843,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 +74923,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 +74939,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 +75033,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 +75061,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 +75193,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 +75344,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 +75431,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 +75897,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) @@ -75800,7 +75987,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103962)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75899,7 +76086,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(104062)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75913,7 +76100,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) } @@ -76360,11 +76547,12 @@ type TVdbeSorter1 = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter1 = TVdbeSorter1 +/* Size (in bytes) of a VdbeSorter object that works with N or fewer subtasks */ + /* ** An instance of the following object is used to read records out of a ** PMA, in sorted order. The next key to be read is cached in nKey/aKey. @@ -76971,8 +77159,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 +77174,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) @@ -77186,18 +77374,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 { @@ -77485,6 +77674,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: @@ -80030,25 +80222,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 +80279,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 +80326,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 +80420,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 +80442,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 +80524,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 +80537,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 +80584,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 +80642,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 +80661,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 +80702,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 +80722,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 +80731,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 +80741,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 +80809,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80717,19 +80884,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 +80922,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 +81068,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 +81123,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 +81147,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 +81161,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 +81187,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 +81204,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 +81320,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 +81332,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 +81378,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 +81503,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 +81538,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 +81576,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 +81646,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 +81680,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 +81993,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 +82060,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 +82071,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 +82081,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 +82303,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 +82383,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 +82591,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 +83066,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 +83145,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 @@ -83321,11 +83490,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)) @@ -83374,7 +83543,7 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt 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)) { _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 +83571,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 +83591,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 +83662,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 +83714,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 +83747,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) } } @@ -83961,7 +84130,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 +84270,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 +84290,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 +84349,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 +84361,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 +84376,7 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(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 +84427,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 +84508,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.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 +84526,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(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 +84607,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 +84736,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 +84834,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 +85515,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 +85536,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 +85757,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 +85810,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 +85910,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 +86508,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,7 +86604,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 + 44)) & 0x4 >> 2))) pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return @@ -86490,9 +86639,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 +86774,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 +86904,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)<= (*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 +87702,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 +87717,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 +87746,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 +87822,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 +87885,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 +87895,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) { @@ -87767,9 +87916,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 +88000,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 +88071,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 +88090,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 @@ -87972,7 +88121,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 +88191,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 +88235,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 @@ -88353,7 +88502,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 +88713,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 +89422,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) } @@ -89790,7 +89943,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) 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 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 @@ -89806,7 +89959,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) (*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 + v9 = pParse + 60 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 @@ -89891,7 +90044,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 +90052,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 +90070,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 +90089,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 +90211,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+8540, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90077,10 +90230,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+8568, 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+8743, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -90096,9 +90249,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+8917, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9039, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9064, 0) } } @@ -90154,7 +90307,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+9215, 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 +90316,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+9274, 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+9280, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -90197,21 +90350,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+9307, 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+9491, 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+9796, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9812, 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+9870, 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 +90372,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 +90380,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+10135, 0) goto exit_rename_table exit_rename_table: ; @@ -90244,7 +90397,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+10148, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -90284,11 +90437,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+10186, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10193, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10218, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -90304,10 +90457,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+10245) } 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+10304) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -90319,13 +90472,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+10357) } _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+10403) } } /* Modify the CREATE TABLE statement. */ @@ -90339,7 +90492,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+10430, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -90367,7 +90520,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+10576, libc.VaList(bp+16, zTab, zDb)) } } } @@ -90405,12 +90558,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+10929, 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+10963, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -90425,7 +90578,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 +90586,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(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+10993, 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 +90648,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 + 11012 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10992 + zType = __ccgo_ts + 11017 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11006 + v1 = __ccgo_ts + 11031 } else { - v1 = __ccgo_ts + 11023 + v1 = __ccgo_ts + 11048 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11041, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11066, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90553,21 +90706,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+11084, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -90583,11 +90724,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+11105, 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+11287, 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+10135, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -91063,11 +91204,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 + 11418 } 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+11420, 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 +91279,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+11443, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118867)) } 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(118888)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -91182,9 +91327,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 +91344,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+11451, 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 +91363,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 +91389,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 + 11418 } 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+11457, 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 +91429,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 +91739,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 +92006,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 +92189,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 +92273,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 +92291,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 +92370,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(119856)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -92242,7 +92387,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+11462, 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 +92442,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+11084, 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 + 11469 } 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+11481, 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+11509, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -92325,31 +92470,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+11557, 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+11678, 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 +92508,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 +92519,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 +92581,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 + 11696, }, 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 + 11717, }, 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 + 11737, }, 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 + 11756, }, 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 + 11775, }, } @@ -92667,8 +92812,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+11878, 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 +92828,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+11901, 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+11931, 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 +92863,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11773, - FzCols: __ccgo_ts + 11786, + FzName: __ccgo_ts + 11798, + FzCols: __ccgo_ts + 11811, }, 1: { - FzName: __ccgo_ts + 11799, - FzCols: __ccgo_ts + 11812, + FzName: __ccgo_ts + 11824, + FzCols: __ccgo_ts + 11837, }, 2: { - FzName: __ccgo_ts + 11840, + FzName: __ccgo_ts + 11865, }, } @@ -92935,7 +93085,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 +93102,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 +93115,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 +93174,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 + 11949, } func init() { @@ -93397,7 +93548,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 + 11959, } func init() { @@ -93447,7 +93598,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+11969, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -93458,7 +93609,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+11974, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -93497,7 +93648,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+11980, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -93515,7 +93666,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 + 11986, } func init() { @@ -93581,7 +93732,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+11995, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -93590,12 +93741,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.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+11798, 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)) @@ -93797,7 +93948,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 +93979,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+12005, 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 +94070,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+12005, 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 +94107,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 +94140,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+12009) } 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+12013) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -94157,17 +94308,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+12017, 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+12028, 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+12038, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -94179,13 +94330,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) - } } } @@ -94546,11 +94690,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+11824, 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+12050, __ccgo_ts+12119, zDb) } return rc } @@ -94616,10 +94760,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+11798, (*(*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+12171, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94732,7 +94876,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 +94928,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+12212, 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 +94963,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+12215, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -94828,7 +94972,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+12252, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -94846,7 +94990,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(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 +95028,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+12282, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94892,7 +95036,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+12311, 0) rc = int32(SQLITE_ERROR) } } @@ -94939,7 +95083,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+12379, libc.VaList(bp+56, zFile)) } } } @@ -95001,15 +95145,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+12407, 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+12428, 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+12454, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -95104,7 +95248,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 + 12476, } func init() { @@ -95126,7 +95270,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 + 12490, } func init() { @@ -95152,7 +95296,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+12504, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -95186,7 +95330,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+12528, 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))) @@ -95403,7 +95547,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+12574, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -95431,11 +95575,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+12597, 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+12603, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12584, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12609, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -95495,7 +95639,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 +95674,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+12636, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -95648,7 +95792,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 +95890,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 +95970,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 +95984,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 +96099,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 +96143,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 +96186,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+12651, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -96048,7 +96196,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 +96204,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 + 12659 } else { - v1 = __ccgo_ts + 12647 + v1 = __ccgo_ts + 12672 } 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 +96250,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 @@ -96632,7 +96780,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 +96812,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 +96870,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+12686, 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+12703, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96776,8 +96924,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+12723, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96813,23 +96961,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 +97099,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 +97142,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 +97157,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+12765, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -97023,9 +97173,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10987 + v2 = __ccgo_ts + 11012 } else { - v2 = __ccgo_ts + 9249 + v2 = __ccgo_ts + 9274 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -97035,9 +97185,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 +97211,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 + 11012 } else { - v4 = __ccgo_ts + 9249 + v4 = __ccgo_ts + 9274 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12781, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12806, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -97073,11 +97223,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+12827, 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 +97259,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 +97301,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 +97329,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 +97390,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+12862, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -97234,14 +97399,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+12896, 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 +97440,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 +97455,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+12916, 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 +97465,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+12939, 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+12946, 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 +97512,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+12956, 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 +97526,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 +97539,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 +97725,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+12982, 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+13027, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -97621,7 +97786,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+13068, 0) } } @@ -97649,8 +97814,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 +97823,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+13120, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -97677,21 +97842,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 +97868,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+13161, 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 +97896,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 +97989,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+13217, 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+13260, (*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+13268, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97872,7 +98031,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+13275, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -98013,9 +98172,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 +98186,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 + 13306 + zEnd = __ccgo_ts + 5201 } else { - zSep = __ccgo_ts + 13283 - zSep2 = __ccgo_ts + 13287 - zEnd = __ccgo_ts + 13292 + zSep = __ccgo_ts + 13308 + zSep2 = __ccgo_ts + 13312 + zEnd = __ccgo_ts + 13317 } - 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+13320, 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 +98221,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 +98236,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 + 13334, + 2: __ccgo_ts + 13340, + 3: __ccgo_ts + 13345, + 4: __ccgo_ts + 13350, + 5: __ccgo_ts + 13340, } // C documentation @@ -98094,15 +98256,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 +98280,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 +98513,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 +98624,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 +98637,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 +98668,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 +98887,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+13356, 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+13389, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98737,11 +98910,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+13416, 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+13466, 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 +98961,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+13498, 0) return } } @@ -98822,16 +98995,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 + 9274 + zType2 = __ccgo_ts + 13542 } else { /* A view */ - zType = __ccgo_ts + 10987 - zType2 = __ccgo_ts + 13523 + zType = __ccgo_ts + 11012 + zType2 = __ccgo_ts + 13548 } /* 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 +99021,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 +99091,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+13553, 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+13568, 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 +99116,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+13666, 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+13708, 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+13742, 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 +99142,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+9796) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -98987,7 +99175,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+13763, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -99004,7 +99192,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+11012, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -99101,7 +99289,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+13799, 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 +99473,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+13829, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -99298,7 +99486,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+13844, 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 +99569,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+13911, 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+11901, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -99424,7 +99612,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+13925, 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 +99621,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+13970, 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 +99656,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 +99715,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 +99750,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+14037, 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+14065, 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+14099, 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 +99771,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+12013, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -99631,19 +99819,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+14131, 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+14194, 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 +99888,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+14288, 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 +100003,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 +100029,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 +100074,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 +100103,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 +100148,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 + 14334 } else { - v2 = __ccgo_ts + 14315 + v2 = __ccgo_ts + 14340 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14320, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14345, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -100042,7 +100230,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+14373, *(*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 +100240,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+14379, 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 +100254,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+14429, 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+14457, 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+14482, 0) goto exit_create_index } /* @@ -100096,19 +100284,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+14373, (*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+14516, 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+14550, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -100129,7 +100317,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+14574, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -100147,9 +100335,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 +100365,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+14373) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -100209,7 +100397,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 +100449,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+14597, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -100276,6 +100464,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { j = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) } else { if int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16 + 8))&0xf>>0)) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) @@ -100360,7 +100549,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 +100597,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+14658, 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 +100627,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+14700, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127335)) goto exit_create_index } } @@ -100452,7 +100641,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 +100670,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 + 14717 } - 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+14725, 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 +100680,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+14745, 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 +100688,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+14804, 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 +100851,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+14831, 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+14849, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100679,9 +100868,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 +100886,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+14922, 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+12009, (*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 +100960,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(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 +101077,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+14982, 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 +101164,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 +101214,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 +101385,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 + 15018 } else { - v1 = __ccgo_ts + 14996 + v1 = __ccgo_ts + 15021 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15002, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15027, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -101399,7 +101588,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+15063, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -101446,9 +101635,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 + 15069 } else { - v1 = __ccgo_ts + 15053 + v1 = __ccgo_ts + 15078 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -101480,9 +101669,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 + 15063, + 1: __ccgo_ts + 15085, + 2: __ccgo_ts + 15069, } // C documentation @@ -101502,7 +101691,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+15093, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -101527,7 +101716,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+12597, 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 +102147,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+15293, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102840,11 +103027,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+15326, 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+15355, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102948,7 +103135,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 +103192,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+15429, -int32(1)) return } if argc == int32(3) { @@ -104724,7 +104916,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+15462, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -104806,7 +104998,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 +105070,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+15507, 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+15515, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -104931,13 +105123,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 + 15523 + } else { + v2 = __ccgo_ts + 15527 + } + 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+15530, -int32(1)) + return +} + // C documentation // // /* @@ -104949,6 +105277,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 +105291,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) @@ -105483,7 +105815,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11393, + 0: __ccgo_ts + 11418, } // C documentation @@ -105643,7 +105975,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+15553, int32(4), libc.UintptrFromInt32(0)) } } @@ -105704,7 +106036,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+12636, -int32(1)) return } if argc == int32(2) { @@ -105814,7 +106146,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 +106228,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+15406, -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) @@ -106246,7 +106578,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+15558, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -106275,8 +106607,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+15564, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15564, 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 +106788,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 +106896,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 +106909,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 + 15569, }, 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 + 15589, }, 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 + 15602, }, 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 + 15620, }, 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 + 15629, }, 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 + 15637, }, 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 + 15637, }, 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 + 15652, }, 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 + 15678, }, 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 + 15703, }, 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 + 15712, }, 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 + 15723, }, 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 + 15730, }, 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 + 15744, }, 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 + 15744, }, 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 + 15750, }, 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 + 15750, }, 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 + 15756, }, 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 + 15756, }, 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 + 15761, }, 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 + 15761, }, 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 + 15765, }, 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 + 15765, }, 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 + 15769, }, 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 + 15776, }, 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 + 15784, }, 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 + 15791, }, 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 + 15804, }, 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 + 15810, }, 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 + 15817, }, 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 + 15824, }, 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 + 15832, }, 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 + 15837, }, 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 + 15841, }, 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 + 15841, }, 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 + 15847, }, 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 + 15853, }, 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 + 15859, }, 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 + 15863, }, 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 + 15863, }, 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 + 15869, }, 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 + 15876, }, 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 + 15886, }, 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 + 15893, }, 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 + 15900, }, 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 + 15911, }, 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 + 15918, }, 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 + 15933, }, 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 + 15950, }, 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 + 15961, }, 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 + 15968, }, 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 + 15974, }, 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 + 15987, }, 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 + 16005, }, 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 + 16013, }, 55: { - 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 + 15972, - }, - 56: { 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 + 16027, + }, + 56: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16035, }, 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 + 16044, }, 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 + 16044, }, 59: { - 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, + 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 + 16051, }, 60: { - 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, + 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 + 16051, }, 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 + 15999, + FzName: __ccgo_ts + 16061, }, 62: { - 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, + 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 + 16065, }, 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(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16003, + 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 + 16071, }, 64: { - 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, + 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 + 16075, }, 65: { - 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, + 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 + 16075, }, 66: { - FnArg: int16(2), + 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 + 16022, + FzName: __ccgo_ts + 16081, }, 67: { 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, + 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 + 16081, }, 68: { 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, + 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 + 16094, }, 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 + 16105, + }, + 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 + 15564, + }, + 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, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16038, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1240, + FzName: __ccgo_ts + 15564, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1248, + FzName: __ccgo_ts + 16110, }, 73: { 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 + 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 + 16049, + 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 + 16052, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16115, }, 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 + 16056, + FzName: __ccgo_ts + 16121, }, 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 + 16062, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16124, }, 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 + 16052, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16128, }, 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, + FfuncFlags: 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 + 16134, }, 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 + 16124, }, 81: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16075, - }, - 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, - }, - 83: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16085, - }, - 84: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16090, - }, - 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, - }, - 86: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16100, - }, - 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, - }, - 88: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16110, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, }, + 82: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16143, + }, + 83: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16147, + }, + 84: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16153, + }, + 85: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16157, + }, + 86: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16162, + }, + 87: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16167, + }, + 88: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16172, + }, + 89: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16178, + }, + 90: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16182, + }, + 91: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16186, + }, + 92: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16190, + }, + 93: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16195, + }, + 94: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16200, + }, 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 + 16205, }, 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 + 16211, }, 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 + 16217, }, 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 + 16223, }, 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 + 16228, }, 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 + 16236, }, 101: { - 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, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16244, }, 102: { - 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, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16247, }, 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 + 6885, + }, + 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 + 16184, + FzName: __ccgo_ts + 16252, + }, + 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 + 16256, }, } @@ -107171,109 +107514,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 ************************************************/ @@ -107590,7 +107935,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+16259, 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 +108759,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 +109046,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 +109114,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) @@ -109351,7 +109696,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 +109762,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 +110091,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 +110105,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 +110140,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 +110153,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 +110280,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 +110381,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++ @@ -110072,44 +110417,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+16304, 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+16345, 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 +110460,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+16377, 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 +110508,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 +110552,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,28 +110570,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)*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+16385, 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+16437, 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 +110704,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 +110725,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 +110742,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 +110766,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 +110886,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 +110949,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16457) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16529) } goto insert_cleanup insert_cleanup: @@ -111016,7 +111345,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+12597, 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 +113581,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+16578, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -113270,7 +113601,7 @@ 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+16582, uint64(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } @@ -113282,7 +113613,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+16516, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16588, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113297,7 +113628,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+16559, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16631, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) @@ -113328,7 +113659,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+16663, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113337,7 +113668,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 + 16543, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -113570,7 +113901,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+16700, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -113624,63 +113955,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 + 16739, + 2: __ccgo_ts + 9274, + 3: __ccgo_ts + 16743, + 4: __ccgo_ts + 16748, + 5: __ccgo_ts + 16751, + 6: __ccgo_ts + 16761, + 7: __ccgo_ts + 16771, + 8: __ccgo_ts + 16777, + 9: __ccgo_ts + 16781, + 10: __ccgo_ts + 16786, + 11: __ccgo_ts + 16791, + 12: __ccgo_ts + 16799, + 13: __ccgo_ts + 16810, + 14: __ccgo_ts + 16813, + 15: __ccgo_ts + 16781, + 16: __ccgo_ts + 16820, + 17: __ccgo_ts + 16786, + 18: __ccgo_ts + 16828, + 19: __ccgo_ts + 16832, + 20: __ccgo_ts + 16837, + 21: __ccgo_ts + 16843, + 22: __ccgo_ts + 16781, + 23: __ccgo_ts + 16786, + 24: __ccgo_ts + 16850, + 25: __ccgo_ts + 16855, + 26: __ccgo_ts + 16858, + 27: __ccgo_ts + 16865, + 28: __ccgo_ts + 16777, + 29: __ccgo_ts + 16781, + 30: __ccgo_ts + 16871, + 31: __ccgo_ts + 16876, + 32: __ccgo_ts + 16881, + 33: __ccgo_ts + 16739, + 34: __ccgo_ts + 16781, + 35: __ccgo_ts + 16885, + 36: __ccgo_ts + 16892, + 37: __ccgo_ts + 16899, + 38: __ccgo_ts + 12013, + 39: __ccgo_ts + 12009, + 40: __ccgo_ts + 16907, + 41: __ccgo_ts + 16912, + 42: __ccgo_ts + 16917, + 43: __ccgo_ts + 9274, + 44: __ccgo_ts + 16922, + 45: __ccgo_ts + 5595, + 46: __ccgo_ts + 16928, + 47: __ccgo_ts + 16933, + 48: __ccgo_ts + 16124, + 49: __ccgo_ts + 16938, + 50: __ccgo_ts + 16739, + 51: __ccgo_ts + 16781, + 52: __ccgo_ts + 16951, + 53: __ccgo_ts + 16956, + 54: __ccgo_ts + 16965, + 55: __ccgo_ts + 16972, + 56: __ccgo_ts + 16983, } // C documentation @@ -113699,338 +114030,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16919, + FzName: __ccgo_ts + 16991, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16934, + FzName: __ccgo_ts + 17006, 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 + 17021, 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 + 17033, 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 + 17049, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16900, + FzName: __ccgo_ts + 16972, 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 + 17062, 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 + 17074, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17022, + FzName: __ccgo_ts + 17094, 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 + 17110, 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 + 17131, 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 + 17146, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17090, + FzName: __ccgo_ts + 17162, 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 + 17176, 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 + 17189, 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 + 17203, 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 + 17222, 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 + 17241, 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 + 17264, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17201, + FzName: __ccgo_ts + 17273, 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 + 17291, 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 + 17308, 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 + 17321, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17264, + FzName: __ccgo_ts + 17336, 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 + 17354, 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 + 17364, 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 + 17378, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17322, + FzName: __ccgo_ts + 17394, 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 + 17419, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17366, + FzName: __ccgo_ts + 17438, 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 + 17449, 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 + 17460, 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 + 17472, 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 + 17488, 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 + 17501, 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 + 17520, 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 + 17539, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17480, + FzName: __ccgo_ts + 17552, 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 + 17567, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17505, + FzName: __ccgo_ts + 17577, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17517, + FzName: __ccgo_ts + 17589, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17526, + FzName: __ccgo_ts + 17598, 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 + 17609, 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 + 17619, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17559, + FzName: __ccgo_ts + 17631, 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 + 17642, 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 + 17654, 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 + 17671, 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 + 17690, 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 + 17716, 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 + 17731, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17673, + FzName: __ccgo_ts + 17745, 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 + 17764, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17706, + FzName: __ccgo_ts + 17778, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17722, + FzName: __ccgo_ts + 17794, 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 + 17806, 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 + 17817, 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 + 17828, 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 +114369,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17768, + FzName: __ccgo_ts + 17840, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17779, + FzName: __ccgo_ts + 17851, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17800, + FzName: __ccgo_ts + 17872, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17808, + FzName: __ccgo_ts + 17880, 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 + 17895, 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 + 17908, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17855, + FzName: __ccgo_ts + 17927, 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 + 17942, 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 +114425,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 +114533,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+17958) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17896) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17968) { return PAGER_LOCKINGMODE_NORMAL } } @@ -114223,13 +114554,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+17975) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17908) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17980) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -114252,10 +114583,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+16951) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17920) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+17992) == 0 { return int32(2) } else { return 0 @@ -114277,7 +114608,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+17999, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -114407,15 +114738,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 + 18061 case int32(OE_SetDflt): - zName = __ccgo_ts + 17998 + zName = __ccgo_ts + 18070 case int32(OE_Cascade): - zName = __ccgo_ts + 18010 + zName = __ccgo_ts + 18082 case int32(OE_Restrict): - zName = __ccgo_ts + 18018 + zName = __ccgo_ts + 18090 default: - zName = __ccgo_ts + 18027 + zName = __ccgo_ts + 18099 break } return zName @@ -114436,12 +114767,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 + 18109, + 1: __ccgo_ts + 18116, + 2: __ccgo_ts + 18124, + 3: __ccgo_ts + 18128, + 4: __ccgo_ts + 17992, + 5: __ccgo_ts + 18137, } // C documentation @@ -114503,15 +114834,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 + 18162 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18092 + zType = __ccgo_ts + 18164 } 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+18166, 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 +114851,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 + 18141, + 2: __ccgo_ts + 18146, + 3: __ccgo_ts + 18154, } // C documentation @@ -114621,7 +114952,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+18173, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114664,7 +114995,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 +115040,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 +115099,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+18177) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114811,7 +115142,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 +115170,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 + 17968 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 +115198,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 + 17958 } _returnSingleText(tls, v, zRet) break @@ -115157,7 +115488,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+18182, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -115167,7 +115498,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 +115520,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+18207, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -115221,8 +115552,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+18260) == 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 +115634,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 + 18266 } else { - v14 = __ccgo_ts + 18202 + v14 = __ccgo_ts + 18274 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -115375,7 +115707,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+18281, 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 +115737,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 + 11012 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13235 + zType = __ccgo_ts + 13260 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18225 + zType = __ccgo_ts + 18297 } else { - zType = __ccgo_ts + 9249 + zType = __ccgo_ts + 9274 } } } - _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+18304, 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 +115796,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+18311, 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+18316, 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 +115822,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 + 18321, + 1: __ccgo_ts + 18323, + 2: __ccgo_ts + 16810, } - _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+18325, 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 +115845,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+18331, 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 +115862,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+18335, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -115580,7 +115912,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 +115924,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 +115950,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+18338, 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+18347)) goto _32 _32: ; @@ -115632,8 +115964,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 +116091,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+18352, 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 +116187,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 @@ -115950,7 +116282,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+18356, 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 +116293,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+18380) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -116097,7 +116429,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+18409, 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 +116491,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 +116513,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+18445, 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 +116526,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+18465, 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 +116534,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+18487, 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 +116545,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+18510, -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+18512, 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 +116582,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+18532, 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 +116606,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+18562) _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+18567) _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 +116621,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+18588) _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+18624) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -116319,9 +116651,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+18562) _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+18635) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -116349,7 +116681,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+18662) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -116446,7 +116778,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 + 18689 (*(*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 +116857,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+18750, libc.VaList(bp+176, zRight)) } } } @@ -116630,13 +116962,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+17975) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18703) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18775) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18056) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18128) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116771,7 +117103,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 +117133,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 +117195,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+18783, 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 +117468,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18620, + FzName: __ccgo_ts + 18692, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18625, + FzName: __ccgo_ts + 18697, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18631, + FzName: __ccgo_ts + 18703, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18640, + FzName: __ccgo_ts + 18712, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18649, + FzName: __ccgo_ts + 18721, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18657, + FzName: __ccgo_ts + 18729, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18665, + FzName: __ccgo_ts + 18737, }, 7: { - FzName: __ccgo_ts + 18672, + FzName: __ccgo_ts + 18744, }, 8: {}, } @@ -117259,14 +117591,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+18801) 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+18816, libc.VaList(bp+240, int32(cSep), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -117275,19 +117607,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+18823, 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+18829) 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+18841) 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 +117634,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 +117815,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 +117827,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+18856) 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+18864, 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+18868, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -117510,7 +117842,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 +117968,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+18902, 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(143745)) } 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+18930, 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+18961, 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(143752)) } } } @@ -117661,9 +117993,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 + 18872, + 1: __ccgo_ts + 18879, + 2: __ccgo_ts + 18891, } // C documentation @@ -117739,7 +118071,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+14700) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117772,11 +118104,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+18969) } 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+14700) } } } @@ -117815,18 +118147,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 + 9274 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 + 18982 (*(*[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 +118242,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+12311) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117936,7 +118268,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+19054) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117951,7 +118283,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+19078, 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)) @@ -118280,7 +118612,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 +118641,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 +118701,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+19112, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -118385,7 +118717,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+19142, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -118408,10 +118740,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 +118751,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 +118781,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(144552)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -118583,7 +118915,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(144701)) } /* 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 @@ -118843,7 +119175,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 +119183,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 +119339,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 + 11418 + zSp2 = __ccgo_ts + 11418 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+19161, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -119072,25 +119404,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 +119557,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 +119641,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+19191, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -119356,12 +119691,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+19241, 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 +119711,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+19305, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -119388,6 +119724,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 +119765,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), } @@ -119470,7 +119813,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 +119858,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 +119882,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 +119903,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 +120026,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 +120153,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 +120164,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 +120341,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+19342, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -120109,8 +120452,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(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 +120461,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 +120546,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19290 + z = __ccgo_ts + 19362 case int32(TK_INTERSECT): - z = __ccgo_ts + 19300 + z = __ccgo_ts + 19372 case int32(TK_EXCEPT): - z = __ccgo_ts + 19310 + z = __ccgo_ts + 19382 default: - z = __ccgo_ts + 19317 + z = __ccgo_ts + 19389 break } return z @@ -120230,7 +120573,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+19395, libc.VaList(bp+8, zUsage)) } /* @@ -120267,13 +120610,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 + 19418 } 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+19432, 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+19463, 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 +120640,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 +120860,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 + 16922 } 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 +120973,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 +120982,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 +121006,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 + 16922 } 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+12597, 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 +121020,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+19509, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120769,7 +121112,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 + 16922 } zName = v3 } else { @@ -120784,7 +121127,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+19509, 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 +121163,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+19518, 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 +121282,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 + 19526 } else { zType = uintptr(0) j = int32(1) @@ -121005,7 +121348,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 +121376,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 +121426,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 +121449,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 +121597,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+19530, 0) return } /* Obtain authorization to do a recursive query */ @@ -121291,7 +121634,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 +121645,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 +121659,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 +121690,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+19579, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -121362,7 +121705,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+19621, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -121390,7 +121733,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+19627, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -121445,9 +121788,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 + 19642 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19572, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19644, 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 +121898,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+19667, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19682, 0) } /* Generate code for the left and right SELECT statements. */ @@ -121581,7 +121924,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+19362, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121607,7 +121950,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 +121976,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+19701, 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 +122008,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 +122034,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+19701, 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 +122141,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 +122158,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+19722, 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+19768, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121887,7 +122231,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+19342, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -122135,7 +122479,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 +122533,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 +122560,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+19850, 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+19861, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -122254,7 +122598,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+19866, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -122464,11 +122808,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 +122973,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 +123163,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 +123377,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 +123524,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) @@ -123470,7 +123814,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++ @@ -123539,7 +123883,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 +123901,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 +124388,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 +124434,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+15761) == 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+15765) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -124184,8 +124528,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+19872, 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 +124553,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 +124635,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 +124653,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+19890, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -124457,7 +124801,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 +124829,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+19913, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -124507,12 +124851,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+19933, 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 +124873,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 + 19976 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 +124904,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+19999, 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 +124913,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 + 20037 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19999 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20071 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -124620,7 +124964,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 +124974,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+20109, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124726,7 +125070,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 +125079,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 +125130,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+20113, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124801,7 +125145,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+20152, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124816,7 +125160,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+15293, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124940,7 +125284,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 +125301,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+20183, 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 +125380,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+20188, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -125049,7 +125393,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+12597, 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 +125413,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+20197, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20143, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20215, 0) } } } @@ -125085,7 +125429,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+20235, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -125334,7 +125678,7 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint (*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))) + *(*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 +125731,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 +125768,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+20266, 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+20317, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -125450,7 +125794,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+20350, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -125589,7 +125933,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 +126041,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 @@ -125764,7 +126108,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 + 20383 } else { v1 = __ccgo_ts + 1667 } @@ -125773,7 +126117,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+20406, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125805,7 +126149,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 +126278,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 +126307,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+16075) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -125995,9 +126340,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 +126352,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 +126378,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 +126551,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 +126561,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 +126581,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 +126605,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+20418, 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 +126713,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+20472, 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 +126914,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+20512, 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 +126953,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 +126968,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+20527, 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 +127022,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 +127055,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 +127114,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 +127143,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 +127172,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 +127209,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 +127225,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 +127255,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++ } @@ -126934,11 +127286,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.Uint16FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -126972,47 +127324,47 @@ 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)) /* 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)) /* Begin a loop that will extract all source rows in GROUP BY order. @@ -127022,16 +127374,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 +127401,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 + 20543 } else { - v46 = __ccgo_ts + 20480 + v47 = __ccgo_ts + 20552 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19323, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19395, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -127067,8 +127419,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -127086,8 +127438,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -127098,12 +127450,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 +127504,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 +127583,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 +127602,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 +127632,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 +127673,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 +127740,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+20543) } /* 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 +127846,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 +127862,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+20561, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -127596,7 +127952,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 +128114,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+20626, 0) goto trigger_cleanup } iDb = int32(1) @@ -127798,7 +128154,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+20672, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -127808,11 +128164,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+20680, 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+20721, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127821,13 +128177,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+20672, (*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+20761, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127835,8 +128191,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+20787, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127844,15 +128200,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 + 20825 } else { - v1 = __ccgo_ts + 20760 + v1 = __ccgo_ts + 20832 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20766, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20838, 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+20875, 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 +128228,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 +128330,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+20672, 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 +128352,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+20921, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -128012,10 +128368,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+20969, 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+21044, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -128283,11 +128639,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+21073, 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 +128681,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 +128698,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+21093, 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 +128831,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 + 21155 } else { - v1 = __ccgo_ts + 21090 + v1 = __ccgo_ts + 21162 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21097, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21169, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -128581,7 +128937,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+21217, 0) return int32(1) } @@ -128729,12 +129085,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 +129098,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 +129124,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 +129138,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 +129206,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 +129305,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+21259, 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 +129332,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 +129404,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 +129820,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 +129834,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 +129895,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 @@ -129617,58 +129978,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+21273, 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+21309, 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 +130047,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 +130069,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 +130089,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 +130102,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 +130122,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 +130149,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 +130192,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 +130533,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -130235,8 +130584,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 +130632,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 +130648,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 +130695,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+21328) } goto update_cleanup update_cleanup: @@ -130403,13 +130752,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 +130800,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 +131129,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+21341, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21273, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21345, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -130871,13 +131220,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 +131234,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+12686, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130967,7 +131316,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+21418, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21422, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -131058,7 +131407,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 +131446,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+21426) 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+21466) 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+21509) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -131124,7 +131473,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+21558) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -131177,7 +131526,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+15063) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131208,11 +131557,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+21585, 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+21693, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131221,7 +131570,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+21747, 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 +131580,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+21884, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -131758,7 +132107,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+12916, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131881,24 +132230,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+22007, 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+22031, 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+22130, 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 @@ -131982,7 +132336,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+22149, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -132024,9 +132378,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+22191, 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 +132393,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 + 22221 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -132073,7 +132427,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+16813, 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 +132508,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+22267, 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 +132595,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+22267, 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 +132643,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+22286, 0) return int32(SQLITE_ERROR) } goto _1 @@ -132300,9 +132654,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(158352))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158354)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -132344,7 +132698,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) } @@ -132800,7 +133154,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 +133174,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 +133238,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(158849)) } else { ap = va switch op { @@ -132897,7 +133251,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(158871)) break } _ = ap @@ -133582,7 +133936,6 @@ type TWhereInfo1 = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo1 = TWhereInfo1 @@ -133618,10 +133971,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 + 22299 } if i == -int32(1) { - return __ccgo_ts + 16850 + return __ccgo_ts + 16922 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -133640,10 +133993,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+22306, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22240, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22312, int32(1)) } i = 0 for { @@ -133651,7 +134004,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+13306, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133660,11 +134013,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+22312, int32(1)) } i = 0 for { @@ -133672,16 +134025,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+13306, 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 +134081,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+22314, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133736,12 +134089,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+22306, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22245 + v2 = __ccgo_ts + 22317 } else { - v2 = __ccgo_ts + 22250 + v2 = __ccgo_ts + 22322 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133758,7 +134111,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+22330) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133769,9 +134122,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+22332) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5175, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } // C documentation @@ -133816,11 +134169,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 + 22334 } else { - v2 = __ccgo_ts + 22269 + v2 = __ccgo_ts + 22341 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22274, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, 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 +134186,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 + 11469 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22280 + zFmt = __ccgo_ts + 22352 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22313 + zFmt = __ccgo_ts + 22385 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22338 + zFmt = __ccgo_ts + 22410 } else { - zFmt = __ccgo_ts + 22356 + zFmt = __ccgo_ts + 22428 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22365, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22437, 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 + 16922 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22445, 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+22476, libc.VaList(bp+144, zRowid)) cRangeOp = int8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133873,14 +134226,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+22486, 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+22491) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22441 + v3 = __ccgo_ts + 22513 } else { - v3 = __ccgo_ts + 22449 + v3 = __ccgo_ts + 22521 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -133901,7 +134254,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+22527, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133967,14 +134320,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+22538, 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+22317, 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+22559, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -133998,16 +134351,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+22306, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22245, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22317, 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 +134565,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 @@ -134291,7 +134644,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 */ @@ -134653,7 +135006,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 @@ -135066,7 +135419,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 +135480,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 +135515,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 +135656,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 +135736,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 +135770,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 +135892,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 +136085,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 +136099,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 +136143,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 +136167,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(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 +136203,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 +136235,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 +136290,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+22567, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135956,7 +136313,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+22582, 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 +136802,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,7 +136813,7 @@ 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+22591, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { @@ -136502,15 +136859,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 +136880,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) { @@ -136993,19 +137351,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16699, + FzOp: __ccgo_ts + 16771, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16033, + FzOp: __ccgo_ts + 16105, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15512, + FzOp: __ccgo_ts + 15564, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22533, + FzOp: __ccgo_ts + 22605, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -137793,7 +138151,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+22612, 0) return } } else { @@ -137805,10 +138163,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+22612, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137889,7 +138247,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 +138348,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 + 22653 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -138521,7 +138879,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+22660, 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,7 +138951,6 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo @@ -138604,7 +138961,6 @@ type THiddenIndexInfo1 = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo1 = THiddenIndexInfo1 @@ -139637,7 +139993,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)<>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 @@ -142254,7 +142606,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { + })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0)) { if libc.Int32FromUint16((*(*struct { FnEq Tu16 FnBtm Tu16 @@ -142458,7 +142810,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 @@ -142742,7 +143094,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 +143272,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)) @@ -143261,7 +143613,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+22733, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143336,7 +143688,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+22733, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143490,7 +143842,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(168893)) /* 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 +144278,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+22759, 0) rc = SQLITE_OK } else { break @@ -145134,7 +145486,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+22794, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145712,7 +146064,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 +146220,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+22812, 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,10 +146241,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.Int32FromUint64(libc.Uint64FromInt64(960)) - if nTabList > int32(1) { - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt32(nByteWInfo) + libc.Uint64FromInt32(nTabList-libc.Int32FromInt32(1))*libc.Uint64FromInt64(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) @@ -145941,7 +146290,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+22840, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -146086,7 +146435,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 +146470,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. @@ -146246,7 +146596,7 @@ 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 @@ -146277,16 +146627,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 @@ -146465,7 +146815,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 { @@ -146672,7 +147022,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 +147032,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+22858, 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 +147082,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 +147351,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+22887, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -147183,7 +147533,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+22943, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -147509,7 +147859,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+22988, libc.VaList(bp+8, zName)) } return p } @@ -147560,12 +147910,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+23007, 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+23078, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -147638,7 +147988,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 } @@ -147776,7 +148126,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( 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 { @@ -147920,7 +148270,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+23141, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147956,7 +148306,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 +148321,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 +148340,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 +148390,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 +148411,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 +148433,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 +148557,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+23167, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -148275,18 +148625,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 + 23199 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23144 + zErr = __ccgo_ts + 23216 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23160 + zErr = __ccgo_ts + 23232 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23180, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23252, 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 +148660,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+23285, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -148416,24 +148766,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 +148801,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 +148818,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 +148878,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 + 23332, + 1: __ccgo_ts + 23385, + 2: __ccgo_ts + 22887, + 3: __ccgo_ts + 23436, + 4: __ccgo_ts + 23488, } var _aOp1 = [5]int32{ @@ -149112,7 +149462,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 +149558,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 +150275,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 +150288,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 +150314,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 +150347,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 +150566,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 +150630,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+23538, libc.VaList(bp+8, p)) } // C documentation @@ -150290,6 +150644,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 +150678,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 + 23562 } else { - v1 = __ccgo_ts + 23499 + v1 = __ccgo_ts + 23571 } - _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+23577, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -150336,7 +150691,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+23619, 0) } } } @@ -150442,7 +150797,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+23653, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -158899,20 +159254,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+16922, 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+23691, 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+16858, 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+23691, 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 +159308,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 +159458,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 +159553,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 +159910,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+23718) 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) { @@ -159895,9 +160260,9 @@ _237: */ _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 + v347 = __ccgo_ts + 8102 } else { - v347 = __ccgo_ts + 8082 + v347 = __ccgo_ts + 8107 } *(*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 { @@ -160139,15 +160504,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+23727, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23750, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23822, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23834, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23906, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -160289,7 +160654,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 +160848,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+23991, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -163214,14 +163579,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)< int32(65528) { sz = int32(65528) } - if cnt < 0 { + /* 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 > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } szAlloc = int64(sz) * int64(cnt) - if sz == 0 || cnt == 0 { + 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)) @@ -164697,7 +165071,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182779)) + return _sqlite3MisuseError(tls, int32(183820)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164717,7 +165091,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+24078, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -165018,14 +165392,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 + 24621 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -165037,31 +165411,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 + 24146, + 1: __ccgo_ts + 24159, + 3: __ccgo_ts + 24175, + 4: __ccgo_ts + 24200, + 5: __ccgo_ts + 24214, + 6: __ccgo_ts + 24233, 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 + 24258, + 9: __ccgo_ts + 24295, + 10: __ccgo_ts + 24307, + 11: __ccgo_ts + 24322, + 12: __ccgo_ts + 24355, + 13: __ccgo_ts + 24373, + 14: __ccgo_ts + 24398, + 15: __ccgo_ts + 24427, + 17: __ccgo_ts + 6130, + 18: __ccgo_ts + 5534, + 19: __ccgo_ts + 24444, + 20: __ccgo_ts + 24462, + 21: __ccgo_ts + 24480, + 23: __ccgo_ts + 24514, + 25: __ccgo_ts + 24535, + 26: __ccgo_ts + 24561, + 27: __ccgo_ts + 24584, + 28: __ccgo_ts + 24605, } // C documentation @@ -165208,6 +165582,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 // // /* @@ -165240,7 +165628,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i 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(183430)) + return _sqlite3MisuseError(tls, int32(184509)) } 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) @@ -165283,7 +165671,7 @@ 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+24702, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165409,7 +165797,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+24765, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -165440,7 +165828,7 @@ 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) } @@ -165684,7 +166072,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(184046)) + return _sqlite3MisuseError(tls, int32(185125)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -165694,7 +166082,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+24816, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165816,7 +166204,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(184182))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185261))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165948,7 +166336,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(184261)) + return _sqlite3MisuseError(tls, int32(185340)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165958,7 +166346,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(184270)) + return _sqlite3MisuseError(tls, int32(185349)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -166007,7 +166395,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(184318)) + return _sqlite3MisuseError(tls, int32(185397)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -166016,7 +166404,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+24837, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -166163,7 +166551,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+24905, 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 @@ -166193,8 +166581,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+24911, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24921, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -166283,24 +166671,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+24949, 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+24953, 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 + 24953 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24902, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24974, 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 @@ -166329,12 +166717,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+24989, 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+25009, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -166358,7 +166746,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+25033, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -166378,11 +166766,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24887, + Fz: __ccgo_ts + 24959, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24894, + Fz: __ccgo_ts + 24966, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -166393,19 +166781,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24907, + Fz: __ccgo_ts + 24979, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24910, + Fz: __ccgo_ts + 24982, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24913, + Fz: __ccgo_ts + 24985, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17920, + Fz: __ccgo_ts + 17992, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -166533,8 +166921,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+22653, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25049, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -166555,10 +166943,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(184993)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186072)) /* 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) } @@ -166567,7 +166955,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) } @@ -166594,9 +166982,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 + 24051 (*(*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 { @@ -166690,7 +167078,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 + 25055 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166850,7 +167238,7 @@ 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) @@ -166907,20 +167295,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+25058, 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+25083) } 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+25103) } 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+25110) } // C documentation @@ -166945,9 +167333,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) @@ -166974,29 +167362,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 @@ -167051,15 +167428,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+25127, 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) @@ -167238,8 +167615,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 @@ -168079,7 +168456,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+25155, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -168297,7 +168674,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 + 25163 } else { v2 = uintptr(0) } @@ -168543,7 +168920,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 @@ -168760,6 +169137,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -169072,8 +169456,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 @@ -169130,7 +169514,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 @@ -169140,7 +169524,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 @@ -169178,18 +169562,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 + 25186, + 12: __ccgo_ts + 25192, 13: __ccgo_ts + 1667, 14: __ccgo_ts + 1667, 15: __ccgo_ts + 1667, @@ -169676,7 +170060,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) { @@ -169974,8 +170358,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) } } @@ -170111,7 +170495,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+15507, 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)) @@ -170125,14 +170509,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+25199, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -170186,7 +170568,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+25228, -int32(1)) } } } @@ -170469,8 +170851,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 + 25243, + FzRepl: __ccgo_ts + 25247, }, 1: { Fc1: int8('i'), @@ -170478,8 +170860,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 + 25255, + FzRepl: __ccgo_ts + 25247, }, 2: { Fc1: int8('n'), @@ -170494,7 +170876,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25209, + FzMatch: __ccgo_ts + 25264, FzRepl: __ccgo_ts + 1653, }, 4: { @@ -170502,7 +170884,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25214, + FzMatch: __ccgo_ts + 25269, FzRepl: __ccgo_ts + 1653, }, } @@ -170518,7 +170900,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+25274, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -170536,23 +170918,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 } @@ -170630,7 +171012,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 @@ -170701,7 +171083,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) + } } } } @@ -170976,7 +171362,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+25317, 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') { @@ -171406,7 +171792,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 { @@ -171445,7 +171831,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)) } @@ -171453,7 +171839,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)) } @@ -171530,14 +171916,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+25243, 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+25326) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25278) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25333) } - 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+25339, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171722,7 +172108,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+25333) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171767,7 +172153,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+25228, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171780,7 +172166,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+25228, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171829,10 +172215,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) @@ -171866,15 +172248,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 @@ -171947,11 +172329,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: ; @@ -172000,9 +172382,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25192 + v19 = __ccgo_ts + 25247 } else { - v19 = __ccgo_ts + 11944 + v19 = __ccgo_ts + 11969 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -172038,9 +172420,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: ; @@ -172067,7 +172452,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25290, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25345, uint32(2)) zIn2++ sz2-- continue @@ -172090,7 +172475,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25293, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25348, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -172098,12 +172483,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25300, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25355, 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+25360, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -172283,7 +172668,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+25367, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172306,12 +172691,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+25370, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25312, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25367, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172326,50 +172711,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 // // /* @@ -172421,6 +172762,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 // // /* @@ -172441,6 +172860,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)) @@ -172513,9 +172935,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 @@ -172558,7 +172980,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 @@ -173046,7 +173479,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+25228, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -173181,7 +173614,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 } @@ -173282,7 +173715,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+25228, -int32(1)) return } @@ -173319,11 +173752,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+25199, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -173336,7 +173766,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+25228, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -173355,10 +173785,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+25333) } 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+25326) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -173397,7 +173827,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+25373, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -173413,7 +173843,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. // ** @@ -173494,7 +173924,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+25228, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -173506,34 +173936,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; +// ** 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. +// ** 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) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { + 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 (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) - return 0 + 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 (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - 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 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) @@ -173616,7 +174066,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 @@ -173676,7 +174126,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+25228, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173811,7 +174261,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 + 25391 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173821,7 +174271,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+25228, -int32(1)) } } eErr = uint8(1) @@ -173931,23 +174381,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+25393, uint32(1)) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25340, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25395, 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+25397, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25345, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25400, uint32(1)) } } } @@ -173987,7 +174437,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+25228, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -174255,7 +174705,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+25228, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -174279,7 +174729,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+25402, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -174290,7 +174740,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+25453, -int32(1)) _jsonStringReset(tls, bp) return } @@ -174362,7 +174812,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+25228, -int32(1)) } } goto json_remove_done @@ -174399,7 +174849,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+16027) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -174430,9 +174880,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 + 25487 } else { - v1 = __ccgo_ts + 25436 + v1 = __ccgo_ts + 25491 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -174480,7 +174930,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+25228, -int32(1)) } } goto json_type_done @@ -174527,7 +174977,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 + 25498 (*(*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)) @@ -174601,17 +175051,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+25503, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -174620,18 +175069,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 @@ -174693,9 +175141,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))) @@ -174802,7 +175248,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+25560, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174894,20 +175340,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))) + } } } @@ -174951,7 +175399,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+25563, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -175054,7 +175502,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+25566) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -175188,7 +175636,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+25649, 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 @@ -175214,9 +175662,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+25656, 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+25664, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -175527,9 +175975,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))) @@ -175602,7 +176049,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+25670, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -175626,7 +176073,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+25228, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175687,186 +176134,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 + 25672, }, 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 + 25677, }, 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 + 25683, }, 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 + 25694, }, 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 + 25706, }, 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 + 25706, }, 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 + 25724, }, 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 + 25744, }, 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 + 25757, }, 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 + 25771, }, 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 + 25774, }, 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 + 25778, }, 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 + 25790, }, 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 + 25803, }, 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 + 25815, }, 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 + 25828, }, 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 + 25839, }, 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 + 25851, }, 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 + 25851, }, 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 + 25863, }, 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 + 25874, }, 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 + 25886, }, 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 + 25899, }, 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 + 25912, }, 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 + 25926, }, 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 + 25935, }, 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 + 25945, }, 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 + 25945, }, 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 + 25955, }, 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 + 25955, }, 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 + 25966, }, 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 + 25983, }, 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 + 26001, }, 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 + 26019, }, } @@ -175949,17 +176396,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25983, + FzName: __ccgo_ts + 26038, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25993, + FzName: __ccgo_ts + 26048, 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 @@ -176067,7 +176516,6 @@ type TRtreeMatchArg = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - FaParam [1]TRtreeDValue } type RtreeMatchArg = TRtreeMatchArg @@ -176350,11 +176798,12 @@ type TRtreeMatchArg1 = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - 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 ** clang, since clang works hard to be gcc compatible. So the gcc @@ -176599,7 +177048,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+26058, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -176904,7 +177353,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+26063, 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 { @@ -177821,7 +178270,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+26145) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -178130,7 +178579,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 } @@ -178138,7 +178587,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 @@ -178376,7 +178825,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: @@ -179311,7 +179760,7 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179328,7 +179777,7 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179356,7 +179805,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+26159, 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 { @@ -179366,11 +179815,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+26179, 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+26211, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -179584,7 +180033,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+26248, 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)) @@ -179638,9 +180087,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 + 26393 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+11798, 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) { @@ -179698,9 +180147,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 + 26449, + 1: __ccgo_ts + 5595, + 2: __ccgo_ts + 16922, } var _rtreeModule = Tsqlite3_module{ @@ -179744,21 +180193,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+26863, 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+26925, 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+26930, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26994, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27064, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179788,7 +180237,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 + 27113 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179803,31 +180252,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+27221, 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+27266, 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+13306, 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+27293, 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+27315, 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+27323, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179841,14 +180290,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 + 26454, + 1: __ccgo_ts + 26507, + 2: __ccgo_ts + 26552, + 3: __ccgo_ts + 26604, + 4: __ccgo_ts + 26658, + 5: __ccgo_ts + 26703, + 6: __ccgo_ts + 26761, + 7: __ccgo_ts + 26816, } // C documentation @@ -179906,7 +180355,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+27339, 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) @@ -179914,17 +180363,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+27359, 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))) @@ -180001,13 +180450,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+27602, 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+27608, 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) { @@ -180016,7 +180465,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+27632, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -180030,19 +180479,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+27659, 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))) } } } @@ -180065,7 +180514,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)) @@ -180076,7 +180525,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 @@ -180092,8 +180541,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27583, - 1: __ccgo_ts + 27594, + 0: __ccgo_ts + 27638, + 1: __ccgo_ts + 27649, } // C documentation @@ -180151,21 +180600,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+11418, 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+27662, 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+27668, 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+27672, int32(1)) goto _1 _1: ; @@ -180192,7 +180641,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+27674, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -180295,7 +180744,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) @@ -180310,11 +180759,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+27707, 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) } @@ -180348,7 +180797,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+27714, 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) @@ -180365,7 +180814,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+27759, libc.VaList(bp+8, iNode)) } } return pRet @@ -180394,8 +180843,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 + 27791, + 1: __ccgo_ts + 27845, } 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)) @@ -180408,21 +180857,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 + 27893 } else { - v1 = __ccgo_ts + 27846 + v1 = __ccgo_ts + 27901 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27855, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27910, 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 + 27893 } else { - v2 = __ccgo_ts + 27846 + v2 = __ccgo_ts + 27901 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27900, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27955, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -180467,7 +180916,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+28013, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -180485,7 +180934,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+28061, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -180518,19 +180967,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+28128, 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+28162, 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+28192, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -180575,12 +181024,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+28247, 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+28278, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -180609,7 +181058,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+28345, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -180619,11 +181068,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+26159, 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+28373, 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)) @@ -180639,8 +181088,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+28404, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28411, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -180667,7 +181116,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+28419, 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) } @@ -180718,13 +181167,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+28438, -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))) } @@ -180733,7 +181182,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 + 18689 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -181200,19 +181649,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+25338, int32(1)) + Xsqlite3_str_append(tls, x, __ccgo_ts+25393, int32(1)) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28434, 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+28489, 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+28445, 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+28500, 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) } @@ -181241,20 +181690,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+28456, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28511, 0) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28474, 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+28529, 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+28482, 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+28537, 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) { @@ -181262,14 +181711,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+28490, libc.VaList(bp+8, z)) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28545, libc.VaList(bp+8, z)) } goto _2 _2: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28494, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28549, 0) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -181315,8 +181764,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 @@ -181348,13 +181797,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 } @@ -181434,16 +181883,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 } @@ -181490,9 +181939,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: ; @@ -181718,7 +182167,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 // ** @@ -181757,7 +182206,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) } @@ -181861,7 +182310,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 @@ -181945,7 +182394,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 @@ -182229,7 +182678,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) { @@ -182398,13 +182847,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+27602, 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+28562, 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) @@ -182413,13 +182862,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+28584, 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+27659, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -182427,7 +182876,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) @@ -182442,7 +182891,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 @@ -182654,7 +183103,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 + 16922 (*(*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) @@ -182664,7 +183113,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 + 28588 (*(*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) @@ -182672,7 +183121,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 + 28594 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182792,7 +183241,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+28603, 0) } goto geopoly_update_end } @@ -182895,12 +183344,12 @@ geopoly_update_end: func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28588) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28643) == 0 { *(*uintptr)(unsafe.Pointer(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 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28659) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) @@ -182971,7 +183420,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+28836, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -182985,61 +183434,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28619, + FzName: __ccgo_ts + 28674, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28632, + FzName: __ccgo_ts + 28687, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28645, + FzName: __ccgo_ts + 28700, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28658, + FzName: __ccgo_ts + 28713, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28604, + FzName: __ccgo_ts + 28659, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28670, + FzName: __ccgo_ts + 28725, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28588, + FzName: __ccgo_ts + 28643, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28693, + FzName: __ccgo_ts + 28748, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28707, + FzName: __ccgo_ts + 28762, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28720, + FzName: __ccgo_ts + 28775, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28734, + FzName: __ccgo_ts + 28789, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28750, + FzName: __ccgo_ts + 28805, }, } @@ -183065,7 +183514,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28762, + FzName: __ccgo_ts + 28817, }, } @@ -183090,20 +183539,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+28844, 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+28854, 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+28865, -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+28588, 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+28876, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -183177,7 +183626,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) @@ -183205,7 +183654,7 @@ 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+26145, __ccgo_fp(_rtreeMatchArgFree)) } } } @@ -183446,7 +183895,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 @@ -184422,7 +184871,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+28886, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -184432,7 +184881,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+28886, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -184458,7 +184907,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 @@ -184481,7 +184930,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 } @@ -184613,7 +185062,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+28907, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184702,7 +185151,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+26058, 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')) { @@ -184739,13 +185188,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 + 29078 } 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+29119, 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+29269) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184912,7 +185361,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))) } } @@ -184973,7 +185422,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+29394, 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 @@ -184983,7 +185432,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+29513, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -184991,7 +185440,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+29534, 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) @@ -185003,7 +185452,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+29585, 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 { @@ -185047,7 +185496,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+29606, 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))) { @@ -185060,7 +185509,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+29634, 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 { @@ -185113,7 +185562,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+20197, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -185124,7 +185573,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+29663, 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) @@ -185135,7 +185584,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+29682, 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 @@ -185143,7 +185592,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+29687, zName) { bRbuRowid = int32(1) } } @@ -185157,17 +185606,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 + 29697 } else { - v4 = __ccgo_ts + 29655 + v4 = __ccgo_ts + 29710 } - (*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+29719, 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+29748, 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)) @@ -185189,7 +185638,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+29770, 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)) @@ -185235,8 +185684,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+29797, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15174 goto _1 _1: ; @@ -185270,7 +185719,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+29806, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -185318,21 +185767,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+29819, 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+29851, 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+15174, __ccgo_ts+29874) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29880, __ccgo_ts+29887, __ccgo_ts+5201) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15174, __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+29895, 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+29937, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -185384,7 +185833,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+29634, 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)) @@ -185406,15 +185855,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 + 29957 } } 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+29965, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29986, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30022, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15174 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -185423,7 +185872,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+30049, 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 @@ -185440,15 +185889,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+30097, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15174 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+30104, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -185506,7 +185955,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+29634, 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)) @@ -185515,7 +185964,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+30116, 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 { @@ -185535,9 +185984,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 + 29957 } else { - zCol = __ccgo_ts + 29632 + zCol = __ccgo_ts + 29687 } } zType = __ccgo_ts + 1141 @@ -185545,24 +185994,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+30138, 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 + 29874 } 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+30158, 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+30179, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30212, 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 + 15174 + zAnd = __ccgo_ts + 22306 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185616,11 +186065,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+30236, 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+30248, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15149 + zS = __ccgo_ts + 15174 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -185632,7 +186081,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+30257, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -185658,7 +186107,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+30272, 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 @@ -185668,15 +186117,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+30286, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22306 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30243, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30298, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1667 i1 = 0 @@ -185686,8 +186135,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+30348, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22306 } goto _2 _2: @@ -185710,7 +186159,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+30361, 0) } // C documentation @@ -185752,16 +186201,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+30348, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15174 } 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+30387, 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 + 15174 } 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+30417, 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 + 15174 } } } @@ -185845,16 +186294,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 + 30454 *(*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+29606, 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+16810) == 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+29634, libc.VaList(bp+24, zIdx))) } break } @@ -185865,16 +186314,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 + 29874 } 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+30467, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15174 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30423, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30478, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -185920,7 +186369,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+30482) 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))) { @@ -185928,7 +186377,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+29634, 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))) { @@ -185937,21 +186386,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+30532, 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 + 29874 } 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+30554, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15174 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30509, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30564, 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+30579, 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)) } } @@ -185988,7 +186437,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) { @@ -185997,19 +186446,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 + 30641 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30599 + v2 = __ccgo_ts + 30654 } 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+30664, 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 + 15174 goto _1 _1: ; @@ -186018,17 +186467,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+30691, 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 + 30698 } 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+30713, 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)) } } @@ -186054,7 +186503,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+30745, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -186100,7 +186549,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+30802) } 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)) @@ -186269,7 +186718,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+30868, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -186286,18 +186735,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+30888, 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+30953, 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+30989, 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 { @@ -186312,26 +186761,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 + 31023 } else { - v2 = __ccgo_ts + 30972 + v2 = __ccgo_ts + 31027 } 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+31033, 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+31094, 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 + 31023 } else { - v3 = __ccgo_ts + 30972 + v3 = __ccgo_ts + 31027 } - 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+31155, 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 { @@ -186350,8 +186799,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). */ @@ -186360,39 +186809,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 + 31314 } 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 + 31323 } 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+31333, 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+31369, 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 + 31397 } /* 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 + 31409 } 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+31426, 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+31502, 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+31801, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -186403,9 +186852,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 + 31900 } else { - v7 = __ccgo_ts + 31855 + v7 = __ccgo_ts + 31910 } zRbuRowid1 = v7 } @@ -186418,14 +186867,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+29957, 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+15174, __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 + 31921 } else { v8 = __ccgo_ts + 1667 } @@ -186435,11 +186884,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 + 23562 } 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+31927, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -186527,9 +186976,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 + 31314 } - 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+31975, 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 } @@ -186556,7 +187005,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) } @@ -186603,7 +187052,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+32005, 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): @@ -186662,27 +187111,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+32035, 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+32063, 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+32081, 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 } @@ -186715,10 +187164,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+32147, 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+24905, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186734,14 +187183,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 + 32179 } 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+32181, 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 @@ -186752,27 +187201,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+32213, -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+32228, 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+32245, -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+32261, 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+32289, 0) } } @@ -186858,7 +187307,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { if pState == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32206, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32261, uintptr(0), uintptr(0), uintptr(0)) } } /* Assuming no error has occurred, run a "restart" checkpoint with the @@ -186891,7 +187340,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CAPTURE) - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32252, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32307, uintptr(0), uintptr(0), uintptr(0)) if rc2 != int32(SQLITE_NOTICE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -187024,16 +187473,16 @@ 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) + 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_methods1)(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) } - 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)) @@ -187055,7 +187504,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+32342, 0) } // C documentation @@ -187072,13 +187521,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+32367, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32374, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -187210,7 +187659,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+24462, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -187346,7 +187795,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+32381) 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 @@ -187359,7 +187808,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+32403, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -187386,7 +187835,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+32430, 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))) @@ -187422,9 +187871,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+32590, 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+32605, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -187447,9 +187896,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+32625, 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+32650) } 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) @@ -187460,10 +187909,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+32758) } 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+32823) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -187481,7 +187930,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+32867, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -187508,8 +187957,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+17895) + _rbuCopyPragma(tls, p, __ccgo_ts+17006) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -187517,7 +187966,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+32892, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -187539,10 +187988,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+15078, 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+15078, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -187629,7 +188078,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+32920, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -187652,10 +188101,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+32367, 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) } @@ -187677,7 +188126,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+32945, 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) @@ -187724,7 +188173,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+32956, 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 { @@ -187769,11 +188218,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+33028, 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+33042) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187782,7 +188231,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+33099) 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) @@ -187830,7 +188279,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 @@ -187862,7 +188311,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+33173, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187884,17 +188333,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 + 33205 } else { - v3 = __ccgo_ts + 33157 + v3 = __ccgo_ts + 33212 } - (*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+33219, 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+15063, 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) @@ -187906,21 +188355,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+17609) + _rbuCopyPragma(tls, p, __ccgo_ts+17021) } /* 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+33251, 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+33267, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -187998,7 +188447,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+33291, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -188045,7 +188494,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+31314, 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++ @@ -188073,7 +188522,7 @@ 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+15078, 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) { @@ -188082,7 +188531,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { } _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+15078, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -188092,7 +188541,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+33299, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -188193,7 +188642,7 @@ 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+15078, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ @@ -188206,19 +188655,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { 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+15078, 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 + 15063 } else { - v1 = __ccgo_ts + 33196 + v1 = __ccgo_ts + 33251 } 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+33251, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -188704,7 +189153,7 @@ func _rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileSize})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, pSize) /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existence of a *-wal file. rbuVfsRead() contains ** similar logic. */ if rc == SQLITE_OK && *(*Tsqlite_int64)(unsafe.Pointer(pSize)) == 0 && (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpRbu)).FzTarget == uintptr(0) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_MAIN_DB) != 0 { *(*Tsqlite_int64)(unsafe.Pointer(pSize)) = int64(1024) @@ -188785,7 +189234,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xControl})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, int32(SQLITE_FCNTL_ZIPVFS), bp) if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33271, 0) + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33326, 0) } else { if rc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p @@ -188811,7 +189260,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r if rc == SQLITE_OK && op == int32(SQLITE_FCNTL_VFSNAME) { pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs zIn = *(*uintptr)(unsafe.Pointer(pArg)) - zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33294, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33349, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -189006,7 +189455,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag if pDb != 0 { if (*Trbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == int32(RBU_STAGE_OAL) { if (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) { - zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6715) + zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6740) zOpen = Xsqlite3_filename_wal(tls, zOpen) } nOpen = libc.Xstrlen(tls, zOpen) @@ -189020,7 +189469,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag } else { (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu } - if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33305, 0) != 0 { + if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33360, 0) != 0 { oflags = libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) } @@ -189576,7 +190025,7 @@ func _statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint _sqlite3TokenInit(tls, bp, *(*uintptr)(unsafe.Pointer(argv + 3*8))) iDb = _sqlite3FindDb(tls, db, bp) if iDb < 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12382, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12407, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) return int32(SQLITE_ERROR) } } else { @@ -190076,7 +190525,7 @@ statNextRestart: (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiPgno = iRoot (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33316, 0) + v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33371, 0) z = v1 (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FzPath = v1 if z == uintptr(0) { @@ -190114,8 +190563,8 @@ statNextRestart: if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { (*TStatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33318 - v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33327, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33373 + v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33382, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) z = v2 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v2 if z == uintptr(0) { @@ -190144,7 +190593,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage++ if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226029)) + return _sqlite3CorruptError(tls, int32(227304)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -190155,7 +190604,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+33394, 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) { @@ -190178,13 +190627,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 + 33402 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 + 33411 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33361 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33416 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -190193,7 +190642,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) { @@ -190282,12 +190731,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+33426, 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+33581, 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+33595, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -190364,7 +190813,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+33610, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -191658,11 +192107,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+11798, 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+33617, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1667, 0) @@ -191671,7 +192120,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+33747, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191697,7 +192146,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, __ccgo_ts+29902))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, __ccgo_ts+29957))) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { 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)))) @@ -191721,8 +192170,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+29957) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29957, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191786,7 +192235,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 @@ -191803,6 +192252,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 { @@ -191824,7 +192275,7 @@ 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+11798, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { @@ -192119,10 +192570,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 + 11418 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33722, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33777, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -192134,8 +192585,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 + 15174 goto _1 _1: ; @@ -192789,8 +193240,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+33784, 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 + 22306 if zRet == uintptr(0) { break } @@ -192819,8 +193270,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+33818, 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 + 33859 if zRet == uintptr(0) { break } @@ -192831,7 +193282,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 } @@ -192842,12 +193293,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 + 33864 } 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+33875, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192908,11 +193359,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15149 + v2 = __ccgo_ts + 15174 } 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+33954, 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 } @@ -192940,7 +193391,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+33973, 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 { @@ -192969,17 +193420,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)) @@ -192992,7 +193444,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 } @@ -193003,18 +193457,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+34030, 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+34061, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -193040,7 +193520,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+34082, 0) } rc = int32(SQLITE_SCHEMA) } @@ -193372,7 +193852,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) } @@ -193672,12 +194152,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+34109, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11798, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34113, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34137, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34146, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34191, bp) } else { i = 0 for { @@ -193685,17 +194165,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+15174, 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 + 15174 _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+34205, 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+34209, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -193709,7 +194189,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+34236, 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) } @@ -193851,7 +194331,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, 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+34278, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193957,7 +194437,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } } 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+34298, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -194212,13 +194692,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 } } @@ -194374,7 +194855,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(230285)) + rc = _sqlite3CorruptError(tls, int32(231591)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -194398,7 +194879,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(230305)) + rc = _sqlite3CorruptError(tls, int32(231611)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -194413,7 +194894,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(230315)) + rc = _sqlite3CorruptError(tls, int32(231621)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -194469,7 +194950,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(230363)) + rc = _sqlite3CorruptError(tls, int32(231669)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -194574,7 +195055,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(230451)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231757)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -194645,8 +195126,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) @@ -194680,7 +195161,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(230537)) + v7 = _sqlite3CorruptError(tls, int32(231843)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194690,7 +195171,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(230543)) + v10 = _sqlite3CorruptError(tls, int32(231849)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194769,7 +195250,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(230587)) + v16 = _sqlite3CorruptError(tls, int32(231893)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -195179,7 +195660,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230952)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232258)) goto finished_invert } if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { @@ -195382,7 +195863,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+11798) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -195391,9 +195872,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+34316, 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+34329, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -195403,9 +195884,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+34335, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15149 + zSep = __ccgo_ts + 15174 } goto _2 _2: @@ -195414,7 +195895,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+34340, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -195423,13 +195904,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+34348, 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+34423, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22234 + zSep = __ccgo_ts + 22306 } goto _3 _3: @@ -195516,9 +195997,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+34429, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34233, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34340, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -195528,9 +196009,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+34335, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22234 + zSep = __ccgo_ts + 22306 } goto _1 _1: @@ -195538,9 +196019,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+34447, 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+33859, bp) zSep = __ccgo_ts + 1667 i = 0 for { @@ -195550,16 +196031,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+34423, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34348 + zSep = __ccgo_ts + 34455 } 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)) @@ -195585,7 +196066,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 @@ -195608,16 +196089,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+34460, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22240, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22312, 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+15174, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -195625,19 +196106,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+34478, 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+34489, 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)) } @@ -195660,12 +196141,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+11798, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34386) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34493) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34499) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34606) } return rc } @@ -195731,7 +196212,7 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231434)) + rc = _sqlite3CorruptError(tls, int32(232740)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -196147,7 +196628,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+34750, 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)) @@ -196160,7 +196641,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+34771, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -196260,10 +196741,10 @@ 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+34790, 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+34816, 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)) @@ -196294,7 +196775,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui ** 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)))) 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 @@ -196304,7 +196785,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 } @@ -196323,18 +196804,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+34846, 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+34890, 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+34961, 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+11798) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -196391,17 +196872,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34914, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35021, 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+35051, 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+35075, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35051, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -197177,7 +197658,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 { @@ -197213,11 +197694,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 @@ -197802,6 +198289,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 @@ -197847,8 +198335,7 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset @@ -197860,12 +198347,13 @@ type Fts5Colset = TFts5Colset ** This object is used by fts5_expr.c and fts5_index.c. */ type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 + FnCol 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 ** to parse the arguments passed to the CREATE VIRTUAL TABLE statement. @@ -198242,7 +198730,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -198270,16 +198757,14 @@ 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 @@ -198321,7 +198806,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 @@ -199125,7 +199610,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+35103, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -199481,7 +199966,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+35131, 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 */ } @@ -199765,7 +200250,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+35162, 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) } @@ -199864,7 +200349,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 + 35169 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200119,7 +200604,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 + 35219 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200390,7 +200875,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))) @@ -200482,13 +200967,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) } @@ -200514,13 +200999,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 + 35267 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 + 35323 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -200553,19 +201038,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35274, + FzFunc: __ccgo_ts + 35381, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35282, + FzFunc: __ccgo_ts + 35389, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35292, + FzFunc: __ccgo_ts + 35399, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35297, + FzFunc: __ccgo_ts + 35404, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200953,7 +201438,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 @@ -201429,7 +201914,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+35420, 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) { @@ -201455,12 +201940,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+35427, 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+35458, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201469,7 +201954,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+35491, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201479,14 +201964,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+35528, zCmd, nCmd) == 0 { p1 = zArg nArg = libc.Int64FromUint64(libc.Xstrlen(tls, zArg) + uint64(1)) 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+35537, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -201513,7 +201998,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+35570, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -201525,76 +202010,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+35604, 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+35612, 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+35644, 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+35650, 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+35669, 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+35712, 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+35669, 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+35734, 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+35748, 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+35786, 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+35797, 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+35832, 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+35839, 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 + 17975, }, 2: { - FzName: __ccgo_ts + 35763, + FzName: __ccgo_ts + 35870, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -201602,20 +202087,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+35878, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35802, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35909, 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+35919, 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+35953, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201676,16 +202161,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+35981) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16922) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35986, 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+36016) { *(*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+36026, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201711,7 +202196,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+36057, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201719,12 +202204,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+36062, 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+36069, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35970, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36077, 0) } } goto _1 @@ -201740,9 +202225,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+36084, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35970, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36077, 0) } goto _2 _2: @@ -201805,8 +202290,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+35981) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36092, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201837,7 +202322,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+36121, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -201867,7 +202352,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+36141, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201875,37 +202360,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+36191, 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+36246, 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 + 35604 } 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 + 35604 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36192 + zTail = __ccgo_ts + 36299 } } } 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+36307, 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+16922, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201974,7 +202459,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+36318, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -201983,16 +202468,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 + 15174 } 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+36334, 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+36341, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35981)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -202150,7 +202635,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+36367) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -202161,7 +202646,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+36372) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -202172,7 +202657,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+36381) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -202186,7 +202671,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+36391) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -202197,7 +202682,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+36401) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -202214,7 +202699,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+36413) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -202229,7 +202714,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+35981) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -202244,7 +202729,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+36425) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -202260,7 +202745,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+36439) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -202303,7 +202788,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 + 36449 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -202323,7 +202808,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+36481) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -202334,7 +202819,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+36489, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -202438,11 +202923,12 @@ type TFts5ExprNode1 = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode1 = TFts5ExprNode1 +/* Size (in bytes) of an Fts5ExprNode object that holds up to N children */ + /* ** 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. @@ -202472,24 +202958,26 @@ type TFts5ExprPhrase1 = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase1 = TFts5ExprPhrase1 +/* Size (in bytes) of an Fts5ExprPhrase object that holds up to N terms */ + /* ** 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 + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset1 = TFts5ExprNearset1 +/* Size (in bytes) of an Fts5ExprNearset object covering up to N phrases */ + /* ** Parse context. */ @@ -202580,7 +203068,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+36560, 0) return FTS5_EOF } goto _1 @@ -202591,7 +203079,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+36580, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -202606,13 +203094,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+36611, 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+36614, 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+31023, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -202656,7 +203144,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) @@ -204295,7 +204783,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) @@ -204305,7 +204793,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) @@ -204411,12 +204899,12 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(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 @@ -204550,7 +205038,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) @@ -204590,15 +205078,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)) @@ -204639,7 +205127,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 { @@ -204677,8 +205165,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+36618, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35131, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204698,10 +205186,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+36623, 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: ; @@ -204735,7 +205226,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(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 { @@ -204785,7 +205276,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 @@ -204836,7 +205327,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+21309, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204863,7 +205354,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)) @@ -204960,7 +205451,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+36652, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -205045,7 +205536,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) @@ -205058,7 +205549,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) @@ -205132,7 +205623,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 @@ -205158,11 +205649,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 + 36705 } else { - v2 = __ccgo_ts + 36511 + v2 = __ccgo_ts + 36618 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36605, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36712, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -205175,7 +205666,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+36762, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -205652,7 +206143,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) { @@ -205716,7 +206207,7 @@ 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 +** to accumulate "term -> doclist" content before it is flushed to a level-0 ** segment. */ @@ -205775,7 +206266,7 @@ type TFts5HashEntry1 = struct { type Fts5HashEntry1 = TFts5HashEntry1 /* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -206657,9 +207148,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 @@ -206696,7 +207187,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206769,7 +207259,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206804,7 +207293,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206819,9 +207307,9 @@ 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 @@ -206918,11 +207406,12 @@ type TFts5Structure1 = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure1 = TFts5Structure1 +/* Size (in bytes) of an Fts5Structure object holding up to N levels */ + /* ** An object of type Fts5SegWriter is used to write to segments. */ @@ -207055,13 +207544,15 @@ type Fts5SegIter1 = TFts5SegIter1 ** Array of tombstone pages. Reference counted. */ type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray1 = TFts5TombstoneArray1 +/* Size (in bytes) of an Fts5TombstoneArray holding up to N tombstones */ + /* ** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. @@ -207114,11 +207605,12 @@ type TFts5Iter1 = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter1 = TFts5Iter1 +/* Size (in bytes) of an Fts5Iter object holding up to N segment iterators */ + /* ** An instance of the following type is used to iterate through the contents ** of a doclist-index record. @@ -207144,13 +207636,15 @@ type TFts5DlidxLvl1 = struct { type Fts5DlidxLvl1 = TFts5DlidxLvl1 type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } 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)) *(*Tu8)(unsafe.Pointer(aOut + 1)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) & libc.Int32FromInt32(0xFF)) @@ -207329,7 +207823,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+36815, 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. @@ -207434,7 +207928,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+36821, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -207463,7 +207957,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+36872, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -207497,7 +207991,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+36921, 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) @@ -207575,7 +208069,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)) @@ -207666,7 +208160,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+36961, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207677,7 +208171,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+36961, 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)) @@ -208358,7 +208852,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) @@ -208608,7 +209102,7 @@ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _ = nByte, nTomb, pNew nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(nTomb+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) if pNew != 0 { (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb @@ -209318,7 +209812,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+36989, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -209407,7 +209901,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+37073, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -210054,7 +210548,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 @@ -211378,7 +211872,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+37155, 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. */ @@ -211884,7 +212378,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+37212, 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) @@ -212053,7 +212547,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 } @@ -212371,7 +212865,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+37273, 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))) @@ -212646,7 +213140,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: @@ -212681,7 +213175,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint ; i++ } - nByte = Tsqlite3_int64(uint64(nByte) + uint64(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)) @@ -213295,11 +213789,12 @@ type TFts5TokenDataIter1 = struct { 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 // // /* @@ -213367,7 +213862,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) { @@ -213611,7 +214106,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) @@ -213661,7 +214156,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 @@ -213743,15 +214238,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) } @@ -213777,11 +214275,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+37324, 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+26058, __ccgo_ts+37332, 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+12009, __ccgo_ts+37367, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -213979,7 +214477,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) @@ -214234,7 +214732,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+37411) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -214585,7 +215083,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') @@ -214707,7 +215205,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 { @@ -214827,7 +215325,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+36815, 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))) @@ -215421,7 +215919,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+37413, 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)) @@ -215652,7 +216150,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+37499) 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)) @@ -215791,7 +216289,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215948,11 +216445,12 @@ type TFts5Sorter1 = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter1 = TFts5Sorter1 +/* Size (int bytes) of an Fts5Sorter object with N indexes */ + /* ** Virtual-table cursor object. ** @@ -216274,7 +216772,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+37504, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -216311,7 +216809,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++ @@ -216330,7 +216828,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 @@ -216780,7 +217278,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 @@ -216808,7 +217306,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) } @@ -216828,7 +217326,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) @@ -216843,7 +217341,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 + 15174 } else { v1 = __ccgo_ts + 1667 } @@ -216853,11 +217351,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 + 37543 } else { - v3 = __ccgo_ts + 37441 + v3 = __ccgo_ts + 37548 } - 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+37552, 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 @@ -216915,14 +217413,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+37607, 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+37613, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216972,7 +217470,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+37641, 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)) @@ -217005,7 +217503,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+37651, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -217039,7 +217537,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+37672, libc.VaList(bp+24, z)) } } } else { @@ -217047,7 +217545,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 + 35399 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -217204,7 +217702,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+37705, 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))) } @@ -217404,7 +217902,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+37710, 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 @@ -217537,10 +218035,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. @@ -220076,12 +220574,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+39059, 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+39163, 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+39201, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -220090,7 +220588,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+39239, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -220102,14 +220600,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+26058, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12009, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38393, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36192, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36299, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35497, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35604, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -220129,13 +220627,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 + 30698 } 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+39281, 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+39311, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -220176,7 +220674,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+39355, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -220184,7 +220682,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+39378, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -220199,7 +220697,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+39384, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -220208,22 +220706,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+35604, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39283 + zCols = __ccgo_ts + 39390 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39315 + zCols = __ccgo_ts + 39422 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36192, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36299, 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+38393, __ccgo_ts+39470, 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+36481, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -220643,12 +221141,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+39487, 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+39537, 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+39566, 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. */ @@ -220656,7 +221154,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+36481, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220958,7 +221456,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+39595, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -221190,14 +221688,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+35604, 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)) @@ -222402,64 +222900,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+39697, 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+39700, 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+39705, 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+39710, 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+39713, 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+39716, 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+39721, 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+39726, 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+39730, 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+39736, 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+39741, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222468,49 +222966,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+39745, 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+39749, 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+39752, 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+39756, 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+39760, 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+39764, 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+39768, 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+39772, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222527,20 +223025,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+39776, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39756, 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+39779, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39782, 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+39786, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39772, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -222556,75 +223054,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+39789, 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+39756, 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+39797, 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+39804, 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+39809, 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+39705, 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+39814, 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+39700, 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+39819, 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+39772, 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+39824, 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+16124, 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+39829, 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+39782, 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+39833, 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+39697, 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+39838, 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+39741, 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+39844, 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+39848, 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+39850, 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+39764, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -222633,48 +223131,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+39856, 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+39772, 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+39864, 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+39756, 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+39870, 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+39756, 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+39875, 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+39697, 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+39881, 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+39768, 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+39889, 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+39897, 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+39901, 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+39764, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222682,21 +223180,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+39909, 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+39697, 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+39915, 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+39768, 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+39921, 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+39782, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222714,48 +223212,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+39928, 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+39713, 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+39933, 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+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+39606, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39713, 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+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+39606, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39713, 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+39897, 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+39950, 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+39956, 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+39697, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222771,13 +223269,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+39962, 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+39966, 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+39969, 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) @@ -222785,7 +223283,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+39972, 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) @@ -222950,14 +223448,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+39976) { 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+39669) { 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 { @@ -223225,7 +223723,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+39991)) } // C documentation @@ -223251,7 +223749,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39580, + FzName: __ccgo_ts + 39687, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -223259,7 +223757,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39892, + FzName: __ccgo_ts + 39999, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -223267,7 +223765,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39884, + FzName: __ccgo_ts + 39991, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -223297,7 +223795,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+40005, pApi, bp+96, uintptr(0)) } return rc } @@ -228813,16 +229311,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+40012) == 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+40016) == 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+40020) == 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+40029, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228885,21 +229383,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 + 40063, + 1: __ccgo_ts + 40103, + 2: __ccgo_ts + 40138, } 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+24051, *(*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+40181, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228920,23 +229419,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) } @@ -229069,10 +229568,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+40214, 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+40245, 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)) } @@ -229091,7 +229590,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+40296, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -229541,7 +230040,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+40322, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -229596,7 +230095,7 @@ 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 + 40332 } type TAggInfo_col = struct { @@ -229826,7 +230325,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 @@ -229874,11 +230373,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]int8{'3', '.', '4', '9', '.', '1'} +var Xsqlite3_version = [7]int8{'3', '.', '5', '0', '.', '1'} 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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods @@ -229888,3 +230387,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_arm.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_arm.go index 5f402e0..04136f7 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_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 @@ -1558,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 @@ -1797,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 @@ -2007,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 @@ -2169,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 @@ -2177,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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70" +const SQLITE_SOURCE_ID = "2025-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2288,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.1" -const SQLITE_VERSION_NUMBER = 3049001 +const SQLITE_VERSION = "3.50.1" +const SQLITE_VERSION_NUMBER = 3050001 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3517,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 @@ -3526,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 @@ -4433,6 +4439,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. @@ -4789,6 +4801,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 @@ -5222,7 +5235,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -6974,11 +6986,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. */ /* @@ -7352,6 +7370,7 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem @@ -7397,6 +7416,7 @@ type THashElem1 = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem1 = THashElem1 @@ -7550,6 +7570,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. */ @@ -7608,6 +7633,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 @@ -7911,7 +7947,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData = TDbClientData @@ -7984,7 +8019,6 @@ type Expr = TExpr type TExprList = struct { FnExpr int32 FnAlloc int32 - Fa [1]TExprList_item } type ExprList = TExprList @@ -7999,7 +8033,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -8049,7 +8082,6 @@ type FuncDefHash = TFuncDefHash type TIdList = struct { FnId int32 - Fa [1]TIdList_item } type IdList = TIdList @@ -8115,7 +8147,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -8187,19 +8218,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 @@ -8213,11 +8247,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 @@ -8228,39 +8259,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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -8274,23 +8307,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 @@ -8449,7 +8485,6 @@ type TSrcList = struct { F__ccgo_align [0]uint32 FnSrc int32 FnAlloc Tu32 - Fa [1]TSrcItem } type SrcList = TSrcList @@ -8504,6 +8539,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8690,7 +8726,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8732,7 +8767,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -9320,8 +9354,8 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. +/* Use SQLITE_ENABLE_EXPLAIN_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 @@ -10180,6 +10214,7 @@ type TTable1 = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table1 = TTable1 @@ -10261,11 +10296,13 @@ type TFKey1 = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey1 = TFKey1 +/* The size (in bytes) of an FKey object holding N columns. The answer +** does NOT include space to hold the zTo name. */ + /* ** SQLite supports many different ways to resolve a constraint ** error. ROLLBACK processing means that a constraint violation @@ -10314,11 +10351,12 @@ type TKeyInfo1 = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo1 = TKeyInfo1 +/* The size (in bytes) of a KeyInfo object with up to N fields */ + /* ** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. */ @@ -10729,11 +10767,13 @@ type Expr1 = TExpr1 type TExprList1 = struct { FnExpr int32 FnAlloc int32 - Fa [1]TExprList_item } type ExprList1 = TExprList1 +/* The size (in bytes) of an ExprList object that is big enough to hold +** as many as N expressions. */ + /* ** Allowed values for Expr.a.eEName */ @@ -10755,11 +10795,12 @@ type ExprList1 = TExprList1 */ type TIdList1 = struct { FnId int32 - Fa [1]TIdList_item } type IdList1 = TIdList1 +/* The size (in bytes) of an IdList object that can hold up to N IDs. */ + /* ** Allowed values for IdList.eType, which determines which value of the a.u4 ** is valid. @@ -10869,11 +10910,16 @@ type TSrcList1 = struct { F__ccgo_align [0]uint32 FnSrc int32 FnAlloc Tu32 - Fa [1]TSrcItem } type SrcList1 = TSrcList1 +/* Size (in bytes) of a SrcList object that can hold as many as N +** SrcItem objects. */ + +/* Size (in bytes( of a SrcList object that holds 1 SrcItem. This is a +** special case of SZ_SRCITEM(1) that comes up often. */ + /* ** Permitted values of the SrcList.a.jointype field */ @@ -11234,19 +11280,22 @@ type TParse1 = 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 @@ -11260,11 +11309,8 @@ type TParse1 = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -11275,39 +11321,41 @@ type TParse1 = 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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -11676,11 +11724,13 @@ type TWith1 = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With1 = TWith1 +/* The size (in bytes) of a With object that can hold as many +** as N different CTEs. */ + /* ** The Cte object is not guaranteed to persist for the entire duration ** of code generation. (The query flattener or other parser tree @@ -11710,11 +11760,13 @@ type TDbClientData1 = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData1 = TDbClientData1 +/* The size (in bytes) of a DbClientData object that can has a name +** that is N bytes long, including the zero-terminator. */ + /* ** This object is used in various ways, most (but not all) related to window ** functions. @@ -12863,27 +12915,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 @@ -12965,7 +13016,7 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 + F__ccgo_pad29 [4]byte } type VdbeCursor = TVdbeCursor @@ -13004,11 +13055,17 @@ type TVdbeCursor1 = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 + F__ccgo_pad29 [4]byte } type VdbeCursor1 = TVdbeCursor1 +/* +** The size (in bytes) of a VdbeCursor object that has an nField value of N +** or less. The value of SZ_VDBECURSOR(n) is guaranteed to be a multiple +** of 8. + */ + /* Return true if P is a null-only cursor */ @@ -13228,21 +13285,14 @@ type Tsqlite3_context1 = struct { 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 */ +/* +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. + */ // C documentation // @@ -13374,23 +13424,26 @@ type Vdbe1 = TVdbe1 ** 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 + 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 PreUpdate1 = TPreUpdate1 @@ -13528,7 +13581,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(24453)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13700,7 +13753,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)) @@ -14094,7 +14147,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++ } @@ -14165,10 +14218,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) @@ -14304,7 +14357,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) } } @@ -14401,7 +14454,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) @@ -14556,7 +14609,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) @@ -14634,7 +14687,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) @@ -14782,7 +14835,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)) @@ -15085,7 +15138,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 } @@ -15242,7 +15295,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('.') @@ -15290,7 +15343,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('.') @@ -15395,7 +15448,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) @@ -16124,7 +16177,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 } @@ -16773,7 +16826,8 @@ func init() { // /* // ** Initialize the mutex system. // */ -func _sqlite3MutexInit(tls *libc.TLS) (r int32) { +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 @@ -18402,17 +18456,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'), @@ -18609,22 +18663,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. */ @@ -18873,11 +18928,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 @@ -19354,29 +19409,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) @@ -19491,25 +19524,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 + 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 = 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. @@ -19517,15 +19554,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) { @@ -19536,13 +19573,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) @@ -19556,35 +19626,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 - } - 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 + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + 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++ + } + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 + j1++ + 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) @@ -19609,9 +19742,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: ; @@ -19625,7 +19758,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+1680, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1706, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -19635,21 +19768,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+1682, 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+1692, 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+1713, 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: ; @@ -19888,7 +20021,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 @@ -20187,6 +20320,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 // // /* @@ -20204,11 +20339,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)) } @@ -20860,6 +20995,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 // // /* @@ -21610,7 +21776,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 { @@ -21785,7 +21951,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+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 @@ -21997,11 +22163,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 @@ -22237,7 +22403,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)) @@ -22327,7 +22493,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)) { @@ -22554,7 +22720,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+1771)) + n = libc.Int32FromUint32(libc.Uint32FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1797)) if *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -22714,7 +22880,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 + 1787 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1813 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') @@ -22823,7 +22989,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-- } } @@ -23239,7 +23405,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 @@ -23268,7 +23434,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 { @@ -23282,7 +23448,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) @@ -23313,7 +23479,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) { @@ -23664,23 +23830,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 @@ -23735,8 +23899,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) } @@ -23769,9 +23933,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: ; @@ -23791,13 +23954,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 } @@ -23805,7 +23967,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 @@ -23821,7 +23983,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 { @@ -23833,7 +23995,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 } @@ -23882,7 +24044,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 @@ -23892,20 +24054,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) } @@ -23924,196 +24085,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 = int32 @@ -24678,91 +24839,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, - }, - 14: { - FzName: __ccgo_ts + 3555, - }, - 15: { - FzName: __ccgo_ts + 3562, - }, - 16: { FzName: __ccgo_ts + 3572, }, + 14: { + FzName: __ccgo_ts + 3581, + }, + 15: { + FzName: __ccgo_ts + 3588, + }, + 16: { + FzName: __ccgo_ts + 3598, + }, 17: { - FzName: __ccgo_ts + 3579, - }, - 18: { - FzName: __ccgo_ts + 3593, - }, - 19: { - FzName: __ccgo_ts + 3599, - }, - 20: { FzName: __ccgo_ts + 3605, }, - 21: { - FzName: __ccgo_ts + 3612, + 18: { + FzName: __ccgo_ts + 3619, }, - 22: { - FzName: __ccgo_ts + 3620, - }, - 23: { + 19: { FzName: __ccgo_ts + 3625, }, - 24: { - FzName: __ccgo_ts + 3632, + 20: { + FzName: __ccgo_ts + 3631, }, - 25: { - FzName: __ccgo_ts + 3639, + 21: { + FzName: __ccgo_ts + 3638, }, - 26: { + 22: { + FzName: __ccgo_ts + 3646, + }, + 23: { FzName: __ccgo_ts + 3651, }, + 24: { + FzName: __ccgo_ts + 3658, + }, + 25: { + FzName: __ccgo_ts + 3665, + }, + 26: { + FzName: __ccgo_ts + 3677, + }, 27: { - FzName: __ccgo_ts + 3660, + FzName: __ccgo_ts + 3686, }, 28: { - FzName: __ccgo_ts + 3666, + FzName: __ccgo_ts + 3692, }, } @@ -25001,9 +25162,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+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+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 } } @@ -25326,7 +25487,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 } @@ -25354,7 +25515,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+3809, 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+3836, 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 } } @@ -26013,7 +26174,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(40995)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -26618,7 +26779,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+3864, 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('/')) { @@ -26644,7 +26805,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(42576)), __ccgo_ts+3605, bp, int32(42576)) } // C documentation @@ -26681,7 +26842,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)<= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43393)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -27292,7 +27453,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)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44803)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -28293,10 +28453,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 @@ -28305,8 +28465,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 @@ -28368,7 +28528,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+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 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { v1 = iLimit iLimit++ @@ -28540,7 +28700,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) } @@ -28695,7 +28855,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(45251)), __ccgo_ts+3488, zName, int32(45251)) if rc == SQLITE_OK { rc = rc2 } @@ -28772,7 +28932,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(45502)) 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+3651, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45507)), __ccgo_ts+3677, zIn, int32(45507)) return } (*(*[4098]uint8)(unsafe.Pointer(bp + 152)))[got] = uint8(0) @@ -28970,14 +29130,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+3480, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45565)), __ccgo_ts+3506, zPath, int32(45565)) } _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(45571)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<>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) } } @@ -32300,7 +32460,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) - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, 0) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -32394,7 +32554,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-- - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, 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)) } @@ -32435,7 +32595,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, 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 @@ -32563,7 +32723,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 libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g)) + 96) + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -32583,17 +32743,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) } @@ -32611,7 +32773,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 @@ -32623,7 +32785,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) } } @@ -32824,10 +32986,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 @@ -34982,7 +35145,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 @@ -35000,7 +35163,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 } @@ -35573,6 +35736,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 { @@ -36219,7 +36391,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 @@ -36231,7 +36404,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) @@ -36252,11 +36425,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 @@ -36285,7 +36459,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 @@ -36518,7 +36692,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) } @@ -36655,7 +36829,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)) @@ -36671,7 +36845,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)< int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65269)) } 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)) @@ -40778,7 +40952,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 { @@ -41344,7 +41518,6 @@ type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { FiPrior Tu32 FnSegment int32 - FaSegment [1]TWalSegment } type WalIterator = TWalIterator @@ -41548,6 +41721,11 @@ type WalCkptInfo1 = TWalCkptInfo1 /* ** An open write-ahead log file is represented by an instance of the ** following object. +** +** writeLock: +** This is usually set to 1 whenever the WRITER lock is held. However, +** if it is set to 2, then the WRITER lock is held but must be released +** by walHandleException() if a SEH exception is thrown. */ type TWal1 = struct { F__ccgo_align [0]uint32 @@ -41618,11 +41796,12 @@ type ht_slot = Tht_slot 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 ** is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -41680,7 +41859,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) @@ -41781,6 +41960,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 @@ -42222,7 +42402,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(67209)) } goto _1 _1: @@ -42310,7 +42490,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(67341)) goto finished } /* Malloc a buffer to read frames into. */ @@ -42449,7 +42629,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 { @@ -43080,7 +43260,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(68150)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -43196,7 +43376,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)) } } @@ -43411,7 +43591,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 { @@ -43437,7 +43624,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(68601)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -44160,8 +44347,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)) } @@ -44248,7 +44435,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(69451)) } iKey = _walNextHash(tls, iKey) } @@ -44746,7 +44933,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(69974)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44995,7 +45182,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, /* 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(70234)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -45771,6 +45958,11 @@ type CellInfo1 = TCellInfo1 ** assumed that the database is corrupt. */ +/* +** Maximum amount of storage local to a database page, regardless of +** page size. + */ + /* ** A cursor is a pointer to a particular entry within a particular ** b-tree within a database file. @@ -46142,10 +46334,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) { @@ -46154,14 +46347,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) { @@ -46861,7 +47054,7 @@ 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(72422)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } @@ -47039,7 +47232,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(72620)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -47052,12 +47245,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(72633)) 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(72638)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -47101,7 +47294,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(72683)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -47109,7 +47302,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(72691)) } return SQLITE_OK } @@ -47297,7 +47490,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) } @@ -47330,7 +47523,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) } @@ -47529,7 +47722,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(73136)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -47569,12 +47762,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(73194)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73197)) } 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)) @@ -47582,21 +47775,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(73205)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73208)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73210)) } 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(73214)) } } cbrk = top + sz @@ -47643,12 +47836,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(73247)) } 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(73253)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -47664,7 +47857,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(73267)) } *(*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) @@ -47724,7 +47917,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(73324)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -47741,14 +47934,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(73339)) } 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(73346)) } return uintptr(0) } @@ -47791,11 +47984,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(73394)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73397)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -47809,7 +48002,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(73414)) } else { return SQLITE_OK } @@ -47862,42 +48055,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(73498)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47905,70 +48096,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(73510)) } - 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(73513)) } - 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(73526)) } - 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(73532)) } 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) + *(*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)) += libc.Int32FromUint16(iOrigSize) + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -48014,7 +48205,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(73602)) } } } else { @@ -48040,7 +48231,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(73626)) } } } @@ -48079,12 +48270,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(73677)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73682)) } 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(73692)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73696)) } } /* At this point, nFree contains the sum of the offset to the start @@ -48111,7 +48302,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(73708)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -48142,11 +48333,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(73739)) } 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(73744)) } goto _1 _1: @@ -48175,11 +48366,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(73776)) } (*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) @@ -48188,7 +48379,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(73790)) } /* 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 @@ -48210,30 +48401,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) @@ -48341,7 +48530,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(73933)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -48403,7 +48592,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(74005)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -48491,7 +48680,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 */ @@ -49115,7 +49304,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) @@ -49277,7 +49466,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, 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 @@ -49315,7 +49504,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(74943)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 4)) @@ -49756,7 +49945,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(75398)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -49780,7 +49969,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(75417)) } 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) @@ -49789,7 +49978,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(75426)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -49803,7 +49992,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(75438)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -49833,7 +50022,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(75473)) } /* 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) @@ -49929,7 +50118,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(75571)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49967,7 +50156,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(75623)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 20)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 16)), bCommit) @@ -50034,7 +50223,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(75691)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -50077,7 +50266,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(75742)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -50107,7 +50296,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(75769)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -50573,7 +50762,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(76233)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50965,7 +51154,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(76657)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50975,7 +51164,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(76672)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -51032,7 +51221,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(76743)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -51106,7 +51295,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(76827)) } return rc } @@ -51241,7 +51430,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(76965)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -51253,7 +51442,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(76979)) } if rc != 0 { v3 = pCur + 68 @@ -51369,7 +51558,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(77114)) } goto skip_init skip_init: @@ -51383,7 +51572,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(77126)) } 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) @@ -51617,7 +51806,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(77375)) } } } @@ -51821,7 +52010,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes p3 = pCur + 1 *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(BTCF_ValidOvfl) | libc.Int32FromInt32(BTCF_AtLast))) if !((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76795)) + return _sqlite3CorruptError(tls, int32(77571)) } goto bypass_moveto_root /* Start search on the current page */ } @@ -51884,10 +52073,10 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ if nCell < int32(2) || libc.Uint32FromInt32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77658)) 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 @@ -51915,7 +52104,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(77690)) } goto moveto_index_finish } @@ -51948,7 +52137,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(77721)) } *(*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 @@ -51957,7 +52146,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(77732)) } if rc != 0 { v11 = pCur + 68 @@ -52086,7 +52275,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(77833)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -52196,7 +52385,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(77926)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -52284,7 +52473,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(78016)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -52339,7 +52528,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(78072)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -52365,7 +52554,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(78101)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52392,7 +52581,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(78135)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+8, 0) @@ -52463,7 +52652,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(78200)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52601,7 +52790,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(78327)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 4)) = pMemPage @@ -52652,7 +52841,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(78374)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 8)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -52661,7 +52850,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(78385)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -52751,7 +52940,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(78474)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -52769,7 +52958,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(78491)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+4, bp) @@ -52792,7 +52981,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(78511)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 4)), ovflPgno) } @@ -53013,10 +53202,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(78767)) 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 @@ -53407,12 +53596,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(79157)) } 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(79162)) } } pData -= uintptr(sz) @@ -53420,7 +53609,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(79168)) } libc.Xmemmove(tls, pData, pCell, uint32(sz)) i++ @@ -53515,7 +53704,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(79255)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4)), libc.Uint32FromInt32(sz)) @@ -53596,7 +53785,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: ; @@ -53623,7 +53812,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: ; @@ -53663,7 +53852,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(79377)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint32FromInt32(nCell*int32(2))) nCell -= nShift @@ -53734,7 +53923,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(79455)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -53779,7 +53968,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(79495)) } /* 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 @@ -53975,10 +54164,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 @@ -54101,8 +54291,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 @@ -54142,7 +54332,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(79919)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -54165,7 +54355,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(79943)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -54296,7 +54486,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(80044)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 36)))[k-int32(1)] = 0 @@ -54339,7 +54529,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(80077)) goto balance_cleanup } } @@ -54398,7 +54588,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(80121)) goto balance_cleanup } goto _11 @@ -54430,7 +54620,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(80154)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -54660,7 +54850,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(80355)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54906,7 +55096,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(80587)) } goto _1 _1: @@ -54979,7 +55169,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(80647)) } 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))) @@ -55138,7 +55328,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(80811)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -55169,7 +55359,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(80839)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -55254,7 +55444,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(80920)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -55346,7 +55536,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(81043)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -55382,7 +55572,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(81085)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55412,10 +55602,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(81112)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81115)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -55533,7 +55723,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(81217)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { @@ -55548,14 +55738,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(81242)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -55655,21 +55845,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(81338)) } } 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(81347)) } 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(81351)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81354)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -55763,7 +55953,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(81445)) } 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 @@ -55873,7 +56063,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(81561)) } *(*TPgno)(unsafe.Pointer(bp + 4))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55914,7 +56104,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(81609)) } if *(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55995,14 +56185,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(81699)) } *(*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(81706)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -56139,7 +56329,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(81810)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -56404,7 +56594,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+4272, 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)) @@ -56452,11 +56642,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) @@ -56482,11 +56672,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 @@ -56558,11 +56748,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)) } } @@ -56698,12 +56888,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+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+4690, 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+4720, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4746, 0) doCoverageCheck = 0 goto _4 } @@ -56788,7 +56978,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+4744, 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 */ @@ -56811,7 +57001,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 { @@ -56888,7 +57078,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+4793, 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))) @@ -56902,7 +57092,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+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 @@ -56993,7 +57183,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) } @@ -57017,11 +57207,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+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+4938, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+4964, 0) } } } @@ -57058,10 +57248,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+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+5013, libc.VaList(bp+208, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5039, libc.VaList(bp+208, i)) } goto _3 _3: @@ -57500,7 +57690,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+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) @@ -57510,7 +57700,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+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 @@ -57539,7 +57729,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 @@ -57569,7 +57759,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... @@ -58247,7 +58437,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+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) } @@ -58385,9 +58575,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) @@ -58563,7 +58750,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 @@ -58593,7 +58780,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 @@ -59347,7 +59534,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(85108)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -59511,7 +59698,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 { @@ -59519,8 +59707,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 { @@ -59584,7 +59772,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 */ @@ -59623,14 +59811,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+3864, 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)) @@ -59730,7 +59918,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 } } } @@ -59745,7 +59933,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 } @@ -60049,7 +60237,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(85794)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -60065,7 +60253,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(85800)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -60075,7 +60263,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(85806)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -60536,12 +60724,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 @@ -60715,7 +60902,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 @@ -60800,8 +60987,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. @@ -60814,11 +61001,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 */ @@ -60855,13 +61042,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 @@ -60892,7 +61082,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 @@ -61394,7 +61584,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+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)) { @@ -61407,39 +61597,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+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+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+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+5200, 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+5200, 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+1428, libc.VaList(bp+32, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5207, 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+1395, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): @@ -61456,14 +61646,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+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 @@ -61478,20 +61668,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+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+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+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)) } @@ -61505,10 +61695,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 @@ -62461,7 +62651,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) } @@ -62469,18 +62659,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+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+8) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5297, 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) @@ -62711,7 +62901,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(90646))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -64099,7 +64289,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(90727))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 20 + uintptr(i)*4)) != 0 { @@ -64134,7 +64324,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(90757))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -64188,7 +64378,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(90808))) return 0 /* Corrupt index */ } } @@ -64320,7 +64510,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(90971))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -64472,7 +64662,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(91129)) } // C documentation @@ -64503,7 +64693,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(91162)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -64654,15 +64844,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 + 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 @@ -64731,8 +64921,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 @@ -64740,7 +64930,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 @@ -64757,10 +64947,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 @@ -64769,9 +64960,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 { @@ -64851,7 +65042,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 @@ -64861,7 +65052,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) @@ -64919,7 +65110,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(91560)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -65422,7 +65613,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 @@ -65623,7 +65814,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(92354)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -65753,7 +65944,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(92475)) } 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) @@ -66213,18 +66404,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'), @@ -66479,14 +66670,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(93091)) } 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(93095))) 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(93099)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -66637,7 +66828,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, 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) } @@ -67060,11 +67251,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(93642)) 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))) } @@ -67073,7 +67264,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) @@ -67087,7 +67278,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) } @@ -67122,7 +67313,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(93701)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*4)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -67157,7 +67348,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 } @@ -67223,11 +67414,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(93797)) 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))) } @@ -67250,7 +67441,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 @@ -67399,7 +67590,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(zRawSql)-int32(zStart)) } } else { @@ -67437,7 +67628,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr 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+5136, 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 @@ -67452,28 +67643,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+5635, 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+5642, 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+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+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+5663, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5689, int32(1)) } } } @@ -67637,9 +67828,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 { @@ -67665,12 +67856,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) @@ -67679,28 +67868,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 @@ -68091,12 +68280,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 @@ -68113,7 +68302,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 @@ -68845,19 +69034,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+3864, 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+5699, 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+5720, 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+3864, 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+5727, 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) { @@ -70071,7 +70260,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 @@ -70087,6 +70276,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 */ @@ -70580,7 +70775,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(97561)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -70683,7 +70878,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+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+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, @@ -71279,7 +71474,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 { @@ -71309,12 +71504,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 } @@ -71406,7 +71601,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. @@ -72517,7 +72712,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(99822)) } else { goto jump_to_p2 } @@ -72976,7 +73171,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(). @@ -73409,7 +73604,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(101119)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+464, db, uint16(0)) @@ -73739,7 +73934,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+3864, 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 @@ -73770,13 +73965,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 + 6151 + 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+6165, 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 { @@ -73791,7 +73986,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(101412)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -74028,7 +74223,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+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 @@ -74045,15 +74240,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 @@ -74134,11 +74329,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) } @@ -74350,7 +74545,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 @@ -74400,7 +74595,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+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 { @@ -74456,7 +74651,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+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)) @@ -74535,11 +74730,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+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) { @@ -74692,7 +74887,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+736, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6333, libc.VaList(bp+736, z1)) } goto abort_due_to_error } @@ -74854,7 +75049,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+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' @@ -74934,12 +75129,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)) @@ -74950,7 +75145,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+3864, 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)) @@ -75204,7 +75399,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+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) @@ -75355,7 +75550,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+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 { @@ -75442,15 +75637,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) @@ -75916,11 +76103,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+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) @@ -76006,7 +76193,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103962)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -76105,7 +76292,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(104062)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -76119,7 +76306,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) } @@ -76568,31 +76755,32 @@ type SortSubtask1 = TSortSubtask1 ** largest record in the sorter. */ type TVdbeSorter1 = 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 VdbeSorter1 = TVdbeSorter1 +/* Size (in bytes) of a VdbeSorter object that works with N or fewer subtasks */ + /* ** An instance of the following object is used to read records out of a ** PMA, in sorted order. The next key to be read is cached in nKey/aKey. @@ -77206,8 +77394,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 @@ -77221,9 +77409,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) @@ -77421,18 +77609,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 { @@ -77720,6 +77909,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: @@ -80273,25 +80465,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) } } @@ -80330,23 +80522,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 */ @@ -80378,7 +80569,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 @@ -80472,7 +80663,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 } } @@ -80494,57 +80685,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 @@ -80589,11 +80767,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 } @@ -80602,36 +80780,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+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 += 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++ @@ -80660,18 +80827,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 } } } @@ -80718,15 +80885,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+6739, 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+6770, 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+6807, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -80737,8 +80904,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -80778,7 +80945,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+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) @@ -80798,7 +80965,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) @@ -80807,7 +80974,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 + 20)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -80817,26 +80984,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+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+6919, 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+6929, libc.VaList(bp+16, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6954, libc.VaList(bp+16, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6990, 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) } @@ -80885,8 +81052,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80960,19 +81127,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) } @@ -80998,7 +81165,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 @@ -81144,7 +81311,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) { @@ -81199,7 +81366,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+7116, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7141, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -81223,7 +81390,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) @@ -81237,13 +81404,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: ; @@ -81263,16 +81430,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 @@ -81283,35 +81447,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 { @@ -81396,7 +81563,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 + 20))) } @@ -81408,7 +81575,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 @@ -81454,7 +81621,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 @@ -81579,7 +81746,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) } @@ -81614,7 +81781,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+7524, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7549, 0) return int32(1) } i = 0 @@ -81652,7 +81819,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 { @@ -81722,7 +81889,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+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 @@ -81756,7 +81923,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+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 @@ -82069,7 +82236,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 { @@ -82136,7 +82303,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 { @@ -82147,7 +82314,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 @@ -82157,7 +82324,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 @@ -82259,12 +82426,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) @@ -82307,12 +82474,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)) @@ -82379,33 +82546,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 } @@ -82457,7 +82626,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) { @@ -82665,7 +82834,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 } @@ -83140,7 +83309,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) { @@ -83219,7 +83388,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+7760, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7785, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -83564,11 +83733,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 + 20)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -83617,7 +83786,7 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt 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)) { _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) } @@ -83645,7 +83814,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+7854, 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)) @@ -83665,7 +83834,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 @@ -83736,7 +83905,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)) } } } @@ -83774,7 +83943,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 @@ -83788,7 +83957,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+7958, 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 } @@ -83808,7 +83977,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 @@ -83821,7 +83990,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+8001, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8026, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -84204,7 +84373,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 @@ -84344,7 +84513,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: @@ -84365,27 +84533,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) { @@ -84431,9 +84592,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++ } @@ -84443,8 +84604,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++ } @@ -84458,7 +84619,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) } @@ -84509,7 +84670,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 @@ -84590,7 +84751,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) @@ -84608,7 +84769,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) @@ -84689,7 +84850,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 @@ -84818,7 +84979,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+8054, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8079, libc.VaList(bp+8, zObject)) } } @@ -84916,10 +85077,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) @@ -85597,13 +85758,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+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 @@ -85618,32 +85779,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.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 @@ -85852,7 +86000,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 @@ -85905,7 +86053,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) @@ -86005,12 +86153,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 = 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) @@ -86602,7 +86751,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 @@ -86698,7 +86847,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 @@ -86733,9 +86882,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) { @@ -86868,7 +87017,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) } } @@ -86998,13 +87147,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)<= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8414, 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) } @@ -87796,7 +87945,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)) @@ -87811,7 +87960,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+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) { @@ -87840,7 +87989,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) } @@ -87916,7 +88065,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8024, 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): @@ -87979,7 +88128,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 @@ -87989,7 +88138,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) { @@ -88010,9 +88159,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 /* @@ -88094,7 +88243,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 libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -88165,17 +88314,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 { @@ -88184,7 +88333,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 @@ -88215,7 +88364,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 { @@ -88285,7 +88434,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) @@ -88329,7 +88478,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 @@ -88596,7 +88745,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: @@ -88805,7 +88956,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: @@ -89512,7 +89665,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) } @@ -90035,7 +90188,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) 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 + v7 = pParse + 48 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 @@ -90051,7 +90204,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) (*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 + v9 = pParse + 48 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 @@ -90136,7 +90289,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 @@ -90144,7 +90297,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 @@ -90162,7 +90315,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 } } } @@ -90181,11 +90334,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 } @@ -90303,8 +90456,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+8540, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90322,10 +90475,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+32, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8568, 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+8743, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -90341,9 +90494,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+8917, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9039, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9064, 0) } } @@ -90399,7 +90552,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+9215, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -90408,11 +90561,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+9274, 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+9280, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -90442,21 +90595,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+9307, 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+9491, 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+9796, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9812, 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+9870, 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 @@ -90464,7 +90617,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 @@ -90472,7 +90625,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+10135, 0) goto exit_rename_table exit_rename_table: ; @@ -90489,7 +90642,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+10148, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -90529,11 +90682,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+10186, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10193, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10218, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -90549,10 +90702,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+10220) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10245) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10279) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10304) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -90564,13 +90717,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+10357) } _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+10403) } } /* Modify the CREATE TABLE statement. */ @@ -90584,7 +90737,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+10430, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -90612,7 +90765,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+10551, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10576, libc.VaList(bp+16, zTab, zDb)) } } } @@ -90650,12 +90803,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+10929, 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+10963, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -90670,7 +90823,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 } @@ -90679,7 +90832,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+10968, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+10993, 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 } @@ -90740,18 +90893,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 + 11012 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10992 + zType = __ccgo_ts + 11017 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11006 + v1 = __ccgo_ts + 11031 } else { - v1 = __ccgo_ts + 11023 + v1 = __ccgo_ts + 11048 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11041, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11066, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90798,21 +90951,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)*12))).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+11084, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -90828,11 +90969,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+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+11105, 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+11287, 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+10135, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -91186,7 +91327,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 @@ -91308,11 +91449,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 + 11393 + v1 = __ccgo_ts + 11418 } 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+11420, 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) } @@ -91383,30 +91524,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+11443, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118867)) } 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(118888)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -91427,9 +91572,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)) @@ -91445,15 +91589,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+11451, 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)) @@ -91464,16 +91608,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++ @@ -91490,21 +91634,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 + 11393 + v1 = __ccgo_ts + 11418 } 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+11457, 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))) @@ -91530,7 +91674,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: ; @@ -91785,7 +91929,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))) @@ -91826,11 +91970,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 @@ -91840,7 +91984,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 { @@ -91850,7 +91994,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 @@ -91867,13 +92011,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: ; @@ -91884,7 +92028,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: ; @@ -91896,7 +92040,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: ; @@ -91937,8 +92081,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 { @@ -91970,7 +92114,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) @@ -92066,15 +92210,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))) @@ -92088,13 +92232,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)) @@ -92105,16 +92249,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) } @@ -92132,7 +92276,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: @@ -92144,35 +92288,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 @@ -92182,7 +92326,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: @@ -92201,7 +92345,7 @@ 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 { @@ -92215,7 +92359,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt } } _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 } @@ -92264,9 +92408,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))) @@ -92279,18 +92423,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 { @@ -92300,16 +92444,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: ; @@ -92318,19 +92462,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) { @@ -92372,12 +92516,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) @@ -92391,19 +92536,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 } @@ -92470,7 +92615,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(119856)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName) @@ -92487,7 +92632,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+296, int32((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int32(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11462, 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 @@ -92542,23 +92687,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+11084, 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 + 11444 + v1 = __ccgo_ts + 11469 } 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+11481, 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+11509, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -92570,31 +92715,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+11557, 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+11678, 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)) { @@ -92608,7 +92753,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 @@ -92619,8 +92764,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 } @@ -92681,27 +92826,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 + 11696, }, 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 + 11717, }, 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 + 11737, }, 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 + 11756, }, 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 + 11775, }, } @@ -92912,8 +93057,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+11878, 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 { @@ -92923,10 +93073,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+11901, 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+11931, 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) @@ -92958,15 +93108,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11773, - FzCols: __ccgo_ts + 11786, + FzName: __ccgo_ts + 11798, + FzCols: __ccgo_ts + 11811, }, 1: { - FzName: __ccgo_ts + 11799, - FzCols: __ccgo_ts + 11812, + FzName: __ccgo_ts + 11824, + FzCols: __ccgo_ts + 11837, }, 2: { - FzName: __ccgo_ts + 11840, + FzName: __ccgo_ts + 11865, }, } @@ -93192,7 +93342,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) { @@ -93208,12 +93359,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 @@ -93221,7 +93372,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) @@ -93280,7 +93431,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 + 11949, } func init() { @@ -93654,7 +93805,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 + 11959, } func init() { @@ -93704,7 +93855,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+56, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11969, libc.VaList(bp+56, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -93715,7 +93866,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+56, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11974, libc.VaList(bp+56, iVal)) goto _2 _2: ; @@ -93754,7 +93905,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+11955, libc.VaList(bp+56, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+24, __ccgo_ts+11980, libc.VaList(bp+56, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -93772,7 +93923,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 + 11986, } func init() { @@ -93838,7 +93989,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+11995, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -93847,12 +93998,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+11773, uint32(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*80 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11798, 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)) @@ -94054,7 +94205,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: @@ -94085,7 +94236,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+12005, 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)) @@ -94176,7 +94327,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+12005, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -94213,7 +94364,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 @@ -94246,11 +94397,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+11984) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12009) } 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+12013) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -94414,17 +94565,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+11992, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12017, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12003, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12028, 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+12038, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -94436,13 +94587,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) - } } } @@ -94803,11 +94947,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+11824, 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+12050, __ccgo_ts+12119, zDb) } return rc } @@ -94873,10 +95017,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+11773, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11798, (*(*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+16, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12171, libc.VaList(bp+16, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94989,7 +95133,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+6715, 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 @@ -95041,11 +95185,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 + 20)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 16)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4036) + *(*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+12187, db, bp+20, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), __ccgo_ts+12212, 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 { @@ -95076,7 +95220,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+12190, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(db + 120 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12215, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(db + 120 + 7*4)))) goto attach_error } i = 0 @@ -95085,7 +95229,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+12227, libc.VaList(bp+32, zName)) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12252, libc.VaList(bp+32, zName)) goto attach_error } goto _1 @@ -95103,7 +95247,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 } @@ -95141,7 +95285,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+12257, 0) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12282, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -95149,7 +95293,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+12286, 0) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12311, 0) rc = int32(SQLITE_ERROR) } } @@ -95196,7 +95340,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+1637, 0) } else { if *(*uintptr)(unsafe.Pointer(bp + 12)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12354, libc.VaList(bp+32, zFile)) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12379, libc.VaList(bp+32, zFile)) } } } @@ -95258,15 +95402,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+12407, 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+12428, 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+12454, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -95361,7 +95505,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 + 12476, } func init() { @@ -95383,7 +95527,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 + 12490, } func init() { @@ -95409,7 +95553,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+12504, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -95443,7 +95587,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+12503, 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+12528, 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))) @@ -95660,7 +95804,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+12574, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -95688,11 +95832,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+12597, 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+12603, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12584, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12609, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -95752,7 +95896,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 + 8096 + zCol = __ccgo_ts + 8121 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -95787,7 +95931,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+12636, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -95905,7 +96049,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 @@ -96003,7 +96147,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) @@ -96081,7 +96227,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) { @@ -96095,7 +96241,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) } @@ -96161,13 +96309,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-- } @@ -96208,21 +96356,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)*16))).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*16))).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*16))).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)*16))).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)*16))).FpSchema+8, __ccgo_ts+6175) } } } @@ -96252,12 +96400,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*16))).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*16))).FpSchema+8, __ccgo_ts+6688) } } } @@ -96295,7 +96443,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+12626, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12651, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -96305,7 +96453,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) @@ -96313,15 +96461,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 + 12659 } else { - v1 = __ccgo_ts + 12647 + v1 = __ccgo_ts + 12672 } 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 { } @@ -96359,12 +96507,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 @@ -96889,7 +97037,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) @@ -96921,7 +97069,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 @@ -96979,13 +97127,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+12686, 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+12703, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -97033,8 +97181,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+12723, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -97070,23 +97218,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 @@ -97206,7 +97356,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 @@ -97249,9 +97399,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 @@ -97264,7 +97414,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+12765, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -97280,9 +97430,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10987 + v2 = __ccgo_ts + 11012 } else { - v2 = __ccgo_ts + 9249 + v2 = __ccgo_ts + 9274 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -97292,9 +97442,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 + 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 @@ -97318,11 +97468,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 + 11012 } else { - v4 = __ccgo_ts + 9249 + v4 = __ccgo_ts + 9274 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12781, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12806, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -97330,11 +97480,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+12827, 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++ @@ -97366,19 +97516,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 @@ -97398,15 +97558,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) @@ -97421,7 +97586,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 } @@ -97482,7 +97647,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+12862, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -97491,14 +97656,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+12871, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+104, __ccgo_ts+12896, 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) @@ -97530,11 +97697,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) @@ -97545,7 +97712,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+12891, libc.VaList(bp+24, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12916, libc.VaList(bp+24, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -97555,12 +97722,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+12914, 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+12939, 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+12921, 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+12946, 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-- @@ -97602,21 +97769,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+12931, 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+12956, 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) { @@ -97627,7 +97783,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. */ @@ -97640,12 +97796,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 @@ -97817,10 +97982,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+12957, libc.VaList(bp+64, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12982, 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+13002, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13027, 0) } else { libc.Xmemset(tls, bp, 0, uint32(52)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -97878,7 +98043,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+13043, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13068, 0) } } @@ -97906,8 +98071,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) @@ -97915,7 +98080,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+13120, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 28)) |= uint32(TF_HasPrimaryKey) @@ -97934,21 +98099,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 @@ -97971,7 +98125,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+13161, 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) @@ -97999,8 +98153,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 { @@ -98087,17 +98246,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+13192, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13217, 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+13260, (*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+13268, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -98129,7 +98288,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+13275, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -98270,9 +98429,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 @@ -98283,31 +98443,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) { + 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 + 13306 + zEnd = __ccgo_ts + 5201 } else { - zSep = __ccgo_ts + 13283 - zSep2 = __ccgo_ts + 13287 - zEnd = __ccgo_ts + 13292 + zSep = __ccgo_ts + 13308 + zSep2 = __ccgo_ts + 13312 + zEnd = __ccgo_ts + 13317 } - 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+13320, 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))++ @@ -98318,8 +98478,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)] @@ -98332,17 +98493,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+3864, 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 + 1667, - 1: __ccgo_ts + 13309, - 2: __ccgo_ts + 13315, - 3: __ccgo_ts + 13320, - 4: __ccgo_ts + 13325, - 5: __ccgo_ts + 13315, + 1: __ccgo_ts + 13334, + 2: __ccgo_ts + 13340, + 3: __ccgo_ts + 13345, + 4: __ccgo_ts + 13350, + 5: __ccgo_ts + 13340, } // C documentation @@ -98351,15 +98513,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) } @@ -98374,7 +98537,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 } @@ -98607,8 +98770,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. @@ -98708,7 +98881,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 @@ -98721,8 +98894,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++ } @@ -98752,7 +98925,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 @@ -98971,9 +99144,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+13331, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1667))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13356, 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+13364, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13389, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98994,11 +99167,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+13416, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13441, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13466, 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)) @@ -99045,7 +99218,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+13498, 0) return } } @@ -99079,16 +99252,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 + 9274 + zType2 = __ccgo_ts + 13542 } else { /* A view */ - zType = __ccgo_ts + 10987 - zType2 = __ccgo_ts + 13523 + zType = __ccgo_ts + 11012 + zType2 = __ccgo_ts + 13548 } /* 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 @@ -99105,24 +99278,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) @@ -99161,7 +99339,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 } @@ -99170,13 +99348,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+13528, libc.VaList(bp+40, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13553, 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+13543, 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+13568, 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 @@ -99185,15 +99373,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+13641, libc.VaList(bp+40, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13666, 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+13683, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13708, 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+13717, 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+13742, 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. @@ -99211,7 +99399,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+9796) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -99244,7 +99432,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+13738, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13763, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -99261,7 +99449,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+10987, *(*uintptr)(unsafe.Pointer(bp + 60))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+11012, *(*uintptr)(unsafe.Pointer(bp + 60))) if _sqlite3FixSelect(tls, bp+8, pSelect) != 0 { goto create_view_fail } @@ -99358,7 +99546,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+13799, 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. @@ -99542,7 +99730,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+13829, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -99555,7 +99743,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)*16))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13844, 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) } @@ -99638,9 +99826,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+13911, 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+11901, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -99681,7 +99869,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+13925, 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 @@ -99690,7 +99878,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+13970, 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) } @@ -99725,11 +99913,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) @@ -99784,9 +99972,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)*16))).FzDbSName @@ -99819,18 +100007,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+14037, 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+14065, 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+14099, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -99840,7 +100028,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+12013, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -99888,19 +100076,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)*12))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14131, 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+14169, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14194, 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 { @@ -99957,7 +100145,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)*20))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14288, 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) { @@ -100072,11 +100260,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 */ @@ -100098,7 +100286,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 @@ -100143,13 +100331,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) } @@ -100172,23 +100360,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 @@ -100217,11 +100405,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 + 14309 + v2 = __ccgo_ts + 14334 } else { - v2 = __ccgo_ts + 14315 + v2 = __ccgo_ts + 14340 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14320, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14345, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -100299,7 +100487,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 + 52))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14373, *(*uintptr)(unsafe.Pointer(bp + 52))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -100309,7 +100497,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+14354, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14379, 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)) { @@ -100323,16 +100511,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+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+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+14429, 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+14432, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14457, 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+14482, 0) goto exit_create_index } /* @@ -100353,19 +100541,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+14373, (*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+80, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14516, 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+14525, libc.VaList(bp+80, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14550, libc.VaList(bp+80, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -100386,7 +100574,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+80, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14574, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -100404,9 +100592,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 @@ -100434,7 +100622,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+14373) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -100466,7 +100654,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 } @@ -100518,7 +100706,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+14597, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -100533,6 +100721,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { j = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) + libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 10, 0x400) } else { if int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12 + 4))&0xf>>0)) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 3, 0x8) @@ -100617,7 +100806,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) @@ -100665,7 +100854,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+80, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14658, 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 @@ -100695,8 +100884,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+14700, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127335)) goto exit_create_index } } @@ -100709,7 +100898,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 @@ -100738,9 +100927,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 + 14717 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14700, libc.VaList(bp+80, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 52)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14725, 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(""); */ @@ -100748,7 +100937,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+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+14745, 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. @@ -100756,7 +100945,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+80, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14804, 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)) @@ -100919,16 +101108,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+14806, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14831, 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+14824, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14849, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100936,9 +101125,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 + 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 { @@ -100954,8 +101143,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)*16))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11984, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14922, 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+12009, (*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) @@ -101028,12 +101217,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) @@ -101145,13 +101334,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+14982, 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) } @@ -101232,7 +101421,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) } @@ -101282,7 +101471,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 @@ -101453,11 +101642,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 + 15018 } else { - v1 = __ccgo_ts + 14996 + v1 = __ccgo_ts + 15021 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15002, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15027, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -101656,7 +101845,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+15063, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -101703,9 +101892,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 + 15069 } else { - v1 = __ccgo_ts + 15053 + v1 = __ccgo_ts + 15078 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -101737,9 +101926,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 + 15063, + 1: __ccgo_ts + 15085, + 2: __ccgo_ts + 15069, } // C documentation @@ -101759,7 +101948,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+15068, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15093, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -101784,7 +101973,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)*12))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12597, 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 @@ -102215,7 +102404,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+15268, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15293, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -103097,11 +103284,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+15326, 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+15355, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -103205,7 +103392,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 @@ -103262,7 +103449,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+15404, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15429, -int32(1)) return } if argc == int32(3) { @@ -104981,7 +105173,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+15437, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15462, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+4) @@ -105063,7 +105255,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*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 @@ -105135,28 +105327,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+15482, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15507, 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+15515, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -105188,13 +105380,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 + 15523 + } else { + v2 = __ccgo_ts + 15527 + } + 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[*(*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+15530, -int32(1)) + return +} + // C documentation // // /* @@ -105206,6 +105534,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) @@ -105216,7 +105548,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) @@ -105740,7 +106072,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11393, + 0: __ccgo_ts + 11418, } // C documentation @@ -105900,7 +106232,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+15553, int32(4), libc.UintptrFromInt32(0)) } } @@ -105961,7 +106293,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+12636, -int32(1)) return } if argc == int32(2) { @@ -106075,7 +106407,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) { @@ -106157,7 +106489,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+15406, -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) @@ -106509,7 +106841,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+15558, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -106538,8 +106870,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+15564, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15564, 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 @@ -106719,11 +107051,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 @@ -106827,7 +107159,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))) } /* @@ -106840,542 +107172,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 + 15517, + FzName: __ccgo_ts + 15569, }, 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 + 15537, + FzName: __ccgo_ts + 15589, }, 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 + 15550, + FzName: __ccgo_ts + 15602, }, 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 + 15568, + FzName: __ccgo_ts + 15620, }, 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 + 15629, }, 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 + 15637, }, 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 + 15637, }, 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 + 15652, }, 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 + 15678, }, 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 + 15651, + FzName: __ccgo_ts + 15703, }, 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 + 15660, + FzName: __ccgo_ts + 15712, }, 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 + 15671, + FzName: __ccgo_ts + 15723, }, 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 + 15678, + FzName: __ccgo_ts + 15730, }, 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 + 15692, + FzName: __ccgo_ts + 15744, }, 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 + 15692, + FzName: __ccgo_ts + 15744, }, 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 + 15698, + FzName: __ccgo_ts + 15750, }, 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 + 15698, + FzName: __ccgo_ts + 15750, }, 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 + 15704, + FzName: __ccgo_ts + 15756, }, 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 + 15704, + FzName: __ccgo_ts + 15756, }, 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 + 15761, }, 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 + 15761, }, 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 + 15713, + FzName: __ccgo_ts + 15765, }, 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 + 15713, + FzName: __ccgo_ts + 15765, }, 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 + 15769, }, 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 + 15776, }, 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 + 15784, }, 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 + 15791, }, 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 + 15804, }, 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 + 15810, }, 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 + 15817, }, 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 + 15824, }, 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 + 15832, }, 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 + 15837, }, 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 + 15841, }, 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 + 15841, }, 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 + 15847, }, 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 + 15853, }, 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 + 15859, }, 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 + 15863, }, 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 + 15863, }, 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 + 15869, }, 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 + 15876, }, 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 + 15886, }, 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 + 15893, }, 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 + 15900, }, 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 + 15911, }, 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 + 15918, }, 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 + 15933, }, 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 + 15950, }, 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 + 15961, }, 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 + 15968, }, 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(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 15974, }, 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 + 15987, }, 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 + 16005, }, 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 + 16013, }, 55: { - 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 + 15972, - }, - 56: { 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 + 16027, + }, + 56: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16035, }, 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 + 16044, }, 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 + 16044, }, 59: { - 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, + 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 + 16051, }, 60: { - 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, + 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 + 16051, }, 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 + 15999, + FzName: __ccgo_ts + 16061, }, 62: { - 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, + 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 + 16065, }, 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(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16003, + 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 + 16071, }, 64: { - 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, + 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 + 16075, }, 65: { - 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, + 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 + 16075, }, 66: { - FnArg: int16(2), + 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 + 16022, + FzName: __ccgo_ts + 16081, }, 67: { 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, + 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 + 16081, }, 68: { 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, + 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 + 16094, }, 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 + 16105, + }, + 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 + 15564, + }, + 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, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16038, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1240, + FzName: __ccgo_ts + 15564, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1248, + FzName: __ccgo_ts + 16110, }, 73: { 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 + 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 + 16049, + 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 + 16052, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16115, }, 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 + 16056, + FzName: __ccgo_ts + 16121, }, 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 + 16062, + FpUserData: uintptr(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 16124, }, 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 + 16052, + FpUserData: uintptr(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 16128, }, 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, + FfuncFlags: 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 + 16134, }, 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 + 16124, }, 81: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16075, - }, - 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, - }, - 83: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16085, - }, - 84: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16090, - }, - 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, - }, - 86: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16100, - }, - 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, - }, - 88: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16110, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, }, + 82: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16143, + }, + 83: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16147, + }, + 84: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16153, + }, + 85: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16157, + }, + 86: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16162, + }, + 87: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16167, + }, + 88: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16172, + }, + 89: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16178, + }, + 90: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16182, + }, + 91: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16186, + }, + 92: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16190, + }, + 93: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16195, + }, + 94: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16200, + }, 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 + 16205, }, 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 + 16211, }, 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 + 16217, }, 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 + 16223, }, 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 + 16228, }, 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 + 16236, }, 101: { - 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, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16244, }, 102: { - 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, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16247, }, 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 + 6885, + }, + 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 + 16184, + FzName: __ccgo_ts + 16252, + }, + 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 + 16256, }, } @@ -107434,109 +107777,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 ************************************************/ @@ -107853,7 +108198,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+16259, 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) @@ -108677,7 +109022,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 @@ -108964,11 +109309,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 8)) = TToken{ - Fz: __ccgo_ts + 6726, + Fz: __ccgo_ts + 6751, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 6722, + Fz: __ccgo_ts + 6747, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 { @@ -109032,7 +109377,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 = uint8(OE_Abort) @@ -109614,7 +109959,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8353, 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 } @@ -109680,11 +110025,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 } @@ -110009,7 +110354,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) @@ -110023,7 +110368,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 @@ -110058,7 +110403,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 @@ -110071,7 +110416,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 @@ -110198,27 +110543,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 */ @@ -110299,7 +110644,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++ @@ -110335,44 +110680,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+16232, 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+16304, 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+16273, 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+16345, 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 } } @@ -110394,31 +110723,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+88, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16377, 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 @@ -110442,10 +110771,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) @@ -110486,8 +110815,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-- } @@ -110504,28 +110833,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+16313, libc.VaList(bp+88, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16385, 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+16365, libc.VaList(bp+88, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16437, 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 @@ -110638,18 +110967,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 @@ -110659,13 +110988,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 } } } @@ -110676,14 +111005,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 } @@ -110700,16 +111029,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++ @@ -110820,11 +111149,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 */ @@ -110883,7 +111212,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16457) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16529) } goto insert_cleanup insert_cleanup: @@ -111279,7 +111608,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+48, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12597, 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('/'))) { @@ -113513,7 +113844,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+16578, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -113533,7 +113864,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16510, uint32(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16582, uint32(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } @@ -113545,7 +113876,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+16516, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16588, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113560,7 +113891,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+16559, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16631, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) @@ -113591,7 +113922,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+16663, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113600,7 +113931,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 + 16543, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -113833,7 +114164,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+16700, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -113887,63 +114218,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 + 16739, + 2: __ccgo_ts + 9274, + 3: __ccgo_ts + 16743, + 4: __ccgo_ts + 16748, + 5: __ccgo_ts + 16751, + 6: __ccgo_ts + 16761, + 7: __ccgo_ts + 16771, + 8: __ccgo_ts + 16777, + 9: __ccgo_ts + 16781, + 10: __ccgo_ts + 16786, + 11: __ccgo_ts + 16791, + 12: __ccgo_ts + 16799, + 13: __ccgo_ts + 16810, + 14: __ccgo_ts + 16813, + 15: __ccgo_ts + 16781, + 16: __ccgo_ts + 16820, + 17: __ccgo_ts + 16786, + 18: __ccgo_ts + 16828, + 19: __ccgo_ts + 16832, + 20: __ccgo_ts + 16837, + 21: __ccgo_ts + 16843, + 22: __ccgo_ts + 16781, + 23: __ccgo_ts + 16786, + 24: __ccgo_ts + 16850, + 25: __ccgo_ts + 16855, + 26: __ccgo_ts + 16858, + 27: __ccgo_ts + 16865, + 28: __ccgo_ts + 16777, + 29: __ccgo_ts + 16781, + 30: __ccgo_ts + 16871, + 31: __ccgo_ts + 16876, + 32: __ccgo_ts + 16881, + 33: __ccgo_ts + 16739, + 34: __ccgo_ts + 16781, + 35: __ccgo_ts + 16885, + 36: __ccgo_ts + 16892, + 37: __ccgo_ts + 16899, + 38: __ccgo_ts + 12013, + 39: __ccgo_ts + 12009, + 40: __ccgo_ts + 16907, + 41: __ccgo_ts + 16912, + 42: __ccgo_ts + 16917, + 43: __ccgo_ts + 9274, + 44: __ccgo_ts + 16922, + 45: __ccgo_ts + 5595, + 46: __ccgo_ts + 16928, + 47: __ccgo_ts + 16933, + 48: __ccgo_ts + 16124, + 49: __ccgo_ts + 16938, + 50: __ccgo_ts + 16739, + 51: __ccgo_ts + 16781, + 52: __ccgo_ts + 16951, + 53: __ccgo_ts + 16956, + 54: __ccgo_ts + 16965, + 55: __ccgo_ts + 16972, + 56: __ccgo_ts + 16983, } // C documentation @@ -113963,338 +114294,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16919, + FzName: __ccgo_ts + 16991, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16934, + FzName: __ccgo_ts + 17006, 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 + 17021, 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 + 17033, 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 + 17049, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16900, + FzName: __ccgo_ts + 16972, 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 + 17062, 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 + 17074, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17022, + FzName: __ccgo_ts + 17094, 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 + 17110, 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 + 17131, 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 + 17146, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17090, + FzName: __ccgo_ts + 17162, 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 + 17176, 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 + 17189, 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 + 17203, 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 + 17222, 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 + 17241, 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 + 17264, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17201, + FzName: __ccgo_ts + 17273, 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 + 17291, 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 + 17308, 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 + 17321, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17264, + FzName: __ccgo_ts + 17336, 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 + 17354, 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 + 17364, 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 + 17378, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17322, + FzName: __ccgo_ts + 17394, 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 + 17419, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17366, + FzName: __ccgo_ts + 17438, 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 + 17449, 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 + 17460, 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 + 17472, 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 + 17488, 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 + 17501, 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 + 17520, 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 + 17539, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17480, + FzName: __ccgo_ts + 17552, 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 + 17567, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17505, + FzName: __ccgo_ts + 17577, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17517, + FzName: __ccgo_ts + 17589, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17526, + FzName: __ccgo_ts + 17598, 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 + 17609, 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 + 17619, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17559, + FzName: __ccgo_ts + 17631, 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 + 17642, 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 + 17654, 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 + 17671, 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 + 17690, 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 + 17716, 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 + 17731, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17673, + FzName: __ccgo_ts + 17745, 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 + 17764, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17706, + FzName: __ccgo_ts + 17778, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17722, + FzName: __ccgo_ts + 17794, 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 + 17806, 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 + 17817, 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 + 17828, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -114302,45 +114633,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17768, + FzName: __ccgo_ts + 17840, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17779, + FzName: __ccgo_ts + 17851, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17800, + FzName: __ccgo_ts + 17872, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17808, + FzName: __ccgo_ts + 17880, 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 + 17895, 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 + 17908, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17855, + FzName: __ccgo_ts + 17927, 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 + 17942, 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)), @@ -114358,7 +114689,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 @@ -114466,10 +114797,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+17958) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17896) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17968) { return PAGER_LOCKINGMODE_NORMAL } } @@ -114487,13 +114818,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+17975) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17908) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17980) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -114516,10 +114847,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+16861) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+16951) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17920) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+17992) == 0 { return int32(2) } else { return 0 @@ -114541,7 +114872,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+17927, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17999, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpBt) @@ -114671,15 +115002,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 + 18061 case int32(OE_SetDflt): - zName = __ccgo_ts + 17998 + zName = __ccgo_ts + 18070 case int32(OE_Cascade): - zName = __ccgo_ts + 18010 + zName = __ccgo_ts + 18082 case int32(OE_Restrict): - zName = __ccgo_ts + 18018 + zName = __ccgo_ts + 18090 default: - zName = __ccgo_ts + 18027 + zName = __ccgo_ts + 18099 break } return zName @@ -114700,12 +115031,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 + 18109, + 1: __ccgo_ts + 18116, + 2: __ccgo_ts + 18124, + 3: __ccgo_ts + 18128, + 4: __ccgo_ts + 17992, + 5: __ccgo_ts + 18137, } // C documentation @@ -114767,15 +115098,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 + 18162 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18092 + zType = __ccgo_ts + 18164 } 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+18166, 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: ; @@ -114784,9 +115115,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 + 18141, + 2: __ccgo_ts + 18146, + 3: __ccgo_ts + 18154, } // C documentation @@ -114885,7 +115216,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+136, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18173, libc.VaList(bp+136, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114928,7 +115259,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+3864, 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++ @@ -114973,7 +115304,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 @@ -115032,7 +115363,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+18177) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -115075,7 +115406,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 @@ -115103,7 +115434,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 + 17968 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 @@ -115131,7 +115462,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 + 17958 } _returnSingleText(tls, v, zRet) break @@ -115421,7 +115752,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+18110, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18182, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -115431,7 +115762,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+3864, 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) } @@ -115453,7 +115784,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+18207, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -115485,8 +115816,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+18188) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18260) == 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. */ @@ -115566,9 +115898,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 + 18266 } else { - v14 = __ccgo_ts + 18202 + v14 = __ccgo_ts + 18274 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 { v15 = int32(1) @@ -115639,7 +115971,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+136, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18281, 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)) @@ -115669,19 +116001,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 + 11012 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13235 + zType = __ccgo_ts + 13260 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18225 + zType = __ccgo_ts + 18297 } else { - zType = __ccgo_ts + 9249 + zType = __ccgo_ts + 9274 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18232, 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+18304, 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: ; @@ -115728,9 +116060,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+18239, libc.VaList(bp+136, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18311, libc.VaList(bp+136, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18244, 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+18316, 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 @@ -115754,11 +116086,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 + 18321, + 1: __ccgo_ts + 18323, + 2: __ccgo_ts + 16810, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18253, 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+18325, 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: ; @@ -115777,7 +116109,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+18259, 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+18331, 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: ; @@ -115794,7 +116126,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+136, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18335, libc.VaList(bp+136, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -115844,7 +116176,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+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: ; @@ -115856,7 +116188,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+7808, 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: ; @@ -115882,7 +116214,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+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+18275)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18338, 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+18347)) goto _32 _32: ; @@ -115896,8 +116228,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 @@ -116023,7 +116355,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+136, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18352, 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))) @@ -116119,7 +116451,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 @@ -116214,7 +116546,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+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+18356, 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) @@ -116225,7 +116557,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+18380) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -116361,7 +116693,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+18337, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18409, 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) @@ -116423,7 +116755,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))) } @@ -116445,7 +116777,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+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18445, 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) @@ -116458,7 +116790,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+18393, 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+18465, 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) { @@ -116466,7 +116798,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+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18487, 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) { @@ -116477,10 +116809,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+18438, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18510, -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+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18512, 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)) } } @@ -116514,7 +116846,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+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18532, 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) @@ -116538,9 +116870,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+18490) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18562) _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+18567) _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)) @@ -116553,9 +116885,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+18516) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18588) _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+18624) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -116583,9 +116915,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+18562) _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+18635) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -116613,7 +116945,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+18590) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18662) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -116710,7 +117042,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 + 18617 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*20 + 16)) = __ccgo_ts + 18689 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*20))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*20 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -116789,7 +117121,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+136, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18750, libc.VaList(bp+136, zRight)) } } } @@ -116894,13 +117226,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+17975) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18703) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18775) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18056) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18128) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -117035,7 +117367,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 @@ -117065,7 +117397,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. @@ -117127,7 +117459,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+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18783, 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)) @@ -117400,34 +117732,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18620, + FzName: __ccgo_ts + 18692, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18625, + FzName: __ccgo_ts + 18697, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18631, + FzName: __ccgo_ts + 18703, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18640, + FzName: __ccgo_ts + 18712, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18649, + FzName: __ccgo_ts + 18721, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18657, + FzName: __ccgo_ts + 18729, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18665, + FzName: __ccgo_ts + 18737, }, 7: { - FzName: __ccgo_ts + 18672, + FzName: __ccgo_ts + 18744, }, 8: {}, } @@ -117525,14 +117857,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+18729) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18801) 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+232, libc.Int32FromUint8(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18816, libc.VaList(bp+232, libc.Int32FromUint8(cSep), _pragCName[j])) cSep = uint8(',') goto _1 _1: @@ -117541,19 +117873,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+232, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18823, 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+18757) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18829) 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+18841) 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+24) if rc == SQLITE_OK { @@ -117568,7 +117900,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+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 @@ -117749,7 +118081,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+3864, 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) } @@ -117761,13 +118093,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+18784) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18856) if *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18792, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18864, 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+18796, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18868, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -117776,7 +118108,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+3864, 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) @@ -117902,24 +118234,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*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+18902, 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(143745)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*4)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*4)) } 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+18930, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*uint8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18889, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18961, 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(143752)) } } } @@ -117927,9 +118259,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 + 18872, + 1: __ccgo_ts + 18879, + 2: __ccgo_ts + 18891, } // C documentation @@ -118005,7 +118337,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+14675) + _corruptSchema(tls, pData, argv, __ccgo_ts+14700) } } libc.SetBitFieldPtr8Uint32(db+172+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -118038,11 +118370,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+18897) + _corruptSchema(tls, pData, argv, __ccgo_ts+18969) } 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+14675) + _corruptSchema(tls, pData, argv, __ccgo_ts+14700) } } } @@ -118081,18 +118413,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 + 9274 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 + 18982 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 44))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 44))).FiDb = iDb @@ -118176,7 +118508,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+12286) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12311) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -118202,7 +118534,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+19054) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -118217,7 +118549,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+19006, libc.VaList(bp+80, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19078, 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)) @@ -118546,8 +118878,8 @@ 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 @@ -118575,8 +118907,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 @@ -118635,7 +118967,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+19040, libc.VaList(bp+296, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19112, libc.VaList(bp+296, zDb)) goto end_prepare } } @@ -118651,7 +118983,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+19070, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19142, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -118674,10 +119006,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 { @@ -118685,7 +119017,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+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) @@ -118715,7 +119047,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(144552)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -118849,7 +119181,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(144701)) } /* 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 @@ -119109,7 +119441,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) @@ -119117,7 +119449,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 @@ -119273,15 +119605,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 + 11418 + zSp2 = __ccgo_ts + 11418 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+19161, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -119338,25 +119670,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) } @@ -119488,13 +119823,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 { @@ -119572,7 +119907,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+19119, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19191, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -119622,12 +119957,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+19169, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19241, 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. @@ -119642,9 +119977,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+19233, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19305, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -119654,6 +119990,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) @@ -119688,7 +120031,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), } @@ -119736,7 +120079,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 @@ -119781,7 +120124,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) @@ -119805,7 +120148,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) @@ -119826,7 +120169,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 @@ -119949,7 +120292,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 { @@ -120076,10 +120419,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 @@ -120087,7 +120430,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 @@ -120264,7 +120607,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+19342, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -120375,8 +120718,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) @@ -120384,7 +120727,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) } @@ -120469,13 +120812,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19290 + z = __ccgo_ts + 19362 case int32(TK_INTERSECT): - z = __ccgo_ts + 19300 + z = __ccgo_ts + 19372 case int32(TK_EXCEPT): - z = __ccgo_ts + 19310 + z = __ccgo_ts + 19382 default: - z = __ccgo_ts + 19317 + z = __ccgo_ts + 19389 break } return z @@ -120496,7 +120839,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+19395, libc.VaList(bp+8, zUsage)) } /* @@ -120533,13 +120876,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 + 19418 } 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+19432, 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+19463, 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) @@ -120563,11 +120906,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 @@ -120783,7 +121126,7 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr } if iCol < 0 { zType = __ccgo_ts + 1141 - *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 16850 + *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 16922 } 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)) @@ -120896,7 +121239,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 */ @@ -120905,7 +121248,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) @@ -120929,13 +121272,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 + 16922 } 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+12572, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12597, 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))) @@ -120943,7 +121286,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+19437, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19509, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -121035,7 +121378,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 + 16850 + v3 = __ccgo_ts + 16922 } zName = v3 } else { @@ -121050,7 +121393,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+32, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19509, 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. @@ -121086,7 +121429,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+32, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19518, libc.VaList(bp+32, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -121205,7 +121548,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 + 19454 + zType = __ccgo_ts + 19526 } else { zType = uintptr(0) j = int32(1) @@ -121271,7 +121614,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) } @@ -121299,7 +121642,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) } @@ -121349,7 +121692,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 @@ -121372,7 +121715,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 @@ -121520,7 +121863,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+19530, 0) return } /* Obtain authorization to do a recursive query */ @@ -121557,7 +121900,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 @@ -121568,7 +121911,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 @@ -121582,7 +121925,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 @@ -121613,7 +121956,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+19579, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -121628,7 +121971,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+19621, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -121656,7 +121999,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+19627, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -121711,9 +122054,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 + 19642 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19572, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19644, 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) { @@ -121821,8 +122164,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+19667, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19682, 0) } /* Generate code for the left and right SELECT statements. */ @@ -121847,7 +122190,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+19362, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121873,7 +122216,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 @@ -121899,7 +122242,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+19629, libc.VaList(bp+96, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19701, 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 @@ -121931,11 +122274,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 @@ -121957,7 +122300,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+19629, libc.VaList(bp+96, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19701, 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 @@ -122064,6 +122407,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) } @@ -122080,9 +122424,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+19722, 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+19768, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -122153,7 +122497,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+19342, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -122401,7 +122745,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 { @@ -122455,16 +122799,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 + 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 @@ -122482,32 +122826,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+19778, libc.VaList(bp+64, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19850, 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+19789, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19861, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -122520,7 +122864,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+19866, 0) _sqlite3Select(tls, pParse, p, bp+28) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -122730,11 +123074,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 + 36)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } @@ -122895,7 +123239,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 @@ -123085,9 +123429,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. @@ -123299,7 +123643,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) @@ -123446,7 +123790,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) @@ -123736,7 +124080,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++ @@ -123805,7 +124149,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 @@ -123823,12 +124167,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 { @@ -124310,7 +124654,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 @@ -124356,13 +124700,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+15761) == 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+15765) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -124450,8 +124794,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+19872, 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 @@ -124475,7 +124819,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 @@ -124557,7 +124901,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) @@ -124575,7 +124919,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+19818, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19890, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -124723,7 +125067,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) } @@ -124751,7 +125095,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+19841, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 32)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19913, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 32)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+12+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -124773,12 +125117,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+19861, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19933, 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 @@ -124795,7 +125139,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 + 19976 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 { @@ -124826,7 +125170,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+19999, 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) } @@ -124835,9 +125179,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 + 19965 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20037 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19999 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20071 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -124886,7 +125230,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) { @@ -124896,7 +125240,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+20109, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124992,7 +125336,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) @@ -125001,7 +125345,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) } @@ -125052,7 +125396,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+20113, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -125067,7 +125411,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+20080, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20152, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -125082,7 +125426,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+15268, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15293, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -125206,7 +125550,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 + 6720 + v10 = __ccgo_ts + 6745 } zSchemaName = v10 } @@ -125223,7 +125567,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+20111, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20183, 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) } @@ -125302,7 +125646,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+20116, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20188, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -125315,7 +125659,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+12597, 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) @@ -125335,9 +125679,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+20197, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20143, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20215, 0) } } } @@ -125351,7 +125695,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+20163, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20235, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -125600,7 +125944,7 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint (*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))) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -125653,7 +125997,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 @@ -125690,12 +126034,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+20194, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20266, 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+20245, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20317, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -125716,7 +126060,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+20350, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -125855,7 +126199,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 @@ -125963,7 +126307,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 @@ -126030,7 +126374,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 + 56))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 20311 + v1 = __ccgo_ts + 20383 } else { v1 = __ccgo_ts + 1667 } @@ -126039,7 +126383,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+20406, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -126071,7 +126415,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)) @@ -126200,6 +126544,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. // */ @@ -126228,7 +126573,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+16075) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != uintptr(0) { @@ -126261,9 +126606,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 */ } @@ -126273,13 +126618,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 { @@ -126299,7 +126644,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) } @@ -126472,8 +126817,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 @@ -126482,11 +126827,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 { @@ -126502,7 +126847,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)) @@ -126526,14 +126871,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+128, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20418, 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) @@ -126634,7 +126979,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+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+20472, 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 @@ -126812,7 +127157,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 @@ -126835,14 +127180,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+20440, libc.VaList(bp+128, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20512, 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) @@ -126874,7 +127219,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 @@ -126889,7 +127234,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+20455, libc.VaList(bp+128, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20527, 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 { @@ -126911,7 +127256,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: @@ -126943,7 +127288,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 @@ -126976,7 +127321,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 @@ -127035,7 +127380,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 @@ -127064,6 +127409,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)) @@ -127086,10 +127438,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) @@ -127123,8 +127475,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 @@ -127139,8 +127491,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 @@ -127169,8 +127521,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++ } @@ -127200,11 +127552,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.Uint16FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+84, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+84, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy) @@ -127238,47 +127590,47 @@ 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)) /* 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)) /* Begin a loop that will extract all source rows in GROUP BY order. @@ -127288,16 +127640,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 @@ -127315,11 +127667,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 + 20543 } else { - v46 = __ccgo_ts + 20480 + v47 = __ccgo_ts + 20552 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19323, libc.VaList(bp+128, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19395, libc.VaList(bp+128, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -127333,8 +127685,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -127352,8 +127704,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -127364,12 +127716,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) @@ -127418,12 +127770,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++ } @@ -127493,9 +127849,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 @@ -127512,10 +127868,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 */ @@ -127542,8 +127898,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 } @@ -127583,32 +127939,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) @@ -127650,7 +128006,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+20543) } /* 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 @@ -127756,7 +128112,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)*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 } @@ -127772,7 +128128,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+20561, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -127862,7 +128218,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+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) } @@ -128024,7 +128380,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+20626, 0) goto trigger_cleanup } iDb = int32(1) @@ -128064,7 +128420,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+20600, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+4, pParse, iDb, __ccgo_ts+20672, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+4, pTableName) != 0 { goto trigger_cleanup } @@ -128074,11 +128430,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+20680, 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+20721, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -128087,13 +128443,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+20672, (*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+20689, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20761, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -128101,8 +128457,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+20787, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -128110,15 +128466,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 + 20825 } else { - v1 = __ccgo_ts + 20760 + v1 = __ccgo_ts + 20832 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20766, libc.VaList(bp+64, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20838, 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+20803, libc.VaList(bp+64, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20875, libc.VaList(bp+64, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -128138,9 +128494,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 @@ -128240,7 +128596,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+20600, bp+56) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20672, 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 } @@ -128262,7 +128618,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+72, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20921, libc.VaList(bp+72, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -128278,10 +128634,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+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+20969, 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+20972, libc.VaList(bp+72, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21044, libc.VaList(bp+72, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -128549,11 +128905,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+21073, 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) @@ -128591,9 +128947,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 + 6663 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6151 + v1 = __ccgo_ts + 6175 } zTab = v1 if iDb == int32(1) { @@ -128608,7 +128964,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)*16))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21093, 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) } @@ -128741,11 +129097,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 + 21155 } else { - v1 = __ccgo_ts + 21090 + v1 = __ccgo_ts + 21162 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21097, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21169, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -128847,7 +129203,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+21217, 0) return int32(1) } @@ -128995,12 +129351,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) { @@ -129008,19 +129364,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) @@ -129028,24 +129387,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 { @@ -129113,7 +129472,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+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): @@ -129164,8 +129523,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 @@ -129212,10 +129571,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+21187, libc.VaList(bp+336, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21259, 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 @@ -129237,7 +129598,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 @@ -129309,7 +129670,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)) @@ -129725,13 +130086,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 @@ -129739,21 +130100,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 */ @@ -129800,7 +130161,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 @@ -129883,58 +130244,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+21201, 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+21273, 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+21237, 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+21309, 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 + 8096 + 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 { @@ -129964,17 +130313,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++ } @@ -129986,11 +130335,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 @@ -130006,11 +130355,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 @@ -130019,18 +130368,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++ } @@ -130039,16 +130388,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. */ @@ -130066,24 +130415,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 { @@ -130109,50 +130458,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) @@ -130450,8 +130799,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -130501,8 +130850,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++ @@ -130549,11 +130898,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)) } @@ -130565,11 +130914,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. */ @@ -130612,7 +130961,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+21328) } goto update_cleanup update_cleanup: @@ -130669,13 +131018,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) { @@ -130717,11 +131066,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 @@ -131046,9 +131395,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+21269, libc.VaList(bp+168, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+140, __ccgo_ts+21341, libc.VaList(bp+168, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21273, libc.VaList(bp+168, bp+140)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21345, libc.VaList(bp+168, bp+140)) return int32(SQLITE_ERROR) } goto _1 @@ -131137,13 +131486,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: @@ -131151,7 +131500,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+12686, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -131233,7 +131582,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, uint32(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21350, uint32(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21418, uint32(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21422, uint32(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -131324,7 +131673,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 @@ -131363,17 +131712,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+21426) 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+21466) 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+21509) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -131390,7 +131739,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+21486) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21558) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_VacuumInto) @@ -131443,7 +131792,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+15063) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131474,11 +131823,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+21585, 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+21693, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131487,7 +131836,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+21747, 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 @@ -131497,7 +131846,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+21884, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -132024,7 +132373,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+12891, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12916, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -132147,24 +132496,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+21935, libc.VaList(bp+8, pParse+204)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22007, 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+21959, 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+22031, 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+22058, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22130, 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 @@ -132205,7 +132559,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 @@ -132248,7 +132602,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+32, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22149, libc.VaList(bp+32, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -132290,9 +132644,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+22119, libc.VaList(bp+32, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22191, libc.VaList(bp+32, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3864, 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) @@ -132305,7 +132659,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 + 22221 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+32, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -132339,7 +132693,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 || 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+16813, 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 @@ -132420,13 +132774,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+22195, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22267, 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))) @@ -132507,7 +132861,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+22267, 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) @@ -132531,13 +132885,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 @@ -132550,12 +132904,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+22214, 0) + if *(*int32)(unsafe.Pointer(bp + 284)) != libc.Int32FromUint8(_aKeyword1[i]) { + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22286, 0) return int32(SQLITE_ERROR) } goto _1 @@ -132566,9 +132920,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(158352))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158354)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -132610,11 +132964,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 + 3864 + 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) } @@ -133024,7 +133378,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 @@ -133066,7 +133420,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 } @@ -133086,7 +133440,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) } @@ -133150,7 +133504,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(158849)) } else { ap = va switch op { @@ -133163,7 +133517,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(158871)) break } _ = ap @@ -133882,7 +134236,6 @@ type TWhereInfo1 = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo1 = TWhereInfo1 @@ -133918,10 +134271,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 + 22299 } if i == -int32(1) { - return __ccgo_ts + 16850 + return __ccgo_ts + 16922 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*12))).FzCnName } @@ -133940,10 +134293,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+22306, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22240, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22312, int32(1)) } i = 0 for { @@ -133951,7 +134304,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+13306, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133960,11 +134313,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+22312, int32(1)) } i = 0 for { @@ -133972,16 +134325,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+13306, 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)) } } @@ -134028,7 +134381,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+22314, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -134036,12 +134389,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+22306, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22245 + v2 = __ccgo_ts + 22317 } else { - v2 = __ccgo_ts + 22250 + v2 = __ccgo_ts + 22322 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -134058,7 +134411,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+22330) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -134069,9 +134422,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+22332) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5175, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } // C documentation @@ -134116,11 +134469,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 + 22262 + v2 = __ccgo_ts + 22334 } else { - v2 = __ccgo_ts + 22269 + v2 = __ccgo_ts + 22341 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22274, libc.VaList(bp+136, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, 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 { @@ -134133,37 +134486,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 + 11444 + zFmt = __ccgo_ts + 11469 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22280 + zFmt = __ccgo_ts + 22352 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22313 + zFmt = __ccgo_ts + 22385 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22338 + zFmt = __ccgo_ts + 22410 } else { - zFmt = __ccgo_ts + 22356 + zFmt = __ccgo_ts + 22428 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22365, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22437, 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 + 16850 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22373, libc.VaList(bp+136, zRowid)) + zRowid = __ccgo_ts + 16922 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22445, 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+22404, libc.VaList(bp+136, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22476, libc.VaList(bp+136, zRowid)) cRangeOp = uint8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -134173,14 +134526,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22414, libc.VaList(bp+136, libc.Int32FromUint8(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22486, libc.VaList(bp+136, libc.Int32FromUint8(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22419) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22491) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22441 + v3 = __ccgo_ts + 22513 } else { - v3 = __ccgo_ts + 22449 + v3 = __ccgo_ts + 22521 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+136, (*(*struct { FidxNum int32 @@ -134201,7 +134554,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+22527, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -134267,14 +134620,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+22466, libc.VaList(bp+136, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22538, 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+22245, 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+22317, 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+22487, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22559, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -134298,16 +134651,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+22306, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22245, libc.VaList(bp+136, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22317, libc.VaList(bp+136, 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 @@ -134512,7 +134865,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 @@ -134591,7 +134944,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 */ @@ -134953,7 +135306,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 @@ -135366,7 +135719,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 @@ -135427,11 +135780,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 @@ -135462,6 +135815,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 { @@ -135600,7 +135956,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 @@ -135680,7 +136036,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 @@ -135714,7 +136070,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 @@ -135836,7 +136192,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 @@ -136029,7 +136385,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: @@ -136043,12 +136399,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 { @@ -136086,11 +136443,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 */ @@ -136110,7 +136467,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 } @@ -136146,21 +136503,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 @@ -136178,7 +136535,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, @@ -136233,7 +136590,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+22567, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -136256,7 +136613,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+72, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22582, 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)) @@ -136745,9 +137102,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 @@ -136756,7 +137113,7 @@ 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+22519, libc.VaList(bp+64, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22591, libc.VaList(bp+64, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { @@ -136802,15 +137159,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 @@ -136822,7 +137180,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) { @@ -137293,19 +137651,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16699, + FzOp: __ccgo_ts + 16771, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16033, + FzOp: __ccgo_ts + 16105, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15512, + FzOp: __ccgo_ts + 15564, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22533, + FzOp: __ccgo_ts + 22605, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -138093,7 +138451,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+22612, 0) return } } else { @@ -138105,10 +138463,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+22612, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -138189,7 +138547,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) @@ -138290,7 +138648,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 + 22581 + v13 = __ccgo_ts + 22653 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -138821,7 +139179,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+22660, 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) @@ -138893,7 +139251,6 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo @@ -138904,7 +139261,6 @@ type THiddenIndexInfo1 = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo1 = THiddenIndexInfo1 @@ -139937,7 +140293,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)<>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 @@ -142554,7 +142906,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { + })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x400>>10)) != 0)) { if libc.Int32FromUint16((*(*struct { FnEq Tu16 FnBtm Tu16 @@ -142758,7 +143110,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 @@ -143042,7 +143394,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) } } @@ -143220,7 +143572,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)) @@ -143561,7 +143913,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+22661, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22733, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143636,7 +143988,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+22661, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22733, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143790,7 +144142,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(168893)) /* 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) @@ -144226,7 +144578,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+22759, 0) rc = SQLITE_OK } else { break @@ -145434,7 +145786,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+22794, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -146012,7 +146364,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 @@ -146168,7 +146520,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+22740, libc.VaList(bp+40, libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22812, 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 @@ -146189,10 +146541,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) @@ -146241,7 +146590,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+22840, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -146386,7 +146735,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 @@ -146420,7 +146770,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. @@ -146546,7 +146896,7 @@ 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 @@ -146577,16 +146927,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 @@ -146765,7 +147115,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 { @@ -146972,7 +147322,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 @@ -146982,7 +147332,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+22858, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -147032,7 +147382,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 } @@ -147304,7 +147654,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+22887, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -147487,7 +147837,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+22943, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -147813,7 +148163,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+22988, libc.VaList(bp+8, zName)) } return p } @@ -147864,12 +148214,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+23007, 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+23078, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -147942,7 +148292,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 } @@ -148080,7 +148430,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( 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 { @@ -148224,7 +148574,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+23141, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -148260,7 +148610,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)) } @@ -148275,7 +148625,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 @@ -148294,11 +148644,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 { @@ -148344,11 +148694,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 @@ -148365,7 +148715,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)) @@ -148387,7 +148737,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 @@ -148511,7 +148861,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+23167, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(100)) @@ -148579,18 +148929,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 + 23199 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23144 + zErr = __ccgo_ts + 23216 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23160 + zErr = __ccgo_ts + 23232 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23180, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23252, 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 { @@ -148614,7 +148964,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+23285, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -148720,24 +149070,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 @@ -148755,12 +149105,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) } @@ -148772,15 +149122,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 @@ -148832,11 +149182,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 + 23332, + 1: __ccgo_ts + 23385, + 2: __ccgo_ts + 22887, + 3: __ccgo_ts + 23436, + 4: __ccgo_ts + 23488, } var _aOp1 = [5]int32{ @@ -149416,7 +149766,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 } @@ -149512,7 +149862,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 '' */ @@ -150229,12 +150579,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 @@ -150242,13 +150592,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 @@ -150268,13 +150618,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 @@ -150301,7 +150651,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 @@ -150520,6 +150870,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. @@ -150580,7 +150934,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+23538, libc.VaList(bp+8, p)) } // C documentation @@ -150594,6 +150948,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) } @@ -150627,11 +150982,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 + 23562 } else { - v1 = __ccgo_ts + 23499 + v1 = __ccgo_ts + 23571 } - _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+23577, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -150640,7 +150995,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+23619, 0) } } } @@ -150746,7 +151101,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+23653, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -159203,20 +159558,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+16850, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+16922, 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+23619, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23691, 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+16763, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+16858, 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+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23691, 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 @@ -159257,7 +159612,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 */ @@ -159402,7 +159762,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 */ @@ -159492,9 +159857,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) } @@ -159849,7 +160214,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+23646) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), __ccgo_ts+23718) 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) { @@ -160199,9 +160564,9 @@ _237: */ _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 + 8077 + v347 = __ccgo_ts + 8102 } else { - v347 = __ccgo_ts + 8082 + v347 = __ccgo_ts + 8107 } *(*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 { @@ -160443,15 +160808,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+23655, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23727, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23750, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23822, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23834, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23906, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -160593,7 +160958,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 */ @@ -160787,7 +161152,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+23919, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23991, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -163518,14 +163883,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)< int32(65528) { sz = int32(65528) } - if cnt < 0 { + /* 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 > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } szAlloc = int64(sz) * int64(cnt) - if sz == 0 || cnt == 0 { + 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)) @@ -165003,7 +165377,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182779)) + return _sqlite3MisuseError(tls, int32(183820)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -165023,7 +165397,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+24078, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -165324,14 +165698,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 + 24621 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint32(libc.Uint32FromInt64(116)/libc.Uint32FromInt64(4)) && _aMsg[rc] != uintptr(0) { @@ -165343,31 +165717,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 + 24146, + 1: __ccgo_ts + 24159, + 3: __ccgo_ts + 24175, + 4: __ccgo_ts + 24200, + 5: __ccgo_ts + 24214, + 6: __ccgo_ts + 24233, 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 + 24258, + 9: __ccgo_ts + 24295, + 10: __ccgo_ts + 24307, + 11: __ccgo_ts + 24322, + 12: __ccgo_ts + 24355, + 13: __ccgo_ts + 24373, + 14: __ccgo_ts + 24398, + 15: __ccgo_ts + 24427, + 17: __ccgo_ts + 6130, + 18: __ccgo_ts + 5534, + 19: __ccgo_ts + 24444, + 20: __ccgo_ts + 24462, + 21: __ccgo_ts + 24480, + 23: __ccgo_ts + 24514, + 25: __ccgo_ts + 24535, + 26: __ccgo_ts + 24561, + 27: __ccgo_ts + 24584, + 28: __ccgo_ts + 24605, } // C documentation @@ -165514,6 +165888,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 // // /* @@ -165546,7 +165934,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i 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(183430)) + return _sqlite3MisuseError(tls, int32(184509)) } 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) @@ -165589,7 +165977,7 @@ 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+24702, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165715,7 +166103,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+24765, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -165746,7 +166134,7 @@ 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) } @@ -165990,7 +166378,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(184046)) + return _sqlite3MisuseError(tls, int32(185125)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*uint8)(unsafe.Pointer(zDb)) != 0 { @@ -166000,7 +166388,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+24816, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -166122,7 +166510,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(184182))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185261))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -166254,7 +166642,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(184261)) + return _sqlite3MisuseError(tls, int32(185340)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -166264,7 +166652,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(184270)) + return _sqlite3MisuseError(tls, int32(185349)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -166313,7 +166701,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(184318)) + return _sqlite3MisuseError(tls, int32(185397)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -166322,7 +166710,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+24837, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -166469,7 +166857,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, 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+24905, 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 @@ -166499,8 +166887,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+24839, zUri+7, uint32(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+24911, zUri+7, uint32(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24921, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -166589,24 +166977,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, uint32(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24949, 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+24881, zOpt, uint32(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24953, 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 + 24881 + zModeType = __ccgo_ts + 24953 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24902, zOpt, uint32(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24974, 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 + 3473 + zModeType = __ccgo_ts + 3499 } if aMode != 0 { mode = 0 @@ -166635,12 +167023,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+24989, 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+25009, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -166664,7 +167052,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+25033, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -166684,11 +167072,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24887, + Fz: __ccgo_ts + 24959, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24894, + Fz: __ccgo_ts + 24966, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -166699,19 +167087,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24907, + Fz: __ccgo_ts + 24979, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24910, + Fz: __ccgo_ts + 24982, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24913, + Fz: __ccgo_ts + 24985, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17920, + Fz: __ccgo_ts + 17992, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -166839,8 +167227,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+22653, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25049, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -166861,10 +167249,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(184993)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186072)) /* 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+4, bp+8) } @@ -166873,7 +167261,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 + 3864 + v2 = __ccgo_ts + 3890 } else { v2 = uintptr(0) } @@ -166900,9 +167288,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*16))).FzDbSName = __ccgo_ts + 23979 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FzDbSName = __ccgo_ts + 24051 (*(*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 { @@ -166996,7 +167384,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 + 25055 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -167156,7 +167544,7 @@ 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) @@ -167213,20 +167601,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+25058, 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+25083) } 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+25103) } 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+25110) } // C documentation @@ -167251,9 +167639,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) @@ -167280,29 +167668,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 @@ -167357,15 +167734,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+25127, 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) @@ -167544,8 +167921,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 @@ -168385,7 +168762,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+25155, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -168603,7 +168980,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 + 25163 } else { v2 = uintptr(0) } @@ -168849,7 +169226,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 @@ -169066,6 +169443,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -169378,8 +169762,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 @@ -169436,7 +169820,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 @@ -169446,7 +169830,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 @@ -169484,18 +169868,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 + 25186, + 12: __ccgo_ts + 25192, 13: __ccgo_ts + 1667, 14: __ccgo_ts + 1667, 15: __ccgo_ts + 1667, @@ -169986,7 +170370,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) { @@ -170284,8 +170668,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 + 25127 + 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 + 25127 + 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) } } @@ -170421,7 +170805,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+64, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15507, 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)) @@ -170435,14 +170819,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+25144, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25199, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -170496,7 +170878,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+25228, -int32(1)) } } } @@ -170779,8 +171161,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(3), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25188, - FzRepl: __ccgo_ts + 25192, + FzMatch: __ccgo_ts + 25243, + FzRepl: __ccgo_ts + 25247, }, 1: { Fc1: uint8('i'), @@ -170788,8 +171170,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(8), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25200, - FzRepl: __ccgo_ts + 25192, + FzMatch: __ccgo_ts + 25255, + FzRepl: __ccgo_ts + 25247, }, 2: { Fc1: uint8('n'), @@ -170804,7 +171186,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: uint8('Q'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25209, + FzMatch: __ccgo_ts + 25264, FzRepl: __ccgo_ts + 1653, }, 4: { @@ -170812,7 +171194,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: uint8('S'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25214, + FzMatch: __ccgo_ts + 25269, FzRepl: __ccgo_ts + 1653, }, } @@ -170828,7 +171210,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+25274, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -170846,23 +171228,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 } @@ -170940,7 +171322,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 @@ -171011,7 +171393,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) + } } } } @@ -171286,7 +171672,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+25317, 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') { @@ -171716,7 +172102,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 { @@ -171755,7 +172141,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8077, 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)) } @@ -171763,7 +172149,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8082, 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)) } @@ -171840,14 +172226,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+25188, 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+25243, 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+25271) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25326) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25278) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25333) } - 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+25339, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -172032,7 +172418,7 @@ _38: goto _51 } if libc.Int32FromUint8(_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+25333) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -172077,7 +172463,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+25173, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25228, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -172090,7 +172476,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+25228, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -172139,10 +172525,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) @@ -172176,15 +172558,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 @@ -172257,11 +172639,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: ; @@ -172310,9 +172692,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25192 + v19 = __ccgo_ts + 25247 } else { - v19 = __ccgo_ts + 11944 + v19 = __ccgo_ts + 11969 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -172348,9 +172730,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: ; @@ -172377,7 +172762,7 @@ _11: sz2 -= k2 } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25290, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25345, uint32(2)) zIn2++ sz2-- continue @@ -172400,7 +172785,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, uint8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25293, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25348, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 25 @@ -172408,12 +172793,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25300, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25355, 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+25360, uint32(6)) case int32('\r'): if sz2 > uint32(2) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -172593,7 +172978,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+25367, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172616,12 +173001,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+25370, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25312, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25367, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172636,50 +173021,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 // // /* @@ -172731,6 +173072,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 // // /* @@ -172751,6 +173170,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)) @@ -172823,9 +173245,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 @@ -172868,7 +173290,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 @@ -173356,7 +173789,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+25228, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -173491,7 +173924,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 } @@ -173592,7 +174025,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+25228, -int32(1)) return } @@ -173629,11 +174062,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+25199, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -173646,7 +174076,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+25228, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint32(56)) return int32(1) @@ -173665,10 +174095,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+25278) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25333) } 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+25271) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25326) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -173707,7 +174137,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+25373, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -173723,7 +174153,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. // ** @@ -173804,7 +174234,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+25228, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -173816,34 +174246,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; +// ** 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. +// ** 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) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { + 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 (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) - return 0 + 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 (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - 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 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) @@ -173926,7 +174376,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 @@ -173986,7 +174436,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+25228, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -174121,7 +174571,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 + 25336 + v1 = __ccgo_ts + 25391 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -174131,7 +174581,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+25228, -int32(1)) } } eErr = uint8(1) @@ -174241,23 +174691,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+25338, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25393, uint32(1)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25340, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25395, 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 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+25342, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25397, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25345, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25400, uint32(1)) } } } @@ -174297,7 +174747,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+25228, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -174565,7 +175015,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+25228, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -174589,7 +175039,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+25402, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -174600,7 +175050,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+25398, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25453, -int32(1)) _jsonStringReset(tls, bp) return } @@ -174672,7 +175122,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+25228, -int32(1)) } } goto json_remove_done @@ -174709,7 +175159,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+16027) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -174740,9 +175190,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 + 25487 } else { - v1 = __ccgo_ts + 25436 + v1 = __ccgo_ts + 25491 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -174790,7 +175240,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+25228, -int32(1)) } } goto json_type_done @@ -174837,7 +175287,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 + 25443 + (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent = __ccgo_ts + 25498 (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FszIndent = libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent) @@ -174911,17 +175361,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+25448, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25503, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -174930,18 +175379,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 @@ -175003,9 +175451,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))) @@ -175112,7 +175558,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+25560, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -175204,20 +175650,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))) + } } } @@ -175261,7 +175709,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+25563, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -175368,7 +175816,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+25566) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(16)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -175502,7 +175950,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+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+40, __ccgo_ts+25649, 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 @@ -175528,9 +175976,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+25601, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+40, __ccgo_ts+25656, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+40, __ccgo_ts+25609, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+40, __ccgo_ts+25664, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -175841,9 +176289,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))) @@ -175916,7 +176363,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+25615, uint32(1)) + _jsonAppendRaw(tls, p+40, __ccgo_ts+25670, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+168, i, bp) @@ -175940,7 +176387,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+25228, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -176001,186 +176448,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 + 25672, }, 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 + 25622, + FzName: __ccgo_ts + 25677, }, 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 + 25683, }, 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 + 25639, + FzName: __ccgo_ts + 25694, }, 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 + 25706, }, 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 + 25706, }, 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 + 25724, }, 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 + 25744, }, 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 + 25702, + FzName: __ccgo_ts + 25757, }, 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 + 25716, + FzName: __ccgo_ts + 25771, }, 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 + 25719, + FzName: __ccgo_ts + 25774, }, 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 + 25778, }, 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 + 25735, + FzName: __ccgo_ts + 25790, }, 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 + 25803, }, 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 + 25760, + FzName: __ccgo_ts + 25815, }, 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 + 25828, }, 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 + 25784, + FzName: __ccgo_ts + 25839, }, 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 + 25851, }, 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 + 25851, }, 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 + 25863, }, 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 + 25874, }, 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 + 25831, + FzName: __ccgo_ts + 25886, }, 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 + 25899, }, 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 + 25857, + FzName: __ccgo_ts + 25912, }, 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 + 25871, + FzName: __ccgo_ts + 25926, }, 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 + 25880, + FzName: __ccgo_ts + 25935, }, 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 + 25945, }, 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 + 25945, }, 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 + 25955, }, 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 + 25955, }, 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 + 25966, }, 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 + 25928, + FzName: __ccgo_ts + 25983, }, 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 + 26001, }, 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 + 25964, + FzName: __ccgo_ts + 26019, }, } @@ -176263,17 +176710,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25983, + FzName: __ccgo_ts + 26038, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25993, + FzName: __ccgo_ts + 26048, 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 @@ -176386,13 +176835,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 @@ -176684,17 +177132,18 @@ type RtreeGeomCallback1 = TRtreeGeomCallback1 ** 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 + F__ccgo_align [0]uint32 + FiSize Tu32 + Fcb TRtreeGeomCallback + FnParam int32 + FapSqlParam uintptr + F__ccgo_pad5 [4]byte } 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 ** clang, since clang works hard to be gcc compatible. So the gcc @@ -176939,7 +177388,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+72) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26058, iNode, 0, pRtree+72) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -177244,7 +177693,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+26063, 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 { @@ -178161,7 +178610,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+26145) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -178470,7 +178919,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 } @@ -178478,7 +178927,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 @@ -178716,7 +179165,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: @@ -179651,7 +180100,7 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179668,7 +180117,7 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179696,7 +180145,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+26159, 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 { @@ -179706,11 +180155,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+26179, 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+26211, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -179924,7 +180373,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+26248, 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)) @@ -179978,9 +180427,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 + 26393 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+11798, 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) { @@ -180038,9 +180487,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 + 26449, + 1: __ccgo_ts + 5595, + 2: __ccgo_ts + 16922, } var _rtreeModule = Tsqlite3_module{ @@ -180084,21 +180533,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+26863, 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+26925, 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+26930, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26994, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27064, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -180128,7 +180577,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 + 27113 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -180143,31 +180592,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+27221, 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+27266, 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+13306, 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+27293, 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+27315, 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+27323, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -180181,14 +180630,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 + 26454, + 1: __ccgo_ts + 26507, + 2: __ccgo_ts + 26552, + 3: __ccgo_ts + 26604, + 4: __ccgo_ts + 26658, + 5: __ccgo_ts + 26703, + 6: __ccgo_ts + 26761, + 7: __ccgo_ts + 26816, } // C documentation @@ -180246,7 +180695,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+27339, 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) @@ -180254,17 +180703,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+27359, 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+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))) @@ -180341,13 +180790,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+27547, uint32(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27602, 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+27553, 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+27608, 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) { @@ -180356,7 +180805,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+27577, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27632, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -180370,19 +180819,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+27659, 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))) } } } @@ -180405,7 +180854,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)) @@ -180416,7 +180865,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+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 @@ -180432,8 +180881,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27583, - 1: __ccgo_ts + 27594, + 0: __ccgo_ts + 27638, + 1: __ccgo_ts + 27649, } // C documentation @@ -180491,21 +180940,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+11393, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11418, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27607, libc.VaList(bp+592, (*(*TRtreeCell)(unsafe.Pointer(bp + 536))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27662, 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+27613, libc.VaList(bp+592, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 536 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27668, 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+27617, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+27672, int32(1)) goto _1 _1: ; @@ -180532,7 +180981,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+27674, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -180635,7 +181084,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) @@ -180650,11 +181099,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+27707, 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) } @@ -180688,7 +181137,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+27714, 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) @@ -180705,7 +181154,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+27759, libc.VaList(bp+8, iNode)) } } return pRet @@ -180734,8 +181183,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 + 27791, + 1: __ccgo_ts + 27845, } 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)) @@ -180748,21 +181197,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 + 27893 } else { - v1 = __ccgo_ts + 27846 + v1 = __ccgo_ts + 27901 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27855, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27910, 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 + 27893 } else { - v2 = __ccgo_ts + 27846 + v2 = __ccgo_ts + 27901 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27900, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27955, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -180807,7 +181256,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+28013, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -180825,7 +181274,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+28061, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -180858,19 +181307,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+28128, 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+28162, 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+28192, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -180915,12 +181364,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+28247, 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+28278, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -180949,7 +181398,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+64, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28345, libc.VaList(bp+64, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -180959,11 +181408,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+64, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26159, 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+28318, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28373, 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)) @@ -180979,8 +181428,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+28404, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28411, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -181007,7 +181456,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+28419, 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) } @@ -181058,13 +181507,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+28438, -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*4))) } @@ -181073,7 +181522,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 + 18689 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -181540,19 +181989,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+25338, int32(1)) + Xsqlite3_str_append(tls, x, __ccgo_ts+25393, int32(1)) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28434, 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+28489, 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+28445, 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+28500, 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) } @@ -181581,20 +182030,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+28456, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28511, 0) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28474, 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+28529, 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+28482, 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+28537, 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) { @@ -181602,14 +182051,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+28490, libc.VaList(bp+8, z)) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28545, libc.VaList(bp+8, z)) } goto _2 _2: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28494, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28549, 0) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -181655,8 +182104,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 @@ -181688,13 +182137,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 } @@ -181774,16 +182223,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 } @@ -181830,9 +182279,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: ; @@ -182058,7 +182507,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 // ** @@ -182097,7 +182546,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) } @@ -182201,7 +182650,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 @@ -182291,7 +182740,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 @@ -182575,7 +183024,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) { @@ -182744,13 +183193,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+27547, uint32(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27602, 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+28507, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28562, 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) @@ -182759,13 +183208,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)*4)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28584, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27604, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27659, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -182773,7 +183222,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) @@ -182788,7 +183237,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+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 @@ -183000,7 +183449,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 + 16922 (*(*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) @@ -183010,7 +183459,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 + 28588 (*(*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) @@ -183018,7 +183467,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 + 28594 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -183138,7 +183587,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+28548, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28603, 0) } goto geopoly_update_end } @@ -183241,12 +183690,12 @@ geopoly_update_end: func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28588) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28643) == 0 { *(*uintptr)(unsafe.Pointer(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 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28659) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) @@ -183317,7 +183766,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+28836, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -183331,61 +183780,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28619, + FzName: __ccgo_ts + 28674, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28632, + FzName: __ccgo_ts + 28687, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28645, + FzName: __ccgo_ts + 28700, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28658, + FzName: __ccgo_ts + 28713, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28604, + FzName: __ccgo_ts + 28659, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28670, + FzName: __ccgo_ts + 28725, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28588, + FzName: __ccgo_ts + 28643, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28693, + FzName: __ccgo_ts + 28748, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28707, + FzName: __ccgo_ts + 28762, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28720, + FzName: __ccgo_ts + 28775, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28734, + FzName: __ccgo_ts + 28789, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28750, + FzName: __ccgo_ts + 28805, }, } @@ -183411,7 +183860,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28762, + FzName: __ccgo_ts + 28817, }, } @@ -183436,20 +183885,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+28844, 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+28854, 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+28865, -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+28588, 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+28876, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -183523,7 +183972,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) @@ -183551,7 +184000,7 @@ 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+26145, __ccgo_fp(_rtreeMatchArgFree)) } } } @@ -183792,7 +184241,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 @@ -184782,7 +185231,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+28886, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -184792,7 +185241,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+28886, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -184818,7 +185267,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 @@ -184841,7 +185290,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 } @@ -184973,7 +185422,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+36) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28907, uintptr(0), uintptr(0), p+36) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -185062,7 +185511,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+26003, zIn, uint32(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+26058, 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')) { @@ -185099,13 +185548,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 + 29023 + v1 = __ccgo_ts + 29078 } else { v1 = __ccgo_ts + 1667 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29064, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29119, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+4, p+36, __ccgo_ts+29214) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+4, p+36, __ccgo_ts+29269) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -185272,7 +185721,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))) } } @@ -185333,7 +185782,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+29339, 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+29394, 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 @@ -185343,7 +185792,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+29458, 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+29513, libc.VaList(bp+24, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -185351,7 +185800,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+29479, 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+29534, 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) @@ -185363,7 +185812,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+29530, 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+29585, 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 { @@ -185407,7 +185856,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+29551, 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+29606, 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))) { @@ -185420,7 +185869,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+29579, 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+29634, 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 { @@ -185473,7 +185922,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+20125, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20197, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -185484,7 +185933,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+29608, 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+29663, 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) @@ -185495,7 +185944,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+29682, 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 @@ -185503,7 +185952,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+29632, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29687, zName) { bRbuRowid = int32(1) } } @@ -185517,17 +185966,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 + 29697 } else { - v4 = __ccgo_ts + 29655 + v4 = __ccgo_ts + 29710 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29664, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29719, 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+29693, 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+29748, 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)) @@ -185549,7 +185998,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+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29770, 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)) @@ -185595,8 +186044,8 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+29742, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15149 + zList = _rbuMPrintf(tls, p, __ccgo_ts+29797, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15174 goto _1 _1: ; @@ -185630,7 +186079,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+29751, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29806, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -185678,21 +186127,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+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+36, Xsqlite3_mprintf(tls, __ccgo_ts+29819, 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+29851, 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+15174, __ccgo_ts+29874) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29880, __ccgo_ts+29887, __ccgo_ts+5201) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15174, __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+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+36, Xsqlite3_mprintf(tls, __ccgo_ts+29895, 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+29937, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -185744,7 +186193,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+36, Xsqlite3_mprintf(tls, __ccgo_ts+29579, 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+29634, 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)) @@ -185766,15 +186215,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 + 29902 + zCol = __ccgo_ts + 29957 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*4)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29910, libc.VaList(bp+16, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29931, libc.VaList(bp+16, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29967, libc.VaList(bp+16, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15149 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29965, libc.VaList(bp+16, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29986, libc.VaList(bp+16, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30022, libc.VaList(bp+16, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15174 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -185783,7 +186232,7 @@ 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+29994, 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+30049, 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 + 1667 iCol = 0 @@ -185800,15 +186249,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+30042, libc.VaList(bp+16, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15149 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30097, libc.VaList(bp+16, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15174 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30049, libc.VaList(bp+16, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30104, libc.VaList(bp+16, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -185866,7 +186315,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+36, 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+36, Xsqlite3_mprintf(tls, __ccgo_ts+29634, 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)) @@ -185875,7 +186324,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)*8))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FzSpan, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30116, 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 { @@ -185895,9 +186344,9 @@ 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 + 29902 + zCol = __ccgo_ts + 29957 } else { - zCol = __ccgo_ts + 29632 + zCol = __ccgo_ts + 29687 } } zType = __ccgo_ts + 1141 @@ -185905,24 +186354,24 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter 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+30083, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30138, 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 + 29874 } 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+30158, 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+30179, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30212, 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 + 15174 + zAnd = __ccgo_ts + 22306 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185976,11 +186425,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+30181, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30236, 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+30248, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15149 + zS = __ccgo_ts + 15174 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -185992,7 +186441,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+30257, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -186018,7 +186467,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+30272, 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 @@ -186028,15 +186477,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+30286, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22306 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30243, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30298, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1667 i1 = 0 @@ -186046,8 +186495,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+30293, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22234 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30348, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22306 } goto _2 _2: @@ -186070,7 +186519,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+30361, 0) } // C documentation @@ -186112,16 +186561,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+30293, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) - zSep = __ccgo_ts + 15149 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30348, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) + zSep = __ccgo_ts + 15174 } else { if libc.Int32FromUint8(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)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) - zSep = __ccgo_ts + 15149 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30387, 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 + 15174 } else { if libc.Int32FromUint8(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)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) - zSep = __ccgo_ts + 15149 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30417, 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 + 15174 } } } @@ -186205,16 +186654,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 + 30454 *(*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+29551, 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+29606, 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+16738) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16810) == 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+29579, 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+29634, libc.VaList(bp+16, zIdx))) } break } @@ -186225,16 +186674,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 + 29819 + v1 = __ccgo_ts + 29874 } else { v1 = __ccgo_ts + 1667 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30412, libc.VaList(bp+16, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15149 + z = _rbuMPrintf(tls, p, __ccgo_ts+30467, libc.VaList(bp+16, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15174 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30423, libc.VaList(bp+16, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30478, libc.VaList(bp+16, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) } return z @@ -186280,7 +186729,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+36, __ccgo_ts+30427) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+30482) 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))) { @@ -186288,7 +186737,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+29579, 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+29634, 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))) { @@ -186297,21 +186746,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+30477, 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+30532, 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 + 29819 + v1 = __ccgo_ts + 29874 } else { v1 = __ccgo_ts + 1667 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30499, libc.VaList(bp+16, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15149 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30554, libc.VaList(bp+16, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15174 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30509, libc.VaList(bp+16, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30564, 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+6715, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30524, 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+6715, 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+30579, 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)) } } @@ -186348,7 +186797,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) { @@ -186357,19 +186806,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)*4)) *(*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 + 30641 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30599 + v2 = __ccgo_ts + 30654 } 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)*4)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 15149 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30664, 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 + 15174 goto _1 _1: ; @@ -186378,17 +186827,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+30691, 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 + 30698 } 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+30713, 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)) } } @@ -186414,7 +186863,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+30690, 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+30745, libc.VaList(bp+8, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -186460,7 +186909,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+30747) + *(*int32)(unsafe.Pointer(bp + 4)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+30802) } 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)) @@ -186629,7 +187078,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+24, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30868, libc.VaList(bp+24, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -186646,18 +187095,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+6715, 0, int32(1))) - 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+30833, 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+6715, 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+30888, 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+30898, 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+30953, 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+30934, 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+30989, 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 { @@ -186672,26 +187121,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 + 31023 } else { - v2 = __ccgo_ts + 30972 + v2 = __ccgo_ts + 31027 } v1 = v2 } else { v1 = __ccgo_ts + 1667 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30978, libc.VaList(bp+24, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31033, 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+31039, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31094, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 30968 + v3 = __ccgo_ts + 31023 } else { - v3 = __ccgo_ts + 30972 + v3 = __ccgo_ts + 31027 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31100, 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+31155, 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 { @@ -186710,8 +187159,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). */ @@ -186720,39 +187169,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 + 31314 } 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 + 31323 } else { v5 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31278, 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+31333, 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+31314, 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+31369, 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 + 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 + 31397 } /* 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 + 31409 } else { v6 = __ccgo_ts + 1667 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31371, 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+31447, libc.VaList(bp+24, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31426, 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+31502, 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+31746, libc.VaList(bp+24, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31801, libc.VaList(bp+24, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -186763,9 +187212,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 + 31900 } else { - v7 = __ccgo_ts + 31855 + v7 = __ccgo_ts + 31910 } zRbuRowid1 = v7 } @@ -186778,14 +187227,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+29957, 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+15174, __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 + 31921 } else { v8 = __ccgo_ts + 1667 } @@ -186795,11 +187244,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 + 23562 } else { v10 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+76, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31872, 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+31927, libc.VaList(bp+24, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -186887,9 +187336,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 + 31314 } - 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+31975, 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 } @@ -186916,7 +187365,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) } @@ -186963,7 +187412,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+31950, 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+32005, 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): @@ -187022,27 +187471,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+32035, 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+24, __ccgo_ts+3487, uint32(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32063, 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+6715, 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+32026, libc.VaList(bp+8, p+24)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32081, 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+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 } @@ -187075,10 +187524,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+32147, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24833, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint32(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24905, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint32(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*uint8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -187094,14 +187543,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 + 32179 } 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+32181, 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 @@ -187112,27 +187561,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+32213, -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+32228, 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+32245, -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+32261, 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+32289, 0) } } @@ -187218,7 +187667,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { if pState == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32206, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32261, uintptr(0), uintptr(0), uintptr(0)) } } /* Assuming no error has occurred, run a "restart" checkpoint with the @@ -187251,7 +187700,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CAPTURE) - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32252, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32307, uintptr(0), uintptr(0), uintptr(0)) if rc2 != int32(SQLITE_NOTICE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -187384,16 +187833,16 @@ 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) + 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_methods1)(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) } - 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)) @@ -187415,7 +187864,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+32342, 0) } // C documentation @@ -187432,13 +187881,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+32367, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32374, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -187570,7 +188019,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+24462, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -187706,7 +188155,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+32326) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+36, __ccgo_ts+32381) 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 @@ -187719,7 +188168,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+32403, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -187746,7 +188195,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+32375, 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+32430, 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))) @@ -187782,9 +188231,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+32535, 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+32590, 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+32605, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -187807,9 +188256,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+32570, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32625, 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+32595) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32650) } 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) @@ -187820,10 +188269,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+32703) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32758) } 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+32768) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, __ccgo_ts+32823) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -187841,7 +188290,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+32812, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32867, uintptr(0), uintptr(0), p+36) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -187868,8 +188317,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+17895) + _rbuCopyPragma(tls, p, __ccgo_ts+17006) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -187877,7 +188326,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+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32892, libc.VaList(bp+16, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -187899,10 +188348,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+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15078, 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+15053, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15078, uintptr(0), uintptr(0), p+36) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -187989,7 +188438,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+32920, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -188012,10 +188461,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+32367, 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) } @@ -188037,7 +188486,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+32890, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32945, 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) @@ -188084,7 +188533,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+32901, libc.VaList(bp+16, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+32956, 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 { @@ -188129,11 +188578,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+33028, 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+32987) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+33042) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -188142,7 +188591,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+33044) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+33099) 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) @@ -188190,7 +188639,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+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 @@ -188222,7 +188671,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+33173, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -188244,17 +188693,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 + 33205 } else { - v3 = __ccgo_ts + 33157 + v3 = __ccgo_ts + 33212 } - (*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+33219, 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+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15063, 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) @@ -188266,21 +188715,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+17609) + _rbuCopyPragma(tls, p, __ccgo_ts+17021) } /* 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+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33251, 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+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+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33267, uintptr(0), uintptr(0), p+36) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -188358,7 +188807,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+33236, zState+uintptr(n-uint32(7)), uint32(7)) { + if n >= uint32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33291, zState+uintptr(n-uint32(7)), uint32(7)) { return _rbuMisuseError(tls) } } @@ -188405,7 +188854,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+31259, uint32(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31314, 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++ @@ -188433,7 +188882,7 @@ 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+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15078, 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) { @@ -188442,7 +188891,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { } _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+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15078, uintptr(0), uintptr(0), p+36) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+56) @@ -188452,7 +188901,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+33299, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -188553,7 +189002,7 @@ 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+15078, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ @@ -188566,19 +189015,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { 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+15078, 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 + 15063 } else { - v1 = __ccgo_ts + 33196 + v1 = __ccgo_ts + 33251 } 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+33251, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -189064,7 +189513,7 @@ func _rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileSize})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, pSize) /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existence of a *-wal file. rbuVfsRead() contains ** similar logic. */ if rc == SQLITE_OK && *(*Tsqlite_int64)(unsafe.Pointer(pSize)) == 0 && (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpRbu)).FzTarget == uintptr(0) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_MAIN_DB) != 0 { *(*Tsqlite_int64)(unsafe.Pointer(pSize)) = int64(1024) @@ -189145,7 +189594,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xControl})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, int32(SQLITE_FCNTL_ZIPVFS), bp) if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33271, 0) + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33326, 0) } else { if rc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p @@ -189171,7 +189620,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r if rc == SQLITE_OK && op == int32(SQLITE_FCNTL_VFSNAME) { pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs zIn = *(*uintptr)(unsafe.Pointer(pArg)) - zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33294, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33349, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -189366,7 +189815,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag if pDb != 0 { if (*Trbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == int32(RBU_STAGE_OAL) { if (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) { - zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6715) + zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6740) zOpen = Xsqlite3_filename_wal(tls, zOpen) } nOpen = libc.Xstrlen(tls, zOpen) @@ -189380,7 +189829,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag } else { (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu } - if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33305, 0) != 0 { + if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33360, 0) != 0 { oflags = libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) } @@ -189938,7 +190387,7 @@ func _statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint _sqlite3TokenInit(tls, bp, *(*uintptr)(unsafe.Pointer(argv + 3*4))) iDb = _sqlite3FindDb(tls, db, bp) if iDb < 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12382, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + 3*4)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12407, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + 3*4)))) return int32(SQLITE_ERROR) } } else { @@ -190438,7 +190887,7 @@ statNextRestart: (*(*TStatPage)(unsafe.Pointer(pCsr + 16))).FiPgno = iRoot (*(*TStatPage)(unsafe.Pointer(pCsr + 16))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33316, 0) + v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33371, 0) z = v1 (*(*TStatPage)(unsafe.Pointer(pCsr + 16))).FzPath = v1 if z == uintptr(0) { @@ -190476,8 +190925,8 @@ statNextRestart: if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { (*TStatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33318 - v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33327, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33373 + v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33382, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) z = v2 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v2 if z == uintptr(0) { @@ -190506,7 +190955,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage++ if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= libc.Int32FromUint32(libc.Uint32FromInt64(1280)/libc.Uint32FromInt64(40)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226029)) + return _sqlite3CorruptError(tls, int32(227304)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*40))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -190517,7 +190966,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+33339, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33394, 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) { @@ -190540,13 +190989,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 + 33402 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 + 33411 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33361 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33416 break } *(*int32)(unsafe.Pointer(pCsr + 1320)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -190555,7 +191004,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) { @@ -190644,12 +191093,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)*16))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33426, 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+33526, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33581, 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+33595, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -190726,7 +191175,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+33610, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -192021,11 +192470,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+11798, 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+33617, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1667, 0) @@ -192034,7 +192483,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+33747, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -192060,7 +192509,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte += libc.Int64FromUint32(libc.Xstrlen(tls, __ccgo_ts+29902)) + nByte += libc.Int64FromUint32(libc.Xstrlen(tls, __ccgo_ts+29957)) 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))) @@ -192084,8 +192533,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+uint32(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+29957) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29957, nName+uint32(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)) = pAlloc pAlloc += uintptr(nName + uint32(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -192149,7 +192598,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 @@ -192166,6 +192615,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 { @@ -192187,7 +192638,7 @@ 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+11798, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { @@ -192481,10 +192932,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 + 11393 + zSep = __ccgo_ts + 11418 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+33722, 0) + _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+33777, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -192496,8 +192947,8 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin v2 = __ccgo_ts + 1668 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+5145, libc.VaList(bp+24, zSep, zDflt)) - zSep = __ccgo_ts + 15149 + _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+5171, libc.VaList(bp+24, zSep, zDflt)) + zSep = __ccgo_ts + 15174 goto _1 _1: ; @@ -193151,8 +193602,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)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) - zSep = __ccgo_ts + 22234 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33784, 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 + 22306 if zRet == uintptr(0) { break } @@ -193181,8 +193632,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)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) - zSep = __ccgo_ts + 33804 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33818, 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 + 33859 if zRet == uintptr(0) { break } @@ -193193,7 +193644,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 } @@ -193204,12 +193655,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 + 33864 } 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+33875, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -193270,11 +193721,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15149 + v2 = __ccgo_ts + 15174 } 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)*4)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33954, 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 } @@ -193302,7 +193753,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+33973, 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 { @@ -193331,17 +193782,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)) @@ -193354,7 +193806,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 } @@ -193365,18 +193819,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+34030, 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+34061, libc.VaList(bp+48, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -193402,7 +193882,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+33975, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34082, 0) } rc = int32(SQLITE_SCHEMA) } @@ -193734,7 +194214,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+5207, 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) } @@ -194034,12 +194514,12 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt *(*TSessionBuffer)(unsafe.Pointer(bp + 16)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 28)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+16, __ccgo_ts+34002, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11773, zTab) { - _sessionAppendStr(tls, bp+16, __ccgo_ts+34006, bp) - _sessionAppendStr(tls, bp+28, __ccgo_ts+34030, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+34039, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34084, bp) + _sessionAppendStr(tls, bp+16, __ccgo_ts+34109, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11798, zTab) { + _sessionAppendStr(tls, bp+16, __ccgo_ts+34113, bp) + _sessionAppendStr(tls, bp+28, __ccgo_ts+34137, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34146, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34191, bp) } else { i = 0 for { @@ -194047,17 +194527,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+15149, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+15174, 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 + 15149 + zSep = __ccgo_ts + 15174 _sessionAppendIdent(tls, bp+28, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), bp) - _sessionAppendPrintf(tls, bp+40, bp, __ccgo_ts+34098, libc.VaList(bp+64, i+int32(1))) + _sessionAppendPrintf(tls, bp+40, bp, __ccgo_ts+34205, libc.VaList(bp+64, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+16, bp, __ccgo_ts+34102, 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+34209, libc.VaList(bp+64, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) } goto _1 _1: @@ -194071,7 +194551,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+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+34236, 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) } @@ -194213,7 +194693,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, 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+34171, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 12)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34278, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 12)) } @@ -194319,7 +194799,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } } 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+34298, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 12)) } @@ -194574,13 +195054,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 } } @@ -194736,7 +195217,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(230285)) + rc = _sqlite3CorruptError(tls, int32(231591)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -194760,7 +195241,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(230305)) + rc = _sqlite3CorruptError(tls, int32(231611)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -194775,7 +195256,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(230315)) + rc = _sqlite3CorruptError(tls, int32(231621)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -194831,7 +195312,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(230363)) + rc = _sqlite3CorruptError(tls, int32(231669)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -194936,7 +195417,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(230451)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231757)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -195007,8 +195488,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) @@ -195042,7 +195523,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(230537)) + v7 = _sqlite3CorruptError(tls, int32(231843)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -195052,7 +195533,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(230543)) + v10 = _sqlite3CorruptError(tls, int32(231849)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -195131,7 +195612,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(230587)) + v16 = _sqlite3CorruptError(tls, int32(231893)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -195541,7 +196022,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230952)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232258)) goto finished_invert } if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf >= _sessions_strm_chunk_size { @@ -195744,7 +196225,7 @@ 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+11773) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11798) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -195753,9 +196234,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 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+34209, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34316, bp) _sessionAppendIdent(tls, bp+4, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34222, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34329, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -195765,9 +196246,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+34228, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34335, bp) _sessionAppendInteger(tls, bp+4, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15149 + zSep = __ccgo_ts + 15174 } goto _2 _2: @@ -195776,7 +196257,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+4, __ccgo_ts+34233, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34340, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -195785,13 +196266,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+34241, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34348, bp) } else { _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34316, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34423, bp) _sessionAppendInteger(tls, bp+4, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22234 + zSep = __ccgo_ts + 22306 } goto _3 _3: @@ -195878,9 +196359,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 4)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+4, __ccgo_ts+34322, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34429, bp) _sessionAppendIdent(tls, bp+4, zTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34233, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34340, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -195890,9 +196371,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+34228, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34335, bp) _sessionAppendInteger(tls, bp+4, i+int32(1), bp) - zSep = __ccgo_ts + 22234 + zSep = __ccgo_ts + 22306 } goto _1 _1: @@ -195900,9 +196381,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+4, __ccgo_ts+34340, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34447, bp) _sessionAppendInteger(tls, bp+4, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+33804, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+33859, bp) zSep = __ccgo_ts + 1667 i = 0 for { @@ -195912,16 +196393,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+34316, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34423, bp) _sessionAppendInteger(tls, bp+4, i+int32(1), bp) - zSep = __ccgo_ts + 34348 + zSep = __ccgo_ts + 34455 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+5175, 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)) @@ -195947,7 +196428,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+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 @@ -195970,16 +196451,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+34353, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34460, bp) _sessionAppendIdent(tls, bp+4, zTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+22240, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+22312, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+4, __ccgo_ts+15149, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+15174, bp) } _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp) goto _1 @@ -195987,19 +196468,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+34371, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34478, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+4, __ccgo_ts+34382, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34489, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+5175, 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)) } @@ -196022,12 +196503,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+11798, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34386) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34493) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+4, __ccgo_ts+34499) + rc = _sessionPrepare(tls, db, p+4, __ccgo_ts+34606) } return rc } @@ -196093,7 +196574,7 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231434)) + rc = _sqlite3CorruptError(tls, int32(232740)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -196509,7 +196990,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+34750, 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)) @@ -196522,7 +197003,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+34771, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -196622,10 +197103,10 @@ 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+34683, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34790, 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+34816, 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)) @@ -196656,7 +197137,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui ** 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)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, 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 @@ -196666,7 +197147,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+6715, *(*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 } @@ -196685,18 +197166,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+34739, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34846, 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+34783, 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+34890, 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+34854, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34961, 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+11773) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11798) { v2 = _sessionStat1Sql(tls, db, bp+4) rc = v2 if v2 != 0 { @@ -196753,17 +197234,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34914, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35021, 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+35051, 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+35075, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35051, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FbRebase != 0 { @@ -197539,7 +198020,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 { @@ -197575,11 +198056,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 @@ -198164,6 +198651,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 @@ -198211,8 +198699,7 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset @@ -198224,12 +198711,13 @@ type Fts5Colset = TFts5Colset ** This object is used by fts5_expr.c and fts5_index.c. */ type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 + FnCol 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 ** to parse the arguments passed to the CREATE VIRTUAL TABLE statement. @@ -198624,8 +199112,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr - F__ccgo_pad9 [4]byte } type Fts5ExprNode = TFts5ExprNode @@ -198653,16 +199139,14 @@ 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 @@ -198705,7 +199189,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 @@ -199509,7 +199993,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+35103, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -199865,7 +200349,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+35131, 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 */ } @@ -200149,7 +200633,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+35055, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35162, 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) } @@ -200248,7 +200732,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 + 35062 + zErr = __ccgo_ts + 35169 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200503,7 +200987,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 + 35112 + zErr = __ccgo_ts + 35219 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200778,7 +201262,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))) @@ -200870,13 +201354,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) } @@ -200902,13 +201386,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 + 35160 + z = __ccgo_ts + 35267 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 + 35323 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -200941,19 +201425,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35274, + FzFunc: __ccgo_ts + 35381, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35282, + FzFunc: __ccgo_ts + 35389, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35292, + FzFunc: __ccgo_ts + 35399, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35297, + FzFunc: __ccgo_ts + 35404, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -201341,7 +201825,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 @@ -201817,7 +202301,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+35313, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35420, 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) { @@ -201843,12 +202327,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+35320, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35427, 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+48, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35458, libc.VaList(bp+48, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201857,7 +202341,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+35491, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201867,14 +202351,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+35528, 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+35430, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35537, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -201901,7 +202385,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+35570, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -201913,76 +202397,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+35604, 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+35612, 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+35537, libc.VaList(bp+48, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35644, 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+35543, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35650, 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+35562, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35669, 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+35605, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35712, 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+35562, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35669, 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+35627, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35734, 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+35748, 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+35786, 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+35690, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35797, 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+35725, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35832, 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+35732, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35839, 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+5584, 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 + 8409, + FzName: __ccgo_ts + 8434, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 17903, + FzName: __ccgo_ts + 17975, }, 2: { - FzName: __ccgo_ts + 35763, + FzName: __ccgo_ts + 35870, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -201990,20 +202474,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+35771, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35878, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35802, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35909, 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+35812, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35919, 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+35846, libc.VaList(bp+48, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35953, libc.VaList(bp+48, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -202064,16 +202548,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+35981) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16922) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35986, 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+36016) { *(*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+36026, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -202099,7 +202583,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+35950, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36057, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -202107,12 +202591,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+35955, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36062, 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+35962, libc.VaList(bp+24, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36069, libc.VaList(bp+24, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35970, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36077, 0) } } goto _1 @@ -202128,9 +202612,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+35977, libc.VaList(bp+24, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36084, libc.VaList(bp+24, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35970, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36077, 0) } goto _2 _2: @@ -202193,8 +202677,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+35874) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35985, 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+35981) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36092, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -202225,7 +202709,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+32, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36121, libc.VaList(bp+32, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -202255,7 +202739,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+36141, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -202263,37 +202747,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+36191, 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+36246, 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 + 35604 } 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 + 35604 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36192 + zTail = __ccgo_ts + 36299 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36200, 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+36307, 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+16850, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16922, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -202362,7 +202846,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+36318, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -202371,16 +202855,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 + 15174 } 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)*4)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36334, 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+36234, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35874)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36341, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35981)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -202538,7 +203022,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+36260) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36367) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -202549,7 +203033,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+36372) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -202560,7 +203044,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+36381) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -202574,7 +203058,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+36391) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -202585,7 +203069,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+36401) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -202602,7 +203086,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+36413) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -202617,7 +203101,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+35981) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+4) if rc == SQLITE_OK { @@ -202632,7 +203116,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+36425) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -202648,7 +203132,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+36439) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -202691,7 +203175,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 + 36342 + zSelect = __ccgo_ts + 36449 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 4)) = SQLITE_OK iVersion = 0 @@ -202711,7 +203195,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+36481) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 8)) = 0 @@ -202722,7 +203206,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+36382, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36489, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -202828,12 +203312,12 @@ type TFts5ExprNode1 = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr - F__ccgo_pad9 [4]byte } type Fts5ExprNode1 = TFts5ExprNode1 +/* Size (in bytes) of an Fts5ExprNode object that holds up to N children */ + /* ** 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. @@ -202863,24 +203347,26 @@ type TFts5ExprPhrase1 = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase1 = TFts5ExprPhrase1 +/* Size (in bytes) of an Fts5ExprPhrase object that holds up to N terms */ + /* ** 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 + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset1 = TFts5ExprNearset1 +/* Size (in bytes) of an Fts5ExprNearset object covering up to N phrases */ + /* ** Parse context. */ @@ -202971,7 +203457,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+36453, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36560, 0) return FTS5_EOF } goto _1 @@ -202982,7 +203468,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+36473, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36580, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -202997,13 +203483,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+36504, uint32(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36611, 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+36507, uint32(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36614, 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+30968, uint32(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31023, uint32(3)) == 0 { tok = int32(FTS5_AND) } break @@ -203047,7 +203533,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) @@ -204694,7 +205180,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) @@ -204704,7 +205190,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) @@ -204810,12 +205296,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 @@ -204949,7 +205435,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) @@ -204989,15 +205475,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)) @@ -205038,7 +205524,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 { @@ -205076,8 +205562,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, uint32(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+36618, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint32(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35131, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -205097,10 +205583,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+36516, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36623, 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: ; @@ -205134,7 +205623,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 { @@ -205184,7 +205673,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 @@ -205235,7 +205724,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+21309, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -205262,7 +205751,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)) @@ -205359,7 +205848,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+36652, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -205444,7 +205933,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) @@ -205457,7 +205946,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) @@ -205531,7 +206020,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 @@ -205557,11 +206046,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 + 36598 + v2 = __ccgo_ts + 36705 } else { - v2 = __ccgo_ts + 36511 + v2 = __ccgo_ts + 36618 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36605, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36712, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -205574,7 +206063,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+36762, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -206054,7 +206543,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) { @@ -206119,7 +206608,7 @@ 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 +** to accumulate "term -> doclist" content before it is flushed to a level-0 ** segment. */ @@ -206179,7 +206668,7 @@ type TFts5HashEntry1 = struct { type Fts5HashEntry1 = TFts5HashEntry1 /* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -207064,7 +207553,6 @@ type TFts5DlidxIter = struct { F__ccgo_align [0]uint32 FnLvl int32 FiSegid int32 - FaLvl [1]TFts5DlidxLvl } type Fts5DlidxIter = TFts5DlidxIter @@ -207107,8 +207595,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 @@ -207192,8 +207679,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel - F__ccgo_pad6 [4]byte } type Fts5Structure = TFts5Structure @@ -207231,7 +207716,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -207247,9 +207731,8 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray @@ -207358,12 +207841,12 @@ type TFts5Structure1 = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel - F__ccgo_pad6 [4]byte } type Fts5Structure1 = TFts5Structure1 +/* Size (in bytes) of an Fts5Structure object holding up to N levels */ + /* ** An object of type Fts5SegWriter is used to write to segments. */ @@ -207504,13 +207987,14 @@ type Fts5SegIter1 = TFts5SegIter1 ** Array of tombstone pages. Reference counted. */ type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray1 = TFts5TombstoneArray1 +/* Size (in bytes) of an Fts5TombstoneArray holding up to N tombstones */ + /* ** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. @@ -207565,12 +208049,13 @@ type TFts5Iter1 = struct { F__ccgo_align9 [3]byte FiSwitchRowid Ti64 FaFirst uintptr - F__ccgo_align11 [4]byte - FaSeg [1]TFts5SegIter + F__ccgo_pad12 [4]byte } type Fts5Iter1 = TFts5Iter1 +/* Size (in bytes) of an Fts5Iter object holding up to N segment iterators */ + /* ** An instance of the following type is used to iterate through the contents ** of a doclist-index record. @@ -207601,11 +208086,12 @@ 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)) *(*Tu8)(unsafe.Pointer(aOut + 1)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) & libc.Int32FromInt32(0xFF)) @@ -207784,7 +208270,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+52) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36815, 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. @@ -207889,7 +208375,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+36714, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+56, Xsqlite3_mprintf(tls, __ccgo_ts+36821, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -207918,7 +208404,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+36872, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+60, zSql) != 0 { return } @@ -207952,7 +208438,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+36814, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+68, Xsqlite3_mprintf(tls, __ccgo_ts+36921, 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) @@ -208030,7 +208516,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)) @@ -208121,7 +208607,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, uint32(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36961, uint32(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -208132,7 +208618,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, uint32(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36961, 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)) @@ -208813,7 +209299,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) @@ -209063,7 +209549,7 @@ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _ = nByte, nTomb, pNew nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone if nTomb > 0 { - nByte = libc.Int32FromUint32(libc.Uint32FromInt32(nTomb)*uint32(4) + uint32(12)) + nByte = libc.Int32FromUint32(uint32(libc.UintptrFromInt32(0)+8) + libc.Uint32FromInt32(nTomb+libc.Int32FromInt32(1))*libc.Uint32FromInt64(4)) pNew = _sqlite3Fts5MallocZero(tls, p+44, int64(nByte)) if pNew != 0 { (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb @@ -209773,7 +210259,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+36882, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+72, Xsqlite3_mprintf(tls, __ccgo_ts+36989, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -209862,7 +210348,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+36966, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+76, Xsqlite3_mprintf(tls, __ccgo_ts+37073, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -210509,7 +210995,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 @@ -211832,7 +212318,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+37048, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+37155, 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. */ @@ -212342,7 +212828,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+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+84, Xsqlite3_mprintf(tls, __ccgo_ts+37212, 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) @@ -212511,7 +212997,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 } @@ -212829,7 +213315,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+37166, 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+37273, 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))) @@ -213104,7 +213590,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: @@ -213139,7 +213625,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)) @@ -213758,11 +214244,12 @@ type TFts5TokenDataIter1 = struct { 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 // // /* @@ -213830,7 +214317,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) { @@ -214078,7 +214565,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) @@ -214128,7 +214615,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 @@ -214210,15 +214697,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+1667, 0) - _fts5StructureWrite(tls, p, bp) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -214244,11 +214734,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+37324, 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+26058, __ccgo_ts+37332, 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+12009, __ccgo_ts+37367, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -214446,7 +214936,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) @@ -214701,7 +215191,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+37304) + _sqlite3Fts5BufferAppendBlob(tls, p+44, bp, uint32(1), __ccgo_ts+37411) } else { _sqlite3Fts5BufferSet(tls, p+44, bp, nToken, pToken) } @@ -215052,7 +215542,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') @@ -215174,7 +215664,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 { @@ -215294,7 +215784,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+36708, 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+36815, 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))) @@ -215888,7 +216378,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+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+37413, 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)) @@ -216119,7 +216609,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+37392) + _sqlite3Fts5BufferAppendBlob(tls, p+44, bp, uint32(4), __ccgo_ts+37499) 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)) @@ -216262,8 +216752,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 - F__ccgo_pad5 [4]byte } type Fts5Sorter = TFts5Sorter @@ -216424,12 +216912,12 @@ type TFts5Sorter1 = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 - F__ccgo_pad5 [4]byte } type Fts5Sorter1 = TFts5Sorter1 +/* Size (int bytes) of an Fts5Sorter object with N indexes */ + /* ** Virtual-table cursor object. ** @@ -216753,7 +217241,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+37504, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -216790,7 +217278,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+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++ @@ -216809,7 +217297,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+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 @@ -217259,7 +217747,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+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 @@ -217287,7 +217775,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) } @@ -217307,7 +217795,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) @@ -217322,7 +217810,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 + 15174 } else { v1 = __ccgo_ts + 1667 } @@ -217332,11 +217820,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 + 37543 } else { - v3 = __ccgo_ts + 37441 + v3 = __ccgo_ts + 37548 } - 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+37552, 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 @@ -217394,14 +217882,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+37607, 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+37613, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -217451,7 +217939,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+16, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37641, 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)) @@ -217484,7 +217972,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+16, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37651, libc.VaList(bp+16, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -217518,7 +218006,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+37565, libc.VaList(bp+16, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37672, libc.VaList(bp+16, z)) } } } else { @@ -217526,7 +218014,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 + 35399 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -217683,7 +218171,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+37598, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 4)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37705, 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))) } @@ -217883,7 +218371,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+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37710, 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 @@ -218016,10 +218504,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. @@ -220557,12 +221045,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+39059, 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+39163, 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+39201, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -220571,7 +221059,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+39239, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -220583,14 +221071,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+26058, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12009, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38393, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36192, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36299, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35497, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35604, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -220610,13 +221098,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 + 30698 } 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+39281, 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+39311, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -220657,7 +221145,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+39355, 0) iOff = libc.Int32FromUint32(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -220665,7 +221153,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+39378, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -220680,7 +221168,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+39384, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -220689,22 +221177,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+35604, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39283 + zCols = __ccgo_ts + 39390 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39315 + zCols = __ccgo_ts + 39422 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36192, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36299, 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+38393, __ccgo_ts+39470, 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+36481, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -221124,12 +221612,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+39487, 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+39537, 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+39566, 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. */ @@ -221137,7 +221625,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+36481, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -221439,7 +221927,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+39595, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -221673,14 +222161,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+35497, bp+56) + rc = _fts5StorageCount(tls, p, __ccgo_ts+35604, 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)) @@ -222885,64 +223373,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+39590, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39697, 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+39593, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39700, 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+39598, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39705, 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+39603, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39710, 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+39606, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39713, 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+39609, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39716, 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+39614, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39721, 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+39619, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39726, 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+39623, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39730, 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+39629, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39736, 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+39634, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39741, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222951,49 +223439,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)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39745, 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+39642, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39749, 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+39645, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39752, 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+39649, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39756, 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+39653, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39760, 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+39657, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39764, 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+39661, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39768, 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+39665, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39772, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -223010,20 +223498,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+39669, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39649, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39776, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39756, 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+39672, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39675, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39779, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39782, 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+39679, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39665, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39786, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39772, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -223039,75 +223527,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+39682, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39789, 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+39649, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39756, uint32(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)), uint32(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39797, 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+39697, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39804, uint32(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)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39809, 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+39598, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39705, uint32(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)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39814, 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+39593, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39700, uint32(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)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39819, 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+39665, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39772, uint32(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)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39824, 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+16052, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16124, uint32(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)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39829, 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+39675, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39782, uint32(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)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39833, 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+39590, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39697, uint32(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)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39838, 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+39634, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39741, uint32(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)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39844, 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+39741, uint32(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39848, uint32(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)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39850, 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+39764, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -223116,48 +223604,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)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39856, 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+39665, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39772, uint32(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)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39864, 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+39649, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39756, uint32(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)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39870, 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+39649, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39756, uint32(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)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39875, 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+39590, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39697, uint32(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)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39881, 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+39768, uint32(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)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39889, 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+39790, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39897, uint32(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)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39901, 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+39764, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -223165,21 +223653,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)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39909, 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+39590, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39697, uint32(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)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39915, 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+39661, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39768, uint32(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)), uint32(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39921, 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+39675, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39782, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -223197,48 +223685,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+39821, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39928, 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+39606, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39713, uint32(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)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39933, 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+39831, 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+39606, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39713, uint32(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)), 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+39606, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39713, uint32(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)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39897, 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+39843, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39950, 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+39849, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39956, 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+39590, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39697, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -223254,13 +223742,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+39855, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39962, 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+39859, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39966, uint32(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)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39969, 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) @@ -223268,7 +223756,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)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39972, 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) @@ -223433,14 +223921,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+39869) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+39976) { 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+39562) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+39669) { 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 { @@ -223708,7 +224196,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+39991)) } // C documentation @@ -223734,7 +224222,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39580, + FzName: __ccgo_ts + 39687, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -223742,7 +224230,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39892, + FzName: __ccgo_ts + 39999, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -223750,7 +224238,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39884, + FzName: __ccgo_ts + 39991, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -223780,7 +224268,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+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+40005, pApi, bp+48, uintptr(0)) } return rc } @@ -229302,16 +229790,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+40012) == 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+40016) == 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+40020) == 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+40029, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -229374,21 +229862,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 + 40063, + 1: __ccgo_ts + 40103, + 2: __ccgo_ts + 40138, } 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+23979, *(*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+24051, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(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+40181, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -229409,23 +229898,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) } @@ -229558,10 +230047,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+40107, 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+40214, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40138, 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+40245, 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)) } @@ -229580,7 +230069,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+40189, 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+40296, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -230030,7 +230519,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+40322, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -230085,7 +230574,7 @@ 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 + 40332 } type TAggInfo_col = struct { @@ -230315,7 +230804,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 @@ -230363,11 +230852,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]uint8{'3', '.', '4', '9', '.', '1'} +var Xsqlite3_version = [7]uint8{'3', '.', '5', '0', '.', '1'} 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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods @@ -230377,3 +230866,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_arm64.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_arm64.go index 1188413..fd078aa 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_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 @@ -1563,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 @@ -1802,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 @@ -2012,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 @@ -2174,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 @@ -2182,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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70" +const SQLITE_SOURCE_ID = "2025-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2293,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.1" -const SQLITE_VERSION_NUMBER = 3049001 +const SQLITE_VERSION = "3.50.1" +const SQLITE_VERSION_NUMBER = 3050001 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3465,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 @@ -3474,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 @@ -4376,6 +4382,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. @@ -4732,6 +4744,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 @@ -5164,7 +5177,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -6905,11 +6917,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. */ /* @@ -7283,6 +7301,7 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem @@ -7328,6 +7347,7 @@ type THashElem1 = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem1 = THashElem1 @@ -7478,6 +7498,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. */ @@ -7536,6 +7561,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 @@ -7839,7 +7875,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData = TDbClientData @@ -7909,9 +7944,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 @@ -7926,7 +7961,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -7975,8 +8009,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 @@ -8040,7 +8074,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -8112,19 +8145,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 @@ -8138,11 +8174,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 @@ -8153,40 +8186,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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -8204,7 +8238,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -8216,6 +8250,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -8366,9 +8401,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 @@ -8423,6 +8458,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8603,7 +8639,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8645,7 +8680,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -9215,8 +9249,8 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. +/* Use SQLITE_ENABLE_EXPLAIN_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 @@ -10063,6 +10097,7 @@ type TTable1 = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table1 = TTable1 @@ -10144,11 +10179,13 @@ type TFKey1 = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey1 = TFKey1 +/* The size (in bytes) of an FKey object holding N columns. The answer +** does NOT include space to hold the zTo name. */ + /* ** SQLite supports many different ways to resolve a constraint ** error. ROLLBACK processing means that a constraint violation @@ -10197,11 +10234,12 @@ type TKeyInfo1 = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo1 = TKeyInfo1 +/* The size (in bytes) of a KeyInfo object with up to N fields */ + /* ** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. */ @@ -10603,13 +10641,16 @@ type Expr1 = TExpr1 ** expression. */ type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList1 = TExprList1 +/* The size (in bytes) of an ExprList object that is big enough to hold +** as many as N expressions. */ + /* ** Allowed values for Expr.a.eEName */ @@ -10630,12 +10671,14 @@ type ExprList1 = TExprList1 ** 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 + F__ccgo_align [0]uint64 + FnId int32 } type IdList1 = TIdList1 +/* The size (in bytes) of an IdList object that can hold up to N IDs. */ + /* ** Allowed values for IdList.eType, which determines which value of the a.u4 ** is valid. @@ -10741,13 +10784,19 @@ type OnOrUsing1 = TOnOrUsing1 ** */ type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList1 = TSrcList1 +/* Size (in bytes) of a SrcList object that can hold as many as N +** SrcItem objects. */ + +/* Size (in bytes( of a SrcList object that holds 1 SrcItem. This is a +** special case of SZ_SRCITEM(1) that comes up often. */ + /* ** Permitted values of the SrcList.a.jointype field */ @@ -11108,19 +11157,22 @@ type TParse1 = 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 @@ -11134,11 +11186,8 @@ type TParse1 = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -11149,40 +11198,41 @@ type TParse1 = 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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -11548,11 +11598,13 @@ type TWith1 = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With1 = TWith1 +/* The size (in bytes) of a With object that can hold as many +** as N different CTEs. */ + /* ** The Cte object is not guaranteed to persist for the entire duration ** of code generation. (The query flattener or other parser tree @@ -11582,11 +11634,13 @@ type TDbClientData1 = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData1 = TDbClientData1 +/* The size (in bytes) of a DbClientData object that can has a name +** that is N bytes long, including the zero-terminator. */ + /* ** This object is used in various ways, most (but not all) related to window ** functions. @@ -12752,7 +12806,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12830,7 +12883,6 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor @@ -12868,11 +12920,16 @@ type TVdbeCursor1 = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor1 = TVdbeCursor1 +/* +** The size (in bytes) of a VdbeCursor object that has an nField value of N +** or less. The value of SZ_VDBECURSOR(n) is guaranteed to be a multiple +** of 8. + */ + /* Return true if P is a null-only cursor */ @@ -13083,21 +13140,14 @@ type Tsqlite3_context1 = struct { 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 */ +/* +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. + */ // C documentation // @@ -13230,7 +13280,7 @@ type TPreUpdate1 = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -13242,6 +13292,7 @@ type TPreUpdate1 = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate1 = TPreUpdate1 @@ -13379,7 +13430,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(24453)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13551,7 +13602,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)) @@ -13938,7 +13989,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++ } @@ -14009,10 +14060,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) @@ -14148,7 +14199,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) } } @@ -14245,7 +14296,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) @@ -14386,10 +14437,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+1212, -int32(1)) @@ -14400,7 +14451,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) @@ -14478,7 +14529,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) @@ -14626,7 +14677,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)) @@ -14929,7 +14980,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 } @@ -15086,7 +15137,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('.') @@ -15134,7 +15185,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('.') @@ -15239,7 +15290,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) @@ -15968,7 +16019,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 } @@ -16617,7 +16668,8 @@ func init() { // /* // ** Initialize the mutex system. // */ -func _sqlite3MutexInit(tls *libc.TLS) (r int32) { +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 @@ -18245,17 +18297,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'), @@ -18452,22 +18504,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. */ @@ -18716,11 +18769,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 @@ -18748,7 +18801,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)) @@ -18770,7 +18823,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)) @@ -19197,29 +19250,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) @@ -19334,25 +19365,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 + 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 = 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. @@ -19360,15 +19395,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) { @@ -19379,13 +19414,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) @@ -19399,35 +19467,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 - } - 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 + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + 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++ + } + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 + j1++ + 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) @@ -19452,9 +19583,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: ; @@ -19468,7 +19599,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 { @@ -19478,21 +19609,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: ; @@ -19731,7 +19862,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 @@ -20030,6 +20161,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 // // /* @@ -20047,11 +20180,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)) } @@ -20703,6 +20836,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 // // /* @@ -21453,7 +21617,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 { @@ -21628,7 +21792,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+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 @@ -21840,11 +22004,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 @@ -22080,7 +22244,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)) @@ -22170,7 +22334,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)) { @@ -22397,7 +22561,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 *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -22557,7 +22721,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 + 1787 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1813 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') @@ -22666,7 +22830,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-- } } @@ -23082,7 +23246,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 @@ -23111,7 +23275,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 { @@ -23125,7 +23289,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) @@ -23156,7 +23320,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) { @@ -23507,23 +23671,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 @@ -23578,8 +23740,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)) } @@ -23612,9 +23774,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: ; @@ -23634,13 +23795,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 } @@ -23648,7 +23808,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 @@ -23664,7 +23824,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 { @@ -23676,7 +23836,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 } @@ -23725,7 +23885,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 @@ -23735,20 +23895,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) } @@ -23767,196 +23926,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 Tblksize_t = int32 @@ -24493,91 +24652,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, - }, - 14: { - FzName: __ccgo_ts + 3555, - }, - 15: { - FzName: __ccgo_ts + 3562, - }, - 16: { FzName: __ccgo_ts + 3572, }, + 14: { + FzName: __ccgo_ts + 3581, + }, + 15: { + FzName: __ccgo_ts + 3588, + }, + 16: { + FzName: __ccgo_ts + 3598, + }, 17: { - FzName: __ccgo_ts + 3579, - }, - 18: { - FzName: __ccgo_ts + 3593, - }, - 19: { - FzName: __ccgo_ts + 3599, - }, - 20: { FzName: __ccgo_ts + 3605, }, - 21: { - FzName: __ccgo_ts + 3612, + 18: { + FzName: __ccgo_ts + 3619, }, - 22: { - FzName: __ccgo_ts + 3620, - }, - 23: { + 19: { FzName: __ccgo_ts + 3625, }, - 24: { - FzName: __ccgo_ts + 3632, + 20: { + FzName: __ccgo_ts + 3631, }, - 25: { - FzName: __ccgo_ts + 3639, + 21: { + FzName: __ccgo_ts + 3638, }, - 26: { + 22: { + FzName: __ccgo_ts + 3646, + }, + 23: { FzName: __ccgo_ts + 3651, }, + 24: { + FzName: __ccgo_ts + 3658, + }, + 25: { + FzName: __ccgo_ts + 3665, + }, + 26: { + FzName: __ccgo_ts + 3677, + }, 27: { - FzName: __ccgo_ts + 3660, + FzName: __ccgo_ts + 3686, }, 28: { - FzName: __ccgo_ts + 3666, + FzName: __ccgo_ts + 3692, }, } @@ -24816,9 +24975,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+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+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 } } @@ -25138,7 +25297,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 } @@ -25166,7 +25325,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+3809, 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+3836, 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 } } @@ -25825,7 +25984,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(40995)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -26430,7 +26589,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+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 && libc.Int32FromUint8((*(*[513]uint8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { @@ -26456,7 +26615,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(42576)), __ccgo_ts+3605, bp, int32(42576)) } // C documentation @@ -26493,7 +26652,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)<= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43393)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -27104,7 +27263,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)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44803)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -28105,10 +28263,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 @@ -28117,8 +28275,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 @@ -28180,7 +28338,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+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 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { v1 = iLimit iLimit++ @@ -28352,7 +28510,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) } @@ -28507,7 +28665,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(45251)), __ccgo_ts+3488, zName, int32(45251)) if rc == SQLITE_OK { rc = rc2 } @@ -28584,7 +28742,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(45502)) 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+3651, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45507)), __ccgo_ts+3677, zIn, int32(45507)) return } (*(*[4098]uint8)(unsafe.Pointer(bp + 128)))[got] = uint8(0) @@ -28782,14 +28940,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+3480, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45565)), __ccgo_ts+3506, zPath, int32(45565)) } _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(45571)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<>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) } } @@ -32108,7 +32266,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) - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 0) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -32202,7 +32360,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-- - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 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)) } @@ -32243,7 +32401,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 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 @@ -32371,7 +32529,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 libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g)) + 140) + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -32391,17 +32549,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) } @@ -32419,7 +32579,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 @@ -32431,7 +32591,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) } } @@ -32632,10 +32792,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 @@ -34780,7 +34941,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 @@ -34798,7 +34959,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 } @@ -35371,6 +35532,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 { @@ -36017,7 +36187,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 @@ -36029,7 +36200,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) @@ -36050,11 +36221,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 @@ -36083,7 +36255,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 @@ -36316,7 +36488,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) } @@ -36453,7 +36625,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)) @@ -36469,7 +36641,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)< int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65269)) } 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)) @@ -40576,7 +40748,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 { @@ -41140,9 +41312,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 @@ -41346,6 +41518,11 @@ type WalCkptInfo1 = TWalCkptInfo1 /* ** An open write-ahead log file is represented by an instance of the ** following object. +** +** writeLock: +** This is usually set to 1 whenever the WRITER lock is held. However, +** if it is set to 2, then the WRITER lock is held but must be released +** by walHandleException() if a SEH exception is thrown. */ type TWal1 = struct { FpVfs uintptr @@ -41412,13 +41589,15 @@ type ht_slot = Tht_slot ** This functionality is used by the checkpoint code (see walCheckpoint()). */ type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } 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 ** is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -41476,7 +41655,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) @@ -41488,7 +41667,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) } @@ -41577,6 +41756,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 @@ -42018,7 +42198,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(67209)) } goto _1 _1: @@ -42106,12 +42286,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(67341)) 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 @@ -42245,7 +42425,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 { @@ -42876,7 +43056,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(68150)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -42992,7 +43172,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)) } } @@ -43207,7 +43387,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 { @@ -43233,7 +43420,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(68601)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43956,8 +44143,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)) } @@ -44044,7 +44231,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(69451)) } iKey = _walNextHash(tls, iKey) } @@ -44541,7 +44728,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(69974)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44790,7 +44977,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, /* 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(70234)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -45562,6 +45749,11 @@ type CellInfo1 = TCellInfo1 ** assumed that the database is corrupt. */ +/* +** Maximum amount of storage local to a database page, regardless of +** page size. + */ + /* ** A cursor is a pointer to a particular entry within a particular ** b-tree within a database file. @@ -45928,10 +46120,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) { @@ -45940,14 +46133,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) { @@ -46647,7 +46840,7 @@ 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(72422)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } @@ -46825,7 +47018,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(72620)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46838,12 +47031,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(72633)) 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(72638)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46887,7 +47080,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(72683)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46895,7 +47088,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(72691)) } return SQLITE_OK } @@ -47083,7 +47276,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) } @@ -47116,7 +47309,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) } @@ -47315,7 +47508,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(73136)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -47355,12 +47548,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(73194)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73197)) } 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)) @@ -47368,21 +47561,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(73205)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73208)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73210)) } 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(73214)) } } cbrk = top + sz @@ -47429,12 +47622,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(73247)) } 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(73253)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -47450,7 +47643,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(73267)) } *(*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) @@ -47510,7 +47703,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(73324)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -47527,14 +47720,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(73339)) } 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(73346)) } return uintptr(0) } @@ -47577,11 +47770,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(73394)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73397)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -47595,7 +47788,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(73414)) } else { return SQLITE_OK } @@ -47648,42 +47841,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(73498)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47691,70 +47882,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(73510)) } - 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(73513)) } - 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(73526)) } - 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(73532)) } 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) + *(*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)) += libc.Int32FromUint16(iOrigSize) + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47800,7 +47991,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(73602)) } } } else { @@ -47826,7 +48017,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(73626)) } } } @@ -47865,12 +48056,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(73677)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73682)) } 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(73692)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73696)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47897,7 +48088,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(73708)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47928,11 +48119,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(73739)) } 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(73744)) } goto _1 _1: @@ -47961,11 +48152,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(73776)) } (*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) @@ -47974,7 +48165,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(73790)) } /* 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 @@ -47996,30 +48187,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) @@ -48127,7 +48316,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(73933)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -48189,7 +48378,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(74005)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -48277,7 +48466,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 */ @@ -48901,7 +49090,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) @@ -49063,7 +49252,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 @@ -49101,7 +49290,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(74943)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -49542,7 +49731,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(75398)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -49566,7 +49755,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(75417)) } 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) @@ -49575,7 +49764,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(75426)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -49589,7 +49778,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(75438)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -49619,7 +49808,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(75473)) } /* 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) @@ -49715,7 +49904,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(75571)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49753,7 +49942,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(75623)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -49820,7 +50009,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(75691)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49863,7 +50052,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(75742)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49893,7 +50082,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(75769)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -50359,7 +50548,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(76233)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50751,7 +50940,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(76657)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50761,7 +50950,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(76672)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50792,7 +50981,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) @@ -50818,7 +51007,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(76743)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50892,7 +51081,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(76827)) } return rc } @@ -51027,7 +51216,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(76965)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -51039,7 +51228,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(76979)) } if rc != 0 { v3 = pCur + 84 @@ -51155,7 +51344,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(77114)) } goto skip_init skip_init: @@ -51169,7 +51358,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(77126)) } 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) @@ -51403,7 +51592,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(77375)) } } } @@ -51607,7 +51796,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes p3 = pCur + 1 *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(BTCF_ValidOvfl) | libc.Int32FromInt32(BTCF_AtLast))) if !((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76795)) + return _sqlite3CorruptError(tls, int32(77571)) } goto bypass_moveto_root /* Start search on the current page */ } @@ -51670,10 +51859,10 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ if nCell < int32(2) || libc.Uint32FromInt32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77658)) 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 @@ -51701,7 +51890,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(77690)) } goto moveto_index_finish } @@ -51734,7 +51923,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(77721)) } *(*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 @@ -51743,7 +51932,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(77732)) } if rc != 0 { v11 = pCur + 84 @@ -51872,7 +52061,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(77833)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51982,7 +52171,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(77926)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -52070,7 +52259,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(78016)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -52125,7 +52314,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(78072)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -52151,7 +52340,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(78101)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52178,7 +52367,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(78135)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -52249,7 +52438,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(78200)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52387,7 +52576,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(78327)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -52438,7 +52627,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(78374)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -52447,7 +52636,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(78385)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -52537,7 +52726,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(78474)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -52555,7 +52744,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(78491)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -52578,7 +52767,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(78511)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -52799,10 +52988,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(78767)) 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 @@ -53193,12 +53382,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(79157)) } 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(79162)) } } pData -= uintptr(sz) @@ -53206,7 +53395,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(79168)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -53301,7 +53490,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(79255)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -53382,7 +53571,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: ; @@ -53409,7 +53598,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: ; @@ -53449,7 +53638,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(79377)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2))) nCell -= nShift @@ -53520,7 +53709,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(79455)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -53565,7 +53754,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(79495)) } /* 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 @@ -53761,10 +53950,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 @@ -53887,8 +54077,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 @@ -53928,7 +54118,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(79919)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53951,7 +54141,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(79943)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -54082,7 +54272,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(80044)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -54125,7 +54315,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(80077)) goto balance_cleanup } } @@ -54184,7 +54374,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(80121)) goto balance_cleanup } goto _11 @@ -54216,7 +54406,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(80154)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -54446,7 +54636,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(80355)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54692,7 +54882,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(80587)) } goto _1 _1: @@ -54765,7 +54955,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(80647)) } 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))) @@ -54924,7 +55114,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(80811)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54955,7 +55145,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(80839)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -55040,7 +55230,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(80920)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -55132,7 +55322,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(81043)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -55168,7 +55358,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(81085)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55198,10 +55388,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(81112)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81115)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -55319,12 +55509,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(81217)) } 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 @@ -55334,14 +55524,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(81242)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -55441,21 +55631,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(81338)) } } 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(81347)) } 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(81351)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81354)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -55549,7 +55739,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(81445)) } 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 @@ -55659,7 +55849,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(81561)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55700,7 +55890,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(81609)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55781,14 +55971,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(81699)) } *(*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(81706)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55925,7 +56115,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(81810)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -56190,7 +56380,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)) @@ -56238,11 +56428,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) @@ -56268,11 +56458,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 @@ -56344,11 +56534,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)) } } @@ -56484,12 +56674,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 } @@ -56574,7 +56764,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 */ @@ -56597,7 +56787,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 { @@ -56674,7 +56864,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))) @@ -56688,7 +56878,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 @@ -56779,7 +56969,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) } @@ -56803,11 +56993,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) } } } @@ -56844,10 +57034,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: @@ -57286,7 +57476,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) @@ -57296,7 +57486,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 @@ -57325,7 +57515,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 @@ -57355,7 +57545,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... @@ -58033,7 +58223,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)) *(*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) } @@ -58171,9 +58361,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) @@ -58348,20 +58535,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 } @@ -58376,10 +58563,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 @@ -59133,7 +59320,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(85108)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -59297,7 +59484,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 { @@ -59305,8 +59493,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 { @@ -59363,14 +59551,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 */ @@ -59384,7 +59572,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 @@ -59409,14 +59597,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)) @@ -59516,7 +59704,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 } } } @@ -59531,7 +59719,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 } @@ -59835,7 +60023,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(85794)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59851,7 +60039,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(85800)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59861,7 +60049,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(85806)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -60322,12 +60510,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 @@ -60501,7 +60688,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 @@ -60518,7 +60705,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 { @@ -60586,8 +60773,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. @@ -60600,11 +60787,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 */ @@ -60641,13 +60828,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 @@ -60678,7 +60868,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 @@ -61180,7 +61370,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)) { @@ -61193,39 +61383,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): @@ -61242,14 +61432,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 @@ -61264,20 +61454,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)) } @@ -61291,10 +61481,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 @@ -62091,7 +62281,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 } @@ -62245,7 +62435,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) } @@ -62253,18 +62443,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) @@ -62495,7 +62685,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(90646))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63883,7 +64073,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(90727))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -63918,7 +64108,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(90757))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63972,7 +64162,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(90808))) return 0 /* Corrupt index */ } } @@ -64104,7 +64294,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(90971))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -64256,7 +64446,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(91129)) } // C documentation @@ -64287,7 +64477,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(91162)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -64438,15 +64628,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 @@ -64541,10 +64731,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 @@ -64553,9 +64744,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 { @@ -64635,7 +64826,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 @@ -64645,7 +64836,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) @@ -64703,7 +64894,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(91560)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -65206,7 +65397,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 @@ -65407,7 +65598,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(92354)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -65537,7 +65728,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(92475)) } 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) @@ -65997,18 +66188,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'), @@ -66263,14 +66454,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(93091)) } 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(93095))) 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(93099)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -66421,7 +66612,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, 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) } @@ -66844,11 +67035,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(93642)) 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))) } @@ -66857,7 +67048,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) @@ -66871,7 +67062,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) } @@ -66906,7 +67097,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(93701)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66941,7 +67132,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 } @@ -67007,11 +67198,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(93797)) 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))) } @@ -67034,7 +67225,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 @@ -67056,7 +67247,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 @@ -67183,7 +67374,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 { @@ -67221,7 +67412,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 @@ -67236,28 +67427,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, 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+5663, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5689, int32(1)) } } } @@ -67421,9 +67612,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 { @@ -67449,12 +67640,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) @@ -67463,28 +67652,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 @@ -67875,12 +68064,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 @@ -67897,7 +68086,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 @@ -67915,7 +68104,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 @@ -68629,19 +68818,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) { @@ -69855,7 +70044,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 @@ -69871,6 +70060,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 */ @@ -70364,7 +70559,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(97561)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -70467,7 +70662,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, @@ -71063,7 +71258,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 { @@ -71093,12 +71288,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 } @@ -71190,7 +71385,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. @@ -72301,7 +72496,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(99822)) } else { goto jump_to_p2 } @@ -72760,7 +72955,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(). @@ -73193,7 +73388,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(101119)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -73523,7 +73718,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 @@ -73554,13 +73749,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 { @@ -73575,7 +73770,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(101412)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73812,7 +74007,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 @@ -73829,15 +74024,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 @@ -73918,11 +74113,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) } @@ -74134,7 +74329,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 @@ -74184,7 +74379,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 { @@ -74240,7 +74435,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)) @@ -74319,11 +74514,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) { @@ -74476,7 +74671,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 } @@ -74638,7 +74833,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' @@ -74718,12 +74913,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)) @@ -74734,7 +74929,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)) @@ -74828,7 +75023,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 } @@ -74856,11 +75051,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) { @@ -74988,7 +75183,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) @@ -75139,7 +75334,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 { @@ -75226,15 +75421,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) @@ -75700,11 +75887,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) @@ -75790,7 +75977,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103962)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75889,7 +76076,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(104062)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75903,7 +76090,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) } @@ -76350,11 +76537,12 @@ type TVdbeSorter1 = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter1 = TVdbeSorter1 +/* Size (in bytes) of a VdbeSorter object that works with N or fewer subtasks */ + /* ** An instance of the following object is used to read records out of a ** PMA, in sorted order. The next key to be read is cached in nKey/aKey. @@ -76961,8 +77149,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 @@ -76976,9 +77164,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) @@ -77176,18 +77364,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 { @@ -77475,6 +77664,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: @@ -80020,25 +80212,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) } } @@ -80077,23 +80269,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 */ @@ -80125,7 +80316,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 @@ -80219,7 +80410,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 } } @@ -80241,57 +80432,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 @@ -80336,11 +80514,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 } @@ -80349,36 +80527,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++ @@ -80407,18 +80574,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 } } } @@ -80465,15 +80632,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) @@ -80484,8 +80651,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -80525,7 +80692,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) @@ -80545,7 +80712,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) @@ -80554,7 +80721,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 @@ -80564,26 +80731,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) } @@ -80632,8 +80799,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80707,19 +80874,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) } @@ -80745,7 +80912,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 @@ -80891,7 +81058,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) { @@ -80946,7 +81113,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 { @@ -80970,7 +81137,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) @@ -80984,13 +81151,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: ; @@ -81010,16 +81177,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 @@ -81030,35 +81194,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 { @@ -81143,7 +81310,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))) } @@ -81155,7 +81322,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 @@ -81201,7 +81368,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 @@ -81326,7 +81493,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) } @@ -81361,7 +81528,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 @@ -81399,7 +81566,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 { @@ -81469,7 +81636,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 @@ -81503,7 +81670,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 @@ -81816,7 +81983,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 { @@ -81883,7 +82050,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 { @@ -81894,7 +82061,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 @@ -81904,7 +82071,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 @@ -82126,33 +82293,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 } @@ -82204,7 +82373,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) { @@ -82412,7 +82581,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 } @@ -82887,7 +83056,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) { @@ -82966,7 +83135,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 @@ -83153,7 +83322,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) @@ -83311,11 +83480,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)) @@ -83364,7 +83533,7 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt 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)) { _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) } @@ -83392,7 +83561,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)) @@ -83412,7 +83581,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 @@ -83483,7 +83652,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)) } } } @@ -83535,7 +83704,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 } @@ -83568,7 +83737,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) } } @@ -83951,7 +84120,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 @@ -84091,7 +84260,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: @@ -84112,27 +84280,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) { @@ -84178,9 +84339,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++ } @@ -84190,8 +84351,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++ } @@ -84205,7 +84366,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) } @@ -84256,7 +84417,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 @@ -84337,7 +84498,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) @@ -84355,7 +84516,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) @@ -84436,7 +84597,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 @@ -84565,7 +84726,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)) } } @@ -84663,10 +84824,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) @@ -85344,13 +85505,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+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 @@ -85365,32 +85526,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 @@ -85599,7 +85747,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 @@ -85652,7 +85800,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) @@ -85752,12 +85900,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 = 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) @@ -86349,7 +86498,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 @@ -86445,14 +86594,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 } @@ -86480,9 +86629,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) { @@ -86615,7 +86764,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) } } @@ -86745,13 +86894,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)<= (*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) } @@ -87543,7 +87692,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)) @@ -87558,7 +87707,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) { @@ -87587,7 +87736,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) } @@ -87663,7 +87812,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): @@ -87726,7 +87875,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 @@ -87736,7 +87885,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) { @@ -87757,9 +87906,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 /* @@ -87841,7 +87990,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 libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -87912,17 +88061,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 { @@ -87931,7 +88080,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 @@ -87962,7 +88111,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 { @@ -88032,7 +88181,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) @@ -88076,7 +88225,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 @@ -88343,7 +88492,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: @@ -88552,7 +88703,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: @@ -89259,7 +89412,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) } @@ -89780,7 +89933,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) 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 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 @@ -89796,7 +89949,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) (*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 + v9 = pParse + 60 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 @@ -89881,7 +90034,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 @@ -89889,7 +90042,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 @@ -89907,7 +90060,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 } } } @@ -89926,11 +90079,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 } @@ -90048,8 +90201,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+8540, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90067,10 +90220,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+8568, 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+8743, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -90086,9 +90239,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+8917, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9039, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9064, 0) } } @@ -90144,7 +90297,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+9215, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -90153,11 +90306,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+9274, 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+9280, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -90187,21 +90340,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+9307, 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+9491, 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+9796, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9812, 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+9870, 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 @@ -90209,7 +90362,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 @@ -90217,7 +90370,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+10135, 0) goto exit_rename_table exit_rename_table: ; @@ -90234,7 +90387,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+10148, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -90274,11 +90427,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+10186, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10193, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10218, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -90294,10 +90447,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+10245) } 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+10304) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -90309,13 +90462,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+10357) } _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+10403) } } /* Modify the CREATE TABLE statement. */ @@ -90329,7 +90482,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+10430, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -90357,7 +90510,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+10576, libc.VaList(bp+16, zTab, zDb)) } } } @@ -90395,12 +90548,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+10929, 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+10963, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -90415,7 +90568,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 } @@ -90423,8 +90576,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+10993, 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 } @@ -90485,18 +90638,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 + 11012 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10992 + zType = __ccgo_ts + 11017 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11006 + v1 = __ccgo_ts + 11031 } else { - v1 = __ccgo_ts + 11023 + v1 = __ccgo_ts + 11048 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11041, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11066, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90543,21 +90696,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+11084, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -90573,11 +90714,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+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+11105, 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+11287, 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+10135, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -91053,11 +91194,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 + 11393 + v1 = __ccgo_ts + 11418 } 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+11420, 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) } @@ -91128,30 +91269,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+11443, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118867)) } 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(118888)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -91172,9 +91317,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)) @@ -91190,15 +91334,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+11451, 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)) @@ -91209,16 +91353,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++ @@ -91235,21 +91379,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 + 11393 + v1 = __ccgo_ts + 11418 } 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+11457, 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))) @@ -91275,7 +91419,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: ; @@ -91585,7 +91729,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 { @@ -91852,7 +91996,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) @@ -92035,7 +92179,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 { @@ -92119,8 +92263,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 @@ -92136,12 +92281,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)) @@ -92215,7 +92360,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(119856)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -92232,7 +92377,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+11462, 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 @@ -92287,23 +92432,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+11084, 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 + 11469 } 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+11481, 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+11509, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -92315,31 +92460,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+11557, 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+11678, 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)) { @@ -92353,7 +92498,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 @@ -92364,8 +92509,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 } @@ -92426,27 +92571,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 + 11696, }, 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 + 11717, }, 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 + 11737, }, 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 + 11756, }, 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 + 11775, }, } @@ -92657,8 +92802,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+11878, 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 { @@ -92668,10 +92818,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+11901, 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+11931, 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) @@ -92703,15 +92853,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11773, - FzCols: __ccgo_ts + 11786, + FzName: __ccgo_ts + 11798, + FzCols: __ccgo_ts + 11811, }, 1: { - FzName: __ccgo_ts + 11799, - FzCols: __ccgo_ts + 11812, + FzName: __ccgo_ts + 11824, + FzCols: __ccgo_ts + 11837, }, 2: { - FzName: __ccgo_ts + 11840, + FzName: __ccgo_ts + 11865, }, } @@ -92925,7 +93075,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) { @@ -92941,12 +93092,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 @@ -92954,7 +93105,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) @@ -93013,7 +93164,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 + 11949, } func init() { @@ -93387,7 +93538,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 + 11959, } func init() { @@ -93437,7 +93588,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+11969, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -93448,7 +93599,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+11974, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -93487,7 +93638,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+11980, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -93505,7 +93656,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 + 11986, } func init() { @@ -93571,7 +93722,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+11995, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -93580,12 +93731,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+11798, 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)) @@ -93707,7 +93858,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 } @@ -93787,7 +93938,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: @@ -93818,7 +93969,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+12005, 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)) @@ -93909,7 +94060,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+12005, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -93946,7 +94097,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 @@ -93979,11 +94130,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+12009) } 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+12013) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -94147,17 +94298,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+11992, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12017, 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+12028, 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+12038, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -94169,13 +94320,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) - } } } @@ -94226,7 +94370,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) } @@ -94429,8 +94573,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))) @@ -94536,11 +94680,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+11824, 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+12050, __ccgo_ts+12119, zDb) } return rc } @@ -94606,10 +94750,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+11798, (*(*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+12171, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94722,7 +94866,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 @@ -94774,11 +94918,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+12212, 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 { @@ -94809,7 +94953,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+12215, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -94818,7 +94962,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+12252, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -94830,13 +94974,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 } @@ -94874,7 +95018,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+12282, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94882,7 +95026,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+12311, 0) rc = int32(SQLITE_ERROR) } } @@ -94929,7 +95073,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+12379, libc.VaList(bp+56, zFile)) } } } @@ -94991,15 +95135,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+12407, 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+12428, 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+12454, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -95094,7 +95238,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 + 12476, } func init() { @@ -95116,7 +95260,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 + 12490, } func init() { @@ -95142,7 +95286,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+12504, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -95176,7 +95320,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+12528, 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))) @@ -95393,7 +95537,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+12574, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -95421,11 +95565,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+12597, 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+12603, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12584, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12609, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -95485,7 +95629,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) { @@ -95520,7 +95664,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+12636, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -95638,7 +95782,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 @@ -95736,7 +95880,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) @@ -95814,7 +95960,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) { @@ -95828,7 +95974,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) } @@ -95941,21 +96089,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) } } } @@ -95985,12 +96133,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) } } } @@ -96028,7 +96176,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+12651, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -96038,7 +96186,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) @@ -96046,15 +96194,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 + 12659 } else { - v1 = __ccgo_ts + 12647 + v1 = __ccgo_ts + 12672 } 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 { } @@ -96092,12 +96240,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 @@ -96622,7 +96770,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) @@ -96654,7 +96802,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 @@ -96712,13 +96860,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+12686, 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+12703, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96766,8 +96914,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+12723, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96803,23 +96951,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 @@ -96939,7 +97089,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 @@ -96982,9 +97132,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 @@ -96997,7 +97147,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+12765, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -97013,9 +97163,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10987 + v2 = __ccgo_ts + 11012 } else { - v2 = __ccgo_ts + 9249 + v2 = __ccgo_ts + 9274 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -97025,9 +97175,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 @@ -97051,11 +97201,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 + 11012 } else { - v4 = __ccgo_ts + 9249 + v4 = __ccgo_ts + 9274 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12781, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12806, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -97063,11 +97213,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+12827, 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++ @@ -97099,19 +97249,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 @@ -97131,15 +97291,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) @@ -97154,7 +97319,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 } @@ -97215,7 +97380,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+12862, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -97224,14 +97389,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+12896, 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) @@ -97263,11 +97430,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) @@ -97278,7 +97445,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+12916, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -97288,12 +97455,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+12939, 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+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+12946, 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-- @@ -97335,21 +97502,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+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+12956, 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) { @@ -97360,7 +97516,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. */ @@ -97373,12 +97529,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 @@ -97550,10 +97715,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+12982, 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+13027, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -97611,7 +97776,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+13068, 0) } } @@ -97639,8 +97804,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) @@ -97648,7 +97813,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+13120, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -97667,21 +97832,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 @@ -97704,7 +97858,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+13161, 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) @@ -97732,8 +97886,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 { @@ -97820,17 +97979,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+13217, 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+13260, (*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+13268, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97862,7 +98021,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+13275, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -98003,9 +98162,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 @@ -98016,31 +98176,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 + 13306 + zEnd = __ccgo_ts + 5201 } else { - zSep = __ccgo_ts + 13283 - zSep2 = __ccgo_ts + 13287 - zEnd = __ccgo_ts + 13292 + zSep = __ccgo_ts + 13308 + zSep2 = __ccgo_ts + 13312 + zEnd = __ccgo_ts + 13317 } - 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+13320, 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))++ @@ -98051,8 +98211,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)] @@ -98065,17 +98226,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 + 13334, + 2: __ccgo_ts + 13340, + 3: __ccgo_ts + 13345, + 4: __ccgo_ts + 13350, + 5: __ccgo_ts + 13340, } // C documentation @@ -98084,15 +98246,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) } @@ -98107,7 +98270,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 } @@ -98340,8 +98503,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. @@ -98441,7 +98614,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 @@ -98454,8 +98627,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++ } @@ -98485,7 +98658,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 @@ -98704,9 +98877,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+13356, 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+13389, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98727,11 +98900,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+13416, 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+13466, 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)) @@ -98778,7 +98951,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+13498, 0) return } } @@ -98812,16 +98985,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 + 9274 + zType2 = __ccgo_ts + 13542 } else { /* A view */ - zType = __ccgo_ts + 10987 - zType2 = __ccgo_ts + 13523 + zType = __ccgo_ts + 11012 + zType2 = __ccgo_ts + 13548 } /* 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 @@ -98838,24 +99011,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) @@ -98903,13 +99081,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+13528, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13553, 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+13568, 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 @@ -98918,15 +99106,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+13666, 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+13708, 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+13742, 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. @@ -98944,7 +99132,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+9796) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -98977,7 +99165,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+13763, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -98994,7 +99182,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+11012, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -99091,7 +99279,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+13799, 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. @@ -99275,7 +99463,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+13829, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -99288,7 +99476,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+13844, 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) } @@ -99371,9 +99559,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+13911, 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+11901, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -99414,7 +99602,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+13925, 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 @@ -99423,7 +99611,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+13970, 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) } @@ -99458,11 +99646,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) @@ -99517,9 +99705,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 @@ -99552,18 +99740,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+14037, 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+14065, 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+14099, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -99573,7 +99761,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+12013, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -99621,19 +99809,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+14131, 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+14194, 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 { @@ -99690,7 +99878,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+14288, 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) { @@ -99805,11 +99993,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 */ @@ -99831,7 +100019,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 @@ -99876,13 +100064,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) } @@ -99905,23 +100093,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 @@ -99950,11 +100138,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 + 14334 } else { - v2 = __ccgo_ts + 14315 + v2 = __ccgo_ts + 14340 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14320, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14345, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -100032,7 +100220,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+14373, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -100042,7 +100230,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+14379, 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)) { @@ -100056,16 +100244,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+14429, 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+14457, 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+14482, 0) goto exit_create_index } /* @@ -100086,19 +100274,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+14373, (*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+14516, 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+14550, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -100119,7 +100307,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+14574, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -100137,9 +100325,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 @@ -100167,7 +100355,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+14373) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -100199,7 +100387,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 } @@ -100251,7 +100439,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+14597, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -100266,6 +100454,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { j = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) } else { if int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16 + 8))&0xf>>0)) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) @@ -100350,7 +100539,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) @@ -100398,7 +100587,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+14658, 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 @@ -100428,8 +100617,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+14700, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127335)) goto exit_create_index } } @@ -100442,7 +100631,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 @@ -100471,9 +100660,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 + 14717 } - 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+14725, 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(""); */ @@ -100481,7 +100670,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+14745, 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. @@ -100489,7 +100678,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+14804, 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)) @@ -100652,16 +100841,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+14831, 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+14849, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100669,9 +100858,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 { @@ -100687,8 +100876,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+14922, 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+12009, (*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) @@ -100761,12 +100950,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) @@ -100878,13 +101067,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+14982, 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) } @@ -100965,7 +101154,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) } @@ -101015,7 +101204,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 @@ -101186,11 +101375,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 + 15018 } else { - v1 = __ccgo_ts + 14996 + v1 = __ccgo_ts + 15021 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15002, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15027, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -101389,7 +101578,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+15063, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -101436,9 +101625,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 + 15069 } else { - v1 = __ccgo_ts + 15053 + v1 = __ccgo_ts + 15078 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -101470,9 +101659,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 + 15063, + 1: __ccgo_ts + 15085, + 2: __ccgo_ts + 15069, } // C documentation @@ -101492,7 +101681,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+15093, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -101517,7 +101706,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+12597, 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 @@ -101948,7 +102137,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+15293, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102830,11 +103017,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+15326, 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+15355, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102938,7 +103125,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 @@ -102995,7 +103182,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+15429, -int32(1)) return } if argc == int32(3) { @@ -104714,7 +104906,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+15462, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -104796,7 +104988,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 @@ -104868,28 +105060,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+15482, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15507, 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+15515, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -104921,13 +105113,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 + 15523 + } else { + v2 = __ccgo_ts + 15527 + } + 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[*(*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+15530, -int32(1)) + return +} + // C documentation // // /* @@ -104939,6 +105267,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) @@ -104949,7 +105281,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) @@ -105384,7 +105716,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 } @@ -105473,7 +105805,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11393, + 0: __ccgo_ts + 11418, } // C documentation @@ -105633,7 +105965,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+15553, int32(4), libc.UintptrFromInt32(0)) } } @@ -105694,7 +106026,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+12636, -int32(1)) return } if argc == int32(2) { @@ -105804,7 +106136,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) { @@ -105886,7 +106218,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+15406, -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) @@ -106118,7 +106450,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) @@ -106129,7 +106461,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 { @@ -106236,7 +106568,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+15558, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -106265,8 +106597,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+15564, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15564, 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 @@ -106446,11 +106778,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 @@ -106554,7 +106886,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))) } /* @@ -106567,542 +106899,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 + 15569, }, 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 + 15589, }, 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 + 15602, }, 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 + 15620, }, 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 + 15629, }, 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 + 15637, }, 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 + 15637, }, 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 + 15652, }, 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 + 15678, }, 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 + 15703, }, 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 + 15712, }, 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 + 15723, }, 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 + 15730, }, 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 + 15744, }, 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 + 15744, }, 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 + 15750, }, 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 + 15750, }, 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 + 15756, }, 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 + 15756, }, 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 + 15761, }, 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 + 15761, }, 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 + 15765, }, 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 + 15765, }, 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 + 15769, }, 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 + 15776, }, 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 + 15784, }, 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 + 15791, }, 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 + 15804, }, 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 + 15810, }, 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 + 15817, }, 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 + 15824, }, 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 + 15832, }, 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 + 15837, }, 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 + 15841, }, 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 + 15841, }, 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 + 15847, }, 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 + 15853, }, 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 + 15859, }, 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 + 15863, }, 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 + 15863, }, 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 + 15869, }, 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 + 15876, }, 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 + 15886, }, 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 + 15893, }, 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 + 15900, }, 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 + 15911, }, 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 + 15918, }, 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 + 15933, }, 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 + 15950, }, 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 + 15961, }, 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 + 15968, }, 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 + 15974, }, 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 + 15987, }, 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 + 16005, }, 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 + 16013, }, 55: { - 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 + 15972, - }, - 56: { 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 + 16027, + }, + 56: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16035, }, 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 + 16044, }, 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 + 16044, }, 59: { - 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, + 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 + 16051, }, 60: { - 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, + 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 + 16051, }, 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 + 15999, + FzName: __ccgo_ts + 16061, }, 62: { - 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, + 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 + 16065, }, 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(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16003, + 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 + 16071, }, 64: { - 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, + 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 + 16075, }, 65: { - 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, + 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 + 16075, }, 66: { - FnArg: int16(2), + 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 + 16022, + FzName: __ccgo_ts + 16081, }, 67: { 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, + 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 + 16081, }, 68: { 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, + 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 + 16094, }, 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 + 16105, + }, + 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 + 15564, + }, + 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, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16038, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1240, + FzName: __ccgo_ts + 15564, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1248, + FzName: __ccgo_ts + 16110, }, 73: { 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 + 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 + 16049, + 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 + 16052, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16115, }, 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 + 16056, + FzName: __ccgo_ts + 16121, }, 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 + 16062, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16124, }, 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 + 16052, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16128, }, 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, + FfuncFlags: 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 + 16134, }, 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 + 16124, }, 81: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16075, - }, - 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, - }, - 83: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16085, - }, - 84: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16090, - }, - 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, - }, - 86: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16100, - }, - 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, - }, - 88: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16110, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, }, + 82: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16143, + }, + 83: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16147, + }, + 84: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16153, + }, + 85: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16157, + }, + 86: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16162, + }, + 87: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16167, + }, + 88: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16172, + }, + 89: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16178, + }, + 90: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16182, + }, + 91: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16186, + }, + 92: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16190, + }, + 93: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16195, + }, + 94: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16200, + }, 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 + 16205, }, 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 + 16211, }, 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 + 16217, }, 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 + 16223, }, 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 + 16228, }, 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 + 16236, }, 101: { - 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, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16244, }, 102: { - 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, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16247, }, 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 + 6885, + }, + 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 + 16184, + FzName: __ccgo_ts + 16252, + }, + 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 + 16256, }, } @@ -107161,109 +107504,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 ************************************************/ @@ -107487,7 +107832,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) } @@ -107580,7 +107925,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+16259, 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) @@ -108404,7 +108749,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 @@ -108691,11 +109036,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 { @@ -108759,7 +109104,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 = uint8(OE_Abort) @@ -108775,7 +109120,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 @@ -109341,7 +109686,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 } @@ -109407,11 +109752,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 } @@ -109736,7 +110081,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) @@ -109750,7 +110095,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 @@ -109785,7 +110130,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 @@ -109798,7 +110143,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 @@ -109925,27 +110270,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 */ @@ -110026,7 +110371,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++ @@ -110053,7 +110398,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 } @@ -110062,44 +110407,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+16304, 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+16345, 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 } } @@ -110121,31 +110450,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+16377, 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 @@ -110169,10 +110498,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) @@ -110213,8 +110542,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-- } @@ -110231,34 +110560,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+16385, 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+16437, 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 @@ -110365,18 +110694,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 @@ -110386,13 +110715,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 } } } @@ -110403,14 +110732,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 } @@ -110427,16 +110756,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++ @@ -110547,11 +110876,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 */ @@ -110610,7 +110939,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16457) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16529) } goto insert_cleanup insert_cleanup: @@ -111006,7 +111335,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+12597, 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('/'))) { @@ -113240,7 +113571,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+16578, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -113260,19 +113591,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+16582, 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+16588, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113287,14 +113618,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+16631, 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) } @@ -113318,7 +113649,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+16663, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113327,7 +113658,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 + 16543, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -113560,7 +113891,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+16700, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -113614,63 +113945,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 + 16739, + 2: __ccgo_ts + 9274, + 3: __ccgo_ts + 16743, + 4: __ccgo_ts + 16748, + 5: __ccgo_ts + 16751, + 6: __ccgo_ts + 16761, + 7: __ccgo_ts + 16771, + 8: __ccgo_ts + 16777, + 9: __ccgo_ts + 16781, + 10: __ccgo_ts + 16786, + 11: __ccgo_ts + 16791, + 12: __ccgo_ts + 16799, + 13: __ccgo_ts + 16810, + 14: __ccgo_ts + 16813, + 15: __ccgo_ts + 16781, + 16: __ccgo_ts + 16820, + 17: __ccgo_ts + 16786, + 18: __ccgo_ts + 16828, + 19: __ccgo_ts + 16832, + 20: __ccgo_ts + 16837, + 21: __ccgo_ts + 16843, + 22: __ccgo_ts + 16781, + 23: __ccgo_ts + 16786, + 24: __ccgo_ts + 16850, + 25: __ccgo_ts + 16855, + 26: __ccgo_ts + 16858, + 27: __ccgo_ts + 16865, + 28: __ccgo_ts + 16777, + 29: __ccgo_ts + 16781, + 30: __ccgo_ts + 16871, + 31: __ccgo_ts + 16876, + 32: __ccgo_ts + 16881, + 33: __ccgo_ts + 16739, + 34: __ccgo_ts + 16781, + 35: __ccgo_ts + 16885, + 36: __ccgo_ts + 16892, + 37: __ccgo_ts + 16899, + 38: __ccgo_ts + 12013, + 39: __ccgo_ts + 12009, + 40: __ccgo_ts + 16907, + 41: __ccgo_ts + 16912, + 42: __ccgo_ts + 16917, + 43: __ccgo_ts + 9274, + 44: __ccgo_ts + 16922, + 45: __ccgo_ts + 5595, + 46: __ccgo_ts + 16928, + 47: __ccgo_ts + 16933, + 48: __ccgo_ts + 16124, + 49: __ccgo_ts + 16938, + 50: __ccgo_ts + 16739, + 51: __ccgo_ts + 16781, + 52: __ccgo_ts + 16951, + 53: __ccgo_ts + 16956, + 54: __ccgo_ts + 16965, + 55: __ccgo_ts + 16972, + 56: __ccgo_ts + 16983, } // C documentation @@ -113689,338 +114020,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16919, + FzName: __ccgo_ts + 16991, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16934, + FzName: __ccgo_ts + 17006, 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 + 17021, 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 + 17033, 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 + 17049, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16900, + FzName: __ccgo_ts + 16972, 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 + 17062, 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 + 17074, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17022, + FzName: __ccgo_ts + 17094, 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 + 17110, 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 + 17131, 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 + 17146, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17090, + FzName: __ccgo_ts + 17162, 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 + 17176, 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 + 17189, 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 + 17203, 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 + 17222, 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 + 17241, 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 + 17264, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17201, + FzName: __ccgo_ts + 17273, 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 + 17291, 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 + 17308, 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 + 17321, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17264, + FzName: __ccgo_ts + 17336, 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 + 17354, 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 + 17364, 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 + 17378, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17322, + FzName: __ccgo_ts + 17394, 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 + 17419, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17366, + FzName: __ccgo_ts + 17438, 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 + 17449, 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 + 17460, 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 + 17472, 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 + 17488, 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 + 17501, 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 + 17520, 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 + 17539, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17480, + FzName: __ccgo_ts + 17552, 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 + 17567, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17505, + FzName: __ccgo_ts + 17577, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17517, + FzName: __ccgo_ts + 17589, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17526, + FzName: __ccgo_ts + 17598, 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 + 17609, 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 + 17619, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17559, + FzName: __ccgo_ts + 17631, 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 + 17642, 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 + 17654, 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 + 17671, 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 + 17690, 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 + 17716, 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 + 17731, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17673, + FzName: __ccgo_ts + 17745, 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 + 17764, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17706, + FzName: __ccgo_ts + 17778, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17722, + FzName: __ccgo_ts + 17794, 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 + 17806, 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 + 17817, 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 + 17828, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -114028,45 +114359,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17768, + FzName: __ccgo_ts + 17840, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17779, + FzName: __ccgo_ts + 17851, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17800, + FzName: __ccgo_ts + 17872, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17808, + FzName: __ccgo_ts + 17880, 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 + 17895, 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 + 17908, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17855, + FzName: __ccgo_ts + 17927, 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 + 17942, 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)), @@ -114084,7 +114415,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 @@ -114192,10 +114523,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+17958) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17896) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17968) { return PAGER_LOCKINGMODE_NORMAL } } @@ -114213,13 +114544,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+17975) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17908) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17980) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -114242,10 +114573,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+16861) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+16951) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17920) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+17992) == 0 { return int32(2) } else { return 0 @@ -114267,7 +114598,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+17999, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -114397,15 +114728,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 + 18061 case int32(OE_SetDflt): - zName = __ccgo_ts + 17998 + zName = __ccgo_ts + 18070 case int32(OE_Cascade): - zName = __ccgo_ts + 18010 + zName = __ccgo_ts + 18082 case int32(OE_Restrict): - zName = __ccgo_ts + 18018 + zName = __ccgo_ts + 18090 default: - zName = __ccgo_ts + 18027 + zName = __ccgo_ts + 18099 break } return zName @@ -114426,12 +114757,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 + 18109, + 1: __ccgo_ts + 18116, + 2: __ccgo_ts + 18124, + 3: __ccgo_ts + 18128, + 4: __ccgo_ts + 17992, + 5: __ccgo_ts + 18137, } // C documentation @@ -114493,15 +114824,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 + 18162 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18092 + zType = __ccgo_ts + 18164 } 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+18166, 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: ; @@ -114510,9 +114841,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 + 18141, + 2: __ccgo_ts + 18146, + 3: __ccgo_ts + 18154, } // C documentation @@ -114611,7 +114942,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+18173, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114654,7 +114985,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++ @@ -114699,7 +115030,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 @@ -114758,7 +115089,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+18177) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114801,7 +115132,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 @@ -114829,7 +115160,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 + 17968 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 @@ -114857,7 +115188,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 + 17958 } _returnSingleText(tls, v, zRet) break @@ -115147,7 +115478,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+18110, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18182, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -115157,7 +115488,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+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) } @@ -115179,7 +115510,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+18207, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -115211,8 +115542,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+18260) == 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. */ @@ -115292,9 +115624,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 + 18266 } else { - v14 = __ccgo_ts + 18202 + v14 = __ccgo_ts + 18274 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -115365,7 +115697,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+18281, 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)) @@ -115395,19 +115727,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 + 11012 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13235 + zType = __ccgo_ts + 13260 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18225 + zType = __ccgo_ts + 18297 } else { - zType = __ccgo_ts + 9249 + zType = __ccgo_ts + 9274 } } } - _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+18304, 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: ; @@ -115454,9 +115786,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+18311, 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+18316, 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 @@ -115480,11 +115812,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 + 18321, + 1: __ccgo_ts + 18323, + 2: __ccgo_ts + 16810, } - _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+18325, 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: ; @@ -115503,7 +115835,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+18331, 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: ; @@ -115520,7 +115852,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+18335, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -115570,7 +115902,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: ; @@ -115582,7 +115914,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: ; @@ -115608,7 +115940,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+18338, 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+18347)) goto _32 _32: ; @@ -115622,8 +115954,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 @@ -115749,7 +116081,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+18352, 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))) @@ -115845,7 +116177,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 @@ -115889,7 +116221,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 } @@ -115940,7 +116272,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+18356, 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) @@ -115951,7 +116283,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+18380) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -116087,7 +116419,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+18409, 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) @@ -116149,7 +116481,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))) } @@ -116171,7 +116503,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+18445, 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) @@ -116184,7 +116516,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+18465, 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) { @@ -116192,7 +116524,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+18487, 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) { @@ -116203,10 +116535,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+18510, -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+18512, 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)) } } @@ -116240,7 +116572,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+18532, 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) @@ -116264,9 +116596,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+18562) _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+18567) _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)) @@ -116279,9 +116611,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+18588) _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+18624) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -116309,9 +116641,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+18562) _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+18635) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -116339,7 +116671,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+18662) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -116436,7 +116768,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 + 18689 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -116515,7 +116847,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+18750, libc.VaList(bp+176, zRight)) } } } @@ -116620,13 +116952,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+17975) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18703) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18775) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18056) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18128) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116761,7 +117093,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 @@ -116791,7 +117123,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. @@ -116853,7 +117185,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+18783, 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)) @@ -117126,34 +117458,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18620, + FzName: __ccgo_ts + 18692, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18625, + FzName: __ccgo_ts + 18697, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18631, + FzName: __ccgo_ts + 18703, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18640, + FzName: __ccgo_ts + 18712, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18649, + FzName: __ccgo_ts + 18721, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18657, + FzName: __ccgo_ts + 18729, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18665, + FzName: __ccgo_ts + 18737, }, 7: { - FzName: __ccgo_ts + 18672, + FzName: __ccgo_ts + 18744, }, 8: {}, } @@ -117249,14 +117581,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+18801) 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, libc.Int32FromUint8(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18816, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) cSep = uint8(',') goto _1 _1: @@ -117265,19 +117597,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+18823, 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+18829) 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+18841) 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 { @@ -117292,7 +117624,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 @@ -117473,7 +117805,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) } @@ -117485,13 +117817,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+18856) 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+18864, 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+18868, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -117500,7 +117832,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) @@ -117626,24 +117958,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+18902, 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(143745)) } 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+18930, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*uint8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18889, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18961, 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(143752)) } } } @@ -117651,9 +117983,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 + 18872, + 1: __ccgo_ts + 18879, + 2: __ccgo_ts + 18891, } // C documentation @@ -117729,7 +118061,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+14700) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117762,11 +118094,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+18969) } 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+14700) } } } @@ -117805,18 +118137,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 + 9274 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 + 18982 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -117900,7 +118232,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+12311) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117926,7 +118258,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+19054) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117941,7 +118273,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+19078, 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)) @@ -118270,7 +118602,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 @@ -118299,7 +118631,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 @@ -118359,7 +118691,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+19112, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -118375,7 +118707,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+19070, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19142, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -118398,10 +118730,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 { @@ -118409,7 +118741,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) @@ -118439,7 +118771,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(144552)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -118573,7 +118905,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(144701)) } /* 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 @@ -118833,7 +119165,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) @@ -118841,7 +119173,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 @@ -118997,15 +119329,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 + 11418 + zSp2 = __ccgo_ts + 11418 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+19161, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -119062,25 +119394,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) } @@ -119212,13 +119547,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 { @@ -119296,7 +119631,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+19191, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -119346,12 +119681,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+19241, 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. @@ -119366,9 +119701,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+19305, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -119378,6 +119714,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) @@ -119412,7 +119755,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), } @@ -119460,7 +119803,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 @@ -119505,7 +119848,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) @@ -119529,7 +119872,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) @@ -119550,7 +119893,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 @@ -119673,7 +120016,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 { @@ -119800,10 +120143,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 @@ -119811,7 +120154,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 @@ -119988,7 +120331,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+19342, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -120099,8 +120442,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) @@ -120108,7 +120451,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) } @@ -120193,13 +120536,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19290 + z = __ccgo_ts + 19362 case int32(TK_INTERSECT): - z = __ccgo_ts + 19300 + z = __ccgo_ts + 19372 case int32(TK_EXCEPT): - z = __ccgo_ts + 19310 + z = __ccgo_ts + 19382 default: - z = __ccgo_ts + 19317 + z = __ccgo_ts + 19389 break } return z @@ -120220,7 +120563,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+19395, libc.VaList(bp+8, zUsage)) } /* @@ -120257,13 +120600,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 + 19418 } 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+19432, 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+19463, 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) @@ -120287,11 +120630,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 @@ -120507,7 +120850,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 + 16922 } 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)) @@ -120620,7 +120963,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 */ @@ -120629,7 +120972,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) @@ -120653,13 +120996,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 + 16922 } 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+12597, 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))) @@ -120667,7 +121010,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+19509, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120721,7 +121064,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) } @@ -120759,7 +121102,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 + 16922 } zName = v3 } else { @@ -120774,7 +121117,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+19509, 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. @@ -120810,7 +121153,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+19518, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -120929,7 +121272,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 + 19454 + zType = __ccgo_ts + 19526 } else { zType = uintptr(0) j = int32(1) @@ -120995,7 +121338,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) } @@ -121023,7 +121366,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) } @@ -121073,7 +121416,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 @@ -121096,7 +121439,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 @@ -121244,7 +121587,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+19530, 0) return } /* Obtain authorization to do a recursive query */ @@ -121281,7 +121624,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 @@ -121292,7 +121635,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 @@ -121306,7 +121649,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 @@ -121337,7 +121680,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+19579, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -121352,7 +121695,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+19621, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -121380,7 +121723,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+19627, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -121435,9 +121778,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 + 19642 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19572, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19644, 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) { @@ -121545,8 +121888,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+19667, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19682, 0) } /* Generate code for the left and right SELECT statements. */ @@ -121571,7 +121914,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+19362, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121597,7 +121940,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 @@ -121623,7 +121966,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+19701, 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 @@ -121655,11 +121998,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 @@ -121681,7 +122024,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+19701, 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 @@ -121788,6 +122131,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) } @@ -121804,9 +122148,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+19722, 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+19768, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121877,7 +122221,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+19342, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -122093,7 +122437,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) @@ -122125,7 +122469,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 { @@ -122179,16 +122523,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 @@ -122206,32 +122550,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+19850, 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+19861, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -122244,7 +122588,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+19866, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -122454,11 +122798,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))) } @@ -122619,7 +122963,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 @@ -122809,9 +123153,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. @@ -123023,7 +123367,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) @@ -123170,7 +123514,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) @@ -123460,11 +123804,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 { @@ -123529,7 +123873,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 @@ -123547,12 +123891,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 { @@ -124034,7 +124378,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 @@ -124080,13 +124424,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+15761) == 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+15765) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -124174,8 +124518,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+19872, 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 @@ -124199,7 +124543,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 @@ -124281,7 +124625,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) @@ -124299,7 +124643,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+19890, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -124447,7 +124791,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) } @@ -124475,7 +124819,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+19913, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -124497,12 +124841,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+19933, 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 @@ -124519,7 +124863,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 + 19976 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 { @@ -124550,7 +124894,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+19999, 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) } @@ -124559,9 +124903,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 + 20037 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19999 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20071 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -124610,7 +124954,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) { @@ -124620,7 +124964,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+20109, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124716,7 +125060,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) @@ -124725,7 +125069,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) } @@ -124776,7 +125120,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+20113, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124791,7 +125135,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+20152, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124806,7 +125150,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+15293, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124930,7 +125274,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 } @@ -124947,7 +125291,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+20183, 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) } @@ -125026,7 +125370,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+20188, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -125039,7 +125383,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+12597, 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) @@ -125059,9 +125403,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+20197, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20143, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20215, 0) } } } @@ -125075,7 +125419,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+20235, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -125324,7 +125668,7 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint (*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))) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -125377,7 +125721,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 @@ -125414,12 +125758,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+20266, 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+20317, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -125440,7 +125784,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+20350, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -125579,7 +125923,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 @@ -125687,7 +126031,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 @@ -125754,7 +126098,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 + 20383 } else { v1 = __ccgo_ts + 1667 } @@ -125763,7 +126107,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+20406, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125795,7 +126139,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)) @@ -125924,6 +126268,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. // */ @@ -125952,7 +126297,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+16075) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -125985,9 +126330,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 */ } @@ -125997,13 +126342,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 { @@ -126023,7 +126368,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) } @@ -126196,8 +126541,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 @@ -126206,11 +126551,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 { @@ -126226,7 +126571,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)) @@ -126250,14 +126595,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+20418, 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) @@ -126358,7 +126703,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+20472, 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 @@ -126559,14 +126904,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+20512, 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) @@ -126598,7 +126943,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 @@ -126613,7 +126958,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+20527, 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 { @@ -126667,7 +127012,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 @@ -126700,7 +127045,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 @@ -126759,7 +127104,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 @@ -126788,6 +127133,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)) @@ -126810,10 +127162,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) @@ -126847,8 +127199,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 @@ -126863,8 +127215,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 @@ -126893,8 +127245,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++ } @@ -126924,11 +127276,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.Uint16FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -126962,47 +127314,47 @@ 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)) /* 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)) /* Begin a loop that will extract all source rows in GROUP BY order. @@ -127012,16 +127364,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 @@ -127039,11 +127391,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 + 20543 } else { - v46 = __ccgo_ts + 20480 + v47 = __ccgo_ts + 20552 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19323, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19395, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -127057,8 +127409,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -127076,8 +127428,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -127088,12 +127440,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) @@ -127142,12 +127494,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++ } @@ -127217,9 +127573,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 @@ -127236,10 +127592,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 */ @@ -127266,8 +127622,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 } @@ -127307,32 +127663,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) @@ -127374,7 +127730,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+20543) } /* 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 @@ -127480,7 +127836,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 } @@ -127496,7 +127852,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+20561, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -127586,7 +127942,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) } @@ -127748,7 +128104,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+20626, 0) goto trigger_cleanup } iDb = int32(1) @@ -127788,7 +128144,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+20672, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -127798,11 +128154,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+20680, 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+20721, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127811,13 +128167,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+20672, (*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+20761, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127825,8 +128181,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+20787, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127834,15 +128190,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 + 20825 } else { - v1 = __ccgo_ts + 20760 + v1 = __ccgo_ts + 20832 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20766, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20838, 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+20875, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127862,9 +128218,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 @@ -127964,7 +128320,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+20672, 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 } @@ -127986,7 +128342,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+20921, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -128002,10 +128358,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+20969, 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+21044, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -128273,11 +128629,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+21073, 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) @@ -128315,9 +128671,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) { @@ -128332,7 +128688,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+21093, 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) } @@ -128465,11 +128821,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 + 21155 } else { - v1 = __ccgo_ts + 21090 + v1 = __ccgo_ts + 21162 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21097, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21169, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -128571,7 +128927,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+21217, 0) return int32(1) } @@ -128719,12 +129075,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) { @@ -128732,19 +129088,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) @@ -128755,7 +129114,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 @@ -128769,7 +129128,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 { @@ -128837,7 +129196,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): @@ -128936,10 +129295,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+21259, 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 @@ -128961,7 +129322,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 @@ -129033,7 +129394,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)) @@ -129449,13 +129810,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 @@ -129463,21 +129824,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 */ @@ -129524,7 +129885,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 @@ -129563,7 +129924,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 } @@ -129607,58 +129968,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+21273, 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+21309, 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 { @@ -129688,17 +130037,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++ } @@ -129710,11 +130059,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 @@ -129730,11 +130079,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 @@ -129743,18 +130092,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++ } @@ -129763,16 +130112,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. */ @@ -129790,24 +130139,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 { @@ -129833,50 +130182,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) @@ -130174,8 +130523,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -130225,8 +130574,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++ @@ -130273,11 +130622,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)) } @@ -130289,11 +130638,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. */ @@ -130336,7 +130685,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+21328) } goto update_cleanup update_cleanup: @@ -130393,13 +130742,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) { @@ -130441,11 +130790,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 @@ -130770,9 +131119,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+21269, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21341, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21273, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21345, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -130861,13 +131210,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: @@ -130875,7 +131224,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+12686, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130957,7 +131306,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+21418, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21422, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -131048,7 +131397,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 @@ -131087,17 +131436,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+21426) 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+21466) 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+21509) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -131114,7 +131463,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+21558) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -131167,7 +131516,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+15063) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131198,11 +131547,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+21585, 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+21693, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131211,7 +131560,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+21747, 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 @@ -131221,7 +131570,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+21884, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -131364,7 +131713,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) @@ -131748,7 +132097,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+12916, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131871,24 +132220,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+22007, 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+22031, 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+22130, 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 @@ -131972,7 +132326,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+22149, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -132014,9 +132368,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+22191, 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) @@ -132029,7 +132383,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 + 22221 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -132063,7 +132417,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 || 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+16813, 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 @@ -132144,13 +132498,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+22267, 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))) @@ -132231,7 +132585,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+22267, 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) @@ -132279,7 +132633,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+22286, 0) return int32(SQLITE_ERROR) } goto _1 @@ -132290,9 +132644,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(158352))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158354)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -132334,7 +132688,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) } @@ -132700,7 +133054,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 } @@ -132790,7 +133144,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 } @@ -132810,7 +133164,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) } @@ -132874,7 +133228,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(158849)) } else { ap = va switch op { @@ -132887,7 +133241,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(158871)) break } _ = ap @@ -133572,7 +133926,6 @@ type TWhereInfo1 = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo1 = TWhereInfo1 @@ -133608,10 +133961,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 + 22299 } if i == -int32(1) { - return __ccgo_ts + 16850 + return __ccgo_ts + 16922 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -133630,10 +133983,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+22306, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22240, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22312, int32(1)) } i = 0 for { @@ -133641,7 +133994,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+13306, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133650,11 +134003,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+22312, int32(1)) } i = 0 for { @@ -133662,16 +134015,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+13306, 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)) } } @@ -133718,7 +134071,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+22314, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133726,12 +134079,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+22306, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22245 + v2 = __ccgo_ts + 22317 } else { - v2 = __ccgo_ts + 22250 + v2 = __ccgo_ts + 22322 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133748,7 +134101,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+22330) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133759,9 +134112,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+22332) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5175, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } // C documentation @@ -133806,11 +134159,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 + 22334 } else { - v2 = __ccgo_ts + 22269 + v2 = __ccgo_ts + 22341 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22274, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, 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 { @@ -133823,37 +134176,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 + 11469 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22280 + zFmt = __ccgo_ts + 22352 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22313 + zFmt = __ccgo_ts + 22385 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22338 + zFmt = __ccgo_ts + 22410 } else { - zFmt = __ccgo_ts + 22356 + zFmt = __ccgo_ts + 22428 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22365, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22437, 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 + 16922 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22445, 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+22404, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22476, libc.VaList(bp+144, zRowid)) cRangeOp = uint8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133863,14 +134216,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22414, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22486, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22419) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22491) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22441 + v3 = __ccgo_ts + 22513 } else { - v3 = __ccgo_ts + 22449 + v3 = __ccgo_ts + 22521 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -133891,7 +134244,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+22527, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133957,14 +134310,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+22538, 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+22317, 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+22559, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -133988,16 +134341,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+22306, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22245, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22317, 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 @@ -134202,7 +134555,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 @@ -134281,7 +134634,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 */ @@ -134401,7 +134754,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i 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)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(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)) } @@ -134413,7 +134766,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } else { v3 = n } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(v3))) eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } pX = pExpr @@ -134451,10 +134804,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 @@ -134643,7 +134996,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 @@ -134774,7 +135127,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 @@ -135056,7 +135409,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 @@ -135117,11 +135470,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 @@ -135152,6 +135505,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 { @@ -135290,7 +135646,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 @@ -135370,7 +135726,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 @@ -135404,7 +135760,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 @@ -135526,7 +135882,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 @@ -135719,7 +136075,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: @@ -135733,12 +136089,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 { @@ -135776,11 +136133,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 */ @@ -135800,7 +136157,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 } @@ -135836,21 +136193,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 @@ -135868,7 +136225,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, @@ -135923,7 +136280,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+22567, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135946,7 +136303,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+22582, 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)) @@ -136435,9 +136792,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 @@ -136446,7 +136803,7 @@ 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+22591, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { @@ -136492,15 +136849,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 @@ -136512,7 +136870,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) { @@ -136585,7 +136943,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) @@ -136983,19 +137341,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16699, + FzOp: __ccgo_ts + 16771, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16033, + FzOp: __ccgo_ts + 16105, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15512, + FzOp: __ccgo_ts + 15564, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22533, + FzOp: __ccgo_ts + 22605, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -137783,7 +138141,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+22612, 0) return } } else { @@ -137795,10 +138153,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+22612, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137879,7 +138237,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) @@ -137980,7 +138338,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 + 22653 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -138511,7 +138869,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+22660, 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) @@ -138583,7 +138941,6 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo @@ -138594,7 +138951,6 @@ type THiddenIndexInfo1 = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo1 = THiddenIndexInfo1 @@ -139627,7 +139983,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)<>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 @@ -142244,7 +142596,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { + })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0)) { if libc.Int32FromUint16((*(*struct { FnEq Tu16 FnBtm Tu16 @@ -142448,7 +142800,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 @@ -142732,7 +143084,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) } } @@ -142910,7 +143262,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)) @@ -143251,7 +143603,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+22733, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143326,7 +143678,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+22733, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143480,7 +143832,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(168893)) /* 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) @@ -143916,7 +144268,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+22759, 0) rc = SQLITE_OK } else { break @@ -145124,7 +145476,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+22794, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145702,7 +146054,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 @@ -145858,7 +146210,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+22812, 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 @@ -145879,11 +146231,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) @@ -145931,7 +146280,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+22840, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -146076,7 +146425,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 @@ -146110,7 +146460,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. @@ -146236,7 +146586,7 @@ 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 @@ -146267,16 +146617,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 @@ -146455,7 +146805,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 { @@ -146662,7 +147012,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 @@ -146672,7 +147022,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+22858, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146722,7 +147072,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 } @@ -146991,7 +147341,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+22887, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -147173,7 +147523,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+22943, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -147499,7 +147849,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+22988, libc.VaList(bp+8, zName)) } return p } @@ -147550,12 +147900,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+23007, 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+23078, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -147628,7 +147978,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 } @@ -147766,7 +148116,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( 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 { @@ -147910,7 +148260,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+23141, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147946,7 +148296,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)) } @@ -147961,7 +148311,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 @@ -147980,11 +148330,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 { @@ -148030,11 +148380,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 @@ -148051,7 +148401,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)) @@ -148073,7 +148423,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 @@ -148197,7 +148547,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+23167, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -148265,18 +148615,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 + 23199 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23144 + zErr = __ccgo_ts + 23216 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23160 + zErr = __ccgo_ts + 23232 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23180, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23252, 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 { @@ -148300,7 +148650,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+23285, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -148406,24 +148756,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 @@ -148441,12 +148791,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) } @@ -148458,15 +148808,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 @@ -148518,11 +148868,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 + 23332, + 1: __ccgo_ts + 23385, + 2: __ccgo_ts + 22887, + 3: __ccgo_ts + 23436, + 4: __ccgo_ts + 23488, } var _aOp1 = [5]int32{ @@ -149102,7 +149452,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 } @@ -149198,7 +149548,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 '' */ @@ -149915,12 +150265,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 @@ -149928,13 +150278,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 @@ -149954,13 +150304,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 @@ -149987,7 +150337,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 @@ -150206,6 +150556,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. @@ -150266,7 +150620,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+23538, libc.VaList(bp+8, p)) } // C documentation @@ -150280,6 +150634,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) } @@ -150313,11 +150668,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 + 23562 } else { - v1 = __ccgo_ts + 23499 + v1 = __ccgo_ts + 23571 } - _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+23577, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -150326,7 +150681,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+23619, 0) } } } @@ -150432,7 +150787,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+23653, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -156953,13 +157308,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) } @@ -158889,20 +159244,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+16922, 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+23691, 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+16858, 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+23691, 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 @@ -158943,7 +159298,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 */ @@ -159088,7 +159448,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 */ @@ -159178,9 +159543,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) } @@ -159535,7 +159900,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+23718) 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,9 +160250,9 @@ _237: */ _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 + v347 = __ccgo_ts + 8102 } else { - v347 = __ccgo_ts + 8082 + v347 = __ccgo_ts + 8107 } *(*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 { @@ -160129,15 +160494,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+23727, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23750, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23822, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23834, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23906, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -160279,7 +160644,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 */ @@ -160473,7 +160838,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+23919, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23991, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -163204,14 +163569,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)< int32(65528) { sz = int32(65528) } - if cnt < 0 { + /* 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 > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } szAlloc = int64(sz) * int64(cnt) - if sz == 0 || cnt == 0 { + 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)) @@ -164687,7 +165061,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182779)) + return _sqlite3MisuseError(tls, int32(183820)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164707,7 +165081,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+24078, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -165008,14 +165382,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 + 24621 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -165027,31 +165401,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 + 24146, + 1: __ccgo_ts + 24159, + 3: __ccgo_ts + 24175, + 4: __ccgo_ts + 24200, + 5: __ccgo_ts + 24214, + 6: __ccgo_ts + 24233, 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 + 24258, + 9: __ccgo_ts + 24295, + 10: __ccgo_ts + 24307, + 11: __ccgo_ts + 24322, + 12: __ccgo_ts + 24355, + 13: __ccgo_ts + 24373, + 14: __ccgo_ts + 24398, + 15: __ccgo_ts + 24427, + 17: __ccgo_ts + 6130, + 18: __ccgo_ts + 5534, + 19: __ccgo_ts + 24444, + 20: __ccgo_ts + 24462, + 21: __ccgo_ts + 24480, + 23: __ccgo_ts + 24514, + 25: __ccgo_ts + 24535, + 26: __ccgo_ts + 24561, + 27: __ccgo_ts + 24584, + 28: __ccgo_ts + 24605, } // C documentation @@ -165198,6 +165572,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 // // /* @@ -165230,7 +165618,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i 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(183430)) + return _sqlite3MisuseError(tls, int32(184509)) } 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) @@ -165273,7 +165661,7 @@ 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+24702, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165399,7 +165787,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+24765, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -165430,7 +165818,7 @@ 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) } @@ -165674,7 +166062,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(184046)) + return _sqlite3MisuseError(tls, int32(185125)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*uint8)(unsafe.Pointer(zDb)) != 0 { @@ -165684,7 +166072,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+24816, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165806,7 +166194,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(184182))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185261))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165938,7 +166326,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(184261)) + return _sqlite3MisuseError(tls, int32(185340)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165948,7 +166336,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(184270)) + return _sqlite3MisuseError(tls, int32(185349)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165997,7 +166385,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(184318)) + return _sqlite3MisuseError(tls, int32(185397)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -166006,7 +166394,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+24837, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -166153,7 +166541,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+24905, 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 @@ -166183,8 +166571,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+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+24911, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24921, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -166273,24 +166661,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+24949, 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+24953, 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 + 24953 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24902, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24974, 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 @@ -166319,12 +166707,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+24989, 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+25009, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -166348,7 +166736,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+25033, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -166368,11 +166756,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24887, + Fz: __ccgo_ts + 24959, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24894, + Fz: __ccgo_ts + 24966, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -166383,19 +166771,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24907, + Fz: __ccgo_ts + 24979, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24910, + Fz: __ccgo_ts + 24982, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24913, + Fz: __ccgo_ts + 24985, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17920, + Fz: __ccgo_ts + 17992, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -166523,8 +166911,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+22653, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25049, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -166545,10 +166933,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(184993)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186072)) /* 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) } @@ -166557,7 +166945,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) } @@ -166584,9 +166972,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 + 24051 (*(*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 { @@ -166680,7 +167068,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 + 25055 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166840,7 +167228,7 @@ 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) @@ -166897,20 +167285,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+25058, 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+25083) } 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+25103) } 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+25110) } // C documentation @@ -166935,9 +167323,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) @@ -166964,29 +167352,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 @@ -167041,15 +167418,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+25127, 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) @@ -167228,8 +167605,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 @@ -167673,7 +168050,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: ; @@ -168069,7 +168446,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+25155, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -168287,7 +168664,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 + 25163 } else { v2 = uintptr(0) } @@ -168366,7 +168743,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) @@ -168533,7 +168910,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 @@ -168750,6 +169127,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -169062,8 +169446,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 @@ -169120,7 +169504,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 @@ -169130,7 +169514,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 @@ -169168,18 +169552,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 + 25186, + 12: __ccgo_ts + 25192, 13: __ccgo_ts + 1667, 14: __ccgo_ts + 1667, 15: __ccgo_ts + 1667, @@ -169666,7 +170050,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) { @@ -169964,8 +170348,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 + 25127 + 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 + 25127 + 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) } } @@ -170101,7 +170485,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+15507, 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)) @@ -170115,14 +170499,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+25199, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -170176,7 +170558,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+25228, -int32(1)) } } } @@ -170459,8 +170841,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(3), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25188, - FzRepl: __ccgo_ts + 25192, + FzMatch: __ccgo_ts + 25243, + FzRepl: __ccgo_ts + 25247, }, 1: { Fc1: uint8('i'), @@ -170468,8 +170850,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(8), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25200, - FzRepl: __ccgo_ts + 25192, + FzMatch: __ccgo_ts + 25255, + FzRepl: __ccgo_ts + 25247, }, 2: { Fc1: uint8('n'), @@ -170484,7 +170866,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: uint8('Q'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25209, + FzMatch: __ccgo_ts + 25264, FzRepl: __ccgo_ts + 1653, }, 4: { @@ -170492,7 +170874,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: uint8('S'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25214, + FzMatch: __ccgo_ts + 25269, FzRepl: __ccgo_ts + 1653, }, } @@ -170508,7 +170890,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+25274, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -170526,23 +170908,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 } @@ -170620,7 +171002,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 @@ -170691,7 +171073,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) + } } } } @@ -170966,7 +171352,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+25317, 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') { @@ -171396,7 +171782,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 { @@ -171435,7 +171821,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[*(*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)) } @@ -171443,7 +171829,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8082, 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)) } @@ -171520,14 +171906,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+25188, 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+25243, 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+25271) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25326) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25278) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25333) } - 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+25339, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171712,7 +172098,7 @@ _38: goto _51 } if libc.Int32FromUint8(_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+25333) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171757,7 +172143,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+25173, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25228, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171770,7 +172156,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+25228, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171819,10 +172205,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) @@ -171856,15 +172238,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 @@ -171937,11 +172319,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: ; @@ -171990,9 +172372,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25192 + v19 = __ccgo_ts + 25247 } else { - v19 = __ccgo_ts + 11944 + v19 = __ccgo_ts + 11969 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -172028,9 +172410,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: ; @@ -172057,7 +172442,7 @@ _11: sz2 -= k2 } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25290, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25345, uint32(2)) zIn2++ sz2-- continue @@ -172080,7 +172465,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, uint8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25293, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25348, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -172088,12 +172473,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25300, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25355, 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+25360, uint32(6)) case int32('\r'): if sz2 > uint32(2) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -172273,7 +172658,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+25367, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172296,12 +172681,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+25370, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25312, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25367, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172316,50 +172701,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 // // /* @@ -172411,6 +172752,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 // // /* @@ -172431,6 +172850,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)) @@ -172503,9 +172925,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 @@ -172548,7 +172970,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 @@ -173036,7 +173469,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+25228, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -173171,7 +173604,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 } @@ -173272,7 +173705,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+25228, -int32(1)) return } @@ -173309,11 +173742,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+25199, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -173326,7 +173756,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+25228, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -173345,10 +173775,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+25278) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25333) } 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+25271) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25326) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -173387,7 +173817,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+25373, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -173403,7 +173833,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. // ** @@ -173484,7 +173914,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+25228, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -173496,34 +173926,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; +// ** 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. +// ** 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) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { + 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 (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) - return 0 + 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 (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - 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 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) @@ -173606,7 +174056,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 @@ -173666,7 +174116,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+25228, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173801,7 +174251,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 + 25336 + v1 = __ccgo_ts + 25391 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173811,7 +174261,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+25228, -int32(1)) } } eErr = uint8(1) @@ -173921,23 +174371,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+25393, uint32(1)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25340, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25395, 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 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+25342, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25397, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25345, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25400, uint32(1)) } } } @@ -173977,7 +174427,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+25228, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -174245,7 +174695,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+25228, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -174269,7 +174719,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+25402, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -174280,7 +174730,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+25453, -int32(1)) _jsonStringReset(tls, bp) return } @@ -174352,7 +174802,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+25228, -int32(1)) } } goto json_remove_done @@ -174389,7 +174839,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+16027) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -174420,9 +174870,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 + 25487 } else { - v1 = __ccgo_ts + 25436 + v1 = __ccgo_ts + 25491 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -174470,7 +174920,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+25228, -int32(1)) } } goto json_type_done @@ -174517,7 +174967,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 + 25498 (*(*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)) @@ -174591,17 +175041,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+25503, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -174610,18 +175059,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 @@ -174683,9 +175131,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))) @@ -174792,7 +175238,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+25560, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174884,20 +175330,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))) + } } } @@ -174941,7 +175389,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+25563, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -175044,7 +175492,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+25566) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -175178,7 +175626,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+25649, 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 @@ -175204,9 +175652,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+25656, 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+25664, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -175517,9 +175965,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))) @@ -175592,7 +176039,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+25670, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -175616,7 +176063,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+25228, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175677,186 +176124,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 + 25672, }, 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 + 25677, }, 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 + 25683, }, 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 + 25694, }, 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 + 25706, }, 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 + 25706, }, 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 + 25724, }, 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 + 25744, }, 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 + 25757, }, 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 + 25771, }, 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 + 25774, }, 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 + 25778, }, 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 + 25790, }, 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 + 25803, }, 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 + 25815, }, 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 + 25828, }, 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 + 25839, }, 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 + 25851, }, 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 + 25851, }, 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 + 25863, }, 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 + 25874, }, 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 + 25886, }, 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 + 25899, }, 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 + 25912, }, 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 + 25926, }, 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 + 25935, }, 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 + 25945, }, 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 + 25945, }, 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 + 25955, }, 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 + 25955, }, 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 + 25966, }, 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 + 25983, }, 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 + 26001, }, 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 + 26019, }, } @@ -175939,17 +176386,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25983, + FzName: __ccgo_ts + 26038, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25993, + FzName: __ccgo_ts + 26048, 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 @@ -176057,7 +176506,6 @@ type TRtreeMatchArg = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - FaParam [1]TRtreeDValue } type RtreeMatchArg = TRtreeMatchArg @@ -176340,11 +176788,12 @@ type TRtreeMatchArg1 = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - 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 ** clang, since clang works hard to be gcc compatible. So the gcc @@ -176420,7 +176869,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) } @@ -176526,7 +176975,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 @@ -176589,7 +177038,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+26058, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -176600,7 +177049,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 { @@ -176894,7 +177343,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+26063, 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 { @@ -177431,7 +177880,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) } @@ -177811,7 +178260,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+26145) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177889,7 +178338,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) @@ -178120,7 +178569,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 } @@ -178128,7 +178577,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 @@ -178366,7 +178815,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: @@ -178788,7 +179237,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 @@ -179301,7 +179750,7 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179318,7 +179767,7 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179346,7 +179795,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+26159, 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 { @@ -179356,11 +179805,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+26179, 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+26211, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -179574,7 +180023,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+26248, 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)) @@ -179628,9 +180077,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 + 26393 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+11798, 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) { @@ -179688,9 +180137,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 + 26449, + 1: __ccgo_ts + 5595, + 2: __ccgo_ts + 16922, } var _rtreeModule = Tsqlite3_module{ @@ -179734,21 +180183,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+26863, 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+26925, 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+26930, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26994, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27064, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179778,7 +180227,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 + 27113 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179793,31 +180242,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+27221, 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+27266, 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+13306, 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+27293, 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+27315, 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+27323, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179831,14 +180280,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 + 26454, + 1: __ccgo_ts + 26507, + 2: __ccgo_ts + 26552, + 3: __ccgo_ts + 26604, + 4: __ccgo_ts + 26658, + 5: __ccgo_ts + 26703, + 6: __ccgo_ts + 26761, + 7: __ccgo_ts + 26816, } // C documentation @@ -179896,7 +180345,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+27339, 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) @@ -179904,17 +180353,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+27359, 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))) @@ -179977,7 +180426,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) } @@ -179991,13 +180440,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+27602, 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+27608, 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) { @@ -180006,7 +180455,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+27577, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27632, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -180020,19 +180469,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+27659, 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))) } } } @@ -180055,7 +180504,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)) @@ -180066,7 +180515,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 @@ -180082,8 +180531,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27583, - 1: __ccgo_ts + 27594, + 0: __ccgo_ts + 27638, + 1: __ccgo_ts + 27649, } // C documentation @@ -180141,21 +180590,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+11418, 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+27662, 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+27668, 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+27672, int32(1)) goto _1 _1: ; @@ -180182,7 +180631,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+27674, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -180285,7 +180734,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) @@ -180300,11 +180749,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+27707, 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) } @@ -180338,7 +180787,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+27714, 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) @@ -180355,7 +180804,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+27759, libc.VaList(bp+8, iNode)) } } return pRet @@ -180384,8 +180833,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 + 27791, + 1: __ccgo_ts + 27845, } 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)) @@ -180398,21 +180847,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 + 27893 } else { - v1 = __ccgo_ts + 27846 + v1 = __ccgo_ts + 27901 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27855, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27910, 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 + 27893 } else { - v2 = __ccgo_ts + 27846 + v2 = __ccgo_ts + 27901 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27900, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27955, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -180457,7 +180906,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+28013, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -180475,7 +180924,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+28061, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -180508,19 +180957,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+28128, 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+28162, 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+28192, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -180565,12 +181014,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+28247, 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+28278, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -180599,7 +181048,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+28345, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -180609,11 +181058,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+26159, 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+28373, 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)) @@ -180629,8 +181078,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+28404, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28411, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -180657,7 +181106,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+28419, 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) } @@ -180708,13 +181157,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+28438, -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))) } @@ -180723,7 +181172,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 + 18689 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -180990,7 +181439,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++ @@ -181035,7 +181484,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 @@ -181097,7 +181546,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 } @@ -181465,7 +181914,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 @@ -181480,9 +181929,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: ; @@ -181567,7 +182016,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 { @@ -181708,7 +182157,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 // ** @@ -181747,7 +182196,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) } @@ -181851,7 +182300,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 @@ -181935,7 +182384,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 @@ -182219,7 +182668,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) { @@ -182376,7 +182825,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 @@ -182388,13 +182837,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+27602, 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+28562, 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) @@ -182403,13 +182852,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+28584, 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+27659, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -182417,7 +182866,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) @@ -182432,7 +182881,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 @@ -182644,7 +183093,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 + 16922 (*(*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) @@ -182654,7 +183103,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 + 28588 (*(*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) @@ -182662,7 +183111,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 + 28594 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182782,7 +183231,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+28603, 0) } goto geopoly_update_end } @@ -182885,12 +183334,12 @@ geopoly_update_end: func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28588) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28643) == 0 { *(*uintptr)(unsafe.Pointer(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 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28659) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) @@ -182961,7 +183410,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+28836, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -182975,61 +183424,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28619, + FzName: __ccgo_ts + 28674, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28632, + FzName: __ccgo_ts + 28687, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28645, + FzName: __ccgo_ts + 28700, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28658, + FzName: __ccgo_ts + 28713, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28604, + FzName: __ccgo_ts + 28659, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28670, + FzName: __ccgo_ts + 28725, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28588, + FzName: __ccgo_ts + 28643, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28693, + FzName: __ccgo_ts + 28748, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28707, + FzName: __ccgo_ts + 28762, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28720, + FzName: __ccgo_ts + 28775, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28734, + FzName: __ccgo_ts + 28789, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28750, + FzName: __ccgo_ts + 28805, }, } @@ -183055,7 +183504,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28762, + FzName: __ccgo_ts + 28817, }, } @@ -183080,20 +183529,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+28844, 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+28854, 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+28865, -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+28588, 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+28876, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -183167,7 +183616,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) @@ -183195,7 +183644,7 @@ 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+26145, __ccgo_fp(_rtreeMatchArgFree)) } } } @@ -183436,7 +183885,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 @@ -184412,7 +184861,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+28886, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -184422,7 +184871,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+28886, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -184448,7 +184897,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 @@ -184471,7 +184920,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 } @@ -184603,7 +185052,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+28907, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184692,7 +185141,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+26058, 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')) { @@ -184729,13 +185178,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 + 29078 } 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+29119, 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+29269) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184902,7 +185351,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))) } } @@ -184963,7 +185412,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+29394, 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 @@ -184973,7 +185422,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+29513, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -184981,7 +185430,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+29534, 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) @@ -184993,7 +185442,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+29585, 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 { @@ -185037,7 +185486,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+29606, 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))) { @@ -185050,7 +185499,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+29634, 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 { @@ -185103,7 +185552,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+20197, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -185114,7 +185563,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+29663, 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) @@ -185125,7 +185574,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+29682, 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 @@ -185133,7 +185582,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+29687, zName) { bRbuRowid = int32(1) } } @@ -185147,17 +185596,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 + 29697 } else { - v4 = __ccgo_ts + 29655 + v4 = __ccgo_ts + 29710 } - (*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+29719, 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+29748, 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)) @@ -185179,7 +185628,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+29770, 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)) @@ -185225,8 +185674,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+29797, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15174 goto _1 _1: ; @@ -185260,7 +185709,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+29806, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -185308,21 +185757,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+29819, 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+29851, 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+15174, __ccgo_ts+29874) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29880, __ccgo_ts+29887, __ccgo_ts+5201) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15174, __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+29895, 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+29937, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -185374,7 +185823,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+29634, 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)) @@ -185396,15 +185845,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 + 29957 } } 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+29965, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29986, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30022, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15174 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -185413,7 +185862,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+30049, 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 @@ -185430,15 +185879,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+30097, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15174 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+30104, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -185496,7 +185945,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+29634, 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)) @@ -185505,7 +185954,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+30116, 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 { @@ -185525,9 +185974,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 + 29957 } else { - zCol = __ccgo_ts + 29632 + zCol = __ccgo_ts + 29687 } } zType = __ccgo_ts + 1141 @@ -185535,24 +185984,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+30138, 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 + 29874 } 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+30158, 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+30179, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30212, 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 + 15174 + zAnd = __ccgo_ts + 22306 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185606,11 +186055,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+30236, 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+30248, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15149 + zS = __ccgo_ts + 15174 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -185622,7 +186071,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+30257, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -185648,7 +186097,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+30272, 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 @@ -185658,15 +186107,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+30286, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22306 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30243, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30298, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1667 i1 = 0 @@ -185676,8 +186125,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+30348, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22306 } goto _2 _2: @@ -185700,7 +186149,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+30361, 0) } // C documentation @@ -185742,16 +186191,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+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+30348, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15174 } else { if libc.Int32FromUint8(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+30387, 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 + 15174 } else { if libc.Int32FromUint8(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+30417, 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 + 15174 } } } @@ -185835,16 +186284,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 + 30454 *(*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+29606, 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+16810) == 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+29634, libc.VaList(bp+24, zIdx))) } break } @@ -185855,16 +186304,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 + 29874 } 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+30467, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15174 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30423, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30478, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -185910,7 +186359,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+30482) 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))) { @@ -185918,7 +186367,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+29634, 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))) { @@ -185927,21 +186376,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+30532, 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 + 29874 } 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+30554, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15174 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30509, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30564, 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+30579, 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)) } } @@ -185978,7 +186427,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) { @@ -185987,19 +186436,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 + 30641 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30599 + v2 = __ccgo_ts + 30654 } 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+30664, 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 + 15174 goto _1 _1: ; @@ -186008,17 +186457,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+30691, 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 + 30698 } 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+30713, 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)) } } @@ -186044,7 +186493,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+30745, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -186090,7 +186539,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+30802) } 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)) @@ -186259,7 +186708,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+30868, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -186276,18 +186725,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+30888, 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+30953, 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+30989, 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 { @@ -186302,26 +186751,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 + 31023 } else { - v2 = __ccgo_ts + 30972 + v2 = __ccgo_ts + 31027 } 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+31033, 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+31094, 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 + 31023 } else { - v3 = __ccgo_ts + 30972 + v3 = __ccgo_ts + 31027 } - 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+31155, 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 { @@ -186340,8 +186789,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). */ @@ -186350,39 +186799,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 + 31314 } 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 + 31323 } 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+31333, 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+31369, 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 + 31397 } /* 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 + 31409 } 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+31426, 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+31502, 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+31801, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -186393,9 +186842,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 + 31900 } else { - v7 = __ccgo_ts + 31855 + v7 = __ccgo_ts + 31910 } zRbuRowid1 = v7 } @@ -186408,14 +186857,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+29957, 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+15174, __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 + 31921 } else { v8 = __ccgo_ts + 1667 } @@ -186425,11 +186874,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 + 23562 } 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+31927, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -186517,9 +186966,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 + 31314 } - 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+31975, 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 } @@ -186546,7 +186995,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) } @@ -186593,7 +187042,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+32005, 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): @@ -186652,27 +187101,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+32035, 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+32063, 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+32081, 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 } @@ -186705,10 +187154,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+32147, 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+24905, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*uint8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186724,14 +187173,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 + 32179 } 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+32181, 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 @@ -186742,27 +187191,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+32213, -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+32228, 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+32245, -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+32261, 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+32289, 0) } } @@ -186848,7 +187297,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { if pState == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32206, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32261, uintptr(0), uintptr(0), uintptr(0)) } } /* Assuming no error has occurred, run a "restart" checkpoint with the @@ -186881,7 +187330,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CAPTURE) - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32252, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32307, uintptr(0), uintptr(0), uintptr(0)) if rc2 != int32(SQLITE_NOTICE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -186944,7 +187393,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) } @@ -187014,16 +187463,16 @@ 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) + 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_methods1)(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) } - 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)) @@ -187045,7 +187494,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+32342, 0) } // C documentation @@ -187062,13 +187511,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+32367, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32374, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -187200,7 +187649,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+24462, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -187336,7 +187785,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+32381) 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 @@ -187349,7 +187798,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+32403, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -187376,7 +187825,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+32430, 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))) @@ -187412,9 +187861,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+32590, 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+32605, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -187437,9 +187886,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+32625, 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+32650) } 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) @@ -187450,10 +187899,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+32758) } 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+32823) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -187471,7 +187920,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+32867, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -187498,8 +187947,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+17895) + _rbuCopyPragma(tls, p, __ccgo_ts+17006) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -187507,7 +187956,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+32892, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -187529,10 +187978,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+15078, 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+15078, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -187619,7 +188068,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+32920, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -187642,10 +188091,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+32367, 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) } @@ -187667,7 +188116,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+32890, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32945, 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) @@ -187714,7 +188163,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+32956, 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 { @@ -187759,11 +188208,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+33028, 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+33042) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187772,7 +188221,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+33099) 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) @@ -187820,7 +188269,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 @@ -187852,7 +188301,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+33173, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187874,17 +188323,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 + 33205 } else { - v3 = __ccgo_ts + 33157 + v3 = __ccgo_ts + 33212 } - (*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+33219, 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+15063, 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) @@ -187896,21 +188345,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+17609) + _rbuCopyPragma(tls, p, __ccgo_ts+17021) } /* 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+33251, 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+33267, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -187988,7 +188437,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+33291, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -188035,7 +188484,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+31314, 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++ @@ -188063,7 +188512,7 @@ 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+15078, 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) { @@ -188072,7 +188521,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { } _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+15078, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -188082,7 +188531,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+33299, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -188183,7 +188632,7 @@ 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+15078, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ @@ -188196,19 +188645,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { 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+15078, 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 + 15063 } else { - v1 = __ccgo_ts + 33196 + v1 = __ccgo_ts + 33251 } 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+33251, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -188694,7 +189143,7 @@ func _rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileSize})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, pSize) /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existence of a *-wal file. rbuVfsRead() contains ** similar logic. */ if rc == SQLITE_OK && *(*Tsqlite_int64)(unsafe.Pointer(pSize)) == 0 && (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpRbu)).FzTarget == uintptr(0) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_MAIN_DB) != 0 { *(*Tsqlite_int64)(unsafe.Pointer(pSize)) = int64(1024) @@ -188775,7 +189224,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xControl})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, int32(SQLITE_FCNTL_ZIPVFS), bp) if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33271, 0) + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33326, 0) } else { if rc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p @@ -188801,7 +189250,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r if rc == SQLITE_OK && op == int32(SQLITE_FCNTL_VFSNAME) { pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs zIn = *(*uintptr)(unsafe.Pointer(pArg)) - zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33294, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33349, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -188996,7 +189445,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag if pDb != 0 { if (*Trbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == int32(RBU_STAGE_OAL) { if (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) { - zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6715) + zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6740) zOpen = Xsqlite3_filename_wal(tls, zOpen) } nOpen = libc.Xstrlen(tls, zOpen) @@ -189010,7 +189459,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag } else { (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu } - if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33305, 0) != 0 { + if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33360, 0) != 0 { oflags = libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) } @@ -189566,7 +190015,7 @@ func _statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint _sqlite3TokenInit(tls, bp, *(*uintptr)(unsafe.Pointer(argv + 3*8))) iDb = _sqlite3FindDb(tls, db, bp) if iDb < 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12382, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12407, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) return int32(SQLITE_ERROR) } } else { @@ -189878,7 +190327,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { _sqlite3BtreeEnter(tls, pBt) nUsable = szPage - _sqlite3BtreeGetReserveNoMutex(tls, pBt) _sqlite3BtreeLeave(tls, pBt) - (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32)) + (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32))) if (*TStatPage)(unsafe.Pointer(p)).FaCell == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -189925,7 +190374,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } (*TStatCell)(unsafe.Pointer(pCell)).FnLastOvfl = libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp)) - libc.Uint32FromInt32(nLocal) - libc.Uint32FromInt32((nOvfl-int32(1))*(nUsable-int32(4)))) (*TStatCell)(unsafe.Pointer(pCell)).FnOvfl = nOvfl - (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(4)*libc.Uint64FromInt32(nOvfl)) + (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(uint64(4)*libc.Uint64FromInt32(nOvfl))) if (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -190066,7 +190515,7 @@ statNextRestart: (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiPgno = iRoot (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33316, 0) + v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33371, 0) z = v1 (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FzPath = v1 if z == uintptr(0) { @@ -190104,8 +190553,8 @@ statNextRestart: if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { (*TStatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33318 - v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33327, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33373 + v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33382, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) z = v2 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v2 if z == uintptr(0) { @@ -190134,7 +190583,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage++ if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226029)) + return _sqlite3CorruptError(tls, int32(227304)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -190145,7 +190594,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+33394, 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) { @@ -190168,13 +190617,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 + 33402 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 + 33411 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33361 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33416 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -190183,7 +190632,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) { @@ -190272,12 +190721,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+33426, 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+33581, 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+33595, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -190354,7 +190803,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+33610, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -191555,7 +192004,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) { @@ -191648,11 +192097,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+11798, 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+33617, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1667, 0) @@ -191661,7 +192110,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+33747, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191687,10 +192136,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+29957))) 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) @@ -191711,8 +192160,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+29957) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29957, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191776,7 +192225,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 @@ -191793,6 +192242,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 { @@ -191814,12 +192265,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+11798, (*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))) } } } @@ -192109,10 +192560,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 + 11418 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33722, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33777, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -192124,8 +192575,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 + 15174 goto _1 _1: ; @@ -192779,8 +193230,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+33784, 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 + 22306 if zRet == uintptr(0) { break } @@ -192809,8 +193260,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+33818, 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 + 33859 if zRet == uintptr(0) { break } @@ -192821,7 +193272,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 } @@ -192832,12 +193283,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 + 33864 } 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+33875, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192898,11 +193349,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15149 + v2 = __ccgo_ts + 15174 } 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+33954, 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 } @@ -192930,7 +193381,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+33973, 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 { @@ -192959,17 +193410,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)) @@ -192982,7 +193434,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 } @@ -192993,18 +193447,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+34030, 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+34061, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -193030,7 +193510,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+34082, 0) } rc = int32(SQLITE_SCHEMA) } @@ -193078,7 +193558,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) } @@ -193362,7 +193842,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+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) } @@ -193662,12 +194142,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+34109, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11798, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34113, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34137, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34146, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34191, bp) } else { i = 0 for { @@ -193675,17 +194155,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+15174, 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 + 15174 _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+34205, 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+34209, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -193699,7 +194179,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+34236, 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) } @@ -193841,7 +194321,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, 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+34278, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193947,7 +194427,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } } 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+34298, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -194202,13 +194682,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 } } @@ -194364,7 +194845,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(230285)) + rc = _sqlite3CorruptError(tls, int32(231591)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -194388,7 +194869,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(230305)) + rc = _sqlite3CorruptError(tls, int32(231611)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -194403,7 +194884,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(230315)) + rc = _sqlite3CorruptError(tls, int32(231621)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -194459,7 +194940,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(230363)) + rc = _sqlite3CorruptError(tls, int32(231669)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -194564,7 +195045,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(230451)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231757)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -194635,8 +195116,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) @@ -194670,7 +195151,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(230537)) + v7 = _sqlite3CorruptError(tls, int32(231843)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194680,7 +195161,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(230543)) + v10 = _sqlite3CorruptError(tls, int32(231849)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194759,7 +195240,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(230587)) + v16 = _sqlite3CorruptError(tls, int32(231893)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -195097,7 +195578,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 @@ -195169,7 +195650,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230952)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232258)) goto finished_invert } if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { @@ -195372,7 +195853,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+11798) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -195381,9 +195862,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+34316, 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+34329, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -195393,9 +195874,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+34335, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15149 + zSep = __ccgo_ts + 15174 } goto _2 _2: @@ -195404,7 +195885,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+34340, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -195413,13 +195894,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+34348, 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+34423, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22234 + zSep = __ccgo_ts + 22306 } goto _3 _3: @@ -195506,9 +195987,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+34429, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34233, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34340, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -195518,9 +195999,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+34335, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22234 + zSep = __ccgo_ts + 22306 } goto _1 _1: @@ -195528,9 +196009,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+34447, 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+33859, bp) zSep = __ccgo_ts + 1667 i = 0 for { @@ -195540,16 +196021,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+34423, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34348 + zSep = __ccgo_ts + 34455 } 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)) @@ -195575,7 +196056,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 @@ -195598,16 +196079,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+34460, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22240, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22312, 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+15174, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -195615,19 +196096,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+34478, 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+34489, 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)) } @@ -195650,12 +196131,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+11798, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34386) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34493) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34499) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34606) } return rc } @@ -195721,7 +196202,7 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231434)) + rc = _sqlite3CorruptError(tls, int32(232740)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -196137,7 +196618,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+34750, 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)) @@ -196150,7 +196631,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+34771, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -196250,10 +196731,10 @@ 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+34790, 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+34816, 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)) @@ -196284,7 +196765,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui ** 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)))) 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 @@ -196294,7 +196775,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 } @@ -196313,18 +196794,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+34846, 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+34890, 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+34961, 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+11798) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -196381,17 +196862,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34914, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35021, 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+35051, 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+35075, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35051, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -196505,7 +196986,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) } @@ -196875,7 +197356,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) } @@ -197167,7 +197648,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 { @@ -197203,11 +197684,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 @@ -197792,6 +198279,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 @@ -197837,8 +198325,7 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset @@ -197850,12 +198337,13 @@ type Fts5Colset = TFts5Colset ** This object is used by fts5_expr.c and fts5_index.c. */ type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 + FnCol 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 ** to parse the arguments passed to the CREATE VIRTUAL TABLE statement. @@ -198232,7 +198720,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -198260,16 +198747,14 @@ 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 @@ -198311,7 +198796,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 @@ -199115,7 +199600,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+35103, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -199471,7 +199956,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+35131, 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 */ } @@ -199755,7 +200240,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+35162, 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) } @@ -199854,7 +200339,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 + 35169 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199942,7 +200427,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) } @@ -200109,7 +200594,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 + 35219 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200380,7 +200865,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))) @@ -200472,13 +200957,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) } @@ -200504,13 +200989,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 + 35267 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 + 35323 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -200543,19 +201028,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35274, + FzFunc: __ccgo_ts + 35381, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35282, + FzFunc: __ccgo_ts + 35389, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35292, + FzFunc: __ccgo_ts + 35399, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35297, + FzFunc: __ccgo_ts + 35404, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200943,7 +201428,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 @@ -201419,7 +201904,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+35420, 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) { @@ -201445,12 +201930,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+35320, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35427, 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+35458, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201459,7 +201944,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+35491, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201469,14 +201954,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+35528, 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+35537, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -201503,7 +201988,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+35570, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -201515,76 +202000,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+35604, 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+35612, 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+35537, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35644, 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+35650, 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+35562, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35669, 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+35605, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35712, 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+35562, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35669, 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+35627, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35734, 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+35748, 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+35786, 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+35690, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35797, 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+35725, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35832, 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+35732, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35839, 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+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 + 17975, }, 2: { - FzName: __ccgo_ts + 35763, + FzName: __ccgo_ts + 35870, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -201592,20 +202077,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+35878, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35802, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35909, 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+35812, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35919, 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+35846, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35953, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201666,16 +202151,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+35981) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16922) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35986, 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+36016) { *(*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+36026, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201701,7 +202186,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+36057, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201709,12 +202194,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+36062, 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+36069, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35970, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36077, 0) } } goto _1 @@ -201730,9 +202215,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+36084, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35970, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36077, 0) } goto _2 _2: @@ -201795,8 +202280,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+35981) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36092, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201827,7 +202312,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+36121, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -201857,7 +202342,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+36141, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201865,37 +202350,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+36191, 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+36246, 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 + 35604 } 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 + 35604 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36192 + zTail = __ccgo_ts + 36299 } } } 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+36307, 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+16922, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201964,7 +202449,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+36318, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -201973,16 +202458,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 + 15174 } 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+36334, 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+36341, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35981)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -202140,7 +202625,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+36367) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -202151,7 +202636,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+36372) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -202162,7 +202647,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+36381) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -202176,7 +202661,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+36391) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -202187,7 +202672,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+36401) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -202204,7 +202689,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+36413) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -202219,7 +202704,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+35981) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -202234,7 +202719,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+36425) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -202250,7 +202735,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+36439) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -202293,7 +202778,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 + 36449 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -202313,7 +202798,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+36481) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -202324,7 +202809,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+36489, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -202428,11 +202913,12 @@ type TFts5ExprNode1 = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode1 = TFts5ExprNode1 +/* Size (in bytes) of an Fts5ExprNode object that holds up to N children */ + /* ** 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. @@ -202462,24 +202948,26 @@ type TFts5ExprPhrase1 = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase1 = TFts5ExprPhrase1 +/* Size (in bytes) of an Fts5ExprPhrase object that holds up to N terms */ + /* ** 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 + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset1 = TFts5ExprNearset1 +/* Size (in bytes) of an Fts5ExprNearset object covering up to N phrases */ + /* ** Parse context. */ @@ -202570,7 +203058,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+36453, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36560, 0) return FTS5_EOF } goto _1 @@ -202581,7 +203069,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+36473, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36580, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -202596,13 +203084,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+36611, 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+36614, 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+31023, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -202646,7 +203134,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) @@ -204285,7 +204773,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) @@ -204295,7 +204783,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) @@ -204401,12 +204889,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 @@ -204540,7 +205028,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) @@ -204580,15 +205068,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)) @@ -204629,7 +205117,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 { @@ -204667,8 +205155,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+36618, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35131, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204688,10 +205176,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+36516, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36623, 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: ; @@ -204725,7 +205216,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 { @@ -204775,7 +205266,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 @@ -204826,7 +205317,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+21309, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204853,7 +205344,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)) @@ -204950,7 +205441,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+36652, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -205035,7 +205526,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) @@ -205048,7 +205539,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) @@ -205122,7 +205613,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 @@ -205148,11 +205639,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 + 36705 } else { - v2 = __ccgo_ts + 36511 + v2 = __ccgo_ts + 36618 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36605, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36712, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -205165,7 +205656,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+36762, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -205309,7 +205800,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 @@ -205642,7 +206133,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) { @@ -205706,7 +206197,7 @@ 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 +** to accumulate "term -> doclist" content before it is flushed to a level-0 ** segment. */ @@ -205765,7 +206256,7 @@ type TFts5HashEntry1 = struct { type Fts5HashEntry1 = TFts5HashEntry1 /* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -205903,7 +206394,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) } @@ -206215,7 +206706,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) } @@ -206647,9 +207138,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 @@ -206686,7 +207177,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206759,7 +207249,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206794,7 +207283,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206809,9 +207297,9 @@ 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 @@ -206908,11 +207396,12 @@ type TFts5Structure1 = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure1 = TFts5Structure1 +/* Size (in bytes) of an Fts5Structure object holding up to N levels */ + /* ** An object of type Fts5SegWriter is used to write to segments. */ @@ -207045,13 +207534,15 @@ type Fts5SegIter1 = TFts5SegIter1 ** Array of tombstone pages. Reference counted. */ type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray1 = TFts5TombstoneArray1 +/* Size (in bytes) of an Fts5TombstoneArray holding up to N tombstones */ + /* ** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. @@ -207104,11 +207595,12 @@ type TFts5Iter1 = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter1 = TFts5Iter1 +/* Size (in bytes) of an Fts5Iter object holding up to N segment iterators */ + /* ** An instance of the following type is used to iterate through the contents ** of a doclist-index record. @@ -207134,13 +207626,15 @@ type TFts5DlidxLvl1 = struct { type Fts5DlidxLvl1 = TFts5DlidxLvl1 type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } 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)) *(*Tu8)(unsafe.Pointer(aOut + 1)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) & libc.Int32FromInt32(0xFF)) @@ -207319,7 +207813,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+36815, 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. @@ -207424,7 +207918,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+36821, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -207453,7 +207947,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+36872, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -207487,7 +207981,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+36921, 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) @@ -207565,7 +208059,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)) @@ -207656,7 +208150,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+36961, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207667,7 +208161,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+36961, 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)) @@ -208348,7 +208842,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) @@ -208598,7 +209092,7 @@ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _ = nByte, nTomb, pNew nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(nTomb+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) if pNew != 0 { (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb @@ -208702,7 +209196,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 @@ -209308,7 +209802,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+36989, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -209397,7 +209891,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+37073, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -210044,7 +210538,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 @@ -210954,7 +211448,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 { @@ -211368,7 +211862,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+37155, 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. */ @@ -211874,7 +212368,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+37212, 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) @@ -212043,7 +212537,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 } @@ -212361,7 +212855,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+37273, 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))) @@ -212636,7 +213130,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: @@ -212671,7 +213165,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)) @@ -213285,11 +213779,12 @@ type TFts5TokenDataIter1 = struct { 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 // // /* @@ -213357,7 +213852,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) { @@ -213601,7 +214096,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) @@ -213651,7 +214146,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 @@ -213733,15 +214228,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) } @@ -213767,11 +214265,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+37324, 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+26058, __ccgo_ts+37332, 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+12009, __ccgo_ts+37367, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -213969,7 +214467,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) @@ -214224,7 +214722,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+37411) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -214575,7 +215073,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') @@ -214697,7 +215195,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 { @@ -214817,7 +215315,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+36815, 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))) @@ -215411,7 +215909,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+37413, 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)) @@ -215642,7 +216140,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+37499) 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)) @@ -215781,7 +216279,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215938,11 +216435,12 @@ type TFts5Sorter1 = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter1 = TFts5Sorter1 +/* Size (int bytes) of an Fts5Sorter object with N indexes */ + /* ** Virtual-table cursor object. ** @@ -216264,7 +216762,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+37504, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -216301,7 +216799,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+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++ @@ -216320,7 +216818,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+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 @@ -216770,7 +217268,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 @@ -216798,7 +217296,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) } @@ -216818,7 +217316,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) @@ -216833,7 +217331,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 + 15174 } else { v1 = __ccgo_ts + 1667 } @@ -216843,11 +217341,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 + 37543 } else { - v3 = __ccgo_ts + 37441 + v3 = __ccgo_ts + 37548 } - 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+37552, 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 @@ -216905,14 +217403,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+37607, 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+37613, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216962,7 +217460,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+37641, 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)) @@ -216995,7 +217493,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+37651, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -217029,7 +217527,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+37672, libc.VaList(bp+24, z)) } } } else { @@ -217037,7 +217535,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 + 35399 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -217194,7 +217692,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+37705, 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))) } @@ -217394,7 +217892,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+37710, 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 @@ -217527,10 +218025,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. @@ -220066,12 +220564,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+39059, 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+39163, 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+39201, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -220080,7 +220578,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+39239, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -220092,14 +220590,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+26058, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12009, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38393, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36192, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36299, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35497, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35604, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -220119,13 +220617,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 + 30698 } 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+39281, 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+39311, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -220166,7 +220664,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+39355, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -220174,7 +220672,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+39378, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -220189,7 +220687,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+39384, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -220198,22 +220696,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+35604, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39283 + zCols = __ccgo_ts + 39390 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39315 + zCols = __ccgo_ts + 39422 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36192, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36299, 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+38393, __ccgo_ts+39470, 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+36481, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -220633,12 +221131,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+39487, 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+39537, 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+39566, 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. */ @@ -220646,7 +221144,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+36481, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220948,7 +221446,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+39595, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -221078,7 +221576,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) } @@ -221180,14 +221678,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+35604, 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 @@ -221839,11 +222337,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 + 39649 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) } @@ -221853,7 +222351,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+39658) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -221870,20 +222368,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+39669) { 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+39520) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39627) { 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+39638) { 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+39658) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -222175,7 +222673,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 + 39687 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -222392,64 +222890,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+39590, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39697, 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+39700, 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+39705, 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+39710, 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+39713, 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+39716, 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+39721, 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+39726, 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+39730, 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+39736, 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+39741, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222458,49 +222956,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+39745, 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+39749, 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+39752, 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+39756, 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+39760, 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+39764, 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+39768, 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+39772, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222517,20 +223015,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+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+39776, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39756, 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+39779, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39782, 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+39786, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39772, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -222546,75 +223044,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+39682, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39789, 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+39756, 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+39797, 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+39804, 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+39809, 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+39705, 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+39814, 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+39700, 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+39819, 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+39772, 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+39824, 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+16124, 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+39829, 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+39782, 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+39833, 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+39697, 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+39838, 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+39741, 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+39844, 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+39848, 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+39850, 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+39764, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -222623,48 +223121,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+39856, 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+39772, 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+39864, 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+39756, 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+39870, 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+39756, 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+39875, 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+39697, 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+39881, 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+39768, 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+39889, 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+39897, 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+39901, 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+39764, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222672,21 +223170,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+39909, 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+39697, 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+39915, 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+39768, 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+39921, 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+39782, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222704,48 +223202,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+39821, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39928, 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+39713, 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+39933, 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+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+39606, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39713, 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+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+39606, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39713, 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+39897, 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+39950, 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+39956, 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+39697, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222761,13 +223259,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+39855, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39962, 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+39966, 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+39969, 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) @@ -222775,7 +223273,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+39972, 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) @@ -222940,14 +223438,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+39976) { 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+39562) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39669) { 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 { @@ -223215,7 +223713,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+39991)) } // C documentation @@ -223241,7 +223739,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39580, + FzName: __ccgo_ts + 39687, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -223249,7 +223747,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39892, + FzName: __ccgo_ts + 39999, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -223257,7 +223755,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39884, + FzName: __ccgo_ts + 39991, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -223287,7 +223785,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+40005, pApi, bp+96, uintptr(0)) } return rc } @@ -228803,16 +229301,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+40012) == 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+40016) == 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+40020) == 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+40029, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228875,21 +229373,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 + 40063, + 1: __ccgo_ts + 40103, + 2: __ccgo_ts + 40138, } 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+24051, *(*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+40181, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228910,23 +229409,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) } @@ -229059,10 +229558,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+40214, 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+40245, 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)) } @@ -229081,7 +229580,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+40296, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -229531,7 +230030,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+40322, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -229586,7 +230085,7 @@ 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 + 40332 } type TAggInfo_col = struct { @@ -229816,7 +230315,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 @@ -229864,11 +230363,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]uint8{'3', '.', '4', '9', '.', '1'} +var Xsqlite3_version = [7]uint8{'3', '.', '5', '0', '.', '1'} 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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods @@ -229878,3 +230377,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_loong64.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_loong64.go index 338535c..9be3a6e 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/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. +// 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 @@ -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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70" +const SQLITE_SOURCE_ID = "2025-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95" 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.1" -const SQLITE_VERSION_NUMBER = 3049001 +const SQLITE_VERSION = "3.50.1" +const SQLITE_VERSION_NUMBER = 3050001 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3564,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 @@ -3573,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 @@ -4475,6 +4481,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. @@ -4831,6 +4843,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 @@ -5263,7 +5276,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -7004,11 +7016,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. */ /* @@ -7382,6 +7400,7 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem @@ -7427,6 +7446,7 @@ type THashElem1 = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem1 = THashElem1 @@ -7577,6 +7597,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. */ @@ -7635,6 +7660,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 @@ -7938,7 +7974,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData = TDbClientData @@ -8008,9 +8043,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 @@ -8025,7 +8060,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -8074,8 +8108,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 @@ -8139,7 +8173,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -8211,19 +8244,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 @@ -8237,11 +8273,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 @@ -8252,40 +8285,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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -8303,7 +8337,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -8315,6 +8349,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -8465,9 +8500,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 @@ -8522,6 +8557,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8702,7 +8738,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8744,7 +8779,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -9314,8 +9348,8 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. +/* Use SQLITE_ENABLE_EXPLAIN_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 @@ -10162,6 +10196,7 @@ type TTable1 = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table1 = TTable1 @@ -10243,11 +10278,13 @@ type TFKey1 = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey1 = TFKey1 +/* The size (in bytes) of an FKey object holding N columns. The answer +** does NOT include space to hold the zTo name. */ + /* ** SQLite supports many different ways to resolve a constraint ** error. ROLLBACK processing means that a constraint violation @@ -10296,11 +10333,12 @@ type TKeyInfo1 = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo1 = TKeyInfo1 +/* The size (in bytes) of a KeyInfo object with up to N fields */ + /* ** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. */ @@ -10702,13 +10740,16 @@ type Expr1 = TExpr1 ** expression. */ type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList1 = TExprList1 +/* The size (in bytes) of an ExprList object that is big enough to hold +** as many as N expressions. */ + /* ** Allowed values for Expr.a.eEName */ @@ -10729,12 +10770,14 @@ type ExprList1 = TExprList1 ** 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 + F__ccgo_align [0]uint64 + FnId int32 } type IdList1 = TIdList1 +/* The size (in bytes) of an IdList object that can hold up to N IDs. */ + /* ** Allowed values for IdList.eType, which determines which value of the a.u4 ** is valid. @@ -10840,13 +10883,19 @@ type OnOrUsing1 = TOnOrUsing1 ** */ type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList1 = TSrcList1 +/* Size (in bytes) of a SrcList object that can hold as many as N +** SrcItem objects. */ + +/* Size (in bytes( of a SrcList object that holds 1 SrcItem. This is a +** special case of SZ_SRCITEM(1) that comes up often. */ + /* ** Permitted values of the SrcList.a.jointype field */ @@ -11207,19 +11256,22 @@ type TParse1 = 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 @@ -11233,11 +11285,8 @@ type TParse1 = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -11248,40 +11297,41 @@ type TParse1 = 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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -11647,11 +11697,13 @@ type TWith1 = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With1 = TWith1 +/* The size (in bytes) of a With object that can hold as many +** as N different CTEs. */ + /* ** The Cte object is not guaranteed to persist for the entire duration ** of code generation. (The query flattener or other parser tree @@ -11681,11 +11733,13 @@ type TDbClientData1 = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData1 = TDbClientData1 +/* The size (in bytes) of a DbClientData object that can has a name +** that is N bytes long, including the zero-terminator. */ + /* ** This object is used in various ways, most (but not all) related to window ** functions. @@ -12851,7 +12905,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12929,7 +12982,6 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor @@ -12967,11 +13019,16 @@ type TVdbeCursor1 = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor1 = TVdbeCursor1 +/* +** The size (in bytes) of a VdbeCursor object that has an nField value of N +** or less. The value of SZ_VDBECURSOR(n) is guaranteed to be a multiple +** of 8. + */ + /* Return true if P is a null-only cursor */ @@ -13182,21 +13239,14 @@ type Tsqlite3_context1 = struct { 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 */ +/* +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. + */ // C documentation // @@ -13329,7 +13379,7 @@ type TPreUpdate1 = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -13341,6 +13391,7 @@ type TPreUpdate1 = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate1 = TPreUpdate1 @@ -13478,7 +13529,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(24453)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13650,7 +13701,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)) @@ -14037,7 +14088,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++ } @@ -14108,10 +14159,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 @@ -14247,7 +14298,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) } } @@ -14344,7 +14395,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) @@ -14485,10 +14536,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)) @@ -14499,7 +14550,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 @@ -14577,7 +14628,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) @@ -14725,7 +14776,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)) @@ -15028,7 +15079,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 } @@ -15185,7 +15236,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('.') @@ -15233,7 +15284,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('.') @@ -15338,7 +15389,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) @@ -16067,7 +16118,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 } @@ -16716,7 +16767,8 @@ func init() { // /* // ** Initialize the mutex system. // */ -func _sqlite3MutexInit(tls *libc.TLS) (r int32) { +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 @@ -18344,17 +18396,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'), @@ -18551,22 +18603,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. */ @@ -18815,11 +18868,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 @@ -18847,7 +18900,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)) @@ -18869,7 +18922,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)) @@ -19296,29 +19349,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) @@ -19433,25 +19464,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 = v98 + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) + } + } + 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. @@ -19459,15 +19494,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) { @@ -19478,13 +19513,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) @@ -19498,35 +19566,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 - } - 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 + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + 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++ + } + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 + j1++ + 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) @@ -19551,9 +19682,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: ; @@ -19567,7 +19698,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 { @@ -19577,21 +19708,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: ; @@ -19830,7 +19961,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 @@ -20129,6 +20260,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 // // /* @@ -20146,11 +20279,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)) } @@ -20802,6 +20935,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 // // /* @@ -21552,7 +21716,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 { @@ -21727,7 +21891,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 @@ -21939,11 +22103,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 @@ -22179,7 +22343,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)) @@ -22269,7 +22433,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)) { @@ -22496,7 +22660,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++ } @@ -22656,7 +22820,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('+') @@ -22765,7 +22929,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-- } } @@ -23181,7 +23345,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 @@ -23210,7 +23374,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 { @@ -23224,7 +23388,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) @@ -23255,7 +23419,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) { @@ -23606,23 +23770,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 @@ -23677,8 +23839,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)) } @@ -23711,9 +23873,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: ; @@ -23733,13 +23894,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 } @@ -23747,7 +23907,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 @@ -23763,7 +23923,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 { @@ -23775,7 +23935,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 } @@ -23824,7 +23984,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 @@ -23834,20 +23994,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) } @@ -23866,196 +24025,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 @@ -24592,91 +24751,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, - }, - 14: { - FzName: __ccgo_ts + 3583, - }, - 15: { - FzName: __ccgo_ts + 3590, - }, - 16: { FzName: __ccgo_ts + 3600, }, + 14: { + FzName: __ccgo_ts + 3609, + }, + 15: { + FzName: __ccgo_ts + 3616, + }, + 16: { + FzName: __ccgo_ts + 3626, + }, 17: { - FzName: __ccgo_ts + 3607, - }, - 18: { - FzName: __ccgo_ts + 3621, - }, - 19: { - FzName: __ccgo_ts + 3627, - }, - 20: { FzName: __ccgo_ts + 3633, }, - 21: { - FzName: __ccgo_ts + 3640, + 18: { + FzName: __ccgo_ts + 3647, }, - 22: { - FzName: __ccgo_ts + 3648, - }, - 23: { + 19: { FzName: __ccgo_ts + 3653, }, - 24: { - FzName: __ccgo_ts + 3660, + 20: { + FzName: __ccgo_ts + 3659, }, - 25: { - FzName: __ccgo_ts + 3667, + 21: { + FzName: __ccgo_ts + 3666, }, - 26: { + 22: { + FzName: __ccgo_ts + 3674, + }, + 23: { FzName: __ccgo_ts + 3679, }, + 24: { + FzName: __ccgo_ts + 3686, + }, + 25: { + FzName: __ccgo_ts + 3693, + }, + 26: { + FzName: __ccgo_ts + 3705, + }, 27: { - FzName: __ccgo_ts + 3688, + FzName: __ccgo_ts + 3714, }, 28: { - FzName: __ccgo_ts + 3694, + FzName: __ccgo_ts + 3720, }, } @@ -24915,9 +25074,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 } } @@ -25237,7 +25396,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 } @@ -25265,7 +25424,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 } } @@ -25924,7 +26083,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(40995)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -26529,7 +26688,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('/')) { @@ -26555,7 +26714,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(42576)), __ccgo_ts+3633, bp, int32(42576)) } // C documentation @@ -26592,7 +26751,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)<= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43393)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -27203,7 +27362,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)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44803)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -28204,10 +28362,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 @@ -28216,8 +28374,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 @@ -28279,7 +28437,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++ @@ -28451,7 +28609,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) } @@ -28606,7 +28764,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(45251)), __ccgo_ts+3516, zName, int32(45251)) if rc == SQLITE_OK { rc = rc2 } @@ -28683,7 +28841,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(45502)) 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(45507)), __ccgo_ts+3705, zIn, int32(45507)) return } (*(*[4098]int8)(unsafe.Pointer(bp + 128)))[got] = 0 @@ -28881,14 +29039,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(45565)), __ccgo_ts+3534, zPath, int32(45565)) } _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(45571)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<>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) } } @@ -32207,7 +32365,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) - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 0) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -32301,7 +32459,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-- - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 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)) } @@ -32342,7 +32500,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 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 @@ -32470,7 +32628,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 libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g)) + 140) + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -32490,17 +32648,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) } @@ -32518,7 +32678,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 @@ -32530,7 +32690,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) } } @@ -32731,10 +32891,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 @@ -34879,7 +35040,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 @@ -34897,7 +35058,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 } @@ -35470,6 +35631,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 { @@ -36116,7 +36286,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 @@ -36128,7 +36299,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) @@ -36149,11 +36320,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 @@ -36182,7 +36354,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 @@ -36415,7 +36587,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) } @@ -36552,7 +36724,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)) @@ -36568,7 +36740,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)< int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65269)) } 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)) @@ -40675,7 +40847,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 { @@ -41239,9 +41411,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 @@ -41445,6 +41617,11 @@ type WalCkptInfo1 = TWalCkptInfo1 /* ** An open write-ahead log file is represented by an instance of the ** following object. +** +** writeLock: +** This is usually set to 1 whenever the WRITER lock is held. However, +** if it is set to 2, then the WRITER lock is held but must be released +** by walHandleException() if a SEH exception is thrown. */ type TWal1 = struct { FpVfs uintptr @@ -41511,13 +41688,15 @@ type ht_slot = Tht_slot ** This functionality is used by the checkpoint code (see walCheckpoint()). */ type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } 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 ** is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -41575,7 +41754,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) @@ -41587,7 +41766,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) } @@ -41676,6 +41855,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 @@ -42117,7 +42297,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(67209)) } goto _1 _1: @@ -42205,12 +42385,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(67341)) 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 @@ -42344,7 +42524,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 { @@ -42975,7 +43155,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(68150)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -43091,7 +43271,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)) } } @@ -43306,7 +43486,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 { @@ -43332,7 +43519,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(68601)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -44055,8 +44242,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)) } @@ -44143,7 +44330,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(69451)) } iKey = _walNextHash(tls, iKey) } @@ -44640,7 +44827,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(69974)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44889,7 +45076,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, /* 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(70234)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -45661,6 +45848,11 @@ type CellInfo1 = TCellInfo1 ** assumed that the database is corrupt. */ +/* +** Maximum amount of storage local to a database page, regardless of +** page size. + */ + /* ** A cursor is a pointer to a particular entry within a particular ** b-tree within a database file. @@ -46027,10 +46219,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) { @@ -46039,14 +46232,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) { @@ -46746,7 +46939,7 @@ 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(72422)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } @@ -46924,7 +47117,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(72620)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46937,12 +47130,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(72633)) 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(72638)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46986,7 +47179,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(72683)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46994,7 +47187,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(72691)) } return SQLITE_OK } @@ -47182,7 +47375,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) } @@ -47215,7 +47408,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) } @@ -47414,7 +47607,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(73136)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -47454,12 +47647,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(73194)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73197)) } 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)) @@ -47467,21 +47660,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(73205)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73208)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73210)) } 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(73214)) } } cbrk = top + sz @@ -47528,12 +47721,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(73247)) } 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(73253)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -47549,7 +47742,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(73267)) } *(*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) @@ -47609,7 +47802,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(73324)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -47626,14 +47819,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(73339)) } 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(73346)) } return uintptr(0) } @@ -47676,11 +47869,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(73394)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73397)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -47694,7 +47887,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(73414)) } else { return SQLITE_OK } @@ -47747,42 +47940,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(73498)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47790,70 +47981,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(73510)) } - 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(73513)) } - 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(73526)) } - 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(73532)) } 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) + *(*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)) += libc.Int32FromUint16(iOrigSize) + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47899,7 +48090,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(73602)) } } } else { @@ -47925,7 +48116,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(73626)) } } } @@ -47964,12 +48155,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(73677)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73682)) } 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(73692)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73696)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47996,7 +48187,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(73708)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -48027,11 +48218,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(73739)) } 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(73744)) } goto _1 _1: @@ -48060,11 +48251,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(73776)) } (*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) @@ -48073,7 +48264,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(73790)) } /* 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 @@ -48095,15 +48286,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 { @@ -48111,14 +48300,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) @@ -48226,7 +48415,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(73933)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -48288,7 +48477,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(74005)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -48376,7 +48565,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 */ @@ -49000,7 +49189,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) @@ -49162,7 +49351,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 @@ -49200,7 +49389,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(74943)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -49641,7 +49830,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(75398)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -49665,7 +49854,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(75417)) } 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) @@ -49674,7 +49863,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(75426)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -49688,7 +49877,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(75438)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -49718,7 +49907,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(75473)) } /* 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) @@ -49814,7 +50003,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(75571)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49852,7 +50041,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(75623)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -49919,7 +50108,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(75691)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49962,7 +50151,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(75742)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49992,7 +50181,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(75769)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -50458,7 +50647,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(76233)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50850,7 +51039,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(76657)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50860,7 +51049,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(76672)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50891,7 +51080,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) @@ -50917,7 +51106,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(76743)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50991,7 +51180,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(76827)) } return rc } @@ -51126,7 +51315,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(76965)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -51138,7 +51327,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(76979)) } if rc != 0 { v3 = pCur + 84 @@ -51254,7 +51443,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(77114)) } goto skip_init skip_init: @@ -51268,7 +51457,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(77126)) } 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) @@ -51502,7 +51691,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(77375)) } } } @@ -51706,7 +51895,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes p3 = pCur + 1 *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(BTCF_ValidOvfl) | libc.Int32FromInt32(BTCF_AtLast))) if !((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76795)) + return _sqlite3CorruptError(tls, int32(77571)) } goto bypass_moveto_root /* Start search on the current page */ } @@ -51769,10 +51958,10 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ if nCell < int32(2) || libc.Uint32FromInt32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77658)) 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 @@ -51800,7 +51989,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(77690)) } goto moveto_index_finish } @@ -51833,7 +52022,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(77721)) } *(*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 @@ -51842,7 +52031,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(77732)) } if rc != 0 { v11 = pCur + 84 @@ -51971,7 +52160,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(77833)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -52081,7 +52270,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(77926)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -52169,7 +52358,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(78016)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -52224,7 +52413,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(78072)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -52250,7 +52439,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(78101)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52277,7 +52466,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(78135)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -52348,7 +52537,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(78200)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52486,7 +52675,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(78327)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -52537,7 +52726,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(78374)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -52546,7 +52735,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(78385)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -52636,7 +52825,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(78474)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -52654,7 +52843,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(78491)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -52677,7 +52866,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(78511)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -52898,10 +53087,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(78767)) 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 @@ -53292,12 +53481,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(79157)) } 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(79162)) } } pData -= uintptr(sz) @@ -53305,7 +53494,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(79168)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -53400,7 +53589,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(79255)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -53481,7 +53670,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: ; @@ -53508,7 +53697,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: ; @@ -53548,7 +53737,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(79377)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2))) nCell -= nShift @@ -53619,7 +53808,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(79455)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -53664,7 +53853,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(79495)) } /* 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 @@ -53860,10 +54049,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 @@ -53986,8 +54176,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 @@ -54027,7 +54217,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(79919)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -54050,7 +54240,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(79943)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -54181,7 +54371,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(80044)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -54224,7 +54414,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(80077)) goto balance_cleanup } } @@ -54283,7 +54473,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(80121)) goto balance_cleanup } goto _11 @@ -54315,7 +54505,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(80154)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -54545,7 +54735,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(80355)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54791,7 +54981,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(80587)) } goto _1 _1: @@ -54864,7 +55054,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(80647)) } 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))) @@ -55023,7 +55213,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(80811)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -55054,7 +55244,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(80839)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -55139,7 +55329,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(80920)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -55231,7 +55421,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(81043)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -55267,7 +55457,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(81085)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55297,10 +55487,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(81112)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81115)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -55418,12 +55608,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(81217)) } 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 @@ -55433,14 +55623,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(81242)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -55540,21 +55730,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(81338)) } } 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(81347)) } 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(81351)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81354)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -55648,7 +55838,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(81445)) } 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 @@ -55758,7 +55948,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(81561)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55799,7 +55989,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(81609)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55880,14 +56070,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(81699)) } *(*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(81706)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -56024,7 +56214,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(81810)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -56289,7 +56479,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)) @@ -56337,11 +56527,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) @@ -56367,11 +56557,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 @@ -56443,11 +56633,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)) } } @@ -56583,12 +56773,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 } @@ -56673,7 +56863,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 */ @@ -56696,7 +56886,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 { @@ -56773,7 +56963,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))) @@ -56787,7 +56977,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 @@ -56878,7 +57068,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) } @@ -56902,11 +57092,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) } } } @@ -56943,10 +57133,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: @@ -57385,7 +57575,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) @@ -57395,7 +57585,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 @@ -57424,7 +57614,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 @@ -57454,7 +57644,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... @@ -58132,7 +58322,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) } @@ -58270,9 +58460,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 @@ -58447,20 +58634,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 } @@ -58475,10 +58662,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 @@ -59232,7 +59419,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(85108)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -59396,7 +59583,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 { @@ -59404,8 +59592,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 { @@ -59462,14 +59650,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 */ @@ -59483,7 +59671,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 @@ -59508,14 +59696,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)) @@ -59615,7 +59803,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 } } } @@ -59630,7 +59818,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 } @@ -59934,7 +60122,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(85794)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59950,7 +60138,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(85800)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59960,7 +60148,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(85806)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -60421,12 +60609,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 @@ -60600,7 +60787,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 @@ -60617,7 +60804,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 { @@ -60685,8 +60872,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. @@ -60699,11 +60886,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 */ @@ -60740,13 +60927,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 @@ -60777,7 +60967,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 @@ -61279,7 +61469,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)) { @@ -61292,39 +61482,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): @@ -61341,14 +61531,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 @@ -61363,20 +61553,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)) } @@ -61390,10 +61580,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 @@ -62190,7 +62380,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 } @@ -62344,7 +62534,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) } @@ -62352,18 +62542,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) @@ -62594,7 +62784,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(90646))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63982,7 +64172,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(90727))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -64017,7 +64207,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(90757))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -64071,7 +64261,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(90808))) return 0 /* Corrupt index */ } } @@ -64203,7 +64393,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(90971))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -64355,7 +64545,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(91129)) } // C documentation @@ -64386,7 +64576,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(91162)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -64537,15 +64727,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 @@ -64640,10 +64830,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 @@ -64652,9 +64843,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 { @@ -64734,7 +64925,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 @@ -64744,7 +64935,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) @@ -64802,7 +64993,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(91560)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -65305,7 +65496,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 @@ -65506,7 +65697,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(92354)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -65636,7 +65827,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(92475)) } 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) @@ -66096,18 +66287,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'), @@ -66362,14 +66553,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(93091)) } 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(93095))) 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(93099)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -66520,7 +66711,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, 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) } @@ -66943,11 +67134,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(93642)) 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))) } @@ -66956,7 +67147,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) @@ -66970,7 +67161,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) } @@ -67005,7 +67196,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(93701)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -67040,7 +67231,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 } @@ -67106,11 +67297,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(93797)) 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))) } @@ -67133,7 +67324,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 @@ -67155,7 +67346,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 @@ -67282,7 +67473,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 { @@ -67320,7 +67511,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 @@ -67335,28 +67526,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)) } } } @@ -67520,9 +67711,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 { @@ -67548,12 +67739,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) @@ -67562,28 +67751,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 @@ -67974,12 +68163,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 @@ -67996,7 +68185,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 @@ -68014,7 +68203,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 @@ -68728,19 +68917,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) { @@ -69954,7 +70143,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 @@ -69970,6 +70159,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 */ @@ -70463,7 +70658,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(97561)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -70566,7 +70761,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, @@ -71162,7 +71357,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 { @@ -71192,12 +71387,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 } @@ -71289,7 +71484,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. @@ -72400,7 +72595,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(99822)) } else { goto jump_to_p2 } @@ -72859,7 +73054,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(). @@ -73292,7 +73487,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(101119)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -73622,7 +73817,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 @@ -73653,13 +73848,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 { @@ -73674,7 +73869,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(101412)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73911,7 +74106,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 @@ -73928,15 +74123,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 @@ -74017,11 +74212,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) } @@ -74233,7 +74428,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 @@ -74283,7 +74478,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 { @@ -74339,7 +74534,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)) @@ -74418,11 +74613,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) { @@ -74575,7 +74770,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 } @@ -74737,7 +74932,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' @@ -74817,12 +75012,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)) @@ -74833,7 +75028,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)) @@ -74927,7 +75122,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 } @@ -74955,11 +75150,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) { @@ -75087,7 +75282,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) @@ -75238,7 +75433,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 { @@ -75325,15 +75520,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) @@ -75799,11 +75986,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) @@ -75889,7 +76076,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103962)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75988,7 +76175,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(104062)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -76002,7 +76189,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) } @@ -76449,11 +76636,12 @@ type TVdbeSorter1 = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter1 = TVdbeSorter1 +/* Size (in bytes) of a VdbeSorter object that works with N or fewer subtasks */ + /* ** An instance of the following object is used to read records out of a ** PMA, in sorted order. The next key to be read is cached in nKey/aKey. @@ -77060,8 +77248,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 @@ -77075,9 +77263,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) @@ -77275,18 +77463,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 { @@ -77574,6 +77763,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: @@ -80119,25 +80311,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) } } @@ -80176,23 +80368,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 */ @@ -80224,7 +80415,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 @@ -80318,7 +80509,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 } } @@ -80340,57 +80531,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 @@ -80435,11 +80613,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 } @@ -80448,36 +80626,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++ @@ -80506,18 +80673,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 } } } @@ -80564,15 +80731,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) @@ -80583,8 +80750,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -80624,7 +80791,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) @@ -80644,7 +80811,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) @@ -80653,7 +80820,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 @@ -80663,26 +80830,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) } @@ -80731,8 +80898,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80806,19 +80973,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) } @@ -80844,7 +81011,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 @@ -80990,7 +81157,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) { @@ -81045,7 +81212,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 { @@ -81069,7 +81236,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) @@ -81083,13 +81250,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: ; @@ -81109,16 +81276,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 @@ -81129,35 +81293,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 { @@ -81242,7 +81409,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))) } @@ -81254,7 +81421,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 @@ -81300,7 +81467,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 @@ -81425,7 +81592,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) } @@ -81460,7 +81627,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 @@ -81498,7 +81665,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 { @@ -81568,7 +81735,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 @@ -81602,7 +81769,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 @@ -81915,7 +82082,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 { @@ -81982,7 +82149,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 { @@ -81993,7 +82160,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 @@ -82003,7 +82170,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 @@ -82225,33 +82392,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 } @@ -82303,7 +82472,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) { @@ -82511,7 +82680,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 } @@ -82986,7 +83155,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) { @@ -83065,7 +83234,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 @@ -83252,7 +83421,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) @@ -83410,11 +83579,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)) @@ -83463,7 +83632,7 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt 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)) { _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) } @@ -83491,7 +83660,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)) @@ -83511,7 +83680,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 @@ -83582,7 +83751,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)) } } } @@ -83634,7 +83803,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 } @@ -83667,7 +83836,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) } } @@ -84050,7 +84219,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 @@ -84190,7 +84359,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: @@ -84211,27 +84379,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) { @@ -84277,9 +84438,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++ } @@ -84289,8 +84450,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++ } @@ -84304,7 +84465,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) } @@ -84355,7 +84516,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 @@ -84436,7 +84597,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) @@ -84454,7 +84615,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) @@ -84535,7 +84696,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 @@ -84664,7 +84825,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)) } } @@ -84762,10 +84923,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) @@ -85443,13 +85604,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 @@ -85464,32 +85625,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 @@ -85698,7 +85846,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 @@ -85751,7 +85899,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) @@ -85851,12 +85999,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) @@ -86448,7 +86597,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 @@ -86544,14 +86693,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 } @@ -86579,9 +86728,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) { @@ -86714,7 +86863,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) } } @@ -86844,13 +86993,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)<= (*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) } @@ -87642,7 +87791,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)) @@ -87657,7 +87806,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) { @@ -87686,7 +87835,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) } @@ -87762,7 +87911,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): @@ -87825,7 +87974,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 @@ -87835,7 +87984,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) { @@ -87856,9 +88005,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 /* @@ -87940,7 +88089,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) { @@ -88011,17 +88160,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 { @@ -88030,7 +88179,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 @@ -88061,7 +88210,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 { @@ -88131,7 +88280,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) @@ -88175,7 +88324,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 @@ -88442,7 +88591,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: @@ -88651,7 +88802,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: @@ -89358,7 +89511,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) } @@ -89879,7 +90032,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) 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 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 @@ -89895,7 +90048,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) (*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 + v9 = pParse + 60 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 @@ -89980,7 +90133,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 @@ -89988,7 +90141,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 @@ -90006,7 +90159,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 } } } @@ -90025,11 +90178,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 } @@ -90147,8 +90300,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+8568, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90166,10 +90319,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+8596, 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+8771, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -90185,9 +90338,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+8945, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9067, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9092, 0) } } @@ -90243,7 +90396,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+9243, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -90252,11 +90405,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+9302, 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+9308, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -90286,21 +90439,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+9335, 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+9519, 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+9824, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9840, 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+9898, 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 @@ -90308,7 +90461,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 @@ -90316,7 +90469,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+10163, 0) goto exit_rename_table exit_rename_table: ; @@ -90333,7 +90486,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+10176, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -90373,11 +90526,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+10214, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10221, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10246, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -90393,10 +90546,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+10273) } 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+10332) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -90408,13 +90561,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+10385) } _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+10431) } } /* Modify the CREATE TABLE statement. */ @@ -90428,7 +90581,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+10458, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -90456,7 +90609,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+10604, libc.VaList(bp+16, zTab, zDb)) } } } @@ -90494,12 +90647,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+10957, 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+10991, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -90514,7 +90667,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 } @@ -90522,8 +90675,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+11021, 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 } @@ -90584,18 +90737,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 + 11040 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 11020 + zType = __ccgo_ts + 11045 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11034 + v1 = __ccgo_ts + 11059 } else { - v1 = __ccgo_ts + 11051 + v1 = __ccgo_ts + 11076 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11069, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11094, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90642,21 +90795,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+11112, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -90672,11 +90813,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+11133, 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+11315, 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+10163, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -91152,11 +91293,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 + 11446 } 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+11448, 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) } @@ -91227,30 +91368,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+11471, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118867)) } 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(118888)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -91271,9 +91416,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)) @@ -91289,15 +91433,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+11479, 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)) @@ -91308,16 +91452,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++ @@ -91334,21 +91478,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 + 11446 } 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+11485, 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))) @@ -91374,7 +91518,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: ; @@ -91684,7 +91828,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 { @@ -91951,7 +92095,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) @@ -92134,7 +92278,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 { @@ -92218,8 +92362,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 @@ -92235,12 +92380,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)) @@ -92314,7 +92459,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(119856)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -92331,7 +92476,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+11490, 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 @@ -92386,23 +92531,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+11112, 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 + 11497 } 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+11509, 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+11537, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -92414,31 +92559,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+11585, 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+11706, 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)) { @@ -92452,7 +92597,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 @@ -92463,8 +92608,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 } @@ -92525,27 +92670,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 + 11724, }, 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 + 11745, }, 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 + 11765, }, 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 + 11784, }, 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 + 11803, }, } @@ -92756,8 +92901,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+11906, 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 { @@ -92767,10 +92917,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+11929, 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+11959, 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) @@ -92802,15 +92952,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11801, - FzCols: __ccgo_ts + 11814, + FzName: __ccgo_ts + 11826, + FzCols: __ccgo_ts + 11839, }, 1: { - FzName: __ccgo_ts + 11827, - FzCols: __ccgo_ts + 11840, + FzName: __ccgo_ts + 11852, + FzCols: __ccgo_ts + 11865, }, 2: { - FzName: __ccgo_ts + 11868, + FzName: __ccgo_ts + 11893, }, } @@ -93024,7 +93174,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) { @@ -93040,12 +93191,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 @@ -93053,7 +93204,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) @@ -93112,7 +93263,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 + 11977, } func init() { @@ -93486,7 +93637,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 + 11987, } func init() { @@ -93536,7 +93687,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+11997, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -93547,7 +93698,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+12002, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -93586,7 +93737,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+12008, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -93604,7 +93755,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 + 12014, } func init() { @@ -93670,7 +93821,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+12023, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -93679,12 +93830,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+11826, 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)) @@ -93806,7 +93957,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 } @@ -93886,7 +94037,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: @@ -93917,7 +94068,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+12033, 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)) @@ -94008,7 +94159,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+12033, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -94045,7 +94196,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 @@ -94078,11 +94229,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+12037) } 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+12041) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -94246,17 +94397,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+12045, 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+12056, 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+12066, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -94268,13 +94419,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) - } } } @@ -94325,7 +94469,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) } @@ -94528,8 +94672,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))) @@ -94635,11 +94779,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+11852, 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+12078, __ccgo_ts+12147, zDb) } return rc } @@ -94705,10 +94849,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+11826, (*(*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+12199, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94821,7 +94965,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 @@ -94873,11 +95017,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+12240, 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 { @@ -94908,7 +95052,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+12243, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -94917,7 +95061,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+12280, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -94929,13 +95073,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 } @@ -94973,7 +95117,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+12310, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94981,7 +95125,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+12339, 0) rc = int32(SQLITE_ERROR) } } @@ -95028,7 +95172,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+12407, libc.VaList(bp+56, zFile)) } } } @@ -95090,15 +95234,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+12435, 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+12456, 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+12482, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -95193,7 +95337,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 + 12504, } func init() { @@ -95215,7 +95359,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 + 12518, } func init() { @@ -95241,7 +95385,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+12532, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -95275,7 +95419,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+12556, 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))) @@ -95492,7 +95636,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+12602, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -95520,11 +95664,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+12625, 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+12631, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12612, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12637, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -95584,7 +95728,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) { @@ -95619,7 +95763,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+12664, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -95737,7 +95881,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 @@ -95835,7 +95979,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) @@ -95913,7 +96059,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) { @@ -95927,7 +96073,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) } @@ -96040,21 +96188,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) } } } @@ -96084,12 +96232,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) } } } @@ -96127,7 +96275,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+12679, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -96137,7 +96285,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) @@ -96145,15 +96293,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 + 12687 } else { - v1 = __ccgo_ts + 12675 + v1 = __ccgo_ts + 12700 } 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 { } @@ -96191,12 +96339,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 @@ -96721,7 +96869,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) @@ -96753,7 +96901,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 @@ -96811,13 +96959,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+12714, 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+12731, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96865,8 +97013,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+12751, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96902,23 +97050,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 @@ -97038,7 +97188,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 @@ -97081,9 +97231,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 @@ -97096,7 +97246,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+12793, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -97112,9 +97262,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 11015 + v2 = __ccgo_ts + 11040 } else { - v2 = __ccgo_ts + 9277 + v2 = __ccgo_ts + 9302 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -97124,9 +97274,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 @@ -97150,11 +97300,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 + 11040 } else { - v4 = __ccgo_ts + 9277 + v4 = __ccgo_ts + 9302 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12809, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12834, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -97162,11 +97312,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+12855, 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++ @@ -97198,19 +97348,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 @@ -97230,15 +97390,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) @@ -97253,7 +97418,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 } @@ -97314,7 +97479,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+12890, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -97323,14 +97488,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+12924, 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) @@ -97362,11 +97529,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) @@ -97377,7 +97544,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+12944, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -97387,12 +97554,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+12967, 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+12974, 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-- @@ -97434,21 +97601,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+12984, 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) { @@ -97459,7 +97615,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. */ @@ -97472,12 +97628,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 @@ -97649,10 +97814,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+13010, 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+13055, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -97710,7 +97875,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+13096, 0) } } @@ -97738,8 +97903,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) @@ -97747,7 +97912,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+13148, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -97766,21 +97931,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 @@ -97803,7 +97957,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+13189, 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) @@ -97831,8 +97985,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 { @@ -97919,17 +98078,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+13245, 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+13288, (*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+13296, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97961,7 +98120,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+13303, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -98102,9 +98261,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 @@ -98115,31 +98275,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 + 13334 + zEnd = __ccgo_ts + 5229 } else { - zSep = __ccgo_ts + 13311 - zSep2 = __ccgo_ts + 13315 - zEnd = __ccgo_ts + 13320 + zSep = __ccgo_ts + 13336 + zSep2 = __ccgo_ts + 13340 + zEnd = __ccgo_ts + 13345 } - 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+13348, 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))++ @@ -98150,8 +98310,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)] @@ -98164,17 +98325,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 + 13362, + 2: __ccgo_ts + 13368, + 3: __ccgo_ts + 13373, + 4: __ccgo_ts + 13378, + 5: __ccgo_ts + 13368, } // C documentation @@ -98183,15 +98345,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) } @@ -98206,7 +98369,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 } @@ -98439,8 +98602,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. @@ -98540,7 +98713,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 @@ -98553,8 +98726,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++ } @@ -98584,7 +98757,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 @@ -98803,9 +98976,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+13384, 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+13417, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98826,11 +98999,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+13444, 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+13494, 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)) @@ -98877,7 +99050,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+13526, 0) return } } @@ -98911,16 +99084,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 + 9302 + zType2 = __ccgo_ts + 13570 } else { /* A view */ - zType = __ccgo_ts + 11015 - zType2 = __ccgo_ts + 13551 + zType = __ccgo_ts + 11040 + zType2 = __ccgo_ts + 13576 } /* 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 @@ -98937,24 +99110,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) @@ -99002,13 +99180,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+13581, 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+13596, 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 @@ -99017,15 +99205,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+13694, 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+13736, 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+13770, 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. @@ -99043,7 +99231,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+9824) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -99076,7 +99264,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+13791, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -99093,7 +99281,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+11040, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -99190,7 +99378,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+13827, 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. @@ -99374,7 +99562,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+13857, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -99387,7 +99575,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+13872, 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) } @@ -99470,9 +99658,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+13939, 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+11929, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -99513,7 +99701,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+13953, 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 @@ -99522,7 +99710,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+13998, 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) } @@ -99557,11 +99745,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) @@ -99616,9 +99804,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 @@ -99651,18 +99839,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+14065, 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+14093, 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+14127, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -99672,7 +99860,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+12041, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -99720,19 +99908,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+14159, 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+14222, 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 { @@ -99789,7 +99977,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+14316, 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) { @@ -99904,11 +100092,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 */ @@ -99930,7 +100118,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 @@ -99975,13 +100163,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) } @@ -100004,23 +100192,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 @@ -100049,11 +100237,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 + 14362 } else { - v2 = __ccgo_ts + 14343 + v2 = __ccgo_ts + 14368 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14348, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14373, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -100131,7 +100319,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+14401, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -100141,7 +100329,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+14407, 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)) { @@ -100155,16 +100343,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+14457, 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+14485, 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+14510, 0) goto exit_create_index } /* @@ -100185,19 +100373,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+14401, (*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+14544, 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+14578, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -100218,7 +100406,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+14602, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -100236,9 +100424,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 @@ -100266,7 +100454,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+14401) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -100298,7 +100486,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 } @@ -100350,7 +100538,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+14625, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -100365,6 +100553,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { j = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) } else { if int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16 + 8))&0xf>>0)) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) @@ -100449,7 +100638,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) @@ -100497,7 +100686,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+14686, 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 @@ -100527,8 +100716,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+14728, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127335)) goto exit_create_index } } @@ -100541,7 +100730,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 @@ -100570,9 +100759,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 + 14745 } - 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+14753, 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(""); */ @@ -100580,7 +100769,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+14773, 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. @@ -100588,7 +100777,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+14832, 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)) @@ -100751,16 +100940,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+14859, 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+14877, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100768,9 +100957,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 { @@ -100786,8 +100975,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+14950, 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+12037, (*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) @@ -100860,12 +101049,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) @@ -100977,13 +101166,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+15010, 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) } @@ -101064,7 +101253,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) } @@ -101114,7 +101303,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 @@ -101285,11 +101474,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 + 15046 } else { - v1 = __ccgo_ts + 15024 + v1 = __ccgo_ts + 15049 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15030, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15055, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -101488,7 +101677,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+15091, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -101535,9 +101724,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 + 15097 } else { - v1 = __ccgo_ts + 15081 + v1 = __ccgo_ts + 15106 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -101569,9 +101758,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 + 15091, + 1: __ccgo_ts + 15113, + 2: __ccgo_ts + 15097, } // C documentation @@ -101591,7 +101780,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+15121, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -101616,7 +101805,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+12625, 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 @@ -102047,7 +102236,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+15321, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102929,11 +103116,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+15354, 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+15383, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -103037,7 +103224,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 @@ -103094,7 +103281,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+15457, -int32(1)) return } if argc == int32(3) { @@ -104813,7 +105005,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+15490, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -104895,7 +105087,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 @@ -104967,28 +105159,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+15535, 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+15543, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -105020,13 +105212,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 + 15551 + } else { + v2 = __ccgo_ts + 15555 + } + 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+15558, -int32(1)) + return +} + // C documentation // // /* @@ -105038,6 +105366,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) @@ -105048,7 +105380,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) @@ -105483,7 +105815,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 } @@ -105572,7 +105904,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11421, + 0: __ccgo_ts + 11446, } // C documentation @@ -105732,7 +106064,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+15581, int32(4), libc.UintptrFromInt32(0)) } } @@ -105793,7 +106125,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+12664, -int32(1)) return } if argc == int32(2) { @@ -105903,7 +106235,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) { @@ -105985,7 +106317,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+15434, -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) @@ -106217,7 +106549,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) @@ -106228,7 +106560,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 { @@ -106335,7 +106667,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+15586, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -106364,8 +106696,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+15592, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15592, 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 @@ -106545,11 +106877,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 @@ -106653,7 +106985,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))) } /* @@ -106666,542 +106998,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 + 15597, }, 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 + 15617, }, 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 + 15630, }, 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 + 15648, }, 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 + 15657, }, 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 + 15665, }, 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 + 15665, }, 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 + 15680, }, 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 + 15706, }, 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 + 15731, }, 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 + 15740, }, 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 + 15751, }, 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 + 15758, }, 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 + 15772, }, 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 + 15772, }, 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 + 15778, }, 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 + 15778, }, 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 + 15784, }, 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 + 15784, }, 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 + 15789, }, 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 + 15789, }, 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 + 15793, }, 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 + 15793, }, 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 + 15797, }, 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 + 15804, }, 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 + 15812, }, 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 + 15819, }, 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 + 15832, }, 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 + 15838, }, 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 + 15845, }, 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 + 15852, }, 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 + 15860, }, 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 + 15865, }, 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 + 15869, }, 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 + 15869, }, 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 + 15875, }, 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 + 15881, }, 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 + 15887, }, 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 + 15891, }, 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 + 15891, }, 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 + 15897, }, 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 + 15904, }, 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 + 15914, }, 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 + 15921, }, 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 + 15928, }, 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 + 15939, }, 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 + 15946, }, 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 + 15961, }, 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 + 15978, }, 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 + 15989, }, 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 + 15996, }, 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 + 16002, }, 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 + 16015, }, 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 + 16033, }, 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 + 16041, }, 55: { - 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 + 16000, - }, - 56: { 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 + 16055, + }, + 56: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16063, }, 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 + 16072, }, 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 + 16072, }, 59: { - 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, + 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 + 16079, }, 60: { - 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, + 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 + 16079, }, 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 + 16027, + FzName: __ccgo_ts + 16089, }, 62: { - 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, + 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 + 16093, }, 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(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16031, + 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 + 16099, }, 64: { - 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, + 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 + 16103, }, 65: { - 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, + 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 + 16103, }, 66: { - FnArg: int16(2), + 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 + 16050, + FzName: __ccgo_ts + 16109, }, 67: { 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, + 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 + 16109, }, 68: { 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, + 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 + 16122, }, 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 + 16133, + }, + 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 + 15592, + }, + 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, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16066, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1268, + FzName: __ccgo_ts + 15592, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1276, + FzName: __ccgo_ts + 16138, }, 73: { 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 + 1268, }, 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 + 16077, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1276, }, 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 + 16080, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16143, }, 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 + 16084, + FzName: __ccgo_ts + 16149, }, 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 + 16090, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16152, }, 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 + 16080, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16156, }, 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, + FfuncFlags: 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 + 16162, }, 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 + 16152, }, 81: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16103, - }, - 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, - }, - 83: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16113, - }, - 84: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16118, - }, - 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, - }, - 86: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16128, - }, - 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, - }, - 88: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16138, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, }, + 82: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16171, + }, + 83: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16175, + }, + 84: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16181, + }, + 85: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16185, + }, + 86: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16190, + }, + 87: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16195, + }, + 88: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16200, + }, + 89: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16206, + }, + 90: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16210, + }, + 91: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16214, + }, + 92: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16218, + }, + 93: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16223, + }, + 94: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16228, + }, 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 + 16233, }, 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 + 16239, }, 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 + 16245, }, 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 + 16251, }, 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 + 16256, }, 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 + 16264, }, 101: { - 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, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16272, }, 102: { - 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, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16275, }, 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 + 6913, + }, + 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 + 16212, + FzName: __ccgo_ts + 16280, + }, + 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 + 16284, }, } @@ -107260,109 +107603,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 ************************************************/ @@ -107586,7 +107931,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) } @@ -107679,7 +108024,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+16287, 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) @@ -108503,7 +108848,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 @@ -108790,11 +109135,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 { @@ -108858,7 +109203,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) @@ -108874,7 +109219,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 @@ -109440,7 +109785,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 } @@ -109506,11 +109851,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 } @@ -109835,7 +110180,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) @@ -109849,7 +110194,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 @@ -109884,7 +110229,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 @@ -109897,7 +110242,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 @@ -110024,27 +110369,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 */ @@ -110125,7 +110470,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++ @@ -110152,7 +110497,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 } @@ -110161,44 +110506,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+16332, 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+16373, 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 } } @@ -110220,31 +110549,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+16405, 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 @@ -110268,10 +110597,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) @@ -110312,8 +110641,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-- } @@ -110330,34 +110659,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+16413, 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+16465, 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 @@ -110464,18 +110793,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 @@ -110485,13 +110814,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 } } } @@ -110502,14 +110831,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 } @@ -110526,16 +110855,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++ @@ -110646,11 +110975,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 */ @@ -110709,7 +111038,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16485) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16557) } goto insert_cleanup insert_cleanup: @@ -111105,7 +111434,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+12625, 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('/'))) { @@ -113339,7 +113670,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+16606, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -113359,19 +113690,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+16610, 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+16616, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113386,14 +113717,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+16659, 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) } @@ -113417,7 +113748,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+16691, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113426,7 +113757,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 + 16571, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -113659,7 +113990,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+16728, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -113713,63 +114044,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 + 16767, + 2: __ccgo_ts + 9302, + 3: __ccgo_ts + 16771, + 4: __ccgo_ts + 16776, + 5: __ccgo_ts + 16779, + 6: __ccgo_ts + 16789, + 7: __ccgo_ts + 16799, + 8: __ccgo_ts + 16805, + 9: __ccgo_ts + 16809, + 10: __ccgo_ts + 16814, + 11: __ccgo_ts + 16819, + 12: __ccgo_ts + 16827, + 13: __ccgo_ts + 16838, + 14: __ccgo_ts + 16841, + 15: __ccgo_ts + 16809, + 16: __ccgo_ts + 16848, + 17: __ccgo_ts + 16814, + 18: __ccgo_ts + 16856, + 19: __ccgo_ts + 16860, + 20: __ccgo_ts + 16865, + 21: __ccgo_ts + 16871, + 22: __ccgo_ts + 16809, + 23: __ccgo_ts + 16814, + 24: __ccgo_ts + 16878, + 25: __ccgo_ts + 16883, + 26: __ccgo_ts + 16886, + 27: __ccgo_ts + 16893, + 28: __ccgo_ts + 16805, + 29: __ccgo_ts + 16809, + 30: __ccgo_ts + 16899, + 31: __ccgo_ts + 16904, + 32: __ccgo_ts + 16909, + 33: __ccgo_ts + 16767, + 34: __ccgo_ts + 16809, + 35: __ccgo_ts + 16913, + 36: __ccgo_ts + 16920, + 37: __ccgo_ts + 16927, + 38: __ccgo_ts + 12041, + 39: __ccgo_ts + 12037, + 40: __ccgo_ts + 16935, + 41: __ccgo_ts + 16940, + 42: __ccgo_ts + 16945, + 43: __ccgo_ts + 9302, + 44: __ccgo_ts + 16950, + 45: __ccgo_ts + 5623, + 46: __ccgo_ts + 16956, + 47: __ccgo_ts + 16961, + 48: __ccgo_ts + 16152, + 49: __ccgo_ts + 16966, + 50: __ccgo_ts + 16767, + 51: __ccgo_ts + 16809, + 52: __ccgo_ts + 16979, + 53: __ccgo_ts + 16984, + 54: __ccgo_ts + 16993, + 55: __ccgo_ts + 17000, + 56: __ccgo_ts + 17011, } // C documentation @@ -113788,338 +114119,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16947, + FzName: __ccgo_ts + 17019, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16962, + FzName: __ccgo_ts + 17034, 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 + 17049, 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 + 17061, 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 + 17077, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16928, + FzName: __ccgo_ts + 17000, 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 + 17090, 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 + 17102, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17050, + FzName: __ccgo_ts + 17122, 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 + 17138, 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 + 17159, 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 + 17174, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17118, + FzName: __ccgo_ts + 17190, 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 + 17204, 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 + 17217, 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 + 17231, 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 + 17250, 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 + 17269, 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 + 17292, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17229, + FzName: __ccgo_ts + 17301, 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 + 17319, 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 + 17336, 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 + 17349, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17292, + FzName: __ccgo_ts + 17364, 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 + 17382, 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 + 17392, 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 + 17406, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17350, + FzName: __ccgo_ts + 17422, 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 + 17447, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17394, + FzName: __ccgo_ts + 17466, 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 + 17477, 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 + 17488, 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 + 17500, 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 + 17516, 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 + 17529, 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 + 17548, 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 + 17567, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17508, + FzName: __ccgo_ts + 17580, 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 + 17595, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17533, + FzName: __ccgo_ts + 17605, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17545, + FzName: __ccgo_ts + 17617, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17554, + FzName: __ccgo_ts + 17626, 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 + 17637, 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 + 17647, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17587, + FzName: __ccgo_ts + 17659, 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 + 17670, 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 + 17682, 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 + 17699, 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 + 17718, 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 + 17744, 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 + 17759, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17701, + FzName: __ccgo_ts + 17773, 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 + 17792, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17734, + FzName: __ccgo_ts + 17806, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17750, + FzName: __ccgo_ts + 17822, 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 + 17834, 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 + 17845, 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 + 17856, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -114127,45 +114458,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17796, + FzName: __ccgo_ts + 17868, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17807, + FzName: __ccgo_ts + 17879, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17828, + FzName: __ccgo_ts + 17900, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17836, + FzName: __ccgo_ts + 17908, 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 + 17923, 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 + 17936, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17883, + FzName: __ccgo_ts + 17955, 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 + 17970, 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)), @@ -114183,7 +114514,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 @@ -114291,10 +114622,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+17986) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17924) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17996) { return PAGER_LOCKINGMODE_NORMAL } } @@ -114312,13 +114643,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+18003) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17936) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18008) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -114341,10 +114672,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+16979) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17948) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18020) == 0 { return int32(2) } else { return 0 @@ -114366,7 +114697,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+18027, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -114496,15 +114827,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 + 18089 case int32(OE_SetDflt): - zName = __ccgo_ts + 18026 + zName = __ccgo_ts + 18098 case int32(OE_Cascade): - zName = __ccgo_ts + 18038 + zName = __ccgo_ts + 18110 case int32(OE_Restrict): - zName = __ccgo_ts + 18046 + zName = __ccgo_ts + 18118 default: - zName = __ccgo_ts + 18055 + zName = __ccgo_ts + 18127 break } return zName @@ -114525,12 +114856,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 + 18137, + 1: __ccgo_ts + 18144, + 2: __ccgo_ts + 18152, + 3: __ccgo_ts + 18156, + 4: __ccgo_ts + 18020, + 5: __ccgo_ts + 18165, } // C documentation @@ -114592,15 +114923,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 + 18190 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18120 + zType = __ccgo_ts + 18192 } 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+18194, 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: ; @@ -114609,9 +114940,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 + 18169, + 2: __ccgo_ts + 18174, + 3: __ccgo_ts + 18182, } // C documentation @@ -114710,7 +115041,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+18201, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114753,7 +115084,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++ @@ -114798,7 +115129,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 @@ -114857,7 +115188,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+18205) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114900,7 +115231,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 @@ -114928,7 +115259,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 + 17996 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 @@ -114956,7 +115287,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 + 17986 } _returnSingleText(tls, v, zRet) break @@ -115246,7 +115577,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+18210, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -115256,7 +115587,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) } @@ -115278,7 +115609,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+18235, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -115310,8 +115641,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+18288) == 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. */ @@ -115391,9 +115723,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 + 18294 } else { - v14 = __ccgo_ts + 18230 + v14 = __ccgo_ts + 18302 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -115464,7 +115796,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+18309, 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)) @@ -115494,19 +115826,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 + 11040 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13263 + zType = __ccgo_ts + 13288 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18253 + zType = __ccgo_ts + 18325 } else { - zType = __ccgo_ts + 9277 + zType = __ccgo_ts + 9302 } } } - _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+18332, 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: ; @@ -115553,9 +115885,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+18339, 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+18344, 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 @@ -115579,11 +115911,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 + 18349, + 1: __ccgo_ts + 18351, + 2: __ccgo_ts + 16838, } - _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+18353, 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: ; @@ -115602,7 +115934,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+18359, 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: ; @@ -115619,7 +115951,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+18363, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -115669,7 +116001,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: ; @@ -115681,7 +116013,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: ; @@ -115707,7 +116039,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+18366, 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+18375)) goto _32 _32: ; @@ -115721,8 +116053,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 @@ -115848,7 +116180,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+18380, 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))) @@ -115944,7 +116276,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 @@ -115988,7 +116320,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 } @@ -116039,7 +116371,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+18384, 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) @@ -116050,7 +116382,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+18408) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -116186,7 +116518,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+18437, 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) @@ -116248,7 +116580,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))) } @@ -116270,7 +116602,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+18473, 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) @@ -116283,7 +116615,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+18493, 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) { @@ -116291,7 +116623,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+18515, 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) { @@ -116302,10 +116634,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+18538, -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+18540, 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)) } } @@ -116339,7 +116671,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+18560, 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) @@ -116363,9 +116695,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+18590) _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+18595) _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)) @@ -116378,9 +116710,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+18616) _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+18652) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -116408,9 +116740,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+18590) _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+18663) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -116438,7 +116770,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+18690) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -116535,7 +116867,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 + 18717 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -116614,7 +116946,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+18778, libc.VaList(bp+176, zRight)) } } } @@ -116719,13 +117051,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+18003) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18731) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18803) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18084) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18156) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116860,7 +117192,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 @@ -116890,7 +117222,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. @@ -116952,7 +117284,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+18811, 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)) @@ -117225,34 +117557,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18648, + FzName: __ccgo_ts + 18720, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18653, + FzName: __ccgo_ts + 18725, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18659, + FzName: __ccgo_ts + 18731, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18668, + FzName: __ccgo_ts + 18740, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18677, + FzName: __ccgo_ts + 18749, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18685, + FzName: __ccgo_ts + 18757, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18693, + FzName: __ccgo_ts + 18765, }, 7: { - FzName: __ccgo_ts + 18700, + FzName: __ccgo_ts + 18772, }, 8: {}, } @@ -117348,14 +117680,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+18829) 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+18844, libc.VaList(bp+240, int32(cSep), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -117364,19 +117696,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+18851, 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+18857) 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+18869) 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 { @@ -117391,7 +117723,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 @@ -117572,7 +117904,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) } @@ -117584,13 +117916,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+18884) 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+18892, 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+18896, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -117599,7 +117931,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) @@ -117725,24 +118057,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+18930, 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(143745)) } 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+18958, 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+18989, 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(143752)) } } } @@ -117750,9 +118082,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 + 18900, + 1: __ccgo_ts + 18907, + 2: __ccgo_ts + 18919, } // C documentation @@ -117828,7 +118160,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+14728) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117861,11 +118193,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+18997) } 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+14728) } } } @@ -117904,18 +118236,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 + 9302 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 + 19010 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -117999,7 +118331,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+12339) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -118025,7 +118357,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+19082) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -118040,7 +118372,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+19106, 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)) @@ -118369,7 +118701,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 @@ -118398,7 +118730,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 @@ -118458,7 +118790,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+19140, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -118474,7 +118806,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+19170, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -118497,10 +118829,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 { @@ -118508,7 +118840,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) @@ -118538,7 +118870,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(144552)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -118672,7 +119004,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(144701)) } /* 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 @@ -118932,7 +119264,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) @@ -118940,7 +119272,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 @@ -119096,15 +119428,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 + 11446 + zSp2 = __ccgo_ts + 11446 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+19189, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -119161,25 +119493,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) } @@ -119311,13 +119646,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 { @@ -119395,7 +119730,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+19219, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -119445,12 +119780,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+19269, 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. @@ -119465,9 +119800,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+19333, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -119477,6 +119813,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) @@ -119511,7 +119854,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), } @@ -119559,7 +119902,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 @@ -119604,7 +119947,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) @@ -119628,7 +119971,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) @@ -119649,7 +119992,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 @@ -119772,7 +120115,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 { @@ -119899,10 +120242,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 @@ -119910,7 +120253,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 @@ -120087,7 +120430,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+19370, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -120198,8 +120541,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) @@ -120207,7 +120550,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) } @@ -120292,13 +120635,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19318 + z = __ccgo_ts + 19390 case int32(TK_INTERSECT): - z = __ccgo_ts + 19328 + z = __ccgo_ts + 19400 case int32(TK_EXCEPT): - z = __ccgo_ts + 19338 + z = __ccgo_ts + 19410 default: - z = __ccgo_ts + 19345 + z = __ccgo_ts + 19417 break } return z @@ -120319,7 +120662,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+19423, libc.VaList(bp+8, zUsage)) } /* @@ -120356,13 +120699,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 + 19446 } 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+19460, 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+19491, 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) @@ -120386,11 +120729,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 @@ -120606,7 +120949,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 + 16950 } 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)) @@ -120719,7 +121062,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 */ @@ -120728,7 +121071,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) @@ -120752,13 +121095,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 + 16950 } 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+12625, 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))) @@ -120766,7 +121109,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+19537, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120820,7 +121163,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) } @@ -120858,7 +121201,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 + 16950 } zName = v3 } else { @@ -120873,7 +121216,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+19537, 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. @@ -120909,7 +121252,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+19546, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -121028,7 +121371,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 + 19554 } else { zType = uintptr(0) j = int32(1) @@ -121094,7 +121437,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) } @@ -121122,7 +121465,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) } @@ -121172,7 +121515,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 @@ -121195,7 +121538,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 @@ -121343,7 +121686,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+19558, 0) return } /* Obtain authorization to do a recursive query */ @@ -121380,7 +121723,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 @@ -121391,7 +121734,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 @@ -121405,7 +121748,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 @@ -121436,7 +121779,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+19607, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -121451,7 +121794,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+19649, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -121479,7 +121822,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+19655, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -121534,9 +121877,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 + 19670 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19600, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19672, 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) { @@ -121644,8 +121987,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+19695, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19710, 0) } /* Generate code for the left and right SELECT statements. */ @@ -121670,7 +122013,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+19390, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121696,7 +122039,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 @@ -121722,7 +122065,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+19729, 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 @@ -121754,11 +122097,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 @@ -121780,7 +122123,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+19729, 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 @@ -121887,6 +122230,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) } @@ -121903,9 +122247,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+19750, 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+19796, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121976,7 +122320,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+19370, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -122192,7 +122536,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) @@ -122224,7 +122568,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 { @@ -122278,16 +122622,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 @@ -122305,32 +122649,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+19878, 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+19889, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -122343,7 +122687,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+19894, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -122553,11 +122897,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))) } @@ -122718,7 +123062,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 @@ -122908,9 +123252,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. @@ -123122,7 +123466,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) @@ -123269,7 +123613,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) @@ -123559,11 +123903,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 { @@ -123628,7 +123972,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 @@ -123646,12 +123990,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 { @@ -124133,7 +124477,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 @@ -124179,13 +124523,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+15789) == 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+15793) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -124273,8 +124617,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+19900, 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 @@ -124298,7 +124642,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 @@ -124380,7 +124724,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) @@ -124398,7 +124742,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+19918, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -124546,7 +124890,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) } @@ -124574,7 +124918,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+19941, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -124596,12 +124940,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+19961, 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 @@ -124618,7 +124962,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 + 20004 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 { @@ -124649,7 +124993,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+20027, 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) } @@ -124658,9 +125002,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 + 20065 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20027 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20099 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -124709,7 +125053,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) { @@ -124719,7 +125063,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+20137, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124815,7 +125159,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) @@ -124824,7 +125168,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) } @@ -124875,7 +125219,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+20141, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124890,7 +125234,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+20180, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124905,7 +125249,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+15321, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -125029,7 +125373,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 } @@ -125046,7 +125390,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+20211, 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) } @@ -125125,7 +125469,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+20216, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -125138,7 +125482,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+12625, 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) @@ -125158,9 +125502,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+20225, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20171, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20243, 0) } } } @@ -125174,7 +125518,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+20263, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -125423,7 +125767,7 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint (*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))) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -125476,7 +125820,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 @@ -125513,12 +125857,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+20294, 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+20345, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -125539,7 +125883,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+20378, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -125678,7 +126022,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 @@ -125786,7 +126130,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 @@ -125853,7 +126197,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 + 20411 } else { v1 = __ccgo_ts + 1695 } @@ -125862,7 +126206,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+20434, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125894,7 +126238,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)) @@ -126023,6 +126367,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. // */ @@ -126051,7 +126396,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+16103) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -126084,9 +126429,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 */ } @@ -126096,13 +126441,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 { @@ -126122,7 +126467,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) } @@ -126295,8 +126640,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 @@ -126305,11 +126650,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 { @@ -126325,7 +126670,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)) @@ -126349,14 +126694,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+20446, 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) @@ -126457,7 +126802,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+20500, 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 @@ -126658,14 +127003,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+20540, 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) @@ -126697,7 +127042,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 @@ -126712,7 +127057,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+20555, 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 { @@ -126766,7 +127111,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 @@ -126799,7 +127144,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 @@ -126858,7 +127203,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 @@ -126887,6 +127232,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)) @@ -126909,10 +127261,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) @@ -126946,8 +127298,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 @@ -126962,8 +127314,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 @@ -126992,8 +127344,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++ } @@ -127023,11 +127375,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.Uint16FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -127061,47 +127413,47 @@ 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)) /* 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)) /* Begin a loop that will extract all source rows in GROUP BY order. @@ -127111,16 +127463,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 @@ -127138,11 +127490,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 + 20571 } else { - v46 = __ccgo_ts + 20508 + v47 = __ccgo_ts + 20580 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19351, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19423, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -127156,8 +127508,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -127175,8 +127527,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -127187,12 +127539,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) @@ -127241,12 +127593,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++ } @@ -127316,9 +127672,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 @@ -127335,10 +127691,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 */ @@ -127365,8 +127721,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 } @@ -127406,32 +127762,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) @@ -127473,7 +127829,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+20571) } /* 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 @@ -127579,7 +127935,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 } @@ -127595,7 +127951,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+20589, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -127685,7 +128041,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) } @@ -127847,7 +128203,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+20654, 0) goto trigger_cleanup } iDb = int32(1) @@ -127887,7 +128243,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+20700, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -127897,11 +128253,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+20708, 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+20749, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127910,13 +128266,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+20700, (*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+20789, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127924,8 +128280,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+20815, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127933,15 +128289,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 + 20853 } else { - v1 = __ccgo_ts + 20788 + v1 = __ccgo_ts + 20860 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20794, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20866, 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+20903, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127961,9 +128317,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 @@ -128063,7 +128419,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+20700, 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 } @@ -128085,7 +128441,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+20949, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -128101,10 +128457,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+20997, 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+21072, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -128372,11 +128728,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+21101, 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) @@ -128414,9 +128770,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) { @@ -128431,7 +128787,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+21121, 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) } @@ -128564,11 +128920,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 + 21183 } else { - v1 = __ccgo_ts + 21118 + v1 = __ccgo_ts + 21190 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21125, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21197, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -128670,7 +129026,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+21245, 0) return int32(1) } @@ -128818,12 +129174,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) { @@ -128831,19 +129187,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) @@ -128854,7 +129213,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 @@ -128868,7 +129227,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 { @@ -128936,7 +129295,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): @@ -129035,10 +129394,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+21287, 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 @@ -129060,7 +129421,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 @@ -129132,7 +129493,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)) @@ -129548,13 +129909,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 @@ -129562,21 +129923,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 */ @@ -129623,7 +129984,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 @@ -129662,7 +130023,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 } @@ -129706,58 +130067,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+21301, 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+21337, 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 { @@ -129787,17 +130136,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++ } @@ -129809,11 +130158,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 @@ -129829,11 +130178,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 @@ -129842,18 +130191,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++ } @@ -129862,16 +130211,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. */ @@ -129889,24 +130238,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 { @@ -129932,50 +130281,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) @@ -130273,8 +130622,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -130324,8 +130673,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++ @@ -130372,11 +130721,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)) } @@ -130388,11 +130737,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. */ @@ -130435,7 +130784,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+21356) } goto update_cleanup update_cleanup: @@ -130492,13 +130841,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) { @@ -130540,11 +130889,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 @@ -130869,9 +131218,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+21369, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21301, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21373, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -130960,13 +131309,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: @@ -130974,7 +131323,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+12714, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -131056,7 +131405,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+21446, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21450, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -131147,7 +131496,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 @@ -131186,17 +131535,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+21454) 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+21494) 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+21537) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -131213,7 +131562,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+21586) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -131266,7 +131615,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+15091) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131297,11 +131646,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+21613, 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+21721, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131310,7 +131659,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+21775, 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 @@ -131320,7 +131669,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+21912, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -131463,7 +131812,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) @@ -131847,7 +132196,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+12944, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131970,24 +132319,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+22035, 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+22059, 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+22158, 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 @@ -132071,7 +132425,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+22177, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -132113,9 +132467,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+22219, 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) @@ -132128,7 +132482,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 + 22249 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -132162,7 +132516,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+16841, 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 @@ -132243,13 +132597,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+22295, 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))) @@ -132330,7 +132684,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+22295, 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) @@ -132378,7 +132732,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+22314, 0) return int32(SQLITE_ERROR) } goto _1 @@ -132389,9 +132743,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(158352))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158354)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -132433,7 +132787,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) } @@ -132799,7 +133153,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 } @@ -132889,7 +133243,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 } @@ -132909,7 +133263,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) } @@ -132973,7 +133327,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(158849)) } else { ap = va switch op { @@ -132986,7 +133340,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(158871)) break } _ = ap @@ -133671,7 +134025,6 @@ type TWhereInfo1 = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo1 = TWhereInfo1 @@ -133707,10 +134060,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 + 22327 } if i == -int32(1) { - return __ccgo_ts + 16878 + return __ccgo_ts + 16950 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -133729,10 +134082,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+22334, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22268, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22340, int32(1)) } i = 0 for { @@ -133740,7 +134093,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+13334, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133749,11 +134102,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+22340, int32(1)) } i = 0 for { @@ -133761,16 +134114,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+13334, 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)) } } @@ -133817,7 +134170,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+22342, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133825,12 +134178,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+22334, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22273 + v2 = __ccgo_ts + 22345 } else { - v2 = __ccgo_ts + 22278 + v2 = __ccgo_ts + 22350 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133847,7 +134200,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+22358) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133858,9 +134211,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+22360) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5203, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5229, int32(1)) } // C documentation @@ -133905,11 +134258,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 + 22362 } else { - v2 = __ccgo_ts + 22297 + v2 = __ccgo_ts + 22369 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22302, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22374, 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 { @@ -133922,37 +134275,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 + 11497 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22308 + zFmt = __ccgo_ts + 22380 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22341 + zFmt = __ccgo_ts + 22413 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22366 + zFmt = __ccgo_ts + 22438 } else { - zFmt = __ccgo_ts + 22384 + zFmt = __ccgo_ts + 22456 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22393, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22465, 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 + 16950 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22473, 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+22504, libc.VaList(bp+144, zRowid)) cRangeOp = int8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133962,14 +134315,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+22514, 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+22519) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22469 + v3 = __ccgo_ts + 22541 } else { - v3 = __ccgo_ts + 22477 + v3 = __ccgo_ts + 22549 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -133990,7 +134343,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+22555, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -134056,14 +134409,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+22566, 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+22345, 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+22587, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -134087,16 +134440,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+22334, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22273, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22345, 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 @@ -134301,7 +134654,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 @@ -134380,7 +134733,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 */ @@ -134500,7 +134853,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i 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)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(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)) } @@ -134512,7 +134865,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } else { v3 = n } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(v3))) eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } pX = pExpr @@ -134550,10 +134903,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 @@ -134742,7 +135095,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 @@ -134873,7 +135226,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 @@ -135155,7 +135508,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 @@ -135216,11 +135569,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 @@ -135251,6 +135604,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 { @@ -135389,7 +135745,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 @@ -135469,7 +135825,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 @@ -135503,7 +135859,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 @@ -135625,7 +135981,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 @@ -135818,7 +136174,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: @@ -135832,12 +136188,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 { @@ -135875,11 +136232,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 */ @@ -135899,7 +136256,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 } @@ -135935,21 +136292,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 @@ -135967,7 +136324,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, @@ -136022,7 +136379,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+22595, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -136045,7 +136402,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+22610, 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)) @@ -136534,9 +136891,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 @@ -136545,7 +136902,7 @@ 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+22619, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { @@ -136591,15 +136948,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 @@ -136611,7 +136969,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) { @@ -136684,7 +137042,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) @@ -137082,19 +137440,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16727, + FzOp: __ccgo_ts + 16799, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16061, + FzOp: __ccgo_ts + 16133, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15540, + FzOp: __ccgo_ts + 15592, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22561, + FzOp: __ccgo_ts + 22633, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -137882,7 +138240,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+22640, 0) return } } else { @@ -137894,10 +138252,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+22640, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137978,7 +138336,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) @@ -138079,7 +138437,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 + 22681 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -138610,7 +138968,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+22688, 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) @@ -138682,7 +139040,6 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo @@ -138693,7 +139050,6 @@ type THiddenIndexInfo1 = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo1 = THiddenIndexInfo1 @@ -139726,7 +140082,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)<>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 @@ -142343,7 +142695,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { + })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0)) { if libc.Int32FromUint16((*(*struct { FnEq Tu16 FnBtm Tu16 @@ -142547,7 +142899,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 @@ -142831,7 +143183,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) } } @@ -143009,7 +143361,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)) @@ -143350,7 +143702,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+22761, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143425,7 +143777,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+22761, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143579,7 +143931,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(168893)) /* 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) @@ -144015,7 +144367,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+22787, 0) rc = SQLITE_OK } else { break @@ -145223,7 +145575,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+22822, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145801,7 +146153,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 @@ -145957,7 +146309,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+22840, 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 @@ -145978,11 +146330,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) @@ -146030,7 +146379,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+22868, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -146175,7 +146524,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 @@ -146209,7 +146559,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. @@ -146335,7 +146685,7 @@ 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 @@ -146366,16 +146716,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 @@ -146554,7 +146904,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 { @@ -146761,7 +147111,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 @@ -146771,7 +147121,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+22886, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146821,7 +147171,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 } @@ -147090,7 +147440,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+22915, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -147272,7 +147622,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+22971, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -147598,7 +147948,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+23016, libc.VaList(bp+8, zName)) } return p } @@ -147649,12 +147999,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+23035, 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+23106, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -147727,7 +148077,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 } @@ -147865,7 +148215,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( 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 { @@ -148009,7 +148359,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+23169, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -148045,7 +148395,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)) } @@ -148060,7 +148410,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 @@ -148079,11 +148429,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 { @@ -148129,11 +148479,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 @@ -148150,7 +148500,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)) @@ -148172,7 +148522,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 @@ -148296,7 +148646,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+23195, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -148364,18 +148714,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 + 23227 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23172 + zErr = __ccgo_ts + 23244 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23188 + zErr = __ccgo_ts + 23260 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23208, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23280, 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 { @@ -148399,7 +148749,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+23313, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -148505,24 +148855,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 @@ -148540,12 +148890,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) } @@ -148557,15 +148907,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 @@ -148617,11 +148967,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 + 23360, + 1: __ccgo_ts + 23413, + 2: __ccgo_ts + 22915, + 3: __ccgo_ts + 23464, + 4: __ccgo_ts + 23516, } var _aOp1 = [5]int32{ @@ -149201,7 +149551,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 } @@ -149297,7 +149647,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 '' */ @@ -150014,12 +150364,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 @@ -150027,13 +150377,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 @@ -150053,13 +150403,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 @@ -150086,7 +150436,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 @@ -150305,6 +150655,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. @@ -150365,7 +150719,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+23566, libc.VaList(bp+8, p)) } // C documentation @@ -150379,6 +150733,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) } @@ -150412,11 +150767,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 + 23590 } else { - v1 = __ccgo_ts + 23527 + v1 = __ccgo_ts + 23599 } - _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+23605, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -150425,7 +150780,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+23647, 0) } } } @@ -150531,7 +150886,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+23681, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -157052,13 +157407,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) } @@ -158988,20 +159343,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+16950, 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+23719, 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+16886, 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+23719, 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 @@ -159042,7 +159397,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 */ @@ -159187,7 +159547,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 */ @@ -159277,9 +159642,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) } @@ -159634,7 +159999,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+23746) 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) { @@ -159984,9 +160349,9 @@ _237: */ _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 + v347 = __ccgo_ts + 8130 } else { - v347 = __ccgo_ts + 8110 + v347 = __ccgo_ts + 8135 } *(*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 { @@ -160228,15 +160593,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+23755, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23778, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23850, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23862, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23934, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -160378,7 +160743,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 */ @@ -160572,7 +160937,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+24019, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -163303,14 +163668,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)< int32(65528) { sz = int32(65528) } - if cnt < 0 { + /* 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 > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } szAlloc = int64(sz) * int64(cnt) - if sz == 0 || cnt == 0 { + 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)) @@ -164786,7 +165160,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182779)) + return _sqlite3MisuseError(tls, int32(183820)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164806,7 +165180,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+24106, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -165107,14 +165481,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 + 24649 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -165126,31 +165500,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 + 24174, + 1: __ccgo_ts + 24187, + 3: __ccgo_ts + 24203, + 4: __ccgo_ts + 24228, + 5: __ccgo_ts + 24242, + 6: __ccgo_ts + 24261, 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 + 24286, + 9: __ccgo_ts + 24323, + 10: __ccgo_ts + 24335, + 11: __ccgo_ts + 24350, + 12: __ccgo_ts + 24383, + 13: __ccgo_ts + 24401, + 14: __ccgo_ts + 24426, + 15: __ccgo_ts + 24455, + 17: __ccgo_ts + 6158, + 18: __ccgo_ts + 5562, + 19: __ccgo_ts + 24472, + 20: __ccgo_ts + 24490, + 21: __ccgo_ts + 24508, + 23: __ccgo_ts + 24542, + 25: __ccgo_ts + 24563, + 26: __ccgo_ts + 24589, + 27: __ccgo_ts + 24612, + 28: __ccgo_ts + 24633, } // C documentation @@ -165297,6 +165671,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 // // /* @@ -165329,7 +165717,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i 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(183430)) + return _sqlite3MisuseError(tls, int32(184509)) } 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) @@ -165372,7 +165760,7 @@ 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+24730, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165498,7 +165886,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+24793, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -165529,7 +165917,7 @@ 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) } @@ -165773,7 +166161,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(184046)) + return _sqlite3MisuseError(tls, int32(185125)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -165783,7 +166171,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+24844, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165905,7 +166293,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(184182))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185261))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -166037,7 +166425,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(184261)) + return _sqlite3MisuseError(tls, int32(185340)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -166047,7 +166435,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(184270)) + return _sqlite3MisuseError(tls, int32(185349)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -166096,7 +166484,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(184318)) + return _sqlite3MisuseError(tls, int32(185397)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -166105,7 +166493,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+24865, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -166252,7 +166640,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+24933, 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 @@ -166282,8 +166670,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+24939, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24949, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -166372,24 +166760,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+24977, 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+24981, 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 + 24981 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24930, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25002, 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 @@ -166418,12 +166806,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+25017, 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+25037, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -166447,7 +166835,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+25061, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -166467,11 +166855,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24915, + Fz: __ccgo_ts + 24987, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24922, + Fz: __ccgo_ts + 24994, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -166482,19 +166870,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24935, + Fz: __ccgo_ts + 25007, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24938, + Fz: __ccgo_ts + 25010, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24941, + Fz: __ccgo_ts + 25013, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17948, + Fz: __ccgo_ts + 18020, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -166622,8 +167010,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+22681, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25077, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -166644,10 +167032,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(184993)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186072)) /* 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) } @@ -166656,7 +167044,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) } @@ -166683,9 +167071,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 + 24079 (*(*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 { @@ -166779,7 +167167,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 + 25083 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166939,7 +167327,7 @@ 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) @@ -166996,20 +167384,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+25086, 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+25111) } 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+25131) } 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+25138) } // C documentation @@ -167034,9 +167422,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) @@ -167063,29 +167451,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 @@ -167140,15 +167517,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+25155, 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) @@ -167327,8 +167704,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 @@ -167772,7 +168149,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: ; @@ -168168,7 +168545,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+25183, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -168386,7 +168763,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 + 25191 } else { v2 = uintptr(0) } @@ -168465,7 +168842,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) @@ -168632,7 +169009,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 @@ -168849,6 +169226,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -169161,8 +169545,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 @@ -169219,7 +169603,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 @@ -169229,7 +169613,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 @@ -169267,18 +169651,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 + 25214, + 12: __ccgo_ts + 25220, 13: __ccgo_ts + 1695, 14: __ccgo_ts + 1695, 15: __ccgo_ts + 1695, @@ -169765,7 +170149,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) { @@ -170063,8 +170447,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) } } @@ -170200,7 +170584,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+15535, 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)) @@ -170214,14 +170598,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+25227, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -170275,7 +170657,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+25256, -int32(1)) } } } @@ -170558,8 +170940,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 + 25271, + FzRepl: __ccgo_ts + 25275, }, 1: { Fc1: int8('i'), @@ -170567,8 +170949,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 + 25283, + FzRepl: __ccgo_ts + 25275, }, 2: { Fc1: int8('n'), @@ -170583,7 +170965,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25237, + FzMatch: __ccgo_ts + 25292, FzRepl: __ccgo_ts + 1681, }, 4: { @@ -170591,7 +170973,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25242, + FzMatch: __ccgo_ts + 25297, FzRepl: __ccgo_ts + 1681, }, } @@ -170607,7 +170989,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+25302, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -170625,23 +171007,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 } @@ -170719,7 +171101,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 @@ -170790,7 +171172,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) + } } } } @@ -171065,7 +171451,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+25345, 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') { @@ -171495,7 +171881,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 { @@ -171534,7 +171920,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)) } @@ -171542,7 +171928,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)) } @@ -171619,14 +172005,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+25271, 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+25354) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25306) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25361) } - 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+25367, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171811,7 +172197,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+25361) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171856,7 +172242,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+25256, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171869,7 +172255,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+25256, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171918,10 +172304,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) @@ -171955,15 +172337,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 @@ -172036,11 +172418,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: ; @@ -172089,9 +172471,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25220 + v19 = __ccgo_ts + 25275 } else { - v19 = __ccgo_ts + 11972 + v19 = __ccgo_ts + 11997 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -172127,9 +172509,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: ; @@ -172156,7 +172541,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25318, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25373, uint32(2)) zIn2++ sz2-- continue @@ -172179,7 +172564,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25321, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25376, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -172187,12 +172572,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25328, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25383, 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+25388, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -172372,7 +172757,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+25395, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172395,12 +172780,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+25398, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25340, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25395, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172415,50 +172800,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 // // /* @@ -172510,6 +172851,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 // // /* @@ -172530,6 +172949,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)) @@ -172602,9 +173024,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 @@ -172647,7 +173069,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 @@ -173135,7 +173568,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+25256, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -173270,7 +173703,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 } @@ -173371,7 +173804,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+25256, -int32(1)) return } @@ -173408,11 +173841,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+25227, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -173425,7 +173855,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+25256, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -173444,10 +173874,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+25361) } 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+25354) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -173486,7 +173916,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+25401, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -173502,7 +173932,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. // ** @@ -173583,7 +174013,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+25256, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -173595,34 +174025,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; +// ** 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. +// ** 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) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { + 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 (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) - return 0 + 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 (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - 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 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) @@ -173705,7 +174155,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 @@ -173765,7 +174215,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+25256, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173900,7 +174350,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 + 25419 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173910,7 +174360,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+25256, -int32(1)) } } eErr = uint8(1) @@ -174020,23 +174470,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+25421, uint32(1)) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25368, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25423, 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+25425, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25373, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25428, uint32(1)) } } } @@ -174076,7 +174526,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+25256, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -174344,7 +174794,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+25256, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -174368,7 +174818,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+25430, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -174379,7 +174829,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+25481, -int32(1)) _jsonStringReset(tls, bp) return } @@ -174451,7 +174901,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+25256, -int32(1)) } } goto json_remove_done @@ -174488,7 +174938,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+16055) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -174519,9 +174969,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 + 25515 } else { - v1 = __ccgo_ts + 25464 + v1 = __ccgo_ts + 25519 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -174569,7 +175019,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+25256, -int32(1)) } } goto json_type_done @@ -174616,7 +175066,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 + 25526 (*(*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)) @@ -174690,17 +175140,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+25531, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -174709,18 +175158,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 @@ -174782,9 +175230,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))) @@ -174891,7 +175337,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+25588, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174983,20 +175429,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))) + } } } @@ -175040,7 +175488,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+25591, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -175143,7 +175591,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+25594) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -175277,7 +175725,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+25677, 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 @@ -175303,9 +175751,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+25684, 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+25692, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -175616,9 +176064,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))) @@ -175691,7 +176138,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+25698, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -175715,7 +176162,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+25256, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175776,186 +176223,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 + 25700, }, 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 + 25705, }, 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 + 25711, }, 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 + 25722, }, 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 + 25734, }, 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 + 25734, }, 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 + 25752, }, 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 + 25772, }, 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 + 25785, }, 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 + 25799, }, 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 + 25802, }, 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 + 25806, }, 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 + 25818, }, 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 + 25831, }, 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 + 25843, }, 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 + 25856, }, 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 + 25867, }, 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 + 25879, }, 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 + 25879, }, 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 + 25891, }, 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 + 25902, }, 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 + 25914, }, 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 + 25927, }, 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 + 25940, }, 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 + 25954, }, 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 + 25963, }, 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 + 25973, }, 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 + 25973, }, 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 + 25983, }, 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 + 25983, }, 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 + 25994, }, 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 + 26011, }, 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 + 26029, }, 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 + 26047, }, } @@ -176038,17 +176485,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 26011, + FzName: __ccgo_ts + 26066, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 26021, + FzName: __ccgo_ts + 26076, 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 @@ -176156,7 +176605,6 @@ type TRtreeMatchArg = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - FaParam [1]TRtreeDValue } type RtreeMatchArg = TRtreeMatchArg @@ -176439,11 +176887,12 @@ type TRtreeMatchArg1 = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - 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 ** clang, since clang works hard to be gcc compatible. So the gcc @@ -176519,7 +176968,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) } @@ -176625,7 +177074,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 @@ -176688,7 +177137,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+26086, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -176699,7 +177148,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 { @@ -176993,7 +177442,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+26091, 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 { @@ -177530,7 +177979,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) } @@ -177910,7 +178359,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+26173) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177988,7 +178437,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) @@ -178219,7 +178668,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 } @@ -178227,7 +178676,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 @@ -178465,7 +178914,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: @@ -178887,7 +179336,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 @@ -179400,7 +179849,7 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179417,7 +179866,7 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179445,7 +179894,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+26187, 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 { @@ -179455,11 +179904,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+26207, 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+26239, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -179673,7 +180122,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+26276, 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)) @@ -179727,9 +180176,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 + 26421 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+11826, 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) { @@ -179787,9 +180236,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 + 26477, + 1: __ccgo_ts + 5623, + 2: __ccgo_ts + 16950, } var _rtreeModule = Tsqlite3_module{ @@ -179833,21 +180282,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+26891, 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+26953, 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+26958, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27022, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27092, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179877,7 +180326,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 + 27141 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179892,31 +180341,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+27249, 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+27294, 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+13334, 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+27321, 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+27343, 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+27351, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179930,14 +180379,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 + 26482, + 1: __ccgo_ts + 26535, + 2: __ccgo_ts + 26580, + 3: __ccgo_ts + 26632, + 4: __ccgo_ts + 26686, + 5: __ccgo_ts + 26731, + 6: __ccgo_ts + 26789, + 7: __ccgo_ts + 26844, } // C documentation @@ -179995,7 +180444,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+27367, 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) @@ -180003,17 +180452,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+27387, 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))) @@ -180076,7 +180525,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) } @@ -180090,13 +180539,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+27630, 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+27636, 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) { @@ -180105,7 +180554,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+27660, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -180119,19 +180568,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+27687, 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))) } } } @@ -180154,7 +180603,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)) @@ -180165,7 +180614,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 @@ -180181,8 +180630,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27611, - 1: __ccgo_ts + 27622, + 0: __ccgo_ts + 27666, + 1: __ccgo_ts + 27677, } // C documentation @@ -180240,21 +180689,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+11446, 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+27690, 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+27696, 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+27700, int32(1)) goto _1 _1: ; @@ -180281,7 +180730,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+27702, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -180384,7 +180833,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) @@ -180399,11 +180848,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+27735, 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) } @@ -180437,7 +180886,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+27742, 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) @@ -180454,7 +180903,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+27787, libc.VaList(bp+8, iNode)) } } return pRet @@ -180483,8 +180932,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 + 27819, + 1: __ccgo_ts + 27873, } 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)) @@ -180497,21 +180946,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 + 27921 } else { - v1 = __ccgo_ts + 27874 + v1 = __ccgo_ts + 27929 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27883, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27938, 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 + 27921 } else { - v2 = __ccgo_ts + 27874 + v2 = __ccgo_ts + 27929 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27928, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27983, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -180556,7 +181005,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+28041, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -180574,7 +181023,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+28089, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -180607,19 +181056,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+28156, 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+28190, 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+28220, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -180664,12 +181113,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+28275, 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+28306, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -180698,7 +181147,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+28373, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -180708,11 +181157,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+26187, 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+28401, 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)) @@ -180728,8 +181177,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+28432, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28439, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -180756,7 +181205,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+28447, 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) } @@ -180807,13 +181256,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+28466, -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))) } @@ -180822,7 +181271,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 + 18717 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -181089,7 +181538,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++ @@ -181134,7 +181583,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 @@ -181196,7 +181645,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 } @@ -181564,7 +182013,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 @@ -181579,9 +182028,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: ; @@ -181666,7 +182115,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 { @@ -181807,7 +182256,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 // ** @@ -181846,7 +182295,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) } @@ -181950,7 +182399,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 @@ -182034,7 +182483,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 @@ -182318,7 +182767,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) { @@ -182475,7 +182924,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 @@ -182487,13 +182936,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+27630, 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+28590, 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) @@ -182502,13 +182951,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+28612, 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+27687, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -182516,7 +182965,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) @@ -182531,7 +182980,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 @@ -182743,7 +183192,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 + 16950 (*(*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) @@ -182753,7 +183202,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 + 28616 (*(*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) @@ -182761,7 +183210,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 + 28622 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182881,7 +183330,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+28631, 0) } goto geopoly_update_end } @@ -182984,12 +183433,12 @@ geopoly_update_end: func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28616) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28671) == 0 { *(*uintptr)(unsafe.Pointer(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 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28687) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) @@ -183060,7 +183509,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+28864, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -183074,61 +183523,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28647, + FzName: __ccgo_ts + 28702, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28660, + FzName: __ccgo_ts + 28715, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28673, + FzName: __ccgo_ts + 28728, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28686, + FzName: __ccgo_ts + 28741, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28632, + FzName: __ccgo_ts + 28687, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28698, + FzName: __ccgo_ts + 28753, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28616, + FzName: __ccgo_ts + 28671, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28721, + FzName: __ccgo_ts + 28776, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28735, + FzName: __ccgo_ts + 28790, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28748, + FzName: __ccgo_ts + 28803, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28762, + FzName: __ccgo_ts + 28817, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28778, + FzName: __ccgo_ts + 28833, }, } @@ -183154,7 +183603,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28790, + FzName: __ccgo_ts + 28845, }, } @@ -183179,20 +183628,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+28872, 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+28882, 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+28893, -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+28616, 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+28904, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -183266,7 +183715,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) @@ -183294,7 +183743,7 @@ 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+26173, __ccgo_fp(_rtreeMatchArgFree)) } } } @@ -183535,7 +183984,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 @@ -184511,7 +184960,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+28914, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -184521,7 +184970,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+28914, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -184547,7 +184996,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 @@ -184570,7 +185019,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 } @@ -184702,7 +185151,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+28935, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184791,7 +185240,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+26086, 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')) { @@ -184828,13 +185277,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 + 29106 } 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+29147, 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+29297) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -185001,7 +185450,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))) } } @@ -185062,7 +185511,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+29422, 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 @@ -185072,7 +185521,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+29541, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -185080,7 +185529,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+29562, 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) @@ -185092,7 +185541,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+29613, 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 { @@ -185136,7 +185585,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+29634, 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))) { @@ -185149,7 +185598,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+29662, 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 { @@ -185202,7 +185651,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+20225, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -185213,7 +185662,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+29691, 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) @@ -185224,7 +185673,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+29710, 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 @@ -185232,7 +185681,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+29715, zName) { bRbuRowid = int32(1) } } @@ -185246,17 +185695,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 + 29725 } else { - v4 = __ccgo_ts + 29683 + v4 = __ccgo_ts + 29738 } - (*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+29747, 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+29776, 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)) @@ -185278,7 +185727,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+29798, 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)) @@ -185324,8 +185773,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+29825, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15202 goto _1 _1: ; @@ -185359,7 +185808,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+29834, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -185407,21 +185856,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+29847, 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+29879, 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+15202, __ccgo_ts+29902) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29908, __ccgo_ts+29915, __ccgo_ts+5229) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1695, __ccgo_ts+15202, __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+29923, 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+29965, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -185473,7 +185922,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+29662, 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)) @@ -185495,15 +185944,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 + 29985 } } 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+29993, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30014, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30050, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15202 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -185512,7 +185961,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+30077, 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 @@ -185529,15 +185978,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+30125, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15202 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+30132, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -185595,7 +186044,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+29662, 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)) @@ -185604,7 +186053,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+30144, 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 { @@ -185624,9 +186073,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 + 29985 } else { - zCol = __ccgo_ts + 29660 + zCol = __ccgo_ts + 29715 } } zType = __ccgo_ts + 1169 @@ -185634,24 +186083,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+30166, 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 + 29902 } 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+30186, 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+30207, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30240, 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 + 15202 + zAnd = __ccgo_ts + 22334 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185705,11 +186154,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+30264, 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+30276, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15177 + zS = __ccgo_ts + 15202 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -185721,7 +186170,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+30285, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -185747,7 +186196,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+30300, 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 @@ -185757,15 +186206,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+30314, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22334 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30271, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30326, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1695 i1 = 0 @@ -185775,8 +186224,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+30376, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22334 } goto _2 _2: @@ -185799,7 +186248,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+30389, 0) } // C documentation @@ -185841,16 +186290,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+30376, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15202 } 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+30415, 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 + 15202 } 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+30445, 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 + 15202 } } } @@ -185934,16 +186383,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 + 30482 *(*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+29634, 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+16838) == 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+29662, libc.VaList(bp+24, zIdx))) } break } @@ -185954,16 +186403,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 + 29902 } 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+30495, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15202 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30451, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30506, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -186009,7 +186458,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+30510) 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))) { @@ -186017,7 +186466,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+29662, 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))) { @@ -186026,21 +186475,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+30560, 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 + 29902 } 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+30582, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15202 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30537, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30592, 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+30607, 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)) } } @@ -186077,7 +186526,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) { @@ -186086,19 +186535,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 + 30669 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30627 + v2 = __ccgo_ts + 30682 } 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+30692, 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 + 15202 goto _1 _1: ; @@ -186107,17 +186556,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+30719, 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 + 30726 } 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+30741, 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)) } } @@ -186143,7 +186592,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+30773, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -186189,7 +186638,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+30830) } 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)) @@ -186358,7 +186807,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+30896, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -186375,18 +186824,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+30916, 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+30981, 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+31017, 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 { @@ -186401,26 +186850,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 + 31051 } else { - v2 = __ccgo_ts + 31000 + v2 = __ccgo_ts + 31055 } 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+31061, 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+31122, 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 + 31051 } else { - v3 = __ccgo_ts + 31000 + v3 = __ccgo_ts + 31055 } - 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+31183, 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 { @@ -186439,8 +186888,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). */ @@ -186449,39 +186898,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 + 31342 } 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 + 31351 } 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+31361, 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+31397, 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 + 31425 } /* 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 + 31437 } 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+31454, 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+31530, 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+31829, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -186492,9 +186941,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 + 31928 } else { - v7 = __ccgo_ts + 31883 + v7 = __ccgo_ts + 31938 } zRbuRowid1 = v7 } @@ -186507,14 +186956,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+29985, 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+15202, __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 + 31949 } else { v8 = __ccgo_ts + 1695 } @@ -186524,11 +186973,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 + 23590 } 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+31955, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -186616,9 +187065,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 + 31342 } - 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+32003, 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 } @@ -186645,7 +187094,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) } @@ -186692,7 +187141,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+32033, 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): @@ -186751,27 +187200,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+32063, 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+32091, 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+32109, 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 } @@ -186804,10 +187253,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+32175, 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+24933, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186823,14 +187272,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 + 32207 } 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+32209, 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 @@ -186841,27 +187290,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+32241, -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+32256, 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+32273, -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+32289, 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+32317, 0) } } @@ -186947,7 +187396,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { if pState == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32234, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32289, uintptr(0), uintptr(0), uintptr(0)) } } /* Assuming no error has occurred, run a "restart" checkpoint with the @@ -186980,7 +187429,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CAPTURE) - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32280, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32335, uintptr(0), uintptr(0), uintptr(0)) if rc2 != int32(SQLITE_NOTICE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -187043,7 +187492,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) } @@ -187113,16 +187562,16 @@ 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) + 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_methods1)(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) } - 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)) @@ -187144,7 +187593,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+32370, 0) } // C documentation @@ -187161,13 +187610,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+32395, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32402, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -187299,7 +187748,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+24490, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -187435,7 +187884,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+32409) 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 @@ -187448,7 +187897,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+32431, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -187475,7 +187924,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+32458, 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))) @@ -187511,9 +187960,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+32618, 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+32633, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -187536,9 +187985,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+32653, 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+32678) } 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) @@ -187549,10 +187998,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+32786) } 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+32851) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -187570,7 +188019,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+32895, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -187597,8 +188046,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+17923) + _rbuCopyPragma(tls, p, __ccgo_ts+17034) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -187606,7 +188055,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+32920, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -187628,10 +188077,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+15106, 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+15106, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -187718,7 +188167,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+32948, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -187741,10 +188190,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+32395, 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) } @@ -187766,7 +188215,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+32973, 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) @@ -187813,7 +188262,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+32984, 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 { @@ -187858,11 +188307,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+33056, 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+33070) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187871,7 +188320,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+33127) 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) @@ -187919,7 +188368,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 @@ -187951,7 +188400,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+33201, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187973,17 +188422,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 + 33233 } else { - v3 = __ccgo_ts + 33185 + v3 = __ccgo_ts + 33240 } - (*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+33247, 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+15091, 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) @@ -187995,21 +188444,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+17637) + _rbuCopyPragma(tls, p, __ccgo_ts+17049) } /* 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+33279, 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+33295, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -188087,7 +188536,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+33319, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -188134,7 +188583,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+31342, 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++ @@ -188162,7 +188611,7 @@ 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+15106, 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) { @@ -188171,7 +188620,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { } _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+15106, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -188181,7 +188630,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+33327, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -188282,7 +188731,7 @@ 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+15106, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ @@ -188295,19 +188744,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { 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+15106, 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 + 15091 } else { - v1 = __ccgo_ts + 33224 + v1 = __ccgo_ts + 33279 } 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+33279, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -188793,7 +189242,7 @@ func _rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileSize})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, pSize) /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existence of a *-wal file. rbuVfsRead() contains ** similar logic. */ if rc == SQLITE_OK && *(*Tsqlite_int64)(unsafe.Pointer(pSize)) == 0 && (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpRbu)).FzTarget == uintptr(0) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_MAIN_DB) != 0 { *(*Tsqlite_int64)(unsafe.Pointer(pSize)) = int64(1024) @@ -188874,7 +189323,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xControl})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, int32(SQLITE_FCNTL_ZIPVFS), bp) if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33299, 0) + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33354, 0) } else { if rc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p @@ -188900,7 +189349,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r if rc == SQLITE_OK && op == int32(SQLITE_FCNTL_VFSNAME) { pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs zIn = *(*uintptr)(unsafe.Pointer(pArg)) - zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33322, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33377, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -189095,7 +189544,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag if pDb != 0 { if (*Trbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == int32(RBU_STAGE_OAL) { if (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) { - zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6743) + zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6768) zOpen = Xsqlite3_filename_wal(tls, zOpen) } nOpen = libc.Xstrlen(tls, zOpen) @@ -189109,7 +189558,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag } else { (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu } - if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33333, 0) != 0 { + if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33388, 0) != 0 { oflags = libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) } @@ -189665,7 +190114,7 @@ func _statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint _sqlite3TokenInit(tls, bp, *(*uintptr)(unsafe.Pointer(argv + 3*8))) iDb = _sqlite3FindDb(tls, db, bp) if iDb < 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12410, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12435, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) return int32(SQLITE_ERROR) } } else { @@ -189977,7 +190426,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { _sqlite3BtreeEnter(tls, pBt) nUsable = szPage - _sqlite3BtreeGetReserveNoMutex(tls, pBt) _sqlite3BtreeLeave(tls, pBt) - (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32)) + (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32))) if (*TStatPage)(unsafe.Pointer(p)).FaCell == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -190024,7 +190473,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } (*TStatCell)(unsafe.Pointer(pCell)).FnLastOvfl = libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp)) - libc.Uint32FromInt32(nLocal) - libc.Uint32FromInt32((nOvfl-int32(1))*(nUsable-int32(4)))) (*TStatCell)(unsafe.Pointer(pCell)).FnOvfl = nOvfl - (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(4)*libc.Uint64FromInt32(nOvfl)) + (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(uint64(4)*libc.Uint64FromInt32(nOvfl))) if (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -190165,7 +190614,7 @@ statNextRestart: (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiPgno = iRoot (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33344, 0) + v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33399, 0) z = v1 (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FzPath = v1 if z == uintptr(0) { @@ -190203,8 +190652,8 @@ statNextRestart: if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { (*TStatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33346 - v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33355, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33401 + v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33410, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) z = v2 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v2 if z == uintptr(0) { @@ -190233,7 +190682,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage++ if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226029)) + return _sqlite3CorruptError(tls, int32(227304)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -190244,7 +190693,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+33422, 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) { @@ -190267,13 +190716,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 + 33430 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 + 33439 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33389 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33444 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -190282,7 +190731,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) { @@ -190371,12 +190820,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+33454, 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+33609, 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+33623, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -190453,7 +190902,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+33638, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -191654,7 +192103,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) { @@ -191747,11 +192196,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+11826, 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+33645, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1695, 0) @@ -191760,7 +192209,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+33775, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191786,10 +192235,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+29985))) 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) @@ -191810,8 +192259,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+29985) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29985, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191875,7 +192324,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 @@ -191892,6 +192341,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 { @@ -191913,12 +192364,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+11826, (*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))) } } } @@ -192208,10 +192659,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 + 11446 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33750, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33805, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -192223,8 +192674,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 + 15202 goto _1 _1: ; @@ -192878,8 +193329,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+33812, 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 + 22334 if zRet == uintptr(0) { break } @@ -192908,8 +193359,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+33846, 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 + 33887 if zRet == uintptr(0) { break } @@ -192920,7 +193371,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 } @@ -192931,12 +193382,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 + 33892 } 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+33903, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192997,11 +193448,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15177 + v2 = __ccgo_ts + 15202 } 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+33982, 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 } @@ -193029,7 +193480,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+34001, 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 { @@ -193058,17 +193509,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)) @@ -193081,7 +193533,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 } @@ -193092,18 +193546,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+34058, 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+34089, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -193129,7 +193609,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+34110, 0) } rc = int32(SQLITE_SCHEMA) } @@ -193177,7 +193657,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) } @@ -193461,7 +193941,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) } @@ -193761,12 +194241,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+34137, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11826, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34141, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34165, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34174, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34219, bp) } else { i = 0 for { @@ -193774,17 +194254,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+15202, 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 + 15202 _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+34233, 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+34237, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -193798,7 +194278,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+34264, 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) } @@ -193940,7 +194420,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, 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+34306, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -194046,7 +194526,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } } 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+34326, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -194301,13 +194781,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 } } @@ -194463,7 +194944,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(230285)) + rc = _sqlite3CorruptError(tls, int32(231591)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -194487,7 +194968,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(230305)) + rc = _sqlite3CorruptError(tls, int32(231611)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -194502,7 +194983,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(230315)) + rc = _sqlite3CorruptError(tls, int32(231621)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -194558,7 +195039,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(230363)) + rc = _sqlite3CorruptError(tls, int32(231669)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -194663,7 +195144,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(230451)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231757)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -194734,8 +195215,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) @@ -194769,7 +195250,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(230537)) + v7 = _sqlite3CorruptError(tls, int32(231843)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194779,7 +195260,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(230543)) + v10 = _sqlite3CorruptError(tls, int32(231849)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194858,7 +195339,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(230587)) + v16 = _sqlite3CorruptError(tls, int32(231893)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -195196,7 +195677,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 @@ -195268,7 +195749,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230952)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232258)) goto finished_invert } if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { @@ -195471,7 +195952,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+11826) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -195480,9 +195961,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+34344, 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+34357, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -195492,9 +195973,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+34363, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15177 + zSep = __ccgo_ts + 15202 } goto _2 _2: @@ -195503,7 +195984,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+34368, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -195512,13 +195993,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+34376, 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+34451, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22262 + zSep = __ccgo_ts + 22334 } goto _3 _3: @@ -195605,9 +196086,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+34457, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34261, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34368, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -195617,9 +196098,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+34363, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22262 + zSep = __ccgo_ts + 22334 } goto _1 _1: @@ -195627,9 +196108,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+34475, 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+33887, bp) zSep = __ccgo_ts + 1695 i = 0 for { @@ -195639,16 +196120,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+34451, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34376 + zSep = __ccgo_ts + 34483 } 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)) @@ -195674,7 +196155,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 @@ -195697,16 +196178,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+34488, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22268, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22340, 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+15202, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -195714,19 +196195,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+34506, 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+34517, 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)) } @@ -195749,12 +196230,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+11826, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34414) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34521) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34527) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34634) } return rc } @@ -195820,7 +196301,7 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231434)) + rc = _sqlite3CorruptError(tls, int32(232740)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -196236,7 +196717,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+34778, 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)) @@ -196249,7 +196730,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+34799, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -196349,10 +196830,10 @@ 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+34818, 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+34844, 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)) @@ -196383,7 +196864,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui ** 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)))) 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 @@ -196393,7 +196874,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 } @@ -196412,18 +196893,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+34874, 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+34918, 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+34989, 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+11826) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -196480,17 +196961,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34942, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35049, 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+35079, 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+35103, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35079, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -196604,7 +197085,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) } @@ -196974,7 +197455,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) } @@ -197266,7 +197747,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 { @@ -197302,11 +197783,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 @@ -197891,6 +198378,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 @@ -197936,8 +198424,7 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset @@ -197949,12 +198436,13 @@ type Fts5Colset = TFts5Colset ** This object is used by fts5_expr.c and fts5_index.c. */ type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 + FnCol 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 ** to parse the arguments passed to the CREATE VIRTUAL TABLE statement. @@ -198331,7 +198819,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -198359,16 +198846,14 @@ 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 @@ -198410,7 +198895,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 @@ -199214,7 +199699,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+35131, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -199570,7 +200055,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+35159, 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 */ } @@ -199854,7 +200339,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+35190, 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) } @@ -199953,7 +200438,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 + 35197 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200041,7 +200526,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) } @@ -200208,7 +200693,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 + 35247 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200479,7 +200964,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))) @@ -200571,13 +201056,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) } @@ -200603,13 +201088,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 + 35295 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 + 35351 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -200642,19 +201127,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35302, + FzFunc: __ccgo_ts + 35409, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35310, + FzFunc: __ccgo_ts + 35417, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35320, + FzFunc: __ccgo_ts + 35427, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35325, + FzFunc: __ccgo_ts + 35432, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -201042,7 +201527,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 @@ -201518,7 +202003,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+35448, 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) { @@ -201544,12 +202029,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+35455, 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+35486, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201558,7 +202043,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+35519, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201568,14 +202053,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+35556, 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+35565, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -201602,7 +202087,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+35598, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -201614,76 +202099,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+35632, 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+35640, 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+35672, 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+35678, 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+35697, 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+35740, 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+35697, 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+35762, 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+35776, 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+35814, 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+35825, 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+35860, 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+35867, 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 + 18003, }, 2: { - FzName: __ccgo_ts + 35791, + FzName: __ccgo_ts + 35898, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -201691,20 +202176,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+35906, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35830, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35937, 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+35947, 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+35981, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201765,16 +202250,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+36009) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16950) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36014, 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+36044) { *(*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+36054, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201800,7 +202285,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+36085, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201808,12 +202293,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+36090, 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+36097, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35998, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36105, 0) } } goto _1 @@ -201829,9 +202314,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+36112, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35998, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36105, 0) } goto _2 _2: @@ -201894,8 +202379,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+36009) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36120, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201926,7 +202411,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+36149, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -201956,7 +202441,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+36169, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201964,37 +202449,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+36219, 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+36274, 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 + 35632 } 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 + 35632 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36220 + zTail = __ccgo_ts + 36327 } } } 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+36335, 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+16950, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -202063,7 +202548,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+36346, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -202072,16 +202557,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 + 15202 } 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+36362, 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+36369, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36009)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -202239,7 +202724,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+36395) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -202250,7 +202735,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+36400) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -202261,7 +202746,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+36409) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -202275,7 +202760,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+36419) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -202286,7 +202771,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+36429) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -202303,7 +202788,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+36441) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -202318,7 +202803,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+36009) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -202333,7 +202818,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+36453) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -202349,7 +202834,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+36467) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -202392,7 +202877,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 + 36477 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -202412,7 +202897,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+36509) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -202423,7 +202908,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+36517, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -202527,11 +203012,12 @@ type TFts5ExprNode1 = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode1 = TFts5ExprNode1 +/* Size (in bytes) of an Fts5ExprNode object that holds up to N children */ + /* ** 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. @@ -202561,24 +203047,26 @@ type TFts5ExprPhrase1 = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase1 = TFts5ExprPhrase1 +/* Size (in bytes) of an Fts5ExprPhrase object that holds up to N terms */ + /* ** 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 + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset1 = TFts5ExprNearset1 +/* Size (in bytes) of an Fts5ExprNearset object covering up to N phrases */ + /* ** Parse context. */ @@ -202669,7 +203157,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+36588, 0) return FTS5_EOF } goto _1 @@ -202680,7 +203168,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+36608, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -202695,13 +203183,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+36639, 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+36642, 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+31051, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -202745,7 +203233,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) @@ -204384,7 +204872,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) @@ -204394,7 +204882,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) @@ -204500,12 +204988,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 @@ -204639,7 +205127,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) @@ -204679,15 +205167,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)) @@ -204728,7 +205216,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 { @@ -204766,8 +205254,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+36646, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35159, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204787,10 +205275,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+36651, 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: ; @@ -204824,7 +205315,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 { @@ -204874,7 +205365,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 @@ -204925,7 +205416,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+21337, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204952,7 +205443,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)) @@ -205049,7 +205540,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+36680, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -205134,7 +205625,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) @@ -205147,7 +205638,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) @@ -205221,7 +205712,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 @@ -205247,11 +205738,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 + 36733 } else { - v2 = __ccgo_ts + 36539 + v2 = __ccgo_ts + 36646 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36633, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36740, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -205264,7 +205755,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+36790, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -205408,7 +205899,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 @@ -205741,7 +206232,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) { @@ -205805,7 +206296,7 @@ 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 +** to accumulate "term -> doclist" content before it is flushed to a level-0 ** segment. */ @@ -205864,7 +206355,7 @@ type TFts5HashEntry1 = struct { type Fts5HashEntry1 = TFts5HashEntry1 /* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -206002,7 +206493,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) } @@ -206314,7 +206805,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) } @@ -206746,9 +207237,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 @@ -206785,7 +207276,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206858,7 +207348,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206893,7 +207382,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206908,9 +207396,9 @@ 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 @@ -207007,11 +207495,12 @@ type TFts5Structure1 = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure1 = TFts5Structure1 +/* Size (in bytes) of an Fts5Structure object holding up to N levels */ + /* ** An object of type Fts5SegWriter is used to write to segments. */ @@ -207144,13 +207633,15 @@ type Fts5SegIter1 = TFts5SegIter1 ** Array of tombstone pages. Reference counted. */ type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray1 = TFts5TombstoneArray1 +/* Size (in bytes) of an Fts5TombstoneArray holding up to N tombstones */ + /* ** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. @@ -207203,11 +207694,12 @@ type TFts5Iter1 = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter1 = TFts5Iter1 +/* Size (in bytes) of an Fts5Iter object holding up to N segment iterators */ + /* ** An instance of the following type is used to iterate through the contents ** of a doclist-index record. @@ -207233,13 +207725,15 @@ type TFts5DlidxLvl1 = struct { type Fts5DlidxLvl1 = TFts5DlidxLvl1 type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } 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)) *(*Tu8)(unsafe.Pointer(aOut + 1)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) & libc.Int32FromInt32(0xFF)) @@ -207418,7 +207912,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+36843, 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. @@ -207523,7 +208017,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+36849, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -207552,7 +208046,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+36900, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -207586,7 +208080,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+36949, 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) @@ -207664,7 +208158,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)) @@ -207755,7 +208249,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+36989, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207766,7 +208260,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+36989, 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)) @@ -208447,7 +208941,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) @@ -208697,7 +209191,7 @@ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _ = nByte, nTomb, pNew nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(nTomb+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) if pNew != 0 { (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb @@ -208801,7 +209295,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 @@ -209407,7 +209901,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+37017, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -209496,7 +209990,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+37101, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -210143,7 +210637,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 @@ -211053,7 +211547,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 { @@ -211467,7 +211961,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+37183, 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. */ @@ -211973,7 +212467,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+37240, 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) @@ -212142,7 +212636,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 } @@ -212460,7 +212954,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+37301, 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))) @@ -212735,7 +213229,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: @@ -212770,7 +213264,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)) @@ -213384,11 +213878,12 @@ type TFts5TokenDataIter1 = struct { 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 // // /* @@ -213456,7 +213951,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) { @@ -213700,7 +214195,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) @@ -213750,7 +214245,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 @@ -213832,15 +214327,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) } @@ -213866,11 +214364,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+37352, 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+26086, __ccgo_ts+37360, 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+12037, __ccgo_ts+37395, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -214068,7 +214566,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) @@ -214323,7 +214821,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+37439) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -214674,7 +215172,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') @@ -214796,7 +215294,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 { @@ -214916,7 +215414,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+36843, 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))) @@ -215510,7 +216008,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+37441, 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)) @@ -215741,7 +216239,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+37527) 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)) @@ -215880,7 +216378,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -216037,11 +216534,12 @@ type TFts5Sorter1 = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter1 = TFts5Sorter1 +/* Size (int bytes) of an Fts5Sorter object with N indexes */ + /* ** Virtual-table cursor object. ** @@ -216363,7 +216861,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+37532, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -216400,7 +216898,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++ @@ -216419,7 +216917,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 @@ -216869,7 +217367,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 @@ -216897,7 +217395,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) } @@ -216917,7 +217415,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) @@ -216932,7 +217430,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 + 15202 } else { v1 = __ccgo_ts + 1695 } @@ -216942,11 +217440,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 + 37571 } else { - v3 = __ccgo_ts + 37469 + v3 = __ccgo_ts + 37576 } - 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+37580, 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 @@ -217004,14 +217502,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+37635, 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+37641, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -217061,7 +217559,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+37669, 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)) @@ -217094,7 +217592,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+37679, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -217128,7 +217626,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+37700, libc.VaList(bp+24, z)) } } } else { @@ -217136,7 +217634,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 + 35427 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -217293,7 +217791,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+37733, 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))) } @@ -217493,7 +217991,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+37738, 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 @@ -217626,10 +218124,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. @@ -220165,12 +220663,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+39087, 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+39191, 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+39229, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -220179,7 +220677,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+39267, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -220191,14 +220689,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+26086, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12037, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38421, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36220, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36327, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35525, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35632, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -220218,13 +220716,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 + 30726 } 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+39309, 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+39339, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -220265,7 +220763,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+39383, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -220273,7 +220771,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+39406, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -220288,7 +220786,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+39412, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -220297,22 +220795,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+35632, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39311 + zCols = __ccgo_ts + 39418 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39343 + zCols = __ccgo_ts + 39450 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36220, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36327, 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+38421, __ccgo_ts+39498, 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+36509, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -220732,12 +221230,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+39515, 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+39565, 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+39594, 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. */ @@ -220745,7 +221243,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+36509, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -221047,7 +221545,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+39623, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -221177,7 +221675,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) } @@ -221279,14 +221777,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+35632, 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 @@ -221938,11 +222436,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 + 39677 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) } @@ -221952,7 +222450,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+39686) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -221969,20 +222467,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+39697) { 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+39655) { 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+39666) { 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+39686) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -222274,7 +222772,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 + 39715 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -222491,64 +222989,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+39725, 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+39728, 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+39733, 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+39738, 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+39741, 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+39744, 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+39749, 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+39754, 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+39758, 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+39764, 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+39769, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222557,49 +223055,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+39773, 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+39777, 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+39780, 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+39784, 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+39788, 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+39792, 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+39796, 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+39800, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222616,20 +223114,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+39804, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39784, 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+39807, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39810, 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+39814, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39800, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -222645,75 +223143,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+39817, 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+39784, 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+39825, 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+39832, 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+39837, 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+39733, 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+39842, 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+39728, 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+39847, 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+39800, 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+39852, 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+16152, 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+39857, 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+39810, 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+39861, 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+39725, 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+39866, 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+39769, 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+39872, 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+39876, 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+39878, 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+39792, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -222722,48 +223220,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+39884, 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+39800, 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+39892, 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+39784, 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+39898, 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+39784, 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+39903, 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+39725, 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+39909, 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+39796, 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+39917, 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+39925, 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+39929, 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+39792, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222771,21 +223269,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+39937, 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+39725, 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+39943, 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+39796, 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+39949, 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+39810, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222803,48 +223301,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+39956, 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+39741, 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+39961, 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+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+39634, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39741, 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+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+39634, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39741, 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+39925, 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+39978, 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+39984, 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+39725, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222860,13 +223358,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+39990, 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+39994, 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+39997, 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) @@ -222874,7 +223372,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+40000, 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) @@ -223039,14 +223537,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+40004) { 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+39697) { 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 { @@ -223314,7 +223812,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+40019)) } // C documentation @@ -223340,7 +223838,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39608, + FzName: __ccgo_ts + 39715, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -223348,7 +223846,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39920, + FzName: __ccgo_ts + 40027, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -223356,7 +223854,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39912, + FzName: __ccgo_ts + 40019, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -223386,7 +223884,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+40033, pApi, bp+96, uintptr(0)) } return rc } @@ -228902,16 +229400,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+40040) == 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+40044) == 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+40048) == 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+40057, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228974,21 +229472,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 + 40091, + 1: __ccgo_ts + 40131, + 2: __ccgo_ts + 40166, } 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+24079, *(*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+40209, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -229009,23 +229508,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) } @@ -229158,10 +229657,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+40242, 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+40273, 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)) } @@ -229180,7 +229679,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+40324, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -229630,7 +230129,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+40350, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -229685,7 +230184,7 @@ 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 + 40360 } type TAggInfo_col = struct { @@ -229915,7 +230414,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 @@ -229963,11 +230462,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]int8{'3', '.', '4', '9', '.', '1'} +var Xsqlite3_version = [7]int8{'3', '.', '5', '0', '.', '1'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -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)\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods @@ -229977,3 +230476,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_ppc64le.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_ppc64le.go index ebfb016..f5382a1 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_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 @@ -1558,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 @@ -1797,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 @@ -2007,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 @@ -2169,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 @@ -2177,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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70" +const SQLITE_SOURCE_ID = "2025-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2288,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.1" -const SQLITE_VERSION_NUMBER = 3049001 +const SQLITE_VERSION = "3.50.1" +const SQLITE_VERSION_NUMBER = 3050001 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3501,6 +3507,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 @@ -3510,9 +3519,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 @@ -4412,6 +4418,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. @@ -4768,6 +4780,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 @@ -5200,7 +5213,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -6941,11 +6953,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. */ /* @@ -7319,6 +7337,7 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem @@ -7364,6 +7383,7 @@ type THashElem1 = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem1 = THashElem1 @@ -7514,6 +7534,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. */ @@ -7572,6 +7597,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 @@ -7875,7 +7911,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData = TDbClientData @@ -7945,9 +7980,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 @@ -7962,7 +7997,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -8011,8 +8045,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 @@ -8076,7 +8110,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -8148,19 +8181,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 @@ -8174,11 +8210,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 @@ -8189,40 +8222,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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -8240,7 +8274,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -8252,6 +8286,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -8402,9 +8437,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 @@ -8459,6 +8494,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8639,7 +8675,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8681,7 +8716,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -9251,8 +9285,8 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. +/* Use SQLITE_ENABLE_EXPLAIN_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 @@ -10099,6 +10133,7 @@ type TTable1 = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table1 = TTable1 @@ -10180,11 +10215,13 @@ type TFKey1 = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey1 = TFKey1 +/* The size (in bytes) of an FKey object holding N columns. The answer +** does NOT include space to hold the zTo name. */ + /* ** SQLite supports many different ways to resolve a constraint ** error. ROLLBACK processing means that a constraint violation @@ -10233,11 +10270,12 @@ type TKeyInfo1 = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo1 = TKeyInfo1 +/* The size (in bytes) of a KeyInfo object with up to N fields */ + /* ** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. */ @@ -10639,13 +10677,16 @@ type Expr1 = TExpr1 ** expression. */ type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList1 = TExprList1 +/* The size (in bytes) of an ExprList object that is big enough to hold +** as many as N expressions. */ + /* ** Allowed values for Expr.a.eEName */ @@ -10666,12 +10707,14 @@ type ExprList1 = TExprList1 ** 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 + F__ccgo_align [0]uint64 + FnId int32 } type IdList1 = TIdList1 +/* The size (in bytes) of an IdList object that can hold up to N IDs. */ + /* ** Allowed values for IdList.eType, which determines which value of the a.u4 ** is valid. @@ -10777,13 +10820,19 @@ type OnOrUsing1 = TOnOrUsing1 ** */ type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList1 = TSrcList1 +/* Size (in bytes) of a SrcList object that can hold as many as N +** SrcItem objects. */ + +/* Size (in bytes( of a SrcList object that holds 1 SrcItem. This is a +** special case of SZ_SRCITEM(1) that comes up often. */ + /* ** Permitted values of the SrcList.a.jointype field */ @@ -11144,19 +11193,22 @@ type TParse1 = 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 @@ -11170,11 +11222,8 @@ type TParse1 = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -11185,40 +11234,41 @@ type TParse1 = 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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -11584,11 +11634,13 @@ type TWith1 = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With1 = TWith1 +/* The size (in bytes) of a With object that can hold as many +** as N different CTEs. */ + /* ** The Cte object is not guaranteed to persist for the entire duration ** of code generation. (The query flattener or other parser tree @@ -11618,11 +11670,13 @@ type TDbClientData1 = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData1 = TDbClientData1 +/* The size (in bytes) of a DbClientData object that can has a name +** that is N bytes long, including the zero-terminator. */ + /* ** This object is used in various ways, most (but not all) related to window ** functions. @@ -12788,7 +12842,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12866,7 +12919,6 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor @@ -12904,11 +12956,16 @@ type TVdbeCursor1 = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor1 = TVdbeCursor1 +/* +** The size (in bytes) of a VdbeCursor object that has an nField value of N +** or less. The value of SZ_VDBECURSOR(n) is guaranteed to be a multiple +** of 8. + */ + /* Return true if P is a null-only cursor */ @@ -13119,21 +13176,14 @@ type Tsqlite3_context1 = struct { 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 */ +/* +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. + */ // C documentation // @@ -13266,7 +13316,7 @@ type TPreUpdate1 = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -13278,6 +13328,7 @@ type TPreUpdate1 = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate1 = TPreUpdate1 @@ -13415,7 +13466,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(24453)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13587,7 +13638,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)) @@ -13974,7 +14025,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++ } @@ -14045,10 +14096,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) @@ -14184,7 +14235,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) } } @@ -14281,7 +14332,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) @@ -14422,10 +14473,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+1221, -int32(1)) @@ -14436,7 +14487,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) @@ -14514,7 +14565,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) @@ -14662,7 +14713,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)) @@ -14965,7 +15016,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 } @@ -15122,7 +15173,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('.') @@ -15170,7 +15221,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('.') @@ -15275,7 +15326,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) @@ -16004,7 +16055,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 } @@ -16653,7 +16704,8 @@ func init() { // /* // ** Initialize the mutex system. // */ -func _sqlite3MutexInit(tls *libc.TLS) (r int32) { +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 @@ -18281,17 +18333,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'), @@ -18488,22 +18540,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. */ @@ -18752,11 +18805,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 @@ -18784,7 +18837,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)) @@ -18806,7 +18859,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)) @@ -19233,29 +19286,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) @@ -19370,25 +19401,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 + 1677 + if escarg == uintptr(0) { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1677 } else { - v98 = __ccgo_ts + 1682 + v97 = __ccgo_ts + 1682 } - 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. @@ -19396,15 +19431,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) { @@ -19415,13 +19450,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) @@ -19435,35 +19503,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+1689, 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 - } - 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 + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + 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 + 1698 + uintptr(libc.Int32FromUint8(ch1)&int32(0xf)))) + } + } + } + goto _105 + _105: + ; + i1++ + } + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 + j1++ + 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) @@ -19488,9 +19619,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: ; @@ -19504,7 +19635,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+1689, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1715, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -19514,21 +19645,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+1691, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1717, 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+1701, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1727, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1722, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1748, 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: ; @@ -19767,7 +19898,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 @@ -20066,6 +20197,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 // // /* @@ -20083,11 +20216,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)) } @@ -20739,6 +20872,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 // // /* @@ -21489,7 +21653,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 { @@ -21664,7 +21828,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+1736, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1762, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -21876,11 +22040,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 @@ -22116,7 +22280,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)) @@ -22206,7 +22370,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1761 + pow63 = __ccgo_ts + 1787 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -22433,7 +22597,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+1780)) + n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1806)) if *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -22593,7 +22757,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 + 1796 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1822 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') @@ -22702,7 +22866,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-- } } @@ -23118,7 +23282,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+1798, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1824, libc.VaList(bp+8, zType)) } // C documentation @@ -23147,7 +23311,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+1843) + _logBadConnection(tls, __ccgo_ts+1869) } return 0 } else { @@ -23161,7 +23325,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+1852) + _logBadConnection(tls, __ccgo_ts+1878) return 0 } else { return int32(1) @@ -23192,7 +23356,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) { @@ -23543,23 +23707,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 @@ -23614,8 +23776,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)) } @@ -23648,9 +23810,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: ; @@ -23670,13 +23831,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 } @@ -23684,7 +23844,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 @@ -23700,7 +23860,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 { @@ -23712,7 +23872,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 } @@ -23761,7 +23921,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 @@ -23771,20 +23931,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) } @@ -23803,196 +23962,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1860, - 1: __ccgo_ts + 1870, - 2: __ccgo_ts + 1881, - 3: __ccgo_ts + 1893, - 4: __ccgo_ts + 1904, - 5: __ccgo_ts + 1916, - 6: __ccgo_ts + 1923, - 7: __ccgo_ts + 1931, - 8: __ccgo_ts + 1939, - 9: __ccgo_ts + 1944, - 10: __ccgo_ts + 1949, - 11: __ccgo_ts + 1955, - 12: __ccgo_ts + 1969, - 13: __ccgo_ts + 1975, - 14: __ccgo_ts + 1985, - 15: __ccgo_ts + 1990, - 16: __ccgo_ts + 1995, - 17: __ccgo_ts + 1998, - 18: __ccgo_ts + 2004, - 19: __ccgo_ts + 2011, - 20: __ccgo_ts + 2015, - 21: __ccgo_ts + 2025, - 22: __ccgo_ts + 2032, - 23: __ccgo_ts + 2039, - 24: __ccgo_ts + 2046, - 25: __ccgo_ts + 2053, - 26: __ccgo_ts + 2063, - 27: __ccgo_ts + 2072, - 28: __ccgo_ts + 2083, - 29: __ccgo_ts + 2092, - 30: __ccgo_ts + 2098, - 31: __ccgo_ts + 2108, - 32: __ccgo_ts + 2118, - 33: __ccgo_ts + 2123, - 34: __ccgo_ts + 2137, - 35: __ccgo_ts + 2148, - 36: __ccgo_ts + 2153, - 37: __ccgo_ts + 2160, - 38: __ccgo_ts + 2171, - 39: __ccgo_ts + 2176, - 40: __ccgo_ts + 2181, - 41: __ccgo_ts + 2187, - 42: __ccgo_ts + 2193, - 43: __ccgo_ts + 2199, - 44: __ccgo_ts + 2202, - 45: __ccgo_ts + 2206, - 46: __ccgo_ts + 2212, - 47: __ccgo_ts + 2223, - 48: __ccgo_ts + 2234, - 49: __ccgo_ts + 2242, - 50: __ccgo_ts + 2251, - 51: __ccgo_ts + 2257, - 52: __ccgo_ts + 2264, - 53: __ccgo_ts + 2272, - 54: __ccgo_ts + 2275, - 55: __ccgo_ts + 2278, - 56: __ccgo_ts + 2281, - 57: __ccgo_ts + 2284, - 58: __ccgo_ts + 2287, - 59: __ccgo_ts + 2290, - 60: __ccgo_ts + 2297, - 61: __ccgo_ts + 2307, - 62: __ccgo_ts + 2320, - 63: __ccgo_ts + 2331, - 64: __ccgo_ts + 2337, - 65: __ccgo_ts + 2344, - 66: __ccgo_ts + 2353, - 67: __ccgo_ts + 2362, - 68: __ccgo_ts + 2369, - 69: __ccgo_ts + 2382, - 70: __ccgo_ts + 2393, - 71: __ccgo_ts + 2398, - 72: __ccgo_ts + 2406, - 73: __ccgo_ts + 2412, - 74: __ccgo_ts + 2419, - 75: __ccgo_ts + 2431, - 76: __ccgo_ts + 2436, - 77: __ccgo_ts + 2445, - 78: __ccgo_ts + 2450, - 79: __ccgo_ts + 2459, - 80: __ccgo_ts + 2464, - 81: __ccgo_ts + 2469, - 82: __ccgo_ts + 2475, - 83: __ccgo_ts + 2483, - 84: __ccgo_ts + 2491, - 85: __ccgo_ts + 2501, - 86: __ccgo_ts + 2509, - 87: __ccgo_ts + 2516, - 88: __ccgo_ts + 2529, - 89: __ccgo_ts + 2534, - 90: __ccgo_ts + 2546, - 91: __ccgo_ts + 2554, - 92: __ccgo_ts + 2561, - 93: __ccgo_ts + 2572, - 94: __ccgo_ts + 2579, - 95: __ccgo_ts + 2586, - 96: __ccgo_ts + 2596, - 97: __ccgo_ts + 2605, - 98: __ccgo_ts + 2616, - 99: __ccgo_ts + 2622, - 100: __ccgo_ts + 2633, - 101: __ccgo_ts + 2643, - 102: __ccgo_ts + 2653, - 103: __ccgo_ts + 2662, - 104: __ccgo_ts + 2669, - 105: __ccgo_ts + 2675, - 106: __ccgo_ts + 2685, - 107: __ccgo_ts + 2696, - 108: __ccgo_ts + 2700, - 109: __ccgo_ts + 2709, - 110: __ccgo_ts + 2718, - 111: __ccgo_ts + 2725, - 112: __ccgo_ts + 2735, - 113: __ccgo_ts + 2742, - 114: __ccgo_ts + 2752, - 115: __ccgo_ts + 2760, - 116: __ccgo_ts + 2767, - 117: __ccgo_ts + 2781, - 118: __ccgo_ts + 2795, - 119: __ccgo_ts + 2803, - 120: __ccgo_ts + 2814, - 121: __ccgo_ts + 2827, - 122: __ccgo_ts + 2838, - 123: __ccgo_ts + 2844, - 124: __ccgo_ts + 2856, - 125: __ccgo_ts + 2865, - 126: __ccgo_ts + 2873, - 127: __ccgo_ts + 2882, - 128: __ccgo_ts + 2891, - 129: __ccgo_ts + 2898, - 130: __ccgo_ts + 2906, - 131: __ccgo_ts + 2913, - 132: __ccgo_ts + 2924, - 133: __ccgo_ts + 2938, - 134: __ccgo_ts + 2949, - 135: __ccgo_ts + 2957, - 136: __ccgo_ts + 2963, - 137: __ccgo_ts + 2971, - 138: __ccgo_ts + 2979, - 139: __ccgo_ts + 2989, - 140: __ccgo_ts + 3002, - 141: __ccgo_ts + 3012, - 142: __ccgo_ts + 3025, - 143: __ccgo_ts + 3034, - 144: __ccgo_ts + 3045, - 145: __ccgo_ts + 3053, - 146: __ccgo_ts + 3059, - 147: __ccgo_ts + 3071, - 148: __ccgo_ts + 3083, - 149: __ccgo_ts + 3091, - 150: __ccgo_ts + 3103, - 151: __ccgo_ts + 3116, - 152: __ccgo_ts + 3126, - 153: __ccgo_ts + 3136, - 154: __ccgo_ts + 3148, - 155: __ccgo_ts + 3153, - 156: __ccgo_ts + 3165, - 157: __ccgo_ts + 3175, - 158: __ccgo_ts + 3181, - 159: __ccgo_ts + 3191, - 160: __ccgo_ts + 3198, - 161: __ccgo_ts + 3210, - 162: __ccgo_ts + 3221, - 163: __ccgo_ts + 3229, - 164: __ccgo_ts + 3238, - 165: __ccgo_ts + 3247, - 166: __ccgo_ts + 3256, - 167: __ccgo_ts + 3263, - 168: __ccgo_ts + 3274, - 169: __ccgo_ts + 3287, - 170: __ccgo_ts + 3297, - 171: __ccgo_ts + 3304, - 172: __ccgo_ts + 3312, - 173: __ccgo_ts + 3321, - 174: __ccgo_ts + 3327, - 175: __ccgo_ts + 3334, - 176: __ccgo_ts + 3342, - 177: __ccgo_ts + 3350, - 178: __ccgo_ts + 3358, - 179: __ccgo_ts + 3368, - 180: __ccgo_ts + 3377, - 181: __ccgo_ts + 3388, - 182: __ccgo_ts + 3399, - 183: __ccgo_ts + 3410, - 184: __ccgo_ts + 3420, - 185: __ccgo_ts + 3426, - 186: __ccgo_ts + 3437, - 187: __ccgo_ts + 3448, - 188: __ccgo_ts + 3453, - 189: __ccgo_ts + 3461, + 0: __ccgo_ts + 1886, + 1: __ccgo_ts + 1896, + 2: __ccgo_ts + 1907, + 3: __ccgo_ts + 1919, + 4: __ccgo_ts + 1930, + 5: __ccgo_ts + 1942, + 6: __ccgo_ts + 1949, + 7: __ccgo_ts + 1957, + 8: __ccgo_ts + 1965, + 9: __ccgo_ts + 1970, + 10: __ccgo_ts + 1975, + 11: __ccgo_ts + 1981, + 12: __ccgo_ts + 1995, + 13: __ccgo_ts + 2001, + 14: __ccgo_ts + 2011, + 15: __ccgo_ts + 2016, + 16: __ccgo_ts + 2021, + 17: __ccgo_ts + 2024, + 18: __ccgo_ts + 2030, + 19: __ccgo_ts + 2037, + 20: __ccgo_ts + 2041, + 21: __ccgo_ts + 2051, + 22: __ccgo_ts + 2058, + 23: __ccgo_ts + 2065, + 24: __ccgo_ts + 2072, + 25: __ccgo_ts + 2079, + 26: __ccgo_ts + 2089, + 27: __ccgo_ts + 2098, + 28: __ccgo_ts + 2109, + 29: __ccgo_ts + 2118, + 30: __ccgo_ts + 2124, + 31: __ccgo_ts + 2134, + 32: __ccgo_ts + 2144, + 33: __ccgo_ts + 2149, + 34: __ccgo_ts + 2163, + 35: __ccgo_ts + 2174, + 36: __ccgo_ts + 2179, + 37: __ccgo_ts + 2186, + 38: __ccgo_ts + 2197, + 39: __ccgo_ts + 2202, + 40: __ccgo_ts + 2207, + 41: __ccgo_ts + 2213, + 42: __ccgo_ts + 2219, + 43: __ccgo_ts + 2225, + 44: __ccgo_ts + 2228, + 45: __ccgo_ts + 2232, + 46: __ccgo_ts + 2238, + 47: __ccgo_ts + 2249, + 48: __ccgo_ts + 2260, + 49: __ccgo_ts + 2268, + 50: __ccgo_ts + 2277, + 51: __ccgo_ts + 2283, + 52: __ccgo_ts + 2290, + 53: __ccgo_ts + 2298, + 54: __ccgo_ts + 2301, + 55: __ccgo_ts + 2304, + 56: __ccgo_ts + 2307, + 57: __ccgo_ts + 2310, + 58: __ccgo_ts + 2313, + 59: __ccgo_ts + 2316, + 60: __ccgo_ts + 2323, + 61: __ccgo_ts + 2333, + 62: __ccgo_ts + 2346, + 63: __ccgo_ts + 2357, + 64: __ccgo_ts + 2363, + 65: __ccgo_ts + 2370, + 66: __ccgo_ts + 2379, + 67: __ccgo_ts + 2388, + 68: __ccgo_ts + 2395, + 69: __ccgo_ts + 2408, + 70: __ccgo_ts + 2419, + 71: __ccgo_ts + 2424, + 72: __ccgo_ts + 2432, + 73: __ccgo_ts + 2438, + 74: __ccgo_ts + 2445, + 75: __ccgo_ts + 2457, + 76: __ccgo_ts + 2462, + 77: __ccgo_ts + 2471, + 78: __ccgo_ts + 2476, + 79: __ccgo_ts + 2485, + 80: __ccgo_ts + 2490, + 81: __ccgo_ts + 2495, + 82: __ccgo_ts + 2501, + 83: __ccgo_ts + 2509, + 84: __ccgo_ts + 2517, + 85: __ccgo_ts + 2527, + 86: __ccgo_ts + 2535, + 87: __ccgo_ts + 2542, + 88: __ccgo_ts + 2555, + 89: __ccgo_ts + 2560, + 90: __ccgo_ts + 2572, + 91: __ccgo_ts + 2580, + 92: __ccgo_ts + 2587, + 93: __ccgo_ts + 2598, + 94: __ccgo_ts + 2605, + 95: __ccgo_ts + 2612, + 96: __ccgo_ts + 2622, + 97: __ccgo_ts + 2631, + 98: __ccgo_ts + 2642, + 99: __ccgo_ts + 2648, + 100: __ccgo_ts + 2659, + 101: __ccgo_ts + 2669, + 102: __ccgo_ts + 2679, + 103: __ccgo_ts + 2688, + 104: __ccgo_ts + 2695, + 105: __ccgo_ts + 2701, + 106: __ccgo_ts + 2711, + 107: __ccgo_ts + 2722, + 108: __ccgo_ts + 2726, + 109: __ccgo_ts + 2735, + 110: __ccgo_ts + 2744, + 111: __ccgo_ts + 2751, + 112: __ccgo_ts + 2761, + 113: __ccgo_ts + 2768, + 114: __ccgo_ts + 2778, + 115: __ccgo_ts + 2786, + 116: __ccgo_ts + 2793, + 117: __ccgo_ts + 2807, + 118: __ccgo_ts + 2821, + 119: __ccgo_ts + 2829, + 120: __ccgo_ts + 2840, + 121: __ccgo_ts + 2853, + 122: __ccgo_ts + 2864, + 123: __ccgo_ts + 2870, + 124: __ccgo_ts + 2882, + 125: __ccgo_ts + 2891, + 126: __ccgo_ts + 2899, + 127: __ccgo_ts + 2908, + 128: __ccgo_ts + 2917, + 129: __ccgo_ts + 2924, + 130: __ccgo_ts + 2932, + 131: __ccgo_ts + 2939, + 132: __ccgo_ts + 2950, + 133: __ccgo_ts + 2964, + 134: __ccgo_ts + 2975, + 135: __ccgo_ts + 2983, + 136: __ccgo_ts + 2989, + 137: __ccgo_ts + 2997, + 138: __ccgo_ts + 3005, + 139: __ccgo_ts + 3015, + 140: __ccgo_ts + 3028, + 141: __ccgo_ts + 3038, + 142: __ccgo_ts + 3051, + 143: __ccgo_ts + 3060, + 144: __ccgo_ts + 3071, + 145: __ccgo_ts + 3079, + 146: __ccgo_ts + 3085, + 147: __ccgo_ts + 3097, + 148: __ccgo_ts + 3109, + 149: __ccgo_ts + 3117, + 150: __ccgo_ts + 3129, + 151: __ccgo_ts + 3142, + 152: __ccgo_ts + 3152, + 153: __ccgo_ts + 3162, + 154: __ccgo_ts + 3174, + 155: __ccgo_ts + 3179, + 156: __ccgo_ts + 3191, + 157: __ccgo_ts + 3201, + 158: __ccgo_ts + 3207, + 159: __ccgo_ts + 3217, + 160: __ccgo_ts + 3224, + 161: __ccgo_ts + 3236, + 162: __ccgo_ts + 3247, + 163: __ccgo_ts + 3255, + 164: __ccgo_ts + 3264, + 165: __ccgo_ts + 3273, + 166: __ccgo_ts + 3282, + 167: __ccgo_ts + 3289, + 168: __ccgo_ts + 3300, + 169: __ccgo_ts + 3313, + 170: __ccgo_ts + 3323, + 171: __ccgo_ts + 3330, + 172: __ccgo_ts + 3338, + 173: __ccgo_ts + 3347, + 174: __ccgo_ts + 3353, + 175: __ccgo_ts + 3360, + 176: __ccgo_ts + 3368, + 177: __ccgo_ts + 3376, + 178: __ccgo_ts + 3384, + 179: __ccgo_ts + 3394, + 180: __ccgo_ts + 3403, + 181: __ccgo_ts + 3414, + 182: __ccgo_ts + 3425, + 183: __ccgo_ts + 3436, + 184: __ccgo_ts + 3446, + 185: __ccgo_ts + 3452, + 186: __ccgo_ts + 3463, + 187: __ccgo_ts + 3474, + 188: __ccgo_ts + 3479, + 189: __ccgo_ts + 3487, } type Tregister_t = int64 @@ -24527,91 +24686,91 @@ type unix_syscall = Tunix_syscall // */ var _aSyscall = [29]Tunix_syscall{ 0: { - FzName: __ccgo_ts + 3471, + FzName: __ccgo_ts + 3497, }, 1: { - FzName: __ccgo_ts + 3476, + FzName: __ccgo_ts + 3502, }, 2: { - FzName: __ccgo_ts + 3482, + FzName: __ccgo_ts + 3508, }, 3: { - FzName: __ccgo_ts + 3489, + FzName: __ccgo_ts + 3515, }, 4: { - FzName: __ccgo_ts + 3496, + FzName: __ccgo_ts + 3522, }, 5: { - FzName: __ccgo_ts + 3501, + FzName: __ccgo_ts + 3527, }, 6: { - FzName: __ccgo_ts + 3507, + FzName: __ccgo_ts + 3533, }, 7: { - FzName: __ccgo_ts + 3517, + FzName: __ccgo_ts + 3543, }, 8: { - FzName: __ccgo_ts + 3523, + FzName: __ccgo_ts + 3549, }, 9: { - FzName: __ccgo_ts + 3528, + FzName: __ccgo_ts + 3554, }, 10: { - FzName: __ccgo_ts + 3534, + FzName: __ccgo_ts + 3560, }, 11: { - FzName: __ccgo_ts + 3542, + FzName: __ccgo_ts + 3568, }, 12: { - FzName: __ccgo_ts + 3548, + FzName: __ccgo_ts + 3574, }, 13: { - FzName: __ccgo_ts + 3555, - }, - 14: { - FzName: __ccgo_ts + 3564, - }, - 15: { - FzName: __ccgo_ts + 3571, - }, - 16: { FzName: __ccgo_ts + 3581, }, + 14: { + FzName: __ccgo_ts + 3590, + }, + 15: { + FzName: __ccgo_ts + 3597, + }, + 16: { + FzName: __ccgo_ts + 3607, + }, 17: { - FzName: __ccgo_ts + 3588, - }, - 18: { - FzName: __ccgo_ts + 3602, - }, - 19: { - FzName: __ccgo_ts + 3608, - }, - 20: { FzName: __ccgo_ts + 3614, }, - 21: { - FzName: __ccgo_ts + 3621, + 18: { + FzName: __ccgo_ts + 3628, }, - 22: { - FzName: __ccgo_ts + 3629, - }, - 23: { + 19: { FzName: __ccgo_ts + 3634, }, - 24: { - FzName: __ccgo_ts + 3641, + 20: { + FzName: __ccgo_ts + 3640, }, - 25: { - FzName: __ccgo_ts + 3648, + 21: { + FzName: __ccgo_ts + 3647, }, - 26: { + 22: { + FzName: __ccgo_ts + 3655, + }, + 23: { FzName: __ccgo_ts + 3660, }, + 24: { + FzName: __ccgo_ts + 3667, + }, + 25: { + FzName: __ccgo_ts + 3674, + }, + 26: { + FzName: __ccgo_ts + 3686, + }, 27: { - FzName: __ccgo_ts + 3669, + FzName: __ccgo_ts + 3695, }, 28: { - FzName: __ccgo_ts + 3675, + FzName: __ccgo_ts + 3701, }, } @@ -24850,9 +25009,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+3681, libc.VaList(bp+152, z, fd)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3707, 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+3724, O_RDONLY, libc.Int32FromUint32(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3750, O_RDONLY, libc.Int32FromUint32(m)) < 0 { break } } @@ -25172,7 +25331,7 @@ func _unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uint if zPath == uintptr(0) { zPath = __ccgo_ts + 1676 } - Xsqlite3_log(tls, errcode, __ccgo_ts+3734, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) + Xsqlite3_log(tls, errcode, __ccgo_ts+3760, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) return errcode } @@ -25200,7 +25359,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+3818, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3844, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if _fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3845, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3871, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -25859,7 +26018,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(40995)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -26464,7 +26623,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+3873, libc.VaList(bp+528, zFilename)) + Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3899, 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('/')) { @@ -26490,7 +26649,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+3588, bp, int32(42324)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42576)), __ccgo_ts+3614, bp, int32(42576)) } // C documentation @@ -26527,7 +26686,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)<= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43393)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -27138,7 +27297,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)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44803)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -28139,10 +28297,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 + 3930, - 3: __ccgo_ts + 3939, - 4: __ccgo_ts + 3948, - 5: __ccgo_ts + 1689, + 2: __ccgo_ts + 3956, + 3: __ccgo_ts + 3965, + 4: __ccgo_ts + 3974, + 5: __ccgo_ts + 1715, } // C documentation @@ -28151,8 +28309,8 @@ var _azTempDirs = [6]uintptr{ // ** Initialize first two members of azTempDirs[] array. // */ func _unixTempFileInit(tls *libc.TLS) { - _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3953) - _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3967) + _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3979) + _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3993) } // C documentation @@ -28214,7 +28372,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+3974, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+4000, 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++ @@ -28386,7 +28544,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+3991) + z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4017) if z != 0 { rc = _getFileMode(tls, z, pMode, pUid, pGid) } @@ -28541,7 +28699,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+3471, zName, int32(44994)) + rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45251)), __ccgo_ts+3497, zName, int32(45251)) if rc == SQLITE_OK { rc = rc2 } @@ -28618,7 +28776,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(45502)) 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+3660, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45507)), __ccgo_ts+3686, zIn, int32(45507)) return } (*(*[4098]uint8)(unsafe.Pointer(bp + 144)))[got] = uint8(0) @@ -28816,14 +28974,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+3489, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45565)), __ccgo_ts+3515, zPath, int32(45565)) } _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(45571)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<>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) } } @@ -32142,7 +32300,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) - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 0) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -32236,7 +32394,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-- - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 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)) } @@ -32277,7 +32435,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 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 @@ -32405,7 +32563,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 libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g)) + 140) + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -32425,17 +32583,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) } @@ -32453,7 +32613,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 @@ -32465,7 +32625,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) } } @@ -32666,10 +32826,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 @@ -34814,7 +34975,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 @@ -34832,7 +34993,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 } @@ -35405,6 +35566,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 { @@ -36051,7 +36221,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 @@ -36063,7 +36234,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) @@ -36084,11 +36255,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 @@ -36117,7 +36289,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 @@ -36350,7 +36522,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) } @@ -36487,7 +36659,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)) @@ -36503,7 +36675,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)< int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65269)) } 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)) @@ -40610,7 +40782,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+4187, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4213, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -41174,9 +41346,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 @@ -41380,6 +41552,11 @@ type WalCkptInfo1 = TWalCkptInfo1 /* ** An open write-ahead log file is represented by an instance of the ** following object. +** +** writeLock: +** This is usually set to 1 whenever the WRITER lock is held. However, +** if it is set to 2, then the WRITER lock is held but must be released +** by walHandleException() if a SEH exception is thrown. */ type TWal1 = struct { FpVfs uintptr @@ -41446,13 +41623,15 @@ type ht_slot = Tht_slot ** This functionality is used by the checkpoint code (see walCheckpoint()). */ type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } 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 ** is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -41510,7 +41689,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) @@ -41522,7 +41701,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) } @@ -41611,6 +41790,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 @@ -42052,7 +42232,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(67209)) } goto _1 _1: @@ -42140,12 +42320,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(67341)) 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 @@ -42279,7 +42459,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 { @@ -42910,7 +43090,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(68150)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -43026,7 +43206,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+4242, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+4268, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -43241,7 +43421,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 { @@ -43267,7 +43454,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(68601)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43990,8 +44177,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)) } @@ -44078,7 +44265,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(69451)) } iKey = _walNextHash(tls, iKey) } @@ -44575,7 +44762,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(69974)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44824,7 +45011,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, /* 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(70234)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -45596,6 +45783,11 @@ type CellInfo1 = TCellInfo1 ** assumed that the database is corrupt. */ +/* +** Maximum amount of storage local to a database page, regardless of +** page size. + */ + /* ** A cursor is a pointer to a particular entry within a particular ** b-tree within a database file. @@ -45962,10 +46154,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) { @@ -45974,14 +46167,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) { @@ -46681,7 +46874,7 @@ 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(72422)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } @@ -46859,7 +47052,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(72620)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46872,12 +47065,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(72633)) 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(72638)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46921,7 +47114,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(72683)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46929,7 +47122,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(72691)) } return SQLITE_OK } @@ -47117,7 +47310,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) } @@ -47150,7 +47343,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) } @@ -47349,7 +47542,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(73136)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -47389,12 +47582,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(73194)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73197)) } 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)) @@ -47402,21 +47595,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(73205)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73208)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73210)) } 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(73214)) } } cbrk = top + sz @@ -47463,12 +47656,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(73247)) } 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(73253)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -47484,7 +47677,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(73267)) } *(*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) @@ -47544,7 +47737,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(73324)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -47561,14 +47754,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(73339)) } 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(73346)) } return uintptr(0) } @@ -47611,11 +47804,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(73394)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73397)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -47629,7 +47822,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(73414)) } else { return SQLITE_OK } @@ -47682,42 +47875,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(73498)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47725,70 +47916,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(73510)) } - 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(73513)) } - 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(73526)) } - 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(73532)) } 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) + *(*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)) += libc.Int32FromUint16(iOrigSize) + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47834,7 +48025,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(73602)) } } } else { @@ -47860,7 +48051,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(73626)) } } } @@ -47899,12 +48090,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(73677)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73682)) } 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(73692)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73696)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47931,7 +48122,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(73708)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47962,11 +48153,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(73739)) } 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(73744)) } goto _1 _1: @@ -47995,11 +48186,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(73776)) } (*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) @@ -48008,7 +48199,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(73790)) } /* 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 @@ -48030,30 +48221,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) @@ -48161,7 +48350,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(73933)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -48223,7 +48412,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(74005)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -48311,7 +48500,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+4268) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4294) == 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 */ @@ -48935,7 +49124,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) @@ -49097,7 +49286,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+4277, uint64(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4303, uint64(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -49135,7 +49324,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(74943)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -49576,7 +49765,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(75398)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -49600,7 +49789,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(75417)) } 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) @@ -49609,7 +49798,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(75426)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -49623,7 +49812,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(75438)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -49653,7 +49842,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(75473)) } /* 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) @@ -49749,7 +49938,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(75571)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49787,7 +49976,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(75623)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -49854,7 +50043,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(75691)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49897,7 +50086,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(75742)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49927,7 +50116,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(75769)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -50393,7 +50582,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(76233)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50785,7 +50974,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(76657)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50795,7 +50984,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(76672)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50826,7 +51015,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) @@ -50852,7 +51041,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(76743)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50926,7 +51115,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(76827)) } return rc } @@ -51061,7 +51250,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(76965)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -51073,7 +51262,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(76979)) } if rc != 0 { v3 = pCur + 84 @@ -51189,7 +51378,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(77114)) } goto skip_init skip_init: @@ -51203,7 +51392,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(77126)) } 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) @@ -51437,7 +51626,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(77375)) } } } @@ -51641,7 +51830,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes p3 = pCur + 1 *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(BTCF_ValidOvfl) | libc.Int32FromInt32(BTCF_AtLast))) if !((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76795)) + return _sqlite3CorruptError(tls, int32(77571)) } goto bypass_moveto_root /* Start search on the current page */ } @@ -51704,10 +51893,10 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ if nCell < int32(2) || libc.Uint32FromInt32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77658)) 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 @@ -51735,7 +51924,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(77690)) } goto moveto_index_finish } @@ -51768,7 +51957,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(77721)) } *(*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 @@ -51777,7 +51966,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(77732)) } if rc != 0 { v11 = pCur + 84 @@ -51906,7 +52095,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(77833)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -52016,7 +52205,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(77926)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -52104,7 +52293,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(78016)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -52159,7 +52348,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(78072)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -52185,7 +52374,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(78101)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52212,7 +52401,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(78135)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -52283,7 +52472,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(78200)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52421,7 +52610,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(78327)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -52472,7 +52661,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(78374)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -52481,7 +52670,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(78385)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -52571,7 +52760,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(78474)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -52589,7 +52778,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(78491)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -52612,7 +52801,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(78511)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -52833,10 +53022,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(78767)) 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 @@ -53227,12 +53416,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(79157)) } 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(79162)) } } pData -= uintptr(sz) @@ -53240,7 +53429,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(79168)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -53335,7 +53524,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(79255)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -53416,7 +53605,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: ; @@ -53443,7 +53632,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: ; @@ -53483,7 +53672,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(79377)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2))) nCell -= nShift @@ -53554,7 +53743,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(79455)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -53599,7 +53788,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(79495)) } /* 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 @@ -53795,10 +53984,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 @@ -53921,8 +54111,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 @@ -53962,7 +54152,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(79919)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53985,7 +54175,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(79943)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -54116,7 +54306,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(80044)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -54159,7 +54349,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(80077)) goto balance_cleanup } } @@ -54218,7 +54408,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(80121)) goto balance_cleanup } goto _11 @@ -54250,7 +54440,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(80154)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -54480,7 +54670,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(80355)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54726,7 +54916,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(80587)) } goto _1 _1: @@ -54799,7 +54989,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(80647)) } 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))) @@ -54958,7 +55148,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(80811)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54989,7 +55179,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(80839)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -55074,7 +55264,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(80920)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -55166,7 +55356,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(81043)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -55202,7 +55392,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(81085)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55232,10 +55422,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(81112)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81115)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -55353,12 +55543,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(81217)) } 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 @@ -55368,14 +55558,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(81242)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -55475,21 +55665,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(81338)) } } 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(81347)) } 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(81351)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81354)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -55583,7 +55773,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(81445)) } 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 @@ -55693,7 +55883,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(81561)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55734,7 +55924,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(81609)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55815,14 +56005,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(81699)) } *(*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(81706)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55959,7 +56149,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(81810)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -56224,7 +56414,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+4281, int32(1)) + Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4307, 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)) @@ -56272,11 +56462,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+4283, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4309, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4306, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4332, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -56302,11 +56492,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+4436, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4462, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -56378,11 +56568,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 + 4475 + v2 = __ccgo_ts + 4501 } else { - v2 = __ccgo_ts + 4480 + v2 = __ccgo_ts + 4506 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+4501, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4527, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -56518,12 +56708,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 + 4527 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4553 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4545, libc.VaList(bp+56, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4571, libc.VaList(bp+56, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4699, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4725, 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+4729, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4755, 0) doCoverageCheck = 0 goto _4 } @@ -56608,7 +56798,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+4753, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4779, 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 */ @@ -56631,7 +56821,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+4777, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4803, 0) depth = d2 } } else { @@ -56708,7 +56898,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+4802, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4828, 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))) @@ -56722,7 +56912,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+4839, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4865, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -56813,7 +57003,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 + 4891 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4917 _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) } @@ -56837,11 +57027,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+4902, libc.VaList(bp+248, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+4928, 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+4947, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+4973, 0) } } } @@ -56878,10 +57068,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+5002, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5028, 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+5022, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5048, libc.VaList(bp+248, i)) } goto _3 _3: @@ -57320,7 +57510,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+3873, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3899, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -57330,7 +57520,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+5054, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5080, libc.VaList(bp+432, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*32))).FpBt @@ -57359,7 +57549,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+5074, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5100, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -57389,7 +57579,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+5105, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5131, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -58067,7 +58257,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+5145, libc.VaList(bp+48, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5171, 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) } @@ -58205,9 +58395,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) @@ -58382,20 +58569,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 } @@ -58410,10 +58597,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 @@ -59167,7 +59354,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(85108)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -59331,7 +59518,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 { @@ -59339,8 +59527,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 { @@ -59397,14 +59585,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 */ @@ -59418,7 +59606,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 @@ -59443,14 +59631,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+3873, libc.VaList(bp+64, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3899, libc.VaList(bp+56, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc)) @@ -59550,7 +59738,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 + 5152 + zNeg = __ccgo_ts + 5178 } } } @@ -59565,7 +59753,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+5154, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5180, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -59869,7 +60057,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(85794)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59885,7 +60073,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(85800)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59895,7 +60083,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(85806)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -60356,12 +60544,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 @@ -60535,7 +60722,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 @@ -60552,7 +60739,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 { @@ -60620,8 +60807,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. @@ -60634,11 +60821,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 */ @@ -60675,13 +60862,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 @@ -60712,7 +60902,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 @@ -61214,7 +61404,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+5159, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5185, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -61227,39 +61417,39 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { v2 = __ccgo_ts + 1676 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+5164) == 0 { - zColl = __ccgo_ts + 5171 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+5190) == 0 { + zColl = __ccgo_ts + 5197 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 5152 + v3 = __ccgo_ts + 5178 } else { v3 = __ccgo_ts + 1676 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 5173 + v4 = __ccgo_ts + 5199 } else { v4 = __ccgo_ts + 1676 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5176, libc.VaList(bp+40, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5202, libc.VaList(bp+40, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5184, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5210, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5200, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, 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+5209, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5235, 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+5209, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5235, 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+1437, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5216, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5242, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) case -int32(12): Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1404, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): @@ -61276,14 +61466,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 + 1677 } else { - zP4 = __ccgo_ts + 5219 + zP4 = __ccgo_ts + 5245 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, libc.VaList(bp+40, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5252, 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 @@ -61298,20 +61488,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5234, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5260, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5239, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5265, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 5241 + zP4 = __ccgo_ts + 5267 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+5249, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5275, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -61325,10 +61515,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 5186, - 1: __ccgo_ts + 5188, - 2: __ccgo_ts + 5190, - 3: __ccgo_ts + 5195, + 0: __ccgo_ts + 5212, + 1: __ccgo_ts + 5214, + 2: __ccgo_ts + 5216, + 3: __ccgo_ts + 5221, } // C documentation @@ -62125,7 +62315,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 } @@ -62279,7 +62469,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+5265, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5291, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -62287,18 +62477,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+5277, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5303, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5291, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5317, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+12) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5306, 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+5332, 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) @@ -62529,7 +62719,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(90646))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63917,7 +64107,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(90727))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -63952,7 +64142,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(90757))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -64006,7 +64196,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(90808))) return 0 /* Corrupt index */ } } @@ -64138,7 +64328,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(90971))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -64290,7 +64480,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(91129)) } // C documentation @@ -64321,7 +64511,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(91162)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -64472,15 +64662,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 + 5349 + zContext = __ccgo_ts + 5375 } else { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 5368 + zContext = __ccgo_ts + 5394 } else { - zContext = __ccgo_ts + 5387 + zContext = __ccgo_ts + 5413 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5396, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5422, 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 @@ -64575,10 +64765,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 @@ -64587,9 +64778,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 { @@ -64669,7 +64860,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+5432, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5458, 0) return int32(1) } else { return 0 @@ -64679,7 +64870,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+5477, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5503, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -64737,7 +64928,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(91560)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -65240,7 +65431,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+5517, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5543, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -65441,7 +65632,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(92354)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -65571,7 +65762,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(92475)) } 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) @@ -66031,18 +66222,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 + 5540, - 1: __ccgo_ts + 5545, - 2: __ccgo_ts + 5552, - 3: __ccgo_ts + 5555, - 4: __ccgo_ts + 5558, - 5: __ccgo_ts + 5561, - 6: __ccgo_ts + 5564, - 7: __ccgo_ts + 5567, - 8: __ccgo_ts + 5575, - 9: __ccgo_ts + 5578, - 10: __ccgo_ts + 5585, - 11: __ccgo_ts + 5593, + 0: __ccgo_ts + 5566, + 1: __ccgo_ts + 5571, + 2: __ccgo_ts + 5578, + 3: __ccgo_ts + 5581, + 4: __ccgo_ts + 5584, + 5: __ccgo_ts + 5587, + 6: __ccgo_ts + 5590, + 7: __ccgo_ts + 5593, + 8: __ccgo_ts + 5601, + 9: __ccgo_ts + 5604, + 10: __ccgo_ts + 5611, + 11: __ccgo_ts + 5619, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -66297,14 +66488,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(93091)) } 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(93095))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5600, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92307)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5626, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(93099)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -66455,7 +66646,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, 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) } @@ -66878,11 +67069,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(93642)) 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))) } @@ -66891,7 +67082,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) @@ -66905,7 +67096,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) } @@ -66940,7 +67131,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(93701)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66975,7 +67166,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 } @@ -67041,11 +67232,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(93797)) 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))) } @@ -67068,7 +67259,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 @@ -67090,7 +67281,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 @@ -67217,7 +67408,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5640, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5666, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(int64(zRawSql)-int64(zStart))) } } else { @@ -67255,7 +67446,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1437, 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+5145, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5171, 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 @@ -67270,28 +67461,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+5644, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5670, 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+5651, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5677, 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+5664, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5690, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5667, 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+5693, 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+5672, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5698, int32(1)) } } } @@ -67455,9 +67646,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 { @@ -67483,12 +67674,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) @@ -67497,28 +67686,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 @@ -67909,12 +68098,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 @@ -67931,7 +68120,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 @@ -67949,7 +68138,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 @@ -68663,19 +68852,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+3873, libc.VaList(bp+944, zErr)) + _sqlite3VdbeError(tls, p, __ccgo_ts+3899, libc.VaList(bp+936, zErr)) } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+5708, libc.VaList(bp+944, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+5734, 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+5729, libc.VaList(bp+944, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5755, libc.VaList(bp+936, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+3873, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3899, 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+5736, 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+5762, libc.VaList(bp+936, pcx, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, (*TVdbe)(unsafe.Pointer(p)).FzSql)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -69889,7 +70078,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 @@ -69905,6 +70094,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 */ @@ -70398,7 +70593,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(97561)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -70501,7 +70696,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+5760, 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+5784, 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+5874, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5898, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -71097,7 +71292,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+5928, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5952, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -71127,12 +71322,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 5983 + v250 = __ccgo_ts + 6007 } else { if iRollback != 0 { - v251 = __ccgo_ts + 6031 + v251 = __ccgo_ts + 6055 } else { - v251 = __ccgo_ts + 6074 + v251 = __ccgo_ts + 6098 } v250 = v251 } @@ -71224,7 +71419,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+6115) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6139) /* 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. @@ -72335,7 +72530,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(99822)) } else { goto jump_to_p2 } @@ -72794,7 +72989,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(). @@ -73227,7 +73422,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(101119)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -73557,7 +73752,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+3873, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(bp + 632)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3899, 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 @@ -73588,13 +73783,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 + 6160 + zSchema = __ccgo_ts + 6184 (*(*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+6174, 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+6198, 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 { @@ -73609,7 +73804,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(101412)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73846,7 +74041,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+6217, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6241, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -73863,15 +74058,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 @@ -73952,11 +74147,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) } @@ -74168,7 +74363,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 @@ -74218,7 +74413,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+3873, libc.VaList(bp+944, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3899, 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 { @@ -74274,7 +74469,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+3873, libc.VaList(bp+944, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3899, libc.VaList(bp+936, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, libc.Int32FromUint8(encoding)) @@ -74353,11 +74548,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 + 6254 + v286 = __ccgo_ts + 6278 } else { - v286 = __ccgo_ts + 6259 + v286 = __ccgo_ts + 6283 } - _sqlite3VdbeError(tls, p, __ccgo_ts+6266, libc.VaList(bp+944, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6290, libc.VaList(bp+936, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -74510,7 +74705,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+6318, libc.VaList(bp+944, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6342, libc.VaList(bp+936, z1)) } goto abort_due_to_error } @@ -74672,7 +74867,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+6347, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6371, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -74752,12 +74947,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)) @@ -74768,7 +74963,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+3873, libc.VaList(bp+944, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3899, libc.VaList(bp+936, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, libc.Int32FromUint8(encoding)) @@ -74862,7 +75057,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 } @@ -74890,11 +75085,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) { @@ -75022,7 +75217,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+3873, libc.VaList(bp+944, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3899, 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) @@ -75173,7 +75368,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+6357, libc.VaList(bp+944, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6381, 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 { @@ -75260,15 +75455,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) @@ -75734,11 +75921,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 3873 + v8 = __ccgo_ts + 3899 } 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) @@ -75824,7 +76011,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103962)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75923,7 +76110,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(104062)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75937,7 +76124,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 + 3873 + v1 = __ccgo_ts + 3899 } else { v1 = libc.UintptrFromInt32(0) } @@ -76384,11 +76571,12 @@ type TVdbeSorter1 = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter1 = TVdbeSorter1 +/* Size (in bytes) of a VdbeSorter object that works with N or fewer subtasks */ + /* ** An instance of the following object is used to read records out of a ** PMA, in sorted order. The next key to be read is cached in nKey/aKey. @@ -76995,8 +77183,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 @@ -77010,9 +77198,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) @@ -77210,18 +77398,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 { @@ -77509,6 +77698,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: @@ -80054,25 +80246,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+6664, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6689, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6672+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6691+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6697+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6716+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6160+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6184+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6710+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6735+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6710+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6735+7) == 0 { return int32(1) } } @@ -80111,23 +80303,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 */ @@ -80159,7 +80350,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+6724, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6749, 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 @@ -80253,7 +80444,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+6729) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6754) != 0 { goto _2 } } @@ -80275,57 +80466,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 @@ -80370,11 +80548,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+6731, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6756, 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+6735, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6760, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -80383,36 +80561,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+6739, zTab) == 0 { + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6764, 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++ @@ -80441,18 +80608,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 } } } @@ -80499,15 +80666,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+6748, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6773, 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+6779, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6804, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6816, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6841, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -80518,8 +80685,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -80559,7 +80726,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+6834, libc.VaList(bp+24, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6859, 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) @@ -80579,7 +80746,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) @@ -80588,7 +80755,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 + 6869 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6894 *(*uintptr)(unsafe.Pointer(pExpr + 32)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -80598,26 +80765,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 6878 + v8 = __ccgo_ts + 6903 } else { - v10 = __ccgo_ts + 6893 + v8 = __ccgo_ts + 6918 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6915, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6940, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6928, libc.VaList(bp+24, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6953, 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+6938, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6963, libc.VaList(bp+24, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6999, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7024, 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) } @@ -80666,8 +80833,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80741,19 +80908,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 7006 + zIn = __ccgo_ts + 7031 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 7034 + zIn = __ccgo_ts + 7059 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 7052 + zIn = __ccgo_ts + 7077 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 7070 + zIn = __ccgo_ts + 7095 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7088, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7113, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -80779,7 +80946,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 @@ -80925,7 +81092,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+7108, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7133, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -80980,7 +81147,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+7125, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7150, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -81004,7 +81171,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+7189, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7214, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) @@ -81018,13 +81185,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: ; @@ -81044,16 +81211,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+7225, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7250, 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 @@ -81064,35 +81228,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+7253, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7278, 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 + 7296 + zType = __ccgo_ts + 7321 } else { - zType = __ccgo_ts + 7303 + zType = __ccgo_ts + 7328 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7313, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7338, 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+7341, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7366, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7363, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7388, 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+7407, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7432, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -81177,7 +81344,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+7455, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7480, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) } @@ -81189,7 +81356,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+7466, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7491, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -81235,7 +81402,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+6816, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6841, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -81360,7 +81527,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+7477, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7502, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -81395,7 +81562,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+7533, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7558, 0) return int32(1) } i = 0 @@ -81433,7 +81600,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+7567, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7592, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -81503,7 +81670,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+7573, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7598, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -81537,7 +81704,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+7634, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7659, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -81850,7 +82017,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+7665, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7690, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -81917,7 +82084,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+7567) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7592) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -81928,7 +82095,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+7704) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7729) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -81938,7 +82105,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+7710, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7735, 0) return int32(WRC_Abort) } goto _6 @@ -82160,33 +82327,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 } @@ -82238,7 +82407,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) { @@ -82446,7 +82615,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 } @@ -82921,7 +83090,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6816, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6841, 0) return } if libc.Int32FromUint8(op) == int32(TK_LE) { @@ -83000,7 +83169,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+7769, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7794, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -83187,7 +83356,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) @@ -83345,11 +83514,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 7817 + v2 = __ccgo_ts + 7842 } else { v2 = __ccgo_ts + 1676 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7819, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7844, 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)) @@ -83398,7 +83567,7 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt 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)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1796) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1822) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -83426,7 +83595,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+7863, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7888, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) @@ -83446,7 +83615,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+7897, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7922, libc.VaList(bp+8, p)) } // C documentation @@ -83517,7 +83686,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+7947, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7972, libc.VaList(bp+8, pExpr)) } } } @@ -83569,7 +83738,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+7967, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7992, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -83602,7 +83771,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+8010, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8035, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -83985,7 +84154,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 @@ -84125,7 +84294,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: @@ -84146,27 +84314,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) { @@ -84212,9 +84373,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++ } @@ -84224,8 +84385,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++ } @@ -84239,7 +84400,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) } @@ -84290,7 +84451,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 @@ -84371,7 +84532,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) @@ -84389,7 +84550,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) @@ -84470,7 +84631,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+8033, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8058, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -84599,7 +84760,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+8063, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8088, libc.VaList(bp+8, zObject)) } } @@ -84697,10 +84858,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+8086) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8111) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8091) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8116) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -85378,13 +85539,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+8097) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8122) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8105) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8130) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8111) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8136) == 0 { return int32(1) } return 0 @@ -85399,32 +85560,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 + 8097, - 1: __ccgo_ts + 8105, - 2: __ccgo_ts + 8111, + 0: __ccgo_ts + 8122, + 1: __ccgo_ts + 8130, + 2: __ccgo_ts + 8136, } 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 @@ -85633,7 +85781,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 @@ -85686,7 +85834,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+8115, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8140, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -85786,12 +85934,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+1796) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1822) 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) @@ -86383,7 +86532,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+8330) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8355) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -86479,14 +86628,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 } @@ -86514,9 +86663,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) { @@ -86649,7 +86798,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) } } @@ -86779,13 +86928,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)<= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8423, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8448, libc.VaList(bp+160, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -87577,7 +87726,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)) @@ -87592,7 +87741,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+8450, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8475, libc.VaList(bp+160, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -87621,7 +87770,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) } @@ -87697,7 +87846,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8033, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8058, 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): @@ -87760,7 +87909,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6816, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6841, 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 @@ -87770,7 +87919,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) { @@ -87791,9 +87940,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 /* @@ -87875,7 +88024,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+8474, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8499, 0) return 0 } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -87946,17 +88095,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 { @@ -87965,7 +88114,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 @@ -87996,7 +88145,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 { @@ -88066,7 +88215,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) @@ -88110,7 +88259,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 @@ -88377,7 +88526,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: @@ -88586,7 +88737,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: @@ -89293,7 +89446,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) } @@ -89814,7 +89967,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) 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 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 @@ -89830,7 +89983,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) (*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 + v9 = pParse + 60 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 @@ -89915,7 +90068,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 @@ -89923,7 +90076,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 @@ -89941,7 +90094,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 } } } @@ -89960,11 +90113,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 } @@ -90082,8 +90235,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+6664, 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+8524, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6689, 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+8549, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90101,10 +90254,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+8552, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8577, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8727, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8752, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -90120,9 +90273,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+8901, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8926, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9048, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9073, 0) } } @@ -90178,7 +90331,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+9199, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9224, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -90187,11 +90340,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+9258, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9283, zName) { goto exit_rename_table } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9264, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9289, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -90221,21 +90374,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+9291, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9316, 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+9475, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9500, 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+9780, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9796, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+9805, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9821, 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+9854, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9879, 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 @@ -90243,7 +90396,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 @@ -90251,7 +90404,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+10119, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10144, 0) goto exit_rename_table exit_rename_table: ; @@ -90268,7 +90421,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+10132, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10157, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -90308,11 +90461,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+10170, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10195, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10202, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10227, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -90328,10 +90481,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+10229) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10254) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10288) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10313) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -90343,13 +90496,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10341) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10366) } _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+10387) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10412) } } /* Modify the CREATE TABLE statement. */ @@ -90363,7 +90516,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+10414, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10439, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -90391,7 +90544,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+10560, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10585, libc.VaList(bp+16, zTab, zDb)) } } } @@ -90429,12 +90582,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+10913, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10938, 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+10947, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10972, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -90449,7 +90602,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 } @@ -90457,8 +90610,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+10977, 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+11002, 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 } @@ -90519,18 +90672,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 + 10996 + zType = __ccgo_ts + 11021 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 11001 + zType = __ccgo_ts + 11026 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11015 + v1 = __ccgo_ts + 11040 } else { - v1 = __ccgo_ts + 11032 + v1 = __ccgo_ts + 11057 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11050, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11075, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90577,21 +90730,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+11068, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11093, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -90607,11 +90748,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+11089, 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+11271, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11114, 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+11296, 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+10119, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10144, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -91087,11 +91228,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 + 11402 + v1 = __ccgo_ts + 11427 } else { v1 = __ccgo_ts + 1676 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11404, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11429, 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) } @@ -91162,30 +91303,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+11427, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11452, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118867)) } 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(118888)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -91206,9 +91351,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)) @@ -91224,15 +91368,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+11435, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11460, 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)) @@ -91243,16 +91387,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++ @@ -91269,21 +91413,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 + 11402 + v1 = __ccgo_ts + 11427 } else { v1 = __ccgo_ts + 1676 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11441, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+11466, 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))) @@ -91309,7 +91453,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: ; @@ -91619,7 +91763,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 { @@ -91886,7 +92030,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) @@ -92069,7 +92213,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 { @@ -92153,8 +92297,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 @@ -92170,12 +92315,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)) @@ -92249,7 +92394,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(119856)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -92266,7 +92411,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11446, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11471, 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 @@ -92321,23 +92466,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11068, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11093, 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 + 11453 + v1 = __ccgo_ts + 11478 } else { - v1 = __ccgo_ts + 5683 + v1 = __ccgo_ts + 5709 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11465, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11490, 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+11493, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11518, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -92349,31 +92494,31 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1676, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11541, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11566, 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+11662, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11687, 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)) { @@ -92387,7 +92532,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 @@ -92398,8 +92543,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 } @@ -92460,27 +92605,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 + 11680, + FzName: __ccgo_ts + 11705, }, 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 + 11701, + FzName: __ccgo_ts + 11726, }, 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 + 11721, + FzName: __ccgo_ts + 11746, }, 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 + 11740, + FzName: __ccgo_ts + 11765, }, 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 + 11759, + FzName: __ccgo_ts + 11784, }, } @@ -92691,8 +92836,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+11862, 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+11887, 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 { @@ -92702,10 +92852,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+11885, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11910, 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+11915, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11940, 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) @@ -92737,15 +92887,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11782, - FzCols: __ccgo_ts + 11795, + FzName: __ccgo_ts + 11807, + FzCols: __ccgo_ts + 11820, }, 1: { - FzName: __ccgo_ts + 11808, - FzCols: __ccgo_ts + 11821, + FzName: __ccgo_ts + 11833, + FzCols: __ccgo_ts + 11846, }, 2: { - FzName: __ccgo_ts + 11849, + FzName: __ccgo_ts + 11874, }, } @@ -92959,7 +93109,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) { @@ -92975,12 +93126,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 @@ -92988,7 +93139,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) @@ -93047,7 +93198,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 + 11933, + FzName: __ccgo_ts + 11958, } func init() { @@ -93421,7 +93572,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 + 11943, + FzName: __ccgo_ts + 11968, } func init() { @@ -93471,7 +93622,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+11953, libc.VaList(bp+72, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11978, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -93482,7 +93633,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+11958, libc.VaList(bp+72, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11983, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -93521,7 +93672,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+11964, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+11989, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -93539,7 +93690,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 + 11970, + FzName: __ccgo_ts + 11995, } func init() { @@ -93605,7 +93756,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+11979, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+12004, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -93614,12 +93765,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+11782, uint64(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*120 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11807, 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)) @@ -93741,7 +93892,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 } @@ -93821,7 +93972,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: @@ -93852,7 +94003,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+11989, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12014, 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)) @@ -93943,7 +94094,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+11989, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12014, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -93980,7 +94131,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 @@ -94013,11 +94164,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+11993) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12018) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11997) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12022) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -94181,17 +94332,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+12001, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12026, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12012, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12037, 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+12022, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12047, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -94203,13 +94354,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) - } } } @@ -94260,7 +94404,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) } @@ -94463,8 +94607,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))) @@ -94570,11 +94714,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+11808, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11833, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+12034, __ccgo_ts+12103, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+12059, __ccgo_ts+12128, zDb) } return rc } @@ -94640,10 +94784,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+11782, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11807, (*(*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+12155, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12180, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94756,7 +94900,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+6724, 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+6749, zName) == 0) } // C documentation @@ -94808,11 +94952,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+4045) + *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4071) if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12196, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12221, 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 { @@ -94843,7 +94987,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+12199, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12224, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -94852,7 +94996,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+12236, libc.VaList(bp+56, zName)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12261, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -94864,13 +95008,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 } @@ -94908,7 +95052,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+12266, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12291, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94916,7 +95060,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+12295, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12320, 0) rc = int32(SQLITE_ERROR) } } @@ -94963,7 +95107,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+1646, 0) } else { if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12363, libc.VaList(bp+56, zFile)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12388, libc.VaList(bp+56, zFile)) } } } @@ -95025,15 +95169,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+12391, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12416, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12412, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12437, 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+12438, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12463, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -95128,7 +95272,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12460, + FzName: __ccgo_ts + 12485, } func init() { @@ -95150,7 +95294,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 + 12474, + FzName: __ccgo_ts + 12499, } func init() { @@ -95176,7 +95320,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+12488, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12513, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -95210,7 +95354,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+12512, 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+12537, 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))) @@ -95427,7 +95571,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+12558, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12583, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -95455,11 +95599,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+12581, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12606, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12587, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12612, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12593, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12618, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -95519,7 +95663,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 + 8105 + zCol = __ccgo_ts + 8130 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -95554,7 +95698,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+12620, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12645, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -95672,7 +95816,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 @@ -95770,7 +95914,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) @@ -95848,7 +95994,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) { @@ -95862,7 +96008,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) } @@ -95975,21 +96123,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+6724) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6749) == 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+6664, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6689, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6691+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6710+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6160+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6672) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6716+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6735+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6184+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6697) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6710+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6160) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6735+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6184) } } } @@ -96019,12 +96167,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6664, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6710+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6160) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6689, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6735+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6184) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6691+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6672) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6716+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6697) } } } @@ -96062,7 +96210,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+12635, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12660, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -96072,7 +96220,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) @@ -96080,15 +96228,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 + 12643 + v1 = __ccgo_ts + 12668 } else { - v1 = __ccgo_ts + 12656 + v1 = __ccgo_ts + 12681 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6928, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6953, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6999, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7024, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -96126,12 +96274,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+6664, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6160+7) == 0 { - return __ccgo_ts + 6710 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6689, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6184+7) == 0 { + return __ccgo_ts + 6735 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6672+7) == 0 { - return __ccgo_ts + 6691 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 { + return __ccgo_ts + 6716 } } return zName @@ -96656,7 +96804,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+6160) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6184) _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) @@ -96688,7 +96836,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+6724, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6749, zName) { break } goto _1 @@ -96746,13 +96894,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+12670, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12695, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12687, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12712, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96800,8 +96948,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+6664, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12707, libc.VaList(bp+8, zName)) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6689, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12732, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96837,23 +96985,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 @@ -96973,7 +97123,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 @@ -97016,9 +97166,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 + 6672 + v1 = __ccgo_ts + 6697 } else { - v1 = __ccgo_ts + 6160 + v1 = __ccgo_ts + 6184 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -97031,7 +97181,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+12749, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12774, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -97047,9 +97197,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10996 + v2 = __ccgo_ts + 11021 } else { - v2 = __ccgo_ts + 9258 + v2 = __ccgo_ts + 9283 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -97059,9 +97209,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 + 6672 + v3 = __ccgo_ts + 6697 } else { - v3 = __ccgo_ts + 6160 + v3 = __ccgo_ts + 6184 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -97085,11 +97235,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 + 10996 + v4 = __ccgo_ts + 11021 } else { - v4 = __ccgo_ts + 9258 + v4 = __ccgo_ts + 9283 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12790, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12815, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -97097,11 +97247,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+12811, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12836, 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++ @@ -97133,19 +97283,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 @@ -97165,15 +97325,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) @@ -97188,7 +97353,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 } @@ -97249,7 +97414,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+12846, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12871, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -97258,14 +97423,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+12880, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12905, 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) @@ -97297,11 +97464,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) @@ -97312,7 +97479,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+12900, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12925, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -97322,12 +97489,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+12923, 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+12948, 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+12930, 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+12955, 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-- @@ -97369,21 +97536,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+12940, 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+12965, 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) { @@ -97394,7 +97550,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. */ @@ -97407,12 +97563,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 @@ -97584,10 +97749,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+12966, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12991, 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+13011, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13036, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -97645,7 +97810,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+13052, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13077, 0) } } @@ -97673,8 +97838,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) @@ -97682,7 +97847,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+13104, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13129, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -97701,21 +97866,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 @@ -97738,7 +97892,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13145, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13170, 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) @@ -97766,8 +97920,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 { @@ -97854,17 +98013,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+13201, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13226, 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+13244, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13269, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13252, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13277, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97896,7 +98055,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13259, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13284, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -98037,9 +98196,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 @@ -98050,31 +98210,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 + 1676 - zSep2 = __ccgo_ts + 13290 - zEnd = __ccgo_ts + 5184 + zSep2 = __ccgo_ts + 13315 + zEnd = __ccgo_ts + 5210 } else { - zSep = __ccgo_ts + 13292 - zSep2 = __ccgo_ts + 13296 - zEnd = __ccgo_ts + 13301 + zSep = __ccgo_ts + 13317 + zSep2 = __ccgo_ts + 13321 + zEnd = __ccgo_ts + 13326 } - 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+13304, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.Xmemcpy(tls, zStmt, __ccgo_ts+13329, 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))++ @@ -98085,8 +98245,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)] @@ -98099,17 +98260,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+3873, 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 + 1676, - 1: __ccgo_ts + 13318, - 2: __ccgo_ts + 13324, - 3: __ccgo_ts + 13329, - 4: __ccgo_ts + 13334, - 5: __ccgo_ts + 13324, + 1: __ccgo_ts + 13343, + 2: __ccgo_ts + 13349, + 3: __ccgo_ts + 13354, + 4: __ccgo_ts + 13359, + 5: __ccgo_ts + 13349, } // C documentation @@ -98118,15 +98280,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) } @@ -98141,7 +98304,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 } @@ -98374,8 +98537,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. @@ -98475,7 +98648,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 @@ -98488,8 +98661,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++ } @@ -98519,7 +98692,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 @@ -98738,9 +98911,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+13340, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1676))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13365, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1676))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13373, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13398, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98761,11 +98934,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+13400, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13425, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13450, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13475, 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)) @@ -98812,7 +98985,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13482, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13507, 0) return } } @@ -98846,16 +99019,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 + 9258 - zType2 = __ccgo_ts + 13526 + zType = __ccgo_ts + 9283 + zType2 = __ccgo_ts + 13551 } else { /* A view */ - zType = __ccgo_ts + 10996 - zType2 = __ccgo_ts + 13532 + zType = __ccgo_ts + 11021 + zType2 = __ccgo_ts + 13557 } /* 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 @@ -98872,24 +99045,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) @@ -98937,13 +99115,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+13537, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13562, 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+13552, 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+13577, 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 @@ -98952,15 +99140,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+13650, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13675, 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+13692, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13717, 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+13726, 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+13751, 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. @@ -98978,7 +99166,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+9780) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9805) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -99011,7 +99199,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+13747, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13772, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -99028,7 +99216,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+10996, *(*uintptr)(unsafe.Pointer(bp + 112))) + _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+11021, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -99125,7 +99313,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+13783, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13808, 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. @@ -99309,7 +99497,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+13813, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13838, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -99322,7 +99510,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+13828, 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+13853, 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) } @@ -99405,9 +99593,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+13895, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13920, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11885, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11910, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -99448,7 +99636,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+13909, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13934, 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 @@ -99457,7 +99645,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+13954, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13979, 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) } @@ -99492,11 +99680,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+6664, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3496, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6689, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3522, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7466, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7491, int32(10)) == 0 { return 0 } return int32(1) @@ -99551,9 +99739,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 + 6672 + v1 = __ccgo_ts + 6697 } else { - v1 = __ccgo_ts + 6160 + v1 = __ccgo_ts + 6184 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName @@ -99586,18 +99774,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+14021, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14046, 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+14049, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14074, 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+14083, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14108, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -99607,7 +99795,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+11997, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12022, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -99655,19 +99843,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+14115, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14140, 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+14178, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14203, 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 { @@ -99724,7 +99912,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+14272, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14297, 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) { @@ -99839,11 +100027,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 */ @@ -99865,7 +100053,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 @@ -99910,13 +100098,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) } @@ -99939,23 +100127,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 @@ -99984,11 +100172,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 + 14318 + v2 = __ccgo_ts + 14343 } else { - v2 = __ccgo_ts + 14324 + v2 = __ccgo_ts + 14349 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14329, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14354, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -100066,7 +100254,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14357, *(*uintptr)(unsafe.Pointer(bp + 96))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14382, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -100076,7 +100264,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+14363, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14388, 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)) { @@ -100090,16 +100278,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+6664, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14413, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6689, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14438, 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+14441, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14466, 0) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14466, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14491, 0) goto exit_create_index } /* @@ -100120,19 +100308,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+14357, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14382, (*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+14500, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14525, 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+14534, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14559, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -100153,7 +100341,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+14558, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14583, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -100171,9 +100359,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 + 6672 + v2 = __ccgo_ts + 6697 } else { - v2 = __ccgo_ts + 6160 + v2 = __ccgo_ts + 6184 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -100201,7 +100389,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+14357) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14382) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -100233,7 +100421,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 } @@ -100285,7 +100473,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+14581, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14606, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -100300,6 +100488,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { j = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) } else { if int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16 + 8))&0xf>>0)) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) @@ -100384,7 +100573,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) @@ -100432,7 +100621,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+14642, libc.VaList(bp+136, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14667, 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 @@ -100462,8 +100651,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+14684, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14709, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127335)) goto exit_create_index } } @@ -100476,7 +100665,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 @@ -100505,9 +100694,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if onError == OE_None { v13 = __ccgo_ts + 1676 } else { - v13 = __ccgo_ts + 14701 + v13 = __ccgo_ts + 14726 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14709, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14734, 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(""); */ @@ -100515,7 +100704,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+14729, 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+14754, 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. @@ -100523,7 +100712,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+14788, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14813, 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)) @@ -100686,16 +100875,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+14815, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14840, 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+14833, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14858, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100703,9 +100892,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 + 6672 + v1 = __ccgo_ts + 6697 } else { - v1 = __ccgo_ts + 6160 + v1 = __ccgo_ts + 6184 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -100721,8 +100910,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+14906, 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+11993, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14931, 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+12018, (*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) @@ -100795,12 +100984,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) @@ -100912,13 +101101,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+14966, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14991, 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) } @@ -100999,7 +101188,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) } @@ -101049,7 +101238,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 @@ -101220,11 +101409,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 + 15002 + v1 = __ccgo_ts + 15027 } else { - v1 = __ccgo_ts + 15005 + v1 = __ccgo_ts + 15030 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15011, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15036, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -101423,7 +101612,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+15047, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15072, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -101470,9 +101659,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 + 15053 + v1 = __ccgo_ts + 15078 } else { - v1 = __ccgo_ts + 15062 + v1 = __ccgo_ts + 15087 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -101504,9 +101693,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 15047, - 1: __ccgo_ts + 15069, - 2: __ccgo_ts + 15053, + 0: __ccgo_ts + 15072, + 1: __ccgo_ts + 15094, + 2: __ccgo_ts + 15078, } // C documentation @@ -101526,7 +101715,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+15077, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15102, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -101551,7 +101740,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+12581, 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+12606, 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 @@ -101982,7 +102171,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+15277, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15302, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102864,11 +103051,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+15310, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15335, 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+15339, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15364, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102972,7 +103159,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 @@ -103029,7 +103216,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+15413, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15438, -int32(1)) return } if argc == int32(3) { @@ -104748,7 +104940,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+15446, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15471, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -104830,7 +105022,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+3873, 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+3899, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) } // C documentation @@ -104902,28 +105094,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+15491, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15516, 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+15499, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15524, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -104955,13 +105147,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+15507, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 15532 + } else { + v2 = __ccgo_ts + 15536 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: Xsqlite3_str_append(tls, pStr, __ccgo_ts+1677, 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+15539, -int32(1)) + return +} + // C documentation // // /* @@ -104973,6 +105301,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) @@ -104983,7 +105315,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) @@ -105418,7 +105750,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 } @@ -105507,7 +105839,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11402, + 0: __ccgo_ts + 11427, } // C documentation @@ -105667,7 +105999,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+15510, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+15562, int32(4), libc.UintptrFromInt32(0)) } } @@ -105728,7 +106060,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+12620, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+12645, -int32(1)) return } if argc == int32(2) { @@ -105838,7 +106170,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) { @@ -105920,7 +106252,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+15390, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15415, -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) @@ -106152,7 +106484,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) @@ -106163,7 +106495,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 { @@ -106270,7 +106602,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+15515, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15567, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -106299,8 +106631,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+15521, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15521, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+15573, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15573, 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 @@ -106480,11 +106812,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 @@ -106588,7 +106920,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))) } /* @@ -106601,542 +106933,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 + 15526, + FzName: __ccgo_ts + 15578, }, 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 + 15546, + FzName: __ccgo_ts + 15598, }, 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 + 15559, + FzName: __ccgo_ts + 15611, }, 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 + 15577, + FzName: __ccgo_ts + 15629, }, 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 + 15586, + FzName: __ccgo_ts + 15638, }, 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 + 15594, + FzName: __ccgo_ts + 15646, }, 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 + 15594, + FzName: __ccgo_ts + 15646, }, 7: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15609, + FzName: __ccgo_ts + 15661, }, 8: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15635, + FzName: __ccgo_ts + 15687, }, 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 + 15660, + FzName: __ccgo_ts + 15712, }, 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 + 15669, + FzName: __ccgo_ts + 15721, }, 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 + 15680, + FzName: __ccgo_ts + 15732, }, 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 + 15687, + FzName: __ccgo_ts + 15739, }, 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 + 15701, + FzName: __ccgo_ts + 15753, }, 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 + 15701, + FzName: __ccgo_ts + 15753, }, 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 + 15707, + FzName: __ccgo_ts + 15759, }, 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 + 15707, + FzName: __ccgo_ts + 15759, }, 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 + 15713, + FzName: __ccgo_ts + 15765, }, 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 + 15713, + FzName: __ccgo_ts + 15765, }, 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 + 15718, + FzName: __ccgo_ts + 15770, }, 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 + 15718, + FzName: __ccgo_ts + 15770, }, 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 + 15722, + FzName: __ccgo_ts + 15774, }, 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 + 15722, + FzName: __ccgo_ts + 15774, }, 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 + 15726, + FzName: __ccgo_ts + 15778, }, 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 + 15733, + FzName: __ccgo_ts + 15785, }, 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 + 15741, + FzName: __ccgo_ts + 15793, }, 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 + 15748, + FzName: __ccgo_ts + 15800, }, 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 + 15761, + FzName: __ccgo_ts + 15813, }, 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 + 15767, + FzName: __ccgo_ts + 15819, }, 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 + 15774, + FzName: __ccgo_ts + 15826, }, 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 + 15781, + FzName: __ccgo_ts + 15833, }, 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 + 15789, + FzName: __ccgo_ts + 15841, }, 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 + 15794, + FzName: __ccgo_ts + 15846, }, 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 + 15798, + FzName: __ccgo_ts + 15850, }, 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 + 15798, + FzName: __ccgo_ts + 15850, }, 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 + 15804, + FzName: __ccgo_ts + 15856, }, 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 + 15810, + FzName: __ccgo_ts + 15862, }, 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 + 15816, + FzName: __ccgo_ts + 15868, }, 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 + 15820, + FzName: __ccgo_ts + 15872, }, 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 + 15820, + FzName: __ccgo_ts + 15872, }, 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 + 15826, + FzName: __ccgo_ts + 15878, }, 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 + 15833, + FzName: __ccgo_ts + 15885, }, 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 + 15843, + FzName: __ccgo_ts + 15895, }, 43: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15850, + FzName: __ccgo_ts + 15902, }, 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 + 15857, + FzName: __ccgo_ts + 15909, }, 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 + 15868, + FzName: __ccgo_ts + 15920, }, 46: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15875, + FzName: __ccgo_ts + 15927, }, 47: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15890, + FzName: __ccgo_ts + 15942, }, 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 + 15907, + FzName: __ccgo_ts + 15959, }, 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 + 15918, + FzName: __ccgo_ts + 15970, }, 50: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15924, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.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, }, 51: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15942, + FnArg: int16(1), + FfuncFlags: 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 + 15983, }, 52: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15950, + FzName: __ccgo_ts + 15996, }, 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 + 15964, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16014, }, 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 + 15972, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16022, }, 55: { - 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 + 15981, - }, - 56: { 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 + 15981, + FzName: __ccgo_ts + 16036, + }, + 56: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16044, }, 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 + 15988, + FzName: __ccgo_ts + 16053, }, 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 + 15988, + FzName: __ccgo_ts + 16053, }, 59: { - 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, + 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 + 16060, }, 60: { - 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 + 16002, + 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 + 16060, }, 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 + 16008, + FzName: __ccgo_ts + 16070, }, 62: { - 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 + 16012, + 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 + 16074, }, 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(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16012, + 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 + 16080, }, 64: { - 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 + 16018, + 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 + 16084, }, 65: { - 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, + 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 + 16084, }, 66: { - FnArg: int16(2), + 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 + 16031, + FzName: __ccgo_ts + 16090, }, 67: { 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 + 16042, + 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 + 16090, }, 68: { 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 + 15521, + 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 + 16103, }, 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 + 16114, + }, + 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 + 15573, + }, + 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 + 15521, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16047, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1249, + FzName: __ccgo_ts + 15573, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1257, + FzName: __ccgo_ts + 16119, }, 73: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16052, + FzName: __ccgo_ts + 1249, }, 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 + 16058, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1257, }, 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 + 16061, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16124, }, 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 + 16065, + FzName: __ccgo_ts + 16130, }, 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 + 16071, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16133, }, 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 + 16061, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16137, }, 79: { FnArg: int16(1), - 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)), + FpUserData: uintptr(int64(libc.Int32FromInt32(2))), + FzName: __ccgo_ts + 16143, }, 80: { FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16080, + FfuncFlags: libc.Uint32FromInt32(libc.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, }, 81: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16084, - }, - 82: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16090, - }, - 83: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16094, - }, - 84: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16099, - }, - 85: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16104, - }, - 86: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16109, - }, - 87: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16115, - }, - 88: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16119, - }, - 89: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16123, - }, - 90: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16127, - }, - 91: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16132, - }, - 92: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16137, - }, - 93: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16142, - }, - 94: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16148, }, + 82: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16152, + }, + 83: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16156, + }, + 84: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16162, + }, + 85: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16166, + }, + 86: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16171, + }, + 87: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16176, + }, + 88: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16181, + }, + 89: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16187, + }, + 90: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16191, + }, + 91: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16195, + }, + 92: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16199, + }, + 93: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16204, + }, + 94: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16209, + }, 95: { 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 + 16214, }, 96: { 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 + 16220, }, 97: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16165, + FzName: __ccgo_ts + 16226, }, 98: { 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 + 16232, }, 99: { + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16181, + FzName: __ccgo_ts + 16237, }, 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 + 16184, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16245, }, 101: { - 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 + 6869, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16253, }, 102: { - 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, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16256, }, 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 + 6894, + }, + 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 + 16193, + FzName: __ccgo_ts + 16261, + }, + 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 + 16265, }, } @@ -107195,109 +107538,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 ************************************************/ @@ -107521,7 +107866,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) } @@ -107614,7 +107959,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+16196, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16268, 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) @@ -108438,7 +108783,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 @@ -108725,11 +109070,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 6735, + Fz: __ccgo_ts + 6760, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 32)) = TToken{ - Fz: __ccgo_ts + 6731, + Fz: __ccgo_ts + 6756, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -108793,7 +109138,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+5319) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5345) pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = uint8(OE_Abort) @@ -108809,7 +109154,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 @@ -109375,7 +109720,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8362, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8387, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -109441,11 +109786,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 } @@ -109770,7 +110115,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) @@ -109784,7 +110129,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 @@ -109819,7 +110164,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 @@ -109832,7 +110177,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 @@ -109959,27 +110304,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 */ @@ -110060,7 +110405,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++ @@ -110087,7 +110432,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 } @@ -110096,44 +110441,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+16241, 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+16313, 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+16282, 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+16354, 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 } } @@ -110155,31 +110484,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+16314, libc.VaList(bp+128, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16386, 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 @@ -110203,10 +110532,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) @@ -110247,8 +110576,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-- } @@ -110265,34 +110594,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+16322, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16394, 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+16374, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16446, 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 @@ -110399,18 +110728,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 @@ -110420,13 +110749,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 } } } @@ -110437,14 +110766,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 } @@ -110461,16 +110790,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++ @@ -110581,11 +110910,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 */ @@ -110644,7 +110973,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16466) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16538) } goto insert_cleanup insert_cleanup: @@ -111040,7 +111369,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+12581, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12606, 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('/'))) { @@ -113274,7 +113605,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16515, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16587, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -113294,19 +113625,19 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16519, uint64(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16591, 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+16525, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16597, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113321,14 +113652,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+16568, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16640, 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) } @@ -113352,7 +113683,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+16600, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16672, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113361,7 +113692,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 16480, + 0: __ccgo_ts + 16552, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -113594,7 +113925,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16637, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16709, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -113648,63 +113979,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 + 5575, - 1: __ccgo_ts + 16676, - 2: __ccgo_ts + 9258, - 3: __ccgo_ts + 16680, - 4: __ccgo_ts + 16685, - 5: __ccgo_ts + 16688, - 6: __ccgo_ts + 16698, - 7: __ccgo_ts + 16708, - 8: __ccgo_ts + 16714, - 9: __ccgo_ts + 16718, - 10: __ccgo_ts + 16723, - 11: __ccgo_ts + 16728, - 12: __ccgo_ts + 16736, - 13: __ccgo_ts + 16747, - 14: __ccgo_ts + 16750, - 15: __ccgo_ts + 16757, - 16: __ccgo_ts + 16718, - 17: __ccgo_ts + 16723, - 18: __ccgo_ts + 16764, - 19: __ccgo_ts + 16769, - 20: __ccgo_ts + 16772, - 21: __ccgo_ts + 16779, - 22: __ccgo_ts + 16714, - 23: __ccgo_ts + 16718, - 24: __ccgo_ts + 16785, - 25: __ccgo_ts + 16790, - 26: __ccgo_ts + 16795, - 27: __ccgo_ts + 16718, - 28: __ccgo_ts + 16799, - 29: __ccgo_ts + 16723, - 30: __ccgo_ts + 16807, - 31: __ccgo_ts + 16811, - 32: __ccgo_ts + 16816, - 33: __ccgo_ts + 11997, - 34: __ccgo_ts + 11993, - 35: __ccgo_ts + 16822, - 36: __ccgo_ts + 16827, - 37: __ccgo_ts + 16832, - 38: __ccgo_ts + 16676, - 39: __ccgo_ts + 16718, - 40: __ccgo_ts + 16837, - 41: __ccgo_ts + 16844, - 42: __ccgo_ts + 16851, - 43: __ccgo_ts + 9258, - 44: __ccgo_ts + 16859, - 45: __ccgo_ts + 5578, - 46: __ccgo_ts + 16865, - 47: __ccgo_ts + 16676, - 48: __ccgo_ts + 16718, - 49: __ccgo_ts + 16870, - 50: __ccgo_ts + 16875, - 51: __ccgo_ts + 16061, - 52: __ccgo_ts + 16880, - 53: __ccgo_ts + 16893, - 54: __ccgo_ts + 16902, - 55: __ccgo_ts + 16909, - 56: __ccgo_ts + 16920, + 0: __ccgo_ts + 5601, + 1: __ccgo_ts + 16748, + 2: __ccgo_ts + 9283, + 3: __ccgo_ts + 16752, + 4: __ccgo_ts + 16757, + 5: __ccgo_ts + 16760, + 6: __ccgo_ts + 16770, + 7: __ccgo_ts + 16780, + 8: __ccgo_ts + 16786, + 9: __ccgo_ts + 16790, + 10: __ccgo_ts + 16795, + 11: __ccgo_ts + 16800, + 12: __ccgo_ts + 16808, + 13: __ccgo_ts + 16819, + 14: __ccgo_ts + 16822, + 15: __ccgo_ts + 16790, + 16: __ccgo_ts + 16829, + 17: __ccgo_ts + 16795, + 18: __ccgo_ts + 16837, + 19: __ccgo_ts + 16841, + 20: __ccgo_ts + 16846, + 21: __ccgo_ts + 16852, + 22: __ccgo_ts + 16790, + 23: __ccgo_ts + 16795, + 24: __ccgo_ts + 16859, + 25: __ccgo_ts + 16864, + 26: __ccgo_ts + 16867, + 27: __ccgo_ts + 16874, + 28: __ccgo_ts + 16786, + 29: __ccgo_ts + 16790, + 30: __ccgo_ts + 16880, + 31: __ccgo_ts + 16885, + 32: __ccgo_ts + 16890, + 33: __ccgo_ts + 16748, + 34: __ccgo_ts + 16790, + 35: __ccgo_ts + 16894, + 36: __ccgo_ts + 16901, + 37: __ccgo_ts + 16908, + 38: __ccgo_ts + 12022, + 39: __ccgo_ts + 12018, + 40: __ccgo_ts + 16916, + 41: __ccgo_ts + 16921, + 42: __ccgo_ts + 16926, + 43: __ccgo_ts + 9283, + 44: __ccgo_ts + 16931, + 45: __ccgo_ts + 5604, + 46: __ccgo_ts + 16937, + 47: __ccgo_ts + 16942, + 48: __ccgo_ts + 16133, + 49: __ccgo_ts + 16947, + 50: __ccgo_ts + 16748, + 51: __ccgo_ts + 16790, + 52: __ccgo_ts + 16960, + 53: __ccgo_ts + 16965, + 54: __ccgo_ts + 16974, + 55: __ccgo_ts + 16981, + 56: __ccgo_ts + 16992, } // C documentation @@ -113723,338 +114054,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16928, + FzName: __ccgo_ts + 17000, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16943, + FzName: __ccgo_ts + 17015, 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 + 16958, + FzName: __ccgo_ts + 17030, 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 + 16970, + FzName: __ccgo_ts + 17042, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 16986, + FzName: __ccgo_ts + 17058, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16909, + FzName: __ccgo_ts + 16981, 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 + 16999, + FzName: __ccgo_ts + 17071, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 17011, + FzName: __ccgo_ts + 17083, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17031, + FzName: __ccgo_ts + 17103, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 17047, + FzName: __ccgo_ts + 17119, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 17068, + FzName: __ccgo_ts + 17140, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 17083, + FzName: __ccgo_ts + 17155, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17099, + FzName: __ccgo_ts + 17171, 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 + 17113, + FzName: __ccgo_ts + 17185, 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 + 17126, + FzName: __ccgo_ts + 17198, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 15: { - FzName: __ccgo_ts + 17140, + FzName: __ccgo_ts + 17212, 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 + 17159, + FzName: __ccgo_ts + 17231, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 17: { - FzName: __ccgo_ts + 17178, + FzName: __ccgo_ts + 17250, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 18: { - FzName: __ccgo_ts + 17201, + FzName: __ccgo_ts + 17273, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17210, + FzName: __ccgo_ts + 17282, 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 + 17228, + FzName: __ccgo_ts + 17300, 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 + 17245, + FzName: __ccgo_ts + 17317, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 22: { - FzName: __ccgo_ts + 17258, + FzName: __ccgo_ts + 17330, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17273, + FzName: __ccgo_ts + 17345, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 24: { - FzName: __ccgo_ts + 17291, + FzName: __ccgo_ts + 17363, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 25: { - FzName: __ccgo_ts + 17301, + FzName: __ccgo_ts + 17373, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 26: { - FzName: __ccgo_ts + 17315, + FzName: __ccgo_ts + 17387, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17331, + FzName: __ccgo_ts + 17403, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 28: { - FzName: __ccgo_ts + 17356, + FzName: __ccgo_ts + 17428, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17375, + FzName: __ccgo_ts + 17447, 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 + 17386, + FzName: __ccgo_ts + 17458, 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 + 17397, + FzName: __ccgo_ts + 17469, 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 + 17409, + FzName: __ccgo_ts + 17481, 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 + 17425, + FzName: __ccgo_ts + 17497, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 34: { - FzName: __ccgo_ts + 17438, + FzName: __ccgo_ts + 17510, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 17457, + FzName: __ccgo_ts + 17529, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 36: { - FzName: __ccgo_ts + 17476, + FzName: __ccgo_ts + 17548, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17489, + FzName: __ccgo_ts + 17561, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17504, + FzName: __ccgo_ts + 17576, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17514, + FzName: __ccgo_ts + 17586, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17526, + FzName: __ccgo_ts + 17598, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17535, + FzName: __ccgo_ts + 17607, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 42: { - FzName: __ccgo_ts + 17546, + FzName: __ccgo_ts + 17618, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 43: { - FzName: __ccgo_ts + 17556, + FzName: __ccgo_ts + 17628, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17568, + FzName: __ccgo_ts + 17640, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 45: { - FzName: __ccgo_ts + 17579, + FzName: __ccgo_ts + 17651, 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 + 17591, + FzName: __ccgo_ts + 17663, 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 + 17608, + FzName: __ccgo_ts + 17680, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 48: { - FzName: __ccgo_ts + 17627, + FzName: __ccgo_ts + 17699, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 49: { - FzName: __ccgo_ts + 17653, + FzName: __ccgo_ts + 17725, 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 + 17668, + FzName: __ccgo_ts + 17740, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17682, + FzName: __ccgo_ts + 17754, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 52: { - FzName: __ccgo_ts + 17701, + FzName: __ccgo_ts + 17773, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17715, + FzName: __ccgo_ts + 17787, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17731, + FzName: __ccgo_ts + 17803, 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 + 17743, + FzName: __ccgo_ts + 17815, 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 + 17754, + FzName: __ccgo_ts + 17826, 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 + 17765, + FzName: __ccgo_ts + 17837, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -114062,45 +114393,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17777, + FzName: __ccgo_ts + 17849, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17788, + FzName: __ccgo_ts + 17860, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17809, + FzName: __ccgo_ts + 17881, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17817, + FzName: __ccgo_ts + 17889, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 62: { - FzName: __ccgo_ts + 17832, + FzName: __ccgo_ts + 17904, 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 + 17845, + FzName: __ccgo_ts + 17917, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17864, + FzName: __ccgo_ts + 17936, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 65: { - FzName: __ccgo_ts + 17879, + FzName: __ccgo_ts + 17951, 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)), @@ -114118,7 +114449,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 @@ -114226,10 +114557,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+17895) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17967) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17905) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17977) { return PAGER_LOCKINGMODE_NORMAL } } @@ -114247,13 +114578,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+8418) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8443) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17912) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17984) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17917) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17989) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -114276,10 +114607,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+16870) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+16960) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17929) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18001) == 0 { return int32(2) } else { return 0 @@ -114301,7 +114632,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+17936, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18008, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -114431,15 +114762,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch libc.Int32FromUint8(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 17998 + zName = __ccgo_ts + 18070 case int32(OE_SetDflt): - zName = __ccgo_ts + 18007 + zName = __ccgo_ts + 18079 case int32(OE_Cascade): - zName = __ccgo_ts + 18019 + zName = __ccgo_ts + 18091 case int32(OE_Restrict): - zName = __ccgo_ts + 18027 + zName = __ccgo_ts + 18099 default: - zName = __ccgo_ts + 18036 + zName = __ccgo_ts + 18108 break } return zName @@ -114460,12 +114791,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 18046, - 1: __ccgo_ts + 18053, - 2: __ccgo_ts + 18061, - 3: __ccgo_ts + 18065, - 4: __ccgo_ts + 17929, - 5: __ccgo_ts + 18074, + 0: __ccgo_ts + 18118, + 1: __ccgo_ts + 18125, + 2: __ccgo_ts + 18133, + 3: __ccgo_ts + 18137, + 4: __ccgo_ts + 18001, + 5: __ccgo_ts + 18146, } // C documentation @@ -114527,15 +114858,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 + 18099 + zType = __ccgo_ts + 18171 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18101 + zType = __ccgo_ts + 18173 } else { - zType = __ccgo_ts + 7817 + zType = __ccgo_ts + 7842 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18103, 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+18175, 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: ; @@ -114544,9 +114875,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 18078, - 2: __ccgo_ts + 18083, - 3: __ccgo_ts + 18091, + 1: __ccgo_ts + 18150, + 2: __ccgo_ts + 18155, + 3: __ccgo_ts + 18163, } // C documentation @@ -114645,7 +114976,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18110, libc.VaList(bp+176, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18182, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114688,7 +115019,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+3873, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3899, 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++ @@ -114733,7 +115064,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 @@ -114792,7 +115123,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+18114) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18186) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114835,7 +115166,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 @@ -114863,7 +115194,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 17905 + zRet = __ccgo_ts + 17977 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 @@ -114891,7 +115222,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 + 17895 + zRet = __ccgo_ts + 17967 } _returnSingleText(tls, v, zRet) break @@ -115181,7 +115512,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+18119, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18191, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -115191,7 +115522,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+3873, libc.VaList(bp+176, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+176, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -115213,7 +115544,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+18144, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18216, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -115245,8 +115576,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+18197) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18269) == 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. */ @@ -115326,9 +115658,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 + 18203 + v14 = __ccgo_ts + 18275 } else { - v14 = __ccgo_ts + 18211 + v14 = __ccgo_ts + 18283 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -115399,7 +115731,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+18218, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18290, 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)) @@ -115429,19 +115761,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 + 10996 + zType = __ccgo_ts + 11021 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13244 + zType = __ccgo_ts + 13269 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18234 + zType = __ccgo_ts + 18306 } else { - zType = __ccgo_ts + 9258 + zType = __ccgo_ts + 9283 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18241, 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+18313, 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: ; @@ -115488,9 +115820,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+18248, libc.VaList(bp+176, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18320, libc.VaList(bp+176, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18253, 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+18325, 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 @@ -115514,11 +115846,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 18258, - 1: __ccgo_ts + 18260, - 2: __ccgo_ts + 16747, + 0: __ccgo_ts + 18330, + 1: __ccgo_ts + 18332, + 2: __ccgo_ts + 16819, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18262, 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+18334, 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: ; @@ -115537,7 +115869,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+18268, 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+18340, 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: ; @@ -115554,7 +115886,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+18272, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18344, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -115604,7 +115936,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+7817, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7842, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -115616,7 +115948,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+7817, libc.VaList(bp+176, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7842, libc.VaList(bp+176, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -115642,7 +115974,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+18275, 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+18284)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18347, 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+18356)) goto _32 _32: ; @@ -115656,8 +115988,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 @@ -115783,7 +116115,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+18289, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18361, 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))) @@ -115879,7 +116211,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 @@ -115923,7 +116255,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 } @@ -115974,7 +116306,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+18293, 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+18365, 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) @@ -115985,7 +116317,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18317) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18389) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -116121,7 +116453,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+18346, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18418, 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) @@ -116183,7 +116515,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))) } @@ -116205,7 +116537,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+18382, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18454, 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) @@ -116218,7 +116550,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+18402, 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+18474, 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) { @@ -116226,7 +116558,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+18424, 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+18496, 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) { @@ -116237,10 +116569,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+18447, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18519, -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+18449, 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+18521, 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)) } } @@ -116274,7 +116606,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+18469, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18541, 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) @@ -116298,9 +116630,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+18499) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18571) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18504) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18576) _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)) @@ -116313,9 +116645,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+18525) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18597) _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+18633) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -116343,9 +116675,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+18499) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18571) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18572) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18644) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -116373,7 +116705,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+18599) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18671) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -116470,7 +116802,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 + 18626 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18698 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -116549,7 +116881,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+18687, libc.VaList(bp+176, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18759, libc.VaList(bp+176, zRight)) } } } @@ -116654,13 +116986,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+17912) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+17984) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18712) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18784) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18065) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18137) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116795,7 +117127,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 @@ -116825,7 +117157,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+6664, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6689, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -116887,7 +117219,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+18720, 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+18792, 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)) @@ -117160,34 +117492,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18629, + FzName: __ccgo_ts + 18701, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18634, + FzName: __ccgo_ts + 18706, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18640, + FzName: __ccgo_ts + 18712, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18649, + FzName: __ccgo_ts + 18721, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18658, + FzName: __ccgo_ts + 18730, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18666, + FzName: __ccgo_ts + 18738, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18674, + FzName: __ccgo_ts + 18746, }, 7: { - FzName: __ccgo_ts + 18681, + FzName: __ccgo_ts + 18753, }, 8: {}, } @@ -117283,14 +117615,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+18738) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18810) 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+18753, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18825, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) cSep = uint8(',') goto _1 _1: @@ -117299,19 +117631,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18760, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18832, 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+18766) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18838) 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+18778) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18850) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5184, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5210, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+32) if rc == SQLITE_OK { @@ -117326,7 +117658,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+3873, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -117507,7 +117839,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+3873, libc.VaList(bp+40, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+40, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -117519,13 +117851,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+18793) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18865) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18801, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18873, 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+18805, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18877, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -117534,7 +117866,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+3873, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -117660,24 +117992,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+18839, 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+18911, 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(143745)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) } else { - v1 = __ccgo_ts + 5186 + v1 = __ccgo_ts + 5212 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18867, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18939, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*uint8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18898, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18970, 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(143752)) } } } @@ -117685,9 +118017,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 18809, - 1: __ccgo_ts + 18816, - 2: __ccgo_ts + 18828, + 0: __ccgo_ts + 18881, + 1: __ccgo_ts + 18888, + 2: __ccgo_ts + 18900, } // C documentation @@ -117763,7 +118095,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+14684) + _corruptSchema(tls, pData, argv, __ccgo_ts+14709) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117796,11 +118128,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+18906) + _corruptSchema(tls, pData, argv, __ccgo_ts+18978) } 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+14684) + _corruptSchema(tls, pData, argv, __ccgo_ts+14709) } } } @@ -117839,18 +118171,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 + 9258 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9283 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6672 + v2 = __ccgo_ts + 6697 } else { - v2 = __ccgo_ts + 6160 + v2 = __ccgo_ts + 6184 } 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 + 8330 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 18919 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8355 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 18991 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -117934,7 +118266,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+12295) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12320) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117960,7 +118292,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+18991) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19063) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117975,7 +118307,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+19015, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19087, 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)) @@ -118304,7 +118636,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 @@ -118333,7 +118665,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 @@ -118393,7 +118725,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+19049, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19121, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -118409,7 +118741,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+19079, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19151, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -118432,10 +118764,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 { @@ -118443,7 +118775,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+3873, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3899, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -118473,7 +118805,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(144552)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -118607,7 +118939,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(144701)) } /* 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 @@ -118867,7 +119199,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) @@ -118875,7 +119207,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 @@ -119031,15 +119363,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 + 11402 - zSp2 = __ccgo_ts + 11402 + zSp1 = __ccgo_ts + 11427 + zSp2 = __ccgo_ts + 11427 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19098, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19170, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -119096,25 +119428,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) } @@ -119246,13 +119581,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 { @@ -119330,7 +119665,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+19128, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19200, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -119380,12 +119715,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+19178, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19250, 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. @@ -119400,9 +119735,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+19242, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19314, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -119412,6 +119748,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) @@ -119446,7 +119789,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 6869, + Fz: __ccgo_ts + 6894, Fn: uint32(8), } @@ -119494,7 +119837,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 @@ -119539,7 +119882,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) @@ -119563,7 +119906,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) @@ -119584,7 +119927,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 @@ -119707,7 +120050,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 { @@ -119834,10 +120177,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 @@ -119845,7 +120188,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 @@ -120022,7 +120365,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+19279, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19351, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -120133,8 +120476,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) @@ -120142,7 +120485,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) } @@ -120227,13 +120570,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19299 + z = __ccgo_ts + 19371 case int32(TK_INTERSECT): - z = __ccgo_ts + 19309 + z = __ccgo_ts + 19381 case int32(TK_EXCEPT): - z = __ccgo_ts + 19319 + z = __ccgo_ts + 19391 default: - z = __ccgo_ts + 19326 + z = __ccgo_ts + 19398 break } return z @@ -120254,7 +120597,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+19332, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19404, libc.VaList(bp+8, zUsage)) } /* @@ -120291,13 +120634,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 + 19355 + v1 = __ccgo_ts + 19427 } else { v1 = __ccgo_ts + 1676 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19369, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19441, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19400, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19472, 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) @@ -120321,11 +120664,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 @@ -120541,7 +120884,7 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr } if iCol < 0 { zType = __ccgo_ts + 1150 - *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16859 + *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16931 } 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)) @@ -120654,7 +120997,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 */ @@ -120663,7 +121006,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) @@ -120687,13 +121030,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 16859 + zCol = __ccgo_ts + 16931 } 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+12581, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12606, 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))) @@ -120701,7 +121044,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+19446, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19518, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120755,7 +121098,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) } @@ -120793,7 +121136,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 + 16859 + v3 = __ccgo_ts + 16931 } zName = v3 } else { @@ -120808,7 +121151,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+19446, libc.VaList(bp+40, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19518, 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. @@ -120844,7 +121187,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+19455, libc.VaList(bp+40, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19527, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -120963,7 +121306,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 + 19463 + zType = __ccgo_ts + 19535 } else { zType = uintptr(0) j = int32(1) @@ -121029,7 +121372,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) } @@ -121057,7 +121400,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) } @@ -121107,7 +121450,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 @@ -121130,7 +121473,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 @@ -121278,7 +121621,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+19467, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19539, 0) return } /* Obtain authorization to do a recursive query */ @@ -121315,7 +121658,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 @@ -121326,7 +121669,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 @@ -121340,7 +121683,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 @@ -121371,7 +121714,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+19516, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19588, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -121386,7 +121729,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+19558, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19630, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -121414,7 +121757,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+19564, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19636, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -121469,9 +121812,9 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) if nRow == int32(1) { v1 = __ccgo_ts + 1676 } else { - v1 = __ccgo_ts + 19579 + v1 = __ccgo_ts + 19651 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19581, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19653, 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) { @@ -121579,8 +121922,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+19604, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19619, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19676, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19691, 0) } /* Generate code for the left and right SELECT statements. */ @@ -121605,7 +121948,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+19299, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19371, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121631,7 +121974,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 @@ -121657,7 +122000,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+19638, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19710, 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 @@ -121689,11 +122032,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 @@ -121715,7 +122058,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+19638, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19710, 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 @@ -121822,6 +122165,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) } @@ -121838,9 +122182,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+19659, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19731, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19705, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19777, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121911,7 +122255,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+19279, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19351, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -122127,7 +122471,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) @@ -122159,7 +122503,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 { @@ -122213,16 +122557,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+7567) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7567) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7592) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7592) /* 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 @@ -122240,32 +122584,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+19787, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19859, 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+19798, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19870, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -122278,7 +122622,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+19803, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19875, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -122488,11 +122832,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 + 5164 + v1 = __ccgo_ts + 5190 } 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))) } @@ -122653,7 +122997,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 @@ -122843,9 +123187,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. @@ -123057,7 +123401,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) @@ -123204,7 +123548,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) @@ -123494,11 +123838,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 { @@ -123563,7 +123907,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 @@ -123581,12 +123925,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 { @@ -124068,7 +124412,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 @@ -124114,13 +124458,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+15718) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15770) == 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+15722) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15774) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -124208,8 +124552,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+19809, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19881, 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 @@ -124233,7 +124577,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 @@ -124315,7 +124659,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) @@ -124333,7 +124677,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+19827, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19899, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -124481,7 +124825,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) } @@ -124509,7 +124853,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+19850, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19922, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -124531,12 +124875,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+19870, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19942, 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 @@ -124553,7 +124897,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19913 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19985 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 { @@ -124584,7 +124928,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+19936, 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+20008, 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) } @@ -124593,9 +124937,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 + 19974 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20046 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20008 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20080 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -124644,7 +124988,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) { @@ -124654,7 +124998,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+20046, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20118, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124750,7 +125094,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) @@ -124759,7 +125103,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) } @@ -124810,7 +125154,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+20050, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20122, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124825,7 +125169,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+20089, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20161, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124840,7 +125184,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+15277, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15302, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124964,7 +125308,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 + 6729 + v10 = __ccgo_ts + 6754 } zSchemaName = v10 } @@ -124981,7 +125325,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+20120, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20192, 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) } @@ -125060,7 +125404,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+20125, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20197, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -125073,7 +125417,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+12581, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12606, 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) @@ -125093,9 +125437,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20134, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20206, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20152, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20224, 0) } } } @@ -125109,7 +125453,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+20172, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20244, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -125358,7 +125702,7 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint (*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))) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -125411,7 +125755,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 @@ -125448,12 +125792,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+20203, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20275, 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+20254, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20326, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -125474,7 +125818,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+20287, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20359, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -125613,7 +125957,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 @@ -125721,7 +126065,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 @@ -125788,7 +126132,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 + 20320 + v1 = __ccgo_ts + 20392 } else { v1 = __ccgo_ts + 1676 } @@ -125797,7 +126141,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp } else { v2 = __ccgo_ts + 1676 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20343, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20415, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125829,7 +126173,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+8330) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8355) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -125958,6 +126302,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. // */ @@ -125986,7 +126331,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+16012) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16084) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -126019,9 +126364,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 */ } @@ -126031,13 +126376,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 { @@ -126057,7 +126402,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) } @@ -126230,8 +126575,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 @@ -126240,11 +126585,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 { @@ -126260,7 +126605,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)) @@ -126284,14 +126629,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+20355, libc.VaList(bp+176, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20427, 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) @@ -126392,7 +126737,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+20409, 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+20481, 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 @@ -126593,14 +126938,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+20449, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20521, 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) @@ -126632,7 +126977,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 @@ -126647,7 +126992,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+20464, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20536, 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 { @@ -126701,7 +127046,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 @@ -126734,7 +127079,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 @@ -126793,7 +127138,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 @@ -126822,6 +127167,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)) @@ -126844,10 +127196,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) @@ -126881,8 +127233,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 @@ -126897,8 +127249,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 @@ -126927,8 +127279,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++ } @@ -126958,11 +127310,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.Uint16FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -126996,47 +127348,47 @@ 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)) /* 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)) /* Begin a loop that will extract all source rows in GROUP BY order. @@ -127046,16 +127398,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 @@ -127073,11 +127425,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 + 20480 + v47 = __ccgo_ts + 20552 } else { - v46 = __ccgo_ts + 20489 + v47 = __ccgo_ts + 20561 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19332, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19404, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -127091,8 +127443,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -127110,8 +127462,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -127122,12 +127474,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) @@ -127176,12 +127528,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++ } @@ -127251,9 +127607,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 @@ -127270,10 +127626,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 */ @@ -127300,8 +127656,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 } @@ -127341,32 +127697,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) @@ -127408,7 +127764,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+20480) + _explainTempTable(tls, pParse, __ccgo_ts+20552) } /* 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 @@ -127514,7 +127870,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+3873, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) if z == uintptr(0) { goto malloc_failed } @@ -127530,7 +127886,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+20498, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20570, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -127620,7 +127976,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+3873, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -127782,7 +128138,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+20563, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20635, 0) goto trigger_cleanup } iDb = int32(1) @@ -127822,7 +128178,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+20609, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20681, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -127832,11 +128188,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+20617, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20689, 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+20658, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20730, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127845,13 +128201,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+20609, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20681, (*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+20698, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20770, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127859,8 +128215,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+6664, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20724, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6689, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20796, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127868,15 +128224,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 + 20762 + v1 = __ccgo_ts + 20834 } else { - v1 = __ccgo_ts + 20769 + v1 = __ccgo_ts + 20841 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20775, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20847, 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+20812, libc.VaList(bp+112, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20884, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127896,9 +128252,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 + 6672 + v3 = __ccgo_ts + 6697 } else { - v3 = __ccgo_ts + 6160 + v3 = __ccgo_ts + 6184 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -127998,7 +128354,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+20609, bp+96) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20681, 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 } @@ -128020,7 +128376,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+20858, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20930, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -128036,10 +128392,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+20906, 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+20978, 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+20981, libc.VaList(bp+120, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21053, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -128307,11 +128663,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21010, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21082, 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) @@ -128349,9 +128705,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 + 6672 + v1 = __ccgo_ts + 6697 } else { - v1 = __ccgo_ts + 6160 + v1 = __ccgo_ts + 6184 } zTab = v1 if iDb == int32(1) { @@ -128366,7 +128722,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+21030, 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+21102, 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) } @@ -128499,11 +128855,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 + 21092 + v1 = __ccgo_ts + 21164 } else { - v1 = __ccgo_ts + 21099 + v1 = __ccgo_ts + 21171 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21106, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21178, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -128605,7 +128961,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+21154, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21226, 0) return int32(1) } @@ -128753,12 +129109,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) { @@ -128766,19 +129122,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) @@ -128789,7 +129148,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 @@ -128803,7 +129162,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 { @@ -128871,7 +129230,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+6357, 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+6381, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -128970,10 +129329,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+21196, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21268, 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 @@ -128995,7 +129356,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 @@ -129067,7 +129428,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)) @@ -129483,13 +129844,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 @@ -129497,21 +129858,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 */ @@ -129558,7 +129919,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 @@ -129597,7 +129958,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 } @@ -129641,58 +130002,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+21210, 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+21282, 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+21246, 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+21318, 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 + 8105 + v10 = __ccgo_ts + 8130 } 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 { @@ -129722,17 +130071,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++ } @@ -129744,11 +130093,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 @@ -129764,11 +130113,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 @@ -129777,18 +130126,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++ } @@ -129797,16 +130146,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. */ @@ -129824,24 +130173,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 { @@ -129867,50 +130216,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) @@ -130208,8 +130557,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -130259,8 +130608,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++ @@ -130307,11 +130656,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)) } @@ -130323,11 +130672,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. */ @@ -130370,7 +130719,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21265) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21337) } goto update_cleanup update_cleanup: @@ -130427,13 +130776,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) { @@ -130475,11 +130824,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 @@ -130804,9 +131153,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+21278, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21350, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21282, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21354, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -130895,13 +131244,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: @@ -130909,7 +131258,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+12670, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12695, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130991,7 +131340,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+21355, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21359, uint64(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21427, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21431, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -131082,7 +131431,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 @@ -131121,17 +131470,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+21363) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21435) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21403) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21475) 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+21446) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21518) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -131148,7 +131497,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+21495) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21567) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -131201,7 +131550,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+15047) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15072) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131232,11 +131581,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+21522, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21594, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21630, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21702, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131245,7 +131594,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+21684, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21756, 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 @@ -131255,7 +131604,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+21821, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21893, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -131398,7 +131747,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) @@ -131782,7 +132131,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+12900, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12925, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131905,24 +132254,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+21944, libc.VaList(bp+8, pParse+272)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22016, 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+21968, 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+22040, 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+22067, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22139, 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 @@ -132006,7 +132360,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+22086, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22158, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -132048,9 +132402,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+22128, libc.VaList(bp+48, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22200, libc.VaList(bp+48, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3873, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3899, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) } _sqlite3DbFree(tls, db, pVTable) @@ -132063,7 +132417,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 + 22158 + zFormat = __ccgo_ts + 22230 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -132097,7 +132451,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16750, 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+16822, 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 @@ -132178,13 +132532,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+22204, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22276, 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+3873, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3899, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -132265,7 +132619,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+22204, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22276, 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) @@ -132313,7 +132667,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+22223, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22295, 0) return int32(SQLITE_ERROR) } goto _1 @@ -132324,9 +132678,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(158352))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158354)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -132368,7 +132722,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 + 3873 + v3 = __ccgo_ts + 3899 } else { v3 = uintptr(0) } @@ -132734,7 +133088,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 } @@ -132824,7 +133178,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 } @@ -132844,7 +133198,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+3873, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3899, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -132908,7 +133262,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(158849)) } else { ap = va switch op { @@ -132921,7 +133275,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(158871)) break } _ = ap @@ -133606,7 +133960,6 @@ type TWhereInfo1 = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo1 = TWhereInfo1 @@ -133642,10 +133995,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 + 22236 + return __ccgo_ts + 22308 } if i == -int32(1) { - return __ccgo_ts + 16859 + return __ccgo_ts + 16931 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -133664,10 +134017,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+22243, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22315, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22249, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22321, int32(1)) } i = 0 for { @@ -133675,7 +134028,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13290, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13315, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133684,11 +134037,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5184, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5210, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22249, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22321, int32(1)) } i = 0 for { @@ -133696,16 +134049,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13290, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13315, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5186, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5212, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5184, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5210, int32(1)) } } @@ -133752,7 +134105,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+22251, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22323, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133760,12 +134113,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+22243, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22315, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22254 + v2 = __ccgo_ts + 22326 } else { - v2 = __ccgo_ts + 22259 + v2 = __ccgo_ts + 22331 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133782,7 +134135,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+22267) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22339) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133793,9 +134146,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+22269) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22341) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5184, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5210, int32(1)) } // C documentation @@ -133840,11 +134193,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 + 22271 + v2 = __ccgo_ts + 22343 } else { - v2 = __ccgo_ts + 22278 + v2 = __ccgo_ts + 22350 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22283, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22355, 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 { @@ -133857,37 +134210,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 + 11453 + zFmt = __ccgo_ts + 11478 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22289 + zFmt = __ccgo_ts + 22361 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22322 + zFmt = __ccgo_ts + 22394 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22347 + zFmt = __ccgo_ts + 22419 } else { - zFmt = __ccgo_ts + 22365 + zFmt = __ccgo_ts + 22437 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22374, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22446, 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 + 16859 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22382, libc.VaList(bp+144, zRowid)) + zRowid = __ccgo_ts + 16931 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22454, 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+22413, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22485, libc.VaList(bp+144, zRowid)) cRangeOp = uint8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133897,14 +134250,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22423, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22495, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22428) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22500) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22450 + v3 = __ccgo_ts + 22522 } else { - v3 = __ccgo_ts + 22458 + v3 = __ccgo_ts + 22530 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -133925,7 +134278,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+22464, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22536, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133991,14 +134344,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+22475, libc.VaList(bp+144, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22547, 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+22254, 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+22326, 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+22496, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22568, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -134022,16 +134375,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+22243, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22315, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22254, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22326, libc.VaList(bp+144, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5184, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5210, 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 @@ -134236,7 +134589,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 @@ -134315,7 +134668,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 */ @@ -134435,7 +134788,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i 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)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(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)) } @@ -134447,7 +134800,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } else { v3 = n } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(v3))) eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } pX = pExpr @@ -134485,10 +134838,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 @@ -134677,7 +135030,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 @@ -134808,7 +135161,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 @@ -135090,7 +135443,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 @@ -135151,11 +135504,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 @@ -135186,6 +135539,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 { @@ -135324,7 +135680,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 @@ -135404,7 +135760,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 @@ -135438,7 +135794,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 @@ -135560,7 +135916,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 @@ -135753,7 +136109,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: @@ -135767,12 +136123,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 { @@ -135810,11 +136167,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 */ @@ -135834,7 +136191,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 } @@ -135870,21 +136227,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 @@ -135902,7 +136259,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, @@ -135957,7 +136314,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+22504, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22576, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135980,7 +136337,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+22519, libc.VaList(bp+96, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22591, 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)) @@ -136469,9 +136826,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 @@ -136480,7 +136837,7 @@ 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+22528, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22600, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { @@ -136526,15 +136883,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 @@ -136546,7 +136904,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) { @@ -136619,7 +136977,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) @@ -137017,19 +137375,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16708, + FzOp: __ccgo_ts + 16780, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16042, + FzOp: __ccgo_ts + 16114, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15521, + FzOp: __ccgo_ts + 15573, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22542, + FzOp: __ccgo_ts + 22614, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -137817,7 +138175,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+22549, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22621, 0) return } } else { @@ -137829,10 +138187,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+22549, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22621, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137913,7 +138271,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 + 8091 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8116 *(*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) @@ -138014,7 +138372,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 + 22590 + v13 = __ccgo_ts + 22662 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -138545,7 +138903,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+22597, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22669, 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) @@ -138617,7 +138975,6 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo @@ -138628,7 +138985,6 @@ type THiddenIndexInfo1 = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo1 = THiddenIndexInfo1 @@ -139661,7 +140017,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)<>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 @@ -142278,7 +142630,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { + })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0)) { if libc.Int32FromUint16((*(*struct { FnEq Tu16 FnBtm Tu16 @@ -142482,7 +142834,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 @@ -142766,7 +143118,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) } } @@ -142944,7 +143296,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)) @@ -143285,7 +143637,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+22670, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22742, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143360,7 +143712,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+22670, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22742, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143514,7 +143866,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(168893)) /* 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) @@ -143950,7 +144302,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+22696, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22768, 0) rc = SQLITE_OK } else { break @@ -145158,7 +145510,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22731, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22803, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145736,7 +146088,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 @@ -145892,7 +146244,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+22749, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22821, 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 @@ -145913,11 +146265,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) @@ -145965,7 +146314,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+22777, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22849, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -146110,7 +146459,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 @@ -146144,7 +146494,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. @@ -146270,7 +146620,7 @@ 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 @@ -146301,16 +146651,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 @@ -146489,7 +146839,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 { @@ -146696,7 +147046,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 @@ -146706,7 +147056,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+22795, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22867, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146756,7 +147106,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 } @@ -147025,7 +147375,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+22824, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22896, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -147207,7 +147557,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+22880, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22952, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -147533,7 +147883,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+22925, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22997, libc.VaList(bp+8, zName)) } return p } @@ -147584,12 +147934,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+22944, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23016, 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+23015, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23087, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -147662,7 +148012,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+8330) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8355) } break } @@ -147800,7 +148150,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( 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 { @@ -147944,7 +148294,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+23078, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23150, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147980,7 +148330,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)) } @@ -147995,7 +148345,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 @@ -148014,11 +148364,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 { @@ -148064,11 +148414,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 @@ -148085,7 +148435,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+1796)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1822)) } 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)) @@ -148107,7 +148457,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 @@ -148231,7 +148581,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+23104, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23176, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -148299,18 +148649,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 + 23136 + zErr = __ccgo_ts + 23208 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23153 + zErr = __ccgo_ts + 23225 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23169 + zErr = __ccgo_ts + 23241 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23189, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23261, 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 { @@ -148334,7 +148684,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+23222, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23294, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -148440,24 +148790,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 @@ -148475,12 +148825,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) } @@ -148492,15 +148842,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 @@ -148552,11 +148902,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 23269, - 1: __ccgo_ts + 23322, - 2: __ccgo_ts + 22824, - 3: __ccgo_ts + 23373, - 4: __ccgo_ts + 23425, + 0: __ccgo_ts + 23341, + 1: __ccgo_ts + 23394, + 2: __ccgo_ts + 22896, + 3: __ccgo_ts + 23445, + 4: __ccgo_ts + 23497, } var _aOp1 = [5]int32{ @@ -149136,7 +149486,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 } @@ -149232,7 +149582,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 '' */ @@ -149949,12 +150299,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 @@ -149962,13 +150312,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 @@ -149988,13 +150338,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 @@ -150021,7 +150371,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 @@ -150240,6 +150590,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. @@ -150300,7 +150654,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+23475, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23547, libc.VaList(bp+8, p)) } // C documentation @@ -150314,6 +150668,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) } @@ -150347,11 +150702,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 + 23499 + v1 = __ccgo_ts + 23571 } else { - v1 = __ccgo_ts + 23508 + v1 = __ccgo_ts + 23580 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23514, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23586, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -150360,7 +150715,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23556, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23628, 0) } } } @@ -150466,7 +150821,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+23590, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23662, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -156987,13 +157342,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) } @@ -158923,20 +159278,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+16859, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16931, 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+23628, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23700, 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+16772, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16867, 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+23628, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23700, 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 @@ -158977,7 +159332,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 */ @@ -159122,7 +159482,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 */ @@ -159212,9 +159577,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) } @@ -159569,7 +159934,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+23655) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23727) 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) { @@ -159919,9 +160284,9 @@ _237: */ _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 + 8086 + v347 = __ccgo_ts + 8111 } else { - v347 = __ccgo_ts + 8091 + v347 = __ccgo_ts + 8116 } *(*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 { @@ -160163,15 +160528,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+23664, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23736, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23759, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23831, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23843, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23915, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -160313,7 +160678,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 */ @@ -160507,7 +160872,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+23928, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24000, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -163238,14 +163603,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)< int32(65528) { sz = int32(65528) } - if cnt < 0 { + /* 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 > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } szAlloc = int64(sz) * int64(cnt) - if sz == 0 || cnt == 0 { + 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)) @@ -164721,7 +165095,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182779)) + return _sqlite3MisuseError(tls, int32(183820)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164741,7 +165115,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+24015, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24087, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -165042,14 +165416,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 + 24558 + zErr = __ccgo_ts + 24630 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -165061,31 +165435,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 24083, - 1: __ccgo_ts + 24096, - 3: __ccgo_ts + 24112, - 4: __ccgo_ts + 24137, - 5: __ccgo_ts + 24151, - 6: __ccgo_ts + 24170, + 0: __ccgo_ts + 24155, + 1: __ccgo_ts + 24168, + 3: __ccgo_ts + 24184, + 4: __ccgo_ts + 24209, + 5: __ccgo_ts + 24223, + 6: __ccgo_ts + 24242, 7: __ccgo_ts + 1646, - 8: __ccgo_ts + 24195, - 9: __ccgo_ts + 24232, - 10: __ccgo_ts + 24244, - 11: __ccgo_ts + 24259, - 12: __ccgo_ts + 24292, - 13: __ccgo_ts + 24310, - 14: __ccgo_ts + 24335, - 15: __ccgo_ts + 24364, - 17: __ccgo_ts + 6115, - 18: __ccgo_ts + 5517, - 19: __ccgo_ts + 24381, - 20: __ccgo_ts + 24399, - 21: __ccgo_ts + 24417, - 23: __ccgo_ts + 24451, - 25: __ccgo_ts + 24472, - 26: __ccgo_ts + 24498, - 27: __ccgo_ts + 24521, - 28: __ccgo_ts + 24542, + 8: __ccgo_ts + 24267, + 9: __ccgo_ts + 24304, + 10: __ccgo_ts + 24316, + 11: __ccgo_ts + 24331, + 12: __ccgo_ts + 24364, + 13: __ccgo_ts + 24382, + 14: __ccgo_ts + 24407, + 15: __ccgo_ts + 24436, + 17: __ccgo_ts + 6139, + 18: __ccgo_ts + 5543, + 19: __ccgo_ts + 24453, + 20: __ccgo_ts + 24471, + 21: __ccgo_ts + 24489, + 23: __ccgo_ts + 24523, + 25: __ccgo_ts + 24544, + 26: __ccgo_ts + 24570, + 27: __ccgo_ts + 24593, + 28: __ccgo_ts + 24614, } // C documentation @@ -165232,6 +165606,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 // // /* @@ -165264,7 +165652,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i 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(183430)) + return _sqlite3MisuseError(tls, int32(184509)) } 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) @@ -165307,7 +165695,7 @@ 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+24639, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24711, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165433,7 +165821,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+24702, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24774, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -165464,7 +165852,7 @@ 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+3873, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -165708,7 +166096,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(184046)) + return _sqlite3MisuseError(tls, int32(185125)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*uint8)(unsafe.Pointer(zDb)) != 0 { @@ -165718,7 +166106,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+24753, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24825, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165840,7 +166228,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(184182))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185261))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165972,7 +166360,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(184261)) + return _sqlite3MisuseError(tls, int32(185340)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165982,7 +166370,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(184270)) + return _sqlite3MisuseError(tls, int32(185349)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -166031,7 +166419,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(184318)) + return _sqlite3MisuseError(tls, int32(185397)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -166040,7 +166428,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+24774, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24846, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -166187,7 +166575,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+24842, 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+24914, 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 @@ -166217,8 +166605,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+24848, zUri+7, uint64(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24858, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24920, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24930, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -166307,24 +166695,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+24886, zOpt, uint64(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24958, 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+24890, zOpt, uint64(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24962, 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 + 24890 + zModeType = __ccgo_ts + 24962 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24911, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24983, 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 + 3482 + zModeType = __ccgo_ts + 3508 } if aMode != 0 { mode = 0 @@ -166353,12 +166741,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+24926, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24998, 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+24946, 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_PERM) goto parse_uri_out } @@ -166382,7 +166770,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+24970, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25042, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -166402,11 +166790,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24896, + Fz: __ccgo_ts + 24968, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24903, + Fz: __ccgo_ts + 24975, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -166417,19 +166805,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24916, + Fz: __ccgo_ts + 24988, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24919, + Fz: __ccgo_ts + 24991, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24922, + Fz: __ccgo_ts + 24994, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17929, + Fz: __ccgo_ts + 18001, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -166557,8 +166945,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+22590, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+24986, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+22662, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25058, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -166579,10 +166967,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(184993)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186072)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 4268 + zFilename = __ccgo_ts + 4294 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+8, bp+16) } @@ -166591,7 +166979,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 + 3873 + v2 = __ccgo_ts + 3899 } else { v2 = uintptr(0) } @@ -166618,9 +167006,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 + 6724 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6749 (*(*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 + 23988 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 24060 (*(*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 { @@ -166714,7 +167102,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 24992 + zFilename = __ccgo_ts + 25064 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166874,7 +167262,7 @@ 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) @@ -166931,20 +167319,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+24995, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+25067, 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+25020) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25092) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25040) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25112) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25047) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25119) } // C documentation @@ -166969,9 +167357,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) @@ -166998,29 +167386,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 @@ -167075,15 +167452,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+25064, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25136, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 3873 + v2 = __ccgo_ts + 3899 } 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) @@ -167262,8 +167639,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 @@ -167707,7 +168084,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: ; @@ -168103,7 +168480,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+25092, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25164, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -168321,7 +168698,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 25100 + v2 = __ccgo_ts + 25172 } else { v2 = uintptr(0) } @@ -168400,7 +168777,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) @@ -168567,7 +168944,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 @@ -168784,6 +169161,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -169096,8 +169480,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 @@ -169154,7 +169538,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 @@ -169164,7 +169548,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 @@ -169202,18 +169586,18 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // */ var _jsonbType = [17]uintptr{ 0: __ccgo_ts + 1662, - 1: __ccgo_ts + 8086, - 2: __ccgo_ts + 8091, - 3: __ccgo_ts + 6400, - 4: __ccgo_ts + 6400, - 5: __ccgo_ts + 6395, - 6: __ccgo_ts + 6395, - 7: __ccgo_ts + 8397, - 8: __ccgo_ts + 8397, - 9: __ccgo_ts + 8397, - 10: __ccgo_ts + 8397, - 11: __ccgo_ts + 25123, - 12: __ccgo_ts + 25129, + 1: __ccgo_ts + 8111, + 2: __ccgo_ts + 8116, + 3: __ccgo_ts + 6425, + 4: __ccgo_ts + 6425, + 5: __ccgo_ts + 6420, + 6: __ccgo_ts + 6420, + 7: __ccgo_ts + 8422, + 8: __ccgo_ts + 8422, + 9: __ccgo_ts + 8422, + 10: __ccgo_ts + 8422, + 11: __ccgo_ts + 25195, + 12: __ccgo_ts + 25201, 13: __ccgo_ts + 1676, 14: __ccgo_ts + 1676, 15: __ccgo_ts + 1676, @@ -169700,7 +170084,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) { @@ -169998,8 +170382,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 + 25136 + 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 + 25136 + 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 + 1698 + 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 + 1698 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(6) } } @@ -170135,7 +170519,7 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { case int32(SQLITE_NULL): _jsonAppendRawNZ(tls, p, __ccgo_ts+1662, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+15491, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15516, 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)) @@ -170149,14 +170533,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+25153, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25208, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -170210,7 +170592,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+25182, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25237, -int32(1)) } } } @@ -170493,8 +170875,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(3), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25197, - FzRepl: __ccgo_ts + 25201, + FzMatch: __ccgo_ts + 25252, + FzRepl: __ccgo_ts + 25256, }, 1: { Fc1: uint8('i'), @@ -170502,8 +170884,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(8), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25209, - FzRepl: __ccgo_ts + 25201, + FzMatch: __ccgo_ts + 25264, + FzRepl: __ccgo_ts + 25256, }, 2: { Fc1: uint8('n'), @@ -170518,7 +170900,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: uint8('Q'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25218, + FzMatch: __ccgo_ts + 25273, FzRepl: __ccgo_ts + 1662, }, 4: { @@ -170526,7 +170908,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: uint8('S'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25223, + FzMatch: __ccgo_ts + 25278, FzRepl: __ccgo_ts + 1662, }, } @@ -170542,7 +170924,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25228, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25283, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -170560,23 +170942,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 } @@ -170654,7 +171036,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 @@ -170725,7 +171107,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) + } } } } @@ -171000,7 +171386,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+25271, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+25326, 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') { @@ -171430,7 +171816,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 { @@ -171469,7 +171855,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8086, 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+8111, 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)) } @@ -171477,7 +171863,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8091, 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+8116, 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)) } @@ -171554,14 +171940,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+25197, 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+25252, 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+25280) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25335) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25287) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25342) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25293, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25348, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171746,7 +172132,7 @@ _38: goto _51 } if libc.Int32FromUint8(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25287) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25342) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171791,7 +172177,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+25182, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25237, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171804,7 +172190,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+25182, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25237, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171853,10 +172239,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) @@ -171890,15 +172272,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 @@ -171971,11 +172353,11 @@ _2: return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8086, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8111, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8091, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8116, uint32(5)) return i + uint32(1) _6: ; @@ -172024,9 +172406,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25201 + v19 = __ccgo_ts + 25256 } else { - v19 = __ccgo_ts + 11953 + v19 = __ccgo_ts + 11978 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -172062,9 +172444,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: ; @@ -172091,7 +172476,7 @@ _11: sz2 -= k2 } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25299, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25354, uint32(2)) zIn2++ sz2-- continue @@ -172114,7 +172499,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, uint8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25302, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25357, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -172122,12 +172507,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25309, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25364, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25314, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25369, uint32(6)) case int32('\r'): if sz2 > uint32(2) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -172307,7 +172692,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25321, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25376, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172330,12 +172715,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+25324, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25379, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25321, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25376, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172350,50 +172735,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 // // /* @@ -172445,6 +172786,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 // // /* @@ -172465,6 +172884,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)) @@ -172537,9 +172959,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 @@ -172582,7 +173004,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 @@ -173070,7 +173503,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+25182, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25237, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -173205,7 +173638,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 } @@ -173306,7 +173739,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25182, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25237, -int32(1)) return } @@ -173343,11 +173776,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+25153, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25208, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -173360,7 +173790,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+25182, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25237, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -173379,10 +173809,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+25287) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25342) } 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+25280) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25335) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -173421,7 +173851,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+25327, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25382, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -173437,7 +173867,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. // ** @@ -173518,7 +173948,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25182, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25237, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -173530,34 +173960,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; +// ** 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. +// ** 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) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { + 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 (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) - return 0 + 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 (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - 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 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) @@ -173640,7 +174090,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 @@ -173700,7 +174150,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25182, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25237, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173835,7 +174285,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 + 25345 + v1 = __ccgo_ts + 25400 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173845,7 +174295,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+25182, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25237, -int32(1)) } } eErr = uint8(1) @@ -173955,23 +174405,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+25347, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25402, uint32(1)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25349, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25404, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+5239, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+5265, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1689, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1715, 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+25351, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25406, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25354, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25409, uint32(1)) } } } @@ -174011,7 +174461,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+25182, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25237, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -174279,7 +174729,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+25182, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25237, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -174303,7 +174753,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+25356, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25411, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -174314,7 +174764,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+25407, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25462, -int32(1)) _jsonStringReset(tls, bp) return } @@ -174386,7 +174836,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+25182, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25237, -int32(1)) } } goto json_remove_done @@ -174423,7 +174873,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+15964) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+16036) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -174454,9 +174904,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 25441 + v1 = __ccgo_ts + 25496 } else { - v1 = __ccgo_ts + 25445 + v1 = __ccgo_ts + 25500 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -174504,7 +174954,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+25182, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25237, -int32(1)) } } goto json_type_done @@ -174551,7 +175001,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 + 25452 + (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25507 (*(*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)) @@ -174625,17 +175075,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+25457, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25512, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -174644,18 +175093,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 @@ -174717,9 +175165,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))) @@ -174826,7 +175272,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25514, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25569, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174918,20 +175364,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))) + } } } @@ -174975,7 +175423,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25517, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25572, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -175078,7 +175526,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25520) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25575) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -175212,7 +175660,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+25603, 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+25658, 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 @@ -175238,9 +175686,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+25610, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25665, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25618, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25673, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -175551,9 +175999,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))) @@ -175626,7 +176073,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+25624, uint32(1)) + _jsonAppendRaw(tls, p+56, __ccgo_ts+25679, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -175650,7 +176097,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+25182, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25237, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175711,186 +176158,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 + 25626, + FzName: __ccgo_ts + 25681, }, 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 + 25631, + FzName: __ccgo_ts + 25686, }, 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 + 25637, + FzName: __ccgo_ts + 25692, }, 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 + 25648, + FzName: __ccgo_ts + 25703, }, 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 + 25660, + FzName: __ccgo_ts + 25715, }, 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 + 25660, + FzName: __ccgo_ts + 25715, }, 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 + 25678, + FzName: __ccgo_ts + 25733, }, 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 + 25698, + FzName: __ccgo_ts + 25753, }, 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 + 25711, + FzName: __ccgo_ts + 25766, }, 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 + 25725, + FzName: __ccgo_ts + 25780, }, 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 + 25728, + FzName: __ccgo_ts + 25783, }, 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 + 25732, + FzName: __ccgo_ts + 25787, }, 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 + 25744, + FzName: __ccgo_ts + 25799, }, 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 + 25757, + FzName: __ccgo_ts + 25812, }, 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 + 25769, + FzName: __ccgo_ts + 25824, }, 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 + 25782, + FzName: __ccgo_ts + 25837, }, 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 + 25793, + FzName: __ccgo_ts + 25848, }, 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 + 25805, + FzName: __ccgo_ts + 25860, }, 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 + 25805, + FzName: __ccgo_ts + 25860, }, 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 + 25817, + FzName: __ccgo_ts + 25872, }, 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 + 25828, + FzName: __ccgo_ts + 25883, }, 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 + 25840, + FzName: __ccgo_ts + 25895, }, 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 + 25853, + FzName: __ccgo_ts + 25908, }, 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 + 25866, + FzName: __ccgo_ts + 25921, }, 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 + 25880, + FzName: __ccgo_ts + 25935, }, 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 + 25889, + FzName: __ccgo_ts + 25944, }, 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 + 25899, + FzName: __ccgo_ts + 25954, }, 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 + 25899, + FzName: __ccgo_ts + 25954, }, 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 + 25909, + FzName: __ccgo_ts + 25964, }, 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 + 25909, + FzName: __ccgo_ts + 25964, }, 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 + 25920, + FzName: __ccgo_ts + 25975, }, 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 + 25937, + FzName: __ccgo_ts + 25992, }, 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 + 25955, + FzName: __ccgo_ts + 26010, }, 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 + 25973, + FzName: __ccgo_ts + 26028, }, } @@ -175973,17 +176420,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25992, + FzName: __ccgo_ts + 26047, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 26002, + FzName: __ccgo_ts + 26057, 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 @@ -176091,7 +176540,6 @@ type TRtreeMatchArg = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - FaParam [1]TRtreeDValue } type RtreeMatchArg = TRtreeMatchArg @@ -176374,11 +176822,12 @@ type TRtreeMatchArg1 = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - 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 ** clang, since clang works hard to be gcc compatible. So the gcc @@ -176454,7 +176903,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) } @@ -176560,7 +177009,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 @@ -176623,7 +177072,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+26012, 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+26067, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -176634,7 +177083,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 { @@ -176928,7 +177377,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26017, 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+26072, 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 { @@ -177465,7 +177914,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) } @@ -177845,7 +178294,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+26099) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26154) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177923,7 +178372,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) @@ -178154,7 +178603,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 } @@ -178162,7 +178611,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 @@ -178400,7 +178849,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: @@ -178822,7 +179271,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 @@ -179335,7 +179784,7 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179352,7 +179801,7 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179380,7 +179829,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+26113, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26168, 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 { @@ -179390,11 +179839,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+26133, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26188, 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+26165, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26220, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -179608,7 +180057,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+26202, 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+26257, 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)) @@ -179662,9 +180111,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 + 26347 + zFmt = __ccgo_ts + 26402 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11782, 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+11807, 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) { @@ -179722,9 +180171,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 26403, - 1: __ccgo_ts + 5578, - 2: __ccgo_ts + 16859, + 0: __ccgo_ts + 26458, + 1: __ccgo_ts + 5604, + 2: __ccgo_ts + 16931, } var _rtreeModule = Tsqlite3_module{ @@ -179768,21 +180217,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+26817, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26872, 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+26879, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26934, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26884, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26948, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27018, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26939, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27003, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27073, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179812,7 +180261,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 + 27067 + zFormat = __ccgo_ts + 27122 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179827,31 +180276,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+27175, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27230, 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+27220, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27275, 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+13290, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+13315, int32(1)) } if ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27247, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27302, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27269, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27324, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27277, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27332, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179865,14 +180314,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 26408, - 1: __ccgo_ts + 26461, - 2: __ccgo_ts + 26506, - 3: __ccgo_ts + 26558, - 4: __ccgo_ts + 26612, - 5: __ccgo_ts + 26657, - 6: __ccgo_ts + 26715, - 7: __ccgo_ts + 26770, + 0: __ccgo_ts + 26463, + 1: __ccgo_ts + 26516, + 2: __ccgo_ts + 26561, + 3: __ccgo_ts + 26613, + 4: __ccgo_ts + 26667, + 5: __ccgo_ts + 26712, + 6: __ccgo_ts + 26770, + 7: __ccgo_ts + 26825, } // C documentation @@ -179930,7 +180379,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+27293, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27348, 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) @@ -179938,17 +180387,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+3873, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27313, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27368, 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+3873, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, 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+3873, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, 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))) @@ -180011,7 +180460,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) } @@ -180025,13 +180474,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+27556, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27611, 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+27562, 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+27617, 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) { @@ -180040,7 +180489,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+27586, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27641, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -180054,19 +180503,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27613, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27668, 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+3873, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, 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+3873, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -180089,7 +180538,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+3873, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, 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)) @@ -180100,7 +180549,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+3873, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -180116,8 +180565,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27592, - 1: __ccgo_ts + 27603, + 0: __ccgo_ts + 27647, + 1: __ccgo_ts + 27658, } // C documentation @@ -180175,21 +180624,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+11402, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11427, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27616, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27671, 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+27622, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27677, 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+27626, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+27681, int32(1)) goto _1 _1: ; @@ -180216,7 +180665,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+27628, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+27683, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -180319,7 +180768,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) @@ -180334,11 +180783,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 + 4281 + v1 = __ccgo_ts + 4307 } else { v1 = __ccgo_ts + 1676 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27661, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27716, 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) } @@ -180372,7 +180821,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+27668, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27723, 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) @@ -180389,7 +180838,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+27713, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27768, libc.VaList(bp+8, iNode)) } } return pRet @@ -180418,8 +180867,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 + 27745, - 1: __ccgo_ts + 27799, + 0: __ccgo_ts + 27800, + 1: __ccgo_ts + 27854, } 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)) @@ -180432,21 +180881,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 + 27847 + v1 = __ccgo_ts + 27902 } else { - v1 = __ccgo_ts + 27855 + v1 = __ccgo_ts + 27910 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27864, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27919, 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 + 27847 + v2 = __ccgo_ts + 27902 } else { - v2 = __ccgo_ts + 27855 + v2 = __ccgo_ts + 27910 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27909, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27964, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -180491,7 +180940,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+27967, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28022, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -180509,7 +180958,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28015, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28070, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -180542,19 +180991,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+28082, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28137, 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+28116, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28171, 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+28146, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28201, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -180599,12 +181048,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+28201, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28256, 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+28232, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28287, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -180633,7 +181082,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+28299, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28354, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -180643,11 +181092,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+26113, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26168, 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+28327, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28382, 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)) @@ -180663,8 +181112,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+28358, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+28365, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28413, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28420, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -180691,7 +181140,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+28373, 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+28428, 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) } @@ -180742,13 +181191,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+28392, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28447, -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 + 6724 + zDb = __ccgo_ts + 6749 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -180757,7 +181206,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 + 18626 + v1 = __ccgo_ts + 18698 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -181024,7 +181473,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++ @@ -181069,7 +181518,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 @@ -181131,7 +181580,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 } @@ -181499,7 +181948,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 @@ -181514,9 +181963,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: ; @@ -181601,7 +182050,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 { @@ -181742,7 +182191,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 // ** @@ -181781,7 +182230,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) } @@ -181885,7 +182334,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 @@ -181969,7 +182418,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 @@ -182253,7 +182702,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) { @@ -182410,7 +182859,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 @@ -182422,13 +182871,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+27556, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27611, 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+28516, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28571, 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) @@ -182437,13 +182886,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+28538, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28593, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27613, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27668, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -182451,7 +182900,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+3873, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -182466,7 +182915,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+3873, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -182678,7 +183127,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 + 16859 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16931 (*(*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) @@ -182688,7 +183137,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 + 28542 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28597 (*(*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) @@ -182696,7 +183145,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 + 28548 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28603 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182816,7 +183265,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+28557, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28612, 0) } goto geopoly_update_end } @@ -182919,12 +183368,12 @@ geopoly_update_end: func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28597) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28652) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28613) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28668) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) @@ -182995,7 +183444,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+28790, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28845, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -183009,61 +183458,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28628, + FzName: __ccgo_ts + 28683, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28641, + FzName: __ccgo_ts + 28696, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28654, + FzName: __ccgo_ts + 28709, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28667, + FzName: __ccgo_ts + 28722, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28613, + FzName: __ccgo_ts + 28668, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28679, + FzName: __ccgo_ts + 28734, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28597, + FzName: __ccgo_ts + 28652, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28702, + FzName: __ccgo_ts + 28757, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28716, + FzName: __ccgo_ts + 28771, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28729, + FzName: __ccgo_ts + 28784, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28743, + FzName: __ccgo_ts + 28798, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28759, + FzName: __ccgo_ts + 28814, }, } @@ -183089,7 +183538,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28771, + FzName: __ccgo_ts + 28826, }, } @@ -183114,20 +183563,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+28798, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28853, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28808, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28863, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28819, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28874, -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+28542, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28597, 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+28830, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28885, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -183201,7 +183650,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) @@ -183229,7 +183678,7 @@ 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+26099, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26154, __ccgo_fp(_rtreeMatchArgFree)) } } } @@ -183470,7 +183919,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 @@ -184446,7 +184895,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+28840, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28895, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -184456,7 +184905,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+28840, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28895, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -184482,7 +184931,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+3873, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -184505,7 +184954,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+3873, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -184637,7 +185086,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+28861, uintptr(0), uintptr(0), p+64) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28916, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184726,7 +185175,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+26012, zIn, uint64(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26067, 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')) { @@ -184763,13 +185212,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 + 29032 + v1 = __ccgo_ts + 29087 } else { v1 = __ccgo_ts + 1676 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29073, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29128, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29223) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29278) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184936,7 +185385,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+3873, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -184997,7 +185446,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+29348, 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+29403, 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 @@ -185007,7 +185456,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+29467, 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+29522, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -185015,7 +185464,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+29488, 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+29543, 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) @@ -185027,7 +185476,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+29539, 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+29594, 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 { @@ -185071,7 +185520,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+29560, 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+29615, 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))) { @@ -185084,7 +185533,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+29588, 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+29643, 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 { @@ -185137,7 +185586,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+20134, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20206, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -185148,7 +185597,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+29617, 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+29672, 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) @@ -185159,7 +185608,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+29636, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+29691, 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 @@ -185167,7 +185616,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+29641, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29696, zName) { bRbuRowid = int32(1) } } @@ -185181,17 +185630,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 + 29651 + v4 = __ccgo_ts + 29706 } else { - v4 = __ccgo_ts + 29664 + v4 = __ccgo_ts + 29719 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29673, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29728, 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+29702, 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+29757, 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)) @@ -185213,7 +185662,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+29724, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29779, 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)) @@ -185259,8 +185708,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+29751, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15158 + zList = _rbuMPrintf(tls, p, __ccgo_ts+29806, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15183 goto _1 _1: ; @@ -185294,7 +185743,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+29760, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29815, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -185342,21 +185791,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+29773, 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+29828, 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+29805, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29860, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1676, __ccgo_ts+15158, __ccgo_ts+29828) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29834, __ccgo_ts+29841, __ccgo_ts+5184) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1676, __ccgo_ts+15158, __ccgo_ts+1676) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1676, __ccgo_ts+15183, __ccgo_ts+29883) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29889, __ccgo_ts+29896, __ccgo_ts+5210) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1676, __ccgo_ts+15183, __ccgo_ts+1676) 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+29849, 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+29904, 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+29891, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29946, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -185408,7 +185857,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zSep = __ccgo_ts + 1676 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+29588, 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+29643, 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)) @@ -185430,15 +185879,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 + 29911 + zCol = __ccgo_ts + 29966 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29919, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29940, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29976, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15158 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29974, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29995, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30031, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15183 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -185447,7 +185896,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+30003, 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+30058, 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 + 1676 iCol = 0 @@ -185464,15 +185913,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+30051, libc.VaList(bp+24, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15158 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30106, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15183 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30058, libc.VaList(bp+24, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30113, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -185530,7 +185979,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zAnd = __ccgo_ts + 1676 /* 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+29588, 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+29643, 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)) @@ -185539,7 +185988,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+30070, 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+30125, 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 + 1676 } else { if iCid < 0 { @@ -185559,9 +186008,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 + 29911 + zCol = __ccgo_ts + 29966 } else { - zCol = __ccgo_ts + 29641 + zCol = __ccgo_ts + 29696 } } zType = __ccgo_ts + 1150 @@ -185569,24 +186018,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+30092, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30147, 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 + 29828 + v2 = __ccgo_ts + 29883 } else { v2 = __ccgo_ts + 1676 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30112, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30167, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30133, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30166, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30188, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30221, 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 + 15158 - zAnd = __ccgo_ts + 22243 + zCom = __ccgo_ts + 15183 + zAnd = __ccgo_ts + 22315 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185640,11 +186089,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+30190, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30245, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30202, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30257, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15158 + zS = __ccgo_ts + 15183 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -185656,7 +186105,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+30211, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30266, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -185682,7 +186131,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+30226, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30281, 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 + 1676 @@ -185692,15 +186141,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+30240, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 22243 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30295, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22315 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30252, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30307, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1676 i1 = 0 @@ -185710,8 +186159,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+30302, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22243 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30357, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22315 } goto _2 _2: @@ -185734,7 +186183,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+30315, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30370, 0) } // C documentation @@ -185776,16 +186225,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+30302, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15158 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30357, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15183 } else { if libc.Int32FromUint8(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30341, 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 + 15158 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30396, 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 + 15183 } else { if libc.Int32FromUint8(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30371, 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 + 15158 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30426, 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 + 15183 } } } @@ -185869,16 +186318,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 + 30408 + zSep = __ccgo_ts + 30463 *(*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+29560, 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+29615, 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+16747) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16819) == 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+29588, 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+29643, libc.VaList(bp+24, zIdx))) } break } @@ -185889,16 +186338,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 + 29828 + v1 = __ccgo_ts + 29883 } else { v1 = __ccgo_ts + 1676 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30421, libc.VaList(bp+24, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15158 + z = _rbuMPrintf(tls, p, __ccgo_ts+30476, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15183 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30432, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30487, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -185944,7 +186393,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+30436) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30491) 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))) { @@ -185952,7 +186401,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+29588, 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+29643, 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))) { @@ -185961,21 +186410,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+30486, 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+30541, 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 + 29828 + v1 = __ccgo_ts + 29883 } else { v1 = __ccgo_ts + 1676 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30508, libc.VaList(bp+24, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15158 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30563, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15183 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30518, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30573, 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+6724, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30533, 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+6724, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30588, 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+6749, 0, 0)) } } @@ -186012,7 +186461,7 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum zComma = __ccgo_ts + 1676 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6724, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -186021,19 +186470,19 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { zPk = __ccgo_ts + 1676 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+6724, (*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+6749, (*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 + 30595 + zPk = __ccgo_ts + 30650 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30608 + v2 = __ccgo_ts + 30663 } else { v2 = __ccgo_ts + 1676 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30618, 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 + 15158 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30673, 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 + 15183 goto _1 _1: ; @@ -186042,17 +186491,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+30645, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30700, 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+6724, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 30652 + v3 = __ccgo_ts + 30707 } else { v3 = __ccgo_ts + 1676 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30667, 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+6724, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30722, 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+6749, 0, 0)) } } @@ -186078,7 +186527,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+30699, 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+30754, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -186124,7 +186573,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+30756) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30811) } 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)) @@ -186293,7 +186742,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+30822, libc.VaList(bp+40, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30877, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -186310,18 +186759,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+6724, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6724, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30842, 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+6724, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30897, 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+6749, 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+30907, 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+30962, 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+30943, 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+30998, 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 { @@ -186336,26 +186785,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 30977 + v2 = __ccgo_ts + 31032 } else { - v2 = __ccgo_ts + 30981 + v2 = __ccgo_ts + 31036 } v1 = v2 } else { v1 = __ccgo_ts + 1676 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30987, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31042, 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+31048, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31103, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 30977 + v3 = __ccgo_ts + 31032 } else { - v3 = __ccgo_ts + 30981 + v3 = __ccgo_ts + 31036 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31109, 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+31164, 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 { @@ -186374,8 +186823,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+6735) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6731) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6760) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6756) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ @@ -186384,39 +186833,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 + 1676 } else { - v4 = __ccgo_ts + 31268 + v4 = __ccgo_ts + 31323 } 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 + 31277 + v5 = __ccgo_ts + 31332 } else { v5 = __ccgo_ts + 1676 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31287, 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+31342, 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+31323, 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+31378, 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 + 1676 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 31351 + zRbuRowid = __ccgo_ts + 31406 } /* 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 + 31363 + v6 = __ccgo_ts + 31418 } else { v6 = __ccgo_ts + 1676 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31380, 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+31456, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31435, 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+31511, 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+31755, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31810, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -186427,9 +186876,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 + 31854 + v7 = __ccgo_ts + 31909 } else { - v7 = __ccgo_ts + 31864 + v7 = __ccgo_ts + 31919 } zRbuRowid1 = v7 } @@ -186442,14 +186891,14 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29911, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29966, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1676, __ccgo_ts+15158, __ccgo_ts+1676) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1676, __ccgo_ts+15183, __ccgo_ts+1676) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 31875 + v8 = __ccgo_ts + 31930 } else { v8 = __ccgo_ts + 1676 } @@ -186459,11 +186908,11 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 v9 = __ccgo_ts + 1676 } if zOrder != 0 { - v10 = __ccgo_ts + 23499 + v10 = __ccgo_ts + 23571 } else { v10 = __ccgo_ts + 1676 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31881, 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+31936, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -186551,9 +187000,9 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p if zSet != 0 { zPrefix = __ccgo_ts + 1676 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 31268 + zPrefix = __ccgo_ts + 31323 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31929, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31984, 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 } @@ -186580,7 +187029,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+3873, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -186627,7 +187076,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+31959, 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+32014, 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): @@ -186686,27 +187135,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+6724, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6749, 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+6724) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+31989, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6749) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32044, 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+32017, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+48, __ccgo_ts+3496, uint64(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32072, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+3522, uint64(4)) } else { - libc.Xmemcpy(tls, p+48, __ccgo_ts+6724, uint64(4)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+6749, uint64(4)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32035, libc.VaList(bp+8, p+48)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32090, 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+6724, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6749, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -186739,10 +187188,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+32101, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32156, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24842, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24914, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*uint8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186758,14 +187207,14 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) if zExtra == uintptr(0) { v2 = __ccgo_ts + 1676 } else { - v2 = __ccgo_ts + 32133 + v2 = __ccgo_ts + 32188 } if zExtra == uintptr(0) { v3 = __ccgo_ts + 1676 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32135, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6724), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32190, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6749), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -186776,27 +187225,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+32167, -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+32222, -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+32182, 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+32237, 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+32199, -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+32254, -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+6724, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32215, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32270, 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+6724, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749, 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+32243, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32298, 0) } } @@ -186882,7 +187331,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { if pState == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32215, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32270, uintptr(0), uintptr(0), uintptr(0)) } } /* Assuming no error has occurred, run a "restart" checkpoint with the @@ -186915,7 +187364,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CAPTURE) - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32261, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32316, uintptr(0), uintptr(0), uintptr(0)) if rc2 != int32(SQLITE_NOTICE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -186978,7 +187427,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) } @@ -187048,16 +187497,16 @@ 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+6724, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6749, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+6724, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6749, 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)) 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) } - Xsqlite3_file_control(tls, db, __ccgo_ts+6724, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6749, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+6724, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6749, 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)) @@ -187079,7 +187528,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+32296, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32351, 0) } // C documentation @@ -187096,13 +187545,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+6724) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6724) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6749) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32321, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32328, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32376, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32383, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -187234,7 +187683,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+24399, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24471, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -187370,7 +187819,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+32335) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32390) 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 @@ -187383,7 +187832,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+32357, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32412, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -187410,7 +187859,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+32384, 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+32439, 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))) @@ -187446,9 +187895,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+32544, 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+32599, 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+32559, 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+32614, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -187471,9 +187920,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+32579, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32634, 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+32604) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32659) } 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) @@ -187484,10 +187933,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+32712) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32767) } 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+32777) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32832) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -187505,7 +187954,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+32821, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32876, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -187532,8 +187981,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+17832) - _rbuCopyPragma(tls, p, __ccgo_ts+16943) + _rbuCopyPragma(tls, p, __ccgo_ts+17904) + _rbuCopyPragma(tls, p, __ccgo_ts+17015) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -187541,7 +187990,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+32846, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32901, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -187563,10 +188012,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+15062, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15087, 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+15062, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15087, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -187653,7 +188102,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+32874, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32929, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -187676,10 +188125,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+32321, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+32376, 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+6724, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749, 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) } @@ -187701,7 +188150,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+32899, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32954, 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) @@ -187748,7 +188197,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+32910, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32965, 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 { @@ -187793,11 +188242,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+32982, 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+33037, 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+32996) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33051) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187806,7 +188255,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+33053) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33108) 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) @@ -187854,7 +188303,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+3873, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3899, 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 @@ -187886,7 +188335,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+33127, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33182, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187908,17 +188357,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 + 33159 + v3 = __ccgo_ts + 33214 } else { - v3 = __ccgo_ts + 33166 + v3 = __ccgo_ts + 33221 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33173, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33228, 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+15047, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15072, 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) @@ -187930,21 +188379,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+17546) - _rbuCopyPragma(tls, p, __ccgo_ts+16958) + _rbuCopyPragma(tls, p, __ccgo_ts+17618) + _rbuCopyPragma(tls, p, __ccgo_ts+17030) } /* 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+33205, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33260, 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+6724, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6749, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33221, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33276, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -188022,7 +188471,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+33245, zState+uintptr(n-uint64(7)), uint64(7)) { + if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33300, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -188069,7 +188518,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+31268, uint64(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31323, 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++ @@ -188097,7 +188546,7 @@ 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+15062, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15087, 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) { @@ -188106,7 +188555,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { } _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+15062, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15087, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -188116,7 +188565,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+33253, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33308, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -188217,7 +188666,7 @@ 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+15062, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15087, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ @@ -188230,19 +188679,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { 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+15062, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15087, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 15047 + v1 = __ccgo_ts + 15072 } else { - v1 = __ccgo_ts + 33205 + v1 = __ccgo_ts + 33260 } 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+33205, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33260, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -188728,7 +189177,7 @@ func _rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileSize})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, pSize) /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existence of a *-wal file. rbuVfsRead() contains ** similar logic. */ if rc == SQLITE_OK && *(*Tsqlite_int64)(unsafe.Pointer(pSize)) == 0 && (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpRbu)).FzTarget == uintptr(0) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_MAIN_DB) != 0 { *(*Tsqlite_int64)(unsafe.Pointer(pSize)) = int64(1024) @@ -188809,7 +189258,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xControl})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, int32(SQLITE_FCNTL_ZIPVFS), bp) if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33280, 0) + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33335, 0) } else { if rc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p @@ -188835,7 +189284,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r if rc == SQLITE_OK && op == int32(SQLITE_FCNTL_VFSNAME) { pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs zIn = *(*uintptr)(unsafe.Pointer(pArg)) - zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33303, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33358, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -189030,7 +189479,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag if pDb != 0 { if (*Trbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == int32(RBU_STAGE_OAL) { if (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) { - zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6724) + zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6749) zOpen = Xsqlite3_filename_wal(tls, zOpen) } nOpen = libc.Xstrlen(tls, zOpen) @@ -189044,7 +189493,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag } else { (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu } - if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33314, 0) != 0 { + if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33369, 0) != 0 { oflags = libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) } @@ -189600,7 +190049,7 @@ func _statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint _sqlite3TokenInit(tls, bp, *(*uintptr)(unsafe.Pointer(argv + 3*8))) iDb = _sqlite3FindDb(tls, db, bp) if iDb < 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12391, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12416, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) return int32(SQLITE_ERROR) } } else { @@ -189912,7 +190361,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { _sqlite3BtreeEnter(tls, pBt) nUsable = szPage - _sqlite3BtreeGetReserveNoMutex(tls, pBt) _sqlite3BtreeLeave(tls, pBt) - (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32)) + (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32))) if (*TStatPage)(unsafe.Pointer(p)).FaCell == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -189959,7 +190408,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } (*TStatCell)(unsafe.Pointer(pCell)).FnLastOvfl = libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp)) - libc.Uint32FromInt32(nLocal) - libc.Uint32FromInt32((nOvfl-int32(1))*(nUsable-int32(4)))) (*TStatCell)(unsafe.Pointer(pCell)).FnOvfl = nOvfl - (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(4)*libc.Uint64FromInt32(nOvfl)) + (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(uint64(4)*libc.Uint64FromInt32(nOvfl))) if (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -190100,7 +190549,7 @@ statNextRestart: (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiPgno = iRoot (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33325, 0) + v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33380, 0) z = v1 (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FzPath = v1 if z == uintptr(0) { @@ -190138,8 +190587,8 @@ statNextRestart: if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { (*TStatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33327 - v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33336, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33382 + v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33391, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) z = v2 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v2 if z == uintptr(0) { @@ -190168,7 +190617,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage++ if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226029)) + return _sqlite3CorruptError(tls, int32(227304)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -190179,7 +190628,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+33348, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33403, 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) { @@ -190202,13 +190651,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33356 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33411 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33365 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33420 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33370 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33425 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -190217,7 +190666,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+3873, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -190306,12 +190755,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+33380, 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+33435, 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+33535, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33590, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33549, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33604, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -190388,7 +190837,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+33564, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+33619, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -191589,7 +192038,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) { @@ -191682,11 +192131,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+11782, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11807, 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+33571, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33626, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1676, 0) @@ -191695,7 +192144,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33701, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33756, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191721,10 +192170,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+29911)) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, __ccgo_ts+29966))) 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) @@ -191745,8 +192194,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+29911) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29911, nName+uint64(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+29966) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29966, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191810,7 +192259,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 @@ -191827,6 +192276,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 { @@ -191848,12 +192299,12 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11782, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11807, (*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))) } } } @@ -192143,10 +192594,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 + 11402 + zSep = __ccgo_ts + 11427 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33731, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33786, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -192158,8 +192609,8 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin v2 = __ccgo_ts + 1677 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5154, libc.VaList(bp+32, zSep, zDflt)) - zSep = __ccgo_ts + 15158 + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5180, libc.VaList(bp+32, zSep, zDflt)) + zSep = __ccgo_ts + 15183 goto _1 _1: ; @@ -192813,8 +193264,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+33738, 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 + 22243 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33793, 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 + 22315 if zRet == uintptr(0) { break } @@ -192843,8 +193294,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+33772, 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 + 33813 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33827, 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 + 33868 if zRet == uintptr(0) { break } @@ -192855,7 +193306,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1796, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1822, 0) } return zRet } @@ -192866,12 +193317,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 + 33818 + v1 = __ccgo_ts + 33873 } else { - v1 = __ccgo_ts + 6729 + v1 = __ccgo_ts + 6754 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33829, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33884, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192932,11 +193383,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15158 + v2 = __ccgo_ts + 15183 } else { v2 = __ccgo_ts + 1676 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33908, 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+33963, 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 } @@ -192964,7 +193415,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+33927, 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+33982, 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 { @@ -192993,17 +193444,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)) @@ -193016,7 +193468,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 } @@ -193027,18 +193481,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+34039, 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+34070, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -193064,7 +193544,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+33984, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34091, 0) } rc = int32(SQLITE_SCHEMA) } @@ -193112,7 +193592,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) } @@ -193396,7 +193876,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+5216, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5242, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -193696,12 +194176,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+34011, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11782, zTab) { - _sessionAppendStr(tls, bp+24, __ccgo_ts+34015, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+34039, bp) - _sessionAppendStr(tls, bp+56, __ccgo_ts+34048, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34093, bp) + _sessionAppendStr(tls, bp+24, __ccgo_ts+34118, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11807, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34122, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34146, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34155, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34200, bp) } else { i = 0 for { @@ -193709,17 +194189,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+15158, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15183, 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 + 15158 + zSep = __ccgo_ts + 15183 _sessionAppendIdent(tls, bp+40, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) - _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34107, libc.VaList(bp+80, i+int32(1))) + _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34214, libc.VaList(bp+80, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34111, 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+34218, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -193733,7 +194213,7 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt } else { v2 = __ccgo_ts + 1676 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34138, 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+34245, 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) } @@ -193875,7 +194355,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, 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+34180, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34287, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193981,7 +194461,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+34200, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34307, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -194236,13 +194716,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 } } @@ -194398,7 +194879,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(230285)) + rc = _sqlite3CorruptError(tls, int32(231591)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -194422,7 +194903,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(230305)) + rc = _sqlite3CorruptError(tls, int32(231611)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -194437,7 +194918,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(230315)) + rc = _sqlite3CorruptError(tls, int32(231621)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -194493,7 +194974,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(230363)) + rc = _sqlite3CorruptError(tls, int32(231669)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -194598,7 +195079,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(230451)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231757)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -194669,8 +195150,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) @@ -194704,7 +195185,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(230537)) + v7 = _sqlite3CorruptError(tls, int32(231843)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194714,7 +195195,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(230543)) + v10 = _sqlite3CorruptError(tls, int32(231849)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194793,7 +195274,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(230587)) + v16 = _sqlite3CorruptError(tls, int32(231893)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -195131,7 +195612,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 @@ -195203,7 +195684,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230952)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232258)) goto finished_invert } if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { @@ -195406,7 +195887,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+11782) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11807) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -195415,9 +195896,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+34218, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34325, bp) _sessionAppendIdent(tls, bp+8, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34231, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34338, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -195427,9 +195908,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+34237, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34344, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15158 + zSep = __ccgo_ts + 15183 } goto _2 _2: @@ -195438,7 +195919,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } /* Create the WHERE clause part of the UPDATE */ zSep = __ccgo_ts + 1676 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34242, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34349, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -195447,13 +195928,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+34250, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34357, bp) } else { _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34325, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34432, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22243 + zSep = __ccgo_ts + 22315 } goto _3 _3: @@ -195540,9 +196021,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+34331, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34438, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34242, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34349, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -195552,9 +196033,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+34237, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34344, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22243 + zSep = __ccgo_ts + 22315 } goto _1 _1: @@ -195562,9 +196043,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+34349, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34456, bp) _sessionAppendInteger(tls, bp+8, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+33813, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+33868, bp) zSep = __ccgo_ts + 1676 i = 0 for { @@ -195574,16 +196055,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+34325, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34432, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34357 + zSep = __ccgo_ts + 34464 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5184, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5210, 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)) @@ -195609,7 +196090,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+6724, 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+6749, 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 @@ -195632,16 +196113,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+34362, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34469, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22249, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22321, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15158, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15183, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -195649,19 +196130,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34380, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34487, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34391, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34498, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5184, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5210, 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)) } @@ -195684,12 +196165,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+11782, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+11807, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34395) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34502) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34508) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34615) } return rc } @@ -195755,7 +196236,7 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231434)) + rc = _sqlite3CorruptError(tls, int32(232740)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -196171,7 +196652,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34652, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34759, 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)) @@ -196184,7 +196665,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34673, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34780, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -196284,10 +196765,10 @@ 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+34692, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34799, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34718, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34825, 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)) @@ -196318,7 +196799,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui ** 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)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3873, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -196328,7 +196809,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+6724, *(*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+6749, *(*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 } @@ -196347,18 +196828,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+34748, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34855, 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+34792, 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+34899, 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+34863, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34970, 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+11782) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11807) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -196415,17 +196896,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34923, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35030, 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+34953, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35060, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+34977, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+34953, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35084, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35060, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -196539,7 +197020,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) } @@ -196909,7 +197390,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) } @@ -197201,7 +197682,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+3873, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -197237,11 +197718,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 @@ -197826,6 +198313,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 @@ -197871,8 +198359,7 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset @@ -197884,12 +198371,13 @@ type Fts5Colset = TFts5Colset ** This object is used by fts5_expr.c and fts5_index.c. */ type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 + FnCol 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 ** to parse the arguments passed to the CREATE VIRTUAL TABLE statement. @@ -198266,7 +198754,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -198294,16 +198781,14 @@ 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 @@ -198345,7 +198830,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 @@ -199149,7 +199634,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+35005, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35112, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -199505,7 +199990,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+35033, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35140, 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 */ } @@ -199789,7 +200274,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+35064, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35171, 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) } @@ -199888,7 +200373,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 + 35071 + zErr = __ccgo_ts + 35178 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199976,7 +200461,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) } @@ -200143,7 +200628,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 + 35121 + zErr = __ccgo_ts + 35228 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200414,7 +200899,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))) @@ -200506,13 +200991,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) } @@ -200538,13 +201023,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 + 35169 + z = __ccgo_ts + 35276 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 + 35225 + z1 = __ccgo_ts + 35332 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -200577,19 +201062,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35283, + FzFunc: __ccgo_ts + 35390, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35291, + FzFunc: __ccgo_ts + 35398, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35301, + FzFunc: __ccgo_ts + 35408, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35306, + FzFunc: __ccgo_ts + 35413, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200977,7 +201462,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 @@ -201453,7 +201938,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+35322, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35429, 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) { @@ -201479,12 +201964,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+35329, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35436, 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+35360, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35467, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201493,7 +201978,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+35393, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35500, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201503,14 +201988,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35430, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35537, 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+35439, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35546, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -201537,7 +202022,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+35472, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35579, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -201549,76 +202034,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+35506, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35613, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35514, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35621, 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+35546, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35653, 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+35552, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35659, 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+35571, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35678, 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+35614, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35721, 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+35571, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35678, 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+35636, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35743, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35650, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35757, 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+35688, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35795, 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+35699, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35806, 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+35734, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35841, 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+35741, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35848, 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+5593, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+5619, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 8)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 8418, + FzName: __ccgo_ts + 8443, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 17912, + FzName: __ccgo_ts + 17984, }, 2: { - FzName: __ccgo_ts + 35772, + FzName: __ccgo_ts + 35879, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -201626,20 +202111,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+35780, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35887, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35811, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35918, 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+35821, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35928, 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+35855, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35962, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201700,16 +202185,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+35883) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16859) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35888, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+35990) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16931) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35995, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+35918) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+36025) { *(*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+35928, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36035, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201735,7 +202220,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+35959, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36066, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201743,12 +202228,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+35964, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36071, 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+35971, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36078, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35979, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36086, 0) } } goto _1 @@ -201764,9 +202249,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+35986, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36093, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35979, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36086, 0) } goto _2 _2: @@ -201829,8 +202314,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+35883) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35994, 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+35990) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36101, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201861,7 +202346,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+36023, libc.VaList(bp+40, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36130, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -201891,7 +202376,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+36043, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36150, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201899,37 +202384,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+36093, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36200, 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+36148, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36255, 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 + 35506 + zTail = __ccgo_ts + 35613 } 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 + 35506 + zTail = __ccgo_ts + 35613 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36201 + zTail = __ccgo_ts + 36308 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36209, 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+36316, 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+16859, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16931, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201998,7 +202483,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+36220, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36327, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -202007,16 +202492,16 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { if i == 0 { v2 = __ccgo_ts + 1676 } else { - v2 = __ccgo_ts + 15158 + v2 = __ccgo_ts + 15183 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36236, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36343, 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+36243, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35883)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36350, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35990)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -202174,7 +202659,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+36269) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36376) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -202185,7 +202670,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+36274) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36381) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -202196,7 +202681,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+36283) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36390) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -202210,7 +202695,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+36293) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36400) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -202221,7 +202706,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+36303) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36410) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -202238,7 +202723,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+36315) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36422) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -202253,7 +202738,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+35883) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35990) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -202268,7 +202753,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36327) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36434) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -202284,7 +202769,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+36341) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36448) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -202327,7 +202812,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 + 36351 + zSelect = __ccgo_ts + 36458 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -202347,7 +202832,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+36383) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36490) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -202358,7 +202843,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+36391, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36498, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -202462,11 +202947,12 @@ type TFts5ExprNode1 = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode1 = TFts5ExprNode1 +/* Size (in bytes) of an Fts5ExprNode object that holds up to N children */ + /* ** 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. @@ -202496,24 +202982,26 @@ type TFts5ExprPhrase1 = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase1 = TFts5ExprPhrase1 +/* Size (in bytes) of an Fts5ExprPhrase object that holds up to N terms */ + /* ** 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 + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset1 = TFts5ExprNearset1 +/* Size (in bytes) of an Fts5ExprNearset object covering up to N phrases */ + /* ** Parse context. */ @@ -202604,7 +203092,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+36462, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36569, 0) return FTS5_EOF } goto _1 @@ -202615,7 +203103,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+36482, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36589, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -202630,13 +203118,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+36513, uint64(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36620, 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+36516, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36623, 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+30977, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31032, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -202680,7 +203168,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) @@ -204319,7 +204807,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) @@ -204329,7 +204817,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) @@ -204435,12 +204923,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 @@ -204574,7 +205062,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) @@ -204614,15 +205102,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)) @@ -204663,7 +205151,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 { @@ -204701,8 +205189,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+36520, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35033, 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+36627, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35140, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204722,10 +205210,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+36525, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36632, 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: ; @@ -204759,7 +205250,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 { @@ -204809,7 +205300,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 @@ -204860,7 +205351,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+21246, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21318, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204887,7 +205378,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)) @@ -204984,7 +205475,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+36554, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36661, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -205069,7 +205560,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) @@ -205082,7 +205573,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) @@ -205156,7 +205647,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 @@ -205182,11 +205673,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 + 36607 + v2 = __ccgo_ts + 36714 } else { - v2 = __ccgo_ts + 36520 + v2 = __ccgo_ts + 36627 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36614, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36721, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -205199,7 +205690,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+36664, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36771, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -205343,7 +205834,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 @@ -205676,7 +206167,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) { @@ -205740,7 +206231,7 @@ 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 +** to accumulate "term -> doclist" content before it is flushed to a level-0 ** segment. */ @@ -205799,7 +206290,7 @@ type TFts5HashEntry1 = struct { type Fts5HashEntry1 = TFts5HashEntry1 /* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -205937,7 +206428,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) } @@ -206249,7 +206740,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) } @@ -206681,9 +207172,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 @@ -206720,7 +207211,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206793,7 +207283,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206828,7 +207317,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206843,9 +207331,9 @@ 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 @@ -206942,11 +207430,12 @@ type TFts5Structure1 = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure1 = TFts5Structure1 +/* Size (in bytes) of an Fts5Structure object holding up to N levels */ + /* ** An object of type Fts5SegWriter is used to write to segments. */ @@ -207079,13 +207568,15 @@ type Fts5SegIter1 = TFts5SegIter1 ** Array of tombstone pages. Reference counted. */ type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray1 = TFts5TombstoneArray1 +/* Size (in bytes) of an Fts5TombstoneArray holding up to N tombstones */ + /* ** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. @@ -207138,11 +207629,12 @@ type TFts5Iter1 = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter1 = TFts5Iter1 +/* Size (in bytes) of an Fts5Iter object holding up to N segment iterators */ + /* ** An instance of the following type is used to iterate through the contents ** of a doclist-index record. @@ -207168,13 +207660,15 @@ type TFts5DlidxLvl1 = struct { type Fts5DlidxLvl1 = TFts5DlidxLvl1 type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } 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)) *(*Tu8)(unsafe.Pointer(aOut + 1)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) & libc.Int32FromInt32(0xFF)) @@ -207353,7 +207847,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+36717, 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+36824, 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. @@ -207458,7 +207952,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+36723, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36830, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -207487,7 +207981,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+36774, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36881, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -207521,7 +208015,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+36823, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36930, 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) @@ -207599,7 +208093,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)) @@ -207690,7 +208184,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+36863, uint64(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36970, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207701,7 +208195,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+36863, uint64(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36970, 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)) @@ -208382,7 +208876,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) @@ -208632,7 +209126,7 @@ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _ = nByte, nTomb, pNew nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(nTomb+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) if pNew != 0 { (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb @@ -208736,7 +209230,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 @@ -209342,7 +209836,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+36891, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+36998, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -209431,7 +209925,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+36975, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+37082, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -210078,7 +210572,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 @@ -210988,7 +211482,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 { @@ -211402,7 +211896,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+37057, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37164, 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. */ @@ -211908,7 +212402,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+37114, 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+37221, 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) @@ -212077,7 +212571,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 } @@ -212395,7 +212889,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+37175, 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+37282, 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))) @@ -212670,7 +213164,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: @@ -212705,7 +213199,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)) @@ -213319,11 +213813,12 @@ type TFts5TokenDataIter1 = struct { 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 // // /* @@ -213391,7 +213886,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) { @@ -213635,7 +214130,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) @@ -213685,7 +214180,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 @@ -213767,15 +214262,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+1676, 0) - _fts5StructureWrite(tls, p, bp) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -213801,11 +214299,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+37226, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37333, 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+26012, __ccgo_ts+37234, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26067, __ccgo_ts+37341, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+11993, __ccgo_ts+37269, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12018, __ccgo_ts+37376, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -214003,7 +214501,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) @@ -214258,7 +214756,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+37313) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37420) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -214609,7 +215107,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') @@ -214731,7 +215229,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 { @@ -214851,7 +215349,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+36717, 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+36824, 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))) @@ -215445,7 +215943,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+37315, 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+37422, 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)) @@ -215676,7 +216174,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+37401) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37508) 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)) @@ -215815,7 +216313,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215972,11 +216469,12 @@ type TFts5Sorter1 = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter1 = TFts5Sorter1 +/* Size (int bytes) of an Fts5Sorter object with N indexes */ + /* ** Virtual-table cursor object. ** @@ -216298,7 +216796,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+37406, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37513, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -216335,7 +216833,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+5216, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5242, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ @@ -216354,7 +216852,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+5216, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5242, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons @@ -216804,7 +217302,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+3873, 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+3899, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -216832,7 +217330,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+3873, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3899, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -216852,7 +217350,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) @@ -216867,7 +217365,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 + 15158 + v1 = __ccgo_ts + 15183 } else { v1 = __ccgo_ts + 1676 } @@ -216877,11 +217375,11 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int v2 = __ccgo_ts + 1676 } if bDesc != 0 { - v3 = __ccgo_ts + 37445 + v3 = __ccgo_ts + 37552 } else { - v3 = __ccgo_ts + 37450 + v3 = __ccgo_ts + 37557 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37454, 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+37561, 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 @@ -216939,14 +217437,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+37509, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37616, 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+5575, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5601, 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+37515, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37622, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216996,7 +217494,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+37543, libc.VaList(bp+24, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37650, 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)) @@ -217029,7 +217527,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+37553, libc.VaList(bp+24, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37660, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -217063,7 +217561,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+37574, libc.VaList(bp+24, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37681, libc.VaList(bp+24, z)) } } } else { @@ -217071,7 +217569,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 + 35301 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35408 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -217228,7 +217726,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+37607, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37714, 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))) } @@ -217428,7 +217926,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+37612, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37719, 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 @@ -217561,10 +218059,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. @@ -220100,12 +220598,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+38961, 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+39068, 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+39065, 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+39172, 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+39103, 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+39210, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -220114,7 +220612,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+39141, 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+39248, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -220126,14 +220624,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+26012, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+11993, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38295, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26067, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12018, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38402, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36201, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36308, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35506, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35613, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -220153,13 +220651,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 + 30652 + v1 = __ccgo_ts + 30707 } else { v1 = __ccgo_ts + 1676 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39183, 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+39290, 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+39213, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39320, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -220200,7 +220698,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+39257, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39364, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -220208,7 +220706,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+39280, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39387, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -220223,7 +220721,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+39286, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39393, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -220232,22 +220730,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35506, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35613, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39292 + zCols = __ccgo_ts + 39399 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39324 + zCols = __ccgo_ts + 39431 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36201, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36308, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38295, __ccgo_ts+39372, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38402, __ccgo_ts+39479, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36383, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36490, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -220667,12 +221165,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+39389, 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+39496, 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+39439, 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+39546, 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+39468, 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+39575, 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. */ @@ -220680,7 +221178,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+36383, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36490, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220982,7 +221480,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+39497, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39604, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -221112,7 +221610,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) } @@ -221214,14 +221712,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+35506, bp+80) + rc = _fts5StorageCount(tls, p, __ccgo_ts+35613, 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 @@ -221873,11 +222371,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 + 39551 + zCat = __ccgo_ts + 39658 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) } @@ -221887,7 +222385,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+39560) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39667) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -221904,20 +222402,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+39571) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39678) { 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+39529) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39636) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, int32(1)) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39540) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39647) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, 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+39667) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -222209,7 +222707,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 + 39589 + zBase = __ccgo_ts + 39696 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -222426,64 +222924,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+39599, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39706, 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+39602, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39709, 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+39607, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39714, 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+39612, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39719, 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+39615, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39722, 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+39618, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39725, 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+39623, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39730, 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+39628, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39735, 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+39632, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39739, 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+39638, 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(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+39750, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222492,49 +222990,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+39647, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39754, 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+39651, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39758, 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+39654, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39761, 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+39658, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39765, 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+39662, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39769, 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+39666, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39773, 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+39670, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39777, 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+39674, 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) } @@ -222551,20 +223049,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+39678, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39658, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39785, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39765, 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+39681, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39684, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39788, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39791, 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+39688, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39674, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39795, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39781, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -222580,75 +223078,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+39691, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39798, 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+39658, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39765, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39699, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39806, 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+39706, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39813, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39711, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39818, 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+39607, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39714, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39716, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39823, 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(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39709, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39721, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39828, 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+39674, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39781, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - 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+39833, 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+16061, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16133, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39731, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39838, 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+39684, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39791, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } 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+39842, 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+39599, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39706, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39740, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39847, 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+39643, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39750, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39746, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39853, 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+39750, uint64(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39857, uint64(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39752, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39859, 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+39773, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -222657,48 +223155,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+39758, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39865, 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+39674, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39781, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - 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+39873, 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+39658, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39765, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39772, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39879, 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+39658, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39765, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39777, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39884, 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+39599, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39706, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39783, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39890, 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+39777, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39791, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39898, 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+39799, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39906, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39803, 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+39773, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222706,21 +223204,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+39811, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39918, 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+39599, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39706, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39817, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39924, 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+39670, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39777, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39823, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39930, 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+39684, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39791, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222738,48 +223236,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+39830, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39937, 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+39615, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39722, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39835, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39942, 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+39840, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39947, 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+39615, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39722, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39846, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39953, 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+39615, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39722, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39799, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39906, 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+39852, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39959, 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+39858, 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+39599, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39706, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222795,13 +223293,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+39864, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39971, 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+39868, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39975, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39871, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39978, 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) @@ -222809,7 +223307,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+39874, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39981, 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) @@ -222974,14 +223472,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+39878) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39985) { 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+39571) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39678) { 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 { @@ -223249,7 +223747,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+39893)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+40000)) } // C documentation @@ -223275,7 +223773,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39589, + FzName: __ccgo_ts + 39696, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -223283,7 +223781,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39901, + FzName: __ccgo_ts + 40008, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -223291,7 +223789,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39893, + FzName: __ccgo_ts + 40000, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -223321,7 +223819,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+39907, 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+40014, pApi, bp+96, uintptr(0)) } return rc } @@ -228837,16 +229335,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+39914) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40021) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39918) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40025) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39922) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40029) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39931, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40038, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228909,21 +229407,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 + 39965, - 1: __ccgo_ts + 40005, - 2: __ccgo_ts + 40040, + 0: __ccgo_ts + 40072, + 1: __ccgo_ts + 40112, + 2: __ccgo_ts + 40147, } 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+23988, *(*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+24060, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40083, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40190, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228944,23 +229443,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) } @@ -229093,10 +229592,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+40116, 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+40223, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40147, 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+40254, 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)) } @@ -229115,7 +229614,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+40198, 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+40305, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -229565,7 +230064,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+40224, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40331, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -229620,7 +230119,7 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 40234 + return __ccgo_ts + 40341 } type TAggInfo_col = struct { @@ -229850,7 +230349,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 @@ -229898,11 +230397,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]uint8{'3', '.', '4', '9', '.', '1'} +var Xsqlite3_version = [7]uint8{'3', '.', '5', '0', '.', '1'} 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_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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\x00" +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_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\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods @@ -229912,3 +230411,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_riscv64.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_riscv64.go index 871b586..debbdfb 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_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 @@ -613,7 +615,7 @@ const F_TLOCK = 2 const F_ULOCK = 0 const F_UNLCK = 2 const F_WRLCK = 1 -const GCC_VERSION = 14002000 +const GCC_VERSION = 11004000 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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70" +const SQLITE_SOURCE_ID = "2025-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95" 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.1" -const SQLITE_VERSION_NUMBER = 3049001 +const SQLITE_VERSION = "3.50.1" +const SQLITE_VERSION_NUMBER = 3050001 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3138,7 +3144,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_IS_IEC_60559__ = 2 const __DBL_MANT_DIG__ = 53 const __DBL_MAX_10_EXP__ = 308 const __DBL_MAX_EXP__ = 1024 @@ -3156,7 +3162,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_IS_IEC_60559__ = 2 const __FLT128_MANT_DIG__ = 113 const __FLT128_MAX_10_EXP__ = 4932 const __FLT128_MAX_EXP__ = 16384 @@ -3165,22 +3171,6 @@ const __FLT128_MIN_10_EXP__ = -4931 const __FLT128_MIN_EXP__ = -16381 const __FLT128_MIN__ = 0 const __FLT128_NORM_MAX__ = 0 -const __FLT16_DECIMAL_DIG__ = 5 -const __FLT16_DENORM_MIN__ = 0 -const __FLT16_DIG__ = 3 -const __FLT16_EPSILON__ = 0 -const __FLT16_HAS_DENORM__ = 1 -const __FLT16_HAS_INFINITY__ = 1 -const __FLT16_HAS_QUIET_NAN__ = 1 -const __FLT16_IS_IEC_60559__ = 1 -const __FLT16_MANT_DIG__ = 11 -const __FLT16_MAX_10_EXP__ = 4 -const __FLT16_MAX_EXP__ = 16 -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 __FLT32X_DECIMAL_DIG__ = 17 const __FLT32X_DENORM_MIN__ = 0 const __FLT32X_DIG__ = 15 @@ -3188,7 +3178,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_IS_IEC_60559__ = 2 const __FLT32X_MANT_DIG__ = 53 const __FLT32X_MAX_10_EXP__ = 308 const __FLT32X_MAX_EXP__ = 1024 @@ -3204,7 +3194,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_IS_IEC_60559__ = 2 const __FLT32_MANT_DIG__ = 24 const __FLT32_MAX_10_EXP__ = 38 const __FLT32_MAX_EXP__ = 128 @@ -3220,7 +3210,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_IS_IEC_60559__ = 2 const __FLT64X_MANT_DIG__ = 113 const __FLT64X_MAX_10_EXP__ = 4932 const __FLT64X_MAX_EXP__ = 16384 @@ -3236,7 +3226,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_IS_IEC_60559__ = 2 const __FLT64_MANT_DIG__ = 53 const __FLT64_MAX_10_EXP__ = 308 const __FLT64_MAX_EXP__ = 1024 @@ -3254,7 +3244,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_IS_IEC_60559__ = 2 const __FLT_MANT_DIG__ = 24 const __FLT_MAX_10_EXP__ = 38 const __FLT_MAX_EXP__ = 128 @@ -3270,31 +3260,28 @@ const __FP_FAST_FMAF32 = 1 const __FP_FAST_FMAF32x = 1 const __FP_FAST_FMAF64 = 1 const __FUNCTION__ = 0 -const __GCC_ATOMIC_BOOL_LOCK_FREE = 2 -const __GCC_ATOMIC_CHAR16_T_LOCK_FREE = 2 +const __GCC_ATOMIC_BOOL_LOCK_FREE = 1 +const __GCC_ATOMIC_CHAR16_T_LOCK_FREE = 1 const __GCC_ATOMIC_CHAR32_T_LOCK_FREE = 2 -const __GCC_ATOMIC_CHAR_LOCK_FREE = 2 +const __GCC_ATOMIC_CHAR_LOCK_FREE = 1 const __GCC_ATOMIC_INT_LOCK_FREE = 2 const __GCC_ATOMIC_LLONG_LOCK_FREE = 2 const __GCC_ATOMIC_LONG_LOCK_FREE = 2 const __GCC_ATOMIC_POINTER_LOCK_FREE = 2 -const __GCC_ATOMIC_SHORT_LOCK_FREE = 2 +const __GCC_ATOMIC_SHORT_LOCK_FREE = 1 const __GCC_ATOMIC_TEST_AND_SET_TRUEVAL = 1 const __GCC_ATOMIC_WCHAR_T_LOCK_FREE = 2 -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 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_MINOR__ = 4 const __GNUC_PATCHLEVEL__ = 0 const __GNUC_STDC_INLINE__ = 1 const __GNUC_WIDE_EXECUTION_CHARSET_NAME = "UTF-32LE" -const __GNUC__ = 14 -const __GXX_ABI_VERSION = 1019 +const __GNUC__ = 11 +const __GXX_ABI_VERSION = 1016 const __INT16_MAX__ = 32767 const __INT32_MAX__ = 2147483647 const __INT32_TYPE__ = 0 @@ -3330,7 +3317,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_IS_IEC_60559__ = 2 const __LDBL_MANT_DIG__ = 113 const __LDBL_MAX_10_EXP__ = 4932 const __LDBL_MAX_EXP__ = 16384 @@ -3381,6 +3368,7 @@ const __SIZEOF_WINT_T__ = 4 const __SIZE_MAX__ = 18446744073709551615 const __SIZE_WIDTH__ = 64 const __SQLITESESSION_H_ = 1 +const __SSP_STRONG__ = 3 const __STDC_HOSTED__ = 1 const __STDC_IEC_559_COMPLEX__ = 1 const __STDC_IEC_559__ = 1 @@ -3406,7 +3394,7 @@ const __UINT_LEAST32_MAX__ = 4294967295 const __UINT_LEAST64_MAX__ = 18446744073709551615 const __UINT_LEAST8_MAX__ = 255 const __USE_TIME_BITS64 = 1 -const __VERSION__ = "14.2.0" +const __VERSION__ = "11.4.0" const __WCHAR_MAX__ = 2147483647 const __WCHAR_MIN__ = -2147483648 const __WCHAR_TYPE__ = 0 @@ -3423,22 +3411,22 @@ const __pie__ = 2 const __restrict = 0 const __restrict_arr = 0 const __riscv = 1 -const __riscv_a = 2001000 +const __riscv_a = 2000000 const __riscv_arch_test = 1 const __riscv_atomic = 1 const __riscv_c = 2000000 const __riscv_cmodel_medany = 1 +const __riscv_cmodel_pic = 1 const __riscv_compressed = 1 -const __riscv_d = 2002000 +const __riscv_d = 2000000 const __riscv_div = 1 -const __riscv_f = 2002000 +const __riscv_f = 2000000 const __riscv_fdiv = 1 const __riscv_flen = 64 const __riscv_float_abi_double = 1 const __riscv_fsqrt = 1 -const __riscv_i = 2001000 +const __riscv_i = 2000000 const __riscv_m = 2000000 -const __riscv_misaligned_slow = 1 const __riscv_mul = 1 const __riscv_muldiv = 1 const __riscv_xlen = 64 @@ -3458,6 +3446,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 @@ -3467,9 +3458,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 @@ -4369,6 +4357,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. @@ -4725,6 +4719,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 @@ -5157,7 +5152,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -6898,11 +6892,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. */ /* @@ -7276,6 +7276,7 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem @@ -7321,6 +7322,7 @@ type THashElem1 = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem1 = THashElem1 @@ -7471,6 +7473,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. */ @@ -7529,6 +7536,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 @@ -7832,7 +7850,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData = TDbClientData @@ -7902,9 +7919,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 @@ -7919,7 +7936,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -7968,8 +7984,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 @@ -8033,7 +8049,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -8105,19 +8120,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 @@ -8131,11 +8149,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 @@ -8146,40 +8161,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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -8197,7 +8213,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -8209,6 +8225,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -8359,9 +8376,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 @@ -8416,6 +8433,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8596,7 +8614,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8638,7 +8655,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -9208,8 +9224,8 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. +/* Use SQLITE_ENABLE_EXPLAIN_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 @@ -10056,6 +10072,7 @@ type TTable1 = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table1 = TTable1 @@ -10137,11 +10154,13 @@ type TFKey1 = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey1 = TFKey1 +/* The size (in bytes) of an FKey object holding N columns. The answer +** does NOT include space to hold the zTo name. */ + /* ** SQLite supports many different ways to resolve a constraint ** error. ROLLBACK processing means that a constraint violation @@ -10190,11 +10209,12 @@ type TKeyInfo1 = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo1 = TKeyInfo1 +/* The size (in bytes) of a KeyInfo object with up to N fields */ + /* ** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. */ @@ -10596,13 +10616,16 @@ type Expr1 = TExpr1 ** expression. */ type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList1 = TExprList1 +/* The size (in bytes) of an ExprList object that is big enough to hold +** as many as N expressions. */ + /* ** Allowed values for Expr.a.eEName */ @@ -10623,12 +10646,14 @@ type ExprList1 = TExprList1 ** 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 + F__ccgo_align [0]uint64 + FnId int32 } type IdList1 = TIdList1 +/* The size (in bytes) of an IdList object that can hold up to N IDs. */ + /* ** Allowed values for IdList.eType, which determines which value of the a.u4 ** is valid. @@ -10734,13 +10759,19 @@ type OnOrUsing1 = TOnOrUsing1 ** */ type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList1 = TSrcList1 +/* Size (in bytes) of a SrcList object that can hold as many as N +** SrcItem objects. */ + +/* Size (in bytes( of a SrcList object that holds 1 SrcItem. This is a +** special case of SZ_SRCITEM(1) that comes up often. */ + /* ** Permitted values of the SrcList.a.jointype field */ @@ -11101,19 +11132,22 @@ type TParse1 = 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 @@ -11127,11 +11161,8 @@ type TParse1 = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -11142,40 +11173,41 @@ type TParse1 = 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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -11541,11 +11573,13 @@ type TWith1 = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With1 = TWith1 +/* The size (in bytes) of a With object that can hold as many +** as N different CTEs. */ + /* ** The Cte object is not guaranteed to persist for the entire duration ** of code generation. (The query flattener or other parser tree @@ -11575,11 +11609,13 @@ type TDbClientData1 = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData1 = TDbClientData1 +/* The size (in bytes) of a DbClientData object that can has a name +** that is N bytes long, including the zero-terminator. */ + /* ** This object is used in various ways, most (but not all) related to window ** functions. @@ -12745,7 +12781,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12823,7 +12858,6 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor @@ -12861,11 +12895,16 @@ type TVdbeCursor1 = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor1 = TVdbeCursor1 +/* +** The size (in bytes) of a VdbeCursor object that has an nField value of N +** or less. The value of SZ_VDBECURSOR(n) is guaranteed to be a multiple +** of 8. + */ + /* Return true if P is a null-only cursor */ @@ -13076,21 +13115,14 @@ type Tsqlite3_context1 = struct { 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 */ +/* +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. + */ // C documentation // @@ -13223,7 +13255,7 @@ type TPreUpdate1 = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -13235,6 +13267,7 @@ type TPreUpdate1 = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate1 = TPreUpdate1 @@ -13372,7 +13405,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(24453)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13544,7 +13577,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)) @@ -13931,7 +13964,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++ } @@ -14002,10 +14035,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) @@ -14141,7 +14174,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) } } @@ -14238,7 +14271,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) @@ -14379,10 +14412,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+1212, -int32(1)) @@ -14393,7 +14426,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) @@ -14471,7 +14504,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) @@ -14619,7 +14652,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)) @@ -14922,7 +14955,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 } @@ -15079,7 +15112,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('.') @@ -15127,7 +15160,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('.') @@ -15232,7 +15265,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) @@ -15961,7 +15994,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 } @@ -16610,7 +16643,8 @@ func init() { // /* // ** Initialize the mutex system. // */ -func _sqlite3MutexInit(tls *libc.TLS) (r int32) { +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 @@ -18238,17 +18272,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'), @@ -18445,22 +18479,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. */ @@ -18709,11 +18744,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 @@ -18741,7 +18776,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)) @@ -18763,7 +18798,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)) @@ -19190,29 +19225,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) @@ -19327,25 +19340,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 + 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 = 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. @@ -19353,15 +19370,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) { @@ -19372,13 +19389,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) @@ -19392,35 +19442,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 - } - 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 + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + 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++ + } + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 + j1++ + 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) @@ -19445,9 +19558,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: ; @@ -19461,7 +19574,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 { @@ -19471,21 +19584,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: ; @@ -19724,7 +19837,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 @@ -20023,6 +20136,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 // // /* @@ -20040,11 +20155,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)) } @@ -20696,6 +20811,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 // // /* @@ -21446,7 +21592,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 { @@ -21621,7 +21767,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+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 @@ -21833,11 +21979,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 @@ -22073,7 +22219,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)) @@ -22163,7 +22309,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)) { @@ -22390,7 +22536,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 *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -22550,7 +22696,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 + 1787 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1813 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') @@ -22659,7 +22805,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-- } } @@ -23075,7 +23221,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 @@ -23104,7 +23250,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 { @@ -23118,7 +23264,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) @@ -23149,7 +23295,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) { @@ -23500,23 +23646,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 @@ -23571,8 +23715,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)) } @@ -23605,9 +23749,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: ; @@ -23627,13 +23770,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 } @@ -23641,7 +23783,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 @@ -23657,7 +23799,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 { @@ -23669,7 +23811,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 } @@ -23718,7 +23860,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 @@ -23728,20 +23870,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) } @@ -23760,196 +23901,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 Tblksize_t = int32 @@ -24486,91 +24627,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, - }, - 14: { - FzName: __ccgo_ts + 3555, - }, - 15: { - FzName: __ccgo_ts + 3562, - }, - 16: { FzName: __ccgo_ts + 3572, }, + 14: { + FzName: __ccgo_ts + 3581, + }, + 15: { + FzName: __ccgo_ts + 3588, + }, + 16: { + FzName: __ccgo_ts + 3598, + }, 17: { - FzName: __ccgo_ts + 3579, - }, - 18: { - FzName: __ccgo_ts + 3593, - }, - 19: { - FzName: __ccgo_ts + 3599, - }, - 20: { FzName: __ccgo_ts + 3605, }, - 21: { - FzName: __ccgo_ts + 3612, + 18: { + FzName: __ccgo_ts + 3619, }, - 22: { - FzName: __ccgo_ts + 3620, - }, - 23: { + 19: { FzName: __ccgo_ts + 3625, }, - 24: { - FzName: __ccgo_ts + 3632, + 20: { + FzName: __ccgo_ts + 3631, }, - 25: { - FzName: __ccgo_ts + 3639, + 21: { + FzName: __ccgo_ts + 3638, }, - 26: { + 22: { + FzName: __ccgo_ts + 3646, + }, + 23: { FzName: __ccgo_ts + 3651, }, + 24: { + FzName: __ccgo_ts + 3658, + }, + 25: { + FzName: __ccgo_ts + 3665, + }, + 26: { + FzName: __ccgo_ts + 3677, + }, 27: { - FzName: __ccgo_ts + 3660, + FzName: __ccgo_ts + 3686, }, 28: { - FzName: __ccgo_ts + 3666, + FzName: __ccgo_ts + 3692, }, } @@ -24809,9 +24950,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+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+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 } } @@ -25131,7 +25272,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 } @@ -25159,7 +25300,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+3809, 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+3836, 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 } } @@ -25818,7 +25959,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(40995)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -26423,7 +26564,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+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 && libc.Int32FromUint8((*(*[513]uint8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { @@ -26449,7 +26590,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(42576)), __ccgo_ts+3605, bp, int32(42576)) } // C documentation @@ -26486,7 +26627,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)<= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43393)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -27097,7 +27238,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)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44803)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -28098,10 +28238,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 @@ -28110,8 +28250,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 @@ -28173,7 +28313,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+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 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { v1 = iLimit iLimit++ @@ -28345,7 +28485,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) } @@ -28500,7 +28640,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(45251)), __ccgo_ts+3488, zName, int32(45251)) if rc == SQLITE_OK { rc = rc2 } @@ -28577,7 +28717,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(45502)) 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+3651, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45507)), __ccgo_ts+3677, zIn, int32(45507)) return } (*(*[4098]uint8)(unsafe.Pointer(bp + 128)))[got] = uint8(0) @@ -28775,14 +28915,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+3480, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45565)), __ccgo_ts+3506, zPath, int32(45565)) } _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(45571)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<>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) } } @@ -32101,7 +32241,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) - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 0) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -32195,7 +32335,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-- - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 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)) } @@ -32236,7 +32376,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 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 @@ -32364,7 +32504,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 libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g)) + 140) + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -32384,17 +32524,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) } @@ -32412,7 +32554,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 @@ -32424,7 +32566,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) } } @@ -32625,10 +32767,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 @@ -34773,7 +34916,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 @@ -34791,7 +34934,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 } @@ -35364,6 +35507,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 { @@ -36010,7 +36162,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 @@ -36022,7 +36175,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) @@ -36043,11 +36196,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 @@ -36076,7 +36230,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 @@ -36309,7 +36463,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) } @@ -36446,7 +36600,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)) @@ -36462,7 +36616,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)< int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65269)) } 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)) @@ -40569,7 +40723,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 { @@ -41133,9 +41287,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 @@ -41339,6 +41493,11 @@ type WalCkptInfo1 = TWalCkptInfo1 /* ** An open write-ahead log file is represented by an instance of the ** following object. +** +** writeLock: +** This is usually set to 1 whenever the WRITER lock is held. However, +** if it is set to 2, then the WRITER lock is held but must be released +** by walHandleException() if a SEH exception is thrown. */ type TWal1 = struct { FpVfs uintptr @@ -41405,13 +41564,15 @@ type ht_slot = Tht_slot ** This functionality is used by the checkpoint code (see walCheckpoint()). */ type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } 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 ** is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -41469,7 +41630,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) @@ -41481,7 +41642,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) } @@ -41570,6 +41731,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 @@ -42011,7 +42173,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(67209)) } goto _1 _1: @@ -42099,12 +42261,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(67341)) 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 @@ -42238,7 +42400,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 { @@ -42869,7 +43031,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(68150)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -42985,7 +43147,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)) } } @@ -43200,7 +43362,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 { @@ -43226,7 +43395,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(68601)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43949,8 +44118,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)) } @@ -44037,7 +44206,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(69451)) } iKey = _walNextHash(tls, iKey) } @@ -44534,7 +44703,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(69974)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44783,7 +44952,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, /* 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(70234)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -45555,6 +45724,11 @@ type CellInfo1 = TCellInfo1 ** assumed that the database is corrupt. */ +/* +** Maximum amount of storage local to a database page, regardless of +** page size. + */ + /* ** A cursor is a pointer to a particular entry within a particular ** b-tree within a database file. @@ -45921,10 +46095,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) { @@ -45933,14 +46108,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) { @@ -46640,7 +46815,7 @@ 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(72422)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } @@ -46818,7 +46993,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(72620)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46831,12 +47006,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(72633)) 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(72638)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46880,7 +47055,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(72683)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46888,7 +47063,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(72691)) } return SQLITE_OK } @@ -47076,7 +47251,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) } @@ -47109,7 +47284,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) } @@ -47308,7 +47483,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(73136)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -47348,12 +47523,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(73194)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73197)) } 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)) @@ -47361,21 +47536,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(73205)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73208)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73210)) } 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(73214)) } } cbrk = top + sz @@ -47422,12 +47597,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(73247)) } 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(73253)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -47443,7 +47618,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(73267)) } *(*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) @@ -47503,7 +47678,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(73324)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -47520,14 +47695,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(73339)) } 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(73346)) } return uintptr(0) } @@ -47570,11 +47745,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(73394)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73397)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -47588,7 +47763,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(73414)) } else { return SQLITE_OK } @@ -47641,42 +47816,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(73498)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47684,70 +47857,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(73510)) } - 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(73513)) } - 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(73526)) } - 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(73532)) } 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) + *(*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)) += libc.Int32FromUint16(iOrigSize) + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47793,7 +47966,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(73602)) } } } else { @@ -47819,7 +47992,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(73626)) } } } @@ -47858,12 +48031,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(73677)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73682)) } 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(73692)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73696)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47890,7 +48063,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(73708)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47921,11 +48094,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(73739)) } 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(73744)) } goto _1 _1: @@ -47954,11 +48127,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(73776)) } (*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) @@ -47967,7 +48140,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(73790)) } /* 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 @@ -47989,30 +48162,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) @@ -48120,7 +48291,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(73933)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -48182,7 +48353,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(74005)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -48270,7 +48441,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 */ @@ -48894,7 +49065,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) @@ -49056,7 +49227,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 @@ -49094,7 +49265,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(74943)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -49535,7 +49706,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(75398)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -49559,7 +49730,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(75417)) } 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) @@ -49568,7 +49739,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(75426)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -49582,7 +49753,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(75438)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -49612,7 +49783,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(75473)) } /* 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) @@ -49708,7 +49879,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(75571)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49746,7 +49917,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(75623)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -49813,7 +49984,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(75691)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49856,7 +50027,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(75742)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49886,7 +50057,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(75769)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -50352,7 +50523,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(76233)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50744,7 +50915,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(76657)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50754,7 +50925,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(76672)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50785,7 +50956,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) @@ -50811,7 +50982,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(76743)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50885,7 +51056,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(76827)) } return rc } @@ -51020,7 +51191,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(76965)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -51032,7 +51203,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(76979)) } if rc != 0 { v3 = pCur + 84 @@ -51148,7 +51319,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(77114)) } goto skip_init skip_init: @@ -51162,7 +51333,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(77126)) } 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) @@ -51396,7 +51567,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(77375)) } } } @@ -51600,7 +51771,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes p3 = pCur + 1 *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(BTCF_ValidOvfl) | libc.Int32FromInt32(BTCF_AtLast))) if !((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76795)) + return _sqlite3CorruptError(tls, int32(77571)) } goto bypass_moveto_root /* Start search on the current page */ } @@ -51663,10 +51834,10 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ if nCell < int32(2) || libc.Uint32FromInt32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77658)) 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 @@ -51694,7 +51865,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(77690)) } goto moveto_index_finish } @@ -51727,7 +51898,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(77721)) } *(*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 @@ -51736,7 +51907,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(77732)) } if rc != 0 { v11 = pCur + 84 @@ -51865,7 +52036,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(77833)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51975,7 +52146,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(77926)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -52063,7 +52234,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(78016)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -52118,7 +52289,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(78072)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -52144,7 +52315,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(78101)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52171,7 +52342,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(78135)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -52242,7 +52413,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(78200)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52380,7 +52551,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(78327)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -52431,7 +52602,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(78374)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -52440,7 +52611,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(78385)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -52530,7 +52701,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(78474)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -52548,7 +52719,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(78491)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -52571,7 +52742,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(78511)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -52792,10 +52963,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(78767)) 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 @@ -53186,12 +53357,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(79157)) } 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(79162)) } } pData -= uintptr(sz) @@ -53199,7 +53370,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(79168)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -53294,7 +53465,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(79255)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -53375,7 +53546,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: ; @@ -53402,7 +53573,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: ; @@ -53442,7 +53613,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(79377)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2))) nCell -= nShift @@ -53513,7 +53684,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(79455)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -53558,7 +53729,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(79495)) } /* 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 @@ -53754,10 +53925,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 @@ -53880,8 +54052,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 @@ -53921,7 +54093,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(79919)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53944,7 +54116,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(79943)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -54075,7 +54247,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(80044)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -54118,7 +54290,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(80077)) goto balance_cleanup } } @@ -54177,7 +54349,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(80121)) goto balance_cleanup } goto _11 @@ -54209,7 +54381,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(80154)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -54439,7 +54611,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(80355)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54685,7 +54857,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(80587)) } goto _1 _1: @@ -54758,7 +54930,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(80647)) } 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))) @@ -54917,7 +55089,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(80811)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54948,7 +55120,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(80839)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -55033,7 +55205,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(80920)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -55125,7 +55297,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(81043)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -55161,7 +55333,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(81085)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55191,10 +55363,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(81112)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81115)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -55312,12 +55484,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(81217)) } 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 @@ -55327,14 +55499,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(81242)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -55434,21 +55606,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(81338)) } } 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(81347)) } 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(81351)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81354)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -55542,7 +55714,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(81445)) } 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 @@ -55652,7 +55824,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(81561)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55693,7 +55865,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(81609)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55774,14 +55946,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(81699)) } *(*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(81706)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55918,7 +56090,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(81810)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -56183,7 +56355,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)) @@ -56231,11 +56403,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) @@ -56261,11 +56433,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 @@ -56337,11 +56509,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)) } } @@ -56477,12 +56649,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 } @@ -56567,7 +56739,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 */ @@ -56590,7 +56762,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 { @@ -56667,7 +56839,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))) @@ -56681,7 +56853,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 @@ -56772,7 +56944,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) } @@ -56796,11 +56968,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) } } } @@ -56837,10 +57009,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: @@ -57279,7 +57451,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) @@ -57289,7 +57461,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 @@ -57318,7 +57490,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 @@ -57348,7 +57520,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... @@ -58026,7 +58198,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)) *(*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) } @@ -58164,9 +58336,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) @@ -58341,20 +58510,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 } @@ -58369,10 +58538,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 @@ -59126,7 +59295,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(85108)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -59290,7 +59459,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 { @@ -59298,8 +59468,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 { @@ -59356,14 +59526,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 */ @@ -59377,7 +59547,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 @@ -59402,14 +59572,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)) @@ -59509,7 +59679,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 } } } @@ -59524,7 +59694,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 } @@ -59828,7 +59998,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(85794)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59844,7 +60014,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(85800)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59854,7 +60024,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(85806)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -60315,12 +60485,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 @@ -60494,7 +60663,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 @@ -60511,7 +60680,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 { @@ -60579,8 +60748,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. @@ -60593,11 +60762,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 */ @@ -60634,13 +60803,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 @@ -60671,7 +60843,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 @@ -61173,7 +61345,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)) { @@ -61186,39 +61358,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): @@ -61235,14 +61407,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 @@ -61257,20 +61429,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)) } @@ -61284,10 +61456,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 @@ -62084,7 +62256,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 } @@ -62238,7 +62410,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) } @@ -62246,18 +62418,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) @@ -62488,7 +62660,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(90646))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63876,7 +64048,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(90727))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -63911,7 +64083,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(90757))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63965,7 +64137,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(90808))) return 0 /* Corrupt index */ } } @@ -64097,7 +64269,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(90971))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -64249,7 +64421,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(91129)) } // C documentation @@ -64280,7 +64452,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(91162)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -64431,15 +64603,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 @@ -64534,10 +64706,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 @@ -64546,9 +64719,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 { @@ -64628,7 +64801,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 @@ -64638,7 +64811,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) @@ -64696,7 +64869,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(91560)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -65199,7 +65372,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 @@ -65400,7 +65573,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(92354)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -65530,7 +65703,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(92475)) } 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) @@ -65990,18 +66163,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'), @@ -66256,14 +66429,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(93091)) } 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(93095))) 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(93099)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -66414,7 +66587,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, 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) } @@ -66837,11 +67010,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(93642)) 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))) } @@ -66850,7 +67023,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) @@ -66864,7 +67037,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) } @@ -66899,7 +67072,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(93701)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66934,7 +67107,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 } @@ -67000,11 +67173,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(93797)) 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))) } @@ -67027,7 +67200,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 @@ -67049,7 +67222,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 @@ -67176,7 +67349,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 { @@ -67214,7 +67387,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 @@ -67229,28 +67402,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, 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+5663, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5689, int32(1)) } } } @@ -67414,9 +67587,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 { @@ -67442,12 +67615,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) @@ -67456,28 +67627,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 @@ -67868,12 +68039,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 @@ -67890,7 +68061,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 @@ -67908,7 +68079,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 @@ -68622,19 +68793,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) { @@ -69848,7 +70019,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 @@ -69864,6 +70035,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 */ @@ -70357,7 +70534,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(97561)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -70460,7 +70637,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, @@ -71056,7 +71233,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 { @@ -71086,12 +71263,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 } @@ -71183,7 +71360,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. @@ -72294,7 +72471,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(99822)) } else { goto jump_to_p2 } @@ -72753,7 +72930,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(). @@ -73186,7 +73363,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(101119)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -73516,7 +73693,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 @@ -73547,13 +73724,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 { @@ -73568,7 +73745,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(101412)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73805,7 +73982,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 @@ -73822,15 +73999,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 @@ -73911,11 +74088,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) } @@ -74127,7 +74304,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 @@ -74177,7 +74354,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 { @@ -74233,7 +74410,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)) @@ -74312,11 +74489,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) { @@ -74469,7 +74646,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 } @@ -74631,7 +74808,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' @@ -74711,12 +74888,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)) @@ -74727,7 +74904,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)) @@ -74821,7 +74998,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 } @@ -74849,11 +75026,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) { @@ -74981,7 +75158,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) @@ -75132,7 +75309,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 { @@ -75219,15 +75396,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) @@ -75693,11 +75862,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) @@ -75783,7 +75952,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103962)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75882,7 +76051,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(104062)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75896,7 +76065,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) } @@ -76343,11 +76512,12 @@ type TVdbeSorter1 = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter1 = TVdbeSorter1 +/* Size (in bytes) of a VdbeSorter object that works with N or fewer subtasks */ + /* ** An instance of the following object is used to read records out of a ** PMA, in sorted order. The next key to be read is cached in nKey/aKey. @@ -76954,8 +77124,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 @@ -76969,9 +77139,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) @@ -77169,18 +77339,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 { @@ -77468,6 +77639,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: @@ -80013,25 +80187,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) } } @@ -80070,23 +80244,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 */ @@ -80118,7 +80291,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 @@ -80212,7 +80385,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 } } @@ -80234,57 +80407,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 @@ -80329,11 +80489,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 } @@ -80342,36 +80502,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++ @@ -80400,18 +80549,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 } } } @@ -80458,15 +80607,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) @@ -80477,8 +80626,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -80518,7 +80667,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) @@ -80538,7 +80687,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) @@ -80547,7 +80696,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 @@ -80557,26 +80706,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) } @@ -80625,8 +80774,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80700,19 +80849,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) } @@ -80738,7 +80887,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 @@ -80884,7 +81033,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) { @@ -80939,7 +81088,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 { @@ -80963,7 +81112,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) @@ -80977,13 +81126,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: ; @@ -81003,16 +81152,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 @@ -81023,35 +81169,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 { @@ -81136,7 +81285,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))) } @@ -81148,7 +81297,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 @@ -81194,7 +81343,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 @@ -81319,7 +81468,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) } @@ -81354,7 +81503,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 @@ -81392,7 +81541,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 { @@ -81462,7 +81611,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 @@ -81496,7 +81645,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 @@ -81809,7 +81958,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 { @@ -81876,7 +82025,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 { @@ -81887,7 +82036,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 @@ -81897,7 +82046,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 @@ -82119,33 +82268,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 } @@ -82197,7 +82348,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) { @@ -82405,7 +82556,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 } @@ -82880,7 +83031,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) { @@ -82959,7 +83110,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 @@ -83146,7 +83297,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) @@ -83304,11 +83455,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)) @@ -83357,7 +83508,7 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt 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)) { _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) } @@ -83385,7 +83536,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)) @@ -83405,7 +83556,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 @@ -83476,7 +83627,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)) } } } @@ -83528,7 +83679,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 } @@ -83561,7 +83712,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) } } @@ -83944,7 +84095,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 @@ -84084,7 +84235,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: @@ -84105,27 +84255,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) { @@ -84171,9 +84314,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++ } @@ -84183,8 +84326,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++ } @@ -84198,7 +84341,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) } @@ -84249,7 +84392,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 @@ -84330,7 +84473,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) @@ -84348,7 +84491,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) @@ -84429,7 +84572,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 @@ -84558,7 +84701,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)) } } @@ -84656,10 +84799,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) @@ -85337,13 +85480,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+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 @@ -85358,32 +85501,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 @@ -85592,7 +85722,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 @@ -85645,7 +85775,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) @@ -85745,12 +85875,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 = 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) @@ -86342,7 +86473,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 @@ -86438,14 +86569,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 } @@ -86473,9 +86604,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) { @@ -86608,7 +86739,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) } } @@ -86738,13 +86869,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)<= (*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) } @@ -87536,7 +87667,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)) @@ -87551,7 +87682,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) { @@ -87580,7 +87711,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) } @@ -87656,7 +87787,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): @@ -87719,7 +87850,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 @@ -87729,7 +87860,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) { @@ -87750,9 +87881,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 /* @@ -87834,7 +87965,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 libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -87905,17 +88036,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 { @@ -87924,7 +88055,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 @@ -87955,7 +88086,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 { @@ -88025,7 +88156,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) @@ -88069,7 +88200,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 @@ -88336,7 +88467,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: @@ -88545,7 +88678,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: @@ -89252,7 +89387,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) } @@ -89773,7 +89908,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) 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 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 @@ -89789,7 +89924,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) (*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 + v9 = pParse + 60 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 @@ -89874,7 +90009,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 @@ -89882,7 +90017,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 @@ -89900,7 +90035,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 } } } @@ -89919,11 +90054,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 } @@ -90041,8 +90176,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+8540, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90060,10 +90195,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+8568, 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+8743, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -90079,9 +90214,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+8917, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9039, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9064, 0) } } @@ -90137,7 +90272,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+9215, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -90146,11 +90281,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+9274, 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+9280, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -90180,21 +90315,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+9307, 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+9491, 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+9796, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9812, 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+9870, 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 @@ -90202,7 +90337,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 @@ -90210,7 +90345,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+10135, 0) goto exit_rename_table exit_rename_table: ; @@ -90227,7 +90362,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+10148, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -90267,11 +90402,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+10186, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10193, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10218, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -90287,10 +90422,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+10245) } 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+10304) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -90302,13 +90437,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+10357) } _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+10403) } } /* Modify the CREATE TABLE statement. */ @@ -90322,7 +90457,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+10430, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -90350,7 +90485,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+10576, libc.VaList(bp+16, zTab, zDb)) } } } @@ -90388,12 +90523,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+10929, 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+10963, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -90408,7 +90543,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 } @@ -90416,8 +90551,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+10993, 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 } @@ -90478,18 +90613,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 + 11012 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10992 + zType = __ccgo_ts + 11017 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11006 + v1 = __ccgo_ts + 11031 } else { - v1 = __ccgo_ts + 11023 + v1 = __ccgo_ts + 11048 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11041, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11066, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90536,21 +90671,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+11084, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -90566,11 +90689,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+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+11105, 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+11287, 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+10135, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -91046,11 +91169,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 + 11393 + v1 = __ccgo_ts + 11418 } 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+11420, 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) } @@ -91121,30 +91244,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+11443, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118867)) } 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(118888)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -91165,9 +91292,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)) @@ -91183,15 +91309,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+11451, 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)) @@ -91202,16 +91328,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++ @@ -91228,21 +91354,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 + 11393 + v1 = __ccgo_ts + 11418 } 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+11457, 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))) @@ -91268,7 +91394,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: ; @@ -91578,7 +91704,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 { @@ -91845,7 +91971,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) @@ -92028,7 +92154,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 { @@ -92112,8 +92238,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 @@ -92129,12 +92256,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)) @@ -92208,7 +92335,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(119856)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -92225,7 +92352,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+11462, 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 @@ -92280,23 +92407,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+11084, 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 + 11469 } 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+11481, 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+11509, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -92308,31 +92435,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+11557, 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+11678, 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)) { @@ -92346,7 +92473,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 @@ -92357,8 +92484,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 } @@ -92419,27 +92546,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 + 11696, }, 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 + 11717, }, 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 + 11737, }, 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 + 11756, }, 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 + 11775, }, } @@ -92650,8 +92777,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+11878, 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 { @@ -92661,10 +92793,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+11901, 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+11931, 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) @@ -92696,15 +92828,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11773, - FzCols: __ccgo_ts + 11786, + FzName: __ccgo_ts + 11798, + FzCols: __ccgo_ts + 11811, }, 1: { - FzName: __ccgo_ts + 11799, - FzCols: __ccgo_ts + 11812, + FzName: __ccgo_ts + 11824, + FzCols: __ccgo_ts + 11837, }, 2: { - FzName: __ccgo_ts + 11840, + FzName: __ccgo_ts + 11865, }, } @@ -92918,7 +93050,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) { @@ -92934,12 +93067,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 @@ -92947,7 +93080,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) @@ -93006,7 +93139,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 + 11949, } func init() { @@ -93380,7 +93513,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 + 11959, } func init() { @@ -93430,7 +93563,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+11969, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -93441,7 +93574,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+11974, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -93480,7 +93613,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+11980, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -93498,7 +93631,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 + 11986, } func init() { @@ -93564,7 +93697,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+11995, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -93573,12 +93706,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+11798, 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)) @@ -93700,7 +93833,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 } @@ -93780,7 +93913,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: @@ -93811,7 +93944,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+12005, 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)) @@ -93902,7 +94035,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+12005, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -93939,7 +94072,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 @@ -93972,11 +94105,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+12009) } 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+12013) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -94140,17 +94273,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+11992, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12017, 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+12028, 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+12038, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -94162,13 +94295,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) - } } } @@ -94219,7 +94345,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) } @@ -94422,8 +94548,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))) @@ -94529,11 +94655,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+11824, 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+12050, __ccgo_ts+12119, zDb) } return rc } @@ -94599,10 +94725,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+11798, (*(*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+12171, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94715,7 +94841,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 @@ -94767,11 +94893,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+12212, 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 { @@ -94802,7 +94928,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+12215, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -94811,7 +94937,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+12252, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -94823,13 +94949,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 } @@ -94867,7 +94993,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+12282, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94875,7 +95001,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+12311, 0) rc = int32(SQLITE_ERROR) } } @@ -94922,7 +95048,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+12379, libc.VaList(bp+56, zFile)) } } } @@ -94984,15 +95110,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+12407, 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+12428, 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+12454, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -95087,7 +95213,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 + 12476, } func init() { @@ -95109,7 +95235,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 + 12490, } func init() { @@ -95135,7 +95261,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+12504, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -95169,7 +95295,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+12528, 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))) @@ -95386,7 +95512,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+12574, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -95414,11 +95540,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+12597, 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+12603, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12584, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12609, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -95478,7 +95604,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) { @@ -95513,7 +95639,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+12636, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -95631,7 +95757,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 @@ -95729,7 +95855,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) @@ -95807,7 +95935,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) { @@ -95821,7 +95949,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) } @@ -95934,21 +96064,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) } } } @@ -95978,12 +96108,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) } } } @@ -96021,7 +96151,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+12651, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -96031,7 +96161,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) @@ -96039,15 +96169,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 + 12659 } else { - v1 = __ccgo_ts + 12647 + v1 = __ccgo_ts + 12672 } 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 { } @@ -96085,12 +96215,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 @@ -96615,7 +96745,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) @@ -96647,7 +96777,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 @@ -96705,13 +96835,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+12686, 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+12703, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96759,8 +96889,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+12723, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96796,23 +96926,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 @@ -96932,7 +97064,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 @@ -96975,9 +97107,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 @@ -96990,7 +97122,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+12765, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -97006,9 +97138,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10987 + v2 = __ccgo_ts + 11012 } else { - v2 = __ccgo_ts + 9249 + v2 = __ccgo_ts + 9274 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -97018,9 +97150,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 @@ -97044,11 +97176,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 + 11012 } else { - v4 = __ccgo_ts + 9249 + v4 = __ccgo_ts + 9274 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12781, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12806, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -97056,11 +97188,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+12827, 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++ @@ -97092,19 +97224,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 @@ -97124,15 +97266,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) @@ -97147,7 +97294,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 } @@ -97208,7 +97355,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+12862, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -97217,14 +97364,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+12896, 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) @@ -97256,11 +97405,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) @@ -97271,7 +97420,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+12916, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -97281,12 +97430,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+12939, 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+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+12946, 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-- @@ -97328,21 +97477,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+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+12956, 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) { @@ -97353,7 +97491,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. */ @@ -97366,12 +97504,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 @@ -97543,10 +97690,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+12982, 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+13027, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -97604,7 +97751,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+13068, 0) } } @@ -97632,8 +97779,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) @@ -97641,7 +97788,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+13120, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -97660,21 +97807,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 @@ -97697,7 +97833,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+13161, 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) @@ -97725,8 +97861,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 { @@ -97813,17 +97954,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+13217, 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+13260, (*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+13268, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97855,7 +97996,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+13275, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -97996,9 +98137,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 @@ -98009,31 +98151,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 + 13306 + zEnd = __ccgo_ts + 5201 } else { - zSep = __ccgo_ts + 13283 - zSep2 = __ccgo_ts + 13287 - zEnd = __ccgo_ts + 13292 + zSep = __ccgo_ts + 13308 + zSep2 = __ccgo_ts + 13312 + zEnd = __ccgo_ts + 13317 } - 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+13320, 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))++ @@ -98044,8 +98186,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)] @@ -98058,17 +98201,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 + 13334, + 2: __ccgo_ts + 13340, + 3: __ccgo_ts + 13345, + 4: __ccgo_ts + 13350, + 5: __ccgo_ts + 13340, } // C documentation @@ -98077,15 +98221,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) } @@ -98100,7 +98245,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 } @@ -98333,8 +98478,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. @@ -98434,7 +98589,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 @@ -98447,8 +98602,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++ } @@ -98478,7 +98633,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 @@ -98697,9 +98852,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+13356, 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+13389, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98720,11 +98875,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+13416, 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+13466, 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)) @@ -98771,7 +98926,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+13498, 0) return } } @@ -98805,16 +98960,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 + 9274 + zType2 = __ccgo_ts + 13542 } else { /* A view */ - zType = __ccgo_ts + 10987 - zType2 = __ccgo_ts + 13523 + zType = __ccgo_ts + 11012 + zType2 = __ccgo_ts + 13548 } /* 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 @@ -98831,24 +98986,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) @@ -98896,13 +99056,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+13528, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13553, 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+13568, 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 @@ -98911,15 +99081,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+13666, 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+13708, 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+13742, 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. @@ -98937,7 +99107,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+9796) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -98970,7 +99140,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+13763, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -98987,7 +99157,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+11012, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -99084,7 +99254,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+13799, 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. @@ -99268,7 +99438,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+13829, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -99281,7 +99451,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+13844, 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) } @@ -99364,9 +99534,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+13911, 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+11901, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -99407,7 +99577,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+13925, 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 @@ -99416,7 +99586,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+13970, 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) } @@ -99451,11 +99621,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) @@ -99510,9 +99680,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 @@ -99545,18 +99715,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+14037, 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+14065, 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+14099, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -99566,7 +99736,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+12013, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -99614,19 +99784,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+14131, 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+14194, 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 { @@ -99683,7 +99853,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+14288, 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) { @@ -99798,11 +99968,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 */ @@ -99824,7 +99994,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 @@ -99869,13 +100039,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) } @@ -99898,23 +100068,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 @@ -99943,11 +100113,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 + 14334 } else { - v2 = __ccgo_ts + 14315 + v2 = __ccgo_ts + 14340 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14320, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14345, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -100025,7 +100195,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+14373, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -100035,7 +100205,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+14379, 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)) { @@ -100049,16 +100219,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+14429, 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+14457, 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+14482, 0) goto exit_create_index } /* @@ -100079,19 +100249,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+14373, (*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+14516, 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+14550, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -100112,7 +100282,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+14574, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -100130,9 +100300,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 @@ -100160,7 +100330,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+14373) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -100192,7 +100362,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 } @@ -100244,7 +100414,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+14597, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -100259,6 +100429,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { j = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) } else { if int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16 + 8))&0xf>>0)) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) @@ -100343,7 +100514,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) @@ -100391,7 +100562,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+14658, 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 @@ -100421,8 +100592,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+14700, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127335)) goto exit_create_index } } @@ -100435,7 +100606,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 @@ -100464,9 +100635,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 + 14717 } - 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+14725, 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(""); */ @@ -100474,7 +100645,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+14745, 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. @@ -100482,7 +100653,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+14804, 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)) @@ -100645,16 +100816,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+14831, 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+14849, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100662,9 +100833,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 { @@ -100680,8 +100851,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+14922, 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+12009, (*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) @@ -100754,12 +100925,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) @@ -100871,13 +101042,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+14982, 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) } @@ -100958,7 +101129,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) } @@ -101008,7 +101179,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 @@ -101179,11 +101350,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 + 15018 } else { - v1 = __ccgo_ts + 14996 + v1 = __ccgo_ts + 15021 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15002, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15027, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -101382,7 +101553,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+15063, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -101429,9 +101600,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 + 15069 } else { - v1 = __ccgo_ts + 15053 + v1 = __ccgo_ts + 15078 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -101463,9 +101634,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 + 15063, + 1: __ccgo_ts + 15085, + 2: __ccgo_ts + 15069, } // C documentation @@ -101485,7 +101656,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+15093, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -101510,7 +101681,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+12597, 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 @@ -101941,7 +102112,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+15293, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102823,11 +102992,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+15326, 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+15355, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102931,7 +103100,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 @@ -102988,7 +103157,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+15429, -int32(1)) return } if argc == int32(3) { @@ -104707,7 +104881,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+15462, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -104789,7 +104963,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 @@ -104861,28 +105035,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+15482, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15507, 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+15515, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -104914,13 +105088,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 + 15523 + } else { + v2 = __ccgo_ts + 15527 + } + 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[*(*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+15530, -int32(1)) + return +} + // C documentation // // /* @@ -104932,6 +105242,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) @@ -104942,7 +105256,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) @@ -105377,7 +105691,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 } @@ -105466,7 +105780,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11393, + 0: __ccgo_ts + 11418, } // C documentation @@ -105626,7 +105940,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+15553, int32(4), libc.UintptrFromInt32(0)) } } @@ -105687,7 +106001,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+12636, -int32(1)) return } if argc == int32(2) { @@ -105797,7 +106111,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) { @@ -105879,7 +106193,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+15406, -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) @@ -106111,7 +106425,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) @@ -106122,7 +106436,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 { @@ -106229,7 +106543,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+15558, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -106258,8 +106572,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+15564, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15564, 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 @@ -106439,11 +106753,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 @@ -106547,7 +106861,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))) } /* @@ -106560,542 +106874,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 + 15569, }, 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 + 15589, }, 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 + 15602, }, 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 + 15620, }, 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 + 15629, }, 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 + 15637, }, 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 + 15637, }, 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 + 15652, }, 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 + 15678, }, 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 + 15703, }, 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 + 15712, }, 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 + 15723, }, 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 + 15730, }, 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 + 15744, }, 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 + 15744, }, 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 + 15750, }, 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 + 15750, }, 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 + 15756, }, 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 + 15756, }, 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 + 15761, }, 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 + 15761, }, 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 + 15765, }, 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 + 15765, }, 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 + 15769, }, 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 + 15776, }, 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 + 15784, }, 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 + 15791, }, 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 + 15804, }, 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 + 15810, }, 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 + 15817, }, 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 + 15824, }, 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 + 15832, }, 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 + 15837, }, 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 + 15841, }, 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 + 15841, }, 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 + 15847, }, 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 + 15853, }, 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 + 15859, }, 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 + 15863, }, 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 + 15863, }, 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 + 15869, }, 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 + 15876, }, 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 + 15886, }, 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 + 15893, }, 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 + 15900, }, 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 + 15911, }, 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 + 15918, }, 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 + 15933, }, 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 + 15950, }, 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 + 15961, }, 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 + 15968, }, 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 + 15974, }, 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 + 15987, }, 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 + 16005, }, 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 + 16013, }, 55: { - 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 + 15972, - }, - 56: { 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 + 16027, + }, + 56: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16035, }, 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 + 16044, }, 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 + 16044, }, 59: { - 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, + 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 + 16051, }, 60: { - 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, + 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 + 16051, }, 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 + 15999, + FzName: __ccgo_ts + 16061, }, 62: { - 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, + 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 + 16065, }, 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(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16003, + 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 + 16071, }, 64: { - 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, + 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 + 16075, }, 65: { - 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, + 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 + 16075, }, 66: { - FnArg: int16(2), + 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 + 16022, + FzName: __ccgo_ts + 16081, }, 67: { 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, + 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 + 16081, }, 68: { 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, + 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 + 16094, }, 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 + 16105, + }, + 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 + 15564, + }, + 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, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16038, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1240, + FzName: __ccgo_ts + 15564, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1248, + FzName: __ccgo_ts + 16110, }, 73: { 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 + 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 + 16049, + 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 + 16052, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16115, }, 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 + 16056, + FzName: __ccgo_ts + 16121, }, 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 + 16062, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16124, }, 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 + 16052, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16128, }, 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, + FfuncFlags: 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 + 16134, }, 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 + 16124, }, 81: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16075, - }, - 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, - }, - 83: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16085, - }, - 84: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16090, - }, - 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, - }, - 86: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16100, - }, - 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, - }, - 88: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16110, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, - }, - 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, }, + 82: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16143, + }, + 83: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16147, + }, + 84: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16153, + }, + 85: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16157, + }, + 86: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16162, + }, + 87: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16167, + }, + 88: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16172, + }, + 89: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16178, + }, + 90: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16182, + }, + 91: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16186, + }, + 92: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16190, + }, + 93: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16195, + }, + 94: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16200, + }, 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 + 16205, }, 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 + 16211, }, 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 + 16217, }, 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 + 16223, }, 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 + 16228, }, 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 + 16236, }, 101: { - 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, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16244, }, 102: { - 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, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16247, }, 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 + 6885, + }, + 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 + 16184, + FzName: __ccgo_ts + 16252, + }, + 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 + 16256, }, } @@ -107154,109 +107479,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 ************************************************/ @@ -107480,7 +107807,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) } @@ -107573,7 +107900,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+16259, 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) @@ -108397,7 +108724,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 @@ -108684,11 +109011,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 { @@ -108752,7 +109079,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 = uint8(OE_Abort) @@ -108768,7 +109095,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 @@ -109334,7 +109661,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 } @@ -109400,11 +109727,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 } @@ -109729,7 +110056,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) @@ -109743,7 +110070,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 @@ -109778,7 +110105,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 @@ -109791,7 +110118,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 @@ -109918,27 +110245,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 */ @@ -110019,7 +110346,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++ @@ -110046,7 +110373,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 } @@ -110055,44 +110382,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+16304, 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+16345, 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 } } @@ -110114,31 +110425,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+16377, 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 @@ -110162,10 +110473,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) @@ -110206,8 +110517,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-- } @@ -110224,34 +110535,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+16385, 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+16437, 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 @@ -110358,18 +110669,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 @@ -110379,13 +110690,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 } } } @@ -110396,14 +110707,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 } @@ -110420,16 +110731,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++ @@ -110540,11 +110851,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 */ @@ -110603,7 +110914,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16457) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16529) } goto insert_cleanup insert_cleanup: @@ -110999,7 +111310,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+12597, 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('/'))) { @@ -113233,7 +113546,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+16578, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -113253,19 +113566,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+16582, 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+16588, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113280,14 +113593,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+16631, 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) } @@ -113311,7 +113624,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+16663, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113320,7 +113633,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 + 16543, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -113553,7 +113866,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+16700, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -113607,63 +113920,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 + 16739, + 2: __ccgo_ts + 9274, + 3: __ccgo_ts + 16743, + 4: __ccgo_ts + 16748, + 5: __ccgo_ts + 16751, + 6: __ccgo_ts + 16761, + 7: __ccgo_ts + 16771, + 8: __ccgo_ts + 16777, + 9: __ccgo_ts + 16781, + 10: __ccgo_ts + 16786, + 11: __ccgo_ts + 16791, + 12: __ccgo_ts + 16799, + 13: __ccgo_ts + 16810, + 14: __ccgo_ts + 16813, + 15: __ccgo_ts + 16781, + 16: __ccgo_ts + 16820, + 17: __ccgo_ts + 16786, + 18: __ccgo_ts + 16828, + 19: __ccgo_ts + 16832, + 20: __ccgo_ts + 16837, + 21: __ccgo_ts + 16843, + 22: __ccgo_ts + 16781, + 23: __ccgo_ts + 16786, + 24: __ccgo_ts + 16850, + 25: __ccgo_ts + 16855, + 26: __ccgo_ts + 16858, + 27: __ccgo_ts + 16865, + 28: __ccgo_ts + 16777, + 29: __ccgo_ts + 16781, + 30: __ccgo_ts + 16871, + 31: __ccgo_ts + 16876, + 32: __ccgo_ts + 16881, + 33: __ccgo_ts + 16739, + 34: __ccgo_ts + 16781, + 35: __ccgo_ts + 16885, + 36: __ccgo_ts + 16892, + 37: __ccgo_ts + 16899, + 38: __ccgo_ts + 12013, + 39: __ccgo_ts + 12009, + 40: __ccgo_ts + 16907, + 41: __ccgo_ts + 16912, + 42: __ccgo_ts + 16917, + 43: __ccgo_ts + 9274, + 44: __ccgo_ts + 16922, + 45: __ccgo_ts + 5595, + 46: __ccgo_ts + 16928, + 47: __ccgo_ts + 16933, + 48: __ccgo_ts + 16124, + 49: __ccgo_ts + 16938, + 50: __ccgo_ts + 16739, + 51: __ccgo_ts + 16781, + 52: __ccgo_ts + 16951, + 53: __ccgo_ts + 16956, + 54: __ccgo_ts + 16965, + 55: __ccgo_ts + 16972, + 56: __ccgo_ts + 16983, } // C documentation @@ -113682,338 +113995,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16919, + FzName: __ccgo_ts + 16991, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16934, + FzName: __ccgo_ts + 17006, 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 + 17021, 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 + 17033, 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 + 17049, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16900, + FzName: __ccgo_ts + 16972, 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 + 17062, 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 + 17074, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17022, + FzName: __ccgo_ts + 17094, 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 + 17110, 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 + 17131, 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 + 17146, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17090, + FzName: __ccgo_ts + 17162, 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 + 17176, 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 + 17189, 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 + 17203, 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 + 17222, 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 + 17241, 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 + 17264, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17201, + FzName: __ccgo_ts + 17273, 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 + 17291, 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 + 17308, 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 + 17321, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17264, + FzName: __ccgo_ts + 17336, 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 + 17354, 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 + 17364, 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 + 17378, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17322, + FzName: __ccgo_ts + 17394, 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 + 17419, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17366, + FzName: __ccgo_ts + 17438, 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 + 17449, 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 + 17460, 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 + 17472, 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 + 17488, 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 + 17501, 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 + 17520, 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 + 17539, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17480, + FzName: __ccgo_ts + 17552, 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 + 17567, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17505, + FzName: __ccgo_ts + 17577, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17517, + FzName: __ccgo_ts + 17589, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17526, + FzName: __ccgo_ts + 17598, 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 + 17609, 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 + 17619, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17559, + FzName: __ccgo_ts + 17631, 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 + 17642, 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 + 17654, 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 + 17671, 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 + 17690, 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 + 17716, 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 + 17731, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17673, + FzName: __ccgo_ts + 17745, 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 + 17764, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17706, + FzName: __ccgo_ts + 17778, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17722, + FzName: __ccgo_ts + 17794, 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 + 17806, 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 + 17817, 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 + 17828, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -114021,45 +114334,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17768, + FzName: __ccgo_ts + 17840, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17779, + FzName: __ccgo_ts + 17851, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17800, + FzName: __ccgo_ts + 17872, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17808, + FzName: __ccgo_ts + 17880, 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 + 17895, 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 + 17908, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17855, + FzName: __ccgo_ts + 17927, 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 + 17942, 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)), @@ -114077,7 +114390,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 @@ -114185,10 +114498,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+17958) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17896) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17968) { return PAGER_LOCKINGMODE_NORMAL } } @@ -114206,13 +114519,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+17975) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17908) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17980) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -114235,10 +114548,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+16861) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+16951) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17920) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+17992) == 0 { return int32(2) } else { return 0 @@ -114260,7 +114573,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+17999, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -114390,15 +114703,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 + 18061 case int32(OE_SetDflt): - zName = __ccgo_ts + 17998 + zName = __ccgo_ts + 18070 case int32(OE_Cascade): - zName = __ccgo_ts + 18010 + zName = __ccgo_ts + 18082 case int32(OE_Restrict): - zName = __ccgo_ts + 18018 + zName = __ccgo_ts + 18090 default: - zName = __ccgo_ts + 18027 + zName = __ccgo_ts + 18099 break } return zName @@ -114419,12 +114732,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 + 18109, + 1: __ccgo_ts + 18116, + 2: __ccgo_ts + 18124, + 3: __ccgo_ts + 18128, + 4: __ccgo_ts + 17992, + 5: __ccgo_ts + 18137, } // C documentation @@ -114486,15 +114799,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 + 18162 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18092 + zType = __ccgo_ts + 18164 } 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+18166, 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: ; @@ -114503,9 +114816,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 + 18141, + 2: __ccgo_ts + 18146, + 3: __ccgo_ts + 18154, } // C documentation @@ -114604,7 +114917,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+18173, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114647,7 +114960,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++ @@ -114692,7 +115005,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 @@ -114751,7 +115064,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+18177) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114794,7 +115107,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 @@ -114822,7 +115135,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 + 17968 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 @@ -114850,7 +115163,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 + 17958 } _returnSingleText(tls, v, zRet) break @@ -115140,7 +115453,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+18110, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18182, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -115150,7 +115463,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+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) } @@ -115172,7 +115485,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+18207, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -115204,8 +115517,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+18260) == 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. */ @@ -115285,9 +115599,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 + 18266 } else { - v14 = __ccgo_ts + 18202 + v14 = __ccgo_ts + 18274 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -115358,7 +115672,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+18281, 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)) @@ -115388,19 +115702,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 + 11012 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13235 + zType = __ccgo_ts + 13260 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18225 + zType = __ccgo_ts + 18297 } else { - zType = __ccgo_ts + 9249 + zType = __ccgo_ts + 9274 } } } - _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+18304, 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: ; @@ -115447,9 +115761,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+18311, 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+18316, 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 @@ -115473,11 +115787,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 + 18321, + 1: __ccgo_ts + 18323, + 2: __ccgo_ts + 16810, } - _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+18325, 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: ; @@ -115496,7 +115810,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+18331, 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: ; @@ -115513,7 +115827,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+18335, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -115563,7 +115877,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: ; @@ -115575,7 +115889,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: ; @@ -115601,7 +115915,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+18338, 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+18347)) goto _32 _32: ; @@ -115615,8 +115929,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 @@ -115742,7 +116056,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+18352, 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))) @@ -115838,7 +116152,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 @@ -115882,7 +116196,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 } @@ -115933,7 +116247,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+18356, 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) @@ -115944,7 +116258,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+18380) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -116080,7 +116394,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+18409, 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) @@ -116142,7 +116456,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))) } @@ -116164,7 +116478,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+18445, 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) @@ -116177,7 +116491,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+18465, 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) { @@ -116185,7 +116499,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+18487, 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) { @@ -116196,10 +116510,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+18510, -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+18512, 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)) } } @@ -116233,7 +116547,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+18532, 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) @@ -116257,9 +116571,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+18562) _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+18567) _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)) @@ -116272,9 +116586,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+18588) _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+18624) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -116302,9 +116616,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+18562) _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+18635) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -116332,7 +116646,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+18662) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -116429,7 +116743,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 + 18689 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -116508,7 +116822,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+18750, libc.VaList(bp+176, zRight)) } } } @@ -116613,13 +116927,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+17975) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18703) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18775) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18056) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18128) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116754,7 +117068,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 @@ -116784,7 +117098,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. @@ -116846,7 +117160,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+18783, 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)) @@ -117119,34 +117433,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18620, + FzName: __ccgo_ts + 18692, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18625, + FzName: __ccgo_ts + 18697, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18631, + FzName: __ccgo_ts + 18703, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18640, + FzName: __ccgo_ts + 18712, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18649, + FzName: __ccgo_ts + 18721, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18657, + FzName: __ccgo_ts + 18729, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18665, + FzName: __ccgo_ts + 18737, }, 7: { - FzName: __ccgo_ts + 18672, + FzName: __ccgo_ts + 18744, }, 8: {}, } @@ -117242,14 +117556,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+18801) 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, libc.Int32FromUint8(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18816, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) cSep = uint8(',') goto _1 _1: @@ -117258,19 +117572,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+18823, 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+18829) 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+18841) 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 { @@ -117285,7 +117599,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 @@ -117466,7 +117780,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) } @@ -117478,13 +117792,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+18856) 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+18864, 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+18868, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -117493,7 +117807,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) @@ -117619,24 +117933,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+18902, 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(143745)) } 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+18930, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*uint8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18889, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18961, 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(143752)) } } } @@ -117644,9 +117958,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 + 18872, + 1: __ccgo_ts + 18879, + 2: __ccgo_ts + 18891, } // C documentation @@ -117722,7 +118036,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+14700) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117755,11 +118069,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+18969) } 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+14700) } } } @@ -117798,18 +118112,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 + 9274 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 + 18982 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -117893,7 +118207,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+12311) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117919,7 +118233,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+19054) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117934,7 +118248,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+19078, 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)) @@ -118263,7 +118577,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 @@ -118292,7 +118606,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 @@ -118352,7 +118666,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+19112, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -118368,7 +118682,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+19070, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19142, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -118391,10 +118705,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 { @@ -118402,7 +118716,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) @@ -118432,7 +118746,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(144552)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -118566,7 +118880,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(144701)) } /* 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 @@ -118826,7 +119140,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) @@ -118834,7 +119148,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 @@ -118990,15 +119304,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 + 11418 + zSp2 = __ccgo_ts + 11418 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+19161, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -119055,25 +119369,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) } @@ -119205,13 +119522,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 { @@ -119289,7 +119606,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+19191, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -119339,12 +119656,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+19241, 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. @@ -119359,9 +119676,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+19305, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -119371,6 +119689,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) @@ -119405,7 +119730,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), } @@ -119453,7 +119778,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 @@ -119498,7 +119823,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) @@ -119522,7 +119847,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) @@ -119543,7 +119868,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 @@ -119666,7 +119991,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 { @@ -119793,10 +120118,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 @@ -119804,7 +120129,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 @@ -119981,7 +120306,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+19342, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -120092,8 +120417,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) @@ -120101,7 +120426,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) } @@ -120186,13 +120511,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19290 + z = __ccgo_ts + 19362 case int32(TK_INTERSECT): - z = __ccgo_ts + 19300 + z = __ccgo_ts + 19372 case int32(TK_EXCEPT): - z = __ccgo_ts + 19310 + z = __ccgo_ts + 19382 default: - z = __ccgo_ts + 19317 + z = __ccgo_ts + 19389 break } return z @@ -120213,7 +120538,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+19395, libc.VaList(bp+8, zUsage)) } /* @@ -120250,13 +120575,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 + 19418 } 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+19432, 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+19463, 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) @@ -120280,11 +120605,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 @@ -120500,7 +120825,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 + 16922 } 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)) @@ -120613,7 +120938,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 */ @@ -120622,7 +120947,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) @@ -120646,13 +120971,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 + 16922 } 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+12597, 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))) @@ -120660,7 +120985,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+19509, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120714,7 +121039,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) } @@ -120752,7 +121077,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 + 16922 } zName = v3 } else { @@ -120767,7 +121092,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+19509, 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. @@ -120803,7 +121128,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+19518, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -120922,7 +121247,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 + 19454 + zType = __ccgo_ts + 19526 } else { zType = uintptr(0) j = int32(1) @@ -120988,7 +121313,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) } @@ -121016,7 +121341,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) } @@ -121066,7 +121391,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 @@ -121089,7 +121414,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 @@ -121237,7 +121562,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+19530, 0) return } /* Obtain authorization to do a recursive query */ @@ -121274,7 +121599,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 @@ -121285,7 +121610,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 @@ -121299,7 +121624,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 @@ -121330,7 +121655,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+19579, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -121345,7 +121670,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+19621, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -121373,7 +121698,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+19627, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -121428,9 +121753,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 + 19642 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19572, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19644, 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) { @@ -121538,8 +121863,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+19667, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19682, 0) } /* Generate code for the left and right SELECT statements. */ @@ -121564,7 +121889,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+19362, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121590,7 +121915,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 @@ -121616,7 +121941,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+19701, 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 @@ -121648,11 +121973,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 @@ -121674,7 +121999,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+19701, 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 @@ -121781,6 +122106,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) } @@ -121797,9 +122123,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+19722, 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+19768, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121870,7 +122196,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+19342, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -122086,7 +122412,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) @@ -122118,7 +122444,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 { @@ -122172,16 +122498,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 @@ -122199,32 +122525,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+19850, 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+19861, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -122237,7 +122563,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+19866, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -122447,11 +122773,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))) } @@ -122612,7 +122938,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 @@ -122802,9 +123128,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. @@ -123016,7 +123342,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) @@ -123163,7 +123489,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) @@ -123453,11 +123779,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 { @@ -123522,7 +123848,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 @@ -123540,12 +123866,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 { @@ -124027,7 +124353,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 @@ -124073,13 +124399,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+15761) == 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+15765) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -124167,8 +124493,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+19872, 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 @@ -124192,7 +124518,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 @@ -124274,7 +124600,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) @@ -124292,7 +124618,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+19890, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -124440,7 +124766,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) } @@ -124468,7 +124794,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+19913, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -124490,12 +124816,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+19933, 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 @@ -124512,7 +124838,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 + 19976 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 { @@ -124543,7 +124869,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+19999, 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) } @@ -124552,9 +124878,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 + 20037 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19999 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20071 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -124603,7 +124929,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) { @@ -124613,7 +124939,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+20109, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124709,7 +125035,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) @@ -124718,7 +125044,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) } @@ -124769,7 +125095,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+20113, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124784,7 +125110,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+20152, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124799,7 +125125,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+15293, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124923,7 +125249,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 } @@ -124940,7 +125266,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+20183, 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) } @@ -125019,7 +125345,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+20188, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -125032,7 +125358,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+12597, 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) @@ -125052,9 +125378,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+20197, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20143, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20215, 0) } } } @@ -125068,7 +125394,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+20235, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -125317,7 +125643,7 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint (*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))) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -125370,7 +125696,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 @@ -125407,12 +125733,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+20266, 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+20317, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -125433,7 +125759,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+20350, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -125572,7 +125898,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 @@ -125680,7 +126006,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 @@ -125747,7 +126073,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 + 20383 } else { v1 = __ccgo_ts + 1667 } @@ -125756,7 +126082,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+20406, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125788,7 +126114,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)) @@ -125917,6 +126243,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. // */ @@ -125945,7 +126272,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+16075) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -125978,9 +126305,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 */ } @@ -125990,13 +126317,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 { @@ -126016,7 +126343,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) } @@ -126189,8 +126516,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 @@ -126199,11 +126526,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 { @@ -126219,7 +126546,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)) @@ -126243,14 +126570,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+20418, 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) @@ -126351,7 +126678,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+20472, 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 @@ -126552,14 +126879,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+20512, 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) @@ -126591,7 +126918,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 @@ -126606,7 +126933,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+20527, 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 { @@ -126660,7 +126987,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 @@ -126693,7 +127020,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 @@ -126752,7 +127079,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 @@ -126781,6 +127108,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)) @@ -126803,10 +127137,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) @@ -126840,8 +127174,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 @@ -126856,8 +127190,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 @@ -126886,8 +127220,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++ } @@ -126917,11 +127251,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.Uint16FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -126955,47 +127289,47 @@ 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)) /* 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)) /* Begin a loop that will extract all source rows in GROUP BY order. @@ -127005,16 +127339,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 @@ -127032,11 +127366,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 + 20543 } else { - v46 = __ccgo_ts + 20480 + v47 = __ccgo_ts + 20552 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19323, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19395, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -127050,8 +127384,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -127069,8 +127403,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -127081,12 +127415,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) @@ -127135,12 +127469,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++ } @@ -127210,9 +127548,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 @@ -127229,10 +127567,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 */ @@ -127259,8 +127597,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 } @@ -127300,32 +127638,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) @@ -127367,7 +127705,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+20543) } /* 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 @@ -127473,7 +127811,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 } @@ -127489,7 +127827,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+20561, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -127579,7 +127917,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) } @@ -127741,7 +128079,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+20626, 0) goto trigger_cleanup } iDb = int32(1) @@ -127781,7 +128119,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+20672, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -127791,11 +128129,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+20680, 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+20721, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127804,13 +128142,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+20672, (*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+20761, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127818,8 +128156,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+20787, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127827,15 +128165,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 + 20825 } else { - v1 = __ccgo_ts + 20760 + v1 = __ccgo_ts + 20832 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20766, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20838, 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+20875, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127855,9 +128193,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 @@ -127957,7 +128295,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+20672, 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 } @@ -127979,7 +128317,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+20921, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -127995,10 +128333,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+20969, 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+21044, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -128266,11 +128604,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+21073, 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) @@ -128308,9 +128646,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) { @@ -128325,7 +128663,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+21093, 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) } @@ -128458,11 +128796,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 + 21155 } else { - v1 = __ccgo_ts + 21090 + v1 = __ccgo_ts + 21162 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21097, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21169, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -128564,7 +128902,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+21217, 0) return int32(1) } @@ -128712,12 +129050,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) { @@ -128725,19 +129063,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) @@ -128748,7 +129089,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 @@ -128762,7 +129103,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 { @@ -128830,7 +129171,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): @@ -128929,10 +129270,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+21259, 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 @@ -128954,7 +129297,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 @@ -129026,7 +129369,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)) @@ -129442,13 +129785,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 @@ -129456,21 +129799,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 */ @@ -129517,7 +129860,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 @@ -129556,7 +129899,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 } @@ -129600,58 +129943,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+21273, 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+21309, 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 { @@ -129681,17 +130012,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++ } @@ -129703,11 +130034,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 @@ -129723,11 +130054,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 @@ -129736,18 +130067,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++ } @@ -129756,16 +130087,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. */ @@ -129783,24 +130114,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 { @@ -129826,50 +130157,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) @@ -130167,8 +130498,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -130218,8 +130549,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++ @@ -130266,11 +130597,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)) } @@ -130282,11 +130613,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. */ @@ -130329,7 +130660,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+21328) } goto update_cleanup update_cleanup: @@ -130386,13 +130717,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) { @@ -130434,11 +130765,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 @@ -130763,9 +131094,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+21269, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21341, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21273, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21345, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -130854,13 +131185,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: @@ -130868,7 +131199,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+12686, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130950,7 +131281,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+21418, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21422, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -131041,7 +131372,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 @@ -131080,17 +131411,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+21426) 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+21466) 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+21509) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -131107,7 +131438,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+21558) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -131160,7 +131491,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+15063) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131191,11 +131522,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+21585, 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+21693, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131204,7 +131535,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+21747, 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 @@ -131214,7 +131545,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+21884, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -131357,7 +131688,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) @@ -131741,7 +132072,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+12916, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131864,24 +132195,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+22007, 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+22031, 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+22130, 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 @@ -131965,7 +132301,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+22149, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -132007,9 +132343,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+22191, 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) @@ -132022,7 +132358,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 + 22221 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -132056,7 +132392,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 || 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+16813, 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 @@ -132137,13 +132473,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+22267, 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))) @@ -132224,7 +132560,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+22267, 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) @@ -132272,7 +132608,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+22286, 0) return int32(SQLITE_ERROR) } goto _1 @@ -132283,9 +132619,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(158352))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158354)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -132327,7 +132663,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) } @@ -132693,7 +133029,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 } @@ -132783,7 +133119,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 } @@ -132803,7 +133139,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) } @@ -132867,7 +133203,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(158849)) } else { ap = va switch op { @@ -132880,7 +133216,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(158871)) break } _ = ap @@ -133565,7 +133901,6 @@ type TWhereInfo1 = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo1 = TWhereInfo1 @@ -133601,10 +133936,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 + 22299 } if i == -int32(1) { - return __ccgo_ts + 16850 + return __ccgo_ts + 16922 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -133623,10 +133958,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+22306, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22240, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22312, int32(1)) } i = 0 for { @@ -133634,7 +133969,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+13306, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133643,11 +133978,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+22312, int32(1)) } i = 0 for { @@ -133655,16 +133990,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+13306, 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)) } } @@ -133711,7 +134046,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+22314, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133719,12 +134054,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+22306, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22245 + v2 = __ccgo_ts + 22317 } else { - v2 = __ccgo_ts + 22250 + v2 = __ccgo_ts + 22322 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133741,7 +134076,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+22330) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133752,9 +134087,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+22332) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5175, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } // C documentation @@ -133799,11 +134134,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 + 22334 } else { - v2 = __ccgo_ts + 22269 + v2 = __ccgo_ts + 22341 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22274, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, 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 { @@ -133816,37 +134151,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 + 11469 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22280 + zFmt = __ccgo_ts + 22352 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22313 + zFmt = __ccgo_ts + 22385 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22338 + zFmt = __ccgo_ts + 22410 } else { - zFmt = __ccgo_ts + 22356 + zFmt = __ccgo_ts + 22428 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22365, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22437, 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 + 16922 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22445, 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+22404, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22476, libc.VaList(bp+144, zRowid)) cRangeOp = uint8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133856,14 +134191,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22414, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22486, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22419) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22491) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22441 + v3 = __ccgo_ts + 22513 } else { - v3 = __ccgo_ts + 22449 + v3 = __ccgo_ts + 22521 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -133884,7 +134219,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+22527, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133950,14 +134285,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+22538, 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+22317, 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+22559, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -133981,16 +134316,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+22306, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22245, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22317, 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 @@ -134195,7 +134530,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 @@ -134274,7 +134609,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 */ @@ -134394,7 +134729,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i 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)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(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)) } @@ -134406,7 +134741,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } else { v3 = n } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(v3))) eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } pX = pExpr @@ -134444,10 +134779,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 @@ -134636,7 +134971,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 @@ -134767,7 +135102,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 @@ -135049,7 +135384,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 @@ -135110,11 +135445,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 @@ -135145,6 +135480,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 { @@ -135283,7 +135621,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 @@ -135363,7 +135701,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 @@ -135397,7 +135735,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 @@ -135519,7 +135857,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 @@ -135712,7 +136050,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: @@ -135726,12 +136064,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 { @@ -135769,11 +136108,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 */ @@ -135793,7 +136132,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 } @@ -135829,21 +136168,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 @@ -135861,7 +136200,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, @@ -135916,7 +136255,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+22567, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135939,7 +136278,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+22582, 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)) @@ -136428,9 +136767,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 @@ -136439,7 +136778,7 @@ 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+22591, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { @@ -136485,15 +136824,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 @@ -136505,7 +136845,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) { @@ -136578,7 +136918,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) @@ -136976,19 +137316,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16699, + FzOp: __ccgo_ts + 16771, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16033, + FzOp: __ccgo_ts + 16105, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15512, + FzOp: __ccgo_ts + 15564, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22533, + FzOp: __ccgo_ts + 22605, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -137776,7 +138116,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+22612, 0) return } } else { @@ -137788,10 +138128,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+22612, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137872,7 +138212,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) @@ -137973,7 +138313,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 + 22653 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -138504,7 +138844,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+22660, 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) @@ -138576,7 +138916,6 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo @@ -138587,7 +138926,6 @@ type THiddenIndexInfo1 = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo1 = THiddenIndexInfo1 @@ -139620,7 +139958,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)<>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 @@ -142237,7 +142571,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { + })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0)) { if libc.Int32FromUint16((*(*struct { FnEq Tu16 FnBtm Tu16 @@ -142441,7 +142775,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 @@ -142725,7 +143059,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) } } @@ -142903,7 +143237,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)) @@ -143244,7 +143578,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+22733, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143319,7 +143653,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+22733, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143473,7 +143807,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(168893)) /* 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) @@ -143909,7 +144243,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+22759, 0) rc = SQLITE_OK } else { break @@ -145117,7 +145451,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+22794, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145695,7 +146029,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 @@ -145851,7 +146185,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+22812, 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 @@ -145872,11 +146206,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) @@ -145924,7 +146255,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+22840, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -146069,7 +146400,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 @@ -146103,7 +146435,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. @@ -146229,7 +146561,7 @@ 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 @@ -146260,16 +146592,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 @@ -146448,7 +146780,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 { @@ -146655,7 +146987,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 @@ -146665,7 +146997,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+22858, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146715,7 +147047,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 } @@ -146984,7 +147316,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+22887, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -147166,7 +147498,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+22943, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -147492,7 +147824,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+22988, libc.VaList(bp+8, zName)) } return p } @@ -147543,12 +147875,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+23007, 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+23078, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -147621,7 +147953,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 } @@ -147759,7 +148091,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( 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 { @@ -147903,7 +148235,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+23141, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147939,7 +148271,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)) } @@ -147954,7 +148286,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 @@ -147973,11 +148305,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 { @@ -148023,11 +148355,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 @@ -148044,7 +148376,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)) @@ -148066,7 +148398,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 @@ -148190,7 +148522,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+23167, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -148258,18 +148590,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 + 23199 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23144 + zErr = __ccgo_ts + 23216 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23160 + zErr = __ccgo_ts + 23232 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23180, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23252, 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 { @@ -148293,7 +148625,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+23285, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -148399,24 +148731,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 @@ -148434,12 +148766,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) } @@ -148451,15 +148783,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 @@ -148511,11 +148843,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 + 23332, + 1: __ccgo_ts + 23385, + 2: __ccgo_ts + 22887, + 3: __ccgo_ts + 23436, + 4: __ccgo_ts + 23488, } var _aOp1 = [5]int32{ @@ -149095,7 +149427,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 } @@ -149191,7 +149523,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 '' */ @@ -149908,12 +150240,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 @@ -149921,13 +150253,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 @@ -149947,13 +150279,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 @@ -149980,7 +150312,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 @@ -150199,6 +150531,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. @@ -150259,7 +150595,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+23538, libc.VaList(bp+8, p)) } // C documentation @@ -150273,6 +150609,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) } @@ -150306,11 +150643,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 + 23562 } else { - v1 = __ccgo_ts + 23499 + v1 = __ccgo_ts + 23571 } - _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+23577, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -150319,7 +150656,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+23619, 0) } } } @@ -150425,7 +150762,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+23653, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -156946,13 +157283,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) } @@ -158882,20 +159219,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+16922, 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+23691, 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+16858, 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+23691, 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 @@ -158936,7 +159273,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 */ @@ -159081,7 +159423,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 */ @@ -159171,9 +159518,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) } @@ -159528,7 +159875,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+23718) 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) { @@ -159878,9 +160225,9 @@ _237: */ _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 + v347 = __ccgo_ts + 8102 } else { - v347 = __ccgo_ts + 8082 + v347 = __ccgo_ts + 8107 } *(*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 { @@ -160122,15 +160469,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+23727, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23750, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23822, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23834, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23906, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -160272,7 +160619,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 */ @@ -160466,7 +160813,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+23919, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23991, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -163197,14 +163544,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)< int32(65528) { sz = int32(65528) } - if cnt < 0 { + /* 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 > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } szAlloc = int64(sz) * int64(cnt) - if sz == 0 || cnt == 0 { + 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)) @@ -164680,7 +165036,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182779)) + return _sqlite3MisuseError(tls, int32(183820)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164700,7 +165056,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+24078, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -165001,14 +165357,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 + 24621 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -165020,31 +165376,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 + 24146, + 1: __ccgo_ts + 24159, + 3: __ccgo_ts + 24175, + 4: __ccgo_ts + 24200, + 5: __ccgo_ts + 24214, + 6: __ccgo_ts + 24233, 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 + 24258, + 9: __ccgo_ts + 24295, + 10: __ccgo_ts + 24307, + 11: __ccgo_ts + 24322, + 12: __ccgo_ts + 24355, + 13: __ccgo_ts + 24373, + 14: __ccgo_ts + 24398, + 15: __ccgo_ts + 24427, + 17: __ccgo_ts + 6130, + 18: __ccgo_ts + 5534, + 19: __ccgo_ts + 24444, + 20: __ccgo_ts + 24462, + 21: __ccgo_ts + 24480, + 23: __ccgo_ts + 24514, + 25: __ccgo_ts + 24535, + 26: __ccgo_ts + 24561, + 27: __ccgo_ts + 24584, + 28: __ccgo_ts + 24605, } // C documentation @@ -165191,6 +165547,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 // // /* @@ -165223,7 +165593,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i 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(183430)) + return _sqlite3MisuseError(tls, int32(184509)) } 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) @@ -165266,7 +165636,7 @@ 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+24702, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165392,7 +165762,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+24765, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -165423,7 +165793,7 @@ 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) } @@ -165667,7 +166037,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(184046)) + return _sqlite3MisuseError(tls, int32(185125)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*uint8)(unsafe.Pointer(zDb)) != 0 { @@ -165677,7 +166047,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+24816, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165799,7 +166169,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(184182))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185261))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165931,7 +166301,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(184261)) + return _sqlite3MisuseError(tls, int32(185340)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165941,7 +166311,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(184270)) + return _sqlite3MisuseError(tls, int32(185349)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165990,7 +166360,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(184318)) + return _sqlite3MisuseError(tls, int32(185397)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -165999,7 +166369,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+24837, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -166146,7 +166516,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+24905, 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 @@ -166176,8 +166546,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+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+24911, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24921, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -166266,24 +166636,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+24949, 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+24953, 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 + 24953 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24902, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24974, 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 @@ -166312,12 +166682,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+24989, 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+25009, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -166341,7 +166711,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+25033, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -166361,11 +166731,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24887, + Fz: __ccgo_ts + 24959, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24894, + Fz: __ccgo_ts + 24966, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -166376,19 +166746,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24907, + Fz: __ccgo_ts + 24979, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24910, + Fz: __ccgo_ts + 24982, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24913, + Fz: __ccgo_ts + 24985, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17920, + Fz: __ccgo_ts + 17992, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -166516,8 +166886,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+22653, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25049, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -166538,10 +166908,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(184993)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186072)) /* 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) } @@ -166550,7 +166920,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) } @@ -166577,9 +166947,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 + 24051 (*(*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 { @@ -166673,7 +167043,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 + 25055 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166833,7 +167203,7 @@ 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) @@ -166890,20 +167260,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+25058, 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+25083) } 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+25103) } 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+25110) } // C documentation @@ -166928,9 +167298,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) @@ -166957,29 +167327,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 @@ -167034,15 +167393,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+25127, 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) @@ -167221,8 +167580,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 @@ -167666,7 +168025,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: ; @@ -168062,7 +168421,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+25155, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -168280,7 +168639,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 + 25163 } else { v2 = uintptr(0) } @@ -168359,7 +168718,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) @@ -168526,7 +168885,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 @@ -168743,6 +169102,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -169055,8 +169421,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 @@ -169113,7 +169479,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 @@ -169123,7 +169489,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 @@ -169161,18 +169527,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 + 25186, + 12: __ccgo_ts + 25192, 13: __ccgo_ts + 1667, 14: __ccgo_ts + 1667, 15: __ccgo_ts + 1667, @@ -169659,7 +170025,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) { @@ -169957,8 +170323,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 + 25127 + 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 + 25127 + 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) } } @@ -170094,7 +170460,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+15507, 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)) @@ -170108,14 +170474,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+25199, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -170169,7 +170533,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+25228, -int32(1)) } } } @@ -170452,8 +170816,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(3), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25188, - FzRepl: __ccgo_ts + 25192, + FzMatch: __ccgo_ts + 25243, + FzRepl: __ccgo_ts + 25247, }, 1: { Fc1: uint8('i'), @@ -170461,8 +170825,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(8), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25200, - FzRepl: __ccgo_ts + 25192, + FzMatch: __ccgo_ts + 25255, + FzRepl: __ccgo_ts + 25247, }, 2: { Fc1: uint8('n'), @@ -170477,7 +170841,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: uint8('Q'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25209, + FzMatch: __ccgo_ts + 25264, FzRepl: __ccgo_ts + 1653, }, 4: { @@ -170485,7 +170849,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: uint8('S'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25214, + FzMatch: __ccgo_ts + 25269, FzRepl: __ccgo_ts + 1653, }, } @@ -170501,7 +170865,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+25274, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -170519,23 +170883,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 } @@ -170613,7 +170977,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 @@ -170684,7 +171048,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) + } } } } @@ -170959,7 +171327,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+25317, 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') { @@ -171389,7 +171757,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 { @@ -171428,7 +171796,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[*(*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)) } @@ -171436,7 +171804,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8082, 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)) } @@ -171513,14 +171881,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+25188, 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+25243, 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+25271) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25326) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25278) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25333) } - 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+25339, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171705,7 +172073,7 @@ _38: goto _51 } if libc.Int32FromUint8(_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+25333) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171750,7 +172118,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+25173, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25228, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171763,7 +172131,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+25228, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171812,10 +172180,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) @@ -171849,15 +172213,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 @@ -171930,11 +172294,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: ; @@ -171983,9 +172347,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25192 + v19 = __ccgo_ts + 25247 } else { - v19 = __ccgo_ts + 11944 + v19 = __ccgo_ts + 11969 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -172021,9 +172385,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: ; @@ -172050,7 +172417,7 @@ _11: sz2 -= k2 } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25290, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25345, uint32(2)) zIn2++ sz2-- continue @@ -172073,7 +172440,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, uint8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25293, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25348, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -172081,12 +172448,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25300, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25355, 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+25360, uint32(6)) case int32('\r'): if sz2 > uint32(2) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -172266,7 +172633,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+25367, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172289,12 +172656,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+25370, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25312, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25367, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172309,50 +172676,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 // // /* @@ -172404,6 +172727,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 // // /* @@ -172424,6 +172825,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)) @@ -172496,9 +172900,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 @@ -172541,7 +172945,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 @@ -173029,7 +173444,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+25228, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -173164,7 +173579,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 } @@ -173265,7 +173680,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+25228, -int32(1)) return } @@ -173302,11 +173717,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+25199, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -173319,7 +173731,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+25228, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -173338,10 +173750,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+25278) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25333) } 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+25271) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25326) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -173380,7 +173792,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+25373, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -173396,7 +173808,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. // ** @@ -173477,7 +173889,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+25228, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -173489,34 +173901,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; +// ** 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. +// ** 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) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { + 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 (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) - return 0 + 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 (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - 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 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) @@ -173599,7 +174031,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 @@ -173659,7 +174091,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+25228, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173794,7 +174226,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 + 25336 + v1 = __ccgo_ts + 25391 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173804,7 +174236,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+25228, -int32(1)) } } eErr = uint8(1) @@ -173914,23 +174346,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+25393, uint32(1)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25340, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25395, 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 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+25342, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25397, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25345, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25400, uint32(1)) } } } @@ -173970,7 +174402,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+25228, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -174238,7 +174670,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+25228, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -174262,7 +174694,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+25402, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -174273,7 +174705,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+25453, -int32(1)) _jsonStringReset(tls, bp) return } @@ -174345,7 +174777,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+25228, -int32(1)) } } goto json_remove_done @@ -174382,7 +174814,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+16027) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -174413,9 +174845,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 + 25487 } else { - v1 = __ccgo_ts + 25436 + v1 = __ccgo_ts + 25491 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -174463,7 +174895,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+25228, -int32(1)) } } goto json_type_done @@ -174510,7 +174942,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 + 25498 (*(*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)) @@ -174584,17 +175016,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+25503, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -174603,18 +175034,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 @@ -174676,9 +175106,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))) @@ -174785,7 +175213,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+25560, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174877,20 +175305,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))) + } } } @@ -174934,7 +175364,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+25563, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -175037,7 +175467,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+25566) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -175171,7 +175601,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+25649, 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 @@ -175197,9 +175627,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+25656, 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+25664, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -175510,9 +175940,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))) @@ -175585,7 +176014,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+25670, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -175609,7 +176038,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+25228, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175670,186 +176099,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 + 25672, }, 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 + 25677, }, 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 + 25683, }, 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 + 25694, }, 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 + 25706, }, 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 + 25706, }, 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 + 25724, }, 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 + 25744, }, 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 + 25757, }, 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 + 25771, }, 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 + 25774, }, 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 + 25778, }, 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 + 25790, }, 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 + 25803, }, 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 + 25815, }, 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 + 25828, }, 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 + 25839, }, 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 + 25851, }, 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 + 25851, }, 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 + 25863, }, 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 + 25874, }, 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 + 25886, }, 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 + 25899, }, 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 + 25912, }, 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 + 25926, }, 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 + 25935, }, 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 + 25945, }, 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 + 25945, }, 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 + 25955, }, 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 + 25955, }, 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 + 25966, }, 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 + 25983, }, 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 + 26001, }, 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 + 26019, }, } @@ -175932,17 +176361,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25983, + FzName: __ccgo_ts + 26038, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25993, + FzName: __ccgo_ts + 26048, 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 @@ -176050,7 +176481,6 @@ type TRtreeMatchArg = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - FaParam [1]TRtreeDValue } type RtreeMatchArg = TRtreeMatchArg @@ -176333,11 +176763,12 @@ type TRtreeMatchArg1 = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - 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 ** clang, since clang works hard to be gcc compatible. So the gcc @@ -176413,7 +176844,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) } @@ -176519,7 +176950,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 @@ -176582,7 +177013,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+26058, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -176593,7 +177024,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 { @@ -176887,7 +177318,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+26063, 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 { @@ -177424,7 +177855,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) } @@ -177804,7 +178235,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+26145) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177882,7 +178313,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) @@ -178113,7 +178544,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 } @@ -178121,7 +178552,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 @@ -178359,7 +178790,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: @@ -178781,7 +179212,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 @@ -179294,7 +179725,7 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179311,7 +179742,7 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179339,7 +179770,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+26159, 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 { @@ -179349,11 +179780,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+26179, 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+26211, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -179567,7 +179998,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+26248, 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)) @@ -179621,9 +180052,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 + 26393 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+11798, 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) { @@ -179681,9 +180112,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 + 26449, + 1: __ccgo_ts + 5595, + 2: __ccgo_ts + 16922, } var _rtreeModule = Tsqlite3_module{ @@ -179727,21 +180158,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+26863, 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+26925, 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+26930, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26994, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27064, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179771,7 +180202,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 + 27113 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179786,31 +180217,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+27221, 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+27266, 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+13306, 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+27293, 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+27315, 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+27323, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179824,14 +180255,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 + 26454, + 1: __ccgo_ts + 26507, + 2: __ccgo_ts + 26552, + 3: __ccgo_ts + 26604, + 4: __ccgo_ts + 26658, + 5: __ccgo_ts + 26703, + 6: __ccgo_ts + 26761, + 7: __ccgo_ts + 26816, } // C documentation @@ -179889,7 +180320,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+27339, 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) @@ -179897,17 +180328,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+27359, 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))) @@ -179970,7 +180401,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) } @@ -179984,13 +180415,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+27602, 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+27608, 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) { @@ -179999,7 +180430,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+27577, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27632, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -180013,19 +180444,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+27659, 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))) } } } @@ -180048,7 +180479,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)) @@ -180059,7 +180490,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 @@ -180075,8 +180506,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27583, - 1: __ccgo_ts + 27594, + 0: __ccgo_ts + 27638, + 1: __ccgo_ts + 27649, } // C documentation @@ -180134,21 +180565,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+11418, 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+27662, 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+27668, 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+27672, int32(1)) goto _1 _1: ; @@ -180175,7 +180606,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+27674, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -180278,7 +180709,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) @@ -180293,11 +180724,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+27707, 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) } @@ -180331,7 +180762,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+27714, 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) @@ -180348,7 +180779,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+27759, libc.VaList(bp+8, iNode)) } } return pRet @@ -180377,8 +180808,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 + 27791, + 1: __ccgo_ts + 27845, } 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)) @@ -180391,21 +180822,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 + 27893 } else { - v1 = __ccgo_ts + 27846 + v1 = __ccgo_ts + 27901 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27855, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27910, 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 + 27893 } else { - v2 = __ccgo_ts + 27846 + v2 = __ccgo_ts + 27901 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27900, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27955, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -180450,7 +180881,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+28013, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -180468,7 +180899,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+28061, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -180501,19 +180932,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+28128, 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+28162, 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+28192, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -180558,12 +180989,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+28247, 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+28278, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -180592,7 +181023,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+28345, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -180602,11 +181033,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+26159, 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+28373, 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)) @@ -180622,8 +181053,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+28404, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28411, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -180650,7 +181081,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+28419, 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) } @@ -180701,13 +181132,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+28438, -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))) } @@ -180716,7 +181147,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 + 18689 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -180983,7 +181414,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++ @@ -181028,7 +181459,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 @@ -181090,7 +181521,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 } @@ -181458,7 +181889,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 @@ -181473,9 +181904,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: ; @@ -181560,7 +181991,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 { @@ -181701,7 +182132,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 // ** @@ -181740,7 +182171,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) } @@ -181844,7 +182275,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 @@ -181928,7 +182359,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 @@ -182212,7 +182643,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) { @@ -182369,7 +182800,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 @@ -182381,13 +182812,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+27602, 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+28562, 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) @@ -182396,13 +182827,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+28584, 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+27659, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -182410,7 +182841,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) @@ -182425,7 +182856,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 @@ -182637,7 +183068,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 + 16922 (*(*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) @@ -182647,7 +183078,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 + 28588 (*(*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) @@ -182655,7 +183086,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 + 28594 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182775,7 +183206,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+28603, 0) } goto geopoly_update_end } @@ -182878,12 +183309,12 @@ geopoly_update_end: func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28588) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28643) == 0 { *(*uintptr)(unsafe.Pointer(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 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28659) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) @@ -182954,7 +183385,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+28836, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -182968,61 +183399,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28619, + FzName: __ccgo_ts + 28674, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28632, + FzName: __ccgo_ts + 28687, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28645, + FzName: __ccgo_ts + 28700, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28658, + FzName: __ccgo_ts + 28713, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28604, + FzName: __ccgo_ts + 28659, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28670, + FzName: __ccgo_ts + 28725, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28588, + FzName: __ccgo_ts + 28643, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28693, + FzName: __ccgo_ts + 28748, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28707, + FzName: __ccgo_ts + 28762, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28720, + FzName: __ccgo_ts + 28775, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28734, + FzName: __ccgo_ts + 28789, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28750, + FzName: __ccgo_ts + 28805, }, } @@ -183048,7 +183479,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28762, + FzName: __ccgo_ts + 28817, }, } @@ -183073,20 +183504,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+28844, 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+28854, 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+28865, -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+28588, 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+28876, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -183160,7 +183591,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) @@ -183188,7 +183619,7 @@ 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+26145, __ccgo_fp(_rtreeMatchArgFree)) } } } @@ -183429,7 +183860,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 @@ -184405,7 +184836,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+28886, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -184415,7 +184846,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+28886, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -184441,7 +184872,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 @@ -184464,7 +184895,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 } @@ -184596,7 +185027,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+28907, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184685,7 +185116,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+26058, 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')) { @@ -184722,13 +185153,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 + 29078 } 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+29119, 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+29269) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184895,7 +185326,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))) } } @@ -184956,7 +185387,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+29394, 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 @@ -184966,7 +185397,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+29513, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -184974,7 +185405,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+29534, 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) @@ -184986,7 +185417,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+29585, 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 { @@ -185030,7 +185461,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+29606, 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))) { @@ -185043,7 +185474,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+29634, 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 { @@ -185096,7 +185527,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+20197, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -185107,7 +185538,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+29663, 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) @@ -185118,7 +185549,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+29682, 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 @@ -185126,7 +185557,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+29687, zName) { bRbuRowid = int32(1) } } @@ -185140,17 +185571,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 + 29697 } else { - v4 = __ccgo_ts + 29655 + v4 = __ccgo_ts + 29710 } - (*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+29719, 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+29748, 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)) @@ -185172,7 +185603,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+29770, 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)) @@ -185218,8 +185649,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+29797, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15174 goto _1 _1: ; @@ -185253,7 +185684,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+29806, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -185301,21 +185732,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+29819, 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+29851, 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+15174, __ccgo_ts+29874) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29880, __ccgo_ts+29887, __ccgo_ts+5201) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15174, __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+29895, 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+29937, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -185367,7 +185798,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+29634, 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)) @@ -185389,15 +185820,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 + 29957 } } 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+29965, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29986, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30022, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15174 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -185406,7 +185837,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+30049, 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 @@ -185423,15 +185854,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+30097, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15174 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+30104, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -185489,7 +185920,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+29634, 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)) @@ -185498,7 +185929,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+30116, 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 { @@ -185518,9 +185949,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 + 29957 } else { - zCol = __ccgo_ts + 29632 + zCol = __ccgo_ts + 29687 } } zType = __ccgo_ts + 1141 @@ -185528,24 +185959,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+30138, 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 + 29874 } 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+30158, 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+30179, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30212, 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 + 15174 + zAnd = __ccgo_ts + 22306 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185599,11 +186030,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+30236, 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+30248, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15149 + zS = __ccgo_ts + 15174 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -185615,7 +186046,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+30257, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -185641,7 +186072,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+30272, 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 @@ -185651,15 +186082,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+30286, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22306 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30243, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30298, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1667 i1 = 0 @@ -185669,8 +186100,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+30348, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22306 } goto _2 _2: @@ -185693,7 +186124,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+30361, 0) } // C documentation @@ -185735,16 +186166,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+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+30348, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15174 } else { if libc.Int32FromUint8(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+30387, 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 + 15174 } else { if libc.Int32FromUint8(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+30417, 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 + 15174 } } } @@ -185828,16 +186259,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 + 30454 *(*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+29606, 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+16810) == 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+29634, libc.VaList(bp+24, zIdx))) } break } @@ -185848,16 +186279,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 + 29874 } 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+30467, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15174 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30423, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30478, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -185903,7 +186334,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+30482) 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))) { @@ -185911,7 +186342,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+29634, 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))) { @@ -185920,21 +186351,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+30532, 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 + 29874 } 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+30554, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15174 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30509, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30564, 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+30579, 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)) } } @@ -185971,7 +186402,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) { @@ -185980,19 +186411,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 + 30641 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30599 + v2 = __ccgo_ts + 30654 } 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+30664, 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 + 15174 goto _1 _1: ; @@ -186001,17 +186432,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+30691, 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 + 30698 } 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+30713, 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)) } } @@ -186037,7 +186468,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+30745, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -186083,7 +186514,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+30802) } 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)) @@ -186252,7 +186683,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+30868, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -186269,18 +186700,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+30888, 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+30953, 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+30989, 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 { @@ -186295,26 +186726,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 + 31023 } else { - v2 = __ccgo_ts + 30972 + v2 = __ccgo_ts + 31027 } 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+31033, 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+31094, 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 + 31023 } else { - v3 = __ccgo_ts + 30972 + v3 = __ccgo_ts + 31027 } - 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+31155, 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 { @@ -186333,8 +186764,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). */ @@ -186343,39 +186774,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 + 31314 } 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 + 31323 } 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+31333, 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+31369, 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 + 31397 } /* 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 + 31409 } 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+31426, 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+31502, 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+31801, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -186386,9 +186817,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 + 31900 } else { - v7 = __ccgo_ts + 31855 + v7 = __ccgo_ts + 31910 } zRbuRowid1 = v7 } @@ -186401,14 +186832,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+29957, 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+15174, __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 + 31921 } else { v8 = __ccgo_ts + 1667 } @@ -186418,11 +186849,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 + 23562 } 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+31927, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -186510,9 +186941,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 + 31314 } - 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+31975, 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 } @@ -186539,7 +186970,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) } @@ -186586,7 +187017,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+32005, 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): @@ -186645,27 +187076,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+32035, 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+32063, 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+32081, 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 } @@ -186698,10 +187129,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+32147, 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+24905, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*uint8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186717,14 +187148,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 + 32179 } 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+32181, 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 @@ -186735,27 +187166,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+32213, -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+32228, 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+32245, -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+32261, 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+32289, 0) } } @@ -186841,7 +187272,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { if pState == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32206, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32261, uintptr(0), uintptr(0), uintptr(0)) } } /* Assuming no error has occurred, run a "restart" checkpoint with the @@ -186874,7 +187305,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CAPTURE) - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32252, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32307, uintptr(0), uintptr(0), uintptr(0)) if rc2 != int32(SQLITE_NOTICE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -186937,7 +187368,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) } @@ -187007,16 +187438,16 @@ 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) + 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_methods1)(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) } - 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)) @@ -187038,7 +187469,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+32342, 0) } // C documentation @@ -187055,13 +187486,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+32367, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32374, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -187193,7 +187624,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+24462, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -187329,7 +187760,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+32381) 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 @@ -187342,7 +187773,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+32403, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -187369,7 +187800,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+32430, 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))) @@ -187405,9 +187836,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+32590, 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+32605, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -187430,9 +187861,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+32625, 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+32650) } 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) @@ -187443,10 +187874,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+32758) } 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+32823) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -187464,7 +187895,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+32867, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -187491,8 +187922,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+17895) + _rbuCopyPragma(tls, p, __ccgo_ts+17006) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -187500,7 +187931,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+32892, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -187522,10 +187953,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+15078, 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+15078, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -187612,7 +188043,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+32920, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -187635,10 +188066,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+32367, 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) } @@ -187660,7 +188091,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+32890, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32945, 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) @@ -187707,7 +188138,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+32956, 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 { @@ -187752,11 +188183,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+33028, 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+33042) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187765,7 +188196,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+33099) 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) @@ -187813,7 +188244,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 @@ -187845,7 +188276,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+33173, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187867,17 +188298,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 + 33205 } else { - v3 = __ccgo_ts + 33157 + v3 = __ccgo_ts + 33212 } - (*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+33219, 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+15063, 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) @@ -187889,21 +188320,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+17609) + _rbuCopyPragma(tls, p, __ccgo_ts+17021) } /* 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+33251, 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+33267, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -187981,7 +188412,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+33291, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -188028,7 +188459,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+31314, 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++ @@ -188056,7 +188487,7 @@ 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+15078, 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) { @@ -188065,7 +188496,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { } _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+15078, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -188075,7 +188506,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+33299, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -188176,7 +188607,7 @@ 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+15078, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ @@ -188189,19 +188620,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { 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+15078, 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 + 15063 } else { - v1 = __ccgo_ts + 33196 + v1 = __ccgo_ts + 33251 } 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+33251, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -188687,7 +189118,7 @@ func _rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileSize})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, pSize) /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existence of a *-wal file. rbuVfsRead() contains ** similar logic. */ if rc == SQLITE_OK && *(*Tsqlite_int64)(unsafe.Pointer(pSize)) == 0 && (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpRbu)).FzTarget == uintptr(0) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_MAIN_DB) != 0 { *(*Tsqlite_int64)(unsafe.Pointer(pSize)) = int64(1024) @@ -188768,7 +189199,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xControl})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, int32(SQLITE_FCNTL_ZIPVFS), bp) if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33271, 0) + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33326, 0) } else { if rc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p @@ -188794,7 +189225,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r if rc == SQLITE_OK && op == int32(SQLITE_FCNTL_VFSNAME) { pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs zIn = *(*uintptr)(unsafe.Pointer(pArg)) - zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33294, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33349, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -188989,7 +189420,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag if pDb != 0 { if (*Trbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == int32(RBU_STAGE_OAL) { if (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) { - zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6715) + zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6740) zOpen = Xsqlite3_filename_wal(tls, zOpen) } nOpen = libc.Xstrlen(tls, zOpen) @@ -189003,7 +189434,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag } else { (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu } - if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33305, 0) != 0 { + if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33360, 0) != 0 { oflags = libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) } @@ -189559,7 +189990,7 @@ func _statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint _sqlite3TokenInit(tls, bp, *(*uintptr)(unsafe.Pointer(argv + 3*8))) iDb = _sqlite3FindDb(tls, db, bp) if iDb < 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12382, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12407, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) return int32(SQLITE_ERROR) } } else { @@ -189871,7 +190302,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { _sqlite3BtreeEnter(tls, pBt) nUsable = szPage - _sqlite3BtreeGetReserveNoMutex(tls, pBt) _sqlite3BtreeLeave(tls, pBt) - (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32)) + (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32))) if (*TStatPage)(unsafe.Pointer(p)).FaCell == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -189918,7 +190349,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } (*TStatCell)(unsafe.Pointer(pCell)).FnLastOvfl = libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp)) - libc.Uint32FromInt32(nLocal) - libc.Uint32FromInt32((nOvfl-int32(1))*(nUsable-int32(4)))) (*TStatCell)(unsafe.Pointer(pCell)).FnOvfl = nOvfl - (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(4)*libc.Uint64FromInt32(nOvfl)) + (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(uint64(4)*libc.Uint64FromInt32(nOvfl))) if (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -190059,7 +190490,7 @@ statNextRestart: (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiPgno = iRoot (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33316, 0) + v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33371, 0) z = v1 (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FzPath = v1 if z == uintptr(0) { @@ -190097,8 +190528,8 @@ statNextRestart: if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { (*TStatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33318 - v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33327, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33373 + v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33382, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) z = v2 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v2 if z == uintptr(0) { @@ -190127,7 +190558,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage++ if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226029)) + return _sqlite3CorruptError(tls, int32(227304)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -190138,7 +190569,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+33394, 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) { @@ -190161,13 +190592,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 + 33402 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 + 33411 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33361 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33416 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -190176,7 +190607,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) { @@ -190265,12 +190696,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+33426, 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+33581, 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+33595, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -190347,7 +190778,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+33610, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -191548,7 +191979,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) { @@ -191641,11 +192072,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+11798, 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+33617, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1667, 0) @@ -191654,7 +192085,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+33747, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191680,10 +192111,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+29957))) 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) @@ -191704,8 +192135,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+29957) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29957, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191769,7 +192200,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 @@ -191786,6 +192217,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 { @@ -191807,12 +192240,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+11798, (*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))) } } } @@ -192102,10 +192535,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 + 11418 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33722, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33777, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -192117,8 +192550,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 + 15174 goto _1 _1: ; @@ -192772,8 +193205,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+33784, 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 + 22306 if zRet == uintptr(0) { break } @@ -192802,8 +193235,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+33818, 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 + 33859 if zRet == uintptr(0) { break } @@ -192814,7 +193247,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 } @@ -192825,12 +193258,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 + 33864 } 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+33875, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192891,11 +193324,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15149 + v2 = __ccgo_ts + 15174 } 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+33954, 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 } @@ -192923,7 +193356,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+33973, 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 { @@ -192952,17 +193385,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)) @@ -192975,7 +193409,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 } @@ -192986,18 +193422,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+34030, 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+34061, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -193023,7 +193485,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+34082, 0) } rc = int32(SQLITE_SCHEMA) } @@ -193071,7 +193533,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) } @@ -193355,7 +193817,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+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) } @@ -193655,12 +194117,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+34109, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11798, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34113, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34137, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34146, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34191, bp) } else { i = 0 for { @@ -193668,17 +194130,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+15174, 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 + 15174 _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+34205, 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+34209, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -193692,7 +194154,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+34236, 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) } @@ -193834,7 +194296,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, 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+34278, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193940,7 +194402,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } } 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+34298, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -194195,13 +194657,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 } } @@ -194357,7 +194820,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(230285)) + rc = _sqlite3CorruptError(tls, int32(231591)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -194381,7 +194844,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(230305)) + rc = _sqlite3CorruptError(tls, int32(231611)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -194396,7 +194859,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(230315)) + rc = _sqlite3CorruptError(tls, int32(231621)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -194452,7 +194915,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(230363)) + rc = _sqlite3CorruptError(tls, int32(231669)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -194557,7 +195020,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(230451)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231757)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -194628,8 +195091,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) @@ -194663,7 +195126,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(230537)) + v7 = _sqlite3CorruptError(tls, int32(231843)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194673,7 +195136,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(230543)) + v10 = _sqlite3CorruptError(tls, int32(231849)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194752,7 +195215,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(230587)) + v16 = _sqlite3CorruptError(tls, int32(231893)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -195090,7 +195553,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 @@ -195162,7 +195625,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230952)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232258)) goto finished_invert } if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { @@ -195365,7 +195828,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+11798) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -195374,9 +195837,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+34316, 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+34329, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -195386,9 +195849,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+34335, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15149 + zSep = __ccgo_ts + 15174 } goto _2 _2: @@ -195397,7 +195860,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+34340, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -195406,13 +195869,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+34348, 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+34423, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22234 + zSep = __ccgo_ts + 22306 } goto _3 _3: @@ -195499,9 +195962,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+34429, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34233, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34340, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -195511,9 +195974,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+34335, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22234 + zSep = __ccgo_ts + 22306 } goto _1 _1: @@ -195521,9 +195984,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+34447, 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+33859, bp) zSep = __ccgo_ts + 1667 i = 0 for { @@ -195533,16 +195996,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+34423, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34348 + zSep = __ccgo_ts + 34455 } 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)) @@ -195568,7 +196031,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 @@ -195591,16 +196054,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+34460, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22240, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22312, 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+15174, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -195608,19 +196071,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+34478, 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+34489, 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)) } @@ -195643,12 +196106,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+11798, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34386) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34493) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34499) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34606) } return rc } @@ -195714,7 +196177,7 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231434)) + rc = _sqlite3CorruptError(tls, int32(232740)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -196130,7 +196593,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+34750, 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)) @@ -196143,7 +196606,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, 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+34771, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -196243,10 +196706,10 @@ 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+34790, 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+34816, 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)) @@ -196277,7 +196740,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui ** 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)))) 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 @@ -196287,7 +196750,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 } @@ -196306,18 +196769,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+34846, 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+34890, 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+34961, 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+11798) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -196374,17 +196837,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34914, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35021, 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+35051, 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+35075, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35051, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -196498,7 +196961,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) } @@ -196868,7 +197331,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) } @@ -197160,7 +197623,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 { @@ -197196,11 +197659,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 @@ -197785,6 +198254,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 @@ -197830,8 +198300,7 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset @@ -197843,12 +198312,13 @@ type Fts5Colset = TFts5Colset ** This object is used by fts5_expr.c and fts5_index.c. */ type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 + FnCol 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 ** to parse the arguments passed to the CREATE VIRTUAL TABLE statement. @@ -198225,7 +198695,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -198253,16 +198722,14 @@ 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 @@ -198304,7 +198771,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 @@ -199108,7 +199575,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+35103, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -199464,7 +199931,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+35131, 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 */ } @@ -199748,7 +200215,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+35162, 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) } @@ -199847,7 +200314,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 + 35169 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199935,7 +200402,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) } @@ -200102,7 +200569,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 + 35219 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200373,7 +200840,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))) @@ -200465,13 +200932,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) } @@ -200497,13 +200964,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 + 35267 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 + 35323 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -200536,19 +201003,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35274, + FzFunc: __ccgo_ts + 35381, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35282, + FzFunc: __ccgo_ts + 35389, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35292, + FzFunc: __ccgo_ts + 35399, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35297, + FzFunc: __ccgo_ts + 35404, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200936,7 +201403,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 @@ -201412,7 +201879,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+35420, 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) { @@ -201438,12 +201905,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+35320, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35427, 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+35458, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201452,7 +201919,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+35491, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201462,14 +201929,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+35528, 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+35537, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -201496,7 +201963,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+35570, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -201508,76 +201975,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+35604, 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+35612, 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+35537, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35644, 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+35650, 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+35562, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35669, 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+35605, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35712, 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+35562, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35669, 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+35627, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35734, 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+35748, 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+35786, 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+35690, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35797, 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+35725, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35832, 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+35732, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35839, 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+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 + 17975, }, 2: { - FzName: __ccgo_ts + 35763, + FzName: __ccgo_ts + 35870, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -201585,20 +202052,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+35878, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35802, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35909, 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+35812, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35919, 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+35846, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35953, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201659,16 +202126,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+35981) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16922) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35986, 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+36016) { *(*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+36026, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201694,7 +202161,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+36057, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201702,12 +202169,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+36062, 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+36069, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35970, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36077, 0) } } goto _1 @@ -201723,9 +202190,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+36084, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35970, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36077, 0) } goto _2 _2: @@ -201788,8 +202255,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+35981) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36092, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201820,7 +202287,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+36121, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -201850,7 +202317,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+36141, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201858,37 +202325,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+36191, 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+36246, 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 + 35604 } 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 + 35604 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36192 + zTail = __ccgo_ts + 36299 } } } 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+36307, 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+16922, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201957,7 +202424,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+36318, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -201966,16 +202433,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 + 15174 } 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+36334, 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+36341, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35981)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -202133,7 +202600,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+36367) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -202144,7 +202611,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+36372) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -202155,7 +202622,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+36381) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -202169,7 +202636,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+36391) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -202180,7 +202647,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+36401) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -202197,7 +202664,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+36413) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -202212,7 +202679,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+35981) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -202227,7 +202694,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+36425) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -202243,7 +202710,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+36439) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -202286,7 +202753,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 + 36449 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -202306,7 +202773,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+36481) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -202317,7 +202784,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+36489, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -202421,11 +202888,12 @@ type TFts5ExprNode1 = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode1 = TFts5ExprNode1 +/* Size (in bytes) of an Fts5ExprNode object that holds up to N children */ + /* ** 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. @@ -202455,24 +202923,26 @@ type TFts5ExprPhrase1 = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase1 = TFts5ExprPhrase1 +/* Size (in bytes) of an Fts5ExprPhrase object that holds up to N terms */ + /* ** 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 + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset1 = TFts5ExprNearset1 +/* Size (in bytes) of an Fts5ExprNearset object covering up to N phrases */ + /* ** Parse context. */ @@ -202563,7 +203033,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+36453, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36560, 0) return FTS5_EOF } goto _1 @@ -202574,7 +203044,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+36473, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36580, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -202589,13 +203059,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+36611, 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+36614, 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+31023, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -202639,7 +203109,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) @@ -204278,7 +204748,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) @@ -204288,7 +204758,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) @@ -204394,12 +204864,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 @@ -204533,7 +205003,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) @@ -204573,15 +205043,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)) @@ -204622,7 +205092,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 { @@ -204660,8 +205130,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+36618, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35131, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204681,10 +205151,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+36516, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36623, 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: ; @@ -204718,7 +205191,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 { @@ -204768,7 +205241,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 @@ -204819,7 +205292,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+21309, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204846,7 +205319,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)) @@ -204943,7 +205416,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+36652, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -205028,7 +205501,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) @@ -205041,7 +205514,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) @@ -205115,7 +205588,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 @@ -205141,11 +205614,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 + 36705 } else { - v2 = __ccgo_ts + 36511 + v2 = __ccgo_ts + 36618 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36605, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36712, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -205158,7 +205631,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+36762, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -205302,7 +205775,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 @@ -205635,7 +206108,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) { @@ -205699,7 +206172,7 @@ 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 +** to accumulate "term -> doclist" content before it is flushed to a level-0 ** segment. */ @@ -205758,7 +206231,7 @@ type TFts5HashEntry1 = struct { type Fts5HashEntry1 = TFts5HashEntry1 /* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -205896,7 +206369,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) } @@ -206208,7 +206681,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) } @@ -206640,9 +207113,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 @@ -206679,7 +207152,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206752,7 +207224,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206787,7 +207258,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206802,9 +207272,9 @@ 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 @@ -206901,11 +207371,12 @@ type TFts5Structure1 = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure1 = TFts5Structure1 +/* Size (in bytes) of an Fts5Structure object holding up to N levels */ + /* ** An object of type Fts5SegWriter is used to write to segments. */ @@ -207038,13 +207509,15 @@ type Fts5SegIter1 = TFts5SegIter1 ** Array of tombstone pages. Reference counted. */ type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray1 = TFts5TombstoneArray1 +/* Size (in bytes) of an Fts5TombstoneArray holding up to N tombstones */ + /* ** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. @@ -207097,11 +207570,12 @@ type TFts5Iter1 = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter1 = TFts5Iter1 +/* Size (in bytes) of an Fts5Iter object holding up to N segment iterators */ + /* ** An instance of the following type is used to iterate through the contents ** of a doclist-index record. @@ -207127,13 +207601,15 @@ type TFts5DlidxLvl1 = struct { type Fts5DlidxLvl1 = TFts5DlidxLvl1 type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } 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)) *(*Tu8)(unsafe.Pointer(aOut + 1)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) & libc.Int32FromInt32(0xFF)) @@ -207312,7 +207788,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+36815, 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. @@ -207417,7 +207893,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+36821, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -207446,7 +207922,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+36872, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -207480,7 +207956,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+36921, 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) @@ -207558,7 +208034,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)) @@ -207649,7 +208125,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+36961, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207660,7 +208136,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+36961, 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)) @@ -208341,7 +208817,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) @@ -208591,7 +209067,7 @@ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _ = nByte, nTomb, pNew nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(nTomb+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) if pNew != 0 { (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb @@ -208695,7 +209171,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 @@ -209301,7 +209777,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+36989, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -209390,7 +209866,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+37073, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -210037,7 +210513,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 @@ -210947,7 +211423,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 { @@ -211361,7 +211837,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+37155, 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. */ @@ -211867,7 +212343,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+37212, 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) @@ -212036,7 +212512,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 } @@ -212354,7 +212830,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+37273, 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))) @@ -212629,7 +213105,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: @@ -212664,7 +213140,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)) @@ -213278,11 +213754,12 @@ type TFts5TokenDataIter1 = struct { 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 // // /* @@ -213350,7 +213827,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) { @@ -213594,7 +214071,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) @@ -213644,7 +214121,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 @@ -213726,15 +214203,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) } @@ -213760,11 +214240,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+37324, 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+26058, __ccgo_ts+37332, 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+12009, __ccgo_ts+37367, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -213962,7 +214442,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) @@ -214217,7 +214697,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+37411) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -214568,7 +215048,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') @@ -214690,7 +215170,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 { @@ -214810,7 +215290,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+36815, 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))) @@ -215404,7 +215884,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+37413, 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)) @@ -215635,7 +216115,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+37499) 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)) @@ -215774,7 +216254,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215931,11 +216410,12 @@ type TFts5Sorter1 = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter1 = TFts5Sorter1 +/* Size (int bytes) of an Fts5Sorter object with N indexes */ + /* ** Virtual-table cursor object. ** @@ -216257,7 +216737,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+37504, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -216294,7 +216774,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+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++ @@ -216313,7 +216793,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+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 @@ -216763,7 +217243,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 @@ -216791,7 +217271,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) } @@ -216811,7 +217291,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) @@ -216826,7 +217306,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 + 15174 } else { v1 = __ccgo_ts + 1667 } @@ -216836,11 +217316,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 + 37543 } else { - v3 = __ccgo_ts + 37441 + v3 = __ccgo_ts + 37548 } - 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+37552, 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 @@ -216898,14 +217378,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+37607, 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+37613, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216955,7 +217435,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+37641, 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)) @@ -216988,7 +217468,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+37651, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -217022,7 +217502,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+37672, libc.VaList(bp+24, z)) } } } else { @@ -217030,7 +217510,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 + 35399 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -217187,7 +217667,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+37705, 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))) } @@ -217387,7 +217867,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+37710, 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 @@ -217520,10 +218000,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. @@ -220059,12 +220539,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+39059, 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+39163, 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+39201, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -220073,7 +220553,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+39239, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -220085,14 +220565,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+26058, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12009, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38393, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36192, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36299, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35497, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35604, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -220112,13 +220592,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 + 30698 } 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+39281, 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+39311, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -220159,7 +220639,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+39355, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -220167,7 +220647,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+39378, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -220182,7 +220662,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+39384, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -220191,22 +220671,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+35604, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39283 + zCols = __ccgo_ts + 39390 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39315 + zCols = __ccgo_ts + 39422 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36192, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36299, 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+38393, __ccgo_ts+39470, 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+36481, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -220626,12 +221106,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+39487, 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+39537, 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+39566, 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. */ @@ -220639,7 +221119,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+36481, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220941,7 +221421,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+39595, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -221071,7 +221551,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) } @@ -221173,14 +221653,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+35604, 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 @@ -221832,11 +222312,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 + 39649 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) } @@ -221846,7 +222326,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+39658) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -221863,20 +222343,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+39669) { 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+39520) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39627) { 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+39638) { 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+39658) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -222168,7 +222648,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 + 39687 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -222385,64 +222865,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+39590, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39697, 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+39700, 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+39705, 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+39710, 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+39713, 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+39716, 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+39721, 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+39726, 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+39730, 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+39736, 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+39741, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222451,49 +222931,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+39745, 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+39749, 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+39752, 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+39756, 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+39760, 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+39764, 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+39768, 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+39772, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222510,20 +222990,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+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+39776, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39756, 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+39779, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39782, 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+39786, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39772, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -222539,75 +223019,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+39682, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39789, 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+39756, 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+39797, 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+39804, 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+39809, 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+39705, 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+39814, 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+39700, 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+39819, 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+39772, 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+39824, 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+16124, 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+39829, 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+39782, 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+39833, 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+39697, 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+39838, 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+39741, 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+39844, 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+39848, 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+39850, 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+39764, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -222616,48 +223096,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+39856, 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+39772, 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+39864, 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+39756, 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+39870, 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+39756, 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+39875, 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+39697, 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+39881, 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+39768, 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+39889, 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+39897, 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+39901, 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+39764, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222665,21 +223145,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+39909, 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+39697, 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+39915, 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+39768, 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+39921, 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+39782, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222697,48 +223177,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+39821, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39928, 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+39713, 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+39933, 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+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+39606, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39713, 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+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+39606, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39713, 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+39897, 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+39950, 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+39956, 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+39697, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222754,13 +223234,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+39855, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39962, 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+39966, 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+39969, 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) @@ -222768,7 +223248,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+39972, 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) @@ -222933,14 +223413,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+39976) { 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+39562) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39669) { 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 { @@ -223208,7 +223688,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+39991)) } // C documentation @@ -223234,7 +223714,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39580, + FzName: __ccgo_ts + 39687, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -223242,7 +223722,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39892, + FzName: __ccgo_ts + 39999, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -223250,7 +223730,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39884, + FzName: __ccgo_ts + 39991, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -223280,7 +223760,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+40005, pApi, bp+96, uintptr(0)) } return rc } @@ -228796,16 +229276,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+40012) == 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+40016) == 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+40020) == 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+40029, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228868,21 +229348,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 + 40063, + 1: __ccgo_ts + 40103, + 2: __ccgo_ts + 40138, } 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+24051, *(*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+40181, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228903,23 +229384,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) } @@ -229052,10 +229533,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+40214, 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+40245, 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)) } @@ -229074,7 +229555,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+40296, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -229524,7 +230005,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+40322, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -229579,7 +230060,7 @@ 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 + 40332 } type TAggInfo_col = struct { @@ -229809,7 +230290,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 @@ -229857,11 +230338,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]uint8{'3', '.', '4', '9', '.', '1'} +var Xsqlite3_version = [7]uint8{'3', '.', '5', '0', '.', '1'} 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_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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-11.4.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\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods @@ -229871,3 +230352,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_s390x.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_s390x.go index 57e4ea9..6ee1f0f 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_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 @@ -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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70" +const SQLITE_SOURCE_ID = "2025-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95" 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 = 3 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.1" -const SQLITE_VERSION_NUMBER = 3049001 +const SQLITE_VERSION = "3.50.1" +const SQLITE_VERSION_NUMBER = 3050001 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3406,6 +3412,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 @@ -3415,9 +3424,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 @@ -4317,6 +4323,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. @@ -4673,6 +4685,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 @@ -5105,7 +5118,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -6846,11 +6858,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. */ /* @@ -7224,6 +7242,7 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem @@ -7269,6 +7288,7 @@ type THashElem1 = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem1 = THashElem1 @@ -7419,6 +7439,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. */ @@ -7477,6 +7502,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 @@ -7780,7 +7816,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData = TDbClientData @@ -7850,9 +7885,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 @@ -7867,7 +7902,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -7916,8 +7950,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 @@ -7981,7 +8015,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -8053,19 +8086,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 @@ -8079,11 +8115,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 @@ -8094,40 +8127,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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -8145,7 +8179,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -8157,6 +8191,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -8307,9 +8342,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 @@ -8364,6 +8399,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8544,7 +8580,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8586,7 +8621,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -9156,8 +9190,8 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. +/* Use SQLITE_ENABLE_EXPLAIN_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 @@ -10004,6 +10038,7 @@ type TTable1 = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table1 = TTable1 @@ -10085,11 +10120,13 @@ type TFKey1 = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey1 = TFKey1 +/* The size (in bytes) of an FKey object holding N columns. The answer +** does NOT include space to hold the zTo name. */ + /* ** SQLite supports many different ways to resolve a constraint ** error. ROLLBACK processing means that a constraint violation @@ -10138,11 +10175,12 @@ type TKeyInfo1 = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo1 = TKeyInfo1 +/* The size (in bytes) of a KeyInfo object with up to N fields */ + /* ** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. */ @@ -10544,13 +10582,16 @@ type Expr1 = TExpr1 ** expression. */ type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList1 = TExprList1 +/* The size (in bytes) of an ExprList object that is big enough to hold +** as many as N expressions. */ + /* ** Allowed values for Expr.a.eEName */ @@ -10571,12 +10612,14 @@ type ExprList1 = TExprList1 ** 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 + F__ccgo_align [0]uint64 + FnId int32 } type IdList1 = TIdList1 +/* The size (in bytes) of an IdList object that can hold up to N IDs. */ + /* ** Allowed values for IdList.eType, which determines which value of the a.u4 ** is valid. @@ -10682,13 +10725,19 @@ type OnOrUsing1 = TOnOrUsing1 ** */ type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList1 = TSrcList1 +/* Size (in bytes) of a SrcList object that can hold as many as N +** SrcItem objects. */ + +/* Size (in bytes( of a SrcList object that holds 1 SrcItem. This is a +** special case of SZ_SRCITEM(1) that comes up often. */ + /* ** Permitted values of the SrcList.a.jointype field */ @@ -11049,19 +11098,22 @@ type TParse1 = 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 @@ -11075,11 +11127,8 @@ type TParse1 = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -11090,40 +11139,41 @@ type TParse1 = 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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -11489,11 +11539,13 @@ type TWith1 = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With1 = TWith1 +/* The size (in bytes) of a With object that can hold as many +** as N different CTEs. */ + /* ** The Cte object is not guaranteed to persist for the entire duration ** of code generation. (The query flattener or other parser tree @@ -11523,11 +11575,13 @@ type TDbClientData1 = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData1 = TDbClientData1 +/* The size (in bytes) of a DbClientData object that can has a name +** that is N bytes long, including the zero-terminator. */ + /* ** This object is used in various ways, most (but not all) related to window ** functions. @@ -12693,7 +12747,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12771,7 +12824,6 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor @@ -12809,11 +12861,16 @@ type TVdbeCursor1 = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor1 = TVdbeCursor1 +/* +** The size (in bytes) of a VdbeCursor object that has an nField value of N +** or less. The value of SZ_VDBECURSOR(n) is guaranteed to be a multiple +** of 8. + */ + /* Return true if P is a null-only cursor */ @@ -13024,21 +13081,14 @@ type Tsqlite3_context1 = struct { 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 */ +/* +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. + */ // C documentation // @@ -13171,7 +13221,7 @@ type TPreUpdate1 = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -13183,6 +13233,7 @@ type TPreUpdate1 = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate1 = TPreUpdate1 @@ -13320,7 +13371,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(24453)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13492,7 +13543,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)) @@ -13879,7 +13930,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++ } @@ -13950,10 +14001,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) @@ -14089,7 +14140,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) } } @@ -14186,7 +14237,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) @@ -14327,10 +14378,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+1221, -int32(1)) @@ -14341,7 +14392,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) @@ -14419,7 +14470,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) @@ -14567,7 +14618,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)) @@ -14870,7 +14921,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 } @@ -15027,7 +15078,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('.') @@ -15075,7 +15126,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('.') @@ -15180,7 +15231,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) @@ -15909,7 +15960,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 } @@ -16558,7 +16609,8 @@ func init() { // /* // ** Initialize the mutex system. // */ -func _sqlite3MutexInit(tls *libc.TLS) (r int32) { +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 @@ -18186,17 +18238,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'), @@ -18393,22 +18445,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. */ @@ -18657,11 +18710,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 @@ -18689,7 +18742,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)) @@ -18711,7 +18764,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)) @@ -19138,29 +19191,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) @@ -19275,25 +19306,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 + 1677 + if escarg == uintptr(0) { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1677 } else { - v98 = __ccgo_ts + 1682 + v97 = __ccgo_ts + 1682 } - 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. @@ -19301,15 +19336,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) { @@ -19320,13 +19355,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) @@ -19340,35 +19408,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+1689, 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 - } - 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 + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + 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 + 1698 + uintptr(libc.Int32FromUint8(ch1)&int32(0xf)))) + } + } + } + goto _105 + _105: + ; + i1++ + } + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 + j1++ + 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) @@ -19393,9 +19524,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: ; @@ -19409,7 +19540,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+1689, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1715, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -19419,21 +19550,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+1691, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1717, 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+1701, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1727, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1722, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1748, 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: ; @@ -19672,7 +19803,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 @@ -19971,6 +20102,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 // // /* @@ -19988,11 +20121,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)) } @@ -20644,6 +20777,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 // // /* @@ -21394,7 +21558,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 { @@ -21569,7 +21733,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+1736, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1762, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -21781,11 +21945,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 @@ -22021,7 +22185,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)) @@ -22111,7 +22275,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1761 + pow63 = __ccgo_ts + 1787 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -22338,7 +22502,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+1780)) + n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1806)) if *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -22498,7 +22662,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 + 1796 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1822 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') @@ -22607,7 +22771,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-- } } @@ -23022,7 +23186,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+1798, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1824, libc.VaList(bp+8, zType)) } // C documentation @@ -23051,7 +23215,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+1843) + _logBadConnection(tls, __ccgo_ts+1869) } return 0 } else { @@ -23065,7 +23229,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+1852) + _logBadConnection(tls, __ccgo_ts+1878) return 0 } else { return int32(1) @@ -23096,7 +23260,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) { @@ -23447,23 +23611,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 @@ -23518,8 +23680,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)) } @@ -23552,9 +23714,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: ; @@ -23574,13 +23735,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 } @@ -23588,7 +23748,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 @@ -23604,7 +23764,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 { @@ -23616,7 +23776,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 } @@ -23665,7 +23825,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 @@ -23675,20 +23835,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) } @@ -23707,196 +23866,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1860, - 1: __ccgo_ts + 1870, - 2: __ccgo_ts + 1881, - 3: __ccgo_ts + 1893, - 4: __ccgo_ts + 1904, - 5: __ccgo_ts + 1916, - 6: __ccgo_ts + 1923, - 7: __ccgo_ts + 1931, - 8: __ccgo_ts + 1939, - 9: __ccgo_ts + 1944, - 10: __ccgo_ts + 1949, - 11: __ccgo_ts + 1955, - 12: __ccgo_ts + 1969, - 13: __ccgo_ts + 1975, - 14: __ccgo_ts + 1985, - 15: __ccgo_ts + 1990, - 16: __ccgo_ts + 1995, - 17: __ccgo_ts + 1998, - 18: __ccgo_ts + 2004, - 19: __ccgo_ts + 2011, - 20: __ccgo_ts + 2015, - 21: __ccgo_ts + 2025, - 22: __ccgo_ts + 2032, - 23: __ccgo_ts + 2039, - 24: __ccgo_ts + 2046, - 25: __ccgo_ts + 2053, - 26: __ccgo_ts + 2063, - 27: __ccgo_ts + 2072, - 28: __ccgo_ts + 2083, - 29: __ccgo_ts + 2092, - 30: __ccgo_ts + 2098, - 31: __ccgo_ts + 2108, - 32: __ccgo_ts + 2118, - 33: __ccgo_ts + 2123, - 34: __ccgo_ts + 2137, - 35: __ccgo_ts + 2148, - 36: __ccgo_ts + 2153, - 37: __ccgo_ts + 2160, - 38: __ccgo_ts + 2171, - 39: __ccgo_ts + 2176, - 40: __ccgo_ts + 2181, - 41: __ccgo_ts + 2187, - 42: __ccgo_ts + 2193, - 43: __ccgo_ts + 2199, - 44: __ccgo_ts + 2202, - 45: __ccgo_ts + 2206, - 46: __ccgo_ts + 2212, - 47: __ccgo_ts + 2223, - 48: __ccgo_ts + 2234, - 49: __ccgo_ts + 2242, - 50: __ccgo_ts + 2251, - 51: __ccgo_ts + 2257, - 52: __ccgo_ts + 2264, - 53: __ccgo_ts + 2272, - 54: __ccgo_ts + 2275, - 55: __ccgo_ts + 2278, - 56: __ccgo_ts + 2281, - 57: __ccgo_ts + 2284, - 58: __ccgo_ts + 2287, - 59: __ccgo_ts + 2290, - 60: __ccgo_ts + 2297, - 61: __ccgo_ts + 2307, - 62: __ccgo_ts + 2320, - 63: __ccgo_ts + 2331, - 64: __ccgo_ts + 2337, - 65: __ccgo_ts + 2344, - 66: __ccgo_ts + 2353, - 67: __ccgo_ts + 2362, - 68: __ccgo_ts + 2369, - 69: __ccgo_ts + 2382, - 70: __ccgo_ts + 2393, - 71: __ccgo_ts + 2398, - 72: __ccgo_ts + 2406, - 73: __ccgo_ts + 2412, - 74: __ccgo_ts + 2419, - 75: __ccgo_ts + 2431, - 76: __ccgo_ts + 2436, - 77: __ccgo_ts + 2445, - 78: __ccgo_ts + 2450, - 79: __ccgo_ts + 2459, - 80: __ccgo_ts + 2464, - 81: __ccgo_ts + 2469, - 82: __ccgo_ts + 2475, - 83: __ccgo_ts + 2483, - 84: __ccgo_ts + 2491, - 85: __ccgo_ts + 2501, - 86: __ccgo_ts + 2509, - 87: __ccgo_ts + 2516, - 88: __ccgo_ts + 2529, - 89: __ccgo_ts + 2534, - 90: __ccgo_ts + 2546, - 91: __ccgo_ts + 2554, - 92: __ccgo_ts + 2561, - 93: __ccgo_ts + 2572, - 94: __ccgo_ts + 2579, - 95: __ccgo_ts + 2586, - 96: __ccgo_ts + 2596, - 97: __ccgo_ts + 2605, - 98: __ccgo_ts + 2616, - 99: __ccgo_ts + 2622, - 100: __ccgo_ts + 2633, - 101: __ccgo_ts + 2643, - 102: __ccgo_ts + 2653, - 103: __ccgo_ts + 2662, - 104: __ccgo_ts + 2669, - 105: __ccgo_ts + 2675, - 106: __ccgo_ts + 2685, - 107: __ccgo_ts + 2696, - 108: __ccgo_ts + 2700, - 109: __ccgo_ts + 2709, - 110: __ccgo_ts + 2718, - 111: __ccgo_ts + 2725, - 112: __ccgo_ts + 2735, - 113: __ccgo_ts + 2742, - 114: __ccgo_ts + 2752, - 115: __ccgo_ts + 2760, - 116: __ccgo_ts + 2767, - 117: __ccgo_ts + 2781, - 118: __ccgo_ts + 2795, - 119: __ccgo_ts + 2803, - 120: __ccgo_ts + 2814, - 121: __ccgo_ts + 2827, - 122: __ccgo_ts + 2838, - 123: __ccgo_ts + 2844, - 124: __ccgo_ts + 2856, - 125: __ccgo_ts + 2865, - 126: __ccgo_ts + 2873, - 127: __ccgo_ts + 2882, - 128: __ccgo_ts + 2891, - 129: __ccgo_ts + 2898, - 130: __ccgo_ts + 2906, - 131: __ccgo_ts + 2913, - 132: __ccgo_ts + 2924, - 133: __ccgo_ts + 2938, - 134: __ccgo_ts + 2949, - 135: __ccgo_ts + 2957, - 136: __ccgo_ts + 2963, - 137: __ccgo_ts + 2971, - 138: __ccgo_ts + 2979, - 139: __ccgo_ts + 2989, - 140: __ccgo_ts + 3002, - 141: __ccgo_ts + 3012, - 142: __ccgo_ts + 3025, - 143: __ccgo_ts + 3034, - 144: __ccgo_ts + 3045, - 145: __ccgo_ts + 3053, - 146: __ccgo_ts + 3059, - 147: __ccgo_ts + 3071, - 148: __ccgo_ts + 3083, - 149: __ccgo_ts + 3091, - 150: __ccgo_ts + 3103, - 151: __ccgo_ts + 3116, - 152: __ccgo_ts + 3126, - 153: __ccgo_ts + 3136, - 154: __ccgo_ts + 3148, - 155: __ccgo_ts + 3153, - 156: __ccgo_ts + 3165, - 157: __ccgo_ts + 3175, - 158: __ccgo_ts + 3181, - 159: __ccgo_ts + 3191, - 160: __ccgo_ts + 3198, - 161: __ccgo_ts + 3210, - 162: __ccgo_ts + 3221, - 163: __ccgo_ts + 3229, - 164: __ccgo_ts + 3238, - 165: __ccgo_ts + 3247, - 166: __ccgo_ts + 3256, - 167: __ccgo_ts + 3263, - 168: __ccgo_ts + 3274, - 169: __ccgo_ts + 3287, - 170: __ccgo_ts + 3297, - 171: __ccgo_ts + 3304, - 172: __ccgo_ts + 3312, - 173: __ccgo_ts + 3321, - 174: __ccgo_ts + 3327, - 175: __ccgo_ts + 3334, - 176: __ccgo_ts + 3342, - 177: __ccgo_ts + 3350, - 178: __ccgo_ts + 3358, - 179: __ccgo_ts + 3368, - 180: __ccgo_ts + 3377, - 181: __ccgo_ts + 3388, - 182: __ccgo_ts + 3399, - 183: __ccgo_ts + 3410, - 184: __ccgo_ts + 3420, - 185: __ccgo_ts + 3426, - 186: __ccgo_ts + 3437, - 187: __ccgo_ts + 3448, - 188: __ccgo_ts + 3453, - 189: __ccgo_ts + 3461, + 0: __ccgo_ts + 1886, + 1: __ccgo_ts + 1896, + 2: __ccgo_ts + 1907, + 3: __ccgo_ts + 1919, + 4: __ccgo_ts + 1930, + 5: __ccgo_ts + 1942, + 6: __ccgo_ts + 1949, + 7: __ccgo_ts + 1957, + 8: __ccgo_ts + 1965, + 9: __ccgo_ts + 1970, + 10: __ccgo_ts + 1975, + 11: __ccgo_ts + 1981, + 12: __ccgo_ts + 1995, + 13: __ccgo_ts + 2001, + 14: __ccgo_ts + 2011, + 15: __ccgo_ts + 2016, + 16: __ccgo_ts + 2021, + 17: __ccgo_ts + 2024, + 18: __ccgo_ts + 2030, + 19: __ccgo_ts + 2037, + 20: __ccgo_ts + 2041, + 21: __ccgo_ts + 2051, + 22: __ccgo_ts + 2058, + 23: __ccgo_ts + 2065, + 24: __ccgo_ts + 2072, + 25: __ccgo_ts + 2079, + 26: __ccgo_ts + 2089, + 27: __ccgo_ts + 2098, + 28: __ccgo_ts + 2109, + 29: __ccgo_ts + 2118, + 30: __ccgo_ts + 2124, + 31: __ccgo_ts + 2134, + 32: __ccgo_ts + 2144, + 33: __ccgo_ts + 2149, + 34: __ccgo_ts + 2163, + 35: __ccgo_ts + 2174, + 36: __ccgo_ts + 2179, + 37: __ccgo_ts + 2186, + 38: __ccgo_ts + 2197, + 39: __ccgo_ts + 2202, + 40: __ccgo_ts + 2207, + 41: __ccgo_ts + 2213, + 42: __ccgo_ts + 2219, + 43: __ccgo_ts + 2225, + 44: __ccgo_ts + 2228, + 45: __ccgo_ts + 2232, + 46: __ccgo_ts + 2238, + 47: __ccgo_ts + 2249, + 48: __ccgo_ts + 2260, + 49: __ccgo_ts + 2268, + 50: __ccgo_ts + 2277, + 51: __ccgo_ts + 2283, + 52: __ccgo_ts + 2290, + 53: __ccgo_ts + 2298, + 54: __ccgo_ts + 2301, + 55: __ccgo_ts + 2304, + 56: __ccgo_ts + 2307, + 57: __ccgo_ts + 2310, + 58: __ccgo_ts + 2313, + 59: __ccgo_ts + 2316, + 60: __ccgo_ts + 2323, + 61: __ccgo_ts + 2333, + 62: __ccgo_ts + 2346, + 63: __ccgo_ts + 2357, + 64: __ccgo_ts + 2363, + 65: __ccgo_ts + 2370, + 66: __ccgo_ts + 2379, + 67: __ccgo_ts + 2388, + 68: __ccgo_ts + 2395, + 69: __ccgo_ts + 2408, + 70: __ccgo_ts + 2419, + 71: __ccgo_ts + 2424, + 72: __ccgo_ts + 2432, + 73: __ccgo_ts + 2438, + 74: __ccgo_ts + 2445, + 75: __ccgo_ts + 2457, + 76: __ccgo_ts + 2462, + 77: __ccgo_ts + 2471, + 78: __ccgo_ts + 2476, + 79: __ccgo_ts + 2485, + 80: __ccgo_ts + 2490, + 81: __ccgo_ts + 2495, + 82: __ccgo_ts + 2501, + 83: __ccgo_ts + 2509, + 84: __ccgo_ts + 2517, + 85: __ccgo_ts + 2527, + 86: __ccgo_ts + 2535, + 87: __ccgo_ts + 2542, + 88: __ccgo_ts + 2555, + 89: __ccgo_ts + 2560, + 90: __ccgo_ts + 2572, + 91: __ccgo_ts + 2580, + 92: __ccgo_ts + 2587, + 93: __ccgo_ts + 2598, + 94: __ccgo_ts + 2605, + 95: __ccgo_ts + 2612, + 96: __ccgo_ts + 2622, + 97: __ccgo_ts + 2631, + 98: __ccgo_ts + 2642, + 99: __ccgo_ts + 2648, + 100: __ccgo_ts + 2659, + 101: __ccgo_ts + 2669, + 102: __ccgo_ts + 2679, + 103: __ccgo_ts + 2688, + 104: __ccgo_ts + 2695, + 105: __ccgo_ts + 2701, + 106: __ccgo_ts + 2711, + 107: __ccgo_ts + 2722, + 108: __ccgo_ts + 2726, + 109: __ccgo_ts + 2735, + 110: __ccgo_ts + 2744, + 111: __ccgo_ts + 2751, + 112: __ccgo_ts + 2761, + 113: __ccgo_ts + 2768, + 114: __ccgo_ts + 2778, + 115: __ccgo_ts + 2786, + 116: __ccgo_ts + 2793, + 117: __ccgo_ts + 2807, + 118: __ccgo_ts + 2821, + 119: __ccgo_ts + 2829, + 120: __ccgo_ts + 2840, + 121: __ccgo_ts + 2853, + 122: __ccgo_ts + 2864, + 123: __ccgo_ts + 2870, + 124: __ccgo_ts + 2882, + 125: __ccgo_ts + 2891, + 126: __ccgo_ts + 2899, + 127: __ccgo_ts + 2908, + 128: __ccgo_ts + 2917, + 129: __ccgo_ts + 2924, + 130: __ccgo_ts + 2932, + 131: __ccgo_ts + 2939, + 132: __ccgo_ts + 2950, + 133: __ccgo_ts + 2964, + 134: __ccgo_ts + 2975, + 135: __ccgo_ts + 2983, + 136: __ccgo_ts + 2989, + 137: __ccgo_ts + 2997, + 138: __ccgo_ts + 3005, + 139: __ccgo_ts + 3015, + 140: __ccgo_ts + 3028, + 141: __ccgo_ts + 3038, + 142: __ccgo_ts + 3051, + 143: __ccgo_ts + 3060, + 144: __ccgo_ts + 3071, + 145: __ccgo_ts + 3079, + 146: __ccgo_ts + 3085, + 147: __ccgo_ts + 3097, + 148: __ccgo_ts + 3109, + 149: __ccgo_ts + 3117, + 150: __ccgo_ts + 3129, + 151: __ccgo_ts + 3142, + 152: __ccgo_ts + 3152, + 153: __ccgo_ts + 3162, + 154: __ccgo_ts + 3174, + 155: __ccgo_ts + 3179, + 156: __ccgo_ts + 3191, + 157: __ccgo_ts + 3201, + 158: __ccgo_ts + 3207, + 159: __ccgo_ts + 3217, + 160: __ccgo_ts + 3224, + 161: __ccgo_ts + 3236, + 162: __ccgo_ts + 3247, + 163: __ccgo_ts + 3255, + 164: __ccgo_ts + 3264, + 165: __ccgo_ts + 3273, + 166: __ccgo_ts + 3282, + 167: __ccgo_ts + 3289, + 168: __ccgo_ts + 3300, + 169: __ccgo_ts + 3313, + 170: __ccgo_ts + 3323, + 171: __ccgo_ts + 3330, + 172: __ccgo_ts + 3338, + 173: __ccgo_ts + 3347, + 174: __ccgo_ts + 3353, + 175: __ccgo_ts + 3360, + 176: __ccgo_ts + 3368, + 177: __ccgo_ts + 3376, + 178: __ccgo_ts + 3384, + 179: __ccgo_ts + 3394, + 180: __ccgo_ts + 3403, + 181: __ccgo_ts + 3414, + 182: __ccgo_ts + 3425, + 183: __ccgo_ts + 3436, + 184: __ccgo_ts + 3446, + 185: __ccgo_ts + 3452, + 186: __ccgo_ts + 3463, + 187: __ccgo_ts + 3474, + 188: __ccgo_ts + 3479, + 189: __ccgo_ts + 3487, } type Tregister_t = int64 @@ -24431,91 +24590,91 @@ type unix_syscall = Tunix_syscall // */ var _aSyscall = [29]Tunix_syscall{ 0: { - FzName: __ccgo_ts + 3471, + FzName: __ccgo_ts + 3497, }, 1: { - FzName: __ccgo_ts + 3476, + FzName: __ccgo_ts + 3502, }, 2: { - FzName: __ccgo_ts + 3482, + FzName: __ccgo_ts + 3508, }, 3: { - FzName: __ccgo_ts + 3489, + FzName: __ccgo_ts + 3515, }, 4: { - FzName: __ccgo_ts + 3496, + FzName: __ccgo_ts + 3522, }, 5: { - FzName: __ccgo_ts + 3501, + FzName: __ccgo_ts + 3527, }, 6: { - FzName: __ccgo_ts + 3507, + FzName: __ccgo_ts + 3533, }, 7: { - FzName: __ccgo_ts + 3517, + FzName: __ccgo_ts + 3543, }, 8: { - FzName: __ccgo_ts + 3523, + FzName: __ccgo_ts + 3549, }, 9: { - FzName: __ccgo_ts + 3528, + FzName: __ccgo_ts + 3554, }, 10: { - FzName: __ccgo_ts + 3534, + FzName: __ccgo_ts + 3560, }, 11: { - FzName: __ccgo_ts + 3542, + FzName: __ccgo_ts + 3568, }, 12: { - FzName: __ccgo_ts + 3548, + FzName: __ccgo_ts + 3574, }, 13: { - FzName: __ccgo_ts + 3555, - }, - 14: { - FzName: __ccgo_ts + 3564, - }, - 15: { - FzName: __ccgo_ts + 3571, - }, - 16: { FzName: __ccgo_ts + 3581, }, + 14: { + FzName: __ccgo_ts + 3590, + }, + 15: { + FzName: __ccgo_ts + 3597, + }, + 16: { + FzName: __ccgo_ts + 3607, + }, 17: { - FzName: __ccgo_ts + 3588, - }, - 18: { - FzName: __ccgo_ts + 3602, - }, - 19: { - FzName: __ccgo_ts + 3608, - }, - 20: { FzName: __ccgo_ts + 3614, }, - 21: { - FzName: __ccgo_ts + 3621, + 18: { + FzName: __ccgo_ts + 3628, }, - 22: { - FzName: __ccgo_ts + 3629, - }, - 23: { + 19: { FzName: __ccgo_ts + 3634, }, - 24: { - FzName: __ccgo_ts + 3641, + 20: { + FzName: __ccgo_ts + 3640, }, - 25: { - FzName: __ccgo_ts + 3648, + 21: { + FzName: __ccgo_ts + 3647, }, - 26: { + 22: { + FzName: __ccgo_ts + 3655, + }, + 23: { FzName: __ccgo_ts + 3660, }, + 24: { + FzName: __ccgo_ts + 3667, + }, + 25: { + FzName: __ccgo_ts + 3674, + }, + 26: { + FzName: __ccgo_ts + 3686, + }, 27: { - FzName: __ccgo_ts + 3669, + FzName: __ccgo_ts + 3695, }, 28: { - FzName: __ccgo_ts + 3675, + FzName: __ccgo_ts + 3701, }, } @@ -24754,9 +24913,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+3681, libc.VaList(bp+152, z, fd)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3707, 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+3724, O_RDONLY, libc.Int32FromUint32(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3750, O_RDONLY, libc.Int32FromUint32(m)) < 0 { break } } @@ -25076,7 +25235,7 @@ func _unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uint if zPath == uintptr(0) { zPath = __ccgo_ts + 1676 } - Xsqlite3_log(tls, errcode, __ccgo_ts+3734, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) + Xsqlite3_log(tls, errcode, __ccgo_ts+3760, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) return errcode } @@ -25104,7 +25263,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+3818, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3844, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if _fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3845, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3871, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -25763,7 +25922,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(40995)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -26368,7 +26527,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+3873, libc.VaList(bp+528, zFilename)) + Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3899, 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('/')) { @@ -26394,7 +26553,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+3588, bp, int32(42324)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42576)), __ccgo_ts+3614, bp, int32(42576)) } // C documentation @@ -26431,7 +26590,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)<= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43393)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -27042,7 +27201,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)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44803)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -28043,10 +28201,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 + 3930, - 3: __ccgo_ts + 3939, - 4: __ccgo_ts + 3948, - 5: __ccgo_ts + 1689, + 2: __ccgo_ts + 3956, + 3: __ccgo_ts + 3965, + 4: __ccgo_ts + 3974, + 5: __ccgo_ts + 1715, } // C documentation @@ -28055,8 +28213,8 @@ var _azTempDirs = [6]uintptr{ // ** Initialize first two members of azTempDirs[] array. // */ func _unixTempFileInit(tls *libc.TLS) { - _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3953) - _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3967) + _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3979) + _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3993) } // C documentation @@ -28118,7 +28276,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+3974, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+4000, 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++ @@ -28290,7 +28448,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+3991) + z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4017) if z != 0 { rc = _getFileMode(tls, z, pMode, pUid, pGid) } @@ -28445,7 +28603,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+3471, zName, int32(44994)) + rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45251)), __ccgo_ts+3497, zName, int32(45251)) if rc == SQLITE_OK { rc = rc2 } @@ -28522,7 +28680,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(45502)) 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+3660, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45507)), __ccgo_ts+3686, zIn, int32(45507)) return } (*(*[4098]uint8)(unsafe.Pointer(bp + 144)))[got] = uint8(0) @@ -28720,14 +28878,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+3489, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45565)), __ccgo_ts+3515, zPath, int32(45565)) } _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(45571)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<>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) } } @@ -32046,7 +32204,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) - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 0) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -32140,7 +32298,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-- - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 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)) } @@ -32181,7 +32339,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 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 @@ -32309,7 +32467,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 libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g)) + 140) + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -32329,17 +32487,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) } @@ -32357,7 +32517,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 @@ -32369,7 +32529,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) } } @@ -32570,10 +32730,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 @@ -34718,7 +34879,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 @@ -34736,7 +34897,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 } @@ -35309,6 +35470,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 { @@ -35955,7 +36125,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 @@ -35967,7 +36138,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) @@ -35988,11 +36159,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 @@ -36021,7 +36193,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 @@ -36254,7 +36426,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) } @@ -36391,7 +36563,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)) @@ -36407,7 +36579,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)< int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65269)) } 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)) @@ -40514,7 +40686,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+4187, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4213, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -41078,9 +41250,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 @@ -41284,6 +41456,11 @@ type WalCkptInfo1 = TWalCkptInfo1 /* ** An open write-ahead log file is represented by an instance of the ** following object. +** +** writeLock: +** This is usually set to 1 whenever the WRITER lock is held. However, +** if it is set to 2, then the WRITER lock is held but must be released +** by walHandleException() if a SEH exception is thrown. */ type TWal1 = struct { FpVfs uintptr @@ -41350,13 +41527,15 @@ type ht_slot = Tht_slot ** This functionality is used by the checkpoint code (see walCheckpoint()). */ type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } 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 ** is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -41414,7 +41593,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) @@ -41426,7 +41605,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) } @@ -41515,6 +41694,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 @@ -41956,7 +42136,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(67209)) } goto _1 _1: @@ -42044,12 +42224,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(67341)) 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 @@ -42183,7 +42363,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 { @@ -42814,7 +42994,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(68150)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -42930,7 +43110,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+4242, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+4268, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -43145,7 +43325,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 { @@ -43171,7 +43358,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(68601)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43894,8 +44081,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)) } @@ -43982,7 +44169,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(69451)) } iKey = _walNextHash(tls, iKey) } @@ -44479,7 +44666,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(69974)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44728,7 +44915,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, /* 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(70234)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -45500,6 +45687,11 @@ type CellInfo1 = TCellInfo1 ** assumed that the database is corrupt. */ +/* +** Maximum amount of storage local to a database page, regardless of +** page size. + */ + /* ** A cursor is a pointer to a particular entry within a particular ** b-tree within a database file. @@ -45866,10 +46058,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) { @@ -45878,14 +46071,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) { @@ -46585,7 +46778,7 @@ 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(72422)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } @@ -46763,7 +46956,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(72620)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46776,12 +46969,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(72633)) 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(72638)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46825,7 +47018,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(72683)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46833,7 +47026,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(72691)) } return SQLITE_OK } @@ -47021,7 +47214,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) } @@ -47054,7 +47247,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) } @@ -47253,7 +47446,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(73136)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -47293,12 +47486,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(73194)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73197)) } 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)) @@ -47306,21 +47499,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(73205)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73208)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73210)) } 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(73214)) } } cbrk = top + sz @@ -47367,12 +47560,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(73247)) } 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(73253)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -47388,7 +47581,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(73267)) } *(*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) @@ -47448,7 +47641,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(73324)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -47465,14 +47658,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(73339)) } 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(73346)) } return uintptr(0) } @@ -47515,11 +47708,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(73394)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73397)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -47533,7 +47726,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(73414)) } else { return SQLITE_OK } @@ -47586,42 +47779,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(73498)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47629,70 +47820,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(73510)) } - 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(73513)) } - 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(73526)) } - 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(73532)) } 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) + *(*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)) += libc.Int32FromUint16(iOrigSize) + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47738,7 +47929,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(73602)) } } } else { @@ -47764,7 +47955,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(73626)) } } } @@ -47803,12 +47994,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(73677)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73682)) } 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(73692)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73696)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47835,7 +48026,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(73708)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47866,11 +48057,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(73739)) } 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(73744)) } goto _1 _1: @@ -47899,11 +48090,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(73776)) } (*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) @@ -47912,7 +48103,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(73790)) } /* 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 @@ -47934,30 +48125,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) @@ -48065,7 +48254,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(73933)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -48127,7 +48316,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(74005)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -48215,7 +48404,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+4268) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4294) == 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 */ @@ -48839,7 +49028,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) @@ -49001,7 +49190,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+4277, uint64(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4303, uint64(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -49039,7 +49228,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(74943)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -49480,7 +49669,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(75398)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -49504,7 +49693,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(75417)) } 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) @@ -49513,7 +49702,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(75426)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -49527,7 +49716,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(75438)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -49557,7 +49746,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(75473)) } /* 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) @@ -49653,7 +49842,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(75571)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49691,7 +49880,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(75623)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -49758,7 +49947,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(75691)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49801,7 +49990,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(75742)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49831,7 +50020,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(75769)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -50297,7 +50486,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(76233)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50689,7 +50878,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(76657)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50699,7 +50888,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(76672)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50730,7 +50919,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) @@ -50756,7 +50945,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(76743)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50830,7 +51019,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(76827)) } return rc } @@ -50965,7 +51154,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(76965)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -50977,7 +51166,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(76979)) } if rc != 0 { v3 = pCur + 84 @@ -51093,7 +51282,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(77114)) } goto skip_init skip_init: @@ -51107,7 +51296,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(77126)) } 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) @@ -51341,7 +51530,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(77375)) } } } @@ -51545,7 +51734,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes p3 = pCur + 1 *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(BTCF_ValidOvfl) | libc.Int32FromInt32(BTCF_AtLast))) if !((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76795)) + return _sqlite3CorruptError(tls, int32(77571)) } goto bypass_moveto_root /* Start search on the current page */ } @@ -51608,10 +51797,10 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ if nCell < int32(2) || libc.Uint32FromInt32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77658)) 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 @@ -51639,7 +51828,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(77690)) } goto moveto_index_finish } @@ -51672,7 +51861,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(77721)) } *(*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 @@ -51681,7 +51870,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(77732)) } if rc != 0 { v11 = pCur + 84 @@ -51810,7 +51999,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(77833)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51920,7 +52109,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(77926)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -52008,7 +52197,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(78016)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -52063,7 +52252,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(78072)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -52089,7 +52278,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(78101)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52116,7 +52305,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(78135)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -52187,7 +52376,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(78200)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52325,7 +52514,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(78327)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -52376,7 +52565,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(78374)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -52385,7 +52574,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(78385)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -52475,7 +52664,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(78474)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -52493,7 +52682,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(78491)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -52516,7 +52705,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(78511)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -52737,10 +52926,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(78767)) 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 @@ -53131,12 +53320,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(79157)) } 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(79162)) } } pData -= uintptr(sz) @@ -53144,7 +53333,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(79168)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -53239,7 +53428,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(79255)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -53320,7 +53509,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: ; @@ -53347,7 +53536,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: ; @@ -53387,7 +53576,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(79377)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2))) nCell -= nShift @@ -53458,7 +53647,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(79455)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -53503,7 +53692,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(79495)) } /* 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 @@ -53699,10 +53888,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 @@ -53825,8 +54015,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 @@ -53866,7 +54056,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(79919)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53889,7 +54079,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(79943)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -54020,7 +54210,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(80044)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -54063,7 +54253,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(80077)) goto balance_cleanup } } @@ -54122,7 +54312,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(80121)) goto balance_cleanup } goto _11 @@ -54154,7 +54344,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(80154)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -54384,7 +54574,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(80355)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54630,7 +54820,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(80587)) } goto _1 _1: @@ -54703,7 +54893,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(80647)) } 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))) @@ -54862,7 +55052,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(80811)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54893,7 +55083,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(80839)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -54978,7 +55168,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(80920)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -55070,7 +55260,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(81043)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -55106,7 +55296,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(81085)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55136,10 +55326,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(81112)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81115)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -55257,12 +55447,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(81217)) } 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 @@ -55272,14 +55462,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(81242)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -55379,21 +55569,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(81338)) } } 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(81347)) } 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(81351)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81354)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -55487,7 +55677,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(81445)) } 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 @@ -55597,7 +55787,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(81561)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55638,7 +55828,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(81609)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55719,14 +55909,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(81699)) } *(*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(81706)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55863,7 +56053,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(81810)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -56128,7 +56318,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+4281, int32(1)) + Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4307, 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)) @@ -56176,11 +56366,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+4283, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4309, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4306, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4332, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -56206,11 +56396,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+4436, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4462, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -56282,11 +56472,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 + 4475 + v2 = __ccgo_ts + 4501 } else { - v2 = __ccgo_ts + 4480 + v2 = __ccgo_ts + 4506 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+4501, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4527, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -56422,12 +56612,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 + 4527 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4553 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4545, libc.VaList(bp+56, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4571, libc.VaList(bp+56, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4699, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4725, 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+4729, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4755, 0) doCoverageCheck = 0 goto _4 } @@ -56512,7 +56702,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+4753, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4779, 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 */ @@ -56535,7 +56725,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+4777, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4803, 0) depth = d2 } } else { @@ -56612,7 +56802,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+4802, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4828, 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))) @@ -56626,7 +56816,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+4839, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4865, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -56717,7 +56907,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 + 4891 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4917 _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) } @@ -56741,11 +56931,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+4902, libc.VaList(bp+248, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+4928, 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+4947, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+4973, 0) } } } @@ -56782,10 +56972,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+5002, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5028, 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+5022, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5048, libc.VaList(bp+248, i)) } goto _3 _3: @@ -57224,7 +57414,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+3873, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3899, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -57234,7 +57424,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+5054, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5080, libc.VaList(bp+432, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*32))).FpBt @@ -57263,7 +57453,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+5074, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5100, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -57293,7 +57483,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+5105, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5131, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -57971,7 +58161,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+5145, libc.VaList(bp+48, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5171, 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) } @@ -58109,9 +58299,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) @@ -58286,20 +58473,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 } @@ -58314,10 +58501,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 @@ -59071,7 +59258,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(85108)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -59235,7 +59422,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 { @@ -59243,8 +59431,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 { @@ -59301,14 +59489,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 */ @@ -59322,7 +59510,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 @@ -59347,14 +59535,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+3873, libc.VaList(bp+64, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3899, libc.VaList(bp+56, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc)) @@ -59454,7 +59642,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 + 5152 + zNeg = __ccgo_ts + 5178 } } } @@ -59469,7 +59657,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+5154, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5180, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -59773,7 +59961,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(85794)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59789,7 +59977,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(85800)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59799,7 +59987,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(85806)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -60260,12 +60448,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 @@ -60439,7 +60626,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 @@ -60456,7 +60643,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 { @@ -60524,8 +60711,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. @@ -60538,11 +60725,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 */ @@ -60579,13 +60766,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 @@ -60616,7 +60806,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 @@ -61118,7 +61308,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+5159, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5185, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -61131,39 +61321,39 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { v2 = __ccgo_ts + 1676 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+5164) == 0 { - zColl = __ccgo_ts + 5171 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+5190) == 0 { + zColl = __ccgo_ts + 5197 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 5152 + v3 = __ccgo_ts + 5178 } else { v3 = __ccgo_ts + 1676 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 5173 + v4 = __ccgo_ts + 5199 } else { v4 = __ccgo_ts + 1676 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5176, libc.VaList(bp+40, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5202, libc.VaList(bp+40, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5184, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5210, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5200, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, 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+5209, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5235, 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+5209, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5235, 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+1437, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5216, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5242, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) case -int32(12): Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1404, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): @@ -61180,14 +61370,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 + 1677 } else { - zP4 = __ccgo_ts + 5219 + zP4 = __ccgo_ts + 5245 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, libc.VaList(bp+40, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5252, 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 @@ -61202,20 +61392,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5234, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5260, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5239, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5265, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 5241 + zP4 = __ccgo_ts + 5267 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+5249, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5275, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -61229,10 +61419,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 5186, - 1: __ccgo_ts + 5188, - 2: __ccgo_ts + 5190, - 3: __ccgo_ts + 5195, + 0: __ccgo_ts + 5212, + 1: __ccgo_ts + 5214, + 2: __ccgo_ts + 5216, + 3: __ccgo_ts + 5221, } // C documentation @@ -62029,7 +62219,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 } @@ -62183,7 +62373,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+5265, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5291, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -62191,18 +62381,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+5277, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5303, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5291, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5317, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+12) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5306, 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+5332, 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) @@ -62433,7 +62623,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(90646))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63821,7 +64011,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(90727))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -63856,7 +64046,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(90757))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63910,7 +64100,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(90808))) return 0 /* Corrupt index */ } } @@ -64042,7 +64232,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(90971))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -64194,7 +64384,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(91129)) } // C documentation @@ -64225,7 +64415,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(91162)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -64376,15 +64566,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 + 5349 + zContext = __ccgo_ts + 5375 } else { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 5368 + zContext = __ccgo_ts + 5394 } else { - zContext = __ccgo_ts + 5387 + zContext = __ccgo_ts + 5413 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5396, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5422, 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 @@ -64479,10 +64669,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 @@ -64491,9 +64682,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 { @@ -64573,7 +64764,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+5432, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5458, 0) return int32(1) } else { return 0 @@ -64583,7 +64774,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+5477, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5503, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -64641,7 +64832,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(91560)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -65144,7 +65335,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+5517, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5543, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -65345,7 +65536,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(92354)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -65475,7 +65666,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(92475)) } 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) @@ -65935,18 +66126,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 + 5540, - 1: __ccgo_ts + 5545, - 2: __ccgo_ts + 5552, - 3: __ccgo_ts + 5555, - 4: __ccgo_ts + 5558, - 5: __ccgo_ts + 5561, - 6: __ccgo_ts + 5564, - 7: __ccgo_ts + 5567, - 8: __ccgo_ts + 5575, - 9: __ccgo_ts + 5578, - 10: __ccgo_ts + 5585, - 11: __ccgo_ts + 5593, + 0: __ccgo_ts + 5566, + 1: __ccgo_ts + 5571, + 2: __ccgo_ts + 5578, + 3: __ccgo_ts + 5581, + 4: __ccgo_ts + 5584, + 5: __ccgo_ts + 5587, + 6: __ccgo_ts + 5590, + 7: __ccgo_ts + 5593, + 8: __ccgo_ts + 5601, + 9: __ccgo_ts + 5604, + 10: __ccgo_ts + 5611, + 11: __ccgo_ts + 5619, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -66201,14 +66392,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(93091)) } 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(93095))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5600, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92307)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5626, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(93099)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -66359,7 +66550,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, 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) } @@ -66782,11 +66973,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(93642)) 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))) } @@ -66795,7 +66986,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) @@ -66809,7 +67000,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) } @@ -66844,7 +67035,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(93701)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66879,7 +67070,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 } @@ -66945,11 +67136,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(93797)) 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))) } @@ -66972,7 +67163,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 @@ -66994,7 +67185,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 @@ -67121,7 +67312,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5640, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5666, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(int64(zRawSql)-int64(zStart))) } } else { @@ -67159,7 +67350,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1437, 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+5145, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5171, 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 @@ -67174,28 +67365,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+5644, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5670, 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+5651, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5677, 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+5664, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5690, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5667, 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+5693, 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+5672, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5698, int32(1)) } } } @@ -67359,9 +67550,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 { @@ -67387,12 +67578,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) @@ -67401,28 +67590,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 @@ -67813,12 +68002,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 @@ -67835,7 +68024,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 @@ -67853,7 +68042,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 @@ -68567,19 +68756,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+3873, libc.VaList(bp+944, zErr)) + _sqlite3VdbeError(tls, p, __ccgo_ts+3899, libc.VaList(bp+936, zErr)) } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+5708, libc.VaList(bp+944, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+5734, 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+5729, libc.VaList(bp+944, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5755, libc.VaList(bp+936, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+3873, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3899, 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+5736, 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+5762, libc.VaList(bp+936, pcx, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, (*TVdbe)(unsafe.Pointer(p)).FzSql)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -69793,7 +69982,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 @@ -69809,6 +69998,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 */ @@ -70302,7 +70497,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(97561)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -70405,7 +70600,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+5760, 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+5784, 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+5874, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5898, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -71001,7 +71196,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+5928, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5952, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -71031,12 +71226,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 5983 + v250 = __ccgo_ts + 6007 } else { if iRollback != 0 { - v251 = __ccgo_ts + 6031 + v251 = __ccgo_ts + 6055 } else { - v251 = __ccgo_ts + 6074 + v251 = __ccgo_ts + 6098 } v250 = v251 } @@ -71128,7 +71323,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+6115) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6139) /* 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. @@ -72239,7 +72434,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(99822)) } else { goto jump_to_p2 } @@ -72698,7 +72893,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(). @@ -73131,7 +73326,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(101119)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -73461,7 +73656,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+3873, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(bp + 632)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3899, 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 @@ -73492,13 +73687,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 + 6160 + zSchema = __ccgo_ts + 6184 (*(*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+6174, 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+6198, 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 { @@ -73513,7 +73708,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(101412)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73750,7 +73945,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+6217, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6241, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -73767,15 +73962,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 @@ -73856,11 +74051,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) } @@ -74072,7 +74267,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 @@ -74122,7 +74317,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+3873, libc.VaList(bp+944, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3899, 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 { @@ -74178,7 +74373,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+3873, libc.VaList(bp+944, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3899, libc.VaList(bp+936, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, libc.Int32FromUint8(encoding)) @@ -74257,11 +74452,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 + 6254 + v286 = __ccgo_ts + 6278 } else { - v286 = __ccgo_ts + 6259 + v286 = __ccgo_ts + 6283 } - _sqlite3VdbeError(tls, p, __ccgo_ts+6266, libc.VaList(bp+944, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6290, libc.VaList(bp+936, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -74414,7 +74609,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+6318, libc.VaList(bp+944, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6342, libc.VaList(bp+936, z1)) } goto abort_due_to_error } @@ -74576,7 +74771,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+6347, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6371, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -74656,12 +74851,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)) @@ -74672,7 +74867,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+3873, libc.VaList(bp+944, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3899, libc.VaList(bp+936, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, libc.Int32FromUint8(encoding)) @@ -74766,7 +74961,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 } @@ -74794,11 +74989,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) { @@ -74926,7 +75121,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+3873, libc.VaList(bp+944, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3899, 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) @@ -75077,7 +75272,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+6357, libc.VaList(bp+944, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6381, 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 { @@ -75164,15 +75359,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) @@ -75638,11 +75825,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 3873 + v8 = __ccgo_ts + 3899 } 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) @@ -75728,7 +75915,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103962)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75827,7 +76014,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(104062)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75841,7 +76028,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 + 3873 + v1 = __ccgo_ts + 3899 } else { v1 = libc.UintptrFromInt32(0) } @@ -76288,11 +76475,12 @@ type TVdbeSorter1 = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter1 = TVdbeSorter1 +/* Size (in bytes) of a VdbeSorter object that works with N or fewer subtasks */ + /* ** An instance of the following object is used to read records out of a ** PMA, in sorted order. The next key to be read is cached in nKey/aKey. @@ -76899,8 +77087,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 @@ -76914,9 +77102,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) @@ -77114,18 +77302,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 { @@ -77413,6 +77602,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: @@ -79958,25 +80150,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+6664, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6689, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6672+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6691+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6697+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6716+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6160+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6184+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6710+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6735+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6710+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6735+7) == 0 { return int32(1) } } @@ -80015,23 +80207,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 */ @@ -80063,7 +80254,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+6724, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6749, 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 @@ -80157,7 +80348,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+6729) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6754) != 0 { goto _2 } } @@ -80179,57 +80370,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 @@ -80274,11 +80452,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+6731, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6756, 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+6735, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6760, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -80287,36 +80465,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+6739, zTab) == 0 { + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6764, 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++ @@ -80345,18 +80512,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 } } } @@ -80403,15 +80570,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+6748, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6773, 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+6779, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6804, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6816, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6841, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -80422,8 +80589,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -80463,7 +80630,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+6834, libc.VaList(bp+24, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6859, 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) @@ -80483,7 +80650,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) @@ -80492,7 +80659,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 + 6869 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6894 *(*uintptr)(unsafe.Pointer(pExpr + 32)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -80502,26 +80669,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 6878 + v8 = __ccgo_ts + 6903 } else { - v10 = __ccgo_ts + 6893 + v8 = __ccgo_ts + 6918 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6915, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6940, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6928, libc.VaList(bp+24, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6953, 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+6938, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6963, libc.VaList(bp+24, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6999, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7024, 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) } @@ -80570,8 +80737,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80645,19 +80812,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 7006 + zIn = __ccgo_ts + 7031 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 7034 + zIn = __ccgo_ts + 7059 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 7052 + zIn = __ccgo_ts + 7077 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 7070 + zIn = __ccgo_ts + 7095 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7088, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7113, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -80683,7 +80850,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 @@ -80829,7 +80996,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+7108, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7133, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -80884,7 +81051,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+7125, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7150, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -80908,7 +81075,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+7189, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7214, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) @@ -80922,13 +81089,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: ; @@ -80948,16 +81115,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+7225, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7250, 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 @@ -80968,35 +81132,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+7253, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7278, 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 + 7296 + zType = __ccgo_ts + 7321 } else { - zType = __ccgo_ts + 7303 + zType = __ccgo_ts + 7328 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7313, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7338, 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+7341, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7366, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7363, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7388, 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+7407, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7432, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -81081,7 +81248,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+7455, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7480, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) } @@ -81093,7 +81260,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+7466, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7491, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -81139,7 +81306,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+6816, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6841, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -81264,7 +81431,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+7477, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7502, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -81299,7 +81466,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+7533, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7558, 0) return int32(1) } i = 0 @@ -81337,7 +81504,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+7567, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7592, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -81407,7 +81574,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+7573, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7598, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -81441,7 +81608,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+7634, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7659, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -81754,7 +81921,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+7665, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7690, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -81821,7 +81988,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+7567) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7592) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -81832,7 +81999,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+7704) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7729) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -81842,7 +82009,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+7710, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7735, 0) return int32(WRC_Abort) } goto _6 @@ -82064,33 +82231,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 } @@ -82142,7 +82311,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) { @@ -82350,7 +82519,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 } @@ -82825,7 +82994,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6816, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6841, 0) return } if libc.Int32FromUint8(op) == int32(TK_LE) { @@ -82904,7 +83073,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+7769, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7794, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -83091,7 +83260,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) @@ -83249,11 +83418,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 7817 + v2 = __ccgo_ts + 7842 } else { v2 = __ccgo_ts + 1676 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7819, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7844, 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)) @@ -83302,7 +83471,7 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt 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)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1796) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1822) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -83330,7 +83499,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+7863, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7888, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) @@ -83350,7 +83519,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+7897, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7922, libc.VaList(bp+8, p)) } // C documentation @@ -83421,7 +83590,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+7947, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7972, libc.VaList(bp+8, pExpr)) } } } @@ -83473,7 +83642,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+7967, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7992, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -83506,7 +83675,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+8010, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8035, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -83889,7 +84058,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 @@ -84029,7 +84198,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: @@ -84050,27 +84218,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) { @@ -84116,9 +84277,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++ } @@ -84128,8 +84289,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++ } @@ -84143,7 +84304,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) } @@ -84194,7 +84355,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 @@ -84275,7 +84436,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) @@ -84293,7 +84454,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) @@ -84374,7 +84535,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+8033, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8058, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -84503,7 +84664,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+8063, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8088, libc.VaList(bp+8, zObject)) } } @@ -84601,10 +84762,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+8086) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8111) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8091) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8116) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -85282,13 +85443,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+8097) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8122) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8105) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8130) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8111) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8136) == 0 { return int32(1) } return 0 @@ -85303,32 +85464,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 + 8097, - 1: __ccgo_ts + 8105, - 2: __ccgo_ts + 8111, + 0: __ccgo_ts + 8122, + 1: __ccgo_ts + 8130, + 2: __ccgo_ts + 8136, } 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 @@ -85537,7 +85685,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 @@ -85590,7 +85738,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+8115, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8140, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -85690,12 +85838,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+1796) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1822) 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) @@ -86287,7 +86436,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+8330) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8355) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -86383,14 +86532,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 } @@ -86418,9 +86567,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) { @@ -86553,7 +86702,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) } } @@ -86683,13 +86832,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)<= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8423, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8448, libc.VaList(bp+160, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -87481,7 +87630,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)) @@ -87496,7 +87645,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+8450, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8475, libc.VaList(bp+160, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -87525,7 +87674,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) } @@ -87601,7 +87750,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8033, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8058, 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): @@ -87664,7 +87813,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6816, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6841, 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 @@ -87674,7 +87823,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) { @@ -87695,9 +87844,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 /* @@ -87779,7 +87928,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+8474, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8499, 0) return 0 } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -87850,17 +87999,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 { @@ -87869,7 +88018,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 @@ -87900,7 +88049,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 { @@ -87970,7 +88119,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) @@ -88014,7 +88163,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 @@ -88281,7 +88430,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: @@ -88490,7 +88641,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: @@ -89197,7 +89350,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) } @@ -89718,7 +89871,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) 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 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 @@ -89734,7 +89887,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) (*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 + v9 = pParse + 60 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 @@ -89819,7 +89972,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 @@ -89827,7 +89980,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 @@ -89845,7 +89998,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 } } } @@ -89864,11 +90017,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 } @@ -89986,8 +90139,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+6664, 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+8524, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6689, 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+8549, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90005,10 +90158,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+8552, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8577, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8727, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8752, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -90024,9 +90177,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+8901, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8926, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9048, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9073, 0) } } @@ -90082,7 +90235,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+9199, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9224, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -90091,11 +90244,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+9258, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9283, zName) { goto exit_rename_table } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9264, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9289, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -90125,21 +90278,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+9291, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9316, 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+9475, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9500, 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+9780, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9796, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+9805, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9821, 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+9854, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9879, 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 @@ -90147,7 +90300,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 @@ -90155,7 +90308,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+10119, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10144, 0) goto exit_rename_table exit_rename_table: ; @@ -90172,7 +90325,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+10132, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10157, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -90212,11 +90365,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+10170, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10195, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10202, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10227, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -90232,10 +90385,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+10229) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10254) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10288) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10313) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -90247,13 +90400,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10341) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10366) } _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+10387) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10412) } } /* Modify the CREATE TABLE statement. */ @@ -90267,7 +90420,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+10414, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10439, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -90295,7 +90448,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+10560, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10585, libc.VaList(bp+16, zTab, zDb)) } } } @@ -90333,12 +90486,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+10913, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10938, 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+10947, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10972, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -90353,7 +90506,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 } @@ -90361,8 +90514,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+10977, 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+11002, 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 } @@ -90423,18 +90576,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 + 10996 + zType = __ccgo_ts + 11021 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 11001 + zType = __ccgo_ts + 11026 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11015 + v1 = __ccgo_ts + 11040 } else { - v1 = __ccgo_ts + 11032 + v1 = __ccgo_ts + 11057 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11050, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11075, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90481,21 +90634,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+11068, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11093, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -90511,11 +90652,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+11089, 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+11271, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11114, 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+11296, 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+10119, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10144, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -90991,11 +91132,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 + 11402 + v1 = __ccgo_ts + 11427 } else { v1 = __ccgo_ts + 1676 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11404, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11429, 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) } @@ -91066,30 +91207,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+11427, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11452, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118867)) } 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(118888)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -91110,9 +91255,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)) @@ -91128,15 +91272,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+11435, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11460, 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)) @@ -91147,16 +91291,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++ @@ -91173,21 +91317,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 + 11402 + v1 = __ccgo_ts + 11427 } else { v1 = __ccgo_ts + 1676 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11441, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+11466, 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))) @@ -91213,7 +91357,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: ; @@ -91523,7 +91667,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 { @@ -91790,7 +91934,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) @@ -91973,7 +92117,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 { @@ -92057,8 +92201,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 @@ -92074,12 +92219,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)) @@ -92153,7 +92298,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(119856)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -92170,7 +92315,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11446, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11471, 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 @@ -92225,23 +92370,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11068, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11093, 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 + 11453 + v1 = __ccgo_ts + 11478 } else { - v1 = __ccgo_ts + 5683 + v1 = __ccgo_ts + 5709 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11465, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11490, 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+11493, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11518, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -92253,31 +92398,31 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1676, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11541, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11566, 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+11662, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11687, 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)) { @@ -92291,7 +92436,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 @@ -92302,8 +92447,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 } @@ -92364,27 +92509,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 + 11680, + FzName: __ccgo_ts + 11705, }, 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 + 11701, + FzName: __ccgo_ts + 11726, }, 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 + 11721, + FzName: __ccgo_ts + 11746, }, 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 + 11740, + FzName: __ccgo_ts + 11765, }, 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 + 11759, + FzName: __ccgo_ts + 11784, }, } @@ -92595,8 +92740,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+11862, 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+11887, 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 { @@ -92606,10 +92756,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+11885, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11910, 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+11915, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11940, 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) @@ -92641,15 +92791,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11782, - FzCols: __ccgo_ts + 11795, + FzName: __ccgo_ts + 11807, + FzCols: __ccgo_ts + 11820, }, 1: { - FzName: __ccgo_ts + 11808, - FzCols: __ccgo_ts + 11821, + FzName: __ccgo_ts + 11833, + FzCols: __ccgo_ts + 11846, }, 2: { - FzName: __ccgo_ts + 11849, + FzName: __ccgo_ts + 11874, }, } @@ -92863,7 +93013,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) { @@ -92879,12 +93030,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 @@ -92892,7 +93043,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) @@ -92951,7 +93102,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 + 11933, + FzName: __ccgo_ts + 11958, } func init() { @@ -93325,7 +93476,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 + 11943, + FzName: __ccgo_ts + 11968, } func init() { @@ -93375,7 +93526,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+11953, libc.VaList(bp+72, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11978, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -93386,7 +93537,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+11958, libc.VaList(bp+72, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11983, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -93425,7 +93576,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+11964, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+11989, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -93443,7 +93594,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 + 11970, + FzName: __ccgo_ts + 11995, } func init() { @@ -93509,7 +93660,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+11979, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+12004, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -93518,12 +93669,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+11782, uint64(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*120 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11807, 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)) @@ -93645,7 +93796,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 } @@ -93725,7 +93876,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: @@ -93756,7 +93907,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+11989, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12014, 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)) @@ -93847,7 +93998,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+11989, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12014, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -93884,7 +94035,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 @@ -93917,11 +94068,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+11993) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12018) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11997) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12022) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -94085,17 +94236,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+12001, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12026, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12012, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12037, 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+12022, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12047, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -94107,13 +94258,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) - } } } @@ -94164,7 +94308,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) } @@ -94367,8 +94511,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))) @@ -94474,11 +94618,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+11808, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11833, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+12034, __ccgo_ts+12103, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+12059, __ccgo_ts+12128, zDb) } return rc } @@ -94544,10 +94688,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+11782, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11807, (*(*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+12155, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12180, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94660,7 +94804,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+6724, 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+6749, zName) == 0) } // C documentation @@ -94712,11 +94856,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+4045) + *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4071) if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12196, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12221, 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 { @@ -94747,7 +94891,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+12199, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12224, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -94756,7 +94900,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+12236, libc.VaList(bp+56, zName)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12261, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -94768,13 +94912,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 } @@ -94812,7 +94956,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+12266, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12291, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94820,7 +94964,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+12295, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12320, 0) rc = int32(SQLITE_ERROR) } } @@ -94867,7 +95011,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+1646, 0) } else { if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12363, libc.VaList(bp+56, zFile)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12388, libc.VaList(bp+56, zFile)) } } } @@ -94929,15 +95073,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+12391, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12416, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12412, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12437, 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+12438, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12463, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -95032,7 +95176,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12460, + FzName: __ccgo_ts + 12485, } func init() { @@ -95054,7 +95198,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 + 12474, + FzName: __ccgo_ts + 12499, } func init() { @@ -95080,7 +95224,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+12488, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12513, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -95114,7 +95258,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+12512, 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+12537, 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))) @@ -95331,7 +95475,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+12558, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12583, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -95359,11 +95503,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+12581, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12606, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12587, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12612, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12593, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12618, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -95423,7 +95567,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 + 8105 + zCol = __ccgo_ts + 8130 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -95458,7 +95602,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+12620, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12645, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -95576,7 +95720,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 @@ -95674,7 +95818,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) @@ -95752,7 +95898,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) { @@ -95766,7 +95912,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) } @@ -95879,21 +96027,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+6724) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6749) == 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+6664, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6689, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6691+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6710+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6160+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6672) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6716+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6735+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6184+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6697) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6710+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6160) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6735+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6184) } } } @@ -95923,12 +96071,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6664, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6710+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6160) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6689, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6735+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6184) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6691+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6672) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6716+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6697) } } } @@ -95966,7 +96114,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+12635, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12660, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -95976,7 +96124,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) @@ -95984,15 +96132,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 + 12643 + v1 = __ccgo_ts + 12668 } else { - v1 = __ccgo_ts + 12656 + v1 = __ccgo_ts + 12681 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6928, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6953, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6999, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7024, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -96030,12 +96178,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+6664, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6160+7) == 0 { - return __ccgo_ts + 6710 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6689, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6184+7) == 0 { + return __ccgo_ts + 6735 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6672+7) == 0 { - return __ccgo_ts + 6691 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 { + return __ccgo_ts + 6716 } } return zName @@ -96560,7 +96708,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+6160) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6184) _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) @@ -96592,7 +96740,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+6724, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6749, zName) { break } goto _1 @@ -96650,13 +96798,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+12670, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12695, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12687, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12712, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96704,8 +96852,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+6664, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12707, libc.VaList(bp+8, zName)) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6689, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12732, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96741,23 +96889,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 @@ -96877,7 +97027,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 @@ -96920,9 +97070,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 + 6672 + v1 = __ccgo_ts + 6697 } else { - v1 = __ccgo_ts + 6160 + v1 = __ccgo_ts + 6184 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -96935,7 +97085,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+12749, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12774, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -96951,9 +97101,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10996 + v2 = __ccgo_ts + 11021 } else { - v2 = __ccgo_ts + 9258 + v2 = __ccgo_ts + 9283 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -96963,9 +97113,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 + 6672 + v3 = __ccgo_ts + 6697 } else { - v3 = __ccgo_ts + 6160 + v3 = __ccgo_ts + 6184 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -96989,11 +97139,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 + 10996 + v4 = __ccgo_ts + 11021 } else { - v4 = __ccgo_ts + 9258 + v4 = __ccgo_ts + 9283 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12790, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12815, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -97001,11 +97151,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+12811, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12836, 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++ @@ -97037,19 +97187,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 @@ -97069,15 +97229,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) @@ -97092,7 +97257,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 } @@ -97153,7 +97318,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+12846, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12871, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -97162,14 +97327,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+12880, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12905, 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) @@ -97201,11 +97368,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) @@ -97216,7 +97383,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+12900, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12925, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -97226,12 +97393,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+12923, 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+12948, 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+12930, 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+12955, 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-- @@ -97273,21 +97440,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+12940, 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+12965, 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) { @@ -97298,7 +97454,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. */ @@ -97311,12 +97467,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 @@ -97488,10 +97653,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+12966, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12991, 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+13011, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13036, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -97549,7 +97714,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+13052, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13077, 0) } } @@ -97577,8 +97742,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) @@ -97586,7 +97751,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+13104, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13129, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -97605,21 +97770,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 @@ -97642,7 +97796,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13145, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13170, 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) @@ -97670,8 +97824,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 { @@ -97758,17 +97917,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+13201, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13226, 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+13244, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13269, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13252, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13277, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97800,7 +97959,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13259, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13284, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -97941,9 +98100,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 @@ -97954,31 +98114,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 + 1676 - zSep2 = __ccgo_ts + 13290 - zEnd = __ccgo_ts + 5184 + zSep2 = __ccgo_ts + 13315 + zEnd = __ccgo_ts + 5210 } else { - zSep = __ccgo_ts + 13292 - zSep2 = __ccgo_ts + 13296 - zEnd = __ccgo_ts + 13301 + zSep = __ccgo_ts + 13317 + zSep2 = __ccgo_ts + 13321 + zEnd = __ccgo_ts + 13326 } - 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+13304, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.Xmemcpy(tls, zStmt, __ccgo_ts+13329, 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))++ @@ -97989,8 +98149,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)] @@ -98003,17 +98164,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+3873, 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 + 1676, - 1: __ccgo_ts + 13318, - 2: __ccgo_ts + 13324, - 3: __ccgo_ts + 13329, - 4: __ccgo_ts + 13334, - 5: __ccgo_ts + 13324, + 1: __ccgo_ts + 13343, + 2: __ccgo_ts + 13349, + 3: __ccgo_ts + 13354, + 4: __ccgo_ts + 13359, + 5: __ccgo_ts + 13349, } // C documentation @@ -98022,15 +98184,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) } @@ -98045,7 +98208,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 } @@ -98278,8 +98441,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. @@ -98379,7 +98552,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 @@ -98392,8 +98565,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++ } @@ -98423,7 +98596,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 @@ -98642,9 +98815,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+13340, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1676))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13365, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1676))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13373, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13398, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98665,11 +98838,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+13400, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13425, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13450, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13475, 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)) @@ -98716,7 +98889,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13482, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13507, 0) return } } @@ -98750,16 +98923,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 + 9258 - zType2 = __ccgo_ts + 13526 + zType = __ccgo_ts + 9283 + zType2 = __ccgo_ts + 13551 } else { /* A view */ - zType = __ccgo_ts + 10996 - zType2 = __ccgo_ts + 13532 + zType = __ccgo_ts + 11021 + zType2 = __ccgo_ts + 13557 } /* 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 @@ -98776,24 +98949,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) @@ -98841,13 +99019,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+13537, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13562, 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+13552, 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+13577, 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 @@ -98856,15 +99044,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+13650, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13675, 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+13692, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13717, 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+13726, 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+13751, 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. @@ -98882,7 +99070,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+9780) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9805) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -98915,7 +99103,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+13747, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13772, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -98932,7 +99120,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+10996, *(*uintptr)(unsafe.Pointer(bp + 112))) + _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+11021, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -99029,7 +99217,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+13783, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13808, 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. @@ -99213,7 +99401,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+13813, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13838, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -99226,7 +99414,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+13828, 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+13853, 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) } @@ -99309,9 +99497,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+13895, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13920, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11885, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11910, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -99352,7 +99540,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+13909, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13934, 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 @@ -99361,7 +99549,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+13954, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13979, 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) } @@ -99396,11 +99584,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+6664, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3496, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6689, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3522, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7466, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7491, int32(10)) == 0 { return 0 } return int32(1) @@ -99455,9 +99643,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 + 6672 + v1 = __ccgo_ts + 6697 } else { - v1 = __ccgo_ts + 6160 + v1 = __ccgo_ts + 6184 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName @@ -99490,18 +99678,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+14021, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14046, 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+14049, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14074, 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+14083, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14108, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -99511,7 +99699,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+11997, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12022, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -99559,19 +99747,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+14115, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14140, 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+14178, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14203, 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 { @@ -99628,7 +99816,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+14272, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14297, 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) { @@ -99743,11 +99931,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 */ @@ -99769,7 +99957,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 @@ -99814,13 +100002,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) } @@ -99843,23 +100031,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 @@ -99888,11 +100076,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 + 14318 + v2 = __ccgo_ts + 14343 } else { - v2 = __ccgo_ts + 14324 + v2 = __ccgo_ts + 14349 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14329, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14354, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -99970,7 +100158,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14357, *(*uintptr)(unsafe.Pointer(bp + 96))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14382, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -99980,7 +100168,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+14363, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14388, 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)) { @@ -99994,16 +100182,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+6664, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14413, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6689, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14438, 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+14441, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14466, 0) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14466, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14491, 0) goto exit_create_index } /* @@ -100024,19 +100212,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+14357, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14382, (*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+14500, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14525, 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+14534, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14559, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -100057,7 +100245,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+14558, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14583, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -100075,9 +100263,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 + 6672 + v2 = __ccgo_ts + 6697 } else { - v2 = __ccgo_ts + 6160 + v2 = __ccgo_ts + 6184 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -100105,7 +100293,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+14357) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14382) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -100137,7 +100325,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 } @@ -100189,7 +100377,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+14581, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14606, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -100204,6 +100392,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { j = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) } else { if int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16 + 8))&0xf>>0)) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) @@ -100288,7 +100477,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) @@ -100336,7 +100525,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+14642, libc.VaList(bp+136, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14667, 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 @@ -100366,8 +100555,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+14684, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14709, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127335)) goto exit_create_index } } @@ -100380,7 +100569,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 @@ -100409,9 +100598,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if onError == OE_None { v13 = __ccgo_ts + 1676 } else { - v13 = __ccgo_ts + 14701 + v13 = __ccgo_ts + 14726 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14709, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14734, 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(""); */ @@ -100419,7 +100608,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+14729, 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+14754, 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. @@ -100427,7 +100616,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+14788, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14813, 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)) @@ -100590,16 +100779,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+14815, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14840, 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+14833, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14858, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100607,9 +100796,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 + 6672 + v1 = __ccgo_ts + 6697 } else { - v1 = __ccgo_ts + 6160 + v1 = __ccgo_ts + 6184 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -100625,8 +100814,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+14906, 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+11993, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14931, 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+12018, (*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) @@ -100699,12 +100888,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) @@ -100816,13 +101005,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+14966, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14991, 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) } @@ -100903,7 +101092,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) } @@ -100953,7 +101142,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 @@ -101124,11 +101313,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 + 15002 + v1 = __ccgo_ts + 15027 } else { - v1 = __ccgo_ts + 15005 + v1 = __ccgo_ts + 15030 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15011, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15036, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -101327,7 +101516,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+15047, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15072, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -101374,9 +101563,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 + 15053 + v1 = __ccgo_ts + 15078 } else { - v1 = __ccgo_ts + 15062 + v1 = __ccgo_ts + 15087 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -101408,9 +101597,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 15047, - 1: __ccgo_ts + 15069, - 2: __ccgo_ts + 15053, + 0: __ccgo_ts + 15072, + 1: __ccgo_ts + 15094, + 2: __ccgo_ts + 15078, } // C documentation @@ -101430,7 +101619,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+15077, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15102, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -101455,7 +101644,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+12581, 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+12606, 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 @@ -101886,7 +102075,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+15277, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15302, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102768,11 +102955,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+15310, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15335, 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+15339, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15364, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102876,7 +103063,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 @@ -102933,7 +103120,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+15413, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15438, -int32(1)) return } if argc == int32(3) { @@ -104652,7 +104844,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+15446, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15471, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -104734,7 +104926,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+3873, 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+3899, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) } // C documentation @@ -104806,28 +104998,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+15491, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15516, 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+15499, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15524, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -104859,13 +105051,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+15507, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 15532 + } else { + v2 = __ccgo_ts + 15536 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: Xsqlite3_str_append(tls, pStr, __ccgo_ts+1677, 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+15539, -int32(1)) + return +} + // C documentation // // /* @@ -104877,6 +105205,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) @@ -104887,7 +105219,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) @@ -105322,7 +105654,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 } @@ -105411,7 +105743,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11402, + 0: __ccgo_ts + 11427, } // C documentation @@ -105571,7 +105903,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+15510, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+15562, int32(4), libc.UintptrFromInt32(0)) } } @@ -105632,7 +105964,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+12620, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+12645, -int32(1)) return } if argc == int32(2) { @@ -105742,7 +106074,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) { @@ -105824,7 +106156,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+15390, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15415, -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) @@ -106056,7 +106388,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) @@ -106067,7 +106399,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 { @@ -106174,7 +106506,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+15515, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15567, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -106203,8 +106535,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+15521, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15521, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+15573, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15573, 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 @@ -106384,11 +106716,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 @@ -106492,7 +106824,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))) } /* @@ -106505,542 +106837,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 + 15526, + FzName: __ccgo_ts + 15578, }, 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 + 15546, + FzName: __ccgo_ts + 15598, }, 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 + 15559, + FzName: __ccgo_ts + 15611, }, 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 + 15577, + FzName: __ccgo_ts + 15629, }, 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 + 15586, + FzName: __ccgo_ts + 15638, }, 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 + 15594, + FzName: __ccgo_ts + 15646, }, 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 + 15594, + FzName: __ccgo_ts + 15646, }, 7: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15609, + FzName: __ccgo_ts + 15661, }, 8: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15635, + FzName: __ccgo_ts + 15687, }, 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 + 15660, + FzName: __ccgo_ts + 15712, }, 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 + 15669, + FzName: __ccgo_ts + 15721, }, 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 + 15680, + FzName: __ccgo_ts + 15732, }, 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 + 15687, + FzName: __ccgo_ts + 15739, }, 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 + 15701, + FzName: __ccgo_ts + 15753, }, 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 + 15701, + FzName: __ccgo_ts + 15753, }, 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 + 15707, + FzName: __ccgo_ts + 15759, }, 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 + 15707, + FzName: __ccgo_ts + 15759, }, 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 + 15713, + FzName: __ccgo_ts + 15765, }, 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 + 15713, + FzName: __ccgo_ts + 15765, }, 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 + 15718, + FzName: __ccgo_ts + 15770, }, 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 + 15718, + FzName: __ccgo_ts + 15770, }, 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 + 15722, + FzName: __ccgo_ts + 15774, }, 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 + 15722, + FzName: __ccgo_ts + 15774, }, 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 + 15726, + FzName: __ccgo_ts + 15778, }, 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 + 15733, + FzName: __ccgo_ts + 15785, }, 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 + 15741, + FzName: __ccgo_ts + 15793, }, 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 + 15748, + FzName: __ccgo_ts + 15800, }, 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 + 15761, + FzName: __ccgo_ts + 15813, }, 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 + 15767, + FzName: __ccgo_ts + 15819, }, 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 + 15774, + FzName: __ccgo_ts + 15826, }, 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 + 15781, + FzName: __ccgo_ts + 15833, }, 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 + 15789, + FzName: __ccgo_ts + 15841, }, 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 + 15794, + FzName: __ccgo_ts + 15846, }, 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 + 15798, + FzName: __ccgo_ts + 15850, }, 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 + 15798, + FzName: __ccgo_ts + 15850, }, 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 + 15804, + FzName: __ccgo_ts + 15856, }, 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 + 15810, + FzName: __ccgo_ts + 15862, }, 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 + 15816, + FzName: __ccgo_ts + 15868, }, 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 + 15820, + FzName: __ccgo_ts + 15872, }, 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 + 15820, + FzName: __ccgo_ts + 15872, }, 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 + 15826, + FzName: __ccgo_ts + 15878, }, 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 + 15833, + FzName: __ccgo_ts + 15885, }, 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 + 15843, + FzName: __ccgo_ts + 15895, }, 43: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15850, + FzName: __ccgo_ts + 15902, }, 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 + 15857, + FzName: __ccgo_ts + 15909, }, 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 + 15868, + FzName: __ccgo_ts + 15920, }, 46: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15875, + FzName: __ccgo_ts + 15927, }, 47: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15890, + FzName: __ccgo_ts + 15942, }, 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 + 15907, + FzName: __ccgo_ts + 15959, }, 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 + 15918, + FzName: __ccgo_ts + 15970, }, 50: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15924, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.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, }, 51: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15942, + FnArg: int16(1), + FfuncFlags: 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 + 15983, }, 52: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15950, + FzName: __ccgo_ts + 15996, }, 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 + 15964, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16014, }, 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 + 15972, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16022, }, 55: { - 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 + 15981, - }, - 56: { 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 + 15981, + FzName: __ccgo_ts + 16036, + }, + 56: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16044, }, 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 + 15988, + FzName: __ccgo_ts + 16053, }, 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 + 15988, + FzName: __ccgo_ts + 16053, }, 59: { - 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, + 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 + 16060, }, 60: { - 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 + 16002, + 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 + 16060, }, 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 + 16008, + FzName: __ccgo_ts + 16070, }, 62: { - 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 + 16012, + 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 + 16074, }, 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(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16012, + 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 + 16080, }, 64: { - 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 + 16018, + 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 + 16084, }, 65: { - 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, + 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 + 16084, }, 66: { - FnArg: int16(2), + 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 + 16031, + FzName: __ccgo_ts + 16090, }, 67: { 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 + 16042, + 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 + 16090, }, 68: { 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 + 15521, + 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 + 16103, }, 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 + 16114, + }, + 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 + 15573, + }, + 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 + 15521, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16047, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1249, + FzName: __ccgo_ts + 15573, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1257, + FzName: __ccgo_ts + 16119, }, 73: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16052, + FzName: __ccgo_ts + 1249, }, 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 + 16058, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1257, }, 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 + 16061, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16124, }, 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 + 16065, + FzName: __ccgo_ts + 16130, }, 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 + 16071, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16133, }, 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 + 16061, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16137, }, 79: { FnArg: int16(1), - 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)), + FpUserData: uintptr(int64(libc.Int32FromInt32(2))), + FzName: __ccgo_ts + 16143, }, 80: { FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16080, + FfuncFlags: libc.Uint32FromInt32(libc.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, }, 81: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16084, - }, - 82: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16090, - }, - 83: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16094, - }, - 84: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16099, - }, - 85: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16104, - }, - 86: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16109, - }, - 87: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16115, - }, - 88: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16119, - }, - 89: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16123, - }, - 90: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16127, - }, - 91: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16132, - }, - 92: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16137, - }, - 93: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16142, - }, - 94: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 16148, }, + 82: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16152, + }, + 83: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16156, + }, + 84: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16162, + }, + 85: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16166, + }, + 86: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16171, + }, + 87: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16176, + }, + 88: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16181, + }, + 89: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16187, + }, + 90: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16191, + }, + 91: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16195, + }, + 92: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16199, + }, + 93: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16204, + }, + 94: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16209, + }, 95: { 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 + 16214, }, 96: { 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 + 16220, }, 97: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16165, + FzName: __ccgo_ts + 16226, }, 98: { 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 + 16232, }, 99: { + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16181, + FzName: __ccgo_ts + 16237, }, 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 + 16184, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16245, }, 101: { - 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 + 6869, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16253, }, 102: { - 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, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16256, }, 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 + 6894, + }, + 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 + 16193, + FzName: __ccgo_ts + 16261, + }, + 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 + 16265, }, } @@ -107099,109 +107442,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 ************************************************/ @@ -107425,7 +107770,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) } @@ -107518,7 +107863,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+16196, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16268, 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) @@ -108342,7 +108687,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 @@ -108629,11 +108974,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 6735, + Fz: __ccgo_ts + 6760, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 32)) = TToken{ - Fz: __ccgo_ts + 6731, + Fz: __ccgo_ts + 6756, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -108697,7 +109042,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+5319) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5345) pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = uint8(OE_Abort) @@ -108713,7 +109058,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 @@ -109279,7 +109624,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8362, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8387, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -109345,11 +109690,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 } @@ -109674,7 +110019,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) @@ -109688,7 +110033,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 @@ -109723,7 +110068,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 @@ -109736,7 +110081,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 @@ -109863,27 +110208,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 */ @@ -109964,7 +110309,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++ @@ -109991,7 +110336,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 } @@ -110000,44 +110345,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+16241, 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+16313, 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+16282, 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+16354, 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 } } @@ -110059,31 +110388,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+16314, libc.VaList(bp+128, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16386, 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 @@ -110107,10 +110436,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) @@ -110151,8 +110480,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-- } @@ -110169,34 +110498,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+16322, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16394, 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+16374, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16446, 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 @@ -110303,18 +110632,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 @@ -110324,13 +110653,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 } } } @@ -110341,14 +110670,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 } @@ -110365,16 +110694,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++ @@ -110485,11 +110814,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 */ @@ -110548,7 +110877,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16466) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16538) } goto insert_cleanup insert_cleanup: @@ -110944,7 +111273,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+12581, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12606, 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('/'))) { @@ -113178,7 +113509,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16515, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16587, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -113198,19 +113529,19 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16519, uint64(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16591, 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+16525, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16597, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113225,14 +113556,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+16568, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16640, 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) } @@ -113256,7 +113587,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+16600, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16672, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113265,7 +113596,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 16480, + 0: __ccgo_ts + 16552, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -113498,7 +113829,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16637, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16709, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -113552,63 +113883,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 + 5575, - 1: __ccgo_ts + 16676, - 2: __ccgo_ts + 9258, - 3: __ccgo_ts + 16680, - 4: __ccgo_ts + 16685, - 5: __ccgo_ts + 16688, - 6: __ccgo_ts + 16698, - 7: __ccgo_ts + 16708, - 8: __ccgo_ts + 16714, - 9: __ccgo_ts + 16718, - 10: __ccgo_ts + 16723, - 11: __ccgo_ts + 16728, - 12: __ccgo_ts + 16736, - 13: __ccgo_ts + 16747, - 14: __ccgo_ts + 16750, - 15: __ccgo_ts + 16757, - 16: __ccgo_ts + 16718, - 17: __ccgo_ts + 16723, - 18: __ccgo_ts + 16764, - 19: __ccgo_ts + 16769, - 20: __ccgo_ts + 16772, - 21: __ccgo_ts + 16779, - 22: __ccgo_ts + 16714, - 23: __ccgo_ts + 16718, - 24: __ccgo_ts + 16785, - 25: __ccgo_ts + 16790, - 26: __ccgo_ts + 16795, - 27: __ccgo_ts + 16718, - 28: __ccgo_ts + 16799, - 29: __ccgo_ts + 16723, - 30: __ccgo_ts + 16807, - 31: __ccgo_ts + 16811, - 32: __ccgo_ts + 16816, - 33: __ccgo_ts + 11997, - 34: __ccgo_ts + 11993, - 35: __ccgo_ts + 16822, - 36: __ccgo_ts + 16827, - 37: __ccgo_ts + 16832, - 38: __ccgo_ts + 16676, - 39: __ccgo_ts + 16718, - 40: __ccgo_ts + 16837, - 41: __ccgo_ts + 16844, - 42: __ccgo_ts + 16851, - 43: __ccgo_ts + 9258, - 44: __ccgo_ts + 16859, - 45: __ccgo_ts + 5578, - 46: __ccgo_ts + 16865, - 47: __ccgo_ts + 16676, - 48: __ccgo_ts + 16718, - 49: __ccgo_ts + 16870, - 50: __ccgo_ts + 16875, - 51: __ccgo_ts + 16061, - 52: __ccgo_ts + 16880, - 53: __ccgo_ts + 16893, - 54: __ccgo_ts + 16902, - 55: __ccgo_ts + 16909, - 56: __ccgo_ts + 16920, + 0: __ccgo_ts + 5601, + 1: __ccgo_ts + 16748, + 2: __ccgo_ts + 9283, + 3: __ccgo_ts + 16752, + 4: __ccgo_ts + 16757, + 5: __ccgo_ts + 16760, + 6: __ccgo_ts + 16770, + 7: __ccgo_ts + 16780, + 8: __ccgo_ts + 16786, + 9: __ccgo_ts + 16790, + 10: __ccgo_ts + 16795, + 11: __ccgo_ts + 16800, + 12: __ccgo_ts + 16808, + 13: __ccgo_ts + 16819, + 14: __ccgo_ts + 16822, + 15: __ccgo_ts + 16790, + 16: __ccgo_ts + 16829, + 17: __ccgo_ts + 16795, + 18: __ccgo_ts + 16837, + 19: __ccgo_ts + 16841, + 20: __ccgo_ts + 16846, + 21: __ccgo_ts + 16852, + 22: __ccgo_ts + 16790, + 23: __ccgo_ts + 16795, + 24: __ccgo_ts + 16859, + 25: __ccgo_ts + 16864, + 26: __ccgo_ts + 16867, + 27: __ccgo_ts + 16874, + 28: __ccgo_ts + 16786, + 29: __ccgo_ts + 16790, + 30: __ccgo_ts + 16880, + 31: __ccgo_ts + 16885, + 32: __ccgo_ts + 16890, + 33: __ccgo_ts + 16748, + 34: __ccgo_ts + 16790, + 35: __ccgo_ts + 16894, + 36: __ccgo_ts + 16901, + 37: __ccgo_ts + 16908, + 38: __ccgo_ts + 12022, + 39: __ccgo_ts + 12018, + 40: __ccgo_ts + 16916, + 41: __ccgo_ts + 16921, + 42: __ccgo_ts + 16926, + 43: __ccgo_ts + 9283, + 44: __ccgo_ts + 16931, + 45: __ccgo_ts + 5604, + 46: __ccgo_ts + 16937, + 47: __ccgo_ts + 16942, + 48: __ccgo_ts + 16133, + 49: __ccgo_ts + 16947, + 50: __ccgo_ts + 16748, + 51: __ccgo_ts + 16790, + 52: __ccgo_ts + 16960, + 53: __ccgo_ts + 16965, + 54: __ccgo_ts + 16974, + 55: __ccgo_ts + 16981, + 56: __ccgo_ts + 16992, } // C documentation @@ -113627,338 +113958,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16928, + FzName: __ccgo_ts + 17000, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16943, + FzName: __ccgo_ts + 17015, 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 + 16958, + FzName: __ccgo_ts + 17030, 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 + 16970, + FzName: __ccgo_ts + 17042, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 16986, + FzName: __ccgo_ts + 17058, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16909, + FzName: __ccgo_ts + 16981, 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 + 16999, + FzName: __ccgo_ts + 17071, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 17011, + FzName: __ccgo_ts + 17083, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17031, + FzName: __ccgo_ts + 17103, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 17047, + FzName: __ccgo_ts + 17119, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 17068, + FzName: __ccgo_ts + 17140, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 17083, + FzName: __ccgo_ts + 17155, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17099, + FzName: __ccgo_ts + 17171, 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 + 17113, + FzName: __ccgo_ts + 17185, 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 + 17126, + FzName: __ccgo_ts + 17198, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 15: { - FzName: __ccgo_ts + 17140, + FzName: __ccgo_ts + 17212, 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 + 17159, + FzName: __ccgo_ts + 17231, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 17: { - FzName: __ccgo_ts + 17178, + FzName: __ccgo_ts + 17250, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 18: { - FzName: __ccgo_ts + 17201, + FzName: __ccgo_ts + 17273, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17210, + FzName: __ccgo_ts + 17282, 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 + 17228, + FzName: __ccgo_ts + 17300, 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 + 17245, + FzName: __ccgo_ts + 17317, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 22: { - FzName: __ccgo_ts + 17258, + FzName: __ccgo_ts + 17330, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17273, + FzName: __ccgo_ts + 17345, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 24: { - FzName: __ccgo_ts + 17291, + FzName: __ccgo_ts + 17363, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 25: { - FzName: __ccgo_ts + 17301, + FzName: __ccgo_ts + 17373, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 26: { - FzName: __ccgo_ts + 17315, + FzName: __ccgo_ts + 17387, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17331, + FzName: __ccgo_ts + 17403, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 28: { - FzName: __ccgo_ts + 17356, + FzName: __ccgo_ts + 17428, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17375, + FzName: __ccgo_ts + 17447, 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 + 17386, + FzName: __ccgo_ts + 17458, 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 + 17397, + FzName: __ccgo_ts + 17469, 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 + 17409, + FzName: __ccgo_ts + 17481, 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 + 17425, + FzName: __ccgo_ts + 17497, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 34: { - FzName: __ccgo_ts + 17438, + FzName: __ccgo_ts + 17510, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 17457, + FzName: __ccgo_ts + 17529, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 36: { - FzName: __ccgo_ts + 17476, + FzName: __ccgo_ts + 17548, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17489, + FzName: __ccgo_ts + 17561, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17504, + FzName: __ccgo_ts + 17576, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17514, + FzName: __ccgo_ts + 17586, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17526, + FzName: __ccgo_ts + 17598, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17535, + FzName: __ccgo_ts + 17607, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 42: { - FzName: __ccgo_ts + 17546, + FzName: __ccgo_ts + 17618, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 43: { - FzName: __ccgo_ts + 17556, + FzName: __ccgo_ts + 17628, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17568, + FzName: __ccgo_ts + 17640, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 45: { - FzName: __ccgo_ts + 17579, + FzName: __ccgo_ts + 17651, 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 + 17591, + FzName: __ccgo_ts + 17663, 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 + 17608, + FzName: __ccgo_ts + 17680, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 48: { - FzName: __ccgo_ts + 17627, + FzName: __ccgo_ts + 17699, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 49: { - FzName: __ccgo_ts + 17653, + FzName: __ccgo_ts + 17725, 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 + 17668, + FzName: __ccgo_ts + 17740, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17682, + FzName: __ccgo_ts + 17754, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 52: { - FzName: __ccgo_ts + 17701, + FzName: __ccgo_ts + 17773, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17715, + FzName: __ccgo_ts + 17787, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17731, + FzName: __ccgo_ts + 17803, 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 + 17743, + FzName: __ccgo_ts + 17815, 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 + 17754, + FzName: __ccgo_ts + 17826, 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 + 17765, + FzName: __ccgo_ts + 17837, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -113966,45 +114297,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17777, + FzName: __ccgo_ts + 17849, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17788, + FzName: __ccgo_ts + 17860, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17809, + FzName: __ccgo_ts + 17881, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17817, + FzName: __ccgo_ts + 17889, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 62: { - FzName: __ccgo_ts + 17832, + FzName: __ccgo_ts + 17904, 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 + 17845, + FzName: __ccgo_ts + 17917, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17864, + FzName: __ccgo_ts + 17936, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 65: { - FzName: __ccgo_ts + 17879, + FzName: __ccgo_ts + 17951, 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)), @@ -114022,7 +114353,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 @@ -114130,10 +114461,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+17895) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17967) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17905) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17977) { return PAGER_LOCKINGMODE_NORMAL } } @@ -114151,13 +114482,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+8418) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8443) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17912) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17984) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17917) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17989) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -114180,10 +114511,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+16870) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+16960) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17929) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18001) == 0 { return int32(2) } else { return 0 @@ -114205,7 +114536,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+17936, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18008, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -114335,15 +114666,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch libc.Int32FromUint8(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 17998 + zName = __ccgo_ts + 18070 case int32(OE_SetDflt): - zName = __ccgo_ts + 18007 + zName = __ccgo_ts + 18079 case int32(OE_Cascade): - zName = __ccgo_ts + 18019 + zName = __ccgo_ts + 18091 case int32(OE_Restrict): - zName = __ccgo_ts + 18027 + zName = __ccgo_ts + 18099 default: - zName = __ccgo_ts + 18036 + zName = __ccgo_ts + 18108 break } return zName @@ -114364,12 +114695,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 18046, - 1: __ccgo_ts + 18053, - 2: __ccgo_ts + 18061, - 3: __ccgo_ts + 18065, - 4: __ccgo_ts + 17929, - 5: __ccgo_ts + 18074, + 0: __ccgo_ts + 18118, + 1: __ccgo_ts + 18125, + 2: __ccgo_ts + 18133, + 3: __ccgo_ts + 18137, + 4: __ccgo_ts + 18001, + 5: __ccgo_ts + 18146, } // C documentation @@ -114431,15 +114762,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 + 18099 + zType = __ccgo_ts + 18171 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18101 + zType = __ccgo_ts + 18173 } else { - zType = __ccgo_ts + 7817 + zType = __ccgo_ts + 7842 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18103, 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+18175, 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: ; @@ -114448,9 +114779,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 18078, - 2: __ccgo_ts + 18083, - 3: __ccgo_ts + 18091, + 1: __ccgo_ts + 18150, + 2: __ccgo_ts + 18155, + 3: __ccgo_ts + 18163, } // C documentation @@ -114549,7 +114880,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18110, libc.VaList(bp+176, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18182, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114592,7 +114923,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+3873, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3899, 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++ @@ -114637,7 +114968,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 @@ -114696,7 +115027,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+18114) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18186) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114739,7 +115070,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 @@ -114767,7 +115098,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 17905 + zRet = __ccgo_ts + 17977 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 @@ -114795,7 +115126,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 + 17895 + zRet = __ccgo_ts + 17967 } _returnSingleText(tls, v, zRet) break @@ -115085,7 +115416,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+18119, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18191, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -115095,7 +115426,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+3873, libc.VaList(bp+176, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+176, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -115117,7 +115448,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+18144, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18216, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -115149,8 +115480,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+18197) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18269) == 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. */ @@ -115230,9 +115562,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 + 18203 + v14 = __ccgo_ts + 18275 } else { - v14 = __ccgo_ts + 18211 + v14 = __ccgo_ts + 18283 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -115303,7 +115635,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+18218, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18290, 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)) @@ -115333,19 +115665,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 + 10996 + zType = __ccgo_ts + 11021 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13244 + zType = __ccgo_ts + 13269 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18234 + zType = __ccgo_ts + 18306 } else { - zType = __ccgo_ts + 9258 + zType = __ccgo_ts + 9283 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18241, 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+18313, 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: ; @@ -115392,9 +115724,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+18248, libc.VaList(bp+176, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18320, libc.VaList(bp+176, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18253, 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+18325, 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 @@ -115418,11 +115750,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 18258, - 1: __ccgo_ts + 18260, - 2: __ccgo_ts + 16747, + 0: __ccgo_ts + 18330, + 1: __ccgo_ts + 18332, + 2: __ccgo_ts + 16819, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18262, 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+18334, 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: ; @@ -115441,7 +115773,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+18268, 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+18340, 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: ; @@ -115458,7 +115790,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+18272, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18344, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -115508,7 +115840,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+7817, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7842, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -115520,7 +115852,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+7817, libc.VaList(bp+176, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7842, libc.VaList(bp+176, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -115546,7 +115878,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+18275, 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+18284)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18347, 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+18356)) goto _32 _32: ; @@ -115560,8 +115892,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 @@ -115687,7 +116019,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+18289, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18361, 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))) @@ -115783,7 +116115,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 @@ -115827,7 +116159,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 } @@ -115878,7 +116210,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+18293, 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+18365, 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) @@ -115889,7 +116221,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18317) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18389) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -116025,7 +116357,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+18346, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18418, 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) @@ -116087,7 +116419,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))) } @@ -116109,7 +116441,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+18382, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18454, 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) @@ -116122,7 +116454,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+18402, 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+18474, 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) { @@ -116130,7 +116462,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+18424, 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+18496, 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) { @@ -116141,10 +116473,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+18447, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18519, -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+18449, 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+18521, 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)) } } @@ -116178,7 +116510,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+18469, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18541, 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) @@ -116202,9 +116534,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+18499) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18571) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18504) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18576) _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)) @@ -116217,9 +116549,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+18525) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18597) _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+18633) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -116247,9 +116579,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+18499) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18571) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18572) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18644) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -116277,7 +116609,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+18599) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18671) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -116374,7 +116706,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 + 18626 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18698 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -116453,7 +116785,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+18687, libc.VaList(bp+176, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18759, libc.VaList(bp+176, zRight)) } } } @@ -116558,13 +116890,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+17912) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+17984) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18712) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18784) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18065) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18137) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116699,7 +117031,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 @@ -116729,7 +117061,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+6664, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6689, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -116791,7 +117123,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+18720, 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+18792, 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)) @@ -117064,34 +117396,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18629, + FzName: __ccgo_ts + 18701, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18634, + FzName: __ccgo_ts + 18706, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18640, + FzName: __ccgo_ts + 18712, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18649, + FzName: __ccgo_ts + 18721, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18658, + FzName: __ccgo_ts + 18730, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18666, + FzName: __ccgo_ts + 18738, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18674, + FzName: __ccgo_ts + 18746, }, 7: { - FzName: __ccgo_ts + 18681, + FzName: __ccgo_ts + 18753, }, 8: {}, } @@ -117187,14 +117519,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+18738) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18810) 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+18753, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18825, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) cSep = uint8(',') goto _1 _1: @@ -117203,19 +117535,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18760, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18832, 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+18766) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18838) 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+18778) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18850) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5184, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5210, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+32) if rc == SQLITE_OK { @@ -117230,7 +117562,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+3873, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -117411,7 +117743,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+3873, libc.VaList(bp+40, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+40, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -117423,13 +117755,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+18793) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18865) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18801, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18873, 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+18805, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18877, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -117438,7 +117770,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+3873, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -117564,24 +117896,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+18839, 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+18911, 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(143745)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) } else { - v1 = __ccgo_ts + 5186 + v1 = __ccgo_ts + 5212 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18867, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18939, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*uint8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18898, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18970, 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(143752)) } } } @@ -117589,9 +117921,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 18809, - 1: __ccgo_ts + 18816, - 2: __ccgo_ts + 18828, + 0: __ccgo_ts + 18881, + 1: __ccgo_ts + 18888, + 2: __ccgo_ts + 18900, } // C documentation @@ -117667,7 +117999,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+14684) + _corruptSchema(tls, pData, argv, __ccgo_ts+14709) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117700,11 +118032,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+18906) + _corruptSchema(tls, pData, argv, __ccgo_ts+18978) } 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+14684) + _corruptSchema(tls, pData, argv, __ccgo_ts+14709) } } } @@ -117743,18 +118075,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 + 9258 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9283 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6672 + v2 = __ccgo_ts + 6697 } else { - v2 = __ccgo_ts + 6160 + v2 = __ccgo_ts + 6184 } 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 + 8330 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 18919 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8355 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 18991 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -117838,7 +118170,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+12295) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12320) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117864,7 +118196,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+18991) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19063) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117879,7 +118211,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+19015, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19087, 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)) @@ -118208,7 +118540,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 @@ -118237,7 +118569,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 @@ -118297,7 +118629,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+19049, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19121, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -118313,7 +118645,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+19079, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19151, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -118336,10 +118668,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 { @@ -118347,7 +118679,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+3873, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3899, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -118377,7 +118709,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(144552)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -118511,7 +118843,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(144701)) } /* 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 @@ -118771,7 +119103,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) @@ -118779,7 +119111,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 @@ -118935,15 +119267,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 + 11402 - zSp2 = __ccgo_ts + 11402 + zSp1 = __ccgo_ts + 11427 + zSp2 = __ccgo_ts + 11427 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19098, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19170, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -119000,25 +119332,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) } @@ -119150,13 +119485,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 { @@ -119234,7 +119569,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+19128, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19200, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -119284,12 +119619,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+19178, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19250, 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. @@ -119304,9 +119639,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+19242, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19314, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -119316,6 +119652,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) @@ -119350,7 +119693,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 6869, + Fz: __ccgo_ts + 6894, Fn: uint32(8), } @@ -119398,7 +119741,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 @@ -119443,7 +119786,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) @@ -119467,7 +119810,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) @@ -119488,7 +119831,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 @@ -119611,7 +119954,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 { @@ -119738,10 +120081,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 @@ -119749,7 +120092,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 @@ -119926,7 +120269,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+19279, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19351, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -120037,8 +120380,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) @@ -120046,7 +120389,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) } @@ -120131,13 +120474,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19299 + z = __ccgo_ts + 19371 case int32(TK_INTERSECT): - z = __ccgo_ts + 19309 + z = __ccgo_ts + 19381 case int32(TK_EXCEPT): - z = __ccgo_ts + 19319 + z = __ccgo_ts + 19391 default: - z = __ccgo_ts + 19326 + z = __ccgo_ts + 19398 break } return z @@ -120158,7 +120501,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+19332, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19404, libc.VaList(bp+8, zUsage)) } /* @@ -120195,13 +120538,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 + 19355 + v1 = __ccgo_ts + 19427 } else { v1 = __ccgo_ts + 1676 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19369, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19441, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19400, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19472, 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) @@ -120225,11 +120568,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 @@ -120445,7 +120788,7 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr } if iCol < 0 { zType = __ccgo_ts + 1150 - *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16859 + *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16931 } 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)) @@ -120558,7 +120901,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 */ @@ -120567,7 +120910,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) @@ -120591,13 +120934,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 16859 + zCol = __ccgo_ts + 16931 } 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+12581, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12606, 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))) @@ -120605,7 +120948,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+19446, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19518, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120659,7 +121002,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) } @@ -120697,7 +121040,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 + 16859 + v3 = __ccgo_ts + 16931 } zName = v3 } else { @@ -120712,7 +121055,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+19446, libc.VaList(bp+40, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19518, 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. @@ -120748,7 +121091,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+19455, libc.VaList(bp+40, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19527, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -120867,7 +121210,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 + 19463 + zType = __ccgo_ts + 19535 } else { zType = uintptr(0) j = int32(1) @@ -120933,7 +121276,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) } @@ -120961,7 +121304,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) } @@ -121011,7 +121354,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 @@ -121034,7 +121377,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 @@ -121182,7 +121525,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+19467, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19539, 0) return } /* Obtain authorization to do a recursive query */ @@ -121219,7 +121562,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 @@ -121230,7 +121573,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 @@ -121244,7 +121587,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 @@ -121275,7 +121618,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+19516, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19588, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -121290,7 +121633,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+19558, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19630, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -121318,7 +121661,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+19564, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19636, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -121373,9 +121716,9 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) if nRow == int32(1) { v1 = __ccgo_ts + 1676 } else { - v1 = __ccgo_ts + 19579 + v1 = __ccgo_ts + 19651 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19581, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19653, 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) { @@ -121483,8 +121826,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+19604, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19619, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19676, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19691, 0) } /* Generate code for the left and right SELECT statements. */ @@ -121509,7 +121852,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+19299, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19371, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121535,7 +121878,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 @@ -121561,7 +121904,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+19638, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19710, 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 @@ -121593,11 +121936,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 @@ -121619,7 +121962,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+19638, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19710, 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 @@ -121726,6 +122069,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) } @@ -121742,9 +122086,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+19659, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19731, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19705, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19777, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121815,7 +122159,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+19279, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19351, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -122031,7 +122375,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) @@ -122063,7 +122407,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 { @@ -122117,16 +122461,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+7567) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7567) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7592) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7592) /* 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 @@ -122144,32 +122488,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+19787, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19859, 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+19798, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19870, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -122182,7 +122526,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+19803, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19875, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -122392,11 +122736,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 + 5164 + v1 = __ccgo_ts + 5190 } 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))) } @@ -122557,7 +122901,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 @@ -122747,9 +123091,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. @@ -122961,7 +123305,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) @@ -123108,7 +123452,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) @@ -123398,11 +123742,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 { @@ -123467,7 +123811,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 @@ -123485,12 +123829,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 { @@ -123972,7 +124316,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 @@ -124018,13 +124362,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+15718) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15770) == 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+15722) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15774) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -124112,8 +124456,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+19809, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19881, 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 @@ -124137,7 +124481,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 @@ -124219,7 +124563,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) @@ -124237,7 +124581,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+19827, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19899, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -124385,7 +124729,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) } @@ -124413,7 +124757,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+19850, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19922, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -124435,12 +124779,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+19870, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19942, 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 @@ -124457,7 +124801,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19913 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19985 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 { @@ -124488,7 +124832,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+19936, 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+20008, 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) } @@ -124497,9 +124841,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 + 19974 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20046 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20008 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20080 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -124548,7 +124892,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) { @@ -124558,7 +124902,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+20046, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20118, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124654,7 +124998,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) @@ -124663,7 +125007,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) } @@ -124714,7 +125058,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+20050, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20122, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124729,7 +125073,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+20089, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20161, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124744,7 +125088,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+15277, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15302, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124868,7 +125212,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 + 6729 + v10 = __ccgo_ts + 6754 } zSchemaName = v10 } @@ -124885,7 +125229,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+20120, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20192, 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) } @@ -124964,7 +125308,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+20125, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20197, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -124977,7 +125321,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+12581, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12606, 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) @@ -124997,9 +125341,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20134, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20206, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20152, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20224, 0) } } } @@ -125013,7 +125357,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+20172, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20244, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -125262,7 +125606,7 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint (*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))) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -125315,7 +125659,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 @@ -125352,12 +125696,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+20203, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20275, 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+20254, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20326, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -125378,7 +125722,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+20287, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20359, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -125517,7 +125861,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 @@ -125625,7 +125969,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 @@ -125692,7 +126036,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 + 20320 + v1 = __ccgo_ts + 20392 } else { v1 = __ccgo_ts + 1676 } @@ -125701,7 +126045,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp } else { v2 = __ccgo_ts + 1676 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20343, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20415, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125733,7 +126077,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+8330) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8355) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -125862,6 +126206,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. // */ @@ -125890,7 +126235,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+16012) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16084) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -125923,9 +126268,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 */ } @@ -125935,13 +126280,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 { @@ -125961,7 +126306,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) } @@ -126134,8 +126479,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 @@ -126144,11 +126489,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 { @@ -126164,7 +126509,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)) @@ -126188,14 +126533,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+20355, libc.VaList(bp+176, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20427, 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) @@ -126296,7 +126641,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+20409, 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+20481, 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 @@ -126497,14 +126842,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+20449, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20521, 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) @@ -126536,7 +126881,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 @@ -126551,7 +126896,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+20464, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20536, 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 { @@ -126605,7 +126950,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 @@ -126638,7 +126983,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 @@ -126697,7 +127042,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 @@ -126726,6 +127071,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)) @@ -126748,10 +127100,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) @@ -126785,8 +127137,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 @@ -126801,8 +127153,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 @@ -126831,8 +127183,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++ } @@ -126862,11 +127214,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.Uint16FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -126900,47 +127252,47 @@ 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)) /* 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)) /* Begin a loop that will extract all source rows in GROUP BY order. @@ -126950,16 +127302,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 @@ -126977,11 +127329,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 + 20480 + v47 = __ccgo_ts + 20552 } else { - v46 = __ccgo_ts + 20489 + v47 = __ccgo_ts + 20561 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19332, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19404, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -126995,8 +127347,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -127014,8 +127366,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -127026,12 +127378,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) @@ -127080,12 +127432,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++ } @@ -127155,9 +127511,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 @@ -127174,10 +127530,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 */ @@ -127204,8 +127560,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 } @@ -127245,32 +127601,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) @@ -127312,7 +127668,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+20480) + _explainTempTable(tls, pParse, __ccgo_ts+20552) } /* 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 @@ -127418,7 +127774,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+3873, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) if z == uintptr(0) { goto malloc_failed } @@ -127434,7 +127790,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+20498, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20570, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -127524,7 +127880,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+3873, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -127686,7 +128042,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+20563, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20635, 0) goto trigger_cleanup } iDb = int32(1) @@ -127726,7 +128082,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+20609, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20681, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -127736,11 +128092,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+20617, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20689, 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+20658, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20730, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127749,13 +128105,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+20609, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20681, (*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+20698, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20770, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127763,8 +128119,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+6664, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20724, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6689, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20796, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127772,15 +128128,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 + 20762 + v1 = __ccgo_ts + 20834 } else { - v1 = __ccgo_ts + 20769 + v1 = __ccgo_ts + 20841 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20775, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20847, 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+20812, libc.VaList(bp+112, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20884, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127800,9 +128156,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 + 6672 + v3 = __ccgo_ts + 6697 } else { - v3 = __ccgo_ts + 6160 + v3 = __ccgo_ts + 6184 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -127902,7 +128258,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+20609, bp+96) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20681, 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 } @@ -127924,7 +128280,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+20858, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20930, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -127940,10 +128296,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+20906, 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+20978, 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+20981, libc.VaList(bp+120, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21053, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -128211,11 +128567,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21010, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21082, 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) @@ -128253,9 +128609,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 + 6672 + v1 = __ccgo_ts + 6697 } else { - v1 = __ccgo_ts + 6160 + v1 = __ccgo_ts + 6184 } zTab = v1 if iDb == int32(1) { @@ -128270,7 +128626,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+21030, 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+21102, 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) } @@ -128403,11 +128759,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 + 21092 + v1 = __ccgo_ts + 21164 } else { - v1 = __ccgo_ts + 21099 + v1 = __ccgo_ts + 21171 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21106, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21178, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -128509,7 +128865,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+21154, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21226, 0) return int32(1) } @@ -128657,12 +129013,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) { @@ -128670,19 +129026,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) @@ -128693,7 +129052,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 @@ -128707,7 +129066,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 { @@ -128775,7 +129134,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+6357, 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+6381, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -128874,10 +129233,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+21196, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21268, 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 @@ -128899,7 +129260,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 @@ -128971,7 +129332,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)) @@ -129387,13 +129748,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 @@ -129401,21 +129762,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 */ @@ -129462,7 +129823,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 @@ -129501,7 +129862,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 } @@ -129545,58 +129906,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+21210, 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+21282, 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+21246, 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+21318, 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 + 8105 + v10 = __ccgo_ts + 8130 } 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 { @@ -129626,17 +129975,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++ } @@ -129648,11 +129997,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 @@ -129668,11 +130017,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 @@ -129681,18 +130030,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++ } @@ -129701,16 +130050,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. */ @@ -129728,24 +130077,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 { @@ -129771,50 +130120,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) @@ -130112,8 +130461,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -130163,8 +130512,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++ @@ -130211,11 +130560,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)) } @@ -130227,11 +130576,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. */ @@ -130274,7 +130623,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21265) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21337) } goto update_cleanup update_cleanup: @@ -130331,13 +130680,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) { @@ -130379,11 +130728,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 @@ -130708,9 +131057,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+21278, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21350, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21282, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21354, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -130799,13 +131148,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: @@ -130813,7 +131162,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+12670, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12695, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130895,7 +131244,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+21355, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21359, uint64(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21427, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21431, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -130986,7 +131335,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 @@ -131025,17 +131374,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+21363) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21435) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21403) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21475) 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+21446) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21518) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -131052,7 +131401,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+21495) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21567) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -131105,7 +131454,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+15047) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15072) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131136,11 +131485,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+21522, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21594, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21630, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21702, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131149,7 +131498,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+21684, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21756, 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 @@ -131159,7 +131508,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+21821, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21893, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -131302,7 +131651,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) @@ -131686,7 +132035,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+12900, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12925, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131809,24 +132158,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+21944, libc.VaList(bp+8, pParse+272)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22016, 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+21968, 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+22040, 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+22067, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22139, 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 @@ -131910,7 +132264,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+22086, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22158, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -131952,9 +132306,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+22128, libc.VaList(bp+48, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22200, libc.VaList(bp+48, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3873, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3899, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) } _sqlite3DbFree(tls, db, pVTable) @@ -131967,7 +132321,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 + 22158 + zFormat = __ccgo_ts + 22230 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -132001,7 +132355,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16750, 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+16822, 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 @@ -132082,13 +132436,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+22204, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22276, 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+3873, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3899, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -132169,7 +132523,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+22204, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22276, 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) @@ -132217,7 +132571,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+22223, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22295, 0) return int32(SQLITE_ERROR) } goto _1 @@ -132228,9 +132582,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(158352))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158354)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -132272,7 +132626,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 + 3873 + v3 = __ccgo_ts + 3899 } else { v3 = uintptr(0) } @@ -132638,7 +132992,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 } @@ -132728,7 +133082,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 } @@ -132748,7 +133102,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+3873, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3899, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -132812,7 +133166,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(158849)) } else { ap = va switch op { @@ -132825,7 +133179,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(158871)) break } _ = ap @@ -133510,7 +133864,6 @@ type TWhereInfo1 = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo1 = TWhereInfo1 @@ -133546,10 +133899,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 + 22236 + return __ccgo_ts + 22308 } if i == -int32(1) { - return __ccgo_ts + 16859 + return __ccgo_ts + 16931 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -133568,10 +133921,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+22243, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22315, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22249, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22321, int32(1)) } i = 0 for { @@ -133579,7 +133932,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13290, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13315, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133588,11 +133941,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5184, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5210, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22249, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22321, int32(1)) } i = 0 for { @@ -133600,16 +133953,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13290, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13315, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5186, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5212, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5184, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5210, int32(1)) } } @@ -133656,7 +134009,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+22251, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22323, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133664,12 +134017,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+22243, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22315, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22254 + v2 = __ccgo_ts + 22326 } else { - v2 = __ccgo_ts + 22259 + v2 = __ccgo_ts + 22331 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133686,7 +134039,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+22267) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22339) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133697,9 +134050,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+22269) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22341) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5184, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5210, int32(1)) } // C documentation @@ -133744,11 +134097,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 + 22271 + v2 = __ccgo_ts + 22343 } else { - v2 = __ccgo_ts + 22278 + v2 = __ccgo_ts + 22350 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22283, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22355, 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 { @@ -133761,37 +134114,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 + 11453 + zFmt = __ccgo_ts + 11478 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22289 + zFmt = __ccgo_ts + 22361 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22322 + zFmt = __ccgo_ts + 22394 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22347 + zFmt = __ccgo_ts + 22419 } else { - zFmt = __ccgo_ts + 22365 + zFmt = __ccgo_ts + 22437 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22374, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22446, 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 + 16859 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22382, libc.VaList(bp+144, zRowid)) + zRowid = __ccgo_ts + 16931 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22454, 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+22413, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22485, libc.VaList(bp+144, zRowid)) cRangeOp = uint8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133801,14 +134154,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22423, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22495, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22428) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22500) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22450 + v3 = __ccgo_ts + 22522 } else { - v3 = __ccgo_ts + 22458 + v3 = __ccgo_ts + 22530 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -133829,7 +134182,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+22464, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22536, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133895,14 +134248,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+22475, libc.VaList(bp+144, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22547, 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+22254, 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+22326, 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+22496, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22568, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -133926,16 +134279,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+22243, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22315, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22254, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22326, libc.VaList(bp+144, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5184, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5210, 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 @@ -134140,7 +134493,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 @@ -134219,7 +134572,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 */ @@ -134339,7 +134692,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i 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)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(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)) } @@ -134351,7 +134704,7 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } else { v3 = n } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(v3))) eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } pX = pExpr @@ -134389,10 +134742,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 @@ -134581,7 +134934,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 @@ -134712,7 +135065,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 @@ -134994,7 +135347,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 @@ -135055,11 +135408,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 @@ -135090,6 +135443,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 { @@ -135228,7 +135584,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 @@ -135308,7 +135664,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 @@ -135342,7 +135698,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 @@ -135464,7 +135820,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 @@ -135657,7 +136013,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: @@ -135671,12 +136027,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 { @@ -135714,11 +136071,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 */ @@ -135738,7 +136095,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 } @@ -135774,21 +136131,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 @@ -135806,7 +136163,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, @@ -135861,7 +136218,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+22504, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22576, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135884,7 +136241,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+22519, libc.VaList(bp+96, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22591, 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)) @@ -136373,9 +136730,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 @@ -136384,7 +136741,7 @@ 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+22528, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22600, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { @@ -136430,15 +136787,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 @@ -136450,7 +136808,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) { @@ -136523,7 +136881,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) @@ -136921,19 +137279,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16708, + FzOp: __ccgo_ts + 16780, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16042, + FzOp: __ccgo_ts + 16114, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15521, + FzOp: __ccgo_ts + 15573, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22542, + FzOp: __ccgo_ts + 22614, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -137721,7 +138079,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+22549, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22621, 0) return } } else { @@ -137733,10 +138091,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+22549, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22621, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137817,7 +138175,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 + 8091 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8116 *(*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) @@ -137918,7 +138276,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 + 22590 + v13 = __ccgo_ts + 22662 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -138449,7 +138807,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+22597, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22669, 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) @@ -138521,7 +138879,6 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo @@ -138532,7 +138889,6 @@ type THiddenIndexInfo1 = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo1 = THiddenIndexInfo1 @@ -139565,7 +139921,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)<>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 @@ -142182,7 +142534,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { + })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0)) { if libc.Int32FromUint16((*(*struct { FnEq Tu16 FnBtm Tu16 @@ -142386,7 +142738,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 @@ -142670,7 +143022,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) } } @@ -142848,7 +143200,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)) @@ -143189,7 +143541,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+22670, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22742, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143264,7 +143616,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+22670, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22742, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143418,7 +143770,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(168893)) /* 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) @@ -143854,7 +144206,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+22696, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22768, 0) rc = SQLITE_OK } else { break @@ -145062,7 +145414,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22731, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22803, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145640,7 +145992,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 @@ -145796,7 +146148,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+22749, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22821, 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 @@ -145817,11 +146169,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) @@ -145869,7 +146218,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+22777, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22849, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -146014,7 +146363,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 @@ -146048,7 +146398,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. @@ -146174,7 +146524,7 @@ 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 @@ -146205,16 +146555,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 @@ -146393,7 +146743,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 { @@ -146600,7 +146950,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 @@ -146610,7 +146960,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+22795, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22867, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146660,7 +147010,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 } @@ -146929,7 +147279,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+22824, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22896, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -147111,7 +147461,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+22880, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22952, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -147437,7 +147787,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+22925, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22997, libc.VaList(bp+8, zName)) } return p } @@ -147488,12 +147838,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+22944, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23016, 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+23015, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23087, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -147566,7 +147916,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+8330) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8355) } break } @@ -147704,7 +148054,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( 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 { @@ -147848,7 +148198,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+23078, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23150, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147884,7 +148234,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)) } @@ -147899,7 +148249,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 @@ -147918,11 +148268,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 { @@ -147968,11 +148318,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 @@ -147989,7 +148339,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+1796)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1822)) } 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)) @@ -148011,7 +148361,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 @@ -148135,7 +148485,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+23104, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23176, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -148203,18 +148553,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 + 23136 + zErr = __ccgo_ts + 23208 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23153 + zErr = __ccgo_ts + 23225 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23169 + zErr = __ccgo_ts + 23241 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23189, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23261, 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 { @@ -148238,7 +148588,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+23222, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23294, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -148344,24 +148694,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 @@ -148379,12 +148729,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) } @@ -148396,15 +148746,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 @@ -148456,11 +148806,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 23269, - 1: __ccgo_ts + 23322, - 2: __ccgo_ts + 22824, - 3: __ccgo_ts + 23373, - 4: __ccgo_ts + 23425, + 0: __ccgo_ts + 23341, + 1: __ccgo_ts + 23394, + 2: __ccgo_ts + 22896, + 3: __ccgo_ts + 23445, + 4: __ccgo_ts + 23497, } var _aOp1 = [5]int32{ @@ -149040,7 +149390,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 } @@ -149136,7 +149486,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 '' */ @@ -149853,12 +150203,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 @@ -149866,13 +150216,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 @@ -149892,13 +150242,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 @@ -149925,7 +150275,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 @@ -150144,6 +150494,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. @@ -150204,7 +150558,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+23475, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23547, libc.VaList(bp+8, p)) } // C documentation @@ -150218,6 +150572,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) } @@ -150251,11 +150606,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 + 23499 + v1 = __ccgo_ts + 23571 } else { - v1 = __ccgo_ts + 23508 + v1 = __ccgo_ts + 23580 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23514, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23586, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -150264,7 +150619,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23556, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23628, 0) } } } @@ -150370,7 +150725,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+23590, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23662, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -156891,13 +157246,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) } @@ -158827,20 +159182,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+16859, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16931, 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+23628, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23700, 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+16772, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16867, 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+23628, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23700, 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 @@ -158881,7 +159236,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 */ @@ -159026,7 +159386,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 */ @@ -159116,9 +159481,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) } @@ -159473,7 +159838,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+23655) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23727) 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) { @@ -159823,9 +160188,9 @@ _237: */ _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 + 8086 + v347 = __ccgo_ts + 8111 } else { - v347 = __ccgo_ts + 8091 + v347 = __ccgo_ts + 8116 } *(*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 { @@ -160067,15 +160432,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+23664, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23736, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23759, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23831, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23843, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23915, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -160217,7 +160582,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 */ @@ -160411,7 +160776,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+23928, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24000, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -163142,14 +163507,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)< int32(65528) { sz = int32(65528) } - if cnt < 0 { + /* 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 > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } szAlloc = int64(sz) * int64(cnt) - if sz == 0 || cnt == 0 { + 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)) @@ -164625,7 +164999,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182779)) + return _sqlite3MisuseError(tls, int32(183820)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164645,7 +165019,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+24015, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24087, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -164946,14 +165320,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 + 24558 + zErr = __ccgo_ts + 24630 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -164965,31 +165339,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 24083, - 1: __ccgo_ts + 24096, - 3: __ccgo_ts + 24112, - 4: __ccgo_ts + 24137, - 5: __ccgo_ts + 24151, - 6: __ccgo_ts + 24170, + 0: __ccgo_ts + 24155, + 1: __ccgo_ts + 24168, + 3: __ccgo_ts + 24184, + 4: __ccgo_ts + 24209, + 5: __ccgo_ts + 24223, + 6: __ccgo_ts + 24242, 7: __ccgo_ts + 1646, - 8: __ccgo_ts + 24195, - 9: __ccgo_ts + 24232, - 10: __ccgo_ts + 24244, - 11: __ccgo_ts + 24259, - 12: __ccgo_ts + 24292, - 13: __ccgo_ts + 24310, - 14: __ccgo_ts + 24335, - 15: __ccgo_ts + 24364, - 17: __ccgo_ts + 6115, - 18: __ccgo_ts + 5517, - 19: __ccgo_ts + 24381, - 20: __ccgo_ts + 24399, - 21: __ccgo_ts + 24417, - 23: __ccgo_ts + 24451, - 25: __ccgo_ts + 24472, - 26: __ccgo_ts + 24498, - 27: __ccgo_ts + 24521, - 28: __ccgo_ts + 24542, + 8: __ccgo_ts + 24267, + 9: __ccgo_ts + 24304, + 10: __ccgo_ts + 24316, + 11: __ccgo_ts + 24331, + 12: __ccgo_ts + 24364, + 13: __ccgo_ts + 24382, + 14: __ccgo_ts + 24407, + 15: __ccgo_ts + 24436, + 17: __ccgo_ts + 6139, + 18: __ccgo_ts + 5543, + 19: __ccgo_ts + 24453, + 20: __ccgo_ts + 24471, + 21: __ccgo_ts + 24489, + 23: __ccgo_ts + 24523, + 25: __ccgo_ts + 24544, + 26: __ccgo_ts + 24570, + 27: __ccgo_ts + 24593, + 28: __ccgo_ts + 24614, } // C documentation @@ -165136,6 +165510,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 // // /* @@ -165168,7 +165556,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i 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(183430)) + return _sqlite3MisuseError(tls, int32(184509)) } 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) @@ -165211,7 +165599,7 @@ 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+24639, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24711, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165337,7 +165725,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+24702, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24774, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -165368,7 +165756,7 @@ 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+3873, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -165612,7 +166000,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(184046)) + return _sqlite3MisuseError(tls, int32(185125)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*uint8)(unsafe.Pointer(zDb)) != 0 { @@ -165622,7 +166010,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+24753, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24825, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165744,7 +166132,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(184182))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185261))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165876,7 +166264,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(184261)) + return _sqlite3MisuseError(tls, int32(185340)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165886,7 +166274,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(184270)) + return _sqlite3MisuseError(tls, int32(185349)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165935,7 +166323,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(184318)) + return _sqlite3MisuseError(tls, int32(185397)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -165944,7 +166332,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+24774, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24846, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -166091,7 +166479,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+24842, 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+24914, 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 @@ -166121,8 +166509,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+24848, zUri+7, uint64(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24858, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24920, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24930, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -166211,24 +166599,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+24886, zOpt, uint64(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24958, 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+24890, zOpt, uint64(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24962, 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 + 24890 + zModeType = __ccgo_ts + 24962 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24911, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24983, 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 + 3482 + zModeType = __ccgo_ts + 3508 } if aMode != 0 { mode = 0 @@ -166257,12 +166645,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+24926, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24998, 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+24946, 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_PERM) goto parse_uri_out } @@ -166286,7 +166674,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+24970, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25042, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -166306,11 +166694,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24896, + Fz: __ccgo_ts + 24968, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24903, + Fz: __ccgo_ts + 24975, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -166321,19 +166709,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24916, + Fz: __ccgo_ts + 24988, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24919, + Fz: __ccgo_ts + 24991, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24922, + Fz: __ccgo_ts + 24994, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17929, + Fz: __ccgo_ts + 18001, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -166461,8 +166849,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+22590, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+24986, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+22662, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25058, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -166483,10 +166871,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(184993)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186072)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 4268 + zFilename = __ccgo_ts + 4294 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+8, bp+16) } @@ -166495,7 +166883,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 + 3873 + v2 = __ccgo_ts + 3899 } else { v2 = uintptr(0) } @@ -166522,9 +166910,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 + 6724 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6749 (*(*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 + 23988 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 24060 (*(*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 { @@ -166618,7 +167006,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 24992 + zFilename = __ccgo_ts + 25064 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16BE), libc.UintptrFromInt32(0)) @@ -166778,7 +167166,7 @@ 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) @@ -166835,20 +167223,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+24995, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+25067, 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+25020) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25092) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25040) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25112) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25047) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25119) } // C documentation @@ -166873,9 +167261,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) @@ -166902,29 +167290,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 @@ -166979,15 +167356,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+25064, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25136, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 3873 + v2 = __ccgo_ts + 3899 } 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) @@ -167166,8 +167543,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 @@ -167611,7 +167988,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: ; @@ -168007,7 +168384,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+25092, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25164, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -168225,7 +168602,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 25100 + v2 = __ccgo_ts + 25172 } else { v2 = uintptr(0) } @@ -168304,7 +168681,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) @@ -168471,7 +168848,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 @@ -168688,6 +169065,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -169000,8 +169384,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 @@ -169058,7 +169442,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 @@ -169068,7 +169452,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 @@ -169106,18 +169490,18 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // */ var _jsonbType = [17]uintptr{ 0: __ccgo_ts + 1662, - 1: __ccgo_ts + 8086, - 2: __ccgo_ts + 8091, - 3: __ccgo_ts + 6400, - 4: __ccgo_ts + 6400, - 5: __ccgo_ts + 6395, - 6: __ccgo_ts + 6395, - 7: __ccgo_ts + 8397, - 8: __ccgo_ts + 8397, - 9: __ccgo_ts + 8397, - 10: __ccgo_ts + 8397, - 11: __ccgo_ts + 25123, - 12: __ccgo_ts + 25129, + 1: __ccgo_ts + 8111, + 2: __ccgo_ts + 8116, + 3: __ccgo_ts + 6425, + 4: __ccgo_ts + 6425, + 5: __ccgo_ts + 6420, + 6: __ccgo_ts + 6420, + 7: __ccgo_ts + 8422, + 8: __ccgo_ts + 8422, + 9: __ccgo_ts + 8422, + 10: __ccgo_ts + 8422, + 11: __ccgo_ts + 25195, + 12: __ccgo_ts + 25201, 13: __ccgo_ts + 1676, 14: __ccgo_ts + 1676, 15: __ccgo_ts + 1676, @@ -169604,7 +169988,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) { @@ -169902,8 +170286,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 + 25136 + 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 + 25136 + 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 + 1698 + 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 + 1698 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(6) } } @@ -170039,7 +170423,7 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { case int32(SQLITE_NULL): _jsonAppendRawNZ(tls, p, __ccgo_ts+1662, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+15491, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15516, 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)) @@ -170053,14 +170437,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+25153, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25208, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -170114,7 +170496,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+25182, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25237, -int32(1)) } } } @@ -170397,8 +170779,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(3), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25197, - FzRepl: __ccgo_ts + 25201, + FzMatch: __ccgo_ts + 25252, + FzRepl: __ccgo_ts + 25256, }, 1: { Fc1: uint8('i'), @@ -170406,8 +170788,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(8), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25209, - FzRepl: __ccgo_ts + 25201, + FzMatch: __ccgo_ts + 25264, + FzRepl: __ccgo_ts + 25256, }, 2: { Fc1: uint8('n'), @@ -170422,7 +170804,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: uint8('Q'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25218, + FzMatch: __ccgo_ts + 25273, FzRepl: __ccgo_ts + 1662, }, 4: { @@ -170430,7 +170812,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: uint8('S'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25223, + FzMatch: __ccgo_ts + 25278, FzRepl: __ccgo_ts + 1662, }, } @@ -170446,7 +170828,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25228, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25283, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -170464,23 +170846,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 } @@ -170558,7 +170940,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 @@ -170629,7 +171011,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) + } } } } @@ -170904,7 +171290,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+25271, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+25326, 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') { @@ -171334,7 +171720,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 { @@ -171373,7 +171759,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8086, 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+8111, 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)) } @@ -171381,7 +171767,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8091, 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+8116, 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)) } @@ -171458,14 +171844,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+25197, 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+25252, 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+25280) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25335) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25287) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25342) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25293, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25348, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171650,7 +172036,7 @@ _38: goto _51 } if libc.Int32FromUint8(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25287) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25342) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171695,7 +172081,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+25182, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25237, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171708,7 +172094,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+25182, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25237, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171757,10 +172143,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) @@ -171794,15 +172176,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 @@ -171875,11 +172257,11 @@ _2: return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8086, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8111, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8091, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8116, uint32(5)) return i + uint32(1) _6: ; @@ -171928,9 +172310,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25201 + v19 = __ccgo_ts + 25256 } else { - v19 = __ccgo_ts + 11953 + v19 = __ccgo_ts + 11978 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -171966,9 +172348,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: ; @@ -171995,7 +172380,7 @@ _11: sz2 -= k2 } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25299, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25354, uint32(2)) zIn2++ sz2-- continue @@ -172018,7 +172403,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, uint8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25302, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25357, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -172026,12 +172411,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25309, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25364, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25314, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25369, uint32(6)) case int32('\r'): if sz2 > uint32(2) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -172211,7 +172596,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25321, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25376, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172234,12 +172619,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+25324, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25379, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25321, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25376, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172254,50 +172639,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 // // /* @@ -172349,6 +172690,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 // // /* @@ -172369,6 +172788,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)) @@ -172441,9 +172863,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 @@ -172486,7 +172908,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 @@ -172974,7 +173407,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+25182, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25237, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -173109,7 +173542,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 } @@ -173210,7 +173643,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25182, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25237, -int32(1)) return } @@ -173247,11 +173680,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+25153, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25208, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -173264,7 +173694,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+25182, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25237, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -173283,10 +173713,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+25287) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25342) } 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+25280) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25335) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -173325,7 +173755,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+25327, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25382, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -173341,7 +173771,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. // ** @@ -173422,7 +173852,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25182, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25237, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -173434,34 +173864,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; +// ** 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. +// ** 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) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { + 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 (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) - return 0 + 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 (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - 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 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) @@ -173544,7 +173994,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 @@ -173604,7 +174054,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25182, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25237, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173739,7 +174189,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 + 25345 + v1 = __ccgo_ts + 25400 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173749,7 +174199,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+25182, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25237, -int32(1)) } } eErr = uint8(1) @@ -173859,23 +174309,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+25347, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25402, uint32(1)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25349, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25404, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+5239, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+5265, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1689, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1715, 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+25351, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25406, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25354, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25409, uint32(1)) } } } @@ -173915,7 +174365,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+25182, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25237, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -174183,7 +174633,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+25182, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25237, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -174207,7 +174657,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+25356, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25411, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -174218,7 +174668,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+25407, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25462, -int32(1)) _jsonStringReset(tls, bp) return } @@ -174290,7 +174740,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+25182, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25237, -int32(1)) } } goto json_remove_done @@ -174327,7 +174777,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+15964) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+16036) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -174358,9 +174808,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 25441 + v1 = __ccgo_ts + 25496 } else { - v1 = __ccgo_ts + 25445 + v1 = __ccgo_ts + 25500 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -174408,7 +174858,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+25182, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25237, -int32(1)) } } goto json_type_done @@ -174455,7 +174905,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 + 25452 + (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25507 (*(*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)) @@ -174529,17 +174979,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+25457, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25512, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -174548,18 +174997,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 @@ -174621,9 +175069,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))) @@ -174730,7 +175176,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25514, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25569, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174822,20 +175268,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))) + } } } @@ -174879,7 +175327,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25517, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25572, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174982,7 +175430,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25520) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25575) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -175116,7 +175564,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+25603, 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+25658, 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 @@ -175142,9 +175590,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+25610, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25665, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25618, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25673, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -175455,9 +175903,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))) @@ -175530,7 +175977,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+25624, uint32(1)) + _jsonAppendRaw(tls, p+56, __ccgo_ts+25679, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -175554,7 +176001,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+25182, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25237, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175615,186 +176062,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 + 25626, + FzName: __ccgo_ts + 25681, }, 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 + 25631, + FzName: __ccgo_ts + 25686, }, 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 + 25637, + FzName: __ccgo_ts + 25692, }, 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 + 25648, + FzName: __ccgo_ts + 25703, }, 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 + 25660, + FzName: __ccgo_ts + 25715, }, 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 + 25660, + FzName: __ccgo_ts + 25715, }, 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 + 25678, + FzName: __ccgo_ts + 25733, }, 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 + 25698, + FzName: __ccgo_ts + 25753, }, 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 + 25711, + FzName: __ccgo_ts + 25766, }, 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 + 25725, + FzName: __ccgo_ts + 25780, }, 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 + 25728, + FzName: __ccgo_ts + 25783, }, 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 + 25732, + FzName: __ccgo_ts + 25787, }, 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 + 25744, + FzName: __ccgo_ts + 25799, }, 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 + 25757, + FzName: __ccgo_ts + 25812, }, 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 + 25769, + FzName: __ccgo_ts + 25824, }, 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 + 25782, + FzName: __ccgo_ts + 25837, }, 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 + 25793, + FzName: __ccgo_ts + 25848, }, 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 + 25805, + FzName: __ccgo_ts + 25860, }, 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 + 25805, + FzName: __ccgo_ts + 25860, }, 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 + 25817, + FzName: __ccgo_ts + 25872, }, 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 + 25828, + FzName: __ccgo_ts + 25883, }, 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 + 25840, + FzName: __ccgo_ts + 25895, }, 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 + 25853, + FzName: __ccgo_ts + 25908, }, 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 + 25866, + FzName: __ccgo_ts + 25921, }, 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 + 25880, + FzName: __ccgo_ts + 25935, }, 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 + 25889, + FzName: __ccgo_ts + 25944, }, 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 + 25899, + FzName: __ccgo_ts + 25954, }, 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 + 25899, + FzName: __ccgo_ts + 25954, }, 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 + 25909, + FzName: __ccgo_ts + 25964, }, 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 + 25909, + FzName: __ccgo_ts + 25964, }, 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 + 25920, + FzName: __ccgo_ts + 25975, }, 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 + 25937, + FzName: __ccgo_ts + 25992, }, 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 + 25955, + FzName: __ccgo_ts + 26010, }, 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 + 25973, + FzName: __ccgo_ts + 26028, }, } @@ -175877,17 +176324,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25992, + FzName: __ccgo_ts + 26047, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 26002, + FzName: __ccgo_ts + 26057, 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 @@ -175995,7 +176444,6 @@ type TRtreeMatchArg = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - FaParam [1]TRtreeDValue } type RtreeMatchArg = TRtreeMatchArg @@ -176278,11 +176726,12 @@ type TRtreeMatchArg1 = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - 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 ** clang, since clang works hard to be gcc compatible. So the gcc @@ -176463,7 +176912,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 @@ -176526,7 +176975,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+26012, 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+26067, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -176537,7 +176986,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 { @@ -176831,7 +177280,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26017, 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+26072, 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 { @@ -177368,7 +177817,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) } @@ -177748,7 +178197,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+26099) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26154) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177826,7 +178275,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) @@ -178057,7 +178506,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 } @@ -178065,7 +178514,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 @@ -178303,7 +178752,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: @@ -178725,7 +179174,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 @@ -179238,7 +179687,7 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179255,7 +179704,7 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179283,7 +179732,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+26113, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26168, 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 { @@ -179293,11 +179742,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+26133, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26188, 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+26165, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26220, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -179511,7 +179960,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+26202, 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+26257, 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)) @@ -179565,9 +180014,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 + 26347 + zFmt = __ccgo_ts + 26402 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11782, 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+11807, 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) { @@ -179625,9 +180074,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 26403, - 1: __ccgo_ts + 5578, - 2: __ccgo_ts + 16859, + 0: __ccgo_ts + 26458, + 1: __ccgo_ts + 5604, + 2: __ccgo_ts + 16931, } var _rtreeModule = Tsqlite3_module{ @@ -179671,21 +180120,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+26817, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26872, 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+26879, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26934, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26884, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26948, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27018, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26939, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27003, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27073, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179715,7 +180164,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 + 27067 + zFormat = __ccgo_ts + 27122 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179730,31 +180179,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+27175, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27230, 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+27220, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27275, 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+13290, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+13315, int32(1)) } if ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27247, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27302, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27269, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27324, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27277, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27332, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179768,14 +180217,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 26408, - 1: __ccgo_ts + 26461, - 2: __ccgo_ts + 26506, - 3: __ccgo_ts + 26558, - 4: __ccgo_ts + 26612, - 5: __ccgo_ts + 26657, - 6: __ccgo_ts + 26715, - 7: __ccgo_ts + 26770, + 0: __ccgo_ts + 26463, + 1: __ccgo_ts + 26516, + 2: __ccgo_ts + 26561, + 3: __ccgo_ts + 26613, + 4: __ccgo_ts + 26667, + 5: __ccgo_ts + 26712, + 6: __ccgo_ts + 26770, + 7: __ccgo_ts + 26825, } // C documentation @@ -179833,7 +180282,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+27293, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27348, 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) @@ -179841,17 +180290,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+3873, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27313, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27368, 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+3873, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, 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+3873, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, 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))) @@ -179914,7 +180363,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) } @@ -179928,13 +180377,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+27556, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27611, 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+27562, 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+27617, 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) { @@ -179943,7 +180392,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+27586, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27641, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -179957,19 +180406,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27613, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27668, 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+3873, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, 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+3873, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -179992,7 +180441,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+3873, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, 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)) @@ -180003,7 +180452,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+3873, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -180019,8 +180468,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27592, - 1: __ccgo_ts + 27603, + 0: __ccgo_ts + 27647, + 1: __ccgo_ts + 27658, } // C documentation @@ -180078,21 +180527,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+11402, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11427, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27616, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27671, 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+27622, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27677, 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+27626, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+27681, int32(1)) goto _1 _1: ; @@ -180119,7 +180568,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+27628, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+27683, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -180222,7 +180671,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) @@ -180237,11 +180686,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 + 4281 + v1 = __ccgo_ts + 4307 } else { v1 = __ccgo_ts + 1676 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27661, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27716, 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) } @@ -180275,7 +180724,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+27668, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27723, 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) @@ -180292,7 +180741,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+27713, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27768, libc.VaList(bp+8, iNode)) } } return pRet @@ -180321,8 +180770,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 + 27745, - 1: __ccgo_ts + 27799, + 0: __ccgo_ts + 27800, + 1: __ccgo_ts + 27854, } 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)) @@ -180335,21 +180784,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 + 27847 + v1 = __ccgo_ts + 27902 } else { - v1 = __ccgo_ts + 27855 + v1 = __ccgo_ts + 27910 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27864, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27919, 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 + 27847 + v2 = __ccgo_ts + 27902 } else { - v2 = __ccgo_ts + 27855 + v2 = __ccgo_ts + 27910 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27909, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27964, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -180394,7 +180843,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+27967, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28022, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -180412,7 +180861,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28015, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28070, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -180445,19 +180894,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+28082, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28137, 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+28116, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28171, 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+28146, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28201, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -180502,12 +180951,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+28201, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28256, 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+28232, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28287, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -180536,7 +180985,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+28299, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28354, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -180546,11 +180995,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+26113, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26168, 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+28327, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28382, 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)) @@ -180566,8 +181015,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+28358, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+28365, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28413, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28420, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -180594,7 +181043,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+28373, 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+28428, 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) } @@ -180645,13 +181094,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+28392, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28447, -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 + 6724 + zDb = __ccgo_ts + 6749 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -180660,7 +181109,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 + 18626 + v1 = __ccgo_ts + 18698 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -180927,7 +181376,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++ @@ -180972,7 +181421,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 @@ -181034,7 +181483,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 } @@ -181402,7 +181851,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 @@ -181417,9 +181866,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: ; @@ -181504,7 +181953,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 { @@ -181645,7 +182094,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 // ** @@ -181684,7 +182133,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) } @@ -181788,7 +182237,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 @@ -181872,7 +182321,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 @@ -182156,7 +182605,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) { @@ -182313,7 +182762,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 @@ -182325,13 +182774,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+27556, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27611, 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+28516, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28571, 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) @@ -182340,13 +182789,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+28538, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28593, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27613, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27668, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -182354,7 +182803,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+3873, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -182369,7 +182818,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+3873, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -182581,7 +183030,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 + 16859 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16931 (*(*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) @@ -182591,7 +183040,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 + 28542 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28597 (*(*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) @@ -182599,7 +183048,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 + 28548 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28603 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182719,7 +183168,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+28557, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28612, 0) } goto geopoly_update_end } @@ -182822,12 +183271,12 @@ geopoly_update_end: func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28597) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28652) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28613) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28668) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) @@ -182898,7 +183347,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+28790, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28845, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -182912,61 +183361,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28628, + FzName: __ccgo_ts + 28683, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28641, + FzName: __ccgo_ts + 28696, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28654, + FzName: __ccgo_ts + 28709, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28667, + FzName: __ccgo_ts + 28722, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28613, + FzName: __ccgo_ts + 28668, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28679, + FzName: __ccgo_ts + 28734, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28597, + FzName: __ccgo_ts + 28652, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28702, + FzName: __ccgo_ts + 28757, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28716, + FzName: __ccgo_ts + 28771, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28729, + FzName: __ccgo_ts + 28784, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28743, + FzName: __ccgo_ts + 28798, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28759, + FzName: __ccgo_ts + 28814, }, } @@ -182992,7 +183441,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28771, + FzName: __ccgo_ts + 28826, }, } @@ -183017,20 +183466,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+28798, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28853, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28808, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28863, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28819, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28874, -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+28542, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28597, 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+28830, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28885, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -183104,7 +183553,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) @@ -183132,7 +183581,7 @@ 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+26099, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26154, __ccgo_fp(_rtreeMatchArgFree)) } } } @@ -183373,7 +183822,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 @@ -184349,7 +184798,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+28840, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28895, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -184359,7 +184808,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+28840, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28895, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -184385,7 +184834,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+3873, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -184408,7 +184857,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+3873, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -184540,7 +184989,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+28861, uintptr(0), uintptr(0), p+64) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28916, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184629,7 +185078,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+26012, zIn, uint64(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26067, 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')) { @@ -184666,13 +185115,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 + 29032 + v1 = __ccgo_ts + 29087 } else { v1 = __ccgo_ts + 1676 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29073, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29128, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29223) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29278) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184839,7 +185288,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+3873, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -184900,7 +185349,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+29348, 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+29403, 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 @@ -184910,7 +185359,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+29467, 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+29522, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -184918,7 +185367,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+29488, 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+29543, 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) @@ -184930,7 +185379,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+29539, 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+29594, 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 { @@ -184974,7 +185423,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+29560, 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+29615, 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))) { @@ -184987,7 +185436,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+29588, 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+29643, 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 { @@ -185040,7 +185489,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+20134, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20206, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -185051,7 +185500,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+29617, 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+29672, 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) @@ -185062,7 +185511,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+29636, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+29691, 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 @@ -185070,7 +185519,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+29641, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29696, zName) { bRbuRowid = int32(1) } } @@ -185084,17 +185533,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 + 29651 + v4 = __ccgo_ts + 29706 } else { - v4 = __ccgo_ts + 29664 + v4 = __ccgo_ts + 29719 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29673, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29728, 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+29702, 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+29757, 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)) @@ -185116,7 +185565,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+29724, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29779, 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)) @@ -185162,8 +185611,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+29751, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15158 + zList = _rbuMPrintf(tls, p, __ccgo_ts+29806, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15183 goto _1 _1: ; @@ -185197,7 +185646,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+29760, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29815, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -185245,21 +185694,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+29773, 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+29828, 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+29805, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29860, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1676, __ccgo_ts+15158, __ccgo_ts+29828) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29834, __ccgo_ts+29841, __ccgo_ts+5184) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1676, __ccgo_ts+15158, __ccgo_ts+1676) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1676, __ccgo_ts+15183, __ccgo_ts+29883) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29889, __ccgo_ts+29896, __ccgo_ts+5210) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1676, __ccgo_ts+15183, __ccgo_ts+1676) 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+29849, 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+29904, 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+29891, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29946, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -185311,7 +185760,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zSep = __ccgo_ts + 1676 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+29588, 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+29643, 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)) @@ -185333,15 +185782,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 + 29911 + zCol = __ccgo_ts + 29966 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29919, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29940, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29976, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15158 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29974, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29995, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30031, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15183 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -185350,7 +185799,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+30003, 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+30058, 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 + 1676 iCol = 0 @@ -185367,15 +185816,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+30051, libc.VaList(bp+24, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15158 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30106, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15183 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30058, libc.VaList(bp+24, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30113, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -185433,7 +185882,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zAnd = __ccgo_ts + 1676 /* 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+29588, 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+29643, 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)) @@ -185442,7 +185891,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+30070, 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+30125, 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 + 1676 } else { if iCid < 0 { @@ -185462,9 +185911,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 + 29911 + zCol = __ccgo_ts + 29966 } else { - zCol = __ccgo_ts + 29641 + zCol = __ccgo_ts + 29696 } } zType = __ccgo_ts + 1150 @@ -185472,24 +185921,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+30092, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30147, 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 + 29828 + v2 = __ccgo_ts + 29883 } else { v2 = __ccgo_ts + 1676 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30112, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30167, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30133, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30166, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30188, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30221, 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 + 15158 - zAnd = __ccgo_ts + 22243 + zCom = __ccgo_ts + 15183 + zAnd = __ccgo_ts + 22315 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185543,11 +185992,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+30190, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30245, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30202, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30257, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15158 + zS = __ccgo_ts + 15183 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -185559,7 +186008,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+30211, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30266, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -185585,7 +186034,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+30226, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30281, 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 + 1676 @@ -185595,15 +186044,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+30240, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 22243 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30295, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22315 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30252, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30307, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1676 i1 = 0 @@ -185613,8 +186062,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+30302, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22243 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30357, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22315 } goto _2 _2: @@ -185637,7 +186086,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+30315, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30370, 0) } // C documentation @@ -185679,16 +186128,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+30302, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15158 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30357, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15183 } else { if libc.Int32FromUint8(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30341, 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 + 15158 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30396, 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 + 15183 } else { if libc.Int32FromUint8(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30371, 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 + 15158 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30426, 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 + 15183 } } } @@ -185772,16 +186221,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 + 30408 + zSep = __ccgo_ts + 30463 *(*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+29560, 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+29615, 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+16747) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16819) == 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+29588, 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+29643, libc.VaList(bp+24, zIdx))) } break } @@ -185792,16 +186241,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 + 29828 + v1 = __ccgo_ts + 29883 } else { v1 = __ccgo_ts + 1676 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30421, libc.VaList(bp+24, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15158 + z = _rbuMPrintf(tls, p, __ccgo_ts+30476, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15183 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30432, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30487, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -185847,7 +186296,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+30436) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30491) 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))) { @@ -185855,7 +186304,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+29588, 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+29643, 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))) { @@ -185864,21 +186313,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+30486, 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+30541, 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 + 29828 + v1 = __ccgo_ts + 29883 } else { v1 = __ccgo_ts + 1676 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30508, libc.VaList(bp+24, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15158 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30563, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15183 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30518, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30573, 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+6724, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30533, 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+6724, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30588, 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+6749, 0, 0)) } } @@ -185915,7 +186364,7 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum zComma = __ccgo_ts + 1676 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6724, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -185924,19 +186373,19 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { zPk = __ccgo_ts + 1676 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+6724, (*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+6749, (*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 + 30595 + zPk = __ccgo_ts + 30650 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30608 + v2 = __ccgo_ts + 30663 } else { v2 = __ccgo_ts + 1676 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30618, 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 + 15158 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30673, 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 + 15183 goto _1 _1: ; @@ -185945,17 +186394,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+30645, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30700, 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+6724, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 30652 + v3 = __ccgo_ts + 30707 } else { v3 = __ccgo_ts + 1676 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30667, 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+6724, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30722, 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+6749, 0, 0)) } } @@ -185981,7 +186430,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+30699, 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+30754, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -186027,7 +186476,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+30756) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30811) } 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)) @@ -186196,7 +186645,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+30822, libc.VaList(bp+40, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30877, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -186213,18 +186662,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+6724, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6724, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30842, 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+6724, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30897, 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+6749, 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+30907, 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+30962, 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+30943, 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+30998, 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 { @@ -186239,26 +186688,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 30977 + v2 = __ccgo_ts + 31032 } else { - v2 = __ccgo_ts + 30981 + v2 = __ccgo_ts + 31036 } v1 = v2 } else { v1 = __ccgo_ts + 1676 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30987, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31042, 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+31048, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31103, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 30977 + v3 = __ccgo_ts + 31032 } else { - v3 = __ccgo_ts + 30981 + v3 = __ccgo_ts + 31036 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31109, 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+31164, 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 { @@ -186277,8 +186726,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+6735) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6731) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6760) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6756) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ @@ -186287,39 +186736,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 + 1676 } else { - v4 = __ccgo_ts + 31268 + v4 = __ccgo_ts + 31323 } 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 + 31277 + v5 = __ccgo_ts + 31332 } else { v5 = __ccgo_ts + 1676 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31287, 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+31342, 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+31323, 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+31378, 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 + 1676 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 31351 + zRbuRowid = __ccgo_ts + 31406 } /* 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 + 31363 + v6 = __ccgo_ts + 31418 } else { v6 = __ccgo_ts + 1676 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31380, 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+31456, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31435, 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+31511, 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+31755, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31810, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -186330,9 +186779,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 + 31854 + v7 = __ccgo_ts + 31909 } else { - v7 = __ccgo_ts + 31864 + v7 = __ccgo_ts + 31919 } zRbuRowid1 = v7 } @@ -186345,14 +186794,14 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29911, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29966, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1676, __ccgo_ts+15158, __ccgo_ts+1676) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1676, __ccgo_ts+15183, __ccgo_ts+1676) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 31875 + v8 = __ccgo_ts + 31930 } else { v8 = __ccgo_ts + 1676 } @@ -186362,11 +186811,11 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 v9 = __ccgo_ts + 1676 } if zOrder != 0 { - v10 = __ccgo_ts + 23499 + v10 = __ccgo_ts + 23571 } else { v10 = __ccgo_ts + 1676 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31881, 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+31936, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -186454,9 +186903,9 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p if zSet != 0 { zPrefix = __ccgo_ts + 1676 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 31268 + zPrefix = __ccgo_ts + 31323 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31929, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31984, 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 } @@ -186483,7 +186932,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+3873, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -186530,7 +186979,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+31959, 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+32014, 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): @@ -186589,27 +187038,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+6724, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6749, 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+6724) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+31989, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6749) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32044, 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+32017, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+48, __ccgo_ts+3496, uint64(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32072, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+3522, uint64(4)) } else { - libc.Xmemcpy(tls, p+48, __ccgo_ts+6724, uint64(4)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+6749, uint64(4)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32035, libc.VaList(bp+8, p+48)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32090, 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+6724, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6749, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -186642,10 +187091,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+32101, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32156, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24842, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24914, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*uint8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186661,14 +187110,14 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) if zExtra == uintptr(0) { v2 = __ccgo_ts + 1676 } else { - v2 = __ccgo_ts + 32133 + v2 = __ccgo_ts + 32188 } if zExtra == uintptr(0) { v3 = __ccgo_ts + 1676 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32135, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6724), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32190, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6749), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -186679,27 +187128,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+32167, -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+32222, -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+32182, 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+32237, 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+32199, -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+32254, -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+6724, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32215, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32270, 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+6724, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749, 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+32243, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32298, 0) } } @@ -186785,7 +187234,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { if pState == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32215, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32270, uintptr(0), uintptr(0), uintptr(0)) } } /* Assuming no error has occurred, run a "restart" checkpoint with the @@ -186818,7 +187267,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CAPTURE) - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32261, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32316, uintptr(0), uintptr(0), uintptr(0)) if rc2 != int32(SQLITE_NOTICE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -186881,7 +187330,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) } @@ -186951,16 +187400,16 @@ 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+6724, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6749, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+6724, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6749, 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)) 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) } - Xsqlite3_file_control(tls, db, __ccgo_ts+6724, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6749, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+6724, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6749, 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)) @@ -186982,7 +187431,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+32296, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32351, 0) } // C documentation @@ -186999,13 +187448,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+6724) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6724) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6749) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32321, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32328, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32376, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32383, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -187137,7 +187586,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+24399, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24471, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -187273,7 +187722,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+32335) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32390) 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 @@ -187286,7 +187735,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+32357, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32412, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -187313,7 +187762,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+32384, 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+32439, 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))) @@ -187349,9 +187798,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+32544, 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+32599, 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+32559, 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+32614, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -187374,9 +187823,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+32579, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32634, 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+32604) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32659) } 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) @@ -187387,10 +187836,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+32712) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32767) } 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+32777) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32832) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -187408,7 +187857,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+32821, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32876, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -187435,8 +187884,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+17832) - _rbuCopyPragma(tls, p, __ccgo_ts+16943) + _rbuCopyPragma(tls, p, __ccgo_ts+17904) + _rbuCopyPragma(tls, p, __ccgo_ts+17015) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -187444,7 +187893,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+32846, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32901, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -187466,10 +187915,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+15062, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15087, 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+15062, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15087, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -187556,7 +188005,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+32874, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32929, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -187579,10 +188028,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+32321, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+32376, 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+6724, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6749, 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) } @@ -187604,7 +188053,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+32899, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32954, 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) @@ -187651,7 +188100,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+32910, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32965, 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 { @@ -187696,11 +188145,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+32982, 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+33037, 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+32996) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33051) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187709,7 +188158,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+33053) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33108) 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) @@ -187757,7 +188206,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+3873, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3899, 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 @@ -187789,7 +188238,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+33127, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33182, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187811,17 +188260,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 + 33159 + v3 = __ccgo_ts + 33214 } else { - v3 = __ccgo_ts + 33166 + v3 = __ccgo_ts + 33221 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33173, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33228, 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+15047, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15072, 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) @@ -187833,21 +188282,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+17546) - _rbuCopyPragma(tls, p, __ccgo_ts+16958) + _rbuCopyPragma(tls, p, __ccgo_ts+17618) + _rbuCopyPragma(tls, p, __ccgo_ts+17030) } /* 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+33205, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33260, 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+6724, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6749, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33221, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33276, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -187925,7 +188374,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+33245, zState+uintptr(n-uint64(7)), uint64(7)) { + if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33300, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -187972,7 +188421,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+31268, uint64(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31323, 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++ @@ -188000,7 +188449,7 @@ 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+15062, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15087, 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) { @@ -188009,7 +188458,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { } _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+15062, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15087, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -188019,7 +188468,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+33253, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33308, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -188120,7 +188569,7 @@ 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+15062, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15087, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ @@ -188133,19 +188582,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { 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+15062, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15087, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 15047 + v1 = __ccgo_ts + 15072 } else { - v1 = __ccgo_ts + 33205 + v1 = __ccgo_ts + 33260 } 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+33205, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33260, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -188631,7 +189080,7 @@ func _rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileSize})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, pSize) /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existence of a *-wal file. rbuVfsRead() contains ** similar logic. */ if rc == SQLITE_OK && *(*Tsqlite_int64)(unsafe.Pointer(pSize)) == 0 && (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpRbu)).FzTarget == uintptr(0) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_MAIN_DB) != 0 { *(*Tsqlite_int64)(unsafe.Pointer(pSize)) = int64(1024) @@ -188712,7 +189161,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xControl})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, int32(SQLITE_FCNTL_ZIPVFS), bp) if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33280, 0) + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33335, 0) } else { if rc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p @@ -188738,7 +189187,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r if rc == SQLITE_OK && op == int32(SQLITE_FCNTL_VFSNAME) { pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs zIn = *(*uintptr)(unsafe.Pointer(pArg)) - zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33303, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33358, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -188933,7 +189382,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag if pDb != 0 { if (*Trbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == int32(RBU_STAGE_OAL) { if (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) { - zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6724) + zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6749) zOpen = Xsqlite3_filename_wal(tls, zOpen) } nOpen = libc.Xstrlen(tls, zOpen) @@ -188947,7 +189396,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag } else { (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu } - if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33314, 0) != 0 { + if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33369, 0) != 0 { oflags = libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) } @@ -189503,7 +189952,7 @@ func _statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint _sqlite3TokenInit(tls, bp, *(*uintptr)(unsafe.Pointer(argv + 3*8))) iDb = _sqlite3FindDb(tls, db, bp) if iDb < 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12391, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12416, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) return int32(SQLITE_ERROR) } } else { @@ -189815,7 +190264,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { _sqlite3BtreeEnter(tls, pBt) nUsable = szPage - _sqlite3BtreeGetReserveNoMutex(tls, pBt) _sqlite3BtreeLeave(tls, pBt) - (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32)) + (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32))) if (*TStatPage)(unsafe.Pointer(p)).FaCell == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -189862,7 +190311,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } (*TStatCell)(unsafe.Pointer(pCell)).FnLastOvfl = libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp)) - libc.Uint32FromInt32(nLocal) - libc.Uint32FromInt32((nOvfl-int32(1))*(nUsable-int32(4)))) (*TStatCell)(unsafe.Pointer(pCell)).FnOvfl = nOvfl - (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(4)*libc.Uint64FromInt32(nOvfl)) + (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(uint64(4)*libc.Uint64FromInt32(nOvfl))) if (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -190003,7 +190452,7 @@ statNextRestart: (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiPgno = iRoot (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33325, 0) + v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33380, 0) z = v1 (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FzPath = v1 if z == uintptr(0) { @@ -190041,8 +190490,8 @@ statNextRestart: if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { (*TStatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33327 - v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33336, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33382 + v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33391, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) z = v2 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v2 if z == uintptr(0) { @@ -190071,7 +190520,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage++ if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226029)) + return _sqlite3CorruptError(tls, int32(227304)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -190082,7 +190531,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+33348, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33403, 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) { @@ -190105,13 +190554,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33356 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33411 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33365 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33420 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33370 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33425 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -190120,7 +190569,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+3873, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -190209,12 +190658,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+33380, 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+33435, 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+33535, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33590, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33549, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33604, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -190291,7 +190740,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+33564, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+33619, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -191492,7 +191941,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) { @@ -191585,11 +192034,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+11782, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11807, 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+33571, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33626, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1676, 0) @@ -191598,7 +192047,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33701, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33756, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191624,10 +192073,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+29911)) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, __ccgo_ts+29966))) 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) @@ -191648,8 +192097,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+29911) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29911, nName+uint64(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+29966) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29966, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191713,7 +192162,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 @@ -191730,6 +192179,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 { @@ -191751,12 +192202,12 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11782, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11807, (*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))) } } } @@ -192046,10 +192497,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 + 11402 + zSep = __ccgo_ts + 11427 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33731, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33786, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -192061,8 +192512,8 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin v2 = __ccgo_ts + 1677 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5154, libc.VaList(bp+32, zSep, zDflt)) - zSep = __ccgo_ts + 15158 + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5180, libc.VaList(bp+32, zSep, zDflt)) + zSep = __ccgo_ts + 15183 goto _1 _1: ; @@ -192716,8 +193167,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+33738, 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 + 22243 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33793, 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 + 22315 if zRet == uintptr(0) { break } @@ -192746,8 +193197,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+33772, 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 + 33813 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33827, 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 + 33868 if zRet == uintptr(0) { break } @@ -192758,7 +193209,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1796, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1822, 0) } return zRet } @@ -192769,12 +193220,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 + 33818 + v1 = __ccgo_ts + 33873 } else { - v1 = __ccgo_ts + 6729 + v1 = __ccgo_ts + 6754 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33829, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33884, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192835,11 +193286,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15158 + v2 = __ccgo_ts + 15183 } else { v2 = __ccgo_ts + 1676 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33908, 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+33963, 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 } @@ -192867,7 +193318,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+33927, 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+33982, 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 { @@ -192896,17 +193347,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)) @@ -192919,7 +193371,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 } @@ -192930,18 +193384,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+34039, 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+34070, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -192967,7 +193447,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+33984, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34091, 0) } rc = int32(SQLITE_SCHEMA) } @@ -193015,7 +193495,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) } @@ -193299,7 +193779,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+5216, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5242, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -193599,12 +194079,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+34011, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11782, zTab) { - _sessionAppendStr(tls, bp+24, __ccgo_ts+34015, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+34039, bp) - _sessionAppendStr(tls, bp+56, __ccgo_ts+34048, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34093, bp) + _sessionAppendStr(tls, bp+24, __ccgo_ts+34118, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11807, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34122, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34146, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34155, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34200, bp) } else { i = 0 for { @@ -193612,17 +194092,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+15158, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15183, 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 + 15158 + zSep = __ccgo_ts + 15183 _sessionAppendIdent(tls, bp+40, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) - _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34107, libc.VaList(bp+80, i+int32(1))) + _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34214, libc.VaList(bp+80, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34111, 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+34218, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -193636,7 +194116,7 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt } else { v2 = __ccgo_ts + 1676 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34138, 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+34245, 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) } @@ -193778,7 +194258,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, 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+34180, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34287, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193884,7 +194364,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+34200, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34307, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -194139,13 +194619,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 } } @@ -194301,7 +194782,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(230285)) + rc = _sqlite3CorruptError(tls, int32(231591)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -194325,7 +194806,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(230305)) + rc = _sqlite3CorruptError(tls, int32(231611)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -194340,7 +194821,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(230315)) + rc = _sqlite3CorruptError(tls, int32(231621)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -194396,7 +194877,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(230363)) + rc = _sqlite3CorruptError(tls, int32(231669)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -194501,7 +194982,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(230451)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231757)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -194572,8 +195053,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) @@ -194607,7 +195088,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(230537)) + v7 = _sqlite3CorruptError(tls, int32(231843)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194617,7 +195098,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(230543)) + v10 = _sqlite3CorruptError(tls, int32(231849)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194696,7 +195177,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(230587)) + v16 = _sqlite3CorruptError(tls, int32(231893)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -195034,7 +195515,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 @@ -195106,7 +195587,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230952)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232258)) goto finished_invert } if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { @@ -195309,7 +195790,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+11782) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11807) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -195318,9 +195799,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+34218, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34325, bp) _sessionAppendIdent(tls, bp+8, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34231, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34338, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -195330,9 +195811,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+34237, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34344, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15158 + zSep = __ccgo_ts + 15183 } goto _2 _2: @@ -195341,7 +195822,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } /* Create the WHERE clause part of the UPDATE */ zSep = __ccgo_ts + 1676 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34242, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34349, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -195350,13 +195831,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+34250, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34357, bp) } else { _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34325, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34432, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22243 + zSep = __ccgo_ts + 22315 } goto _3 _3: @@ -195443,9 +195924,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+34331, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34438, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34242, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34349, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -195455,9 +195936,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+34237, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34344, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22243 + zSep = __ccgo_ts + 22315 } goto _1 _1: @@ -195465,9 +195946,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+34349, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34456, bp) _sessionAppendInteger(tls, bp+8, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+33813, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+33868, bp) zSep = __ccgo_ts + 1676 i = 0 for { @@ -195477,16 +195958,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+34325, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34432, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34357 + zSep = __ccgo_ts + 34464 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5184, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5210, 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)) @@ -195512,7 +195993,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+6724, 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+6749, 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 @@ -195535,16 +196016,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+34362, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34469, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22249, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22321, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15158, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15183, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -195552,19 +196033,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34380, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34487, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34391, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34498, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5184, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5210, 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)) } @@ -195587,12 +196068,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+11782, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+11807, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34395) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34502) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34508) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34615) } return rc } @@ -195658,7 +196139,7 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231434)) + rc = _sqlite3CorruptError(tls, int32(232740)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -196074,7 +196555,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34652, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34759, 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)) @@ -196087,7 +196568,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34673, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34780, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -196187,10 +196668,10 @@ 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+34692, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34799, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34718, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34825, 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)) @@ -196221,7 +196702,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui ** 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)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3873, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -196231,7 +196712,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+6724, *(*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+6749, *(*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 } @@ -196250,18 +196731,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+34748, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34855, 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+34792, 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+34899, 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+34863, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34970, 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+11782) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11807) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -196318,17 +196799,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34923, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35030, 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+34953, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35060, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+34977, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+34953, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35084, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35060, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -196442,7 +196923,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) } @@ -196812,7 +197293,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) } @@ -197104,7 +197585,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+3873, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3899, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -197140,11 +197621,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 @@ -197729,6 +198216,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 @@ -197774,8 +198262,7 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset @@ -197787,12 +198274,13 @@ type Fts5Colset = TFts5Colset ** This object is used by fts5_expr.c and fts5_index.c. */ type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 + FnCol 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 ** to parse the arguments passed to the CREATE VIRTUAL TABLE statement. @@ -198169,7 +198657,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -198197,16 +198684,14 @@ 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 @@ -198248,7 +198733,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 @@ -199052,7 +199537,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+35005, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35112, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -199408,7 +199893,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+35033, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35140, 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 */ } @@ -199692,7 +200177,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+35064, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35171, 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) } @@ -199791,7 +200276,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 + 35071 + zErr = __ccgo_ts + 35178 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199879,7 +200364,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) } @@ -200046,7 +200531,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 + 35121 + zErr = __ccgo_ts + 35228 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200317,7 +200802,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))) @@ -200409,13 +200894,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) } @@ -200441,13 +200926,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 + 35169 + z = __ccgo_ts + 35276 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 + 35225 + z1 = __ccgo_ts + 35332 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -200480,19 +200965,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35283, + FzFunc: __ccgo_ts + 35390, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35291, + FzFunc: __ccgo_ts + 35398, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35301, + FzFunc: __ccgo_ts + 35408, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35306, + FzFunc: __ccgo_ts + 35413, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200880,7 +201365,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 @@ -201356,7 +201841,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+35322, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35429, 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) { @@ -201382,12 +201867,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+35329, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35436, 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+35360, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35467, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201396,7 +201881,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+35393, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35500, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201406,14 +201891,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35430, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35537, 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+35439, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35546, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -201440,7 +201925,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+35472, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35579, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -201452,76 +201937,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+35506, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35613, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35514, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35621, 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+35546, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35653, 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+35552, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35659, 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+35571, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35678, 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+35614, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35721, 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+35571, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35678, 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+35636, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35743, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35650, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35757, 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+35688, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35795, 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+35699, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35806, 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+35734, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35841, 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+35741, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35848, 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+5593, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+5619, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 8)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 8418, + FzName: __ccgo_ts + 8443, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 17912, + FzName: __ccgo_ts + 17984, }, 2: { - FzName: __ccgo_ts + 35772, + FzName: __ccgo_ts + 35879, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -201529,20 +202014,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+35780, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35887, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35811, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35918, 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+35821, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35928, 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+35855, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35962, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201603,16 +202088,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+35883) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16859) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35888, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+35990) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16931) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35995, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+35918) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+36025) { *(*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+35928, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36035, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201638,7 +202123,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+35959, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36066, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201646,12 +202131,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+35964, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36071, 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+35971, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36078, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35979, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36086, 0) } } goto _1 @@ -201667,9 +202152,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+35986, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36093, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35979, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36086, 0) } goto _2 _2: @@ -201732,8 +202217,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+35883) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35994, 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+35990) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36101, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201764,7 +202249,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+36023, libc.VaList(bp+40, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36130, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -201794,7 +202279,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+36043, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36150, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201802,37 +202287,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+36093, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36200, 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+36148, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36255, 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 + 35506 + zTail = __ccgo_ts + 35613 } 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 + 35506 + zTail = __ccgo_ts + 35613 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36201 + zTail = __ccgo_ts + 36308 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36209, 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+36316, 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+16859, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16931, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201901,7 +202386,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+36220, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36327, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -201910,16 +202395,16 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { if i == 0 { v2 = __ccgo_ts + 1676 } else { - v2 = __ccgo_ts + 15158 + v2 = __ccgo_ts + 15183 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36236, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36343, 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+36243, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35883)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36350, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35990)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -202077,7 +202562,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+36269) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36376) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -202088,7 +202573,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+36274) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36381) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -202099,7 +202584,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+36283) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36390) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -202113,7 +202598,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+36293) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36400) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -202124,7 +202609,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+36303) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36410) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -202141,7 +202626,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+36315) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36422) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -202156,7 +202641,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+35883) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35990) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -202171,7 +202656,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36327) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36434) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -202187,7 +202672,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+36341) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36448) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -202230,7 +202715,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 + 36351 + zSelect = __ccgo_ts + 36458 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -202250,7 +202735,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+36383) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36490) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -202261,7 +202746,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+36391, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36498, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -202365,11 +202850,12 @@ type TFts5ExprNode1 = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode1 = TFts5ExprNode1 +/* Size (in bytes) of an Fts5ExprNode object that holds up to N children */ + /* ** 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. @@ -202399,24 +202885,26 @@ type TFts5ExprPhrase1 = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase1 = TFts5ExprPhrase1 +/* Size (in bytes) of an Fts5ExprPhrase object that holds up to N terms */ + /* ** 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 + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset1 = TFts5ExprNearset1 +/* Size (in bytes) of an Fts5ExprNearset object covering up to N phrases */ + /* ** Parse context. */ @@ -202507,7 +202995,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+36462, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36569, 0) return FTS5_EOF } goto _1 @@ -202518,7 +203006,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+36482, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36589, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -202533,13 +203021,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+36513, uint64(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36620, 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+36516, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36623, 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+30977, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31032, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -202583,7 +203071,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) @@ -204222,7 +204710,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) @@ -204232,7 +204720,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) @@ -204338,12 +204826,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 @@ -204477,7 +204965,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) @@ -204517,15 +205005,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)) @@ -204566,7 +205054,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 { @@ -204604,8 +205092,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+36520, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35033, 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+36627, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35140, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204625,10 +205113,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+36525, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36632, 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: ; @@ -204662,7 +205153,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 { @@ -204712,7 +205203,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 @@ -204763,7 +205254,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+21246, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21318, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204790,7 +205281,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)) @@ -204887,7 +205378,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+36554, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36661, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -204972,7 +205463,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) @@ -204985,7 +205476,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) @@ -205059,7 +205550,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 @@ -205085,11 +205576,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 + 36607 + v2 = __ccgo_ts + 36714 } else { - v2 = __ccgo_ts + 36520 + v2 = __ccgo_ts + 36627 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36614, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36721, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -205102,7 +205593,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+36664, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36771, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -205246,7 +205737,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 @@ -205579,7 +206070,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) { @@ -205643,7 +206134,7 @@ 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 +** to accumulate "term -> doclist" content before it is flushed to a level-0 ** segment. */ @@ -205702,7 +206193,7 @@ type TFts5HashEntry1 = struct { type Fts5HashEntry1 = TFts5HashEntry1 /* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -205840,7 +206331,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) } @@ -206152,7 +206643,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) } @@ -206584,9 +207075,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 @@ -206623,7 +207114,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206696,7 +207186,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206731,7 +207220,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206746,9 +207234,9 @@ 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 @@ -206845,11 +207333,12 @@ type TFts5Structure1 = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure1 = TFts5Structure1 +/* Size (in bytes) of an Fts5Structure object holding up to N levels */ + /* ** An object of type Fts5SegWriter is used to write to segments. */ @@ -206982,13 +207471,15 @@ type Fts5SegIter1 = TFts5SegIter1 ** Array of tombstone pages. Reference counted. */ type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray1 = TFts5TombstoneArray1 +/* Size (in bytes) of an Fts5TombstoneArray holding up to N tombstones */ + /* ** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. @@ -207041,11 +207532,12 @@ type TFts5Iter1 = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter1 = TFts5Iter1 +/* Size (in bytes) of an Fts5Iter object holding up to N segment iterators */ + /* ** An instance of the following type is used to iterate through the contents ** of a doclist-index record. @@ -207071,13 +207563,15 @@ type TFts5DlidxLvl1 = struct { type Fts5DlidxLvl1 = TFts5DlidxLvl1 type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } 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)) *(*Tu8)(unsafe.Pointer(aOut + 1)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) & libc.Int32FromInt32(0xFF)) @@ -207256,7 +207750,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+36717, 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+36824, 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. @@ -207361,7 +207855,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+36723, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36830, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -207390,7 +207884,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+36774, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36881, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -207424,7 +207918,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+36823, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36930, 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) @@ -207502,7 +207996,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)) @@ -207593,7 +208087,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+36863, uint64(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36970, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207604,7 +208098,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+36863, uint64(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36970, 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)) @@ -208285,7 +208779,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) @@ -208535,7 +209029,7 @@ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _ = nByte, nTomb, pNew nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(nTomb+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) if pNew != 0 { (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb @@ -208639,7 +209133,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 @@ -209245,7 +209739,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+36891, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+36998, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -209334,7 +209828,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+36975, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+37082, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -209981,7 +210475,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 @@ -210891,7 +211385,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 { @@ -211305,7 +211799,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+37057, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37164, 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. */ @@ -211811,7 +212305,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+37114, 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+37221, 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) @@ -211980,7 +212474,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 } @@ -212298,7 +212792,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+37175, 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+37282, 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))) @@ -212573,7 +213067,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: @@ -212608,7 +213102,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)) @@ -213222,11 +213716,12 @@ type TFts5TokenDataIter1 = struct { 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 // // /* @@ -213294,7 +213789,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) { @@ -213538,7 +214033,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) @@ -213588,7 +214083,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 @@ -213670,15 +214165,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+1676, 0) - _fts5StructureWrite(tls, p, bp) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -213704,11 +214202,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+37226, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37333, 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+26012, __ccgo_ts+37234, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26067, __ccgo_ts+37341, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+11993, __ccgo_ts+37269, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12018, __ccgo_ts+37376, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -213906,7 +214404,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) @@ -214161,7 +214659,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+37313) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37420) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -214512,7 +215010,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') @@ -214634,7 +215132,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 { @@ -214754,7 +215252,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+36717, 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+36824, 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))) @@ -215348,7 +215846,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+37315, 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+37422, 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)) @@ -215579,7 +216077,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+37401) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37508) 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)) @@ -215718,7 +216216,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215875,11 +216372,12 @@ type TFts5Sorter1 = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter1 = TFts5Sorter1 +/* Size (int bytes) of an Fts5Sorter object with N indexes */ + /* ** Virtual-table cursor object. ** @@ -216201,7 +216699,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+37406, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37513, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -216238,7 +216736,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+5216, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5242, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ @@ -216257,7 +216755,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+5216, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5242, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons @@ -216707,7 +217205,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+3873, 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+3899, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -216735,7 +217233,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+3873, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3899, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -216755,7 +217253,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) @@ -216770,7 +217268,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 + 15158 + v1 = __ccgo_ts + 15183 } else { v1 = __ccgo_ts + 1676 } @@ -216780,11 +217278,11 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int v2 = __ccgo_ts + 1676 } if bDesc != 0 { - v3 = __ccgo_ts + 37445 + v3 = __ccgo_ts + 37552 } else { - v3 = __ccgo_ts + 37450 + v3 = __ccgo_ts + 37557 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37454, 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+37561, 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 @@ -216842,14 +217340,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+37509, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37616, 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+5575, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5601, 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+37515, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37622, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216899,7 +217397,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+37543, libc.VaList(bp+24, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37650, 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)) @@ -216932,7 +217430,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+37553, libc.VaList(bp+24, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37660, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -216966,7 +217464,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+37574, libc.VaList(bp+24, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37681, libc.VaList(bp+24, z)) } } } else { @@ -216974,7 +217472,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 + 35301 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35408 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -217131,7 +217629,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+37607, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37714, 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))) } @@ -217331,7 +217829,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+37612, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37719, 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 @@ -217464,10 +217962,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. @@ -220003,12 +220501,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+38961, 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+39068, 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+39065, 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+39172, 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+39103, 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+39210, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -220017,7 +220515,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+39141, 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+39248, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -220029,14 +220527,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+26012, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+11993, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38295, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26067, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12018, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38402, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36201, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36308, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35506, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35613, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -220056,13 +220554,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 + 30652 + v1 = __ccgo_ts + 30707 } else { v1 = __ccgo_ts + 1676 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39183, 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+39290, 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+39213, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39320, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -220103,7 +220601,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+39257, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39364, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -220111,7 +220609,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+39280, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39387, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -220126,7 +220624,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+39286, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39393, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -220135,22 +220633,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35506, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35613, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39292 + zCols = __ccgo_ts + 39399 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39324 + zCols = __ccgo_ts + 39431 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36201, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36308, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38295, __ccgo_ts+39372, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38402, __ccgo_ts+39479, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36383, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36490, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -220570,12 +221068,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+39389, 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+39496, 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+39439, 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+39546, 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+39468, 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+39575, 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. */ @@ -220583,7 +221081,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+36383, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36490, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220885,7 +221383,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+39497, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39604, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -221015,7 +221513,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) } @@ -221117,14 +221615,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+35506, bp+80) + rc = _fts5StorageCount(tls, p, __ccgo_ts+35613, 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 @@ -221776,11 +222274,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 + 39551 + zCat = __ccgo_ts + 39658 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) } @@ -221790,7 +222288,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+39560) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39667) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -221807,20 +222305,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+39571) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39678) { 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+39529) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39636) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, int32(1)) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39540) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39647) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, 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+39667) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -222112,7 +222610,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 + 39589 + zBase = __ccgo_ts + 39696 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -222329,64 +222827,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+39599, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39706, 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+39602, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39709, 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+39607, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39714, 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+39612, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39719, 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+39615, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39722, 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+39618, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39725, 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+39623, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39730, 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+39628, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39735, 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+39632, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39739, 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+39638, 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(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+39750, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222395,49 +222893,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+39647, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39754, 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+39651, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39758, 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+39654, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39761, 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+39658, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39765, 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+39662, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39769, 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+39666, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39773, 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+39670, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39777, 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+39674, 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) } @@ -222454,20 +222952,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+39678, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39658, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39785, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39765, 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+39681, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39684, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39788, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39791, 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+39688, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39674, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39795, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39781, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -222483,75 +222981,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+39691, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39798, 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+39658, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39765, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39699, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39806, 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+39706, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39813, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39711, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39818, 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+39607, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39714, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39716, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39823, 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(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39709, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39721, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39828, 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+39674, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39781, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - 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+39833, 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+16061, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16133, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39731, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39838, 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+39684, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39791, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } 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+39842, 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+39599, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39706, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39740, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39847, 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+39643, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39750, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39746, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39853, 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+39750, uint64(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39857, uint64(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39752, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39859, 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+39773, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -222560,48 +223058,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+39758, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39865, 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+39674, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39781, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - 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+39873, 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+39658, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39765, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39772, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39879, 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+39658, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39765, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39777, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39884, 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+39599, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39706, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39783, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39890, 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+39777, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39791, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39898, 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+39799, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39906, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39803, 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+39773, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222609,21 +223107,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+39811, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39918, 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+39599, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39706, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39817, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39924, 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+39670, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39777, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39823, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39930, 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+39684, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39791, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222641,48 +223139,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+39830, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39937, 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+39615, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39722, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39835, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39942, 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+39840, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39947, 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+39615, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39722, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39846, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39953, 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+39615, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39722, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39799, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39906, 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+39852, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39959, 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+39858, 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+39599, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39706, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222698,13 +223196,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+39864, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39971, 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+39868, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39975, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39871, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39978, 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) @@ -222712,7 +223210,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+39874, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39981, 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) @@ -222877,14 +223375,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+39878) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39985) { 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+39571) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39678) { 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 { @@ -223152,7 +223650,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+39893)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+40000)) } // C documentation @@ -223178,7 +223676,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39589, + FzName: __ccgo_ts + 39696, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -223186,7 +223684,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39901, + FzName: __ccgo_ts + 40008, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -223194,7 +223692,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39893, + FzName: __ccgo_ts + 40000, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -223224,7 +223722,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+39907, 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+40014, pApi, bp+96, uintptr(0)) } return rc } @@ -228740,16 +229238,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+39914) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40021) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39918) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40025) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39922) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40029) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39931, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40038, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228812,21 +229310,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 + 39965, - 1: __ccgo_ts + 40005, - 2: __ccgo_ts + 40040, + 0: __ccgo_ts + 40072, + 1: __ccgo_ts + 40112, + 2: __ccgo_ts + 40147, } 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+23988, *(*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+24060, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40083, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40190, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228847,23 +229346,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) } @@ -228996,10 +229495,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+40116, 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+40223, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40147, 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+40254, 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)) } @@ -229018,7 +229517,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+40198, 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+40305, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -229468,7 +229967,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+40224, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40331, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -229523,7 +230022,7 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 40234 + return __ccgo_ts + 40341 } type TAggInfo_col = struct { @@ -229753,7 +230252,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 @@ -229801,11 +230300,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]uint8{'3', '.', '4', '9', '.', '1'} +var Xsqlite3_version = [7]uint8{'3', '.', '5', '0', '.', '1'} 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_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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\x00" +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_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\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods @@ -229815,3 +230314,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + diff --git a/vendor/modernc.org/sqlite/lib/sqlite_windows.go b/vendor/modernc.org/sqlite/lib/sqlite_windows.go index 960649a..d254f6e 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 -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. +// 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 @@ -17486,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 @@ -17494,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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70" +const SQLITE_SOURCE_ID = "2025-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -17605,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.1" -const SQLITE_VERSION_NUMBER = 3049001 +const SQLITE_VERSION = "3.50.1" +const SQLITE_VERSION_NUMBER = 3050001 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -20073,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 @@ -21705,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 @@ -21714,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 @@ -23283,6 +23287,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 @@ -23715,7 +23720,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -25456,11 +25460,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. */ /* @@ -25834,6 +25844,7 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem @@ -25879,6 +25890,7 @@ type THashElem1 = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem1 = THashElem1 @@ -26233,6 +26245,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. */ @@ -26291,6 +26308,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 @@ -26594,7 +26622,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData = TDbClientData @@ -26664,9 +26691,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 @@ -26681,7 +26708,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -26730,8 +26756,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 @@ -26795,7 +26821,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -26867,19 +26892,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 @@ -26893,11 +26921,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 @@ -26908,40 +26933,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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -26959,7 +26985,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -26971,6 +26997,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -27121,9 +27148,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 @@ -27178,6 +27205,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -27358,7 +27386,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -27400,7 +27427,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -27970,8 +27996,8 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. +/* Use SQLITE_ENABLE_EXPLAIN_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 @@ -28818,6 +28844,7 @@ type TTable1 = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table1 = TTable1 @@ -28899,11 +28926,13 @@ type TFKey1 = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey1 = TFKey1 +/* The size (in bytes) of an FKey object holding N columns. The answer +** does NOT include space to hold the zTo name. */ + /* ** SQLite supports many different ways to resolve a constraint ** error. ROLLBACK processing means that a constraint violation @@ -28952,11 +28981,12 @@ type TKeyInfo1 = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo1 = TKeyInfo1 +/* The size (in bytes) of a KeyInfo object with up to N fields */ + /* ** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. */ @@ -29358,13 +29388,16 @@ type Expr1 = TExpr1 ** expression. */ type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList1 = TExprList1 +/* The size (in bytes) of an ExprList object that is big enough to hold +** as many as N expressions. */ + /* ** Allowed values for Expr.a.eEName */ @@ -29385,12 +29418,14 @@ type ExprList1 = TExprList1 ** 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 + F__ccgo_align [0]uint64 + FnId int32 } type IdList1 = TIdList1 +/* The size (in bytes) of an IdList object that can hold up to N IDs. */ + /* ** Allowed values for IdList.eType, which determines which value of the a.u4 ** is valid. @@ -29496,13 +29531,19 @@ type OnOrUsing1 = TOnOrUsing1 ** */ type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList1 = TSrcList1 +/* Size (in bytes) of a SrcList object that can hold as many as N +** SrcItem objects. */ + +/* Size (in bytes( of a SrcList object that holds 1 SrcItem. This is a +** special case of SZ_SRCITEM(1) that comes up often. */ + /* ** Permitted values of the SrcList.a.jointype field */ @@ -29863,19 +29904,22 @@ type TParse1 = 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 @@ -29889,11 +29933,8 @@ type TParse1 = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -29904,40 +29945,41 @@ type TParse1 = 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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -30303,11 +30345,13 @@ type TWith1 = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With1 = TWith1 +/* The size (in bytes) of a With object that can hold as many +** as N different CTEs. */ + /* ** The Cte object is not guaranteed to persist for the entire duration ** of code generation. (The query flattener or other parser tree @@ -30337,11 +30381,13 @@ type TDbClientData1 = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData1 = TDbClientData1 +/* The size (in bytes) of a DbClientData object that can has a name +** that is N bytes long, including the zero-terminator. */ + /* ** This object is used in various ways, most (but not all) related to window ** functions. @@ -31508,7 +31554,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -31586,7 +31631,6 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor @@ -31624,11 +31668,16 @@ type TVdbeCursor1 = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor1 = TVdbeCursor1 +/* +** The size (in bytes) of a VdbeCursor object that has an nField value of N +** or less. The value of SZ_VDBECURSOR(n) is guaranteed to be a multiple +** of 8. + */ + /* Return true if P is a null-only cursor */ @@ -31839,21 +31888,14 @@ type Tsqlite3_context1 = struct { 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 */ +/* +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. + */ // C documentation // @@ -31986,7 +32028,7 @@ type TPreUpdate1 = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -31998,6 +32040,7 @@ type TPreUpdate1 = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate1 = TPreUpdate1 @@ -32135,7 +32178,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(24453)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -32307,7 +32350,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)) @@ -32731,7 +32774,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++ } @@ -32802,10 +32845,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 @@ -32941,7 +32984,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) } } @@ -33038,7 +33081,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) @@ -33196,7 +33239,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 @@ -33274,7 +33317,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) @@ -33422,7 +33465,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)) @@ -33725,7 +33768,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 } @@ -33882,7 +33925,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('.') @@ -33930,7 +33973,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('.') @@ -34035,7 +34078,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) @@ -34764,7 +34807,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 } @@ -35413,7 +35456,8 @@ func init() { // /* // ** Initialize the mutex system. // */ -func _sqlite3MutexInit(tls *libc.TLS) (r int32) { +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 @@ -93565,17 +93609,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'), @@ -93772,22 +93816,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. */ @@ -94036,11 +94081,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 @@ -94517,29 +94562,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) @@ -94654,25 +94677,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 + 1675 + if escarg == uintptr(0) { + if int32(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1675 } else { - v98 = __ccgo_ts + 1680 + v97 = __ccgo_ts + 1680 } - escarg = v98 + escarg = v97 + } else { + if int32(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) + } + } + 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. @@ -94680,15 +94707,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) { @@ -94699,13 +94726,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) @@ -94719,35 +94779,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 - } - 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 + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + 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++ + } + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 + j1++ + 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) @@ -94772,9 +94895,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: ; @@ -94788,7 +94911,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+1687, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1713, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -94798,21 +94921,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+1689, 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+1699, 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+1720, 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: ; @@ -95051,7 +95174,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 @@ -95350,6 +95473,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 // // /* @@ -95367,11 +95492,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)) } @@ -96078,6 +96203,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 // // /* @@ -96874,7 +97030,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 { @@ -97049,7 +97205,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+1734, 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 @@ -97261,11 +97417,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 @@ -97501,7 +97657,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)) @@ -97591,7 +97747,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1759 + pow63 = __ccgo_ts + 1785 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -97818,7 +97974,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+1778)) + n = int32(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1804)) if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -97978,7 +98134,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 + 1794 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1820 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') @@ -98087,7 +98243,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-- } } @@ -98503,7 +98659,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+1796, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1822, libc.VaList(bp+8, zType)) } // C documentation @@ -98532,7 +98688,7 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if int32(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1841) + _logBadConnection(tls, __ccgo_ts+1867) } return 0 } else { @@ -98546,7 +98702,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+1850) + _logBadConnection(tls, __ccgo_ts+1876) return 0 } else { return int32(1) @@ -98577,7 +98733,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) { @@ -98928,23 +99084,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 @@ -98999,8 +99153,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)) } @@ -99033,9 +99187,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: ; @@ -99055,13 +99208,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 } @@ -99069,7 +99221,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 @@ -99085,7 +99237,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 { @@ -99097,7 +99249,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 } @@ -99146,7 +99298,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 @@ -99156,20 +99308,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) } @@ -99188,196 +99339,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1858, - 1: __ccgo_ts + 1868, - 2: __ccgo_ts + 1879, - 3: __ccgo_ts + 1891, - 4: __ccgo_ts + 1902, - 5: __ccgo_ts + 1914, - 6: __ccgo_ts + 1921, - 7: __ccgo_ts + 1929, - 8: __ccgo_ts + 1937, - 9: __ccgo_ts + 1942, - 10: __ccgo_ts + 1947, - 11: __ccgo_ts + 1953, - 12: __ccgo_ts + 1967, - 13: __ccgo_ts + 1973, - 14: __ccgo_ts + 1983, - 15: __ccgo_ts + 1988, - 16: __ccgo_ts + 1993, - 17: __ccgo_ts + 1996, - 18: __ccgo_ts + 2002, - 19: __ccgo_ts + 2009, - 20: __ccgo_ts + 2013, - 21: __ccgo_ts + 2023, - 22: __ccgo_ts + 2030, - 23: __ccgo_ts + 2037, - 24: __ccgo_ts + 2044, - 25: __ccgo_ts + 2051, - 26: __ccgo_ts + 2061, - 27: __ccgo_ts + 2070, - 28: __ccgo_ts + 2081, - 29: __ccgo_ts + 2090, - 30: __ccgo_ts + 2096, - 31: __ccgo_ts + 2106, - 32: __ccgo_ts + 2116, - 33: __ccgo_ts + 2121, - 34: __ccgo_ts + 2135, - 35: __ccgo_ts + 2146, - 36: __ccgo_ts + 2151, - 37: __ccgo_ts + 2158, - 38: __ccgo_ts + 2169, - 39: __ccgo_ts + 2174, - 40: __ccgo_ts + 2179, - 41: __ccgo_ts + 2185, - 42: __ccgo_ts + 2191, - 43: __ccgo_ts + 2197, - 44: __ccgo_ts + 2200, - 45: __ccgo_ts + 2204, - 46: __ccgo_ts + 2210, - 47: __ccgo_ts + 2221, - 48: __ccgo_ts + 2232, - 49: __ccgo_ts + 2240, - 50: __ccgo_ts + 2249, - 51: __ccgo_ts + 2255, - 52: __ccgo_ts + 2262, - 53: __ccgo_ts + 2270, - 54: __ccgo_ts + 2273, - 55: __ccgo_ts + 2276, - 56: __ccgo_ts + 2279, - 57: __ccgo_ts + 2282, - 58: __ccgo_ts + 2285, - 59: __ccgo_ts + 2288, - 60: __ccgo_ts + 2295, - 61: __ccgo_ts + 2305, - 62: __ccgo_ts + 2318, - 63: __ccgo_ts + 2329, - 64: __ccgo_ts + 2335, - 65: __ccgo_ts + 2342, - 66: __ccgo_ts + 2351, - 67: __ccgo_ts + 2360, - 68: __ccgo_ts + 2367, - 69: __ccgo_ts + 2380, - 70: __ccgo_ts + 2391, - 71: __ccgo_ts + 2396, - 72: __ccgo_ts + 2404, - 73: __ccgo_ts + 2410, - 74: __ccgo_ts + 2417, - 75: __ccgo_ts + 2429, - 76: __ccgo_ts + 2434, - 77: __ccgo_ts + 2443, - 78: __ccgo_ts + 2448, - 79: __ccgo_ts + 2457, - 80: __ccgo_ts + 2462, - 81: __ccgo_ts + 2467, - 82: __ccgo_ts + 2473, - 83: __ccgo_ts + 2481, - 84: __ccgo_ts + 2489, - 85: __ccgo_ts + 2499, - 86: __ccgo_ts + 2507, - 87: __ccgo_ts + 2514, - 88: __ccgo_ts + 2527, - 89: __ccgo_ts + 2532, - 90: __ccgo_ts + 2544, - 91: __ccgo_ts + 2552, - 92: __ccgo_ts + 2559, - 93: __ccgo_ts + 2570, - 94: __ccgo_ts + 2577, - 95: __ccgo_ts + 2584, - 96: __ccgo_ts + 2594, - 97: __ccgo_ts + 2603, - 98: __ccgo_ts + 2614, - 99: __ccgo_ts + 2620, - 100: __ccgo_ts + 2631, - 101: __ccgo_ts + 2641, - 102: __ccgo_ts + 2651, - 103: __ccgo_ts + 2660, - 104: __ccgo_ts + 2667, - 105: __ccgo_ts + 2673, - 106: __ccgo_ts + 2683, - 107: __ccgo_ts + 2694, - 108: __ccgo_ts + 2698, - 109: __ccgo_ts + 2707, - 110: __ccgo_ts + 2716, - 111: __ccgo_ts + 2723, - 112: __ccgo_ts + 2733, - 113: __ccgo_ts + 2740, - 114: __ccgo_ts + 2750, - 115: __ccgo_ts + 2758, - 116: __ccgo_ts + 2765, - 117: __ccgo_ts + 2779, - 118: __ccgo_ts + 2793, - 119: __ccgo_ts + 2801, - 120: __ccgo_ts + 2812, - 121: __ccgo_ts + 2825, - 122: __ccgo_ts + 2836, - 123: __ccgo_ts + 2842, - 124: __ccgo_ts + 2854, - 125: __ccgo_ts + 2863, - 126: __ccgo_ts + 2871, - 127: __ccgo_ts + 2880, - 128: __ccgo_ts + 2889, - 129: __ccgo_ts + 2896, - 130: __ccgo_ts + 2904, - 131: __ccgo_ts + 2911, - 132: __ccgo_ts + 2922, - 133: __ccgo_ts + 2936, - 134: __ccgo_ts + 2947, - 135: __ccgo_ts + 2955, - 136: __ccgo_ts + 2961, - 137: __ccgo_ts + 2969, - 138: __ccgo_ts + 2977, - 139: __ccgo_ts + 2987, - 140: __ccgo_ts + 3000, - 141: __ccgo_ts + 3010, - 142: __ccgo_ts + 3023, - 143: __ccgo_ts + 3032, - 144: __ccgo_ts + 3043, - 145: __ccgo_ts + 3051, - 146: __ccgo_ts + 3057, - 147: __ccgo_ts + 3069, - 148: __ccgo_ts + 3081, - 149: __ccgo_ts + 3089, - 150: __ccgo_ts + 3101, - 151: __ccgo_ts + 3114, - 152: __ccgo_ts + 3124, - 153: __ccgo_ts + 3134, - 154: __ccgo_ts + 3146, - 155: __ccgo_ts + 3151, - 156: __ccgo_ts + 3163, - 157: __ccgo_ts + 3173, - 158: __ccgo_ts + 3179, - 159: __ccgo_ts + 3189, - 160: __ccgo_ts + 3196, - 161: __ccgo_ts + 3208, - 162: __ccgo_ts + 3219, - 163: __ccgo_ts + 3227, - 164: __ccgo_ts + 3236, - 165: __ccgo_ts + 3245, - 166: __ccgo_ts + 3254, - 167: __ccgo_ts + 3261, - 168: __ccgo_ts + 3272, - 169: __ccgo_ts + 3285, - 170: __ccgo_ts + 3295, - 171: __ccgo_ts + 3302, - 172: __ccgo_ts + 3310, - 173: __ccgo_ts + 3319, - 174: __ccgo_ts + 3325, - 175: __ccgo_ts + 3332, - 176: __ccgo_ts + 3340, - 177: __ccgo_ts + 3348, - 178: __ccgo_ts + 3356, - 179: __ccgo_ts + 3366, - 180: __ccgo_ts + 3375, - 181: __ccgo_ts + 3386, - 182: __ccgo_ts + 3397, - 183: __ccgo_ts + 3408, - 184: __ccgo_ts + 3418, - 185: __ccgo_ts + 3424, - 186: __ccgo_ts + 3435, - 187: __ccgo_ts + 3446, - 188: __ccgo_ts + 3451, - 189: __ccgo_ts + 3459, + 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 *********************************************/ @@ -99574,10 +99725,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 @@ -99586,15 +99737,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 } @@ -99736,246 +99886,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 + 3469, + FzName: __ccgo_ts + 3495, }, 1: { - FzName: __ccgo_ts + 3485, + FzName: __ccgo_ts + 3511, }, 2: { - FzName: __ccgo_ts + 3496, + FzName: __ccgo_ts + 3522, }, 3: { - FzName: __ccgo_ts + 3507, + FzName: __ccgo_ts + 3533, }, 4: { - FzName: __ccgo_ts + 3519, + FzName: __ccgo_ts + 3545, }, 5: { - FzName: __ccgo_ts + 3531, + FzName: __ccgo_ts + 3557, }, 6: { - FzName: __ccgo_ts + 3543, + FzName: __ccgo_ts + 3569, }, 7: { - FzName: __ccgo_ts + 3562, + FzName: __ccgo_ts + 3588, }, 8: { - FzName: __ccgo_ts + 3581, + FzName: __ccgo_ts + 3607, }, 9: { - FzName: __ccgo_ts + 3594, + FzName: __ccgo_ts + 3620, }, 10: { - FzName: __ccgo_ts + 3606, + FzName: __ccgo_ts + 3632, }, 11: { - FzName: __ccgo_ts + 3618, + FzName: __ccgo_ts + 3644, }, 12: { - FzName: __ccgo_ts + 3642, + FzName: __ccgo_ts + 3668, }, 13: { - FzName: __ccgo_ts + 3663, + FzName: __ccgo_ts + 3689, }, 14: { - FzName: __ccgo_ts + 3680, + FzName: __ccgo_ts + 3706, }, 15: { - FzName: __ccgo_ts + 3695, + FzName: __ccgo_ts + 3721, }, 16: { - FzName: __ccgo_ts + 3710, + FzName: __ccgo_ts + 3736, }, 17: { - FzName: __ccgo_ts + 3722, + FzName: __ccgo_ts + 3748, }, 18: { - FzName: __ccgo_ts + 3742, + FzName: __ccgo_ts + 3768, }, 19: { - FzName: __ccgo_ts + 3760, + FzName: __ccgo_ts + 3786, }, 20: { - FzName: __ccgo_ts + 3778, + FzName: __ccgo_ts + 3804, }, 21: { - FzName: __ccgo_ts + 3797, + FzName: __ccgo_ts + 3823, }, 22: { - FzName: __ccgo_ts + 3816, + FzName: __ccgo_ts + 3842, }, 23: { - FzName: __ccgo_ts + 3837, + FzName: __ccgo_ts + 3863, }, 24: { - FzName: __ccgo_ts + 3849, + FzName: __ccgo_ts + 3875, }, 25: { - FzName: __ccgo_ts + 3866, + FzName: __ccgo_ts + 3892, }, 26: { - FzName: __ccgo_ts + 3883, + FzName: __ccgo_ts + 3909, }, 27: { - FzName: __ccgo_ts + 3896, + FzName: __ccgo_ts + 3922, }, 28: { - FzName: __ccgo_ts + 3912, + FzName: __ccgo_ts + 3938, }, 29: { - FzName: __ccgo_ts + 3926, + FzName: __ccgo_ts + 3952, }, 30: { - FzName: __ccgo_ts + 3940, + FzName: __ccgo_ts + 3966, }, 31: { - FzName: __ccgo_ts + 3964, - }, - 32: { - FzName: __ccgo_ts + 3977, - }, - 33: { FzName: __ccgo_ts + 3990, }, - 34: { + 32: { FzName: __ccgo_ts + 4003, }, + 33: { + FzName: __ccgo_ts + 4016, + }, + 34: { + FzName: __ccgo_ts + 4029, + }, 35: { - FzName: __ccgo_ts + 4017, + FzName: __ccgo_ts + 4043, }, 36: { - FzName: __ccgo_ts + 4031, + FzName: __ccgo_ts + 4057, }, 37: { - FzName: __ccgo_ts + 4041, + FzName: __ccgo_ts + 4067, }, 38: { - FzName: __ccgo_ts + 4052, + FzName: __ccgo_ts + 4078, }, 39: { - FzName: __ccgo_ts + 4064, + FzName: __ccgo_ts + 4090, }, 40: { - FzName: __ccgo_ts + 4073, + FzName: __ccgo_ts + 4099, }, 41: { - FzName: __ccgo_ts + 4085, + FzName: __ccgo_ts + 4111, }, 42: { - FzName: __ccgo_ts + 4094, + FzName: __ccgo_ts + 4120, }, 43: { - FzName: __ccgo_ts + 4107, + FzName: __ccgo_ts + 4133, }, 44: { - FzName: __ccgo_ts + 4119, - }, - 45: { - FzName: __ccgo_ts + 4132, - }, - 46: { FzName: __ccgo_ts + 4145, }, + 45: { + FzName: __ccgo_ts + 4158, + }, + 46: { + FzName: __ccgo_ts + 4171, + }, 47: { - FzName: __ccgo_ts + 4155, + FzName: __ccgo_ts + 4181, }, 48: { - FzName: __ccgo_ts + 4164, + FzName: __ccgo_ts + 4190, }, 49: { - FzName: __ccgo_ts + 4175, + FzName: __ccgo_ts + 4201, }, 50: { - FzName: __ccgo_ts + 4189, + FzName: __ccgo_ts + 4215, }, 51: { - FzName: __ccgo_ts + 4209, + FzName: __ccgo_ts + 4235, }, 52: { - FzName: __ccgo_ts + 4233, + FzName: __ccgo_ts + 4259, }, 53: { - FzName: __ccgo_ts + 4242, + FzName: __ccgo_ts + 4268, }, 54: { - FzName: __ccgo_ts + 4255, + FzName: __ccgo_ts + 4281, }, 55: { - FzName: __ccgo_ts + 4270, + FzName: __ccgo_ts + 4296, }, 56: { - FzName: __ccgo_ts + 4276, + FzName: __ccgo_ts + 4302, }, 57: { - FzName: __ccgo_ts + 4297, + FzName: __ccgo_ts + 4323, }, 58: { - FzName: __ccgo_ts + 4308, + FzName: __ccgo_ts + 4334, }, 59: { - FzName: __ccgo_ts + 4321, + FzName: __ccgo_ts + 4347, }, 60: { - FzName: __ccgo_ts + 4337, + FzName: __ccgo_ts + 4363, }, 61: { - FzName: __ccgo_ts + 4357, + FzName: __ccgo_ts + 4383, }, 62: { - FzName: __ccgo_ts + 4367, + FzName: __ccgo_ts + 4393, }, 63: { - FzName: __ccgo_ts + 4382, + FzName: __ccgo_ts + 4408, }, 64: { - FzName: __ccgo_ts + 4402, + FzName: __ccgo_ts + 4428, }, 65: { - FzName: __ccgo_ts + 4424, + FzName: __ccgo_ts + 4450, }, 66: { - FzName: __ccgo_ts + 4441, + FzName: __ccgo_ts + 4467, }, 67: { - FzName: __ccgo_ts + 4470, + FzName: __ccgo_ts + 4496, }, 68: { - FzName: __ccgo_ts + 4491, + FzName: __ccgo_ts + 4517, }, 69: { - FzName: __ccgo_ts + 4503, + FzName: __ccgo_ts + 4529, }, 70: { - FzName: __ccgo_ts + 4523, + FzName: __ccgo_ts + 4549, }, 71: { - FzName: __ccgo_ts + 4538, + FzName: __ccgo_ts + 4564, }, 72: { - FzName: __ccgo_ts + 4558, + FzName: __ccgo_ts + 4584, }, 73: { - FzName: __ccgo_ts + 4577, + FzName: __ccgo_ts + 4603, }, 74: { - FzName: __ccgo_ts + 4596, + FzName: __ccgo_ts + 4622, }, 75: { - FzName: __ccgo_ts + 4611, + FzName: __ccgo_ts + 4637, }, 76: { - FzName: __ccgo_ts + 4636, + FzName: __ccgo_ts + 4662, }, 77: { - FzName: __ccgo_ts + 4663, + FzName: __ccgo_ts + 4689, }, 78: { - FzName: __ccgo_ts + 4674, + FzName: __ccgo_ts + 4700, }, 79: { - FzName: __ccgo_ts + 4695, + 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, }, } @@ -100042,6 +100219,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 */ @@ -100067,7 +100245,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 { @@ -100084,7 +100262,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 { @@ -100120,7 +100298,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 { @@ -100150,7 +100328,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 { @@ -100164,7 +100342,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) { @@ -100316,25 +100494,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) } @@ -100515,7 +100693,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+4711, 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 @@ -100616,10 +100794,10 @@ func _winGetLastErrorMsg(tls *libc.TLS, lastErrno TDWORD, nBuf int32, zBuf uintp } } if uint32(0) == dwLen { - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+4714, 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+4711, 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) } @@ -100665,7 +100843,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+4734, 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 } @@ -100734,7 +100912,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+4765, 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)) } } @@ -100763,6 +100941,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 // // /* @@ -100783,6 +101002,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(49989)) } - return 0 + return rc } // C documentation @@ -100872,7 +101128,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 { @@ -101084,7 +101393,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 */ @@ -101249,48 +101564,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 { @@ -101322,7 +101637,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 @@ -101391,10 +101706,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) { @@ -101518,7 +101833,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+4711, 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 @@ -101658,26 +101973,29 @@ func _winShmLeaveMutex(tls *libc.TLS) { ** ** 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. ** +** File-handle hSharedShm is used to (a) take the DMS lock, (b) truncate +** the *-shm file if the DMS-locking protocol demands it, and (c) map +** regions of the *-shm file into memory using MapViewOfFile() or +** similar. Other locks are taken by individual clients using the +** winShm.hShm handles. */ type TwinShmNode1 = 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 } @@ -101694,62 +102012,19 @@ 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. +** open shared memory connection. There is one such structure for each +** winFile open on a wal mode database. */ type TwinShm1 = struct { FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 FsharedMask Tu16 FexclMask Tu16 + FhShm THANDLE + FbReadonly int32 } 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 // // /* @@ -101788,9 +102063,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) @@ -101800,7 +102073,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 } } } @@ -101808,73 +102081,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. +// ** +// ** 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 } @@ -101963,40 +102331,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 } @@ -102006,13 +102362,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+5092, uintptr(0), int32(51668)) + return _winLogErrorAtLine(tls, int32(SQLITE_ERROR), uint32(0), __ccgo_ts+5179, uintptr(0), int32(52320)) } - Xsqlite3_snprintf(tls, nMax, zBuf, __ccgo_ts+4711, 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 { @@ -102641,11 +102937,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+5156, uintptr(0), int32(51837)) + return _winLogErrorAtLine(tls, int32(SQLITE_ERROR), uint32(0), __ccgo_ts+5243, uintptr(0), int32(52457)) } - Xsqlite3_snprintf(tls, nBuf-int32(16)-nLen, zBuf+uintptr(nLen), __ccgo_ts+5084, 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) @@ -102762,6 +103058,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 // // /* @@ -102775,21 +103076,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) @@ -102811,11 +103112,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 @@ -102824,12 +103125,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)<>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) } } @@ -106396,7 +106698,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) - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 0) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -106490,7 +106792,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-- - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 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)) } @@ -106531,7 +106833,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, 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 @@ -106659,7 +106961,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 libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g)) + 140) + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -106679,17 +106981,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) } @@ -106707,7 +107011,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 @@ -106719,7 +107023,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) } } @@ -106920,9 +107224,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 { @@ -109068,7 +109373,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 @@ -109086,7 +109391,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 } @@ -109659,6 +109964,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 { @@ -110305,7 +110619,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 @@ -110317,7 +110632,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) @@ -110338,11 +110653,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 @@ -110371,7 +110687,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 @@ -110604,7 +110920,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) } @@ -110741,7 +111057,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)) @@ -110757,7 +111073,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)< int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65269)) } p4 = pPg + 52 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | int32((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -114864,7 +115180,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+5484, 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 { @@ -115428,9 +115744,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 @@ -115634,6 +115950,11 @@ type WalCkptInfo1 = TWalCkptInfo1 /* ** An open write-ahead log file is represented by an instance of the ** following object. +** +** writeLock: +** This is usually set to 1 whenever the WRITER lock is held. However, +** if it is set to 2, then the WRITER lock is held but must be released +** by walHandleException() if a SEH exception is thrown. */ type TWal1 = struct { FpVfs uintptr @@ -115700,13 +116021,15 @@ type ht_slot = Tht_slot ** This functionality is used by the checkpoint code (see walCheckpoint()). */ type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } 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 ** is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -115764,7 +116087,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) @@ -115865,6 +116188,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 @@ -116306,7 +116630,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(67209)) } goto _1 _1: @@ -116394,7 +116718,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(67341)) goto finished } /* Malloc a buffer to read frames into. */ @@ -116533,7 +116857,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 { @@ -117164,7 +117488,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(68150)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -117280,7 +117604,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+5539, 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)) } } @@ -117495,7 +117819,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 { @@ -117521,7 +117852,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(68601)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -118244,8 +118575,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)) } @@ -118332,7 +118663,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(69451)) } iKey = _walNextHash(tls, iKey) } @@ -118829,7 +119160,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(69974)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -119078,7 +119409,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, /* 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(70234)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -119850,6 +120181,11 @@ type CellInfo1 = TCellInfo1 ** assumed that the database is corrupt. */ +/* +** Maximum amount of storage local to a database page, regardless of +** page size. + */ + /* ** A cursor is a pointer to a particular entry within a particular ** b-tree within a database file. @@ -120216,10 +120552,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) { @@ -120228,14 +120565,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) { @@ -120935,7 +121272,7 @@ 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(72422)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } @@ -121113,7 +121450,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(72620)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -121126,12 +121463,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(72633)) 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(72638)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -121175,7 +121512,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(72683)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -121183,7 +121520,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(72691)) } return SQLITE_OK } @@ -121371,7 +121708,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) } @@ -121404,7 +121741,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) } @@ -121603,7 +121940,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(73136)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(int32((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -121643,12 +121980,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(73194)) } if iFree != 0 { iFree2 = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73197)) } 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)) @@ -121656,21 +121993,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(73205)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73208)) } sz2 = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73210)) } 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(73214)) } } cbrk = top + sz @@ -121717,12 +122054,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(73247)) } 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(73253)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = uint8(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = uint8(cbrk) @@ -121738,7 +122075,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(73267)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8(cbrk) @@ -121798,7 +122135,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(73324)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -121815,14 +122152,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(73339)) } 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(73346)) } return uintptr(0) } @@ -121865,11 +122202,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(73394)) } } else { if top > int32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73397)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -121883,7 +122220,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(73414)) } else { return SQLITE_OK } @@ -121936,42 +122273,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(73498)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -121979,70 +122314,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(73510)) } - 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(73513)) } - 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)) + 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(73526)) } - nFrag = Tu8(int32(nFrag) + (int32(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + 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(73532)) } 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 } @@ -122088,7 +122423,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(73602)) } } } else { @@ -122114,7 +122449,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(73626)) } } } @@ -122153,12 +122488,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(73677)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73682)) } 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(73692)) } if uint32(pc)+size > uint32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73696)) } } /* At this point, nFree contains the sum of the offset to the start @@ -122185,7 +122520,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(73708)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = int32(uint16(nFree - iCellFirst)) return SQLITE_OK @@ -122216,11 +122551,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(73739)) } 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(73744)) } goto _1 _1: @@ -122249,11 +122584,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(73776)) } (*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) @@ -122262,7 +122597,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(73790)) } /* 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 @@ -122284,13 +122619,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))) } @@ -122300,14 +122633,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) @@ -122415,7 +122748,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(73933)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -122477,7 +122810,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(74005)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -122565,7 +122898,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+5565) == 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 */ @@ -123189,7 +123522,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) @@ -123351,7 +123684,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+5574, 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 @@ -123389,7 +123722,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(74943)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -123830,7 +124163,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(75398)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -123854,7 +124187,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(75417)) } 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) @@ -123863,7 +124196,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(75426)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -123877,7 +124210,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(75438)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -123907,7 +124240,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(75473)) } /* 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) @@ -124003,7 +124336,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(75571)) } if int32(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -124041,7 +124374,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(75623)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -124108,7 +124441,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(75691)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -124151,7 +124484,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(75742)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -124181,7 +124514,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(75769)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -124647,7 +124980,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(76233)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -125039,7 +125372,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(76657)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -125049,7 +125382,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(76672)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -125106,7 +125439,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(76743)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -125180,7 +125513,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(76827)) } return rc } @@ -125315,7 +125648,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(76965)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -125327,7 +125660,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(76979)) } if rc != 0 { v3 = pCur + 84 @@ -125443,7 +125776,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(77114)) } goto skip_init skip_init: @@ -125457,7 +125790,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(77126)) } 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) @@ -125691,7 +126024,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(77375)) } } } @@ -125895,7 +126228,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes p3 = pCur + 1 *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(BTCF_ValidOvfl) | libc.Int32FromInt32(BTCF_AtLast))) if !((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76795)) + return _sqlite3CorruptError(tls, int32(77571)) } goto bypass_moveto_root /* Start search on the current page */ } @@ -125958,10 +126291,10 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ if nCell < int32(2) || uint32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77658)) 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 @@ -125989,7 +126322,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(77690)) } goto moveto_index_finish } @@ -126022,7 +126355,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(77721)) } *(*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 @@ -126031,7 +126364,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(77732)) } if rc != 0 { v11 = pCur + 84 @@ -126160,7 +126493,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(77833)) } if idx >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -126270,7 +126603,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(77926)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -126358,7 +126691,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(78016)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -126413,7 +126746,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(78072)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -126439,7 +126772,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(78101)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && int32(eMode) == int32(BTALLOC_LE)) { @@ -126466,7 +126799,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(78135)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -126537,7 +126870,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(78200)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && int32(eMode) == int32(BTALLOC_LE)) { @@ -126675,7 +127008,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(78327)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -126726,7 +127059,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(78374)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -126735,7 +127068,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(78385)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -126825,7 +127158,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(78474)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -126843,7 +127176,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(78491)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -126866,7 +127199,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(78511)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -127087,10 +127420,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(78767)) 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 @@ -127481,12 +127814,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(79157)) } 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(79162)) } } pData -= uintptr(sz) @@ -127494,7 +127827,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(79168)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -127589,7 +127922,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(79255)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), uint64(sz)) @@ -127670,7 +128003,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: ; @@ -127697,7 +128030,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: ; @@ -127737,7 +128070,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(79377)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), uint64(nCell*int32(2))) nCell -= nShift @@ -127808,7 +128141,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(79455)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -127853,7 +128186,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(79495)) } /* 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 @@ -128049,10 +128382,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 @@ -128175,8 +128509,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 @@ -128216,7 +128550,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(79919)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -128239,7 +128573,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(79943)) goto balance_cleanup } limit = int32(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -128370,7 +128704,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(80044)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -128413,7 +128747,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(80077)) goto balance_cleanup } } @@ -128472,7 +128806,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(80121)) goto balance_cleanup } goto _11 @@ -128504,7 +128838,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(80154)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -128734,7 +129068,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(80355)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -128980,7 +129314,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(80587)) } goto _1 _1: @@ -129053,7 +129387,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(80647)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(iPage-int32(1))*8)) iIdx = int32(*(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr(iPage-int32(1))*2))) @@ -129212,7 +129546,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(80811)) } else { if uint32(iOffset)+ovflPageSize < uint32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -129243,7 +129577,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(80839)) } if int32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -129328,7 +129662,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(80920)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -129420,7 +129754,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(81043)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -129456,7 +129790,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(81085)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -129486,10 +129820,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(81112)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81115)) } libc.Xmemcpy(tls, oldCell, newCell, uint64(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -129607,12 +129941,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(81217)) } 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 @@ -129622,14 +129956,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(81242)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -129729,21 +130063,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(81338)) } } 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(81347)) } 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(81351)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81354)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -129837,7 +130171,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(81445)) } 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 @@ -129947,7 +130281,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(81561)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -129988,7 +130322,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(81609)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -130069,14 +130403,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(81699)) } *(*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(81706)) goto cleardatabasepage_out } hdr = int32((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -130213,7 +130547,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(81810)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, int32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -130478,7 +130812,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+5578, 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)) @@ -130526,11 +130860,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+5580, 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+5603, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5690, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -130556,11 +130890,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+5733, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5820, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -130632,11 +130966,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 + 5772 + v2 = __ccgo_ts + 5859 } else { - v2 = __ccgo_ts + 5777 + v2 = __ccgo_ts + 5864 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+5798, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5885, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -130772,12 +131106,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 + 5824 + (*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+5842, 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+5996, 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+6026, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+6113, 0) doCoverageCheck = 0 goto _4 } @@ -130862,7 +131196,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+6050, 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 */ @@ -130885,7 +131219,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+6074, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+6161, 0) depth = d2 } } else { @@ -130962,7 +131296,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+6099, 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))) @@ -130976,7 +131310,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+6136, 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 @@ -131067,7 +131401,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 + 6188 + (*(*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) } @@ -131091,11 +131425,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+6199, 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+6244, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+6331, 0) } } } @@ -131132,10 +131466,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+6299, 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+6319, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+6406, libc.VaList(bp+248, i)) } goto _3 _3: @@ -131574,7 +131908,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+4711, 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) @@ -131584,7 +131918,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+6351, 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 @@ -131613,7 +131947,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+6371, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+6458, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -131643,7 +131977,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+6402, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+6489, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -132321,7 +132655,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+6442, 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) } @@ -132459,9 +132793,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 @@ -132636,20 +132967,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 } @@ -132664,10 +132995,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 @@ -133421,7 +133752,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(85108)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, int32(amt+uint32(1))) rc = v1 @@ -133585,7 +133916,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 { @@ -133593,7 +133925,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) @@ -133651,14 +133983,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 */ @@ -133697,14 +134029,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+4711, 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)) @@ -133804,7 +134136,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 + 6449 + zNeg = __ccgo_ts + 6536 } } } @@ -133819,7 +134151,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+6451, 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 } @@ -134123,7 +134455,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(85794)) } iField = int64(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -134139,7 +134471,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(85800)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += int64(szField) @@ -134149,7 +134481,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(85806)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -134610,12 +134942,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 @@ -134789,7 +135120,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 @@ -134874,8 +135205,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. @@ -134888,11 +135219,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 */ @@ -134929,13 +135260,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 @@ -134966,7 +135300,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 @@ -135468,7 +135802,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+6456, 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)) { @@ -135481,39 +135815,39 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { v2 = __ccgo_ts + 1674 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+6461) == 0 { - zColl = __ccgo_ts + 6468 + 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 + 6449 + v3 = __ccgo_ts + 6536 } else { v3 = __ccgo_ts + 1674 } if int32(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 6470 + v4 = __ccgo_ts + 6557 } else { v4 = __ccgo_ts + 1674 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6473, 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+6481, 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+6497, 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+6506, 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+6506, 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+1435, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6513, 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+1402, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): @@ -135530,14 +135864,14 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { zP4 = __ccgo_ts + 1675 } else { - zP4 = __ccgo_ts + 6516 + zP4 = __ccgo_ts + 6603 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6523, 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 @@ -135552,20 +135886,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6531, 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+6536, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+6623, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 6538 + 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+6546, 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)) } @@ -135579,10 +135913,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 6483, - 1: __ccgo_ts + 6485, - 2: __ccgo_ts + 6487, - 3: __ccgo_ts + 6492, + 0: __ccgo_ts + 6570, + 1: __ccgo_ts + 6572, + 2: __ccgo_ts + 6574, + 3: __ccgo_ts + 6579, } // C documentation @@ -136533,7 +136867,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+6562, 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) } @@ -136541,18 +136875,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+6574, 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+6588, 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+6603, 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) @@ -136783,7 +137117,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(90646))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -138171,7 +138505,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(90727))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -138206,7 +138540,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(90757))) return 0 /* Corruption */ } else { if int32((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -138260,7 +138594,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(90808))) return 0 /* Corrupt index */ } } @@ -138392,7 +138726,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(90971))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -138544,7 +138878,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(91129)) } // C documentation @@ -138575,7 +138909,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(91162)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, uint32(nCellKey), bp) @@ -138726,15 +139060,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 + 6646 + zContext = __ccgo_ts + 6733 } else { if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 6665 + zContext = __ccgo_ts + 6752 } else { - zContext = __ccgo_ts + 6684 + zContext = __ccgo_ts + 6771 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+6693, 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 @@ -138829,10 +139163,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 @@ -138841,9 +139176,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 { @@ -138923,7 +139258,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+6729, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6816, 0) return int32(1) } else { return 0 @@ -138933,7 +139268,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+6774, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6861, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -138991,7 +139326,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(91560)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -139494,7 +139829,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+6814, 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 @@ -139695,7 +140030,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(92354)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -139825,7 +140160,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(92475)) } 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) @@ -140285,18 +140620,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 + 6837, - 1: __ccgo_ts + 6842, - 2: __ccgo_ts + 6849, - 3: __ccgo_ts + 6852, - 4: __ccgo_ts + 6855, - 5: __ccgo_ts + 6858, - 6: __ccgo_ts + 6861, - 7: __ccgo_ts + 6864, - 8: __ccgo_ts + 6872, - 9: __ccgo_ts + 6875, - 10: __ccgo_ts + 6882, - 11: __ccgo_ts + 6890, + 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'), @@ -140551,14 +140886,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(93091)) } 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(93095))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6897, 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(93099)) } if i >= uint32((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -140709,7 +141044,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, 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) } @@ -141132,11 +141467,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(93642)) 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))) } @@ -141145,7 +141480,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) @@ -141159,7 +141494,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) } @@ -141194,7 +141529,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(93701)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -141229,7 +141564,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 } @@ -141295,11 +141630,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(93797)) 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))) } @@ -141322,7 +141657,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 @@ -141471,7 +141806,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+6937, 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 { @@ -141509,7 +141844,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr 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+6442, 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 @@ -141524,28 +141859,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+6941, 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+6948, 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+6961, 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+6964, 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+6969, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+7056, int32(1)) } } } @@ -141709,9 +142044,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 { @@ -141737,12 +142072,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) @@ -141751,28 +142084,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 @@ -142163,12 +142496,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 @@ -142185,7 +142518,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 @@ -142203,7 +142536,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 @@ -142917,19 +143250,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+4711, 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+7005, 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+7026, 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+4711, 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+7033, 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) { @@ -144143,7 +144476,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 @@ -144159,6 +144492,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 */ @@ -144652,7 +144991,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(97561)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -144755,7 +145094,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+7057, 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+7171, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+7256, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -145351,7 +145690,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+7225, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+7310, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -145381,12 +145720,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 7280 + v250 = __ccgo_ts + 7365 } else { if iRollback != 0 { - v251 = __ccgo_ts + 7328 + v251 = __ccgo_ts + 7413 } else { - v251 = __ccgo_ts + 7371 + v251 = __ccgo_ts + 7456 } v250 = v251 } @@ -145478,7 +145817,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+7412) + (*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. @@ -146589,7 +146928,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(99822)) } else { goto jump_to_p2 } @@ -147048,7 +147387,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(). @@ -147481,7 +147820,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(101119)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -147811,7 +148150,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+4711, 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 @@ -147842,13 +148181,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 + 7457 + 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+7471, 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 { @@ -147863,7 +148202,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(101412)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -148100,7 +148439,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+7514, 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 @@ -148117,7 +148456,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 @@ -148125,7 +148464,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 @@ -148206,11 +148545,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) } @@ -148422,7 +148761,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 @@ -148472,7 +148811,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+4711, 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 { @@ -148528,7 +148867,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+4711, 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)) @@ -148607,11 +148946,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 + 7551 + v286 = __ccgo_ts + 7636 } else { - v286 = __ccgo_ts + 7556 + v286 = __ccgo_ts + 7641 } - _sqlite3VdbeError(tls, p, __ccgo_ts+7563, 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) { @@ -148764,7 +149103,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+7615, libc.VaList(bp+944, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+7700, libc.VaList(bp+936, z1)) } goto abort_due_to_error } @@ -148926,7 +149265,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+7644, __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' @@ -149006,12 +149345,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)) @@ -149022,7 +149361,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+4711, 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)) @@ -149116,7 +149455,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 } @@ -149144,11 +149483,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) { @@ -149276,7 +149615,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+4711, 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) @@ -149427,7 +149766,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+7654, 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 { @@ -149514,15 +149853,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) @@ -149988,11 +150319,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 4711 + 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) @@ -150078,7 +150409,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103962)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -150177,7 +150508,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(104062)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -150191,7 +150522,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 + 4711 + v1 = __ccgo_ts + 4829 } else { v1 = libc.UintptrFromInt32(0) } @@ -150638,11 +150969,12 @@ type TVdbeSorter1 = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter1 = TVdbeSorter1 +/* Size (in bytes) of a VdbeSorter object that works with N or fewer subtasks */ + /* ** An instance of the following object is used to read records out of a ** PMA, in sorted order. The next key to be read is cached in nKey/aKey. @@ -151249,8 +151581,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 @@ -151264,9 +151596,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) @@ -151464,14 +151796,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 { @@ -151763,6 +152096,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: @@ -154308,25 +154644,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+7961, 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+7969+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7988+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+7457+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7542+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+8007+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+8007+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+8093+7) == 0 { return int32(1) } } @@ -154365,23 +154701,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 */ @@ -154413,7 +154748,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+8021, 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 @@ -154507,7 +154842,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+8026) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+8112) != 0 { goto _2 } } @@ -154529,57 +154864,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 @@ -154624,11 +154946,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+8028, 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+8032, 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 } @@ -154637,36 +154959,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+8036, 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++ @@ -154695,18 +155006,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 } } } @@ -154753,15 +155064,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+8045, 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+8076, 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+8113, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8199, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -154772,8 +155083,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -154813,7 +155124,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+8131, 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) @@ -154833,7 +155144,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) @@ -154842,7 +155153,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 + 8166 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8252 *(*uintptr)(unsafe.Pointer(pExpr + 32)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -154852,26 +155163,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 8175 + v8 = __ccgo_ts + 8261 } else { - v10 = __ccgo_ts + 8190 + v8 = __ccgo_ts + 8276 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8212, 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+8225, 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+8235, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8321, libc.VaList(bp+24, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8296, 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) } @@ -154920,8 +155231,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -154995,19 +155306,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 8303 + zIn = __ccgo_ts + 8389 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 8331 + zIn = __ccgo_ts + 8417 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 8349 + zIn = __ccgo_ts + 8435 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 8367 + zIn = __ccgo_ts + 8453 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8385, 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) } @@ -155033,7 +155344,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 @@ -155179,7 +155490,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+8405, 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) { @@ -155234,7 +155545,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+8422, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8508, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -155258,7 +155569,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+8486, 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) @@ -155272,13 +155583,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: ; @@ -155298,16 +155609,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+8522, 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 @@ -155318,35 +155626,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+8550, 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 + 8593 + zType = __ccgo_ts + 8679 } else { - zType = __ccgo_ts + 8600 + zType = __ccgo_ts + 8686 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8610, 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+8638, 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+8660, 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+8704, 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 { @@ -155431,7 +155742,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+8752, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+8838, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) } @@ -155443,7 +155754,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+8763, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+8849, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -155489,7 +155800,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+8113, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8199, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -155614,7 +155925,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+8774, 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) } @@ -155649,7 +155960,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+8830, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8916, 0) return int32(1) } i = 0 @@ -155687,7 +155998,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+8864, 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 { @@ -155757,7 +156068,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+8870, 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 @@ -155791,7 +156102,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+8931, 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 @@ -156104,7 +156415,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+8962, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9048, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -156171,7 +156482,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+8864) != 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 { @@ -156182,7 +156493,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+9001) != 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 @@ -156192,7 +156503,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+9007, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9093, 0) return int32(WRC_Abort) } goto _6 @@ -156414,33 +156725,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 } @@ -156492,7 +156805,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) { @@ -156700,7 +157013,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 } @@ -157175,7 +157488,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8113, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8199, 0) return } if int32(op) == int32(TK_LE) { @@ -157254,7 +157567,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+9066, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9152, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -157599,11 +157912,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 9114 + v2 = __ccgo_ts + 9200 } else { v2 = __ccgo_ts + 1674 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9116, 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)) @@ -157652,7 +157965,7 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt 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)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1794) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1820) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -157680,7 +157993,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+9160, 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)) @@ -157700,7 +158013,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+9194, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9280, libc.VaList(bp+8, p)) } // C documentation @@ -157771,7 +158084,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+9244, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9330, libc.VaList(bp+8, pExpr)) } } } @@ -157823,7 +158136,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+9264, 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 } @@ -157856,7 +158169,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+9307, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9393, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -158239,7 +158552,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 @@ -158379,7 +158692,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: @@ -158400,27 +158712,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) { @@ -158466,9 +158771,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++ } @@ -158478,8 +158783,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++ } @@ -158493,7 +158798,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) } @@ -158544,7 +158849,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 @@ -158625,7 +158930,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) @@ -158643,7 +158948,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) @@ -158724,7 +159029,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+9330, 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 @@ -158853,7 +159158,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+9360, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9446, libc.VaList(bp+8, zObject)) } } @@ -158951,10 +159256,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+9383) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+9469) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+9388) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+9474) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -159632,13 +159937,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+9394) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+9480) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+9402) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+9488) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+9408) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+9494) == 0 { return int32(1) } return 0 @@ -159653,32 +159958,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 + 9394, - 1: __ccgo_ts + 9402, - 2: __ccgo_ts + 9408, + 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 @@ -159887,7 +160179,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 @@ -159940,7 +160232,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+9412, 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) @@ -160040,12 +160332,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+1794) + 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) @@ -160637,7 +160930,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+9627) + 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 @@ -160733,7 +161026,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 @@ -160768,9 +161061,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) { @@ -160903,7 +161196,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) } } @@ -161033,13 +161326,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)<= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9720, 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) } @@ -161831,7 +162124,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)) @@ -161846,7 +162139,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+9747, 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) { @@ -161875,7 +162168,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) } @@ -161951,7 +162244,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9330, 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): @@ -162014,7 +162307,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8113, 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 @@ -162024,7 +162317,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) { @@ -162045,9 +162338,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 /* @@ -162129,7 +162422,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+9771, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9857, 0) return 0 } if int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -162200,17 +162493,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 { @@ -162219,7 +162512,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 @@ -162250,7 +162543,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 { @@ -162320,7 +162613,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) @@ -162364,7 +162657,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 @@ -162631,7 +162924,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: @@ -162840,7 +163135,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: @@ -163547,7 +163844,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) } @@ -164068,7 +164365,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) 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 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 @@ -164084,7 +164381,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) (*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 + v9 = pParse + 60 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 @@ -164169,7 +164466,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 @@ -164177,7 +164474,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 @@ -164195,7 +164492,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 } } } @@ -164214,11 +164511,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 } @@ -164336,8 +164633,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+7961, 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+9821, 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+9907, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -164355,10 +164652,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+9849, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9935, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10024, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10110, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -164374,9 +164671,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+10198, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10284, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10345, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10431, 0) } } @@ -164432,7 +164729,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+10496, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10582, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -164441,11 +164738,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+10555, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+10641, zName) { goto exit_rename_table } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10561, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10647, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -164475,21 +164772,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+10588, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10674, 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+10772, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10858, 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+11077, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11093, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+11163, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11179, 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+11151, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11237, 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 @@ -164497,7 +164794,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 @@ -164505,7 +164802,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+11416, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11502, 0) goto exit_rename_table exit_rename_table: ; @@ -164522,7 +164819,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+11429, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11515, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -164562,11 +164859,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+11467, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11553, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11499, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11585, 0) return } if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -164582,10 +164879,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+11526) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11612) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11585) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11671) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -164597,13 +164894,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11638) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11724) } _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+11684) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11770) } } /* Modify the CREATE TABLE statement. */ @@ -164617,7 +164914,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+11711, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11797, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -164645,7 +164942,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+11857, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11943, libc.VaList(bp+16, zTab, zDb)) } } } @@ -164683,12 +164980,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+12210, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12296, 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+12244, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12330, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -164703,7 +165000,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 } @@ -164711,8 +165008,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+12274, 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+12360, 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 } @@ -164773,18 +165070,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 + 12293 + zType = __ccgo_ts + 12379 } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 12298 + zType = __ccgo_ts + 12384 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 12312 + v1 = __ccgo_ts + 12398 } else { - v1 = __ccgo_ts + 12329 + v1 = __ccgo_ts + 12415 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12347, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12433, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -164831,21 +165128,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+12365, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12451, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -164861,11 +165146,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+12386, 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+12568, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12472, 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+12654, 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+11416, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+11502, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -165341,11 +165626,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 + 12699 + v1 = __ccgo_ts + 12785 } else { v1 = __ccgo_ts + 1674 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12701, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12787, 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) } @@ -165416,30 +165701,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+12724, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+12810, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118867)) } 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(118888)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -165460,9 +165749,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)) @@ -165478,15 +165766,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+12732, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+12818, 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)) @@ -165497,16 +165785,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++ @@ -165523,18 +165811,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 + 12699 + v1 = __ccgo_ts + 12785 } else { v1 = __ccgo_ts + 1674 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+12738, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+12824, 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)) @@ -165563,7 +165851,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: ; @@ -165873,7 +166161,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 { @@ -166140,7 +166428,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) @@ -166323,7 +166611,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 { @@ -166407,8 +166695,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 @@ -166424,12 +166713,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)) @@ -166503,7 +166792,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(119856)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -166520,7 +166809,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+12743, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+12829, 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 @@ -166575,23 +166864,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12365, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12451, 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 + 12750 + v1 = __ccgo_ts + 12836 } else { - v1 = __ccgo_ts + 6980 + v1 = __ccgo_ts + 7067 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12762, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12848, 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+12790, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12876, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -166603,31 +166892,31 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _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+12838, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12924, 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+12959, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+13045, 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)) { @@ -166641,7 +166930,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 @@ -166652,8 +166941,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 } @@ -166714,27 +167003,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 + 12977, + FzName: __ccgo_ts + 13063, }, 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 + 12998, + FzName: __ccgo_ts + 13084, }, 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 + 13018, + FzName: __ccgo_ts + 13104, }, 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 + 13037, + FzName: __ccgo_ts + 13123, }, 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 + 13056, + FzName: __ccgo_ts + 13142, }, } @@ -166945,8 +167234,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+13159, 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+13245, 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 { @@ -166956,10 +167250,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+13182, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13268, 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+13212, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13298, 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) @@ -166991,15 +167285,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 13079, - FzCols: __ccgo_ts + 13092, + FzName: __ccgo_ts + 13165, + FzCols: __ccgo_ts + 13178, }, 1: { - FzName: __ccgo_ts + 13105, - FzCols: __ccgo_ts + 13118, + FzName: __ccgo_ts + 13191, + FzCols: __ccgo_ts + 13204, }, 2: { - FzName: __ccgo_ts + 13146, + FzName: __ccgo_ts + 13232, }, } @@ -167213,7 +167507,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) { @@ -167229,10 +167524,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) { @@ -167242,7 +167537,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) @@ -167301,7 +167596,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 + 13230, + FzName: __ccgo_ts + 13316, } func init() { @@ -167675,7 +167970,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 + 13240, + FzName: __ccgo_ts + 13326, } func init() { @@ -167725,7 +168020,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+13250, libc.VaList(bp+72, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+13336, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -167736,7 +168031,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+13255, libc.VaList(bp+72, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+13341, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -167775,7 +168070,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+13261, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+13347, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -167793,7 +168088,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 + 13267, + FzName: __ccgo_ts + 13353, } func init() { @@ -167859,7 +168154,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+13276, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+13362, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -167868,12 +168163,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+13079, uint64(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*120 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+13165, 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)) @@ -168075,7 +168370,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: @@ -168106,7 +168401,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+13286, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+13372, 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)) @@ -168197,7 +168492,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+13286, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+13372, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -168234,7 +168529,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 @@ -168267,11 +168562,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+13290) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+13376) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+13294) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+13380) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -168435,17 +168730,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+13298, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+13384, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+13309, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+13395, 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+13319, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+13405, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -168457,13 +168752,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) - } } } @@ -168824,11 +169112,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+13105, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+13191, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && int32((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+13331, __ccgo_ts+13400, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+13417, __ccgo_ts+13486, zDb) } return rc } @@ -168894,10 +169182,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+13079, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+13165, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && int32((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+13452, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+13538, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -169010,7 +169298,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+8021, 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 @@ -169062,11 +169350,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+5342) + *(*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+13493, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+13579, 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 { @@ -169097,7 +169385,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+13496, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13582, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -169106,7 +169394,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+13533, libc.VaList(bp+56, zName)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13619, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -169124,7 +169412,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 } @@ -169162,7 +169450,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+13563, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13649, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -169170,7 +169458,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+13592, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13678, 0) rc = int32(SQLITE_ERROR) } } @@ -169217,7 +169505,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+1644, 0) } else { if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13660, libc.VaList(bp+56, zFile)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13746, libc.VaList(bp+56, zFile)) } } } @@ -169279,15 +169567,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+13688, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13774, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13709, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13795, 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+13735, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13821, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -169382,7 +169670,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 13757, + FzName: __ccgo_ts + 13843, } func init() { @@ -169404,7 +169692,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 + 13771, + FzName: __ccgo_ts + 13857, } func init() { @@ -169430,7 +169718,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+13785, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+13871, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -169464,7 +169752,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+13809, 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+13895, 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))) @@ -169681,7 +169969,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+13855, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13941, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -169709,11 +169997,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+13878, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+13964, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+13884, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+13970, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13890, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13976, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -169773,7 +170061,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 + 9402 + zCol = __ccgo_ts + 9488 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -169808,7 +170096,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+13917, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14003, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -169926,7 +170214,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 @@ -170024,7 +170312,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) @@ -170102,7 +170392,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) { @@ -170116,7 +170406,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) } @@ -170229,21 +170521,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+8021) == 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+7961, 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+7988+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8007+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7457+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+7969) + 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+8007+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+7457) + 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) } } } @@ -170273,12 +170565,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7961, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8007+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+7457) + 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+7988+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+7969) + 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) } } } @@ -170316,7 +170608,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+13932, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+14018, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -170326,7 +170618,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) @@ -170334,15 +170626,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 + 13940 + v1 = __ccgo_ts + 14026 } else { - v1 = __ccgo_ts + 13953 + v1 = __ccgo_ts + 14039 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8225, 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+8296, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8382, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -170380,12 +170672,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+7961, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7457+7) == 0 { - return __ccgo_ts + 8007 + 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+7969+7) == 0 { - return __ccgo_ts + 7988 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8055+7) == 0 { + return __ccgo_ts + 8074 } } return zName @@ -170910,7 +171202,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+7457) + _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) @@ -170942,7 +171234,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+8021, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+8107, zName) { break } goto _1 @@ -171000,13 +171292,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+13967, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14053, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13984, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14070, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -171054,8 +171346,8 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType return int32(SQLITE_ERROR) } } else { - if int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7961, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14004, 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+14090, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -171091,23 +171383,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 @@ -171227,7 +171521,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 @@ -171270,9 +171564,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 + 7969 + v1 = __ccgo_ts + 8055 } else { - v1 = __ccgo_ts + 7457 + v1 = __ccgo_ts + 7542 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -171285,7 +171579,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+14046, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14132, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -171301,9 +171595,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 12293 + v2 = __ccgo_ts + 12379 } else { - v2 = __ccgo_ts + 10555 + v2 = __ccgo_ts + 10641 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -171313,9 +171607,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 + 7969 + v3 = __ccgo_ts + 8055 } else { - v3 = __ccgo_ts + 7457 + v3 = __ccgo_ts + 7542 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -171339,11 +171633,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 + 12293 + v4 = __ccgo_ts + 12379 } else { - v4 = __ccgo_ts + 10555 + v4 = __ccgo_ts + 10641 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14087, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14173, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -171351,11 +171645,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+14108, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14194, 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++ @@ -171387,19 +171681,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 @@ -171419,15 +171723,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) @@ -171442,7 +171751,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 } @@ -171503,7 +171812,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+14143, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14229, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -171512,14 +171821,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+14177, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+14263, 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) @@ -171551,11 +171862,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) @@ -171566,7 +171877,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+14197, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14283, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -171576,12 +171887,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+14220, 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+14306, 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+14227, 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+14313, 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-- @@ -171623,21 +171934,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+14237, 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+14323, 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) { @@ -171648,7 +171948,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. */ @@ -171661,12 +171961,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 @@ -171838,10 +172147,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+14263, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14349, 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+14308, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14394, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -171899,7 +172208,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+14349, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14435, 0) } } @@ -171927,8 +172236,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) @@ -171936,7 +172245,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+14401, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14487, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -171955,21 +172264,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 @@ -171992,7 +172290,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14442, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14528, 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) @@ -172020,8 +172318,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 { @@ -172108,17 +172411,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+14498, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14584, 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+14541, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+14627, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+14549, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+14635, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -172150,7 +172453,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14556, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14642, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -172291,9 +172594,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 @@ -172304,31 +172608,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 + 1674 - zSep2 = __ccgo_ts + 14587 - zEnd = __ccgo_ts + 6481 + zSep2 = __ccgo_ts + 14673 + zEnd = __ccgo_ts + 6568 } else { - zSep = __ccgo_ts + 14589 - zSep2 = __ccgo_ts + 14593 - zEnd = __ccgo_ts + 14598 + zSep = __ccgo_ts + 14675 + zSep2 = __ccgo_ts + 14679 + zEnd = __ccgo_ts + 14684 } - 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+14601, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.Xmemcpy(tls, zStmt, __ccgo_ts+14687, 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))++ @@ -172339,8 +172643,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)] @@ -172353,17 +172658,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+4711, 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 + 1674, - 1: __ccgo_ts + 14615, - 2: __ccgo_ts + 14621, - 3: __ccgo_ts + 14626, - 4: __ccgo_ts + 14631, - 5: __ccgo_ts + 14621, + 1: __ccgo_ts + 14701, + 2: __ccgo_ts + 14707, + 3: __ccgo_ts + 14712, + 4: __ccgo_ts + 14717, + 5: __ccgo_ts + 14707, } // C documentation @@ -172372,15 +172678,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) } @@ -172395,7 +172702,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 } @@ -172628,8 +172935,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. @@ -172729,7 +173046,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 @@ -172742,8 +173059,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++ } @@ -172773,7 +173090,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 @@ -172992,9 +173309,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+14637, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1674))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14723, 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+14670, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14756, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -173015,11 +173332,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+14697, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14783, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14747, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14833, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 48)) |= uint32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -173066,7 +173383,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14779, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14865, 0) return } } @@ -173100,16 +173417,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 + 10555 - zType2 = __ccgo_ts + 14823 + zType = __ccgo_ts + 10641 + zType2 = __ccgo_ts + 14909 } else { /* A view */ - zType = __ccgo_ts + 12293 - zType2 = __ccgo_ts + 14829 + zType = __ccgo_ts + 12379 + zType2 = __ccgo_ts + 14915 } /* 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 @@ -173126,24 +173443,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) @@ -173191,13 +173513,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+14834, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14920, 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+14849, 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+14935, 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 @@ -173206,15 +173538,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+14947, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15033, 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+14989, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+15075, 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+15023, 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+15109, 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. @@ -173232,7 +173564,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+11077) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+11163) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -173265,7 +173597,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+15044, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15130, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -173282,7 +173614,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+12293, *(*uintptr)(unsafe.Pointer(bp + 112))) + _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+12379, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -173379,7 +173711,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+15080, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15166, 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. @@ -173563,7 +173895,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+15110, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15196, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -173576,7 +173908,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+15125, 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+15211, 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) } @@ -173659,9 +173991,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+15192, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+15278, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13182, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13268, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -173702,7 +174034,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+15206, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15292, 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 @@ -173711,7 +174043,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+15251, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15337, 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) } @@ -173746,11 +174078,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+7961, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+15318, 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+15404, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+8763, 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) @@ -173805,9 +174137,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 + 7969 + v1 = __ccgo_ts + 8055 } else { - v1 = __ccgo_ts + 7457 + v1 = __ccgo_ts + 7542 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName @@ -173840,18 +174172,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+15323, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15409, 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+15351, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15437, 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+15385, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15471, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -173861,7 +174193,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+13294, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+13380, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -173909,19 +174241,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+15417, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15503, 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+15480, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15566, 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 { @@ -173978,7 +174310,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+15574, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15660, 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) { @@ -174093,11 +174425,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 */ @@ -174119,7 +174451,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 @@ -174164,13 +174496,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) } @@ -174193,23 +174525,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 @@ -174238,11 +174570,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 + 15620 + v2 = __ccgo_ts + 15706 } else { - v2 = __ccgo_ts + 15626 + v2 = __ccgo_ts + 15712 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15631, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15717, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -174320,7 +174652,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+15659, *(*uintptr)(unsafe.Pointer(bp + 96))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+15745, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -174330,7 +174662,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+15665, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15751, 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)) { @@ -174344,16 +174676,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+7961, int32(7)) == 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15715, 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+15801, 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+15743, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15829, 0) goto exit_create_index } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15768, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15854, 0) goto exit_create_index } /* @@ -174374,19 +174706,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+15659, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+15745, (*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+15802, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15888, 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+15836, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15922, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -174407,7 +174739,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+15860, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+15946, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -174425,9 +174757,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 + 7969 + v2 = __ccgo_ts + 8055 } else { - v2 = __ccgo_ts + 7457 + v2 = __ccgo_ts + 7542 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -174455,7 +174787,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+15659) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+15745) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -174487,7 +174819,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 } @@ -174539,7 +174871,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+15883, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15969, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -174554,6 +174886,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { j = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) } else { if int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16 + 8))&0xf>>0)) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) @@ -174638,7 +174971,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) @@ -174686,7 +175019,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+15944, libc.VaList(bp+136, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16030, 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 @@ -174716,8 +175049,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+15986, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16072, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127335)) goto exit_create_index } } @@ -174730,7 +175063,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 @@ -174759,9 +175092,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if onError == OE_None { v13 = __ccgo_ts + 1674 } else { - v13 = __ccgo_ts + 16003 + v13 = __ccgo_ts + 16089 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+16011, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+16097, 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(""); */ @@ -174769,7 +175102,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+16031, 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+16117, 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. @@ -174777,7 +175110,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+16090, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+16176, 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)) @@ -174940,16 +175273,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+16117, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16203, 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+16135, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16221, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -174957,9 +175290,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 + 7969 + v1 = __ccgo_ts + 8055 } else { - v1 = __ccgo_ts + 7457 + v1 = __ccgo_ts + 7542 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -174975,8 +175308,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+16208, 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+13290, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+16294, 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+13376, (*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) @@ -175049,12 +175382,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) @@ -175166,13 +175499,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+16268, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16354, 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) } @@ -175253,7 +175586,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) } @@ -175303,7 +175636,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 @@ -175474,11 +175807,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 + 16304 + v1 = __ccgo_ts + 16390 } else { - v1 = __ccgo_ts + 16307 + v1 = __ccgo_ts + 16393 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16313, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16399, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -175677,7 +176010,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+16349, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+16435, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -175724,9 +176057,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 + 16355 + v1 = __ccgo_ts + 16441 } else { - v1 = __ccgo_ts + 16364 + v1 = __ccgo_ts + 16450 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -175758,9 +176091,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 16349, - 1: __ccgo_ts + 16371, - 2: __ccgo_ts + 16355, + 0: __ccgo_ts + 16435, + 1: __ccgo_ts + 16457, + 2: __ccgo_ts + 16441, } // C documentation @@ -175780,7 +176113,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+16379, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16465, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -175805,7 +176138,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+13878, 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+13964, 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 @@ -176236,7 +176569,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+16579, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16665, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -177118,11 +177449,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+16612, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16698, 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+16641, 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) } return 0 @@ -177226,7 +177557,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 @@ -177283,7 +177614,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+16715, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+16801, -int32(1)) return } if argc == int32(3) { @@ -179002,7 +179338,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+16748, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+16834, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -179084,7 +179420,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+4711, 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 @@ -179156,28 +179492,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+16793, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+16879, 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+16801, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+16887, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -179209,13 +179545,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+16809, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 16895 + } else { + v2 = __ccgo_ts + 16899 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: 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+16902, -int32(1)) + return +} + // C documentation // // /* @@ -179227,6 +179699,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) @@ -179237,7 +179713,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) @@ -179761,7 +180237,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 12699, + 0: __ccgo_ts + 12785, } // C documentation @@ -179921,7 +180397,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+16812, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+16925, int32(4), libc.UintptrFromInt32(0)) } } @@ -179982,7 +180458,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+13917, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+14003, -int32(1)) return } if argc == int32(2) { @@ -180092,7 +180568,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) { @@ -180174,7 +180650,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+16692, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+16778, -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) @@ -180524,7 +181000,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+16817, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+16930, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -180553,8 +181029,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+16823, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+16823, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+16936, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+16936, 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 @@ -180734,11 +181210,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 @@ -180842,7 +181318,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))) } /* @@ -180855,542 +181331,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 + 16828, + FzName: __ccgo_ts + 16941, }, 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 + 16848, + FzName: __ccgo_ts + 16961, }, 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 + 16861, + FzName: __ccgo_ts + 16974, }, 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 + 16879, + FzName: __ccgo_ts + 16992, }, 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 + 16888, + FzName: __ccgo_ts + 17001, }, 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 + 16896, + FzName: __ccgo_ts + 17009, }, 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 + 16896, + FzName: __ccgo_ts + 17009, }, 7: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16911, + FzName: __ccgo_ts + 17024, }, 8: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16937, + FzName: __ccgo_ts + 17050, }, 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 + 16962, + FzName: __ccgo_ts + 17075, }, 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 + 16971, + FzName: __ccgo_ts + 17084, }, 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 + 16982, + FzName: __ccgo_ts + 17095, }, 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 + 16989, + FzName: __ccgo_ts + 17102, }, 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 + 17003, + FzName: __ccgo_ts + 17116, }, 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 + 17003, + FzName: __ccgo_ts + 17116, }, 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 + 17009, + FzName: __ccgo_ts + 17122, }, 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 + 17009, + FzName: __ccgo_ts + 17122, }, 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 + 17015, + FzName: __ccgo_ts + 17128, }, 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 + 17015, + FzName: __ccgo_ts + 17128, }, 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 + 17020, + FzName: __ccgo_ts + 17133, }, 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 + 17020, + FzName: __ccgo_ts + 17133, }, 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 + 17024, + FzName: __ccgo_ts + 17137, }, 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 + 17024, + FzName: __ccgo_ts + 17137, }, 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 + 17028, + FzName: __ccgo_ts + 17141, }, 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 + 17035, + FzName: __ccgo_ts + 17148, }, 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 + 17043, + FzName: __ccgo_ts + 17156, }, 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 + 17050, + FzName: __ccgo_ts + 17163, }, 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 + 17063, + FzName: __ccgo_ts + 17176, }, 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 + 17069, + FzName: __ccgo_ts + 17182, }, 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 + 17076, + FzName: __ccgo_ts + 17189, }, 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 + 17083, + FzName: __ccgo_ts + 17196, }, 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 + 17091, + FzName: __ccgo_ts + 17204, }, 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 + 17096, + FzName: __ccgo_ts + 17209, }, 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 + 17100, + FzName: __ccgo_ts + 17213, }, 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 + 17100, + FzName: __ccgo_ts + 17213, }, 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 + 17106, + FzName: __ccgo_ts + 17219, }, 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 + 17112, + FzName: __ccgo_ts + 17225, }, 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 + 17118, + FzName: __ccgo_ts + 17231, }, 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 + 17122, + FzName: __ccgo_ts + 17235, }, 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 + 17122, + FzName: __ccgo_ts + 17235, }, 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 + 17128, + FzName: __ccgo_ts + 17241, }, 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 + 17135, + FzName: __ccgo_ts + 17248, }, 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 + 17145, + FzName: __ccgo_ts + 17258, }, 43: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17152, + FzName: __ccgo_ts + 17265, }, 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 + 17159, + FzName: __ccgo_ts + 17272, }, 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 + 17170, + FzName: __ccgo_ts + 17283, }, 46: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17177, + FzName: __ccgo_ts + 17290, }, 47: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17192, + FzName: __ccgo_ts + 17305, }, 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 + 17209, + FzName: __ccgo_ts + 17322, }, 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 + 17220, + FzName: __ccgo_ts + 17333, }, 50: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17226, + 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 + 17340, }, 51: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17244, + 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 + 17346, }, 52: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17252, + FzName: __ccgo_ts + 17359, }, 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 + 17266, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17377, }, 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 + 17274, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17385, }, 55: { - 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 + 17283, - }, - 56: { 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 + 17283, + FzName: __ccgo_ts + 17399, + }, + 56: { + 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 + 17407, }, 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 + 17290, + FzName: __ccgo_ts + 17416, }, 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 + 17290, + FzName: __ccgo_ts + 17416, }, 59: { - 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 + 17300, + 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 + 17423, }, 60: { - 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 + 17304, + 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 + 17423, }, 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 + 17310, + FzName: __ccgo_ts + 17433, }, 62: { - 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 + 17314, + 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 + 17437, }, 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(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 17314, + 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 + 17443, }, 64: { - 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 + 17320, + 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 + 17447, }, 65: { - 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 + 17320, + 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 + 17447, }, 66: { - FnArg: int16(2), + 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 + 17333, + FzName: __ccgo_ts + 17453, }, 67: { 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 + 17344, + 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 + 17453, }, 68: { 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 + 16823, + 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 + 17466, }, 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 + 17477, + }, + 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 + 16936, + }, + 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 + 16823, - }, - 70: { - FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17349, - }, - 71: { - FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1247, + FzName: __ccgo_ts + 16936, }, 72: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1255, + FzName: __ccgo_ts + 17482, }, 73: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17354, + 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 + 17360, + 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 + 17363, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 17487, }, 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 + 17367, + FzName: __ccgo_ts + 17493, }, 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 + 17373, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 17496, }, 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 + 17363, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 17500, }, 79: { FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17378, + 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 + 17506, }, 80: { FnArg: int16(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17382, + 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 + 17496, }, 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 + 17386, + FzName: __ccgo_ts + 17511, }, 82: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17392, + FzName: __ccgo_ts + 17515, }, 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 + 17396, + FzName: __ccgo_ts + 17519, }, 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 + 17401, + FzName: __ccgo_ts + 17525, }, 85: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17406, + FzName: __ccgo_ts + 17529, }, 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 + 17411, + FzName: __ccgo_ts + 17534, }, 87: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17417, + FzName: __ccgo_ts + 17539, }, 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 + 17421, + FzName: __ccgo_ts + 17544, }, 89: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17425, + FzName: __ccgo_ts + 17550, }, 90: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17429, + FzName: __ccgo_ts + 17554, }, 91: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17434, + FzName: __ccgo_ts + 17558, }, 92: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17439, + FzName: __ccgo_ts + 17562, }, 93: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17444, + FzName: __ccgo_ts + 17567, }, 94: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17450, + FzName: __ccgo_ts + 17572, }, 95: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17456, + FzName: __ccgo_ts + 17577, }, 96: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17462, + FzName: __ccgo_ts + 17583, }, 97: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17467, + FzName: __ccgo_ts + 17589, }, 98: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17475, + FzName: __ccgo_ts + 17595, }, 99: { + FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17483, + FzName: __ccgo_ts + 17600, }, 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 + 17486, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 17608, }, 101: { - 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 + 8166, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 17616, }, 102: { - 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 + 17491, + 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 + 17619, }, 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 + 8252, + }, + 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 + 17495, + FzName: __ccgo_ts + 17624, + }, + 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 + 17628, }, } @@ -181449,109 +181936,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 ************************************************/ @@ -181868,7 +182357,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+17498, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17631, 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) @@ -182692,7 +183181,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 @@ -182979,11 +183468,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 8032, + Fz: __ccgo_ts + 8118, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 32)) = TToken{ - Fz: __ccgo_ts + 8028, + Fz: __ccgo_ts + 8114, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -183047,7 +183536,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+6616) + 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) @@ -183629,7 +184118,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9659, 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 } @@ -183695,11 +184184,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 } @@ -184024,7 +184513,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) @@ -184038,7 +184527,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 @@ -184073,7 +184562,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 @@ -184086,7 +184575,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 @@ -184213,27 +184702,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 */ @@ -184314,7 +184803,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++ @@ -184350,44 +184839,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+17543, 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+17676, 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+17584, 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+17717, 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 } } @@ -184409,31 +184882,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+17616, libc.VaList(bp+128, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+17749, 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 @@ -184457,10 +184930,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) @@ -184501,8 +184974,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-- } @@ -184519,28 +184992,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+17624, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17757, 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+17676, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17809, 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 @@ -184653,18 +185126,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 @@ -184674,13 +185147,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 } } } @@ -184691,14 +185164,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 } @@ -184715,16 +185188,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++ @@ -184835,11 +185308,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 */ @@ -184898,7 +185371,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+17768) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+17901) } goto insert_cleanup insert_cleanup: @@ -185294,7 +185767,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+13878, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+13964, 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('\\'))) { @@ -187528,7 +188003,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+17818, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+17951, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -187548,7 +188023,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+17822, uint64(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+17955, uint64(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } @@ -187560,7 +188035,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+17828, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+17961, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, int32(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -187575,7 +188050,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+17871, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+18004, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) @@ -187606,7 +188081,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+17903, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+18036, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, int32(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -187615,7 +188090,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 17782, + 0: __ccgo_ts + 17915, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -187848,7 +188323,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+17940, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+18073, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -187902,63 +188377,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 + 6872, - 1: __ccgo_ts + 17979, - 2: __ccgo_ts + 10555, - 3: __ccgo_ts + 17983, - 4: __ccgo_ts + 17988, - 5: __ccgo_ts + 17991, - 6: __ccgo_ts + 18001, - 7: __ccgo_ts + 18011, - 8: __ccgo_ts + 18017, - 9: __ccgo_ts + 18021, - 10: __ccgo_ts + 18026, - 11: __ccgo_ts + 18031, - 12: __ccgo_ts + 18039, - 13: __ccgo_ts + 18050, - 14: __ccgo_ts + 18053, - 15: __ccgo_ts + 18060, - 16: __ccgo_ts + 18021, - 17: __ccgo_ts + 18026, - 18: __ccgo_ts + 18067, - 19: __ccgo_ts + 18072, - 20: __ccgo_ts + 18075, - 21: __ccgo_ts + 18082, - 22: __ccgo_ts + 18017, - 23: __ccgo_ts + 18021, - 24: __ccgo_ts + 18088, - 25: __ccgo_ts + 18093, - 26: __ccgo_ts + 18098, - 27: __ccgo_ts + 18021, - 28: __ccgo_ts + 18102, - 29: __ccgo_ts + 18026, - 30: __ccgo_ts + 18110, - 31: __ccgo_ts + 18114, - 32: __ccgo_ts + 18119, - 33: __ccgo_ts + 13294, - 34: __ccgo_ts + 13290, - 35: __ccgo_ts + 18125, - 36: __ccgo_ts + 18130, - 37: __ccgo_ts + 18135, - 38: __ccgo_ts + 17979, - 39: __ccgo_ts + 18021, - 40: __ccgo_ts + 18140, - 41: __ccgo_ts + 18147, - 42: __ccgo_ts + 18154, - 43: __ccgo_ts + 10555, - 44: __ccgo_ts + 18162, - 45: __ccgo_ts + 6875, - 46: __ccgo_ts + 18168, - 47: __ccgo_ts + 17979, - 48: __ccgo_ts + 18021, - 49: __ccgo_ts + 18173, - 50: __ccgo_ts + 18178, - 51: __ccgo_ts + 17363, - 52: __ccgo_ts + 18183, - 53: __ccgo_ts + 18196, - 54: __ccgo_ts + 18205, - 55: __ccgo_ts + 18212, - 56: __ccgo_ts + 18223, + 0: __ccgo_ts + 6959, + 1: __ccgo_ts + 18112, + 2: __ccgo_ts + 10641, + 3: __ccgo_ts + 18116, + 4: __ccgo_ts + 18121, + 5: __ccgo_ts + 18124, + 6: __ccgo_ts + 18134, + 7: __ccgo_ts + 18144, + 8: __ccgo_ts + 18150, + 9: __ccgo_ts + 18154, + 10: __ccgo_ts + 18159, + 11: __ccgo_ts + 18164, + 12: __ccgo_ts + 18172, + 13: __ccgo_ts + 18183, + 14: __ccgo_ts + 18186, + 15: __ccgo_ts + 18154, + 16: __ccgo_ts + 18193, + 17: __ccgo_ts + 18159, + 18: __ccgo_ts + 18201, + 19: __ccgo_ts + 18205, + 20: __ccgo_ts + 18210, + 21: __ccgo_ts + 18216, + 22: __ccgo_ts + 18154, + 23: __ccgo_ts + 18159, + 24: __ccgo_ts + 18223, + 25: __ccgo_ts + 18228, + 26: __ccgo_ts + 18231, + 27: __ccgo_ts + 18238, + 28: __ccgo_ts + 18150, + 29: __ccgo_ts + 18154, + 30: __ccgo_ts + 18244, + 31: __ccgo_ts + 18249, + 32: __ccgo_ts + 18254, + 33: __ccgo_ts + 18112, + 34: __ccgo_ts + 18154, + 35: __ccgo_ts + 18258, + 36: __ccgo_ts + 18265, + 37: __ccgo_ts + 18272, + 38: __ccgo_ts + 13380, + 39: __ccgo_ts + 13376, + 40: __ccgo_ts + 18280, + 41: __ccgo_ts + 18285, + 42: __ccgo_ts + 18290, + 43: __ccgo_ts + 10641, + 44: __ccgo_ts + 18295, + 45: __ccgo_ts + 6962, + 46: __ccgo_ts + 18301, + 47: __ccgo_ts + 18306, + 48: __ccgo_ts + 17496, + 49: __ccgo_ts + 18311, + 50: __ccgo_ts + 18112, + 51: __ccgo_ts + 18154, + 52: __ccgo_ts + 18324, + 53: __ccgo_ts + 18329, + 54: __ccgo_ts + 18338, + 55: __ccgo_ts + 18345, + 56: __ccgo_ts + 18356, } // C documentation @@ -187977,343 +188452,343 @@ type PragmaName = TPragmaName var _aPragmaName = [67]TPragmaName{ 0: { - FzName: __ccgo_ts + 18231, + FzName: __ccgo_ts + 18364, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 18246, + FzName: __ccgo_ts + 18379, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 18261, + FzName: __ccgo_ts + 18394, 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 + 18273, + FzName: __ccgo_ts + 18406, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 18289, + FzName: __ccgo_ts + 18422, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 18212, + FzName: __ccgo_ts + 18345, 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 + 18302, + FzName: __ccgo_ts + 18435, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 18314, + FzName: __ccgo_ts + 18447, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 18334, + FzName: __ccgo_ts + 18467, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 18350, + FzName: __ccgo_ts + 18483, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 18371, + FzName: __ccgo_ts + 18504, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 18386, + FzName: __ccgo_ts + 18519, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 18402, + FzName: __ccgo_ts + 18535, 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 + 18416, + FzName: __ccgo_ts + 18549, FePragTyp: uint8(PragTyp_DATA_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 14: { - FzName: __ccgo_ts + 18437, + FzName: __ccgo_ts + 18570, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 15: { - FzName: __ccgo_ts + 18450, + FzName: __ccgo_ts + 18583, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 16: { - FzName: __ccgo_ts + 18464, + FzName: __ccgo_ts + 18597, 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 + 18483, + FzName: __ccgo_ts + 18616, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 18: { - FzName: __ccgo_ts + 18502, + FzName: __ccgo_ts + 18635, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 19: { - FzName: __ccgo_ts + 18525, + FzName: __ccgo_ts + 18658, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 20: { - FzName: __ccgo_ts + 18534, + FzName: __ccgo_ts + 18667, 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 + 18552, + FzName: __ccgo_ts + 18685, 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 + 18569, + FzName: __ccgo_ts + 18702, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 23: { - FzName: __ccgo_ts + 18582, + FzName: __ccgo_ts + 18715, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 24: { - FzName: __ccgo_ts + 18597, + FzName: __ccgo_ts + 18730, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 25: { - FzName: __ccgo_ts + 18615, + FzName: __ccgo_ts + 18748, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 26: { - FzName: __ccgo_ts + 18625, + FzName: __ccgo_ts + 18758, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 27: { - FzName: __ccgo_ts + 18639, + FzName: __ccgo_ts + 18772, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 28: { - FzName: __ccgo_ts + 18655, + FzName: __ccgo_ts + 18788, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 29: { - FzName: __ccgo_ts + 18680, + FzName: __ccgo_ts + 18813, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 30: { - FzName: __ccgo_ts + 18699, + FzName: __ccgo_ts + 18832, 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 + 18710, + FzName: __ccgo_ts + 18843, 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 + 18721, + FzName: __ccgo_ts + 18854, 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 + 18733, + FzName: __ccgo_ts + 18866, 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 + 18749, + FzName: __ccgo_ts + 18882, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 18762, + FzName: __ccgo_ts + 18895, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 36: { - FzName: __ccgo_ts + 18781, + FzName: __ccgo_ts + 18914, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 37: { - FzName: __ccgo_ts + 18800, + FzName: __ccgo_ts + 18933, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 18813, + FzName: __ccgo_ts + 18946, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 39: { - FzName: __ccgo_ts + 18828, + FzName: __ccgo_ts + 18961, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 40: { - FzName: __ccgo_ts + 18838, + FzName: __ccgo_ts + 18971, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 41: { - FzName: __ccgo_ts + 18850, + FzName: __ccgo_ts + 18983, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 42: { - FzName: __ccgo_ts + 18859, + FzName: __ccgo_ts + 18992, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 43: { - FzName: __ccgo_ts + 18870, + FzName: __ccgo_ts + 19003, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 44: { - FzName: __ccgo_ts + 18880, + FzName: __ccgo_ts + 19013, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 45: { - FzName: __ccgo_ts + 18892, + FzName: __ccgo_ts + 19025, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 46: { - FzName: __ccgo_ts + 18903, + FzName: __ccgo_ts + 19036, 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 + 18915, + FzName: __ccgo_ts + 19048, 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 + 18932, + FzName: __ccgo_ts + 19065, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 49: { - FzName: __ccgo_ts + 18951, + FzName: __ccgo_ts + 19084, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 50: { - FzName: __ccgo_ts + 18977, + FzName: __ccgo_ts + 19110, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 51: { - FzName: __ccgo_ts + 18992, + FzName: __ccgo_ts + 19125, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 52: { - FzName: __ccgo_ts + 19006, + FzName: __ccgo_ts + 19139, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 53: { - FzName: __ccgo_ts + 19025, + FzName: __ccgo_ts + 19158, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 54: { - FzName: __ccgo_ts + 19039, + FzName: __ccgo_ts + 19172, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 55: { - FzName: __ccgo_ts + 19055, + FzName: __ccgo_ts + 19188, 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 + 19067, + FzName: __ccgo_ts + 19200, 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 + 19078, + FzName: __ccgo_ts + 19211, 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 + 19089, + FzName: __ccgo_ts + 19222, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -188321,45 +188796,45 @@ var _aPragmaName = [67]TPragmaName{ FiArg: uint64(1), }, 59: { - FzName: __ccgo_ts + 19101, + FzName: __ccgo_ts + 19234, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 60: { - FzName: __ccgo_ts + 19112, + FzName: __ccgo_ts + 19245, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 61: { - FzName: __ccgo_ts + 19133, + FzName: __ccgo_ts + 19266, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 62: { - FzName: __ccgo_ts + 19141, + FzName: __ccgo_ts + 19274, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 63: { - FzName: __ccgo_ts + 19156, + FzName: __ccgo_ts + 19289, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 64: { - FzName: __ccgo_ts + 19169, + FzName: __ccgo_ts + 19302, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 65: { - FzName: __ccgo_ts + 19188, + FzName: __ccgo_ts + 19321, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 66: { - FzName: __ccgo_ts + 19203, + FzName: __ccgo_ts + 19336, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -188377,7 +188852,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 @@ -188485,10 +188960,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+5172) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+5259) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19219) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19352) { return PAGER_LOCKINGMODE_NORMAL } } @@ -188506,13 +188981,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+9715) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+9801) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19226) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19359) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19231) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19364) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -188535,10 +189010,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+18173) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18324) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+19243) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+19376) == 0 { return int32(2) } else { return 0 @@ -188560,7 +189035,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+19250, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19383, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -188690,15 +189165,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch int32(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 19312 + zName = __ccgo_ts + 19445 case int32(OE_SetDflt): - zName = __ccgo_ts + 19321 + zName = __ccgo_ts + 19454 case int32(OE_Cascade): - zName = __ccgo_ts + 19333 + zName = __ccgo_ts + 19466 case int32(OE_Restrict): - zName = __ccgo_ts + 19341 + zName = __ccgo_ts + 19474 default: - zName = __ccgo_ts + 19350 + zName = __ccgo_ts + 19483 break } return zName @@ -188719,12 +189194,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 19360, - 1: __ccgo_ts + 19367, - 2: __ccgo_ts + 19375, - 3: __ccgo_ts + 19379, - 4: __ccgo_ts + 19243, - 5: __ccgo_ts + 19388, + 0: __ccgo_ts + 19493, + 1: __ccgo_ts + 19500, + 2: __ccgo_ts + 19508, + 3: __ccgo_ts + 19512, + 4: __ccgo_ts + 19376, + 5: __ccgo_ts + 19521, } // C documentation @@ -188786,15 +189261,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 + 19413 + zType = __ccgo_ts + 19546 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 19415 + zType = __ccgo_ts + 19548 } else { - zType = __ccgo_ts + 9114 + zType = __ccgo_ts + 9200 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19417, 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+19550, 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: ; @@ -188803,9 +189278,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 19392, - 2: __ccgo_ts + 19397, - 3: __ccgo_ts + 19405, + 1: __ccgo_ts + 19525, + 2: __ccgo_ts + 19530, + 3: __ccgo_ts + 19538, } // C documentation @@ -188905,7 +189380,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+19424, libc.VaList(bp+176, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+19557, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -188948,7 +189423,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+4711, 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++ @@ -188993,7 +189468,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 @@ -189052,7 +189527,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+19428) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+19561) == 0 { b = int32(2) } else { b = int32(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -189095,7 +189570,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 @@ -189123,7 +189598,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 19219 + zRet = __ccgo_ts + 19352 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 @@ -189151,7 +189626,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 + 5172 + zRet = __ccgo_ts + 5259 } _returnSingleText(tls, v, zRet) break @@ -189441,7 +189916,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+19433, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19566, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -189451,7 +189926,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+4711, 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) } @@ -189480,14 +189955,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+19433, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19566, 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+4711, 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) } @@ -189509,7 +189984,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+19458, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19591, 0) } else { if iDb != int32(1) { iLevel = (int32(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -189541,8 +190016,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+19511) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+19644) == 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. */ @@ -189622,9 +190098,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 + 19517 + v14 = __ccgo_ts + 19650 } else { - v14 = __ccgo_ts + 19525 + v14 = __ccgo_ts + 19658 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -189695,7 +190171,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+19532, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19665, 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)) @@ -189725,19 +190201,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 + 12293 + zType = __ccgo_ts + 12379 } else { if int32((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 14541 + zType = __ccgo_ts + 14627 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 19548 + zType = __ccgo_ts + 19681 } else { - zType = __ccgo_ts + 10555 + zType = __ccgo_ts + 10641 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19555, 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+19688, 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: ; @@ -189784,9 +190260,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+19562, libc.VaList(bp+176, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19695, libc.VaList(bp+176, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+19567, 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+19700, 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 @@ -189810,11 +190286,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 19572, - 1: __ccgo_ts + 19574, - 2: __ccgo_ts + 18050, + 0: __ccgo_ts + 19705, + 1: __ccgo_ts + 19707, + 2: __ccgo_ts + 18183, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19576, 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+19709, 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: ; @@ -189833,7 +190309,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+19582, 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+19715, 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: ; @@ -189850,7 +190326,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+19586, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19719, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -189900,7 +190376,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+9114, 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: ; @@ -189912,7 +190388,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+9114, 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: ; @@ -189938,7 +190414,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+19589, 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+19598)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19722, 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+19731)) goto _32 _32: ; @@ -189952,8 +190428,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 @@ -190079,7 +190555,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+19603, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+19736, 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))) @@ -190175,7 +190651,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 @@ -190270,7 +190746,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+19607, 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+19740, 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) @@ -190281,7 +190757,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+19631) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+19764) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -190417,7 +190893,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+19660, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+19793, 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) @@ -190479,7 +190955,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))) } @@ -190501,7 +190977,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+19696, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19829, 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) @@ -190514,7 +190990,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+19716, 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+19849, 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) { @@ -190522,7 +190998,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+19738, 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+19871, 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) { @@ -190533,10 +191009,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+19761, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+19894, -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+19763, 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+19896, 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)) } } @@ -190570,7 +191046,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+19783, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19916, 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) @@ -190594,9 +191070,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+19813) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19946) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19818) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19951) _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)) @@ -190609,9 +191085,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+19839) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19972) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19875) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+20008) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -190639,9 +191115,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+19813) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19946) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19886) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+20019) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -190669,7 +191145,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+19913) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+20046) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -190766,7 +191242,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 + 19940 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 20073 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -190845,7 +191321,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+20001, libc.VaList(bp+176, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20134, libc.VaList(bp+176, zRight)) } } } @@ -190950,13 +191426,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+19226) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19359) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+20026) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+20159) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19379) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19512) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -191091,7 +191567,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 @@ -191121,7 +191597,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+7961, 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. @@ -191183,7 +191659,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+20034, 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+20167, 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)) @@ -191456,34 +191932,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 19943, + FzName: __ccgo_ts + 20076, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 19948, + FzName: __ccgo_ts + 20081, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 19954, + FzName: __ccgo_ts + 20087, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 19963, + FzName: __ccgo_ts + 20096, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 19972, + FzName: __ccgo_ts + 20105, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 19980, + FzName: __ccgo_ts + 20113, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 19988, + FzName: __ccgo_ts + 20121, }, 7: { - FzName: __ccgo_ts + 19995, + FzName: __ccgo_ts + 20128, }, 8: {}, } @@ -191579,14 +192055,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+20052) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20185) 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+20067, libc.VaList(bp+240, int32(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20200, libc.VaList(bp+240, int32(cSep), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -191595,19 +192071,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20074, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20207, 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+20080) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20213) j++ } if int32((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20092) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20225) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+6481, 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 { @@ -191622,7 +192098,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+4711, 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 @@ -191803,7 +192279,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+4711, 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) } @@ -191815,13 +192291,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+20107) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20240) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20115, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20248, 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+20119, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20252, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -191830,7 +192306,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+4711, 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) @@ -191956,24 +192432,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+20153, 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+20286, 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(143745)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) } else { - v1 = __ccgo_ts + 6483 + v1 = __ccgo_ts + 6570 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+20181, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+20314, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*int8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+20212, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+20345, 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(143752)) } } } @@ -191981,9 +192457,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 20123, - 1: __ccgo_ts + 20130, - 2: __ccgo_ts + 20142, + 0: __ccgo_ts + 20256, + 1: __ccgo_ts + 20263, + 2: __ccgo_ts + 20275, } // C documentation @@ -192059,7 +192535,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+15986) + _corruptSchema(tls, pData, argv, __ccgo_ts+16072) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -192092,11 +192568,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+20220) + _corruptSchema(tls, pData, argv, __ccgo_ts+20353) } 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+15986) + _corruptSchema(tls, pData, argv, __ccgo_ts+16072) } } } @@ -192135,18 +192611,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 + 10555 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 10641 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 7969 + v2 = __ccgo_ts + 8055 } else { - v2 = __ccgo_ts + 7457 + 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 + 9627 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 20233 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 9713 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 20366 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -192230,7 +192706,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+13592) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+13678) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -192256,7 +192732,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+20305) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+20438) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -192271,7 +192747,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+20329, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+20462, 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)) @@ -192600,7 +193076,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 @@ -192629,7 +193105,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 @@ -192689,7 +193165,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+20363, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+20496, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -192705,7 +193181,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+20393, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+20526, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -192728,10 +193204,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 { @@ -192739,7 +193215,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+4711, 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) @@ -192769,7 +193245,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(144552)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -192903,7 +193379,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(144701)) } /* 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 @@ -193163,7 +193639,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) @@ -193171,7 +193647,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 @@ -193327,15 +193803,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 + 12699 - zSp2 = __ccgo_ts + 12699 + zSp1 = __ccgo_ts + 12785 + zSp2 = __ccgo_ts + 12785 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20412, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20545, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -193392,25 +193868,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) } @@ -193542,13 +194021,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 { @@ -193626,7 +194105,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+20442, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20575, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -193676,12 +194155,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+20492, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20625, 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. @@ -193696,9 +194175,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+20556, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20689, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -193708,6 +194188,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) @@ -193742,7 +194229,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 8166, + Fz: __ccgo_ts + 8252, Fn: uint32(8), } @@ -193790,7 +194277,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 @@ -193835,7 +194322,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) @@ -193859,7 +194346,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) @@ -193880,7 +194367,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 @@ -194003,7 +194490,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 { @@ -194130,10 +194617,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 @@ -194141,7 +194628,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 @@ -194318,7 +194805,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+20593, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20726, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -194429,8 +194916,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) @@ -194438,7 +194925,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) } @@ -194523,13 +195010,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 20613 + z = __ccgo_ts + 20746 case int32(TK_INTERSECT): - z = __ccgo_ts + 20623 + z = __ccgo_ts + 20756 case int32(TK_EXCEPT): - z = __ccgo_ts + 20633 + z = __ccgo_ts + 20766 default: - z = __ccgo_ts + 20640 + z = __ccgo_ts + 20773 break } return z @@ -194550,7 +195037,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+20646, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20779, libc.VaList(bp+8, zUsage)) } /* @@ -194587,13 +195074,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 + 20669 + v1 = __ccgo_ts + 20802 } else { v1 = __ccgo_ts + 1674 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20683, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20816, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20714, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20847, 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) @@ -194617,11 +195104,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 @@ -194837,7 +195324,7 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr } if iCol < 0 { zType = __ccgo_ts + 1148 - *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 18162 + *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 18295 } 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)) @@ -194950,7 +195437,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 */ @@ -194959,7 +195446,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) @@ -194983,13 +195470,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 18162 + zCol = __ccgo_ts + 18295 } 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+13878, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+13964, 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))) @@ -194997,7 +195484,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+20760, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+20893, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -195089,7 +195576,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 + 18162 + v3 = __ccgo_ts + 18295 } zName = v3 } else { @@ -195104,7 +195591,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+20760, libc.VaList(bp+40, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+20893, 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. @@ -195140,7 +195627,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+20769, libc.VaList(bp+40, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+20902, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -195259,7 +195746,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 + 20777 + zType = __ccgo_ts + 20910 } else { zType = uintptr(0) j = int32(1) @@ -195325,7 +195812,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) } @@ -195353,7 +195840,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) } @@ -195403,7 +195890,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 @@ -195426,7 +195913,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 @@ -195574,7 +196061,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+20781, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20914, 0) return } /* Obtain authorization to do a recursive query */ @@ -195611,7 +196098,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 @@ -195622,7 +196109,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 @@ -195636,7 +196123,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 @@ -195667,7 +196154,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+20830, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20963, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -195682,7 +196169,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+20872, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21005, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -195710,7 +196197,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+20878, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21011, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -195765,9 +196252,9 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) if nRow == int32(1) { v1 = __ccgo_ts + 1674 } else { - v1 = __ccgo_ts + 20893 + v1 = __ccgo_ts + 21026 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20895, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21028, 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) { @@ -195875,8 +196362,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+20918, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20933, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21051, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21066, 0) } /* Generate code for the left and right SELECT statements. */ @@ -195901,7 +196388,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+20613, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20746, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -195927,7 +196414,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 @@ -195953,7 +196440,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+20952, libc.VaList(bp+136, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21085, 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 @@ -195985,11 +196472,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 @@ -196011,7 +196498,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+20952, libc.VaList(bp+136, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21085, 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 @@ -196118,6 +196605,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) } @@ -196134,9 +196622,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+20973, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21106, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21019, libc.VaList(bp+8, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21152, libc.VaList(bp+8, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -196207,7 +196695,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+20593, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20726, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -196455,7 +196943,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 { @@ -196509,16 +196997,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+8864) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+8864) + _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 @@ -196536,32 +197024,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+21101, libc.VaList(bp+88, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21234, 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+21112, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21245, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -196574,7 +197062,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+21117, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21250, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -196784,11 +197272,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 + 6461 + 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))) } @@ -196949,7 +197437,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 @@ -197139,9 +197627,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. @@ -197353,7 +197841,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) @@ -197500,7 +197988,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) @@ -197790,7 +198278,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++ @@ -197859,7 +198347,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 @@ -197877,12 +198365,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 { @@ -198364,7 +198852,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 @@ -198410,13 +198898,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+17020) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+17133) == 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+17024) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+17137) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -198504,8 +198992,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+21123, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21256, 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 @@ -198529,7 +199017,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 @@ -198611,7 +199099,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) @@ -198629,7 +199117,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+21141, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21274, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -198777,7 +199265,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) } @@ -198805,7 +199293,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+21164, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21297, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -198827,12 +199315,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+21184, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21317, 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 @@ -198849,7 +199337,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21227 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21360 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 { @@ -198880,7 +199368,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+21250, 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+21383, 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) } @@ -198889,9 +199377,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 + 21288 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21421 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21322 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21455 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -198940,7 +199428,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) { @@ -198950,7 +199438,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+21360, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+21493, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -199046,7 +199534,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) @@ -199055,7 +199543,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) } @@ -199106,7 +199594,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+21364, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21497, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -199121,7 +199609,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+21403, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21536, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -199136,7 +199624,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+16579, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16665, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -199260,7 +199748,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 + 8026 + v10 = __ccgo_ts + 8112 } zSchemaName = v10 } @@ -199277,7 +199765,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+21434, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+21567, 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) } @@ -199356,7 +199844,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+21439, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+21572, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -199369,7 +199857,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+13878, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+13964, 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) @@ -199389,9 +199877,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21448, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21581, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21466, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21599, 0) } } } @@ -199405,7 +199893,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+21486, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21619, 0) return int32(WRC_Abort) } if elistFlags&uint32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -199654,7 +200142,7 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint (*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))) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^uint32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -199707,7 +200195,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 @@ -199744,12 +200232,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+21517, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21650, 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+21568, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21701, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -199770,7 +200258,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+21601, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21734, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -199909,7 +200397,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 @@ -200017,7 +200505,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 @@ -200084,7 +200572,7 @@ 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 + 21634 + v1 = __ccgo_ts + 21767 } else { v1 = __ccgo_ts + 1674 } @@ -200093,7 +200581,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp } else { v2 = __ccgo_ts + 1674 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21657, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21790, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -200125,7 +200613,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+9627) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+9713) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -200254,6 +200742,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. // */ @@ -200282,7 +200771,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+17314) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+17447) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -200315,9 +200804,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 */ } @@ -200327,13 +200816,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 { @@ -200353,7 +200842,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) } @@ -200526,8 +201015,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 @@ -200536,11 +201025,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 { @@ -200556,7 +201045,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)) @@ -200580,14 +201069,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+21669, libc.VaList(bp+176, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21802, 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) @@ -200688,7 +201177,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+21723, 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+21856, 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 @@ -200889,14 +201378,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+21763, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21896, 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) @@ -200928,7 +201417,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 @@ -200943,7 +201432,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+21778, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21911, 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 { @@ -200997,7 +201486,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 @@ -201030,7 +201519,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 @@ -201089,7 +201578,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 @@ -201118,6 +201607,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)) @@ -201140,10 +201636,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) @@ -201177,8 +201673,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 @@ -201193,8 +201689,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 @@ -201223,8 +201719,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++ } @@ -201254,11 +201750,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 = uint16(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -201292,47 +201788,47 @@ 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)) /* Begin a loop that will extract all source rows in GROUP BY order. @@ -201342,16 +201838,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 @@ -201369,11 +201865,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 + 21794 + v47 = __ccgo_ts + 21927 } else { - v46 = __ccgo_ts + 21803 + v47 = __ccgo_ts + 21936 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20646, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20779, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -201387,8 +201883,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -201406,8 +201902,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -201418,12 +201914,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) @@ -201472,12 +201968,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++ } @@ -201547,9 +202047,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 @@ -201566,10 +202066,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 */ @@ -201596,8 +202096,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 } @@ -201637,32 +202137,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) @@ -201704,7 +202204,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+21794) + _explainTempTable(tls, pParse, __ccgo_ts+21927) } /* 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 @@ -201810,7 +202310,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+4711, 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 } @@ -201826,7 +202326,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+21812, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+21945, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -201916,7 +202416,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+4711, 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) } @@ -202078,7 +202578,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+21877, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22010, 0) goto trigger_cleanup } iDb = int32(1) @@ -202118,7 +202618,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+21923, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+22056, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -202128,11 +202628,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+21931, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22064, 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+21972, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22105, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -202141,13 +202641,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+21923, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+22056, (*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+22012, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22145, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -202155,8 +202655,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+7961, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22038, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+8047, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22171, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -202164,15 +202664,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 + 22076 + v1 = __ccgo_ts + 22209 } else { - v1 = __ccgo_ts + 22083 + v1 = __ccgo_ts + 22216 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22089, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22222, 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+22126, libc.VaList(bp+112, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22259, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -202192,9 +202692,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 + 7969 + v3 = __ccgo_ts + 8055 } else { - v3 = __ccgo_ts + 7457 + v3 = __ccgo_ts + 7542 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -202294,7 +202794,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+21923, bp+96) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+22056, 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 } @@ -202316,7 +202816,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+22172, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22305, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -202332,10 +202832,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+22220, 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+22353, 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+22295, libc.VaList(bp+120, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+22428, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -202603,11 +203103,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22324, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22457, 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) @@ -202645,9 +203145,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 + 7969 + v1 = __ccgo_ts + 8055 } else { - v1 = __ccgo_ts + 7457 + v1 = __ccgo_ts + 7542 } zTab = v1 if iDb == int32(1) { @@ -202662,7 +203162,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+22344, 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+22477, 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) } @@ -202795,11 +203295,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 + 22406 + v1 = __ccgo_ts + 22539 } else { - v1 = __ccgo_ts + 22413 + v1 = __ccgo_ts + 22546 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22420, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22553, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -202901,7 +203401,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+22468, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22601, 0) return int32(1) } @@ -203049,12 +203549,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) { @@ -203062,19 +203562,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) @@ -203085,7 +203588,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 @@ -203099,7 +203602,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 { @@ -203167,7 +203670,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+7654, 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): @@ -203266,10 +203769,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+22510, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+22643, 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 @@ -203291,7 +203796,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 @@ -203363,7 +203868,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)) @@ -203779,13 +204284,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 @@ -203793,21 +204298,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 */ @@ -203854,7 +204359,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 @@ -203937,58 +204442,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+22524, 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+22657, 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+22560, 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+22693, 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 + 9402 + 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 { @@ -204018,17 +204511,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++ } @@ -204040,11 +204533,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 @@ -204060,11 +204553,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 @@ -204073,18 +204566,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++ } @@ -204093,16 +204586,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. */ @@ -204120,24 +204613,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 { @@ -204163,50 +204656,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) @@ -204504,8 +204997,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -204555,8 +205048,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++ @@ -204603,11 +205096,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)) } @@ -204619,11 +205112,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. */ @@ -204666,7 +205159,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+22579) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+22712) } goto update_cleanup update_cleanup: @@ -204723,13 +205216,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) { @@ -204771,11 +205264,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 @@ -205100,9 +205593,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+22592, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+22725, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22596, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22729, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -205191,13 +205684,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: @@ -205205,7 +205698,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+13967, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+14053, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -205287,7 +205780,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+22669, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+22673, uint64(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+22802, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+22806, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -205378,7 +205871,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 @@ -205417,17 +205910,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+22677) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22810) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22717) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22850) 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+22760) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22893) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -205444,7 +205937,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+22809) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22942) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -205497,7 +205990,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+16349) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+16435) if rc != SQLITE_OK { goto end_of_vacuum } @@ -205528,11 +206021,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+22836, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22969, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22944, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+23077, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -205541,7 +206034,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+22998, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+23131, 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 @@ -205551,7 +206044,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+23135, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+23268, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -206078,7 +206571,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+14197, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14283, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -206201,24 +206694,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+23258, libc.VaList(bp+8, pParse+272)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+23391, 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+23282, 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+23415, 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+23381, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+23514, 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 @@ -206302,7 +206800,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+23400, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23533, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -206344,9 +206842,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+23442, libc.VaList(bp+48, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23575, libc.VaList(bp+48, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+4711, 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) @@ -206359,7 +206857,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 + 23472 + zFormat = __ccgo_ts + 23605 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -206393,7 +206891,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+18053, 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+18186, 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 @@ -206474,13 +206972,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+23518, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23651, 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+4711, 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))) @@ -206561,7 +207059,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+23518, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23651, 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) @@ -206609,7 +207107,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+23537, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+23670, 0) return int32(SQLITE_ERROR) } goto _1 @@ -206620,9 +207118,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(158352))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158354)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -206664,7 +207162,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 + 4711 + v3 = __ccgo_ts + 4829 } else { v3 = uintptr(0) } @@ -207120,7 +207618,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 } @@ -207140,7 +207638,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+4711, 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) } @@ -207204,7 +207702,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(158849)) } else { ap = va switch op { @@ -207217,7 +207715,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(158871)) break } _ = ap @@ -207902,7 +208400,6 @@ type TWhereInfo1 = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo1 = TWhereInfo1 @@ -207938,10 +208435,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 + 23550 + return __ccgo_ts + 23683 } if i == -int32(1) { - return __ccgo_ts + 18162 + return __ccgo_ts + 18295 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -207960,10 +208457,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+23557, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23690, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+23563, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23696, int32(1)) } i = 0 for { @@ -207971,7 +208468,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+14587, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+14673, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -207980,11 +208477,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+6481, 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+23563, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23696, int32(1)) } i = 0 for { @@ -207992,16 +208489,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+14587, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+14673, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+6483, 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+6481, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+6568, int32(1)) } } @@ -208048,7 +208545,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+23565, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23698, int32(2)) i = 0 for { if !(i < int32(nEq)) { @@ -208056,12 +208553,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+23557, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23690, int32(5)) } if i >= int32(nSkip) { - v2 = __ccgo_ts + 23568 + v2 = __ccgo_ts + 23701 } else { - v2 = __ccgo_ts + 23573 + v2 = __ccgo_ts + 23706 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -208078,7 +208575,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+23581) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+23714) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -208089,9 +208586,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+23583) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+23716) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+6481, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+6568, int32(1)) } // C documentation @@ -208136,11 +208633,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 + 23585 + v2 = __ccgo_ts + 23718 } else { - v2 = __ccgo_ts + 23592 + v2 = __ccgo_ts + 23725 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23597, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23730, libc.VaList(bp+144, v2, pItem)) if flags&uint32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) pIdx = (*(*struct { @@ -208153,37 +208650,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 + 12750 + zFmt = __ccgo_ts + 12836 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 23603 + zFmt = __ccgo_ts + 23736 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 23636 + zFmt = __ccgo_ts + 23769 } else { if flags&uint32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 23661 + zFmt = __ccgo_ts + 23794 } else { - zFmt = __ccgo_ts + 23679 + zFmt = __ccgo_ts + 23812 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+23688, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+23821, 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 + 18162 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23696, libc.VaList(bp+144, zRowid)) + zRowid = __ccgo_ts + 18295 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23829, 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+23727, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23860, libc.VaList(bp+144, zRowid)) cRangeOp = int8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -208193,14 +208690,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23737, libc.VaList(bp+144, int32(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23870, libc.VaList(bp+144, int32(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+23742) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+23875) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 23764 + v3 = __ccgo_ts + 23897 } else { - v3 = __ccgo_ts + 23772 + v3 = __ccgo_ts + 23905 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -208221,7 +208718,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+23778, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23911, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -208287,14 +208784,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+23789, libc.VaList(bp+144, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23922, 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+23568, 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+23701, 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+23810, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23943, 0) } } else { i = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -208318,16 +208815,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+23557, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+23690, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23568, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23701, libc.VaList(bp+144, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+6481, 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 @@ -208532,7 +209029,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 @@ -208611,7 +209108,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 */ @@ -208973,7 +209470,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 @@ -209386,7 +209883,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 @@ -209447,11 +209944,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 @@ -209482,6 +209979,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 { @@ -209620,7 +210120,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 @@ -209700,7 +210200,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 @@ -209734,7 +210234,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 @@ -209856,7 +210356,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 @@ -210049,7 +210549,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: @@ -210063,12 +210563,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 { @@ -210106,11 +210607,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 */ @@ -210130,7 +210631,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 } @@ -210166,21 +210667,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 @@ -210198,7 +210699,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, @@ -210253,7 +210754,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+23818, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23951, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -210276,7 +210777,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+23833, libc.VaList(bp+96, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23966, 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)) @@ -210765,9 +211266,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 @@ -210776,7 +211277,7 @@ 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+23842, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23975, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { @@ -210822,15 +211323,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 @@ -210842,7 +211344,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) { @@ -211313,19 +211815,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 18011, + FzOp: __ccgo_ts + 18144, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 17344, + FzOp: __ccgo_ts + 17477, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 16823, + FzOp: __ccgo_ts + 16936, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 23856, + FzOp: __ccgo_ts + 23989, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -212113,7 +212615,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+23863, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23996, 0) return } } else { @@ -212125,10 +212627,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+23863, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23996, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^uint32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -212209,7 +212711,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 + 9388 + *(*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) @@ -212310,7 +212812,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 + 23904 + v13 = __ccgo_ts + 24037 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -212841,7 +213343,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+23911, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24044, 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) @@ -212913,7 +213415,6 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo @@ -212924,7 +213425,6 @@ type THiddenIndexInfo1 = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo1 = THiddenIndexInfo1 @@ -213957,7 +214457,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)<>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 @@ -216574,7 +217070,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pNew + 24))).FnEq) < int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { + })(unsafe.Pointer(pNew + 24))).FnEq) < int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0)) { if int32((*(*struct { FnEq Tu16 FnBtm Tu16 @@ -216778,7 +217274,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 @@ -217062,7 +217558,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) } } @@ -217240,7 +217736,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)) @@ -217581,7 +218077,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+23984, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24117, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -217656,7 +218152,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+23984, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24117, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -217810,7 +218306,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(168893)) /* 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) @@ -218246,7 +218742,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+24010, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+24143, 0) rc = SQLITE_OK } else { break @@ -219454,7 +219950,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24045, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24178, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -220032,7 +220528,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 @@ -220188,7 +220684,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+24063, libc.VaList(bp+64, int32(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24196, 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 @@ -220209,10 +220705,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) @@ -220261,7 +220754,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+24091, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+24224, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -220406,7 +220899,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 @@ -220440,7 +220934,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. @@ -220566,7 +221060,7 @@ 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 @@ -220597,16 +221091,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 @@ -220785,7 +221279,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 { @@ -220992,7 +221486,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 @@ -221002,7 +221496,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+24109, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24242, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -221052,7 +221546,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 } @@ -221321,7 +221815,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+24138, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24271, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -221503,7 +221997,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+24194, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24327, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -221829,7 +222323,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+24239, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24372, libc.VaList(bp+8, zName)) } return p } @@ -221880,12 +222374,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+24258, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24391, 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+24329, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24462, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -221958,7 +222452,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+9627) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+9713) } break } @@ -222096,7 +222590,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( 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 { @@ -222240,7 +222734,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+24392, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+24525, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -222276,7 +222770,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)) } @@ -222291,7 +222785,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 @@ -222310,11 +222804,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 { @@ -222360,11 +222854,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 @@ -222381,7 +222875,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+1794)) + *(*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)) @@ -222403,7 +222897,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 @@ -222527,7 +223021,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+24418, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24551, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -222595,18 +223089,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 + 24450 + zErr = __ccgo_ts + 24583 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 24467 + zErr = __ccgo_ts + 24600 } else { if int32((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 24483 + zErr = __ccgo_ts + 24616 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24503, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24636, 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 { @@ -222630,7 +223124,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+24536, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24669, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -222736,24 +223230,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 @@ -222771,12 +223265,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) } @@ -222788,15 +223282,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 @@ -222848,11 +223342,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 24583, - 1: __ccgo_ts + 24636, - 2: __ccgo_ts + 24138, - 3: __ccgo_ts + 24687, - 4: __ccgo_ts + 24739, + 0: __ccgo_ts + 24716, + 1: __ccgo_ts + 24769, + 2: __ccgo_ts + 24271, + 3: __ccgo_ts + 24820, + 4: __ccgo_ts + 24872, } var _aOp1 = [5]int32{ @@ -223432,7 +223926,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 } @@ -223528,7 +224022,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 '' */ @@ -224245,12 +224739,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 @@ -224258,13 +224752,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 @@ -224284,13 +224778,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 @@ -224317,7 +224811,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 @@ -224536,6 +225030,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. @@ -224596,7 +225094,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+24789, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24922, libc.VaList(bp+8, p)) } // C documentation @@ -224610,6 +225108,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) } @@ -224643,11 +225142,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 + 24813 + v1 = __ccgo_ts + 24946 } else { - v1 = __ccgo_ts + 24822 + v1 = __ccgo_ts + 24955 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24828, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24961, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -224656,7 +225155,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24870, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25003, 0) } } } @@ -224762,7 +225261,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+24904, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25037, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -233219,20 +233718,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+18162, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+18295, 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+24942, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25075, 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+18075, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+18231, 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+24942, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25075, 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 @@ -233273,7 +233772,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 */ @@ -233418,7 +233922,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 */ @@ -233508,9 +234017,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) } @@ -233865,7 +234374,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+24969) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+25102) 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) { @@ -234215,9 +234724,9 @@ _237: */ _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 + 9383 + v347 = __ccgo_ts + 9469 } else { - v347 = __ccgo_ts + 9388 + v347 = __ccgo_ts + 9474 } *(*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 { @@ -234459,15 +234968,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+24978, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25111, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25073, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25206, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25157, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25290, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -234609,7 +235118,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 */ @@ -234803,7 +235312,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+25242, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25375, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -237534,14 +238043,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)< int32(65528) { sz = int32(65528) } - if cnt < 0 { + /* 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 > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } szAlloc = int64(sz) * int64(cnt) - if sz == 0 || cnt == 0 { + 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)) @@ -239015,7 +239533,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182779)) + return _sqlite3MisuseError(tls, int32(183820)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if int32((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -239035,7 +239553,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+25329, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+25462, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -239336,14 +239854,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 + 25872 + zErr = __ccgo_ts + 26005 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < int32(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -239355,31 +239873,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 25397, - 1: __ccgo_ts + 25410, - 3: __ccgo_ts + 25426, - 4: __ccgo_ts + 25451, - 5: __ccgo_ts + 25465, - 6: __ccgo_ts + 25484, + 0: __ccgo_ts + 25530, + 1: __ccgo_ts + 25543, + 3: __ccgo_ts + 25559, + 4: __ccgo_ts + 25584, + 5: __ccgo_ts + 25598, + 6: __ccgo_ts + 25617, 7: __ccgo_ts + 1644, - 8: __ccgo_ts + 25509, - 9: __ccgo_ts + 25546, - 10: __ccgo_ts + 25558, - 11: __ccgo_ts + 25573, - 12: __ccgo_ts + 25606, - 13: __ccgo_ts + 25624, - 14: __ccgo_ts + 25649, - 15: __ccgo_ts + 25678, - 17: __ccgo_ts + 7412, - 18: __ccgo_ts + 6814, - 19: __ccgo_ts + 25695, - 20: __ccgo_ts + 25713, - 21: __ccgo_ts + 25731, - 23: __ccgo_ts + 25765, - 25: __ccgo_ts + 25786, - 26: __ccgo_ts + 25812, - 27: __ccgo_ts + 25835, - 28: __ccgo_ts + 25856, + 8: __ccgo_ts + 25642, + 9: __ccgo_ts + 25679, + 10: __ccgo_ts + 25691, + 11: __ccgo_ts + 25706, + 12: __ccgo_ts + 25739, + 13: __ccgo_ts + 25757, + 14: __ccgo_ts + 25782, + 15: __ccgo_ts + 25811, + 17: __ccgo_ts + 7497, + 18: __ccgo_ts + 6901, + 19: __ccgo_ts + 25828, + 20: __ccgo_ts + 25846, + 21: __ccgo_ts + 25864, + 23: __ccgo_ts + 25898, + 25: __ccgo_ts + 25919, + 26: __ccgo_ts + 25945, + 27: __ccgo_ts + 25968, + 28: __ccgo_ts + 25989, } // C documentation @@ -239526,6 +240044,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 // // /* @@ -239558,7 +240090,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i 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(183430)) + return _sqlite3MisuseError(tls, int32(184509)) } 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) @@ -239601,7 +240133,7 @@ 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+25953, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+26086, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -239727,7 +240259,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+26016, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+26149, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -239758,7 +240290,7 @@ 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+4711, 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) } @@ -240002,7 +240534,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(184046)) + return _sqlite3MisuseError(tls, int32(185125)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -240012,7 +240544,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+26067, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+26200, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -240134,7 +240666,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(184182))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185261))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -240266,7 +240798,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(184261)) + return _sqlite3MisuseError(tls, int32(185340)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -240276,7 +240808,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(184270)) + return _sqlite3MisuseError(tls, int32(185349)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -240325,7 +240857,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(184318)) + return _sqlite3MisuseError(tls, int32(185397)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -240334,7 +240866,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+26088, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+26221, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -240481,7 +241013,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+26156, 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+26289, 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 @@ -240511,8 +241043,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+26162, zUri+7, uint64(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26172, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+26295, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26305, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -240601,24 +241133,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+26200, zOpt, uint64(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+26333, 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+26204, zOpt, uint64(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+26337, 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 + 26204 + zModeType = __ccgo_ts + 26337 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+26225, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+26358, 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 + 26240 + zModeType = __ccgo_ts + 26373 } if aMode != 0 { mode = 0 @@ -240647,12 +241179,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+26247, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26380, 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+26267, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26400, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -240676,7 +241208,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+26291, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26424, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -240696,11 +241228,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 26210, + Fz: __ccgo_ts + 26343, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 26217, + Fz: __ccgo_ts + 26350, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -240711,19 +241243,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 26230, + Fz: __ccgo_ts + 26363, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 26233, + Fz: __ccgo_ts + 26366, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 26236, + Fz: __ccgo_ts + 26369, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 19243, + Fz: __ccgo_ts + 19376, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -240851,8 +241383,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+23904, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+26307, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+24037, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+26440, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -240873,10 +241405,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(184993)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186072)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 5565 + zFilename = __ccgo_ts + 5652 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+8, bp+16) } @@ -240885,7 +241417,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 + 4711 + v2 = __ccgo_ts + 4829 } else { v2 = uintptr(0) } @@ -240912,9 +241444,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 + 8021 + (*(*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 + 25302 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 25435 (*(*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 { @@ -241008,7 +241540,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 26313 + zFilename = __ccgo_ts + 26446 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -241168,7 +241700,7 @@ 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) @@ -241225,20 +241757,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+26316, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+26449, 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+26341) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+26474) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+26361) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+26494) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+26368) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+26501) } // C documentation @@ -241263,9 +241795,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) @@ -241292,29 +241824,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 @@ -241369,15 +241890,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+26385, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+26518, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 4711 + 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) @@ -241556,8 +242077,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 @@ -242397,7 +242918,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+26413, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+26546, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -242615,7 +243136,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 26421 + v2 = __ccgo_ts + 26554 } else { v2 = uintptr(0) } @@ -242861,7 +243382,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 @@ -243078,6 +243599,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -243390,8 +243918,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 @@ -243448,7 +243976,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 @@ -243458,7 +243986,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 @@ -243496,18 +244024,18 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // */ var _jsonbType = [17]uintptr{ 0: __ccgo_ts + 1660, - 1: __ccgo_ts + 9383, - 2: __ccgo_ts + 9388, - 3: __ccgo_ts + 7697, - 4: __ccgo_ts + 7697, - 5: __ccgo_ts + 7692, - 6: __ccgo_ts + 7692, - 7: __ccgo_ts + 9694, - 8: __ccgo_ts + 9694, - 9: __ccgo_ts + 9694, - 10: __ccgo_ts + 9694, - 11: __ccgo_ts + 26444, - 12: __ccgo_ts + 26450, + 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 + 26577, + 12: __ccgo_ts + 26583, 13: __ccgo_ts + 1674, 14: __ccgo_ts + 1674, 15: __ccgo_ts + 1674, @@ -243994,7 +244522,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) { @@ -244292,8 +244820,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 + 26457 + 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 + 26457 + 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) } } @@ -244429,7 +244957,7 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { case int32(SQLITE_NULL): _jsonAppendRawNZ(tls, p, __ccgo_ts+1660, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+16793, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+16879, 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)) @@ -244443,14 +244971,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+26474, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+26590, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -244504,7 +245030,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+26503, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+26619, -int32(1)) } } } @@ -244787,8 +245313,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(3), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 26518, - FzRepl: __ccgo_ts + 26522, + FzMatch: __ccgo_ts + 26634, + FzRepl: __ccgo_ts + 26638, }, 1: { Fc1: int8('i'), @@ -244796,8 +245322,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(8), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 26530, - FzRepl: __ccgo_ts + 26522, + FzMatch: __ccgo_ts + 26646, + FzRepl: __ccgo_ts + 26638, }, 2: { Fc1: int8('n'), @@ -244812,7 +245338,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 26539, + FzMatch: __ccgo_ts + 26655, FzRepl: __ccgo_ts + 1660, }, 4: { @@ -244820,7 +245346,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 26544, + FzMatch: __ccgo_ts + 26660, FzRepl: __ccgo_ts + 1660, }, } @@ -244836,7 +245362,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26549, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26665, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -244854,23 +245380,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 } @@ -244948,7 +245474,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 @@ -245019,7 +245545,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) + } } } } @@ -245294,7 +245824,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+26592, int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+26708, 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') { @@ -245724,7 +246254,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 { @@ -245763,7 +246293,7 @@ parse_string: return int32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+9383, 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)) } @@ -245771,7 +246301,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+9388, 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)) } @@ -245848,14 +246378,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+26518, 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+26634, 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+26601) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+26717) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26608) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26724) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+26614, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+26730, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -246040,7 +246570,7 @@ _38: goto _51 } if int32(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26608) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26724) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -246085,7 +246615,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+26503, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26619, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -246098,7 +246628,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+26503, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26619, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -246147,10 +246677,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) @@ -246184,15 +246710,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 @@ -246265,11 +246791,11 @@ _2: return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+9383, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+9469, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+9388, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+9474, uint32(5)) return i + uint32(1) _6: ; @@ -246318,9 +246844,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 26522 + v19 = __ccgo_ts + 26638 } else { - v19 = __ccgo_ts + 13250 + v19 = __ccgo_ts + 13336 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -246356,9 +246882,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: ; @@ -246385,7 +246914,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26620, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26736, uint32(2)) zIn2++ sz2-- continue @@ -246408,7 +246937,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26623, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26739, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -246416,12 +246945,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26630, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26746, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26635, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26751, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -246601,7 +247130,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26642, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26758, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -246624,12 +247153,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+26645, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26761, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26642, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26758, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -246644,50 +247173,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 // // /* @@ -246739,6 +247224,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 // // /* @@ -246759,6 +247322,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)) @@ -246831,9 +247397,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 @@ -246876,7 +247442,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 @@ -247364,7 +247941,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+26503, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26619, -int32(1)) return } switch int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -247499,7 +248076,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 } @@ -247600,7 +248177,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26503, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26619, -int32(1)) return } @@ -247637,11 +248214,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+26474, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26590, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -247654,7 +248228,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+26503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -247673,10 +248247,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+26608) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26724) } 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+26601) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+26717) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(n), z) } @@ -247715,7 +248289,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+26648, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26764, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -247731,7 +248305,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. // ** @@ -247812,7 +248386,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -247824,34 +248398,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; +// ** 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. +// ** 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) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { + return 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) - return 0 + 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 (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + if v4 = v2 && int32(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - 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 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) @@ -247934,7 +248528,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 @@ -247994,7 +248588,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -248129,7 +248723,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 + 26666 + v1 = __ccgo_ts + 26782 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -248139,7 +248733,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+26503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) } } eErr = uint8(1) @@ -248249,23 +248843,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+26668, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+26784, uint32(1)) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+26670, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+26786, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+6536, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+6623, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1687, 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+26672, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+26788, uint32(2)) _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+26675, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+26791, uint32(1)) } } } @@ -248305,7 +248899,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+26503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -248573,7 +249167,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+26503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -248597,7 +249191,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+26677, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26793, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -248608,7 +249202,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+26728, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26844, -int32(1)) _jsonStringReset(tls, bp) return } @@ -248680,7 +249274,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+26503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) } } goto json_remove_done @@ -248717,7 +249311,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+17266) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+17399) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -248748,9 +249342,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 26762 + v1 = __ccgo_ts + 26878 } else { - v1 = __ccgo_ts + 26766 + v1 = __ccgo_ts + 26882 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -248798,7 +249392,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+26503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) } } goto json_type_done @@ -248845,7 +249439,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 + 26773 + (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 26889 (*(*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)) @@ -248919,17 +249513,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+26778, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26894, -int32(1)) return } flags = uint8(f & int64(0x0f)) @@ -248938,18 +249531,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 @@ -249011,9 +249603,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))) @@ -249120,7 +249710,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+26835, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+26951, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -249212,20 +249802,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))) + } } } @@ -249269,7 +249861,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+26838, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+26954, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -249372,7 +249964,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+26841) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+26957) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -249506,7 +250098,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+26924, 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+27040, 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 @@ -249532,9 +250124,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+26931, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+27047, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+26939, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+27055, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -249845,9 +250437,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))) @@ -249920,7 +250511,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+26945, uint32(1)) + _jsonAppendRaw(tls, p+56, __ccgo_ts+27061, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -249944,7 +250535,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+26503, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26619, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -250005,186 +250596,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 + 26947, + FzName: __ccgo_ts + 27063, }, 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 + 26952, + FzName: __ccgo_ts + 27068, }, 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 + 26958, + FzName: __ccgo_ts + 27074, }, 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 + 26969, + FzName: __ccgo_ts + 27085, }, 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 + 26981, + FzName: __ccgo_ts + 27097, }, 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 + 26981, + FzName: __ccgo_ts + 27097, }, 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 + 26999, + FzName: __ccgo_ts + 27115, }, 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 + 27019, + FzName: __ccgo_ts + 27135, }, 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 + 27032, + FzName: __ccgo_ts + 27148, }, 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 + 27046, + FzName: __ccgo_ts + 27162, }, 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 + 27049, + FzName: __ccgo_ts + 27165, }, 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 + 27053, + FzName: __ccgo_ts + 27169, }, 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 + 27065, + FzName: __ccgo_ts + 27181, }, 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 + 27078, + FzName: __ccgo_ts + 27194, }, 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 + 27090, + FzName: __ccgo_ts + 27206, }, 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 + 27103, + FzName: __ccgo_ts + 27219, }, 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 + 27114, + FzName: __ccgo_ts + 27230, }, 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 + 27126, + FzName: __ccgo_ts + 27242, }, 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 + 27126, + FzName: __ccgo_ts + 27242, }, 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 + 27138, + FzName: __ccgo_ts + 27254, }, 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 + 27149, + FzName: __ccgo_ts + 27265, }, 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 + 27161, + FzName: __ccgo_ts + 27277, }, 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 + 27174, + FzName: __ccgo_ts + 27290, }, 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 + 27187, + FzName: __ccgo_ts + 27303, }, 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 + 27201, + FzName: __ccgo_ts + 27317, }, 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 + 27210, + FzName: __ccgo_ts + 27326, }, 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 + 27220, + FzName: __ccgo_ts + 27336, }, 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 + 27220, + FzName: __ccgo_ts + 27336, }, 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 + 27230, + FzName: __ccgo_ts + 27346, }, 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 + 27230, + FzName: __ccgo_ts + 27346, }, 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 + 27241, + FzName: __ccgo_ts + 27357, }, 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 + 27258, + FzName: __ccgo_ts + 27374, }, 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 + 27276, + FzName: __ccgo_ts + 27392, }, 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 + 27294, + FzName: __ccgo_ts + 27410, }, } @@ -250267,17 +250858,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 27313, + FzName: __ccgo_ts + 27429, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 27323, + FzName: __ccgo_ts + 27439, 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 @@ -250385,7 +250978,6 @@ type TRtreeMatchArg = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - FaParam [1]TRtreeDValue } type RtreeMatchArg = TRtreeMatchArg @@ -250668,11 +251260,12 @@ type TRtreeMatchArg1 = struct { Fcb TRtreeGeomCallback FnParam int32 FapSqlParam uintptr - 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 ** clang, since clang works hard to be gcc compatible. So the gcc @@ -250917,7 +251510,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+27333, 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+27449, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -251222,7 +251815,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+27338, 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+27454, 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 { @@ -252139,7 +252732,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+27420) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+27536) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -252448,7 +253041,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 } @@ -252456,7 +253049,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 @@ -252694,7 +253287,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: @@ -253629,7 +254222,7 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -253646,7 +254239,7 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -253674,7 +254267,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+27434, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27550, 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 { @@ -253684,11 +254277,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+27454, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+27570, 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+27486, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+27602, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -253902,7 +254495,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+27523, 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+27639, 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)) @@ -253956,9 +254549,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 + 27668 + zFmt = __ccgo_ts + 27784 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+13079, 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+13165, 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) { @@ -254016,9 +254609,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 27724, - 1: __ccgo_ts + 6875, - 2: __ccgo_ts + 18162, + 0: __ccgo_ts + 27840, + 1: __ccgo_ts + 6962, + 2: __ccgo_ts + 18295, } var _rtreeModule = Tsqlite3_module{ @@ -254062,21 +254655,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+28138, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28254, 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+28200, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28316, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+28205, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+28269, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+28339, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28321, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28385, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28455, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -254106,7 +254699,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 + 28388 + zFormat = __ccgo_ts + 28504 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -254121,31 +254714,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+28496, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+28612, 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+28541, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28657, 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+14587, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+14673, int32(1)) } if ii1 < int32((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28568, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28684, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28590, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28706, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28598, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28714, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -254159,14 +254752,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 27729, - 1: __ccgo_ts + 27782, - 2: __ccgo_ts + 27827, - 3: __ccgo_ts + 27879, - 4: __ccgo_ts + 27933, - 5: __ccgo_ts + 27978, - 6: __ccgo_ts + 28036, - 7: __ccgo_ts + 28091, + 0: __ccgo_ts + 27845, + 1: __ccgo_ts + 27898, + 2: __ccgo_ts + 27943, + 3: __ccgo_ts + 27995, + 4: __ccgo_ts + 28049, + 5: __ccgo_ts + 28094, + 6: __ccgo_ts + 28152, + 7: __ccgo_ts + 28207, } // C documentation @@ -254224,7 +254817,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+28614, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+28730, 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) @@ -254232,17 +254825,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+4711, 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+28634, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+28750, 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+4711, 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+4711, 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))) @@ -254319,13 +254912,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+28877, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+28993, 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+28883, 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+28999, 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) { @@ -254334,7 +254927,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+28907, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29023, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if int32((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -254348,19 +254941,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28934, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29050, 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+4711, 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+4711, 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))) } } } @@ -254383,7 +254976,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+4711, 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)) @@ -254394,7 +254987,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+4711, 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 @@ -254410,8 +255003,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 28913, - 1: __ccgo_ts + 28924, + 0: __ccgo_ts + 29029, + 1: __ccgo_ts + 29040, } // C documentation @@ -254469,21 +255062,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+12699, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+12785, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+28937, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+29053, 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+28943, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+29059, 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+28947, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+29063, int32(1)) goto _1 _1: ; @@ -254510,7 +255103,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+28949, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+29065, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -254613,7 +255206,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) @@ -254628,11 +255221,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 + 5578 + v1 = __ccgo_ts + 5665 } else { v1 = __ccgo_ts + 1674 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+28982, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+29098, 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) } @@ -254666,7 +255259,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+28989, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+29105, 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) @@ -254683,7 +255276,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+29034, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29150, libc.VaList(bp+8, iNode)) } } return pRet @@ -254712,8 +255305,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 + 29066, - 1: __ccgo_ts + 29120, + 0: __ccgo_ts + 29182, + 1: __ccgo_ts + 29236, } 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)) @@ -254726,21 +255319,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 + 29168 + v1 = __ccgo_ts + 29284 } else { - v1 = __ccgo_ts + 29176 + v1 = __ccgo_ts + 29292 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29185, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29301, 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 + 29168 + v2 = __ccgo_ts + 29284 } else { - v2 = __ccgo_ts + 29176 + v2 = __ccgo_ts + 29292 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29230, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29346, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -254785,7 +255378,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+29288, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29404, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -254803,7 +255396,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29336, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29452, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -254836,19 +255429,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+29403, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29519, 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+29437, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29553, 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+29467, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29583, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -254893,12 +255486,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+29522, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+29638, 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+29553, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29669, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -254927,7 +255520,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+29620, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+29736, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -254937,11 +255530,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+27434, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+27550, 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+29648, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+29764, 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)) @@ -254957,8 +255550,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+29679, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+29686, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+29795, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+29802, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -254985,7 +255578,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+29694, 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+29810, 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) } @@ -255036,13 +255629,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+29713, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+29829, -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 + 8021 + zDb = __ccgo_ts + 8107 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -255051,7 +255644,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 + 19940 + v1 = __ccgo_ts + 20073 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -255518,19 +256111,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+26668, int32(1)) + Xsqlite3_str_append(tls, x, __ccgo_ts+26784, int32(1)) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29764, 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+29880, 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+29775, 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+29891, 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) } @@ -255559,20 +256152,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+29786, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29902, 0) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29804, 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+29920, 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+29812, 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+29928, 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) { @@ -255580,14 +256173,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+29820, libc.VaList(bp+8, z)) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29936, libc.VaList(bp+8, z)) } goto _2 _2: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29824, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29940, 0) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -255633,8 +256226,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 @@ -255666,13 +256259,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 } @@ -255752,16 +256345,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 } @@ -255808,9 +256401,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: ; @@ -256036,7 +256629,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 // ** @@ -256075,7 +256668,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) } @@ -256179,7 +256772,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 @@ -256263,7 +256856,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 @@ -256547,7 +257140,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) { @@ -256716,13 +257309,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+28877, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+28993, 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+29837, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29953, 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) @@ -256731,13 +257324,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+29859, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29975, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28934, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29050, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -256745,7 +257338,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+4711, 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) @@ -256760,7 +257353,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+4711, 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 @@ -256972,7 +257565,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 + 18162 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 18295 (*(*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) @@ -256982,7 +257575,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 + 29863 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 29979 (*(*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) @@ -256990,7 +257583,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 + 29869 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 29985 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -257110,7 +257703,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+29878, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+29994, 0) } goto geopoly_update_end } @@ -257213,12 +257806,12 @@ geopoly_update_end: func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+29918) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+30034) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+29934) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+30050) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) @@ -257289,7 +257882,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+30111, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+30227, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -257303,61 +257896,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29949, + FzName: __ccgo_ts + 30065, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29962, + FzName: __ccgo_ts + 30078, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29975, + FzName: __ccgo_ts + 30091, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 29988, + FzName: __ccgo_ts + 30104, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 29934, + FzName: __ccgo_ts + 30050, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 30000, + FzName: __ccgo_ts + 30116, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 29918, + FzName: __ccgo_ts + 30034, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 30023, + FzName: __ccgo_ts + 30139, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 30037, + FzName: __ccgo_ts + 30153, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 30050, + FzName: __ccgo_ts + 30166, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 30064, + FzName: __ccgo_ts + 30180, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 30080, + FzName: __ccgo_ts + 30196, }, } @@ -257383,7 +257976,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 30092, + FzName: __ccgo_ts + 30208, }, } @@ -257408,20 +258001,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+30119, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30235, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30129, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30245, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30140, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30256, -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+29863, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+29979, 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+30151, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+30267, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -257495,7 +258088,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) @@ -257523,7 +258116,7 @@ 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+27420, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+27536, __ccgo_fp(_rtreeMatchArgFree)) } } } @@ -257764,7 +258357,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 @@ -258740,7 +259333,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+30161, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+30277, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -258750,7 +259343,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+30161, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+30277, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -258776,7 +259369,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+4711, 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 @@ -258799,7 +259392,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+4711, 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 } @@ -258931,7 +259524,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+30182, uintptr(0), uintptr(0), p+64) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30298, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -259020,7 +259613,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+27333, zIn, uint64(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+27449, 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')) { @@ -259057,13 +259650,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 + 30353 + v1 = __ccgo_ts + 30469 } else { v1 = __ccgo_ts + 1674 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30394, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30510, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+30544) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+30660) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -259230,7 +259823,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+4711, 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))) } } @@ -259291,7 +259884,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+30669, 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+30785, 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 @@ -259301,7 +259894,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+30788, 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+30904, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -259309,7 +259902,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+30809, 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+30925, 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) @@ -259321,7 +259914,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+30860, 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+30976, 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 { @@ -259365,7 +259958,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+30881, 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+30997, 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))) { @@ -259378,7 +259971,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+30909, 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+31025, 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 { @@ -259431,7 +260024,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+21448, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+21581, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -259442,7 +260035,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+30938, 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+31054, 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) @@ -259453,7 +260046,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+30957, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+31073, 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 @@ -259461,7 +260054,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+30962, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+31078, zName) { bRbuRowid = int32(1) } } @@ -259475,17 +260068,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 + 30972 + v4 = __ccgo_ts + 31088 } else { - v4 = __ccgo_ts + 30985 + v4 = __ccgo_ts + 31101 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30994, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31110, 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+31023, 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+31139, 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)) @@ -259507,7 +260100,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+31045, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31161, 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)) @@ -259553,8 +260146,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+31072, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 16460 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31188, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 16546 goto _1 _1: ; @@ -259588,7 +260181,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+31081, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+31197, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -259636,21 +260229,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+31094, 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+31210, 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+31126, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+31242, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16460, __ccgo_ts+31149) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+31155, __ccgo_ts+31162, __ccgo_ts+6481) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16460, __ccgo_ts+1674) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16546, __ccgo_ts+31265) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+31271, __ccgo_ts+31278, __ccgo_ts+6568) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16546, __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+31170, 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+31286, 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+31212, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+31328, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -259702,7 +260295,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { 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+30909, 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+31025, 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)) @@ -259724,15 +260317,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 + 31232 + zCol = __ccgo_ts + 31348 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+31240, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+31261, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+31297, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 16460 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+31356, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+31377, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+31413, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 16546 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -259741,7 +260334,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+31324, 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+31440, 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 + 1674 iCol = 0 @@ -259758,15 +260351,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+31372, libc.VaList(bp+24, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 16460 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+31488, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 16546 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+31379, libc.VaList(bp+24, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+31495, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -259824,7 +260417,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter 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+30909, 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+31025, 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)) @@ -259833,7 +260426,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+31391, 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+31507, 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 { @@ -259853,9 +260446,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 + 31232 + zCol = __ccgo_ts + 31348 } else { - zCol = __ccgo_ts + 30962 + zCol = __ccgo_ts + 31078 } } zType = __ccgo_ts + 1148 @@ -259863,24 +260456,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+31413, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+31529, 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 + 31149 + v2 = __ccgo_ts + 31265 } else { v2 = __ccgo_ts + 1674 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+31433, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+31549, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+31454, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+31487, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+31570, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+31603, 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 + 16460 - zAnd = __ccgo_ts + 23557 + zCom = __ccgo_ts + 16546 + zAnd = __ccgo_ts + 23690 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -259934,11 +260527,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+31511, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+31627, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+31523, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+31639, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 16460 + zS = __ccgo_ts + 16546 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -259950,7 +260543,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+31532, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+31648, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -259976,7 +260569,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+31547, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+31663, 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 + 1674 @@ -259986,15 +260579,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+31561, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 23557 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31677, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 23690 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+31573, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+31689, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1674 i1 = 0 @@ -260004,8 +260597,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+31623, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 23557 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31739, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 23690 } goto _2 _2: @@ -260028,7 +260621,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+31636, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31752, 0) } // C documentation @@ -260070,16 +260663,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+31623, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 16460 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31739, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 16546 } else { if int32(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+31662, 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 + 16460 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31778, 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 + 16546 } else { if int32(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+31692, 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 + 16460 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31808, 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 + 16546 } } } @@ -260163,16 +260756,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 + 31729 + zSep = __ccgo_ts + 31845 *(*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+30881, 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+30997, 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+18050) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+18183) == 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+30909, 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+31025, libc.VaList(bp+24, zIdx))) } break } @@ -260183,16 +260776,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 + 31149 + v1 = __ccgo_ts + 31265 } else { v1 = __ccgo_ts + 1674 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+31742, libc.VaList(bp+24, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 16460 + z = _rbuMPrintf(tls, p, __ccgo_ts+31858, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 16546 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+31753, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+31869, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -260238,7 +260831,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+31757) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+31873) 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))) { @@ -260246,7 +260839,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+30909, 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+31025, 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))) { @@ -260255,21 +260848,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+31807, 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+31923, 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 + 31149 + v1 = __ccgo_ts + 31265 } else { v1 = __ccgo_ts + 1674 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+31829, libc.VaList(bp+24, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 16460 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+31945, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 16546 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+31839, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+31955, 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+8021, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31854, 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+8021, 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+31970, 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)) } } @@ -260306,7 +260899,7 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum 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+8021, 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) { @@ -260315,19 +260908,19 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { 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+8021, (*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 + 31916 + zPk = __ccgo_ts + 32032 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 31929 + v2 = __ccgo_ts + 32045 } else { v2 = __ccgo_ts + 1674 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+31939, 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 + 16460 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+32055, 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 + 16546 goto _1 _1: ; @@ -260336,17 +260929,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+31966, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+32082, 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+8021, 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 + 31973 + v3 = __ccgo_ts + 32089 } else { v3 = __ccgo_ts + 1674 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31988, 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+8021, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32104, 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)) } } @@ -260372,7 +260965,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+32020, 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+32136, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -260418,7 +261011,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+32077) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+32193) } 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)) @@ -260587,7 +261180,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+32143, libc.VaList(bp+40, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+32259, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -260604,18 +261197,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+8021, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8021, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32163, 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+8021, 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+32279, 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+32228, 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+32344, 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+32264, 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+32380, 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 { @@ -260630,26 +261223,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 32298 + v2 = __ccgo_ts + 32414 } else { - v2 = __ccgo_ts + 32302 + v2 = __ccgo_ts + 32418 } v1 = v2 } else { v1 = __ccgo_ts + 1674 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32308, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32424, 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+32369, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32485, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 32298 + v3 = __ccgo_ts + 32414 } else { - v3 = __ccgo_ts + 32302 + v3 = __ccgo_ts + 32418 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32430, 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+32546, 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 { @@ -260668,8 +261261,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+8032) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+8028) + 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). */ @@ -260678,39 +261271,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 + 1674 } else { - v4 = __ccgo_ts + 32589 + v4 = __ccgo_ts + 32705 } 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 + 32598 + v5 = __ccgo_ts + 32714 } else { v5 = __ccgo_ts + 1674 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+32608, 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+32724, 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+32644, 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+32760, 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 + 1674 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 32672 + zRbuRowid = __ccgo_ts + 32788 } /* 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 + 32684 + v6 = __ccgo_ts + 32800 } else { v6 = __ccgo_ts + 1674 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32701, 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+32777, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32817, 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+32893, 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+33076, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33192, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -260721,9 +261314,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 + 33175 + v7 = __ccgo_ts + 33291 } else { - v7 = __ccgo_ts + 33185 + v7 = __ccgo_ts + 33301 } zRbuRowid1 = v7 } @@ -260736,14 +261329,14 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+31232, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+31348, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16460, __ccgo_ts+1674) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16546, __ccgo_ts+1674) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 33196 + v8 = __ccgo_ts + 33312 } else { v8 = __ccgo_ts + 1674 } @@ -260753,11 +261346,11 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 v9 = __ccgo_ts + 1674 } if zOrder != 0 { - v10 = __ccgo_ts + 24813 + v10 = __ccgo_ts + 24946 } else { v10 = __ccgo_ts + 1674 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+33202, 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+33318, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -260845,9 +261438,9 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p if zSet != 0 { zPrefix = __ccgo_ts + 1674 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 32589 + zPrefix = __ccgo_ts + 32705 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+33250, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+33366, 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 } @@ -260874,7 +261467,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+4711, 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) } @@ -260921,7 +261514,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+33280, 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+33396, 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): @@ -260980,27 +261573,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+8021, 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+8021) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+33310, 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+33426, 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+33338, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+48, __ccgo_ts+15318, uint64(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33454, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+15404, uint64(4)) } else { - libc.Xmemcpy(tls, p+48, __ccgo_ts+8021, 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+33356, libc.VaList(bp+8, p+48)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33472, 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+8021, 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 } @@ -261033,10 +261626,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+33422, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33538, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+26156, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+26289, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -261052,14 +261645,14 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) if zExtra == uintptr(0) { v2 = __ccgo_ts + 1674 } else { - v2 = __ccgo_ts + 33454 + v2 = __ccgo_ts + 33570 } if zExtra == uintptr(0) { v3 = __ccgo_ts + 1674 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+33456, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8021), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+33572, 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 @@ -261070,27 +261663,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+33488, -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+33604, -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+33503, 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+33619, 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+33520, -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+33636, -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+8021, 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+33536, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33652, 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+8021, 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+33564, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33680, 0) } } @@ -261176,7 +261769,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { if pState == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33536, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33652, uintptr(0), uintptr(0), uintptr(0)) } } /* Assuming no error has occurred, run a "restart" checkpoint with the @@ -261209,7 +261802,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CAPTURE) - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33582, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33698, uintptr(0), uintptr(0), uintptr(0)) if rc2 != int32(SQLITE_NOTICE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -261342,16 +261935,16 @@ 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+8021, 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+8021, int32(SQLITE_FCNTL_FILE_POINTER), bp) + 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_methods1)(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) } - Xsqlite3_file_control(tls, db, __ccgo_ts+8021, 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+8021, 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)) @@ -261373,7 +261966,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+33617, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+33733, 0) } // C documentation @@ -261390,13 +261983,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+8021) + 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+8021) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8107) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+33642, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+33649, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+33758, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+33765, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -261528,7 +262121,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+25713, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+25846, 0) return } if eType == int32(RBU_DELETE) && int32(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -261664,7 +262257,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+33656) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+33772) 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 @@ -261677,7 +262270,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+33678, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33794, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -261704,7 +262297,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+33705, 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+33821, 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))) @@ -261740,9 +262333,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+33865, 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+33981, 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+33880, 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+33996, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -261765,9 +262358,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+33900, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34016, 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+33925) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+34041) } 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) @@ -261778,10 +262371,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+34033) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+34149) } 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+34098) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+34214) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -261799,7 +262392,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+34142, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34258, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -261826,8 +262419,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+19156) - _rbuCopyPragma(tls, p, __ccgo_ts+18246) + _rbuCopyPragma(tls, p, __ccgo_ts+19289) + _rbuCopyPragma(tls, p, __ccgo_ts+18379) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -261835,7 +262428,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+34167, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+34283, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -261857,10 +262450,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+16364, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16450, 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+16364, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16450, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -261947,7 +262540,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+34195, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34311, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -261970,10 +262563,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+33642, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+33758, 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+8021, 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) } @@ -261995,7 +262588,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+34220, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+34336, 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) @@ -262042,7 +262635,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+34231, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+34347, 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 { @@ -262087,11 +262680,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+34303, 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+34419, 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+34317) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+34433) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -262100,7 +262693,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+34374) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+34490) 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) @@ -262148,7 +262741,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+4711, 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 @@ -262180,7 +262773,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+34448, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34564, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -262202,17 +262795,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 + 34480 + v3 = __ccgo_ts + 34596 } else { - v3 = __ccgo_ts + 34487 + v3 = __ccgo_ts + 34603 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34494, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34610, 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+16349, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16435, 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) @@ -262224,21 +262817,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+18870) - _rbuCopyPragma(tls, p, __ccgo_ts+18261) + _rbuCopyPragma(tls, p, __ccgo_ts+19003) + _rbuCopyPragma(tls, p, __ccgo_ts+18394) } /* 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+34526, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+34642, 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+8021, 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+34542, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+34658, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -262316,7 +262909,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+34566, zState+uintptr(n-uint64(7)), uint64(7)) { + if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+34682, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -262363,7 +262956,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+32589, uint64(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+32705, 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++ @@ -262391,7 +262984,7 @@ 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+16364, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16450, 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) { @@ -262400,7 +262993,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { } _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+16364, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16450, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -262410,7 +263003,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+34574, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+34690, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -262511,7 +263104,7 @@ 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+16364, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16450, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ @@ -262524,19 +263117,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { 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+16364, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16450, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 16349 + v1 = __ccgo_ts + 16435 } else { - v1 = __ccgo_ts + 34526 + v1 = __ccgo_ts + 34642 } 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+34526, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34642, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -263022,7 +263615,7 @@ func _rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileSize})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, pSize) /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existence of a *-wal file. rbuVfsRead() contains ** similar logic. */ if rc == SQLITE_OK && *(*Tsqlite_int64)(unsafe.Pointer(pSize)) == 0 && (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpRbu)).FzTarget == uintptr(0) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_MAIN_DB) != 0 { *(*Tsqlite_int64)(unsafe.Pointer(pSize)) = int64(1024) @@ -263103,7 +263696,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xControl})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, int32(SQLITE_FCNTL_ZIPVFS), bp) if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34601, 0) + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34717, 0) } else { if rc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p @@ -263129,7 +263722,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r if rc == SQLITE_OK && op == int32(SQLITE_FCNTL_VFSNAME) { pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs zIn = *(*uintptr)(unsafe.Pointer(pArg)) - zOut = Xsqlite3_mprintf(tls, __ccgo_ts+34624, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + zOut = Xsqlite3_mprintf(tls, __ccgo_ts+34740, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -263324,7 +263917,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag if pDb != 0 { if (*Trbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == int32(RBU_STAGE_OAL) { if (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) { - zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+8021) + zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+8107) zOpen = Xsqlite3_filename_wal(tls, zOpen) } nOpen = libc.Xstrlen(tls, zOpen) @@ -263338,7 +263931,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag } else { (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu } - if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+34635, 0) != 0 { + if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+34751, 0) != 0 { oflags = libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) } @@ -263894,7 +264487,7 @@ func _statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint _sqlite3TokenInit(tls, bp, *(*uintptr)(unsafe.Pointer(argv + 3*8))) iDb = _sqlite3FindDb(tls, db, bp) if iDb < 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+13688, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+13774, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) return int32(SQLITE_ERROR) } } else { @@ -264394,7 +264987,7 @@ statNextRestart: (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiPgno = iRoot (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v1 = Xsqlite3_mprintf(tls, __ccgo_ts+34646, 0) + v1 = Xsqlite3_mprintf(tls, __ccgo_ts+34762, 0) z = v1 (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FzPath = v1 if z == uintptr(0) { @@ -264432,8 +265025,8 @@ statNextRestart: if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { (*TStatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34648 - v2 = Xsqlite3_mprintf(tls, __ccgo_ts+34657, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34764 + v2 = Xsqlite3_mprintf(tls, __ccgo_ts+34773, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) z = v2 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v2 if z == uintptr(0) { @@ -264462,7 +265055,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage++ if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= int32(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226029)) + return _sqlite3CorruptError(tls, int32(227304)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -264473,7 +265066,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+34669, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+34785, 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) { @@ -264496,13 +265089,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34677 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34793 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34686 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34802 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34691 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34807 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -264511,7 +265104,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+4711, 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) { @@ -264600,12 +265193,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+34701, 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+34817, 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+34856, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+34972, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+34870, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+34986, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -264682,7 +265275,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+34885, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+35001, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -265976,11 +266569,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+13079, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13165, 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+34892, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+35008, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1674, 0) @@ -265989,7 +266582,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+35022, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+35138, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -266015,7 +266608,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+31232)) + nByte = Tsqlite3_int64(uint64(nByte) + libc.Xstrlen(tls, __ccgo_ts+31348)) 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))) @@ -266039,8 +266632,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+31232) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+31232, nName+uint64(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+31348) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+31348, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -266104,7 +266697,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 @@ -266121,6 +266714,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 { @@ -266142,7 +266737,7 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13079, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13165, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { @@ -266437,10 +267032,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 + 12699 + zSep = __ccgo_ts + 12785 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+35052, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+35168, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -266452,8 +267047,8 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin v2 = __ccgo_ts + 1675 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+6451, libc.VaList(bp+32, zSep, zDflt)) - zSep = __ccgo_ts + 16460 + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+6538, libc.VaList(bp+32, zSep, zDflt)) + zSep = __ccgo_ts + 16546 goto _1 _1: ; @@ -267107,8 +267702,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+35059, 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 + 23557 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35175, 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 + 23690 if zRet == uintptr(0) { break } @@ -267137,8 +267732,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+35093, 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 + 35134 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35209, 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 + 35250 if zRet == uintptr(0) { break } @@ -267149,7 +267744,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1794, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1820, 0) } return zRet } @@ -267160,12 +267755,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 + 35139 + v1 = __ccgo_ts + 35255 } else { - v1 = __ccgo_ts + 8026 + v1 = __ccgo_ts + 8112 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35150, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35266, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -267226,11 +267821,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 16460 + v2 = __ccgo_ts + 16546 } else { v2 = __ccgo_ts + 1674 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35229, 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+35345, 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 } @@ -267258,7 +267853,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+35248, 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+35364, 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 { @@ -267287,17 +267882,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)) @@ -267310,7 +267906,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 } @@ -267321,18 +267919,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+35421, 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+35452, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -267358,7 +267982,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+35305, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+35473, 0) } rc = int32(SQLITE_SCHEMA) } @@ -267690,7 +268314,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+6513, 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) } @@ -267990,12 +268614,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+35332, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13079, zTab) { - _sessionAppendStr(tls, bp+24, __ccgo_ts+35336, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+35360, bp) - _sessionAppendStr(tls, bp+56, __ccgo_ts+35369, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+35414, bp) + _sessionAppendStr(tls, bp+24, __ccgo_ts+35500, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13165, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+35504, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+35528, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+35537, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35582, bp) } else { i = 0 for { @@ -268003,17 +268627,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+16460, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+16546, 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 + 16460 + zSep = __ccgo_ts + 16546 _sessionAppendIdent(tls, bp+40, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) - _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+35428, libc.VaList(bp+80, i+int32(1))) + _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+35596, libc.VaList(bp+80, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+35432, 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+35600, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -268027,7 +268651,7 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt } else { v2 = __ccgo_ts + 1674 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+35459, 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+35627, 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) } @@ -268169,7 +268793,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, 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+35501, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+35669, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -268275,7 +268899,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+35521, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35689, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -268530,13 +269154,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 } } @@ -268692,7 +269317,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(230285)) + rc = _sqlite3CorruptError(tls, int32(231591)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -268716,7 +269341,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(230305)) + rc = _sqlite3CorruptError(tls, int32(231611)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -268731,7 +269356,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(230315)) + rc = _sqlite3CorruptError(tls, int32(231621)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -268787,7 +269412,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(230363)) + rc = _sqlite3CorruptError(tls, int32(231669)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -268892,7 +269517,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(230451)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231757)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -268963,8 +269588,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) @@ -268998,7 +269623,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(230537)) + v7 = _sqlite3CorruptError(tls, int32(231843)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -269008,7 +269633,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(230543)) + v10 = _sqlite3CorruptError(tls, int32(231849)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -269087,7 +269712,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(230587)) + v16 = _sqlite3CorruptError(tls, int32(231893)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -269497,7 +270122,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230952)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232258)) goto finished_invert } if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { @@ -269700,7 +270325,7 @@ 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+13079) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+13165) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -269709,9 +270334,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, uint64(nU32)*uint64(4)) - _sessionAppendStr(tls, bp+8, __ccgo_ts+35539, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35707, bp) _sessionAppendIdent(tls, bp+8, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+35552, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35720, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -269721,9 +270346,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+35558, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35726, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 16460 + zSep = __ccgo_ts + 16546 } goto _2 _2: @@ -269732,7 +270357,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } /* Create the WHERE clause part of the UPDATE */ zSep = __ccgo_ts + 1674 - _sessionAppendStr(tls, bp+8, __ccgo_ts+35563, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35731, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -269741,13 +270366,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+35571, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35739, bp) } else { _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+35646, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35814, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 23557 + zSep = __ccgo_ts + 23690 } goto _3 _3: @@ -269834,9 +270459,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+35652, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35820, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+35563, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35731, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -269846,9 +270471,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+35558, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35726, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 23557 + zSep = __ccgo_ts + 23690 } goto _1 _1: @@ -269856,9 +270481,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+35670, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35838, bp) _sessionAppendInteger(tls, bp+8, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+35134, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35250, bp) zSep = __ccgo_ts + 1674 i = 0 for { @@ -269868,16 +270493,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+35646, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35814, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 35678 + zSep = __ccgo_ts + 35846 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+6481, 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)) @@ -269903,7 +270528,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+8021, 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 @@ -269926,16 +270551,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+35683, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35851, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+23563, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+23696, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+16460, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+16546, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -269943,19 +270568,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+35701, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35869, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+8, __ccgo_ts+35712, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35880, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+6481, 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)) } @@ -269978,12 +270603,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+13079, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+13165, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+35716) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+35884) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+35829) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+35997) } return rc } @@ -270049,7 +270674,7 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231434)) + rc = _sqlite3CorruptError(tls, int32(232740)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -270465,7 +271090,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35973, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36141, 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)) @@ -270478,7 +271103,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35994, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36162, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -270578,10 +271203,10 @@ 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+36013, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36181, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+36039, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36207, 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)) @@ -270612,7 +271237,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui ** 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)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+4711, 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 @@ -270622,7 +271247,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+8021, *(*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 } @@ -270641,18 +271266,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+36069, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+36237, 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+36113, 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+36281, 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+36184, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+36352, 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+13079) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+13165) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -270709,17 +271334,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+36244, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+36412, 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+36274, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36442, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+36298, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+36274, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+36466, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+36442, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -271495,7 +272120,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+4711, 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 { @@ -271531,11 +272156,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 @@ -272120,6 +272751,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 @@ -272165,8 +272797,7 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset @@ -272178,12 +272809,13 @@ type Fts5Colset = TFts5Colset ** This object is used by fts5_expr.c and fts5_index.c. */ type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 + FnCol 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 ** to parse the arguments passed to the CREATE VIRTUAL TABLE statement. @@ -272560,7 +273192,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -272588,16 +273219,14 @@ 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 @@ -272639,7 +273268,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 @@ -273443,7 +274072,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+36326, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36494, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -273799,7 +274428,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+36354, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36522, 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 */ } @@ -274088,7 +274717,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+36385, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+36553, 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) } @@ -274187,7 +274816,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 + 36392 + zErr = __ccgo_ts + 36560 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -274442,7 +275071,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 + 36442 + zErr = __ccgo_ts + 36610 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -274713,7 +275342,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))) @@ -274805,13 +275434,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) } @@ -274837,13 +275466,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 + 36490 + z = __ccgo_ts + 36658 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 + 36546 + z1 = __ccgo_ts + 36714 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -274876,19 +275505,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 36604, + FzFunc: __ccgo_ts + 36772, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 36612, + FzFunc: __ccgo_ts + 36780, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 36622, + FzFunc: __ccgo_ts + 36790, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 36627, + FzFunc: __ccgo_ts + 36795, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -275276,7 +275905,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 @@ -275752,7 +276381,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+36643, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36811, 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) { @@ -275778,12 +276407,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+36650, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36818, 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+36681, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36849, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -275792,7 +276421,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+36714, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36882, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -275802,14 +276431,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36751, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36919, 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+36760, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36928, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -275836,7 +276465,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+36793, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36961, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -275848,76 +276477,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+36827, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36995, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36835, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37003, 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+36867, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37035, 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+36873, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37041, 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+36892, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37060, 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+36935, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37103, 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+36892, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37060, 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+36957, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37125, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36971, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37139, 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+37009, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37177, 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+37020, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37188, 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+37055, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37223, 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+37062, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37230, 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+6890, 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 + 9715, + FzName: __ccgo_ts + 9801, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 19226, + FzName: __ccgo_ts + 19359, }, 2: { - FzName: __ccgo_ts + 37093, + FzName: __ccgo_ts + 37261, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -275925,20 +276554,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+37101, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37269, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+37132, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37300, 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+37142, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37310, 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+37176, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37344, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -275999,16 +276628,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+37204) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+18162) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37209, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+37372) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+18295) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37377, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+37239) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+37407) { *(*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+37249, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37417, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -276034,7 +276663,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+37280, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37448, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -276042,12 +276671,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+37285, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37453, 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+37292, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37460, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37300, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37468, 0) } } goto _1 @@ -276063,9 +276692,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+37307, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37475, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37300, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37468, 0) } goto _2 _2: @@ -276128,8 +276757,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+37204) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37315, 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+37372) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37483, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -276160,7 +276789,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+37344, libc.VaList(bp+40, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37512, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -276190,7 +276819,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+37364, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37532, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -276198,37 +276827,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+37414, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37582, 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+37469, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37637, 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 + 36827 + zTail = __ccgo_ts + 36995 } 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 + 36827 + zTail = __ccgo_ts + 36995 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 37522 + zTail = __ccgo_ts + 37690 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37530, 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+37698, 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+18162, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+18295, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -276297,7 +276926,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+37541, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37709, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -276306,16 +276935,16 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { if i == 0 { v2 = __ccgo_ts + 1674 } else { - v2 = __ccgo_ts + 16460 + v2 = __ccgo_ts + 16546 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37557, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37725, 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+37564, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+37204)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37732, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+37372)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -276473,7 +277102,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+37590) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37758) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -276484,7 +277113,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+37595) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37763) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -276495,7 +277124,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+37604) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37772) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -276509,7 +277138,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+37614) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37782) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -276520,7 +277149,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+37624) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37792) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -276537,7 +277166,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+37636) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37804) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -276552,7 +277181,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+37204) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37372) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -276567,7 +277196,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37648) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37816) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -276583,7 +277212,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+37662) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37830) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -276626,7 +277255,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 + 37672 + zSelect = __ccgo_ts + 37840 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -276646,7 +277275,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+37704) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+37872) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -276657,7 +277286,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+37712, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+37880, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -276761,11 +277390,12 @@ type TFts5ExprNode1 = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode1 = TFts5ExprNode1 +/* Size (in bytes) of an Fts5ExprNode object that holds up to N children */ + /* ** 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. @@ -276795,24 +277425,26 @@ type TFts5ExprPhrase1 = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase1 = TFts5ExprPhrase1 +/* Size (in bytes) of an Fts5ExprPhrase object that holds up to N terms */ + /* ** 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 + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset1 = TFts5ExprNearset1 +/* Size (in bytes) of an Fts5ExprNearset object covering up to N phrases */ + /* ** Parse context. */ @@ -276903,7 +277535,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+37783, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37951, 0) return FTS5_EOF } goto _1 @@ -276914,7 +277546,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+37803, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37971, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -276929,13 +277561,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+37834, uint64(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+38002, 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+37837, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+38005, 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+32298, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+32414, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -276979,7 +277611,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) @@ -278618,7 +279250,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) @@ -278628,7 +279260,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) @@ -278734,12 +279366,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 @@ -278873,7 +279505,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) @@ -278913,15 +279545,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)) @@ -278962,7 +279594,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 { @@ -279000,8 +279632,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+37841, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36354, 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+38009, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36522, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -279021,10 +279653,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+37846, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38014, 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: ; @@ -279058,7 +279693,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 { @@ -279108,7 +279743,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 @@ -279159,7 +279794,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+22560, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+22693, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -279186,7 +279821,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)) @@ -279283,7 +279918,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+37875, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38043, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -279368,7 +280003,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) @@ -279381,7 +280016,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) @@ -279455,7 +280090,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 @@ -279481,11 +280116,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 + 37928 + v2 = __ccgo_ts + 38096 } else { - v2 = __ccgo_ts + 37841 + v2 = __ccgo_ts + 38009 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37935, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38103, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -279498,7 +280133,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+37985, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38153, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -279975,7 +280610,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) { @@ -280039,7 +280674,7 @@ 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 +** to accumulate "term -> doclist" content before it is flushed to a level-0 ** segment. */ @@ -280098,7 +280733,7 @@ type TFts5HashEntry1 = struct { type Fts5HashEntry1 = TFts5HashEntry1 /* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -280980,9 +281615,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 @@ -281019,7 +281654,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -281092,7 +281726,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -281127,7 +281760,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -281142,9 +281774,9 @@ 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 @@ -281241,11 +281873,12 @@ type TFts5Structure1 = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure1 = TFts5Structure1 +/* Size (in bytes) of an Fts5Structure object holding up to N levels */ + /* ** An object of type Fts5SegWriter is used to write to segments. */ @@ -281378,13 +282011,15 @@ type Fts5SegIter1 = TFts5SegIter1 ** Array of tombstone pages. Reference counted. */ type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray1 = TFts5TombstoneArray1 +/* Size (in bytes) of an Fts5TombstoneArray holding up to N tombstones */ + /* ** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. @@ -281437,11 +282072,12 @@ type TFts5Iter1 = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter1 = TFts5Iter1 +/* Size (in bytes) of an Fts5Iter object holding up to N segment iterators */ + /* ** An instance of the following type is used to iterate through the contents ** of a doclist-index record. @@ -281467,13 +282103,15 @@ type TFts5DlidxLvl1 = struct { type Fts5DlidxLvl1 = TFts5DlidxLvl1 type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } 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)) *(*Tu8)(unsafe.Pointer(aOut + 1)) = uint8(int32(iVal) & libc.Int32FromInt32(0xFF)) @@ -281652,7 +282290,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+38038, 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+38206, 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. @@ -281757,7 +282395,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+38044, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+38212, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -281786,7 +282424,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+38095, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+38263, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -281820,7 +282458,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+38144, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+38312, 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) @@ -281898,7 +282536,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)) @@ -281989,7 +282627,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+38184, uint64(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+38352, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -282000,7 +282638,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+38184, uint64(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+38352, 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)) @@ -282681,7 +283319,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) @@ -282931,7 +283569,7 @@ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _ = nByte, nTomb, pNew nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone if nTomb > 0 { - nByte = int32(uint64(nTomb)*uint64(8) + uint64(16)) + nByte = int32(uint64(libc.UintptrFromInt32(0)+8) + uint64(nTomb+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) if pNew != 0 { (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb @@ -283641,7 +284279,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+38212, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+38380, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -283730,7 +284368,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+38296, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+38464, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -284377,7 +285015,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 @@ -285701,7 +286339,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+38378, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+38546, 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. */ @@ -286207,7 +286845,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+38435, 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+38603, 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) @@ -286376,7 +287014,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 } @@ -286694,7 +287332,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+38496, 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+38664, 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))) @@ -286969,7 +287607,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: @@ -287004,7 +287642,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)) @@ -287618,11 +288256,12 @@ type TFts5TokenDataIter1 = struct { 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 // // /* @@ -287690,7 +288329,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) { @@ -287934,7 +288573,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) @@ -287984,7 +288623,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 @@ -288066,15 +288705,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+1674, 0) - _fts5StructureWrite(tls, p, bp) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -288100,11 +288742,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+38547, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+38715, 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+27333, __ccgo_ts+38555, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+27449, __ccgo_ts+38723, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+13290, __ccgo_ts+38590, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+13376, __ccgo_ts+38758, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -288302,7 +288944,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) @@ -288557,7 +289199,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+38634) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+38802) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -288908,7 +289550,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') @@ -289030,7 +289672,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 { @@ -289150,7 +289792,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+38038, 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+38206, 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))) @@ -289744,7 +290386,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+38636, 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+38804, 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)) @@ -289975,7 +290617,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+38722) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+38890) 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)) @@ -290114,7 +290756,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -290271,11 +290912,12 @@ type TFts5Sorter1 = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter1 = TFts5Sorter1 +/* Size (int bytes) of an Fts5Sorter object with N indexes */ + /* ** Virtual-table cursor object. ** @@ -290597,7 +291239,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+38727, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38895, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -290634,7 +291276,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+6513, 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++ @@ -290653,7 +291295,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+6513, 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 @@ -291103,7 +291745,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+4711, 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 @@ -291131,7 +291773,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+4711, 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) } @@ -291151,7 +291793,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) @@ -291166,7 +291808,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 + 16460 + v1 = __ccgo_ts + 16546 } else { v1 = __ccgo_ts + 1674 } @@ -291176,11 +291818,11 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int v2 = __ccgo_ts + 1674 } if bDesc != 0 { - v3 = __ccgo_ts + 38766 + v3 = __ccgo_ts + 38934 } else { - v3 = __ccgo_ts + 38771 + v3 = __ccgo_ts + 38939 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+38775, 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+38943, 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 @@ -291238,14 +291880,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+38830, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+38998, 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+6872, 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+38836, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39004, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -291295,7 +291937,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+38864, libc.VaList(bp+24, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+39032, 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)) @@ -291328,7 +291970,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+38874, libc.VaList(bp+24, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39042, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -291362,7 +292004,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+38895, libc.VaList(bp+24, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39063, libc.VaList(bp+24, z)) } } } else { @@ -291370,7 +292012,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 + 36622 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 36790 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -291527,7 +292169,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+38928, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+39096, 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))) } @@ -291727,7 +292369,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+38933, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+39101, 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 @@ -291860,10 +292502,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. @@ -294399,12 +295041,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+40282, 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+40450, 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+40386, 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+40554, 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+40424, 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+40592, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -294413,7 +295055,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+40462, 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+40630, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -294425,14 +295067,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+27333, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+13290, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+39616, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+27449, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+13376, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+39784, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+37522, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+37690, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36827, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36995, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -294452,13 +295094,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 + 31973 + v1 = __ccgo_ts + 32089 } else { v1 = __ccgo_ts + 1674 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+40504, 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+40672, 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+40534, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40702, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -294499,7 +295141,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+40578, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+40746, 0) iOff = int32(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -294507,7 +295149,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+40601, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+40769, libc.VaList(bp+8, i)) iOff += int32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -294522,7 +295164,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+40607, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+40775, libc.VaList(bp+8, i)) iOff += int32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -294531,22 +295173,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36827, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36995, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 40613 + zCols = __ccgo_ts + 40781 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 40645 + zCols = __ccgo_ts + 40813 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+37522, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+37690, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+39616, __ccgo_ts+40693, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+39784, __ccgo_ts+40861, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+37704, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+37872, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -294966,12 +295608,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+40710, 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+40878, 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+40760, 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+40928, 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+40789, 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)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -294979,7 +295621,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+37704, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+37872, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -295281,7 +295923,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+40818, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+40986, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -295513,14 +296155,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+36827, bp+80) + rc = _fts5StorageCount(tls, p, __ccgo_ts+36995, 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)) @@ -296725,64 +297367,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+40920, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41088, 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+40923, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41091, 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+40928, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41096, 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+40933, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41101, 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+40936, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41104, 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+40939, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41107, 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+40944, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41112, 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+40949, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41117, 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+40953, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41121, 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+40959, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41127, 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+40964, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41132, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -296791,49 +297433,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+40968, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41136, 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+40972, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41140, 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+40975, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41143, 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+40979, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41147, 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+40983, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41151, 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+40987, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41155, 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+40991, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41159, 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+40995, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41163, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -296850,20 +297492,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+40999, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40979, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41167, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+41147, 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+41002, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+41005, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41170, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+41173, 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+41009, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40995, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41177, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+41163, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -296879,75 +297521,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+41012, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41180, 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+40979, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41147, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41020, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41188, 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+41027, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+41195, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41032, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41200, 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+40928, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41096, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41037, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41205, 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+40923, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41091, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41042, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41210, 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+40995, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41163, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41047, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41215, 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+17363, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+17496, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41052, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41220, 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+41005, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41173, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41056, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41224, 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+40920, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41088, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41061, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41229, 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+40964, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41132, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41067, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41235, 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+41071, uint64(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41239, uint64(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41073, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41241, 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+40987, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41155, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -296956,48 +297598,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+41079, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41247, 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+40995, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41163, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41087, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41255, 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+40979, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41147, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41093, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41261, 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+40979, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41147, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41098, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41266, 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+40920, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41088, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41104, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41272, 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+40991, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41159, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41112, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41280, 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+41120, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41288, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41124, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41292, 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+40987, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41155, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -297005,21 +297647,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+41132, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41300, 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+40920, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41088, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41138, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41306, 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+40991, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41159, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41144, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41312, 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+41005, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+41173, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -297037,48 +297679,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+41151, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41319, 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+40936, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41104, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41156, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41324, 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+41161, 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+40936, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41104, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41167, 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+40936, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41104, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41120, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41288, 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+41173, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41341, 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+41179, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41347, 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+40920, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41088, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -297094,13 +297736,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+41185, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41353, 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+41189, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41357, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41192, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41360, 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) @@ -297108,7 +297750,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+41195, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41363, 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) @@ -297273,14 +297915,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+41199) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+41367) { 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+40892) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+41060) { 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 { @@ -297548,7 +298190,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+41214)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+41382)) } // C documentation @@ -297574,7 +298216,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 40910, + FzName: __ccgo_ts + 41078, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -297582,7 +298224,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 41222, + FzName: __ccgo_ts + 41390, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -297590,7 +298232,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 41214, + FzName: __ccgo_ts + 41382, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -297620,7 +298262,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+41228, 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+41396, pApi, bp+96, uintptr(0)) } return rc } @@ -303136,16 +303778,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+41235) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41403) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41239) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41407) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41243) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41411) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+41252, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+41420, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -303208,21 +303850,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 + 41286, - 1: __ccgo_ts + 41326, - 2: __ccgo_ts + 41361, + 0: __ccgo_ts + 41454, + 1: __ccgo_ts + 41494, + 2: __ccgo_ts + 41529, } 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+25302, *(*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+25435, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+41404, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+41572, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -303243,15 +303886,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)) @@ -303392,10 +304035,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+41437, 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+41605, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+41468, 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+41636, 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)) } @@ -303414,7 +304057,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+41519, 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+41687, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -303864,7 +304507,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+41545, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+41713, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -303919,7 +304562,7 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 41555 + return __ccgo_ts + 41723 } type TAggInfo_col = struct { @@ -304300,7 +304943,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 @@ -304348,11 +304991,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', '.', '1'} +var Xsqlite3_version = [7]int8{'3', '.', '5', '0', '.', '1'} 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_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)\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods @@ -304362,3 +305005,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + diff --git a/vendor/modernc.org/sqlite/lib/sqlite_windows_386.go b/vendor/modernc.org/sqlite/lib/sqlite_windows_386.go index 958a25a..813f9c0 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 -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. +// 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 @@ -17468,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 @@ -17476,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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70" +const SQLITE_SOURCE_ID = "2025-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -17587,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.1" -const SQLITE_VERSION_NUMBER = 3049001 +const SQLITE_VERSION = "3.50.1" +const SQLITE_VERSION_NUMBER = 3050001 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -20044,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 @@ -21563,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 @@ -21572,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 @@ -23156,6 +23160,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 @@ -23589,7 +23594,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -25341,11 +25345,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. */ /* @@ -25719,6 +25729,7 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem @@ -25764,6 +25775,7 @@ type THashElem1 = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem1 = THashElem1 @@ -26122,6 +26134,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. */ @@ -26180,6 +26197,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 @@ -26483,7 +26511,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData = TDbClientData @@ -26556,7 +26583,6 @@ type Expr = TExpr type TExprList = struct { FnExpr int32 FnAlloc int32 - Fa [1]TExprList_item } type ExprList = TExprList @@ -26571,7 +26597,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -26621,7 +26646,6 @@ type FuncDefHash = TFuncDefHash type TIdList = struct { FnId int32 - Fa [1]TIdList_item } type IdList = TIdList @@ -26687,7 +26711,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -26759,19 +26782,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 @@ -26785,11 +26811,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 @@ -26800,39 +26823,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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -26846,23 +26871,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 @@ -27021,7 +27049,6 @@ type TSrcList = struct { F__ccgo_align [0]uint32 FnSrc int32 FnAlloc Tu32 - Fa [1]TSrcItem } type SrcList = TSrcList @@ -27076,6 +27103,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -27262,7 +27290,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -27304,7 +27331,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -27892,8 +27918,8 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. +/* Use SQLITE_ENABLE_EXPLAIN_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 @@ -28752,6 +28778,7 @@ type TTable1 = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table1 = TTable1 @@ -28833,11 +28860,13 @@ type TFKey1 = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey1 = TFKey1 +/* The size (in bytes) of an FKey object holding N columns. The answer +** does NOT include space to hold the zTo name. */ + /* ** SQLite supports many different ways to resolve a constraint ** error. ROLLBACK processing means that a constraint violation @@ -28886,11 +28915,12 @@ type TKeyInfo1 = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo1 = TKeyInfo1 +/* The size (in bytes) of a KeyInfo object with up to N fields */ + /* ** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. */ @@ -29301,11 +29331,13 @@ type Expr1 = TExpr1 type TExprList1 = struct { FnExpr int32 FnAlloc int32 - Fa [1]TExprList_item } type ExprList1 = TExprList1 +/* The size (in bytes) of an ExprList object that is big enough to hold +** as many as N expressions. */ + /* ** Allowed values for Expr.a.eEName */ @@ -29327,11 +29359,12 @@ type ExprList1 = TExprList1 */ type TIdList1 = struct { FnId int32 - Fa [1]TIdList_item } type IdList1 = TIdList1 +/* The size (in bytes) of an IdList object that can hold up to N IDs. */ + /* ** Allowed values for IdList.eType, which determines which value of the a.u4 ** is valid. @@ -29441,11 +29474,16 @@ type TSrcList1 = struct { F__ccgo_align [0]uint32 FnSrc int32 FnAlloc Tu32 - Fa [1]TSrcItem } type SrcList1 = TSrcList1 +/* Size (in bytes) of a SrcList object that can hold as many as N +** SrcItem objects. */ + +/* Size (in bytes( of a SrcList object that holds 1 SrcItem. This is a +** special case of SZ_SRCITEM(1) that comes up often. */ + /* ** Permitted values of the SrcList.a.jointype field */ @@ -29806,19 +29844,22 @@ type TParse1 = 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 @@ -29832,11 +29873,8 @@ type TParse1 = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -29847,39 +29885,41 @@ type TParse1 = 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 + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } } - 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 + 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 @@ -30248,11 +30288,13 @@ type TWith1 = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With1 = TWith1 +/* The size (in bytes) of a With object that can hold as many +** as N different CTEs. */ + /* ** The Cte object is not guaranteed to persist for the entire duration ** of code generation. (The query flattener or other parser tree @@ -30282,11 +30324,13 @@ type TDbClientData1 = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData1 = TDbClientData1 +/* The size (in bytes) of a DbClientData object that can has a name +** that is N bytes long, including the zero-terminator. */ + /* ** This object is used in various ways, most (but not all) related to window ** functions. @@ -31436,27 +31480,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 @@ -31538,7 +31581,7 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 + F__ccgo_pad29 [4]byte } type VdbeCursor = TVdbeCursor @@ -31577,11 +31620,17 @@ type TVdbeCursor1 = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 + F__ccgo_pad29 [4]byte } type VdbeCursor1 = TVdbeCursor1 +/* +** The size (in bytes) of a VdbeCursor object that has an nField value of N +** or less. The value of SZ_VDBECURSOR(n) is guaranteed to be a multiple +** of 8. + */ + /* Return true if P is a null-only cursor */ @@ -31801,21 +31850,14 @@ type Tsqlite3_context1 = struct { 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 */ +/* +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. + */ // C documentation // @@ -31947,23 +31989,26 @@ type Vdbe1 = TVdbe1 ** 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 + 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 PreUpdate1 = TPreUpdate1 @@ -32101,7 +32146,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(24453)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -32273,7 +32318,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)) @@ -32705,7 +32750,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++ } @@ -32776,10 +32821,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 @@ -32915,7 +32960,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) } } @@ -33012,7 +33057,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) @@ -33170,7 +33215,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 @@ -33248,7 +33293,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) @@ -33396,7 +33441,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)) @@ -33699,7 +33744,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 } @@ -33856,7 +33901,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('.') @@ -33904,7 +33949,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('.') @@ -34009,7 +34054,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) @@ -34738,7 +34783,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 } @@ -35387,7 +35432,8 @@ func init() { // /* // ** Initialize the mutex system. // */ -func _sqlite3MutexInit(tls *libc.TLS) (r int32) { +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 @@ -93346,17 +93392,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'), @@ -93553,22 +93599,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. */ @@ -93817,11 +93864,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 @@ -94298,29 +94345,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) @@ -94435,25 +94460,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 + 1675 + if escarg == uintptr(0) { + if int32(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1675 } else { - v98 = __ccgo_ts + 1680 + v97 = __ccgo_ts + 1680 } - escarg = v98 + escarg = v97 + } else { + if int32(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) + } + } + 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. @@ -94461,15 +94490,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) { @@ -94480,13 +94509,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) @@ -94500,35 +94562,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 - } - 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 + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + 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++ + } + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 + j1++ + 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) @@ -94553,9 +94678,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: ; @@ -94569,7 +94694,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+1687, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1713, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -94579,21 +94704,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+1689, 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+1699, 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+1720, 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: ; @@ -94832,7 +94957,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 @@ -95131,6 +95256,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 // // /* @@ -95148,11 +95275,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)) } @@ -95859,6 +95986,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 // // /* @@ -96659,7 +96817,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 { @@ -96834,7 +96992,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+1734, 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 @@ -97046,11 +97204,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 @@ -97286,7 +97444,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)) @@ -97376,7 +97534,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1759 + pow63 = __ccgo_ts + 1785 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -97603,7 +97761,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+1778)) + n = int32(libc.Uint32FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1804)) if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -97763,7 +97921,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 + 1794 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1820 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') @@ -97872,7 +98030,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-- } } @@ -98288,7 +98446,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+1796, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1822, libc.VaList(bp+8, zType)) } // C documentation @@ -98317,7 +98475,7 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if int32(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1841) + _logBadConnection(tls, __ccgo_ts+1867) } return 0 } else { @@ -98331,7 +98489,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+1850) + _logBadConnection(tls, __ccgo_ts+1876) return 0 } else { return int32(1) @@ -98362,7 +98520,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) { @@ -98713,23 +98871,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 @@ -98784,8 +98940,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) } @@ -98818,9 +98974,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: ; @@ -98840,13 +98995,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 } @@ -98854,7 +99008,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 @@ -98870,7 +99024,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 { @@ -98882,7 +99036,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 } @@ -98931,7 +99085,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 @@ -98941,20 +99095,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) } @@ -98973,196 +99126,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1858, - 1: __ccgo_ts + 1868, - 2: __ccgo_ts + 1879, - 3: __ccgo_ts + 1891, - 4: __ccgo_ts + 1902, - 5: __ccgo_ts + 1914, - 6: __ccgo_ts + 1921, - 7: __ccgo_ts + 1929, - 8: __ccgo_ts + 1937, - 9: __ccgo_ts + 1942, - 10: __ccgo_ts + 1947, - 11: __ccgo_ts + 1953, - 12: __ccgo_ts + 1967, - 13: __ccgo_ts + 1973, - 14: __ccgo_ts + 1983, - 15: __ccgo_ts + 1988, - 16: __ccgo_ts + 1993, - 17: __ccgo_ts + 1996, - 18: __ccgo_ts + 2002, - 19: __ccgo_ts + 2009, - 20: __ccgo_ts + 2013, - 21: __ccgo_ts + 2023, - 22: __ccgo_ts + 2030, - 23: __ccgo_ts + 2037, - 24: __ccgo_ts + 2044, - 25: __ccgo_ts + 2051, - 26: __ccgo_ts + 2061, - 27: __ccgo_ts + 2070, - 28: __ccgo_ts + 2081, - 29: __ccgo_ts + 2090, - 30: __ccgo_ts + 2096, - 31: __ccgo_ts + 2106, - 32: __ccgo_ts + 2116, - 33: __ccgo_ts + 2121, - 34: __ccgo_ts + 2135, - 35: __ccgo_ts + 2146, - 36: __ccgo_ts + 2151, - 37: __ccgo_ts + 2158, - 38: __ccgo_ts + 2169, - 39: __ccgo_ts + 2174, - 40: __ccgo_ts + 2179, - 41: __ccgo_ts + 2185, - 42: __ccgo_ts + 2191, - 43: __ccgo_ts + 2197, - 44: __ccgo_ts + 2200, - 45: __ccgo_ts + 2204, - 46: __ccgo_ts + 2210, - 47: __ccgo_ts + 2221, - 48: __ccgo_ts + 2232, - 49: __ccgo_ts + 2240, - 50: __ccgo_ts + 2249, - 51: __ccgo_ts + 2255, - 52: __ccgo_ts + 2262, - 53: __ccgo_ts + 2270, - 54: __ccgo_ts + 2273, - 55: __ccgo_ts + 2276, - 56: __ccgo_ts + 2279, - 57: __ccgo_ts + 2282, - 58: __ccgo_ts + 2285, - 59: __ccgo_ts + 2288, - 60: __ccgo_ts + 2295, - 61: __ccgo_ts + 2305, - 62: __ccgo_ts + 2318, - 63: __ccgo_ts + 2329, - 64: __ccgo_ts + 2335, - 65: __ccgo_ts + 2342, - 66: __ccgo_ts + 2351, - 67: __ccgo_ts + 2360, - 68: __ccgo_ts + 2367, - 69: __ccgo_ts + 2380, - 70: __ccgo_ts + 2391, - 71: __ccgo_ts + 2396, - 72: __ccgo_ts + 2404, - 73: __ccgo_ts + 2410, - 74: __ccgo_ts + 2417, - 75: __ccgo_ts + 2429, - 76: __ccgo_ts + 2434, - 77: __ccgo_ts + 2443, - 78: __ccgo_ts + 2448, - 79: __ccgo_ts + 2457, - 80: __ccgo_ts + 2462, - 81: __ccgo_ts + 2467, - 82: __ccgo_ts + 2473, - 83: __ccgo_ts + 2481, - 84: __ccgo_ts + 2489, - 85: __ccgo_ts + 2499, - 86: __ccgo_ts + 2507, - 87: __ccgo_ts + 2514, - 88: __ccgo_ts + 2527, - 89: __ccgo_ts + 2532, - 90: __ccgo_ts + 2544, - 91: __ccgo_ts + 2552, - 92: __ccgo_ts + 2559, - 93: __ccgo_ts + 2570, - 94: __ccgo_ts + 2577, - 95: __ccgo_ts + 2584, - 96: __ccgo_ts + 2594, - 97: __ccgo_ts + 2603, - 98: __ccgo_ts + 2614, - 99: __ccgo_ts + 2620, - 100: __ccgo_ts + 2631, - 101: __ccgo_ts + 2641, - 102: __ccgo_ts + 2651, - 103: __ccgo_ts + 2660, - 104: __ccgo_ts + 2667, - 105: __ccgo_ts + 2673, - 106: __ccgo_ts + 2683, - 107: __ccgo_ts + 2694, - 108: __ccgo_ts + 2698, - 109: __ccgo_ts + 2707, - 110: __ccgo_ts + 2716, - 111: __ccgo_ts + 2723, - 112: __ccgo_ts + 2733, - 113: __ccgo_ts + 2740, - 114: __ccgo_ts + 2750, - 115: __ccgo_ts + 2758, - 116: __ccgo_ts + 2765, - 117: __ccgo_ts + 2779, - 118: __ccgo_ts + 2793, - 119: __ccgo_ts + 2801, - 120: __ccgo_ts + 2812, - 121: __ccgo_ts + 2825, - 122: __ccgo_ts + 2836, - 123: __ccgo_ts + 2842, - 124: __ccgo_ts + 2854, - 125: __ccgo_ts + 2863, - 126: __ccgo_ts + 2871, - 127: __ccgo_ts + 2880, - 128: __ccgo_ts + 2889, - 129: __ccgo_ts + 2896, - 130: __ccgo_ts + 2904, - 131: __ccgo_ts + 2911, - 132: __ccgo_ts + 2922, - 133: __ccgo_ts + 2936, - 134: __ccgo_ts + 2947, - 135: __ccgo_ts + 2955, - 136: __ccgo_ts + 2961, - 137: __ccgo_ts + 2969, - 138: __ccgo_ts + 2977, - 139: __ccgo_ts + 2987, - 140: __ccgo_ts + 3000, - 141: __ccgo_ts + 3010, - 142: __ccgo_ts + 3023, - 143: __ccgo_ts + 3032, - 144: __ccgo_ts + 3043, - 145: __ccgo_ts + 3051, - 146: __ccgo_ts + 3057, - 147: __ccgo_ts + 3069, - 148: __ccgo_ts + 3081, - 149: __ccgo_ts + 3089, - 150: __ccgo_ts + 3101, - 151: __ccgo_ts + 3114, - 152: __ccgo_ts + 3124, - 153: __ccgo_ts + 3134, - 154: __ccgo_ts + 3146, - 155: __ccgo_ts + 3151, - 156: __ccgo_ts + 3163, - 157: __ccgo_ts + 3173, - 158: __ccgo_ts + 3179, - 159: __ccgo_ts + 3189, - 160: __ccgo_ts + 3196, - 161: __ccgo_ts + 3208, - 162: __ccgo_ts + 3219, - 163: __ccgo_ts + 3227, - 164: __ccgo_ts + 3236, - 165: __ccgo_ts + 3245, - 166: __ccgo_ts + 3254, - 167: __ccgo_ts + 3261, - 168: __ccgo_ts + 3272, - 169: __ccgo_ts + 3285, - 170: __ccgo_ts + 3295, - 171: __ccgo_ts + 3302, - 172: __ccgo_ts + 3310, - 173: __ccgo_ts + 3319, - 174: __ccgo_ts + 3325, - 175: __ccgo_ts + 3332, - 176: __ccgo_ts + 3340, - 177: __ccgo_ts + 3348, - 178: __ccgo_ts + 3356, - 179: __ccgo_ts + 3366, - 180: __ccgo_ts + 3375, - 181: __ccgo_ts + 3386, - 182: __ccgo_ts + 3397, - 183: __ccgo_ts + 3408, - 184: __ccgo_ts + 3418, - 185: __ccgo_ts + 3424, - 186: __ccgo_ts + 3435, - 187: __ccgo_ts + 3446, - 188: __ccgo_ts + 3451, - 189: __ccgo_ts + 3459, + 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 *********************************************/ @@ -99359,29 +99512,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 @@ -99524,246 +99675,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 + 3469, + FzName: __ccgo_ts + 3495, }, 1: { - FzName: __ccgo_ts + 3485, + FzName: __ccgo_ts + 3511, }, 2: { - FzName: __ccgo_ts + 3496, + FzName: __ccgo_ts + 3522, }, 3: { - FzName: __ccgo_ts + 3507, + FzName: __ccgo_ts + 3533, }, 4: { - FzName: __ccgo_ts + 3519, + FzName: __ccgo_ts + 3545, }, 5: { - FzName: __ccgo_ts + 3531, + FzName: __ccgo_ts + 3557, }, 6: { - FzName: __ccgo_ts + 3543, + FzName: __ccgo_ts + 3569, }, 7: { - FzName: __ccgo_ts + 3562, + FzName: __ccgo_ts + 3588, }, 8: { - FzName: __ccgo_ts + 3581, + FzName: __ccgo_ts + 3607, }, 9: { - FzName: __ccgo_ts + 3594, + FzName: __ccgo_ts + 3620, }, 10: { - FzName: __ccgo_ts + 3606, + FzName: __ccgo_ts + 3632, }, 11: { - FzName: __ccgo_ts + 3618, + FzName: __ccgo_ts + 3644, }, 12: { - FzName: __ccgo_ts + 3642, + FzName: __ccgo_ts + 3668, }, 13: { - FzName: __ccgo_ts + 3663, + FzName: __ccgo_ts + 3689, }, 14: { - FzName: __ccgo_ts + 3680, + FzName: __ccgo_ts + 3706, }, 15: { - FzName: __ccgo_ts + 3695, + FzName: __ccgo_ts + 3721, }, 16: { - FzName: __ccgo_ts + 3710, + FzName: __ccgo_ts + 3736, }, 17: { - FzName: __ccgo_ts + 3722, + FzName: __ccgo_ts + 3748, }, 18: { - FzName: __ccgo_ts + 3742, + FzName: __ccgo_ts + 3768, }, 19: { - FzName: __ccgo_ts + 3760, + FzName: __ccgo_ts + 3786, }, 20: { - FzName: __ccgo_ts + 3778, + FzName: __ccgo_ts + 3804, }, 21: { - FzName: __ccgo_ts + 3797, + FzName: __ccgo_ts + 3823, }, 22: { - FzName: __ccgo_ts + 3816, + FzName: __ccgo_ts + 3842, }, 23: { - FzName: __ccgo_ts + 3837, + FzName: __ccgo_ts + 3863, }, 24: { - FzName: __ccgo_ts + 3849, + FzName: __ccgo_ts + 3875, }, 25: { - FzName: __ccgo_ts + 3866, + FzName: __ccgo_ts + 3892, }, 26: { - FzName: __ccgo_ts + 3883, + FzName: __ccgo_ts + 3909, }, 27: { - FzName: __ccgo_ts + 3896, + FzName: __ccgo_ts + 3922, }, 28: { - FzName: __ccgo_ts + 3912, + FzName: __ccgo_ts + 3938, }, 29: { - FzName: __ccgo_ts + 3926, + FzName: __ccgo_ts + 3952, }, 30: { - FzName: __ccgo_ts + 3940, + FzName: __ccgo_ts + 3966, }, 31: { - FzName: __ccgo_ts + 3964, - }, - 32: { - FzName: __ccgo_ts + 3977, - }, - 33: { FzName: __ccgo_ts + 3990, }, - 34: { + 32: { FzName: __ccgo_ts + 4003, }, + 33: { + FzName: __ccgo_ts + 4016, + }, + 34: { + FzName: __ccgo_ts + 4029, + }, 35: { - FzName: __ccgo_ts + 4017, + FzName: __ccgo_ts + 4043, }, 36: { - FzName: __ccgo_ts + 4031, + FzName: __ccgo_ts + 4057, }, 37: { - FzName: __ccgo_ts + 4041, + FzName: __ccgo_ts + 4067, }, 38: { - FzName: __ccgo_ts + 4052, + FzName: __ccgo_ts + 4078, }, 39: { - FzName: __ccgo_ts + 4064, + FzName: __ccgo_ts + 4090, }, 40: { - FzName: __ccgo_ts + 4073, + FzName: __ccgo_ts + 4099, }, 41: { - FzName: __ccgo_ts + 4085, + FzName: __ccgo_ts + 4111, }, 42: { - FzName: __ccgo_ts + 4094, + FzName: __ccgo_ts + 4120, }, 43: { - FzName: __ccgo_ts + 4107, + FzName: __ccgo_ts + 4133, }, 44: { - FzName: __ccgo_ts + 4119, - }, - 45: { - FzName: __ccgo_ts + 4132, - }, - 46: { FzName: __ccgo_ts + 4145, }, + 45: { + FzName: __ccgo_ts + 4158, + }, + 46: { + FzName: __ccgo_ts + 4171, + }, 47: { - FzName: __ccgo_ts + 4155, + FzName: __ccgo_ts + 4181, }, 48: { - FzName: __ccgo_ts + 4164, + FzName: __ccgo_ts + 4190, }, 49: { - FzName: __ccgo_ts + 4175, + FzName: __ccgo_ts + 4201, }, 50: { - FzName: __ccgo_ts + 4189, + FzName: __ccgo_ts + 4215, }, 51: { - FzName: __ccgo_ts + 4209, + FzName: __ccgo_ts + 4235, }, 52: { - FzName: __ccgo_ts + 4233, + FzName: __ccgo_ts + 4259, }, 53: { - FzName: __ccgo_ts + 4242, + FzName: __ccgo_ts + 4268, }, 54: { - FzName: __ccgo_ts + 4255, + FzName: __ccgo_ts + 4281, }, 55: { - FzName: __ccgo_ts + 4270, + FzName: __ccgo_ts + 4296, }, 56: { - FzName: __ccgo_ts + 4276, + FzName: __ccgo_ts + 4302, }, 57: { - FzName: __ccgo_ts + 4297, + FzName: __ccgo_ts + 4323, }, 58: { - FzName: __ccgo_ts + 4308, + FzName: __ccgo_ts + 4334, }, 59: { - FzName: __ccgo_ts + 4321, + FzName: __ccgo_ts + 4347, }, 60: { - FzName: __ccgo_ts + 4337, + FzName: __ccgo_ts + 4363, }, 61: { - FzName: __ccgo_ts + 4357, + FzName: __ccgo_ts + 4383, }, 62: { - FzName: __ccgo_ts + 4367, + FzName: __ccgo_ts + 4393, }, 63: { - FzName: __ccgo_ts + 4382, + FzName: __ccgo_ts + 4408, }, 64: { - FzName: __ccgo_ts + 4402, + FzName: __ccgo_ts + 4428, }, 65: { - FzName: __ccgo_ts + 4424, + FzName: __ccgo_ts + 4450, }, 66: { - FzName: __ccgo_ts + 4441, + FzName: __ccgo_ts + 4467, }, 67: { - FzName: __ccgo_ts + 4470, + FzName: __ccgo_ts + 4496, }, 68: { - FzName: __ccgo_ts + 4491, + FzName: __ccgo_ts + 4517, }, 69: { - FzName: __ccgo_ts + 4503, + FzName: __ccgo_ts + 4529, }, 70: { - FzName: __ccgo_ts + 4523, + FzName: __ccgo_ts + 4549, }, 71: { - FzName: __ccgo_ts + 4538, + FzName: __ccgo_ts + 4564, }, 72: { - FzName: __ccgo_ts + 4558, + FzName: __ccgo_ts + 4584, }, 73: { - FzName: __ccgo_ts + 4577, + FzName: __ccgo_ts + 4603, }, 74: { - FzName: __ccgo_ts + 4596, + FzName: __ccgo_ts + 4622, }, 75: { - FzName: __ccgo_ts + 4611, + FzName: __ccgo_ts + 4637, }, 76: { - FzName: __ccgo_ts + 4636, + FzName: __ccgo_ts + 4662, }, 77: { - FzName: __ccgo_ts + 4663, + FzName: __ccgo_ts + 4689, }, 78: { - FzName: __ccgo_ts + 4674, + FzName: __ccgo_ts + 4700, }, 79: { - FzName: __ccgo_ts + 4695, + 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, }, } @@ -99830,6 +100008,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 */ @@ -99855,7 +100034,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 { @@ -99872,7 +100051,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 { @@ -99908,7 +100087,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 { @@ -99938,7 +100117,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 { @@ -99952,7 +100131,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) { @@ -100104,25 +100283,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) } @@ -100303,7 +100482,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+4711, 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 @@ -100404,10 +100583,10 @@ func _winGetLastErrorMsg(tls *libc.TLS, lastErrno TDWORD, nBuf int32, zBuf uintp } } if uint32(0) == dwLen { - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+4714, 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+4711, 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) } @@ -100453,7 +100632,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+4734, 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 } @@ -100522,7 +100701,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+4765, 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)) } } @@ -100551,6 +100730,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 // // /* @@ -100571,6 +100791,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(49989)) } - return 0 + return rc } // C documentation @@ -100660,7 +100917,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 { @@ -100872,7 +101182,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 */ @@ -101037,48 +101353,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 { @@ -101110,7 +101426,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 @@ -101179,10 +101495,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) { @@ -101306,7 +101622,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+4711, 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 @@ -101446,28 +101762,30 @@ func _winShmLeaveMutex(tls *libc.TLS) { ** ** 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. ** +** File-handle hSharedShm is used to (a) take the DMS lock, (b) truncate +** the *-shm file if the DMS-locking protocol demands it, and (c) map +** regions of the *-shm file into memory using MapViewOfFile() or +** similar. Other locks are taken by individual clients using the +** winShm.hShm handles. */ 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 + Fmutex uintptr + FzFilename uintptr + FhSharedShm THANDLE + FisUnlocked int32 + FisReadonly int32 + FszRegion int32 + FnRegion int32 + FaRegion uintptr + FlastErrno TDWORD + FnRef int32 + FpNext uintptr } type winShmNode1 = TwinShmNode1 @@ -101483,62 +101801,19 @@ 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. +** open shared memory connection. There is one such structure for each +** winFile open on a wal mode database. */ type TwinShm1 = struct { FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 FsharedMask Tu16 FexclMask Tu16 + FhShm THANDLE + FbReadonly int32 } 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 // // /* @@ -101577,9 +101852,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) @@ -101589,7 +101862,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 } } } @@ -101597,73 +101870,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. +// ** +// ** 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 } @@ -101752,40 +102120,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 } @@ -101795,13 +102151,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+5092, uintptr(0), int32(51668)) + return _winLogErrorAtLine(tls, int32(SQLITE_ERROR), uint32(0), __ccgo_ts+5179, uintptr(0), int32(52320)) } - Xsqlite3_snprintf(tls, nMax, zBuf, __ccgo_ts+4711, 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+5156, uintptr(0), int32(51837)) + return _winLogErrorAtLine(tls, int32(SQLITE_ERROR), uint32(0), __ccgo_ts+5243, uintptr(0), int32(52457)) } - Xsqlite3_snprintf(tls, nBuf-int32(16)-nLen, zBuf+uintptr(nLen), __ccgo_ts+5084, 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) @@ -102551,34 +102847,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) @@ -102600,11 +102901,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 @@ -102613,12 +102914,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)<>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) } } @@ -106189,7 +106491,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) - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, 0) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -106283,7 +106585,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-- - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, 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)) } @@ -106324,7 +106626,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, 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 @@ -106452,7 +106754,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 libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g)) + 96) + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -106472,17 +106774,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) } @@ -106500,7 +106804,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 @@ -106512,7 +106816,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) } } @@ -106713,9 +107017,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 { @@ -108871,7 +109176,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 @@ -108889,7 +109194,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 } @@ -109462,6 +109767,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 { @@ -110108,7 +110422,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 @@ -110120,7 +110435,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) @@ -110141,11 +110456,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 @@ -110174,7 +110490,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 @@ -110407,7 +110723,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) } @@ -110544,7 +110860,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)) @@ -110560,7 +110876,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)< int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65269)) } p4 = pPg + 28 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | int32((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -114667,7 +114983,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+5484, 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 { @@ -115233,7 +115549,6 @@ type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { FiPrior Tu32 FnSegment int32 - FaSegment [1]TWalSegment } type WalIterator = TWalIterator @@ -115437,6 +115752,11 @@ type WalCkptInfo1 = TWalCkptInfo1 /* ** An open write-ahead log file is represented by an instance of the ** following object. +** +** writeLock: +** This is usually set to 1 whenever the WRITER lock is held. However, +** if it is set to 2, then the WRITER lock is held but must be released +** by walHandleException() if a SEH exception is thrown. */ type TWal1 = struct { F__ccgo_align [0]uint32 @@ -115507,11 +115827,12 @@ type ht_slot = Tht_slot 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 ** is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -115569,7 +115890,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) @@ -115670,6 +115991,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 @@ -116111,7 +116433,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(67209)) } goto _1 _1: @@ -116199,7 +116521,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(67341)) goto finished } /* Malloc a buffer to read frames into. */ @@ -116338,7 +116660,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 { @@ -116969,7 +117291,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(68150)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -117085,7 +117407,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+5539, 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)) } } @@ -117300,7 +117622,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 { @@ -117326,7 +117655,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(68601)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -118049,8 +118378,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)) } @@ -118137,7 +118466,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(69451)) } iKey = _walNextHash(tls, iKey) } @@ -118635,7 +118964,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(69974)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -118884,7 +119213,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, /* 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(70234)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -119660,6 +119989,11 @@ type CellInfo1 = TCellInfo1 ** assumed that the database is corrupt. */ +/* +** Maximum amount of storage local to a database page, regardless of +** page size. + */ + /* ** A cursor is a pointer to a particular entry within a particular ** b-tree within a database file. @@ -120031,10 +120365,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) { @@ -120043,14 +120378,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) { @@ -120750,7 +121085,7 @@ 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(72422)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } @@ -120928,7 +121263,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(72620)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -120941,12 +121276,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(72633)) 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(72638)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -120990,7 +121325,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(72683)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -120998,7 +121333,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(72691)) } return SQLITE_OK } @@ -121186,7 +121521,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) } @@ -121219,7 +121554,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) } @@ -121418,7 +121753,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(73136)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(int32((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -121458,12 +121793,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(73194)) } if iFree != 0 { iFree2 = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73197)) } 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)) @@ -121471,21 +121806,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(73205)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73208)) } sz2 = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73210)) } 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(73214)) } } cbrk = top + sz @@ -121532,12 +121867,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(73247)) } 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(73253)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = uint8(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = uint8(cbrk) @@ -121553,7 +121888,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(73267)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8(cbrk) @@ -121613,7 +121948,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(73324)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -121630,14 +121965,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(73339)) } 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(73346)) } return uintptr(0) } @@ -121680,11 +122015,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(73394)) } } else { if top > int32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73397)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -121698,7 +122033,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(73414)) } else { return SQLITE_OK } @@ -121751,42 +122086,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(73498)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -121794,70 +122127,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(73510)) } - 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(73513)) } - 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)) + 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(73526)) } - nFrag = Tu8(int32(nFrag) + (int32(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + 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(73532)) } 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 } @@ -121903,7 +122236,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(73602)) } } } else { @@ -121929,7 +122262,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(73626)) } } } @@ -121968,12 +122301,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(73677)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73682)) } 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(73692)) } if uint32(pc)+size > uint32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73696)) } } /* At this point, nFree contains the sum of the offset to the start @@ -122000,7 +122333,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(73708)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = int32(uint16(nFree - iCellFirst)) return SQLITE_OK @@ -122031,11 +122364,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(73739)) } 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(73744)) } goto _1 _1: @@ -122064,11 +122397,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(73776)) } (*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) @@ -122077,7 +122410,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(73790)) } /* 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 @@ -122099,13 +122432,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)) } @@ -122115,14 +122446,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) @@ -122230,7 +122561,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(73933)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -122292,7 +122623,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(74005)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -122380,7 +122711,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+5565) == 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 */ @@ -123004,7 +123335,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) @@ -123166,7 +123497,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+5574, 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 @@ -123204,7 +123535,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(74943)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 4)) @@ -123645,7 +123976,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(75398)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -123669,7 +124000,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(75417)) } 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) @@ -123678,7 +124009,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(75426)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -123692,7 +124023,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(75438)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -123722,7 +124053,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(75473)) } /* 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) @@ -123818,7 +124149,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(75571)) } if int32(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -123856,7 +124187,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(75623)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 20)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 16)), bCommit) @@ -123923,7 +124254,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(75691)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -123966,7 +124297,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(75742)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -123996,7 +124327,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(75769)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -124462,7 +124793,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(76233)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -124854,7 +125185,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(76657)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -124864,7 +125195,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(76672)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -124921,7 +125252,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(76743)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -124995,7 +125326,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(76827)) } return rc } @@ -125130,7 +125461,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(76965)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -125142,7 +125473,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(76979)) } if rc != 0 { v3 = pCur + 68 @@ -125258,7 +125589,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(77114)) } goto skip_init skip_init: @@ -125272,7 +125603,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(77126)) } 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) @@ -125506,7 +125837,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(77375)) } } } @@ -125710,7 +126041,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes p3 = pCur + 1 *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(BTCF_ValidOvfl) | libc.Int32FromInt32(BTCF_AtLast))) if !((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76795)) + return _sqlite3CorruptError(tls, int32(77571)) } goto bypass_moveto_root /* Start search on the current page */ } @@ -125773,10 +126104,10 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ if nCell < int32(2) || uint32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77658)) 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 @@ -125804,7 +126135,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(77690)) } goto moveto_index_finish } @@ -125837,7 +126168,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(77721)) } *(*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 @@ -125846,7 +126177,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(77732)) } if rc != 0 { v11 = pCur + 68 @@ -125975,7 +126306,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(77833)) } if idx >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -126085,7 +126416,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(77926)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -126173,7 +126504,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(78016)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -126228,7 +126559,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(78072)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -126254,7 +126585,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(78101)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && int32(eMode) == int32(BTALLOC_LE)) { @@ -126281,7 +126612,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(78135)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+8, 0) @@ -126352,7 +126683,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(78200)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && int32(eMode) == int32(BTALLOC_LE)) { @@ -126490,7 +126821,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(78327)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 4)) = pMemPage @@ -126541,7 +126872,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(78374)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 8)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -126550,7 +126881,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(78385)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -126640,7 +126971,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(78474)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -126658,7 +126989,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(78491)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+4, bp) @@ -126681,7 +127012,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(78511)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 4)), ovflPgno) } @@ -126902,10 +127233,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(78767)) 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 @@ -127296,12 +127627,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(79157)) } 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(79162)) } } pData -= uintptr(sz) @@ -127309,7 +127640,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(79168)) } libc.Xmemmove(tls, pData, pCell, uint32(sz)) i++ @@ -127404,7 +127735,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(79255)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4)), uint32(sz)) @@ -127485,7 +127816,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: ; @@ -127512,7 +127843,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: ; @@ -127552,7 +127883,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(79377)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), uint32(nCell*int32(2))) nCell -= nShift @@ -127623,7 +127954,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(79455)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -127668,7 +127999,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(79495)) } /* 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 @@ -127864,10 +128195,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 @@ -127990,8 +128322,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 @@ -128031,7 +128363,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(79919)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -128054,7 +128386,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(79943)) goto balance_cleanup } limit = int32(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -128185,7 +128517,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(80044)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 36)))[k-int32(1)] = 0 @@ -128228,7 +128560,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(80077)) goto balance_cleanup } } @@ -128287,7 +128619,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(80121)) goto balance_cleanup } goto _11 @@ -128319,7 +128651,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(80154)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -128549,7 +128881,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(80355)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -128795,7 +129127,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(80587)) } goto _1 _1: @@ -128868,7 +129200,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(80647)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 120 + uintptr(iPage-int32(1))*4)) iIdx = int32(*(*Tu16)(unsafe.Pointer(pCur + 72 + uintptr(iPage-int32(1))*2))) @@ -129027,7 +129359,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(80811)) } else { if uint32(iOffset)+ovflPageSize < uint32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -129058,7 +129390,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(80839)) } if int32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -129143,7 +129475,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(80920)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -129235,7 +129567,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(81043)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -129271,7 +129603,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(81085)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -129301,10 +129633,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(81112)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81115)) } libc.Xmemcpy(tls, oldCell, newCell, uint32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -129422,7 +129754,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(81217)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { @@ -129437,14 +129769,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(81242)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -129544,21 +129876,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(81338)) } } 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(81347)) } 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(81351)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81354)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -129652,7 +129984,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(81445)) } 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 @@ -129762,7 +130094,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(81561)) } *(*TPgno)(unsafe.Pointer(bp + 4))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -129803,7 +130135,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(81609)) } if *(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -129884,14 +130216,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(81699)) } *(*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(81706)) goto cleardatabasepage_out } hdr = int32((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -130028,7 +130360,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(81810)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, int32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -130293,7 +130625,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+5578, 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)) @@ -130341,11 +130673,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+5580, 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+5603, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5690, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -130371,11 +130703,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+5733, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5820, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -130447,11 +130779,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 + 5772 + v2 = __ccgo_ts + 5859 } else { - v2 = __ccgo_ts + 5777 + v2 = __ccgo_ts + 5864 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+5798, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5885, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -130587,12 +130919,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 + 5824 + (*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+5842, 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+5996, 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+6026, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+6113, 0) doCoverageCheck = 0 goto _4 } @@ -130677,7 +131009,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+6050, 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 */ @@ -130700,7 +131032,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+6074, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+6161, 0) depth = d2 } } else { @@ -130777,7 +131109,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+6099, 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))) @@ -130791,7 +131123,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+6136, 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 @@ -130882,7 +131214,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 + 6188 + (*(*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) } @@ -130906,11 +131238,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+6199, 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+6244, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+6331, 0) } } } @@ -130947,10 +131279,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+6299, 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+6319, libc.VaList(bp+208, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+6406, libc.VaList(bp+208, i)) } goto _3 _3: @@ -131389,7 +131721,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+4711, 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) @@ -131399,7 +131731,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+6351, 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 @@ -131428,7 +131760,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+6371, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+6458, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -131458,7 +131790,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+6402, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+6489, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -132136,7 +132468,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+6442, 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) } @@ -132274,9 +132606,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 @@ -132452,7 +132781,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 @@ -132482,7 +132811,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 @@ -133236,7 +133565,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(85108)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, int32(amt+uint32(1))) rc = v1 @@ -133400,7 +133729,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 { @@ -133408,7 +133738,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) @@ -133473,7 +133803,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 */ @@ -133512,14 +133842,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+4711, 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)) @@ -133619,7 +133949,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 + 6449 + zNeg = __ccgo_ts + 6536 } } } @@ -133634,7 +133964,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+6451, 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 } @@ -133938,7 +134268,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(85794)) } iField = int64(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -133954,7 +134284,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(85800)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += int64(szField) @@ -133964,7 +134294,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(85806)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -134425,12 +134755,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 @@ -134604,7 +134933,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 @@ -134689,8 +135018,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. @@ -134703,11 +135032,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 */ @@ -134744,13 +135073,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 @@ -134781,7 +135113,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 @@ -135283,7 +135615,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+6456, 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)) { @@ -135296,39 +135628,39 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { v2 = __ccgo_ts + 1674 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+6461) == 0 { - zColl = __ccgo_ts + 6468 + 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 + 6449 + v3 = __ccgo_ts + 6536 } else { v3 = __ccgo_ts + 1674 } if int32(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 6470 + v4 = __ccgo_ts + 6557 } else { v4 = __ccgo_ts + 1674 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6473, 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+6481, 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+6497, 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+6506, 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+6506, 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+1435, libc.VaList(bp+32, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6513, 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+1402, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): @@ -135345,14 +135677,14 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { zP4 = __ccgo_ts + 1675 } else { - zP4 = __ccgo_ts + 6516 + zP4 = __ccgo_ts + 6603 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6523, 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 @@ -135367,20 +135699,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6531, 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+6536, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+6623, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 6538 + 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+6546, 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)) } @@ -135394,10 +135726,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 6483, - 1: __ccgo_ts + 6485, - 2: __ccgo_ts + 6487, - 3: __ccgo_ts + 6492, + 0: __ccgo_ts + 6570, + 1: __ccgo_ts + 6572, + 2: __ccgo_ts + 6574, + 3: __ccgo_ts + 6579, } // C documentation @@ -136350,7 +136682,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+6562, 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) } @@ -136358,18 +136690,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+6574, 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+6588, 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+6603, 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) @@ -136600,7 +136932,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(90646))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -137988,7 +138320,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(90727))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 20 + uintptr(i)*4)) != 0 { @@ -138023,7 +138355,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(90757))) return 0 /* Corruption */ } else { if int32((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -138077,7 +138409,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(90808))) return 0 /* Corrupt index */ } } @@ -138209,7 +138541,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(90971))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -138361,7 +138693,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(91129)) } // C documentation @@ -138392,7 +138724,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(91162)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, uint32(nCellKey), bp) @@ -138543,15 +138875,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 + 6646 + zContext = __ccgo_ts + 6733 } else { if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 6665 + zContext = __ccgo_ts + 6752 } else { - zContext = __ccgo_ts + 6684 + zContext = __ccgo_ts + 6771 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+6693, 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 @@ -138620,8 +138952,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 @@ -138629,7 +138961,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 @@ -138646,10 +138978,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 @@ -138658,9 +138991,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 { @@ -138740,7 +139073,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+6729, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6816, 0) return int32(1) } else { return 0 @@ -138750,7 +139083,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+6774, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6861, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -138808,7 +139141,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(91560)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -139311,7 +139644,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+6814, 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 @@ -139512,7 +139845,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(92354)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -139642,7 +139975,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(92475)) } 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) @@ -140102,18 +140435,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 + 6837, - 1: __ccgo_ts + 6842, - 2: __ccgo_ts + 6849, - 3: __ccgo_ts + 6852, - 4: __ccgo_ts + 6855, - 5: __ccgo_ts + 6858, - 6: __ccgo_ts + 6861, - 7: __ccgo_ts + 6864, - 8: __ccgo_ts + 6872, - 9: __ccgo_ts + 6875, - 10: __ccgo_ts + 6882, - 11: __ccgo_ts + 6890, + 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'), @@ -140368,14 +140701,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(93091)) } 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(93095))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6897, 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(93099)) } if i >= uint32((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -140526,7 +140859,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, 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) } @@ -140949,11 +141282,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(93642)) 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))) } @@ -140962,7 +141295,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) @@ -140976,7 +141309,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) } @@ -141011,7 +141344,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(93701)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*4)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -141046,7 +141379,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 } @@ -141112,11 +141445,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(93797)) 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))) } @@ -141139,7 +141472,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 @@ -141288,7 +141621,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+6937, 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 { @@ -141326,7 +141659,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr 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+6442, 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 @@ -141341,28 +141674,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+6941, 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+6948, 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+6961, 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+6964, 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+6969, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+7056, int32(1)) } } } @@ -141526,9 +141859,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 { @@ -141554,12 +141887,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) @@ -141568,28 +141899,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 @@ -141980,12 +142311,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 @@ -142002,7 +142333,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 @@ -142734,19 +143065,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+4711, 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+7005, 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+7026, 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+4711, 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+7033, 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) { @@ -143960,7 +144291,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 @@ -143976,6 +144307,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 */ @@ -144469,7 +144806,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(97561)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -144572,7 +144909,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+7057, 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+7171, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+7256, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -145168,7 +145505,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+7225, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+7310, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -145198,12 +145535,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 7280 + v250 = __ccgo_ts + 7365 } else { if iRollback != 0 { - v251 = __ccgo_ts + 7328 + v251 = __ccgo_ts + 7413 } else { - v251 = __ccgo_ts + 7371 + v251 = __ccgo_ts + 7456 } v250 = v251 } @@ -145295,7 +145632,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+7412) + (*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. @@ -146406,7 +146743,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(99822)) } else { goto jump_to_p2 } @@ -146865,7 +147202,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(). @@ -147298,7 +147635,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(101119)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+464, db, uint16(0)) @@ -147628,7 +147965,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+4711, 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 @@ -147659,13 +147996,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 + 7457 + 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+7471, 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 { @@ -147680,7 +148017,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(101412)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -147917,7 +148254,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+7514, 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 @@ -147934,7 +148271,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 @@ -147942,7 +148279,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 @@ -148023,11 +148360,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) } @@ -148239,7 +148576,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 @@ -148289,7 +148626,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+4711, 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 { @@ -148345,7 +148682,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+4711, 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)) @@ -148424,11 +148761,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 + 7551 + v286 = __ccgo_ts + 7636 } else { - v286 = __ccgo_ts + 7556 + v286 = __ccgo_ts + 7641 } - _sqlite3VdbeError(tls, p, __ccgo_ts+7563, 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) { @@ -148581,7 +148918,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+7615, libc.VaList(bp+736, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+7700, libc.VaList(bp+736, z1)) } goto abort_due_to_error } @@ -148743,7 +149080,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+7644, __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' @@ -148823,12 +149160,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)) @@ -148839,7 +149176,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+4711, 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)) @@ -149093,7 +149430,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+4711, 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) @@ -149244,7 +149581,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+7654, 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 { @@ -149331,15 +149668,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) @@ -149805,11 +150134,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 4711 + 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) @@ -149895,7 +150224,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103962)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -149994,7 +150323,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(104062)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -150008,7 +150337,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 + 4711 + v1 = __ccgo_ts + 4829 } else { v1 = libc.UintptrFromInt32(0) } @@ -150457,31 +150786,32 @@ type SortSubtask1 = TSortSubtask1 ** largest record in the sorter. */ type TVdbeSorter1 = 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 VdbeSorter1 = TVdbeSorter1 +/* Size (in bytes) of a VdbeSorter object that works with N or fewer subtasks */ + /* ** An instance of the following object is used to read records out of a ** PMA, in sorted order. The next key to be read is cached in nKey/aKey. @@ -151095,8 +151425,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 @@ -151110,9 +151440,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) @@ -151310,14 +151640,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 { @@ -151609,6 +151940,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: @@ -154162,25 +154496,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+7961, 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+7969+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7988+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+7457+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7542+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+8007+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+8007+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+8093+7) == 0 { return int32(1) } } @@ -154219,23 +154553,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 */ @@ -154267,7 +154600,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+8021, 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 @@ -154361,7 +154694,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+8026) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+8112) != 0 { goto _2 } } @@ -154383,57 +154716,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 @@ -154478,11 +154798,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+8028, 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+8032, 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 } @@ -154491,36 +154811,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+8036, 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++ @@ -154549,18 +154858,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 } } } @@ -154607,15 +154916,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+8045, 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+8076, 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+8113, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8199, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -154626,8 +154935,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -154667,7 +154976,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+8131, 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) @@ -154687,7 +154996,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) @@ -154696,7 +155005,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 + 8166 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8252 *(*uintptr)(unsafe.Pointer(pExpr + 20)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -154706,26 +155015,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 8175 + v8 = __ccgo_ts + 8261 } else { - v10 = __ccgo_ts + 8190 + v8 = __ccgo_ts + 8276 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8212, 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+8225, 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+8235, libc.VaList(bp+16, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8321, libc.VaList(bp+16, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8296, 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) } @@ -154774,8 +155083,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -154849,19 +155158,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 8303 + zIn = __ccgo_ts + 8389 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 8331 + zIn = __ccgo_ts + 8417 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 8349 + zIn = __ccgo_ts + 8435 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 8367 + zIn = __ccgo_ts + 8453 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8385, 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) } @@ -154887,7 +155196,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 @@ -155033,7 +155342,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+8405, 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) { @@ -155088,7 +155397,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+8422, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8508, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -155112,7 +155421,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+8486, 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) @@ -155126,13 +155435,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: ; @@ -155152,16 +155461,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+8522, 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 @@ -155172,35 +155478,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+8550, 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 + 8593 + zType = __ccgo_ts + 8679 } else { - zType = __ccgo_ts + 8600 + zType = __ccgo_ts + 8686 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8610, 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+8638, 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+8660, 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+8704, 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 { @@ -155285,7 +155594,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+8752, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+8838, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 20))) } @@ -155297,7 +155606,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+8763, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+8849, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -155343,7 +155652,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+8113, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8199, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -155468,7 +155777,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+8774, 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) } @@ -155503,7 +155812,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+8830, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8916, 0) return int32(1) } i = 0 @@ -155541,7 +155850,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+8864, 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 { @@ -155611,7 +155920,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+8870, 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 @@ -155645,7 +155954,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+8931, 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 @@ -155958,7 +156267,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+8962, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9048, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -156025,7 +156334,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+8864) != 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 { @@ -156036,7 +156345,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+9001) != 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 @@ -156046,7 +156355,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+9007, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9093, 0) return int32(WRC_Abort) } goto _6 @@ -156148,12 +156457,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) @@ -156196,12 +156505,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)) @@ -156268,33 +156577,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 } @@ -156346,7 +156657,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) { @@ -156554,7 +156865,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 } @@ -157029,7 +157340,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8113, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8199, 0) return } if int32(op) == int32(TK_LE) { @@ -157108,7 +157419,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+9066, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9152, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -157453,11 +157764,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 9114 + v2 = __ccgo_ts + 9200 } else { v2 = __ccgo_ts + 1674 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9116, 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)) @@ -157506,7 +157817,7 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt 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)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1794) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1820) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -157534,7 +157845,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+9160, 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)) @@ -157554,7 +157865,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+9194, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9280, libc.VaList(bp+8, p)) } // C documentation @@ -157625,7 +157936,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+9244, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9330, libc.VaList(bp+8, pExpr)) } } } @@ -157663,7 +157974,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 @@ -157677,7 +157988,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+9264, 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 } @@ -157697,7 +158008,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 @@ -157710,7 +158021,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+9307, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9393, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -158093,7 +158404,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 @@ -158233,7 +158544,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: @@ -158254,27 +158564,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) { @@ -158320,9 +158623,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++ } @@ -158332,8 +158635,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++ } @@ -158347,7 +158650,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) } @@ -158398,7 +158701,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 @@ -158479,7 +158782,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) @@ -158497,7 +158800,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) @@ -158578,7 +158881,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+9330, 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 @@ -158707,7 +159010,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+9360, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9446, libc.VaList(bp+8, zObject)) } } @@ -158805,10 +159108,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+9383) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+9469) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+9388) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+9474) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -159486,13 +159789,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+9394) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+9480) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+9402) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+9488) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+9408) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+9494) == 0 { return int32(1) } return 0 @@ -159507,32 +159810,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 + 9394, - 1: __ccgo_ts + 9402, - 2: __ccgo_ts + 9408, + 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 @@ -159741,7 +160031,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 @@ -159794,7 +160084,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+9412, 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) @@ -159894,12 +160184,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+1794) + 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) @@ -160491,7 +160782,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+9627) + 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 @@ -160587,7 +160878,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 @@ -160622,9 +160913,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) { @@ -160757,7 +161048,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) } } @@ -160887,13 +161178,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)<= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9720, 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) } @@ -161685,7 +161976,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)) @@ -161700,7 +161991,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+9747, 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) { @@ -161729,7 +162020,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) } @@ -161805,7 +162096,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9330, 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): @@ -161868,7 +162159,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8113, 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 @@ -161878,7 +162169,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) { @@ -161899,9 +162190,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 /* @@ -161983,7 +162274,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+9771, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9857, 0) return 0 } if int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -162054,17 +162345,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 { @@ -162073,7 +162364,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 @@ -162104,7 +162395,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 { @@ -162174,7 +162465,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) @@ -162218,7 +162509,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 @@ -162485,7 +162776,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: @@ -162694,7 +162987,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: @@ -163401,7 +163696,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) } @@ -163924,7 +164219,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) 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 + v7 = pParse + 48 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 @@ -163940,7 +164235,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) (*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 + v9 = pParse + 48 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 @@ -164025,7 +164320,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 @@ -164033,7 +164328,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 @@ -164051,7 +164346,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 } } } @@ -164070,11 +164365,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 } @@ -164192,8 +164487,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+7961, 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+9821, 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+9907, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -164211,10 +164506,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+9849, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9935, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10024, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10110, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -164230,9 +164525,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+10198, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10284, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10345, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10431, 0) } } @@ -164288,7 +164583,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+10496, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10582, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -164297,11 +164592,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+10555, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+10641, zName) { goto exit_rename_table } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10561, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10647, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -164331,21 +164626,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+10588, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10674, 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+10772, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10858, 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+11077, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11093, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+11163, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11179, 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+11151, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11237, 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 @@ -164353,7 +164648,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 @@ -164361,7 +164656,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+11416, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11502, 0) goto exit_rename_table exit_rename_table: ; @@ -164378,7 +164673,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+11429, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11515, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -164418,11 +164713,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+11467, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11553, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11499, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11585, 0) return } if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -164438,10 +164733,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+11526) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11612) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11585) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11671) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -164453,13 +164748,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11638) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11724) } _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+11684) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11770) } } /* Modify the CREATE TABLE statement. */ @@ -164473,7 +164768,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+11711, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11797, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -164501,7 +164796,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+11857, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11943, libc.VaList(bp+16, zTab, zDb)) } } } @@ -164539,12 +164834,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+12210, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12296, 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+12244, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12330, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -164559,7 +164854,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 } @@ -164568,7 +164863,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+12274, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+12360, 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 } @@ -164629,18 +164924,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 + 12293 + zType = __ccgo_ts + 12379 } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 12298 + zType = __ccgo_ts + 12384 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 12312 + v1 = __ccgo_ts + 12398 } else { - v1 = __ccgo_ts + 12329 + v1 = __ccgo_ts + 12415 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12347, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12433, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -164687,21 +164982,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)*12))).FzCnName, zOld) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12365, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12451, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -164717,11 +165000,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+12386, 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+12568, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12472, 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+12654, 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+11416, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+11502, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -165075,7 +165358,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 @@ -165197,11 +165480,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 + 12699 + v1 = __ccgo_ts + 12785 } else { v1 = __ccgo_ts + 1674 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12701, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12787, 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) } @@ -165272,30 +165555,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+12724, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+12810, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118867)) } 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(118888)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -165316,9 +165603,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)) @@ -165334,15 +165620,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+12732, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+12818, 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)) @@ -165353,16 +165639,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++ @@ -165379,21 +165665,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 + 12699 + v1 = __ccgo_ts + 12785 } else { v1 = __ccgo_ts + 1674 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+12738, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+12824, 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))) @@ -165419,7 +165705,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: ; @@ -165674,7 +165960,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))) @@ -165715,11 +166001,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 @@ -165729,7 +166015,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 { @@ -165739,7 +166025,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 @@ -165756,13 +166042,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: ; @@ -165773,7 +166059,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: ; @@ -165785,7 +166071,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: ; @@ -165826,8 +166112,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 { @@ -165859,7 +166145,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) @@ -165955,15 +166241,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))) @@ -165977,13 +166263,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)) @@ -165994,16 +166280,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) } @@ -166021,7 +166307,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: @@ -166033,35 +166319,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 @@ -166071,7 +166357,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: @@ -166090,7 +166376,7 @@ 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 { @@ -166104,7 +166390,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt } } _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 } @@ -166153,9 +166439,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))) @@ -166168,18 +166454,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 { @@ -166189,16 +166475,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: ; @@ -166207,19 +166493,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) { @@ -166261,12 +166547,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) @@ -166280,19 +166567,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 } @@ -166359,7 +166646,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(119856)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName) @@ -166376,7 +166663,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+12743, libc.VaList(bp+296, int32((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int32(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+12829, 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 @@ -166431,23 +166718,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12365, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12451, 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 + 12750 + v1 = __ccgo_ts + 12836 } else { - v1 = __ccgo_ts + 6980 + v1 = __ccgo_ts + 7067 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12762, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12848, 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+12790, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12876, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -166459,31 +166746,31 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _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+12838, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12924, 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+12959, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+13045, 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)) { @@ -166497,7 +166784,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 @@ -166508,8 +166795,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 } @@ -166570,27 +166857,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 + 12977, + FzName: __ccgo_ts + 13063, }, 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 + 12998, + FzName: __ccgo_ts + 13084, }, 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 + 13018, + FzName: __ccgo_ts + 13104, }, 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 + 13037, + FzName: __ccgo_ts + 13123, }, 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 + 13056, + FzName: __ccgo_ts + 13142, }, } @@ -166801,8 +167088,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+13159, 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+13245, 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 { @@ -166812,10 +167104,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+13182, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13268, 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+13212, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13298, 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) @@ -166847,15 +167139,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 13079, - FzCols: __ccgo_ts + 13092, + FzName: __ccgo_ts + 13165, + FzCols: __ccgo_ts + 13178, }, 1: { - FzName: __ccgo_ts + 13105, - FzCols: __ccgo_ts + 13118, + FzName: __ccgo_ts + 13191, + FzCols: __ccgo_ts + 13204, }, 2: { - FzName: __ccgo_ts + 13146, + FzName: __ccgo_ts + 13232, }, } @@ -167081,7 +167373,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) { @@ -167097,10 +167390,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) { @@ -167110,7 +167403,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) @@ -167169,7 +167462,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 + 13230, + FzName: __ccgo_ts + 13316, } func init() { @@ -167543,7 +167836,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 + 13240, + FzName: __ccgo_ts + 13326, } func init() { @@ -167593,7 +167886,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+13250, libc.VaList(bp+56, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+13336, libc.VaList(bp+56, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -167604,7 +167897,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+13255, libc.VaList(bp+56, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+13341, libc.VaList(bp+56, iVal)) goto _2 _2: ; @@ -167643,7 +167936,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+13261, libc.VaList(bp+56, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+24, __ccgo_ts+13347, libc.VaList(bp+56, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -167661,7 +167954,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 + 13267, + FzName: __ccgo_ts + 13353, } func init() { @@ -167727,7 +168020,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+13276, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+13362, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -167736,12 +168029,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+13079, uint32(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*80 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+13165, 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)) @@ -167943,7 +168236,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: @@ -167974,7 +168267,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+13286, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+13372, 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)) @@ -168065,7 +168358,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+13286, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+13372, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -168102,7 +168395,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 @@ -168135,11 +168428,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+13290) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+13376) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+13294) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+13380) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -168303,17 +168596,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+13298, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+13384, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+13309, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+13395, 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+13319, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+13405, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -168325,13 +168618,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) - } } } @@ -168692,11 +168978,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+13105, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+13191, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && int32((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+13331, __ccgo_ts+13400, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+13417, __ccgo_ts+13486, zDb) } return rc } @@ -168762,10 +169048,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+13079, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+13165, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && int32((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+13452, libc.VaList(bp+16, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+13538, libc.VaList(bp+16, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -168878,7 +169164,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+8021, 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 @@ -168930,11 +169216,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 + 20)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 16)) = Xsqlite3_vfs_find(tls, __ccgo_ts+5342) + *(*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+13493, db, bp+20, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), __ccgo_ts+13579, 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 { @@ -168965,7 +169251,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+13496, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(db + 120 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13582, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(db + 120 + 7*4)))) goto attach_error } i = 0 @@ -168974,7 +169260,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+13533, libc.VaList(bp+32, zName)) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13619, libc.VaList(bp+32, zName)) goto attach_error } goto _1 @@ -168992,7 +169278,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 } @@ -169030,7 +169316,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+13563, 0) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13649, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -169038,7 +169324,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+13592, 0) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13678, 0) rc = int32(SQLITE_ERROR) } } @@ -169085,7 +169371,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+1644, 0) } else { if *(*uintptr)(unsafe.Pointer(bp + 12)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13660, libc.VaList(bp+32, zFile)) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13746, libc.VaList(bp+32, zFile)) } } } @@ -169147,15 +169433,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+13688, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13774, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13709, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13795, 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+13735, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13821, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -169250,7 +169536,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 13757, + FzName: __ccgo_ts + 13843, } func init() { @@ -169272,7 +169558,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 + 13771, + FzName: __ccgo_ts + 13857, } func init() { @@ -169298,7 +169584,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+13785, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+13871, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -169332,7 +169618,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+13809, 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+13895, 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))) @@ -169549,7 +169835,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+13855, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13941, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -169577,11 +169863,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+13878, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+13964, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+13884, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+13970, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13890, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13976, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -169641,7 +169927,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 + 9402 + zCol = __ccgo_ts + 9488 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -169676,7 +169962,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+13917, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14003, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -169794,7 +170080,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 @@ -169892,7 +170178,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) @@ -169970,7 +170258,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) { @@ -169984,7 +170272,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) } @@ -170050,13 +170340,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-- } @@ -170097,21 +170387,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+8021) == 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+7961, 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+7988+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8007+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7457+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema+8, __ccgo_ts+7969) + 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+8007+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema+8, __ccgo_ts+7457) + 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) } } } @@ -170141,12 +170431,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7961, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8007+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+7457) + 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+7988+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema+8, __ccgo_ts+7969) + 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) } } } @@ -170184,7 +170474,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+13932, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+14018, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -170194,7 +170484,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) @@ -170202,15 +170492,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 + 13940 + v1 = __ccgo_ts + 14026 } else { - v1 = __ccgo_ts + 13953 + v1 = __ccgo_ts + 14039 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8225, 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+8296, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8382, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -170248,12 +170538,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+7961, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7457+7) == 0 { - return __ccgo_ts + 8007 + 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+7969+7) == 0 { - return __ccgo_ts + 7988 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8055+7) == 0 { + return __ccgo_ts + 8074 } } return zName @@ -170778,7 +171068,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+7457) + _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) @@ -170810,7 +171100,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+8021, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+8107, zName) { break } goto _1 @@ -170868,13 +171158,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+13967, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14053, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13984, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14070, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -170922,8 +171212,8 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType return int32(SQLITE_ERROR) } } else { - if int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7961, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14004, 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+14090, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -170959,23 +171249,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 @@ -171095,7 +171387,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 @@ -171138,9 +171430,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 + 7969 + v1 = __ccgo_ts + 8055 } else { - v1 = __ccgo_ts + 7457 + v1 = __ccgo_ts + 7542 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -171153,7 +171445,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+14046, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14132, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -171169,9 +171461,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 12293 + v2 = __ccgo_ts + 12379 } else { - v2 = __ccgo_ts + 10555 + v2 = __ccgo_ts + 10641 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -171181,9 +171473,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 + 7969 + v3 = __ccgo_ts + 8055 } else { - v3 = __ccgo_ts + 7457 + v3 = __ccgo_ts + 7542 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -171207,11 +171499,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 + 12293 + v4 = __ccgo_ts + 12379 } else { - v4 = __ccgo_ts + 10555 + v4 = __ccgo_ts + 10641 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14087, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14173, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -171219,11 +171511,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+14108, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14194, 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++ @@ -171255,19 +171547,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 @@ -171287,15 +171589,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) @@ -171310,7 +171617,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 } @@ -171371,7 +171678,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+14143, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14229, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -171380,14 +171687,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+14177, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+104, __ccgo_ts+14263, 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) @@ -171419,11 +171728,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) @@ -171434,7 +171743,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+14197, libc.VaList(bp+24, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14283, libc.VaList(bp+24, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -171444,12 +171753,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+14220, 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+14306, 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+14227, 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+14313, 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-- @@ -171491,21 +171800,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+14237, 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+14323, 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) { @@ -171516,7 +171814,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. */ @@ -171529,12 +171827,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 @@ -171706,10 +172013,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+14263, libc.VaList(bp+64, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14349, 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+14308, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14394, 0) } else { libc.Xmemset(tls, bp, 0, uint32(52)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -171767,7 +172074,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+14349, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14435, 0) } } @@ -171795,8 +172102,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) @@ -171804,7 +172111,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+14401, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14487, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 28)) |= uint32(TF_HasPrimaryKey) @@ -171823,21 +172130,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 @@ -171860,7 +172156,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14442, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14528, 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) @@ -171888,8 +172184,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 { @@ -171976,17 +172277,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+14498, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14584, 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+14541, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+14627, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+14549, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+14635, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -172018,7 +172319,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14556, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14642, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -172159,9 +172460,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 @@ -172172,31 +172474,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) { + n += int64(_identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName)) + if n < int64(50) { zSep = __ccgo_ts + 1674 - zSep2 = __ccgo_ts + 14587 - zEnd = __ccgo_ts + 6481 + zSep2 = __ccgo_ts + 14673 + zEnd = __ccgo_ts + 6568 } else { - zSep = __ccgo_ts + 14589 - zSep2 = __ccgo_ts + 14593 - zEnd = __ccgo_ts + 14598 + zSep = __ccgo_ts + 14675 + zSep2 = __ccgo_ts + 14679 + zEnd = __ccgo_ts + 14684 } - 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+14601, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.Xmemcpy(tls, zStmt, __ccgo_ts+14687, 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))++ @@ -172207,8 +172509,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)] @@ -172221,17 +172524,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+4711, 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 + 1674, - 1: __ccgo_ts + 14615, - 2: __ccgo_ts + 14621, - 3: __ccgo_ts + 14626, - 4: __ccgo_ts + 14631, - 5: __ccgo_ts + 14621, + 1: __ccgo_ts + 14701, + 2: __ccgo_ts + 14707, + 3: __ccgo_ts + 14712, + 4: __ccgo_ts + 14717, + 5: __ccgo_ts + 14707, } // C documentation @@ -172240,15 +172544,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) } @@ -172263,7 +172568,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 } @@ -172496,8 +172801,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. @@ -172597,7 +172912,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 @@ -172610,8 +172925,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++ } @@ -172641,7 +172956,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 @@ -172860,9 +173175,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+14637, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1674))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14723, 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+14670, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14756, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -172883,11 +173198,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+14697, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14783, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14747, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14833, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 28)) |= uint32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -172934,7 +173249,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14779, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14865, 0) return } } @@ -172968,16 +173283,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 + 10555 - zType2 = __ccgo_ts + 14823 + zType = __ccgo_ts + 10641 + zType2 = __ccgo_ts + 14909 } else { /* A view */ - zType = __ccgo_ts + 12293 - zType2 = __ccgo_ts + 14829 + zType = __ccgo_ts + 12379 + zType2 = __ccgo_ts + 14915 } /* 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 @@ -172994,24 +173309,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) @@ -173050,7 +173370,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 } @@ -173059,13 +173379,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+14834, libc.VaList(bp+40, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14920, 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+14849, 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+14935, 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 @@ -173074,15 +173404,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+14947, libc.VaList(bp+40, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15033, 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+14989, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+15075, 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+15023, 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+15109, 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. @@ -173100,7 +173430,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+11077) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+11163) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -173133,7 +173463,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+15044, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15130, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -173150,7 +173480,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+12293, *(*uintptr)(unsafe.Pointer(bp + 60))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+12379, *(*uintptr)(unsafe.Pointer(bp + 60))) if _sqlite3FixSelect(tls, bp+8, pSelect) != 0 { goto create_view_fail } @@ -173247,7 +173577,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+15080, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15166, 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. @@ -173431,7 +173761,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+15110, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15196, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -173444,7 +173774,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+15125, 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+15211, 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) } @@ -173527,9 +173857,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+15192, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+15278, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13182, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13268, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -173570,7 +173900,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+15206, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15292, 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 @@ -173579,7 +173909,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+15251, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15337, 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) } @@ -173614,11 +173944,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+7961, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+15318, 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+15404, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+8763, 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) @@ -173673,9 +174003,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 + 7969 + v1 = __ccgo_ts + 8055 } else { - v1 = __ccgo_ts + 7457 + v1 = __ccgo_ts + 7542 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName @@ -173708,18 +174038,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+15323, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15409, 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+15351, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15437, 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+15385, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15471, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -173729,7 +174059,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+13294, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+13380, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -173777,19 +174107,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+15417, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*12))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15503, 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+15480, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15566, 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 { @@ -173846,7 +174176,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+15574, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*20))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15660, 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) { @@ -173961,11 +174291,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 */ @@ -173987,7 +174317,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 @@ -174032,13 +174362,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) } @@ -174061,23 +174391,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 @@ -174106,11 +174436,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 + 15620 + v2 = __ccgo_ts + 15706 } else { - v2 = __ccgo_ts + 15626 + v2 = __ccgo_ts + 15712 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15631, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15717, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -174188,7 +174518,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+15659, *(*uintptr)(unsafe.Pointer(bp + 52))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+15745, *(*uintptr)(unsafe.Pointer(bp + 52))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -174198,7 +174528,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+15665, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15751, 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)) { @@ -174212,16 +174542,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+7961, int32(7)) == 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15715, 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+15801, 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+15743, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15829, 0) goto exit_create_index } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15768, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15854, 0) goto exit_create_index } /* @@ -174242,19 +174572,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+15659, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+15745, (*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+15802, libc.VaList(bp+80, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15888, 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+15836, libc.VaList(bp+80, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15922, libc.VaList(bp+80, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -174275,7 +174605,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+15860, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+15946, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -174293,9 +174623,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 + 7969 + v2 = __ccgo_ts + 8055 } else { - v2 = __ccgo_ts + 7457 + v2 = __ccgo_ts + 7542 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -174323,7 +174653,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+15659) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+15745) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -174355,7 +174685,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 } @@ -174407,7 +174737,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+15883, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15969, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -174422,6 +174752,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { j = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) + libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 10, 0x400) } else { if int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12 + 4))&0xf>>0)) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 3, 0x8) @@ -174506,7 +174837,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) @@ -174554,7 +174885,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+15944, libc.VaList(bp+80, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16030, 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 @@ -174584,8 +174915,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+15986, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16072, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127335)) goto exit_create_index } } @@ -174598,7 +174929,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 @@ -174627,9 +174958,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if onError == OE_None { v13 = __ccgo_ts + 1674 } else { - v13 = __ccgo_ts + 16003 + v13 = __ccgo_ts + 16089 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+16011, libc.VaList(bp+80, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 52)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+16097, 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(""); */ @@ -174637,7 +174968,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+16031, 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+16117, 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. @@ -174645,7 +174976,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+16090, libc.VaList(bp+80, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+16176, 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)) @@ -174808,16 +175139,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+16117, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16203, 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+16135, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16221, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -174825,9 +175156,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 + 7969 + v1 = __ccgo_ts + 8055 } else { - v1 = __ccgo_ts + 7457 + v1 = __ccgo_ts + 7542 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -174843,8 +175174,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+16208, 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+13290, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+16294, 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+13376, (*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) @@ -174917,12 +175248,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) @@ -175034,13 +175365,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+16268, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16354, 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) } @@ -175121,7 +175452,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) } @@ -175171,7 +175502,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 @@ -175342,11 +175673,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 + 16304 + v1 = __ccgo_ts + 16390 } else { - v1 = __ccgo_ts + 16307 + v1 = __ccgo_ts + 16393 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16313, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16399, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -175545,7 +175876,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+16349, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+16435, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -175592,9 +175923,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 + 16355 + v1 = __ccgo_ts + 16441 } else { - v1 = __ccgo_ts + 16364 + v1 = __ccgo_ts + 16450 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -175626,9 +175957,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 16349, - 1: __ccgo_ts + 16371, - 2: __ccgo_ts + 16355, + 0: __ccgo_ts + 16435, + 1: __ccgo_ts + 16457, + 2: __ccgo_ts + 16441, } // C documentation @@ -175648,7 +175979,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+16379, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16465, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -175673,7 +176004,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+13878, 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+13964, 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 @@ -176104,7 +176435,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+16579, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16665, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -176986,11 +177315,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+16612, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16698, 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+16641, 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) } return 0 @@ -177094,7 +177423,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 @@ -177151,7 +177480,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+16715, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+16801, -int32(1)) return } if argc == int32(3) { @@ -178870,7 +179204,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+16748, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+16834, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+4) @@ -178952,7 +179286,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+4711, 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 @@ -179024,28 +179358,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+16793, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+16879, 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+16801, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+16887, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -179077,13 +179411,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+16809, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 16895 + } else { + v2 = __ccgo_ts + 16899 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: 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+16902, -int32(1)) + return +} + // C documentation // // /* @@ -179095,6 +179565,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) @@ -179105,7 +179579,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) @@ -179629,7 +180103,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 12699, + 0: __ccgo_ts + 12785, } // C documentation @@ -179789,7 +180263,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+16812, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+16925, int32(4), libc.UintptrFromInt32(0)) } } @@ -179850,7 +180324,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+13917, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+14003, -int32(1)) return } if argc == int32(2) { @@ -179964,7 +180438,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) { @@ -180046,7 +180520,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+16692, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+16778, -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) @@ -180398,7 +180872,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+16817, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+16930, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -180427,8 +180901,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+16823, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+16823, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+16936, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+16936, 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 @@ -180608,11 +181082,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 @@ -180716,7 +181190,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))) } /* @@ -180729,542 +181203,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 + 16828, + FzName: __ccgo_ts + 16941, }, 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 + 16848, + FzName: __ccgo_ts + 16961, }, 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 + 16861, + FzName: __ccgo_ts + 16974, }, 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 + 16879, + FzName: __ccgo_ts + 16992, }, 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 + 16888, + FzName: __ccgo_ts + 17001, }, 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 + 16896, + FzName: __ccgo_ts + 17009, }, 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 + 16896, + FzName: __ccgo_ts + 17009, }, 7: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16911, + FzName: __ccgo_ts + 17024, }, 8: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16937, + FzName: __ccgo_ts + 17050, }, 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 + 16962, + FzName: __ccgo_ts + 17075, }, 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 + 16971, + FzName: __ccgo_ts + 17084, }, 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 + 16982, + FzName: __ccgo_ts + 17095, }, 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 + 16989, + FzName: __ccgo_ts + 17102, }, 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 + 17003, + FzName: __ccgo_ts + 17116, }, 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 + 17003, + FzName: __ccgo_ts + 17116, }, 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 + 17009, + FzName: __ccgo_ts + 17122, }, 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 + 17009, + FzName: __ccgo_ts + 17122, }, 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 + 17015, + FzName: __ccgo_ts + 17128, }, 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 + 17015, + FzName: __ccgo_ts + 17128, }, 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 + 17020, + FzName: __ccgo_ts + 17133, }, 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 + 17020, + FzName: __ccgo_ts + 17133, }, 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 + 17024, + FzName: __ccgo_ts + 17137, }, 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 + 17024, + FzName: __ccgo_ts + 17137, }, 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 + 17028, + FzName: __ccgo_ts + 17141, }, 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 + 17035, + FzName: __ccgo_ts + 17148, }, 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 + 17043, + FzName: __ccgo_ts + 17156, }, 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 + 17050, + FzName: __ccgo_ts + 17163, }, 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 + 17063, + FzName: __ccgo_ts + 17176, }, 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 + 17069, + FzName: __ccgo_ts + 17182, }, 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 + 17076, + FzName: __ccgo_ts + 17189, }, 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 + 17083, + FzName: __ccgo_ts + 17196, }, 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 + 17091, + FzName: __ccgo_ts + 17204, }, 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 + 17096, + FzName: __ccgo_ts + 17209, }, 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 + 17100, + FzName: __ccgo_ts + 17213, }, 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 + 17100, + FzName: __ccgo_ts + 17213, }, 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 + 17106, + FzName: __ccgo_ts + 17219, }, 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 + 17112, + FzName: __ccgo_ts + 17225, }, 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 + 17118, + FzName: __ccgo_ts + 17231, }, 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 + 17122, + FzName: __ccgo_ts + 17235, }, 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 + 17122, + FzName: __ccgo_ts + 17235, }, 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 + 17128, + FzName: __ccgo_ts + 17241, }, 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 + 17135, + FzName: __ccgo_ts + 17248, }, 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 + 17145, + FzName: __ccgo_ts + 17258, }, 43: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17152, + FzName: __ccgo_ts + 17265, }, 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 + 17159, + FzName: __ccgo_ts + 17272, }, 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 + 17170, + FzName: __ccgo_ts + 17283, }, 46: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17177, + FzName: __ccgo_ts + 17290, }, 47: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17192, + FzName: __ccgo_ts + 17305, }, 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 + 17209, + FzName: __ccgo_ts + 17322, }, 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 + 17220, + FzName: __ccgo_ts + 17333, }, 50: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17226, + 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 + 17340, }, 51: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17244, + 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 + 17346, }, 52: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17252, + FzName: __ccgo_ts + 17359, }, 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 + 17266, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17377, }, 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 + 17274, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17385, }, 55: { - 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 + 17283, - }, - 56: { 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 + 17283, + FzName: __ccgo_ts + 17399, + }, + 56: { + 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 + 17407, }, 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 + 17290, + FzName: __ccgo_ts + 17416, }, 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 + 17290, + FzName: __ccgo_ts + 17416, }, 59: { - 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 + 17300, + 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 + 17423, }, 60: { - 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 + 17304, + 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 + 17423, }, 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 + 17310, + FzName: __ccgo_ts + 17433, }, 62: { - 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 + 17314, + 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 + 17437, }, 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(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 17314, + 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 + 17443, }, 64: { - 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 + 17320, + 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 + 17447, }, 65: { - 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 + 17320, + 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 + 17447, }, 66: { - FnArg: int16(2), + 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 + 17333, + FzName: __ccgo_ts + 17453, }, 67: { 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 + 17344, + 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 + 17453, }, 68: { 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 + 16823, + 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 + 17466, }, 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 + 17477, + }, + 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 + 16936, + }, + 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 + 16823, - }, - 70: { - FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17349, - }, - 71: { - FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1247, + FzName: __ccgo_ts + 16936, }, 72: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1255, + FzName: __ccgo_ts + 17482, }, 73: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17354, + 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 + 17360, + 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 + 17363, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 17487, }, 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 + 17367, + FzName: __ccgo_ts + 17493, }, 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 + 17373, + FpUserData: uintptr(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 17496, }, 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 + 17363, + FpUserData: uintptr(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 17500, }, 79: { FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17378, + 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 + 17506, }, 80: { FnArg: int16(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17382, + 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 + 17496, }, 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 + 17386, + FzName: __ccgo_ts + 17511, }, 82: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17392, + FzName: __ccgo_ts + 17515, }, 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 + 17396, + FzName: __ccgo_ts + 17519, }, 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 + 17401, + FzName: __ccgo_ts + 17525, }, 85: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17406, + FzName: __ccgo_ts + 17529, }, 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 + 17411, + FzName: __ccgo_ts + 17534, }, 87: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17417, + FzName: __ccgo_ts + 17539, }, 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 + 17421, + FzName: __ccgo_ts + 17544, }, 89: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17425, + FzName: __ccgo_ts + 17550, }, 90: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17429, + FzName: __ccgo_ts + 17554, }, 91: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17434, + FzName: __ccgo_ts + 17558, }, 92: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17439, + FzName: __ccgo_ts + 17562, }, 93: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17444, + FzName: __ccgo_ts + 17567, }, 94: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17450, + FzName: __ccgo_ts + 17572, }, 95: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17456, + FzName: __ccgo_ts + 17577, }, 96: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17462, + FzName: __ccgo_ts + 17583, }, 97: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17467, + FzName: __ccgo_ts + 17589, }, 98: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17475, + FzName: __ccgo_ts + 17595, }, 99: { + FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17483, + FzName: __ccgo_ts + 17600, }, 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 + 17486, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 17608, }, 101: { - 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 + 8166, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 17616, }, 102: { - 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 + 17491, + 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 + 17619, }, 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 + 8252, + }, + 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 + 17495, + FzName: __ccgo_ts + 17624, + }, + 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 + 17628, }, } @@ -181323,109 +181808,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 ************************************************/ @@ -181742,7 +182229,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+17498, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17631, 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) @@ -182566,7 +183053,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 @@ -182853,11 +183340,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 8)) = TToken{ - Fz: __ccgo_ts + 8032, + Fz: __ccgo_ts + 8118, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 8028, + Fz: __ccgo_ts + 8114, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 { @@ -182921,7 +183408,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+6616) + 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) @@ -183503,7 +183990,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9659, 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 } @@ -183569,11 +184056,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 } @@ -183898,7 +184385,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) @@ -183912,7 +184399,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 @@ -183947,7 +184434,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 @@ -183960,7 +184447,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 @@ -184087,27 +184574,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 */ @@ -184188,7 +184675,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++ @@ -184224,44 +184711,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+17543, 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+17676, 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+17584, 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+17717, 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 } } @@ -184283,31 +184754,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+17616, libc.VaList(bp+88, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+17749, 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 @@ -184331,10 +184802,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) @@ -184375,8 +184846,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-- } @@ -184393,28 +184864,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+17624, libc.VaList(bp+88, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17757, 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+17676, libc.VaList(bp+88, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17809, 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 @@ -184527,18 +184998,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 @@ -184548,13 +185019,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 } } } @@ -184565,14 +185036,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 } @@ -184589,16 +185060,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++ @@ -184709,11 +185180,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 */ @@ -184772,7 +185243,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+17768) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+17901) } goto insert_cleanup insert_cleanup: @@ -185168,7 +185639,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+13878, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+13964, 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('\\'))) { @@ -187402,7 +187875,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+17818, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+17951, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -187422,7 +187895,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+17822, uint32(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+17955, uint32(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } @@ -187434,7 +187907,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+17828, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+17961, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, int32(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -187449,7 +187922,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+17871, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+18004, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) @@ -187480,7 +187953,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+17903, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+18036, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, int32(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -187489,7 +187962,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 17782, + 0: __ccgo_ts + 17915, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -187722,7 +188195,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+17940, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+18073, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -187776,63 +188249,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 + 6872, - 1: __ccgo_ts + 17979, - 2: __ccgo_ts + 10555, - 3: __ccgo_ts + 17983, - 4: __ccgo_ts + 17988, - 5: __ccgo_ts + 17991, - 6: __ccgo_ts + 18001, - 7: __ccgo_ts + 18011, - 8: __ccgo_ts + 18017, - 9: __ccgo_ts + 18021, - 10: __ccgo_ts + 18026, - 11: __ccgo_ts + 18031, - 12: __ccgo_ts + 18039, - 13: __ccgo_ts + 18050, - 14: __ccgo_ts + 18053, - 15: __ccgo_ts + 18060, - 16: __ccgo_ts + 18021, - 17: __ccgo_ts + 18026, - 18: __ccgo_ts + 18067, - 19: __ccgo_ts + 18072, - 20: __ccgo_ts + 18075, - 21: __ccgo_ts + 18082, - 22: __ccgo_ts + 18017, - 23: __ccgo_ts + 18021, - 24: __ccgo_ts + 18088, - 25: __ccgo_ts + 18093, - 26: __ccgo_ts + 18098, - 27: __ccgo_ts + 18021, - 28: __ccgo_ts + 18102, - 29: __ccgo_ts + 18026, - 30: __ccgo_ts + 18110, - 31: __ccgo_ts + 18114, - 32: __ccgo_ts + 18119, - 33: __ccgo_ts + 13294, - 34: __ccgo_ts + 13290, - 35: __ccgo_ts + 18125, - 36: __ccgo_ts + 18130, - 37: __ccgo_ts + 18135, - 38: __ccgo_ts + 17979, - 39: __ccgo_ts + 18021, - 40: __ccgo_ts + 18140, - 41: __ccgo_ts + 18147, - 42: __ccgo_ts + 18154, - 43: __ccgo_ts + 10555, - 44: __ccgo_ts + 18162, - 45: __ccgo_ts + 6875, - 46: __ccgo_ts + 18168, - 47: __ccgo_ts + 17979, - 48: __ccgo_ts + 18021, - 49: __ccgo_ts + 18173, - 50: __ccgo_ts + 18178, - 51: __ccgo_ts + 17363, - 52: __ccgo_ts + 18183, - 53: __ccgo_ts + 18196, - 54: __ccgo_ts + 18205, - 55: __ccgo_ts + 18212, - 56: __ccgo_ts + 18223, + 0: __ccgo_ts + 6959, + 1: __ccgo_ts + 18112, + 2: __ccgo_ts + 10641, + 3: __ccgo_ts + 18116, + 4: __ccgo_ts + 18121, + 5: __ccgo_ts + 18124, + 6: __ccgo_ts + 18134, + 7: __ccgo_ts + 18144, + 8: __ccgo_ts + 18150, + 9: __ccgo_ts + 18154, + 10: __ccgo_ts + 18159, + 11: __ccgo_ts + 18164, + 12: __ccgo_ts + 18172, + 13: __ccgo_ts + 18183, + 14: __ccgo_ts + 18186, + 15: __ccgo_ts + 18154, + 16: __ccgo_ts + 18193, + 17: __ccgo_ts + 18159, + 18: __ccgo_ts + 18201, + 19: __ccgo_ts + 18205, + 20: __ccgo_ts + 18210, + 21: __ccgo_ts + 18216, + 22: __ccgo_ts + 18154, + 23: __ccgo_ts + 18159, + 24: __ccgo_ts + 18223, + 25: __ccgo_ts + 18228, + 26: __ccgo_ts + 18231, + 27: __ccgo_ts + 18238, + 28: __ccgo_ts + 18150, + 29: __ccgo_ts + 18154, + 30: __ccgo_ts + 18244, + 31: __ccgo_ts + 18249, + 32: __ccgo_ts + 18254, + 33: __ccgo_ts + 18112, + 34: __ccgo_ts + 18154, + 35: __ccgo_ts + 18258, + 36: __ccgo_ts + 18265, + 37: __ccgo_ts + 18272, + 38: __ccgo_ts + 13380, + 39: __ccgo_ts + 13376, + 40: __ccgo_ts + 18280, + 41: __ccgo_ts + 18285, + 42: __ccgo_ts + 18290, + 43: __ccgo_ts + 10641, + 44: __ccgo_ts + 18295, + 45: __ccgo_ts + 6962, + 46: __ccgo_ts + 18301, + 47: __ccgo_ts + 18306, + 48: __ccgo_ts + 17496, + 49: __ccgo_ts + 18311, + 50: __ccgo_ts + 18112, + 51: __ccgo_ts + 18154, + 52: __ccgo_ts + 18324, + 53: __ccgo_ts + 18329, + 54: __ccgo_ts + 18338, + 55: __ccgo_ts + 18345, + 56: __ccgo_ts + 18356, } // C documentation @@ -187852,343 +188325,343 @@ type PragmaName = TPragmaName var _aPragmaName = [67]TPragmaName{ 0: { - FzName: __ccgo_ts + 18231, + FzName: __ccgo_ts + 18364, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 18246, + FzName: __ccgo_ts + 18379, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 18261, + FzName: __ccgo_ts + 18394, 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 + 18273, + FzName: __ccgo_ts + 18406, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 18289, + FzName: __ccgo_ts + 18422, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 18212, + FzName: __ccgo_ts + 18345, 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 + 18302, + FzName: __ccgo_ts + 18435, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 18314, + FzName: __ccgo_ts + 18447, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 18334, + FzName: __ccgo_ts + 18467, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 18350, + FzName: __ccgo_ts + 18483, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 18371, + FzName: __ccgo_ts + 18504, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 18386, + FzName: __ccgo_ts + 18519, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 18402, + FzName: __ccgo_ts + 18535, 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 + 18416, + FzName: __ccgo_ts + 18549, FePragTyp: uint8(PragTyp_DATA_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 14: { - FzName: __ccgo_ts + 18437, + FzName: __ccgo_ts + 18570, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 15: { - FzName: __ccgo_ts + 18450, + FzName: __ccgo_ts + 18583, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 16: { - FzName: __ccgo_ts + 18464, + FzName: __ccgo_ts + 18597, 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 + 18483, + FzName: __ccgo_ts + 18616, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 18: { - FzName: __ccgo_ts + 18502, + FzName: __ccgo_ts + 18635, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 19: { - FzName: __ccgo_ts + 18525, + FzName: __ccgo_ts + 18658, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 20: { - FzName: __ccgo_ts + 18534, + FzName: __ccgo_ts + 18667, 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 + 18552, + FzName: __ccgo_ts + 18685, 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 + 18569, + FzName: __ccgo_ts + 18702, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 23: { - FzName: __ccgo_ts + 18582, + FzName: __ccgo_ts + 18715, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 24: { - FzName: __ccgo_ts + 18597, + FzName: __ccgo_ts + 18730, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 25: { - FzName: __ccgo_ts + 18615, + FzName: __ccgo_ts + 18748, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 26: { - FzName: __ccgo_ts + 18625, + FzName: __ccgo_ts + 18758, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 27: { - FzName: __ccgo_ts + 18639, + FzName: __ccgo_ts + 18772, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 28: { - FzName: __ccgo_ts + 18655, + FzName: __ccgo_ts + 18788, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 29: { - FzName: __ccgo_ts + 18680, + FzName: __ccgo_ts + 18813, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 30: { - FzName: __ccgo_ts + 18699, + FzName: __ccgo_ts + 18832, 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 + 18710, + FzName: __ccgo_ts + 18843, 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 + 18721, + FzName: __ccgo_ts + 18854, 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 + 18733, + FzName: __ccgo_ts + 18866, 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 + 18749, + FzName: __ccgo_ts + 18882, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 18762, + FzName: __ccgo_ts + 18895, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 36: { - FzName: __ccgo_ts + 18781, + FzName: __ccgo_ts + 18914, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 37: { - FzName: __ccgo_ts + 18800, + FzName: __ccgo_ts + 18933, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 18813, + FzName: __ccgo_ts + 18946, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 39: { - FzName: __ccgo_ts + 18828, + FzName: __ccgo_ts + 18961, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 40: { - FzName: __ccgo_ts + 18838, + FzName: __ccgo_ts + 18971, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 41: { - FzName: __ccgo_ts + 18850, + FzName: __ccgo_ts + 18983, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 42: { - FzName: __ccgo_ts + 18859, + FzName: __ccgo_ts + 18992, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 43: { - FzName: __ccgo_ts + 18870, + FzName: __ccgo_ts + 19003, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 44: { - FzName: __ccgo_ts + 18880, + FzName: __ccgo_ts + 19013, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 45: { - FzName: __ccgo_ts + 18892, + FzName: __ccgo_ts + 19025, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 46: { - FzName: __ccgo_ts + 18903, + FzName: __ccgo_ts + 19036, 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 + 18915, + FzName: __ccgo_ts + 19048, 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 + 18932, + FzName: __ccgo_ts + 19065, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 49: { - FzName: __ccgo_ts + 18951, + FzName: __ccgo_ts + 19084, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 50: { - FzName: __ccgo_ts + 18977, + FzName: __ccgo_ts + 19110, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 51: { - FzName: __ccgo_ts + 18992, + FzName: __ccgo_ts + 19125, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 52: { - FzName: __ccgo_ts + 19006, + FzName: __ccgo_ts + 19139, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 53: { - FzName: __ccgo_ts + 19025, + FzName: __ccgo_ts + 19158, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 54: { - FzName: __ccgo_ts + 19039, + FzName: __ccgo_ts + 19172, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 55: { - FzName: __ccgo_ts + 19055, + FzName: __ccgo_ts + 19188, 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 + 19067, + FzName: __ccgo_ts + 19200, 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 + 19078, + FzName: __ccgo_ts + 19211, 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 + 19089, + FzName: __ccgo_ts + 19222, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -188196,45 +188669,45 @@ var _aPragmaName = [67]TPragmaName{ FiArg: uint64(1), }, 59: { - FzName: __ccgo_ts + 19101, + FzName: __ccgo_ts + 19234, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 60: { - FzName: __ccgo_ts + 19112, + FzName: __ccgo_ts + 19245, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 61: { - FzName: __ccgo_ts + 19133, + FzName: __ccgo_ts + 19266, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 62: { - FzName: __ccgo_ts + 19141, + FzName: __ccgo_ts + 19274, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 63: { - FzName: __ccgo_ts + 19156, + FzName: __ccgo_ts + 19289, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 64: { - FzName: __ccgo_ts + 19169, + FzName: __ccgo_ts + 19302, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 65: { - FzName: __ccgo_ts + 19188, + FzName: __ccgo_ts + 19321, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 66: { - FzName: __ccgo_ts + 19203, + FzName: __ccgo_ts + 19336, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -188252,7 +188725,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 @@ -188360,10 +188833,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+5172) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+5259) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19219) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19352) { return PAGER_LOCKINGMODE_NORMAL } } @@ -188381,13 +188854,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+9715) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+9801) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19226) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19359) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19231) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19364) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -188410,10 +188883,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+18173) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18324) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+19243) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+19376) == 0 { return int32(2) } else { return 0 @@ -188435,7 +188908,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+19250, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19383, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpBt) @@ -188565,15 +189038,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch int32(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 19312 + zName = __ccgo_ts + 19445 case int32(OE_SetDflt): - zName = __ccgo_ts + 19321 + zName = __ccgo_ts + 19454 case int32(OE_Cascade): - zName = __ccgo_ts + 19333 + zName = __ccgo_ts + 19466 case int32(OE_Restrict): - zName = __ccgo_ts + 19341 + zName = __ccgo_ts + 19474 default: - zName = __ccgo_ts + 19350 + zName = __ccgo_ts + 19483 break } return zName @@ -188594,12 +189067,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 19360, - 1: __ccgo_ts + 19367, - 2: __ccgo_ts + 19375, - 3: __ccgo_ts + 19379, - 4: __ccgo_ts + 19243, - 5: __ccgo_ts + 19388, + 0: __ccgo_ts + 19493, + 1: __ccgo_ts + 19500, + 2: __ccgo_ts + 19508, + 3: __ccgo_ts + 19512, + 4: __ccgo_ts + 19376, + 5: __ccgo_ts + 19521, } // C documentation @@ -188661,15 +189134,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 + 19413 + zType = __ccgo_ts + 19546 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 19415 + zType = __ccgo_ts + 19548 } else { - zType = __ccgo_ts + 9114 + zType = __ccgo_ts + 9200 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19417, 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+19550, 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: ; @@ -188678,9 +189151,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 19392, - 2: __ccgo_ts + 19397, - 3: __ccgo_ts + 19405, + 1: __ccgo_ts + 19525, + 2: __ccgo_ts + 19530, + 3: __ccgo_ts + 19538, } // C documentation @@ -188780,7 +189253,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+19424, libc.VaList(bp+136, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+19557, libc.VaList(bp+136, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -188823,7 +189296,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+4711, 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++ @@ -188868,7 +189341,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 @@ -188927,7 +189400,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+19428) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+19561) == 0 { b = int32(2) } else { b = int32(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -188970,7 +189443,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 @@ -188998,7 +189471,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 19219 + zRet = __ccgo_ts + 19352 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 @@ -189026,7 +189499,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 + 5172 + zRet = __ccgo_ts + 5259 } _returnSingleText(tls, v, zRet) break @@ -189316,7 +189789,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+19433, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19566, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -189326,7 +189799,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+4711, 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) } @@ -189355,14 +189828,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+19433, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19566, 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+4711, 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) } @@ -189384,7 +189857,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+19458, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19591, 0) } else { if iDb != int32(1) { iLevel = (int32(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -189416,8 +189889,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+19511) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+19644) == 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. */ @@ -189497,9 +189971,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 + 19517 + v14 = __ccgo_ts + 19650 } else { - v14 = __ccgo_ts + 19525 + v14 = __ccgo_ts + 19658 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 { v15 = int32(1) @@ -189570,7 +190044,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+19532, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19665, 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)) @@ -189600,19 +190074,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 + 12293 + zType = __ccgo_ts + 12379 } else { if int32((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 14541 + zType = __ccgo_ts + 14627 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 19548 + zType = __ccgo_ts + 19681 } else { - zType = __ccgo_ts + 10555 + zType = __ccgo_ts + 10641 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19555, 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+19688, 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: ; @@ -189659,9 +190133,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+19562, libc.VaList(bp+136, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19695, libc.VaList(bp+136, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+19567, 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+19700, 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 @@ -189685,11 +190159,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 19572, - 1: __ccgo_ts + 19574, - 2: __ccgo_ts + 18050, + 0: __ccgo_ts + 19705, + 1: __ccgo_ts + 19707, + 2: __ccgo_ts + 18183, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19576, 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+19709, 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: ; @@ -189708,7 +190182,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+19582, 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+19715, 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: ; @@ -189725,7 +190199,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+19586, libc.VaList(bp+136, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19719, libc.VaList(bp+136, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -189775,7 +190249,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+9114, 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: ; @@ -189787,7 +190261,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+9114, 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: ; @@ -189813,7 +190287,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+19589, 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+19598)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19722, 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+19731)) goto _32 _32: ; @@ -189827,8 +190301,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 @@ -189954,7 +190428,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+19603, libc.VaList(bp+136, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+19736, 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))) @@ -190050,7 +190524,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 @@ -190145,7 +190619,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+19607, 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+19740, 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) @@ -190156,7 +190630,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+19631) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+19764) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -190292,7 +190766,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+19660, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+19793, 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) @@ -190354,7 +190828,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))) } @@ -190376,7 +190850,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+19696, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19829, 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) @@ -190389,7 +190863,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+19716, 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+19849, 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) { @@ -190397,7 +190871,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+19738, 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+19871, 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) { @@ -190408,10 +190882,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+19761, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+19894, -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+19763, 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+19896, 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)) } } @@ -190445,7 +190919,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+19783, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19916, 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) @@ -190469,9 +190943,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+19813) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19946) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19818) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19951) _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)) @@ -190484,9 +190958,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+19839) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19972) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19875) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+20008) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -190514,9 +190988,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+19813) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19946) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19886) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+20019) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -190544,7 +191018,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+19913) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+20046) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -190641,7 +191115,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 + 19940 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*20 + 16)) = __ccgo_ts + 20073 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*20))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*20 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -190720,7 +191194,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+20001, libc.VaList(bp+136, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20134, libc.VaList(bp+136, zRight)) } } } @@ -190825,13 +191299,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+19226) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19359) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+20026) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+20159) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19379) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19512) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -190966,7 +191440,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 @@ -190996,7 +191470,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+7961, 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. @@ -191058,7 +191532,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+20034, 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+20167, 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)) @@ -191331,34 +191805,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 19943, + FzName: __ccgo_ts + 20076, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 19948, + FzName: __ccgo_ts + 20081, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 19954, + FzName: __ccgo_ts + 20087, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 19963, + FzName: __ccgo_ts + 20096, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 19972, + FzName: __ccgo_ts + 20105, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 19980, + FzName: __ccgo_ts + 20113, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 19988, + FzName: __ccgo_ts + 20121, }, 7: { - FzName: __ccgo_ts + 19995, + FzName: __ccgo_ts + 20128, }, 8: {}, } @@ -191456,14 +191930,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+20052) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20185) 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+20067, libc.VaList(bp+232, int32(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20200, libc.VaList(bp+232, int32(cSep), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -191472,19 +191946,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20074, libc.VaList(bp+232, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20207, 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+20080) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20213) j++ } if int32((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20092) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20225) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+6481, 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 { @@ -191499,7 +191973,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+4711, 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 @@ -191680,7 +192154,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+4711, 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) } @@ -191692,13 +192166,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+20107) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20240) if *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20115, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20248, 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+20119, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20252, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -191707,7 +192181,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+4711, 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) @@ -191833,24 +192307,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+20153, 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+20286, 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(143745)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*4)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*4)) } else { - v1 = __ccgo_ts + 6483 + v1 = __ccgo_ts + 6570 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+20181, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+20314, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*int8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+20212, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+20345, 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(143752)) } } } @@ -191858,9 +192332,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 20123, - 1: __ccgo_ts + 20130, - 2: __ccgo_ts + 20142, + 0: __ccgo_ts + 20256, + 1: __ccgo_ts + 20263, + 2: __ccgo_ts + 20275, } // C documentation @@ -191936,7 +192410,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+15986) + _corruptSchema(tls, pData, argv, __ccgo_ts+16072) } } libc.SetBitFieldPtr8Uint32(db+172+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -191969,11 +192443,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+20220) + _corruptSchema(tls, pData, argv, __ccgo_ts+20353) } 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+15986) + _corruptSchema(tls, pData, argv, __ccgo_ts+16072) } } } @@ -192012,18 +192486,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 + 10555 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 10641 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 7969 + v2 = __ccgo_ts + 8055 } else { - v2 = __ccgo_ts + 7457 + 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 + 9627 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 20233 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 9713 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 20366 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 44))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 44))).FiDb = iDb @@ -192107,7 +192581,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+13592) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+13678) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -192133,7 +192607,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+20305) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+20438) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -192148,7 +192622,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+20329, libc.VaList(bp+80, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+20462, 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)) @@ -192477,8 +192951,8 @@ 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 @@ -192506,8 +192980,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 @@ -192566,7 +193040,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+20363, libc.VaList(bp+296, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+20496, libc.VaList(bp+296, zDb)) goto end_prepare } } @@ -192582,7 +193056,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+20393, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+20526, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -192605,10 +193079,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 { @@ -192616,7 +193090,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+4711, 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) @@ -192646,7 +193120,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(144552)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -192780,7 +193254,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(144701)) } /* 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 @@ -193040,7 +193514,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) @@ -193048,7 +193522,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 @@ -193204,15 +193678,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 + 12699 - zSp2 = __ccgo_ts + 12699 + zSp1 = __ccgo_ts + 12785 + zSp2 = __ccgo_ts + 12785 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20412, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20545, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -193269,25 +193743,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) } @@ -193419,13 +193896,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 { @@ -193503,7 +193980,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+20442, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20575, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -193553,12 +194030,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+20492, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20625, 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. @@ -193573,9 +194050,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+20556, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20689, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -193585,6 +194063,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) @@ -193619,7 +194104,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 8166, + Fz: __ccgo_ts + 8252, Fn: uint32(8), } @@ -193667,7 +194152,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 @@ -193712,7 +194197,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) @@ -193736,7 +194221,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) @@ -193757,7 +194242,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 @@ -193880,7 +194365,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 { @@ -194007,10 +194492,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 @@ -194018,7 +194503,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 @@ -194195,7 +194680,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+20593, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20726, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -194306,8 +194791,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) @@ -194315,7 +194800,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) } @@ -194400,13 +194885,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 20613 + z = __ccgo_ts + 20746 case int32(TK_INTERSECT): - z = __ccgo_ts + 20623 + z = __ccgo_ts + 20756 case int32(TK_EXCEPT): - z = __ccgo_ts + 20633 + z = __ccgo_ts + 20766 default: - z = __ccgo_ts + 20640 + z = __ccgo_ts + 20773 break } return z @@ -194427,7 +194912,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+20646, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20779, libc.VaList(bp+8, zUsage)) } /* @@ -194464,13 +194949,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 + 20669 + v1 = __ccgo_ts + 20802 } else { v1 = __ccgo_ts + 1674 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20683, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20816, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20714, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20847, 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) @@ -194494,11 +194979,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 @@ -194714,7 +195199,7 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr } if iCol < 0 { zType = __ccgo_ts + 1148 - *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 18162 + *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 18295 } 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)) @@ -194827,7 +195312,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 */ @@ -194836,7 +195321,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) @@ -194860,13 +195345,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 18162 + zCol = __ccgo_ts + 18295 } 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+13878, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+13964, 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))) @@ -194874,7 +195359,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+20760, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+20893, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -194966,7 +195451,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 + 18162 + v3 = __ccgo_ts + 18295 } zName = v3 } else { @@ -194981,7 +195466,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+20760, libc.VaList(bp+32, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+20893, 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. @@ -195017,7 +195502,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+20769, libc.VaList(bp+32, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+20902, libc.VaList(bp+32, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -195136,7 +195621,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 + 20777 + zType = __ccgo_ts + 20910 } else { zType = uintptr(0) j = int32(1) @@ -195202,7 +195687,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) } @@ -195230,7 +195715,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) } @@ -195280,7 +195765,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 @@ -195303,7 +195788,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 @@ -195451,7 +195936,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+20781, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20914, 0) return } /* Obtain authorization to do a recursive query */ @@ -195488,7 +195973,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 @@ -195499,7 +195984,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 @@ -195513,7 +195998,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 @@ -195544,7 +196029,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+20830, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20963, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -195559,7 +196044,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+20872, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21005, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -195587,7 +196072,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+20878, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21011, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -195642,9 +196127,9 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) if nRow == int32(1) { v1 = __ccgo_ts + 1674 } else { - v1 = __ccgo_ts + 20893 + v1 = __ccgo_ts + 21026 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20895, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21028, 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) { @@ -195752,8 +196237,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+20918, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20933, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21051, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21066, 0) } /* Generate code for the left and right SELECT statements. */ @@ -195778,7 +196263,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+20613, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20746, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -195804,7 +196289,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 @@ -195830,7 +196315,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+20952, libc.VaList(bp+96, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21085, 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 @@ -195862,11 +196347,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 @@ -195888,7 +196373,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+20952, libc.VaList(bp+96, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21085, 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 @@ -195995,6 +196480,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) } @@ -196011,9 +196497,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+20973, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21106, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21019, libc.VaList(bp+8, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21152, libc.VaList(bp+8, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -196084,7 +196570,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+20593, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20726, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -196332,7 +196818,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 { @@ -196386,16 +196872,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+8864) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+8864) + _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 @@ -196413,32 +196899,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+21101, libc.VaList(bp+64, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21234, 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+21112, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21245, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -196451,7 +196937,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+21117, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21250, 0) _sqlite3Select(tls, pParse, p, bp+28) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -196661,11 +197147,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 + 6461 + 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))) } @@ -196826,7 +197312,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 @@ -197016,9 +197502,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. @@ -197230,7 +197716,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) @@ -197377,7 +197863,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) @@ -197667,7 +198153,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++ @@ -197736,7 +198222,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 @@ -197754,12 +198240,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 { @@ -198241,7 +198727,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 @@ -198287,13 +198773,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+17020) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+17133) == 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+17024) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+17137) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -198381,8 +198867,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+21123, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21256, 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 @@ -198406,7 +198892,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 @@ -198488,7 +198974,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) @@ -198506,7 +198992,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+21141, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21274, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -198654,7 +199140,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) } @@ -198682,7 +199168,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+21164, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 32)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21297, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 32)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+12+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -198704,12 +199190,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+21184, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21317, 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 @@ -198726,7 +199212,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21227 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21360 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 { @@ -198757,7 +199243,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+21250, 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+21383, 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) } @@ -198766,9 +199252,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 + 21288 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21421 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21322 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21455 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -198817,7 +199303,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) { @@ -198827,7 +199313,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+21360, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+21493, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -198923,7 +199409,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) @@ -198932,7 +199418,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) } @@ -198983,7 +199469,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+21364, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21497, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -198998,7 +199484,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+21403, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21536, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -199013,7 +199499,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+16579, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16665, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -199137,7 +199623,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 + 8026 + v10 = __ccgo_ts + 8112 } zSchemaName = v10 } @@ -199154,7 +199640,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+21434, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+21567, 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) } @@ -199233,7 +199719,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+21439, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+21572, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -199246,7 +199732,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+13878, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+13964, 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) @@ -199266,9 +199752,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21448, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21581, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21466, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21599, 0) } } } @@ -199282,7 +199768,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+21486, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21619, 0) return int32(WRC_Abort) } if elistFlags&uint32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -199531,7 +200017,7 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint (*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))) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^uint32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -199584,7 +200070,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 @@ -199621,12 +200107,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+21517, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21650, 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+21568, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21701, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -199647,7 +200133,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+21601, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21734, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -199786,7 +200272,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 @@ -199894,7 +200380,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 @@ -199961,7 +200447,7 @@ 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 + 21634 + v1 = __ccgo_ts + 21767 } else { v1 = __ccgo_ts + 1674 } @@ -199970,7 +200456,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp } else { v2 = __ccgo_ts + 1674 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21657, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21790, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -200002,7 +200488,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+9627) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+9713) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -200131,6 +200617,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. // */ @@ -200159,7 +200646,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+17314) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+17447) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != uintptr(0) { @@ -200192,9 +200679,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 */ } @@ -200204,13 +200691,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 { @@ -200230,7 +200717,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) } @@ -200403,8 +200890,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 @@ -200413,11 +200900,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 { @@ -200433,7 +200920,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)) @@ -200457,14 +200944,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+21669, libc.VaList(bp+128, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21802, 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) @@ -200565,7 +201052,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+21723, 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+21856, 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 @@ -200743,7 +201230,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 @@ -200766,14 +201253,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+21763, libc.VaList(bp+128, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21896, 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) @@ -200805,7 +201292,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 @@ -200820,7 +201307,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+21778, libc.VaList(bp+128, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21911, 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 { @@ -200842,7 +201329,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: @@ -200874,7 +201361,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 @@ -200907,7 +201394,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 @@ -200966,7 +201453,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 @@ -200995,6 +201482,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)) @@ -201017,10 +201511,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) @@ -201054,8 +201548,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 @@ -201070,8 +201564,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 @@ -201100,8 +201594,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++ } @@ -201131,11 +201625,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 = uint16(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+84, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+84, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy) @@ -201169,47 +201663,47 @@ 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)) /* Begin a loop that will extract all source rows in GROUP BY order. @@ -201219,16 +201713,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 @@ -201246,11 +201740,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 + 21794 + v47 = __ccgo_ts + 21927 } else { - v46 = __ccgo_ts + 21803 + v47 = __ccgo_ts + 21936 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20646, libc.VaList(bp+128, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20779, libc.VaList(bp+128, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -201264,8 +201758,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -201283,8 +201777,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -201295,12 +201789,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) @@ -201349,12 +201843,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++ } @@ -201424,9 +201922,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 @@ -201443,10 +201941,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 */ @@ -201473,8 +201971,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 } @@ -201514,32 +202012,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) @@ -201581,7 +202079,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+21794) + _explainTempTable(tls, pParse, __ccgo_ts+21927) } /* 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 @@ -201687,7 +202185,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+4711, 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 } @@ -201703,7 +202201,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+21812, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+21945, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -201793,7 +202291,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+4711, 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) } @@ -201955,7 +202453,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+21877, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22010, 0) goto trigger_cleanup } iDb = int32(1) @@ -201995,7 +202493,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+21923, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+4, pParse, iDb, __ccgo_ts+22056, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+4, pTableName) != 0 { goto trigger_cleanup } @@ -202005,11 +202503,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+21931, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22064, 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+21972, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22105, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -202018,13 +202516,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+21923, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+22056, (*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+22012, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22145, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -202032,8 +202530,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+7961, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22038, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+8047, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22171, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -202041,15 +202539,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 + 22076 + v1 = __ccgo_ts + 22209 } else { - v1 = __ccgo_ts + 22083 + v1 = __ccgo_ts + 22216 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22089, libc.VaList(bp+64, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22222, 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+22126, libc.VaList(bp+64, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22259, libc.VaList(bp+64, pTableName+8)) goto trigger_orphan_error } if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -202069,9 +202567,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 + 7969 + v3 = __ccgo_ts + 8055 } else { - v3 = __ccgo_ts + 7457 + v3 = __ccgo_ts + 7542 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -202171,7 +202669,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+21923, bp+56) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+22056, 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 } @@ -202193,7 +202691,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+22172, libc.VaList(bp+72, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22305, libc.VaList(bp+72, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -202209,10 +202707,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+22220, 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+22353, 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+22295, libc.VaList(bp+72, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+22428, libc.VaList(bp+72, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -202480,11 +202978,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22324, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22457, 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) @@ -202522,9 +203020,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 + 7969 + v1 = __ccgo_ts + 8055 } else { - v1 = __ccgo_ts + 7457 + v1 = __ccgo_ts + 7542 } zTab = v1 if iDb == int32(1) { @@ -202539,7 +203037,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+22344, 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+22477, 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) } @@ -202672,11 +203170,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 + 22406 + v1 = __ccgo_ts + 22539 } else { - v1 = __ccgo_ts + 22413 + v1 = __ccgo_ts + 22546 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22420, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22553, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -202778,7 +203276,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+22468, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22601, 0) return int32(1) } @@ -202926,12 +203424,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) { @@ -202939,19 +203437,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) @@ -202959,24 +203460,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 { @@ -203044,7 +203545,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+7654, 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): @@ -203095,8 +203596,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 @@ -203143,10 +203644,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+22510, libc.VaList(bp+336, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+22643, 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 @@ -203168,7 +203671,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 @@ -203240,7 +203743,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)) @@ -203656,13 +204159,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 @@ -203670,21 +204173,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 */ @@ -203731,7 +204234,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 @@ -203814,58 +204317,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+22524, 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+22657, 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+22560, 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+22693, 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 + 9402 + 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 { @@ -203895,17 +204386,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++ } @@ -203917,11 +204408,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 @@ -203937,11 +204428,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 @@ -203950,18 +204441,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++ } @@ -203970,16 +204461,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. */ @@ -203997,24 +204488,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 { @@ -204040,50 +204531,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) @@ -204381,8 +204872,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -204432,8 +204923,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++ @@ -204480,11 +204971,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)) } @@ -204496,11 +204987,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. */ @@ -204543,7 +205034,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+22579) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+22712) } goto update_cleanup update_cleanup: @@ -204600,13 +205091,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) { @@ -204648,11 +205139,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 @@ -204977,9 +205468,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+22592, libc.VaList(bp+168, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+140, __ccgo_ts+22725, libc.VaList(bp+168, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22596, libc.VaList(bp+168, bp+140)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22729, libc.VaList(bp+168, bp+140)) return int32(SQLITE_ERROR) } goto _1 @@ -205068,13 +205559,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: @@ -205082,7 +205573,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+13967, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+14053, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -205164,7 +205655,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+22669, uint32(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+22673, uint32(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+22802, uint32(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+22806, uint32(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -205255,7 +205746,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 @@ -205294,17 +205785,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+22677) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22810) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22717) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22850) 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+22760) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22893) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -205321,7 +205812,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+22809) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22942) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_VacuumInto) @@ -205374,7 +205865,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+16349) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+16435) if rc != SQLITE_OK { goto end_of_vacuum } @@ -205405,11 +205896,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+22836, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22969, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22944, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+23077, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -205418,7 +205909,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+22998, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+23131, 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 @@ -205428,7 +205919,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+23135, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+23268, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -205955,7 +206446,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+14197, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14283, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -206078,24 +206569,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+23258, libc.VaList(bp+8, pParse+204)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+23391, 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+23282, 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+23415, 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+23381, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+23514, 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 @@ -206136,7 +206632,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 @@ -206179,7 +206675,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+23400, libc.VaList(bp+32, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23533, libc.VaList(bp+32, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -206221,9 +206717,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+23442, libc.VaList(bp+32, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23575, libc.VaList(bp+32, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+4711, 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) @@ -206236,7 +206732,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 + 23472 + zFormat = __ccgo_ts + 23605 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+32, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -206270,7 +206766,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+18053, 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+18186, 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 @@ -206351,13 +206847,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+23518, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23651, 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+4711, 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))) @@ -206438,7 +206934,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+23518, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23651, 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) @@ -206462,13 +206958,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 @@ -206481,12 +206977,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+23537, 0) + if *(*int32)(unsafe.Pointer(bp + 284)) != int32(_aKeyword1[i]) { + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+23670, 0) return int32(SQLITE_ERROR) } goto _1 @@ -206497,9 +206993,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(158352))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158354)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -206541,11 +207037,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 + 4711 + 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) } @@ -206955,7 +207451,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 @@ -206997,7 +207493,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 } @@ -207017,7 +207513,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+4711, 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) } @@ -207081,7 +207577,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(158849)) } else { ap = va switch op { @@ -207094,7 +207590,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(158871)) break } _ = ap @@ -207813,7 +208309,6 @@ type TWhereInfo1 = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo1 = TWhereInfo1 @@ -207849,10 +208344,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 + 23550 + return __ccgo_ts + 23683 } if i == -int32(1) { - return __ccgo_ts + 18162 + return __ccgo_ts + 18295 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*12))).FzCnName } @@ -207871,10 +208366,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+23557, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23690, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+23563, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23696, int32(1)) } i = 0 for { @@ -207882,7 +208377,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+14587, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+14673, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -207891,11 +208386,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+6481, 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+23563, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23696, int32(1)) } i = 0 for { @@ -207903,16 +208398,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+14587, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+14673, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+6483, 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+6481, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+6568, int32(1)) } } @@ -207959,7 +208454,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+23565, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23698, int32(2)) i = 0 for { if !(i < int32(nEq)) { @@ -207967,12 +208462,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+23557, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23690, int32(5)) } if i >= int32(nSkip) { - v2 = __ccgo_ts + 23568 + v2 = __ccgo_ts + 23701 } else { - v2 = __ccgo_ts + 23573 + v2 = __ccgo_ts + 23706 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -207989,7 +208484,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+23581) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+23714) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -208000,9 +208495,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+23583) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+23716) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+6481, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+6568, int32(1)) } // C documentation @@ -208047,11 +208542,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 + 23585 + v2 = __ccgo_ts + 23718 } else { - v2 = __ccgo_ts + 23592 + v2 = __ccgo_ts + 23725 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23597, libc.VaList(bp+136, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23730, libc.VaList(bp+136, v2, pItem)) if flags&uint32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) pIdx = (*(*struct { @@ -208064,37 +208559,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 + 12750 + zFmt = __ccgo_ts + 12836 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 23603 + zFmt = __ccgo_ts + 23736 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 23636 + zFmt = __ccgo_ts + 23769 } else { if flags&uint32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 23661 + zFmt = __ccgo_ts + 23794 } else { - zFmt = __ccgo_ts + 23679 + zFmt = __ccgo_ts + 23812 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+23688, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+23821, 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 + 18162 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23696, libc.VaList(bp+136, zRowid)) + zRowid = __ccgo_ts + 18295 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23829, 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+23727, libc.VaList(bp+136, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23860, libc.VaList(bp+136, zRowid)) cRangeOp = int8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -208104,14 +208599,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23737, libc.VaList(bp+136, int32(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23870, libc.VaList(bp+136, int32(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+23742) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+23875) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 23764 + v3 = __ccgo_ts + 23897 } else { - v3 = __ccgo_ts + 23772 + v3 = __ccgo_ts + 23905 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+136, (*(*struct { FidxNum int32 @@ -208132,7 +208627,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+23778, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23911, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -208198,14 +208693,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+23789, libc.VaList(bp+136, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23922, 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+23568, 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+23701, 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+23810, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23943, 0) } } else { i = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -208229,16 +208724,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+23557, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+23690, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23568, libc.VaList(bp+136, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23701, libc.VaList(bp+136, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+6481, 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 @@ -208443,7 +208938,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 @@ -208522,7 +209017,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 */ @@ -208884,7 +209379,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 @@ -209297,7 +209792,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 @@ -209358,11 +209853,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 @@ -209393,6 +209888,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 { @@ -209531,7 +210029,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 @@ -209611,7 +210109,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 @@ -209645,7 +210143,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 @@ -209767,7 +210265,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 @@ -209960,7 +210458,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: @@ -209974,12 +210472,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 { @@ -210017,11 +210516,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 */ @@ -210041,7 +210540,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 } @@ -210077,21 +210576,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 @@ -210109,7 +210608,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, @@ -210164,7 +210663,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+23818, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23951, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -210187,7 +210686,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+23833, libc.VaList(bp+72, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23966, 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)) @@ -210676,9 +211175,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 @@ -210687,7 +211186,7 @@ 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+23842, libc.VaList(bp+64, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23975, libc.VaList(bp+64, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { @@ -210733,15 +211232,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 @@ -210753,7 +211253,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) { @@ -211224,19 +211724,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 18011, + FzOp: __ccgo_ts + 18144, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 17344, + FzOp: __ccgo_ts + 17477, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 16823, + FzOp: __ccgo_ts + 16936, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 23856, + FzOp: __ccgo_ts + 23989, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -212024,7 +212524,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+23863, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23996, 0) return } } else { @@ -212036,10 +212536,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+23863, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23996, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^uint32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -212120,7 +212620,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 + 9388 + *(*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) @@ -212221,7 +212721,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 + 23904 + v13 = __ccgo_ts + 24037 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -212752,7 +213252,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+23911, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24044, 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) @@ -212824,7 +213324,6 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo @@ -212835,7 +213334,6 @@ type THiddenIndexInfo1 = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo1 = THiddenIndexInfo1 @@ -213868,7 +214366,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)<>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 @@ -216485,7 +216979,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pNew + 24))).FnEq) < int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { + })(unsafe.Pointer(pNew + 24))).FnEq) < int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x400>>10)) != 0)) { if int32((*(*struct { FnEq Tu16 FnBtm Tu16 @@ -216689,7 +217183,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 @@ -216973,7 +217467,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) } } @@ -217151,7 +217645,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)) @@ -217492,7 +217986,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+23984, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24117, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -217567,7 +218061,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+23984, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24117, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -217721,7 +218215,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(168893)) /* 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) @@ -218157,7 +218651,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+24010, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+24143, 0) rc = SQLITE_OK } else { break @@ -219365,7 +219859,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24045, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24178, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -219943,7 +220437,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 @@ -220099,7 +220593,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+24063, libc.VaList(bp+40, int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24196, 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 @@ -220120,10 +220614,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) @@ -220172,7 +220663,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+24091, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+24224, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -220317,7 +220808,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 @@ -220351,7 +220843,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. @@ -220477,7 +220969,7 @@ 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 @@ -220508,16 +221000,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 @@ -220696,7 +221188,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 { @@ -220903,7 +221395,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 @@ -220913,7 +221405,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+24109, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24242, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -220963,7 +221455,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 } @@ -221235,7 +221727,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+24138, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24271, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -221418,7 +221910,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+24194, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24327, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -221744,7 +222236,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+24239, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24372, libc.VaList(bp+8, zName)) } return p } @@ -221795,12 +222287,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+24258, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24391, 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+24329, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24462, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -221873,7 +222365,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+9627) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+9713) } break } @@ -222011,7 +222503,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( 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 { @@ -222155,7 +222647,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+24392, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+24525, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -222191,7 +222683,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)) } @@ -222206,7 +222698,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 @@ -222225,11 +222717,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 { @@ -222275,11 +222767,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 @@ -222296,7 +222788,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+1794)) + *(*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)) @@ -222318,7 +222810,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 @@ -222442,7 +222934,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+24418, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24551, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(100)) @@ -222510,18 +223002,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 + 24450 + zErr = __ccgo_ts + 24583 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 24467 + zErr = __ccgo_ts + 24600 } else { if int32((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 24483 + zErr = __ccgo_ts + 24616 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24503, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24636, 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 { @@ -222545,7 +223037,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+24536, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24669, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -222651,24 +223143,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 @@ -222686,12 +223178,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) } @@ -222703,15 +223195,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 @@ -222763,11 +223255,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 24583, - 1: __ccgo_ts + 24636, - 2: __ccgo_ts + 24138, - 3: __ccgo_ts + 24687, - 4: __ccgo_ts + 24739, + 0: __ccgo_ts + 24716, + 1: __ccgo_ts + 24769, + 2: __ccgo_ts + 24271, + 3: __ccgo_ts + 24820, + 4: __ccgo_ts + 24872, } var _aOp1 = [5]int32{ @@ -223347,7 +223839,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 } @@ -223443,7 +223935,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 '' */ @@ -224160,12 +224652,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 @@ -224173,13 +224665,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 @@ -224199,13 +224691,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 @@ -224232,7 +224724,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 @@ -224451,6 +224943,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. @@ -224511,7 +225007,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+24789, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24922, libc.VaList(bp+8, p)) } // C documentation @@ -224525,6 +225021,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) } @@ -224558,11 +225055,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 + 24813 + v1 = __ccgo_ts + 24946 } else { - v1 = __ccgo_ts + 24822 + v1 = __ccgo_ts + 24955 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24828, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24961, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -224571,7 +225068,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24870, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25003, 0) } } } @@ -224677,7 +225174,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+24904, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25037, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -233134,20 +233631,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+18162, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+18295, 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+24942, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25075, 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+18075, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+18231, 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+24942, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25075, 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 @@ -233188,7 +233685,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 */ @@ -233333,7 +233835,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 */ @@ -233423,9 +233930,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) } @@ -233780,7 +234287,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+24969) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), __ccgo_ts+25102) 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) { @@ -234130,9 +234637,9 @@ _237: */ _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 + 9383 + v347 = __ccgo_ts + 9469 } else { - v347 = __ccgo_ts + 9388 + v347 = __ccgo_ts + 9474 } *(*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 { @@ -234374,15 +234881,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+24978, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25111, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25073, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25206, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25157, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25290, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -234524,7 +235031,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 */ @@ -234718,7 +235225,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+25242, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25375, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -237449,14 +237956,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)< int32(65528) { sz = int32(65528) } - if cnt < 0 { + /* 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 > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } szAlloc = int64(sz) * int64(cnt) - if sz == 0 || cnt == 0 { + 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)) @@ -238932,7 +239448,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182779)) + return _sqlite3MisuseError(tls, int32(183820)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if int32((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -238952,7 +239468,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+25329, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+25462, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -239253,14 +239769,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 + 25872 + zErr = __ccgo_ts + 26005 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < int32(libc.Uint32FromInt64(116)/libc.Uint32FromInt64(4)) && _aMsg[rc] != uintptr(0) { @@ -239272,31 +239788,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 25397, - 1: __ccgo_ts + 25410, - 3: __ccgo_ts + 25426, - 4: __ccgo_ts + 25451, - 5: __ccgo_ts + 25465, - 6: __ccgo_ts + 25484, + 0: __ccgo_ts + 25530, + 1: __ccgo_ts + 25543, + 3: __ccgo_ts + 25559, + 4: __ccgo_ts + 25584, + 5: __ccgo_ts + 25598, + 6: __ccgo_ts + 25617, 7: __ccgo_ts + 1644, - 8: __ccgo_ts + 25509, - 9: __ccgo_ts + 25546, - 10: __ccgo_ts + 25558, - 11: __ccgo_ts + 25573, - 12: __ccgo_ts + 25606, - 13: __ccgo_ts + 25624, - 14: __ccgo_ts + 25649, - 15: __ccgo_ts + 25678, - 17: __ccgo_ts + 7412, - 18: __ccgo_ts + 6814, - 19: __ccgo_ts + 25695, - 20: __ccgo_ts + 25713, - 21: __ccgo_ts + 25731, - 23: __ccgo_ts + 25765, - 25: __ccgo_ts + 25786, - 26: __ccgo_ts + 25812, - 27: __ccgo_ts + 25835, - 28: __ccgo_ts + 25856, + 8: __ccgo_ts + 25642, + 9: __ccgo_ts + 25679, + 10: __ccgo_ts + 25691, + 11: __ccgo_ts + 25706, + 12: __ccgo_ts + 25739, + 13: __ccgo_ts + 25757, + 14: __ccgo_ts + 25782, + 15: __ccgo_ts + 25811, + 17: __ccgo_ts + 7497, + 18: __ccgo_ts + 6901, + 19: __ccgo_ts + 25828, + 20: __ccgo_ts + 25846, + 21: __ccgo_ts + 25864, + 23: __ccgo_ts + 25898, + 25: __ccgo_ts + 25919, + 26: __ccgo_ts + 25945, + 27: __ccgo_ts + 25968, + 28: __ccgo_ts + 25989, } // C documentation @@ -239443,6 +239959,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 // // /* @@ -239475,7 +240005,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i 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(183430)) + return _sqlite3MisuseError(tls, int32(184509)) } 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) @@ -239518,7 +240048,7 @@ 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+25953, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+26086, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -239644,7 +240174,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+26016, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+26149, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -239675,7 +240205,7 @@ 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+4711, 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) } @@ -239919,7 +240449,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(184046)) + return _sqlite3MisuseError(tls, int32(185125)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -239929,7 +240459,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+26067, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+26200, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -240051,7 +240581,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(184182))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185261))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -240183,7 +240713,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(184261)) + return _sqlite3MisuseError(tls, int32(185340)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -240193,7 +240723,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(184270)) + return _sqlite3MisuseError(tls, int32(185349)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -240242,7 +240772,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(184318)) + return _sqlite3MisuseError(tls, int32(185397)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -240251,7 +240781,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+26088, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+26221, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -240398,7 +240928,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+26156, 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+26289, 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 @@ -240428,8 +240958,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+26162, zUri+7, uint32(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26172, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+26295, zUri+7, uint32(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26305, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -240518,24 +241048,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+26200, zOpt, uint32(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+26333, 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+26204, zOpt, uint32(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+26337, 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 + 26204 + zModeType = __ccgo_ts + 26337 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+26225, zOpt, uint32(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+26358, 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 + 26240 + zModeType = __ccgo_ts + 26373 } if aMode != 0 { mode = 0 @@ -240564,12 +241094,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+26247, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26380, 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+26267, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26400, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -240593,7 +241123,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+26291, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26424, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -240613,11 +241143,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 26210, + Fz: __ccgo_ts + 26343, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 26217, + Fz: __ccgo_ts + 26350, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -240628,19 +241158,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 26230, + Fz: __ccgo_ts + 26363, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 26233, + Fz: __ccgo_ts + 26366, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 26236, + Fz: __ccgo_ts + 26369, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 19243, + Fz: __ccgo_ts + 19376, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -240768,8 +241298,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+23904, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+26307, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+24037, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+26440, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -240790,10 +241320,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(184993)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186072)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 5565 + zFilename = __ccgo_ts + 5652 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+4, bp+8) } @@ -240802,7 +241332,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 + 4711 + v2 = __ccgo_ts + 4829 } else { v2 = uintptr(0) } @@ -240829,9 +241359,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 + 8021 + (*(*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 + 25302 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FzDbSName = __ccgo_ts + 25435 (*(*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 { @@ -240925,7 +241455,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 26313 + zFilename = __ccgo_ts + 26446 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -241085,7 +241615,7 @@ 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) @@ -241142,20 +241672,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+26316, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+26449, 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+26341) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+26474) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+26361) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+26494) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+26368) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+26501) } // C documentation @@ -241180,9 +241710,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) @@ -241209,29 +241739,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 @@ -241286,15 +241805,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+26385, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+26518, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 4711 + 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) @@ -241473,8 +241992,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 @@ -242314,7 +242833,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+26413, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+26546, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -242532,7 +243051,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 26421 + v2 = __ccgo_ts + 26554 } else { v2 = uintptr(0) } @@ -242778,7 +243297,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 @@ -242995,6 +243514,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -243307,8 +243833,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 @@ -243365,7 +243891,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 @@ -243375,7 +243901,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 @@ -243413,18 +243939,18 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // */ var _jsonbType = [17]uintptr{ 0: __ccgo_ts + 1660, - 1: __ccgo_ts + 9383, - 2: __ccgo_ts + 9388, - 3: __ccgo_ts + 7697, - 4: __ccgo_ts + 7697, - 5: __ccgo_ts + 7692, - 6: __ccgo_ts + 7692, - 7: __ccgo_ts + 9694, - 8: __ccgo_ts + 9694, - 9: __ccgo_ts + 9694, - 10: __ccgo_ts + 9694, - 11: __ccgo_ts + 26444, - 12: __ccgo_ts + 26450, + 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 + 26577, + 12: __ccgo_ts + 26583, 13: __ccgo_ts + 1674, 14: __ccgo_ts + 1674, 15: __ccgo_ts + 1674, @@ -243915,7 +244441,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) { @@ -244213,8 +244739,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 + 26457 + 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 + 26457 + 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) } } @@ -244350,7 +244876,7 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { case int32(SQLITE_NULL): _jsonAppendRawNZ(tls, p, __ccgo_ts+1660, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+16793, libc.VaList(bp+64, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+16879, 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)) @@ -244364,14 +244890,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+26474, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+26590, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -244425,7 +244949,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+26503, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+26619, -int32(1)) } } } @@ -244708,8 +245232,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(3), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 26518, - FzRepl: __ccgo_ts + 26522, + FzMatch: __ccgo_ts + 26634, + FzRepl: __ccgo_ts + 26638, }, 1: { Fc1: int8('i'), @@ -244717,8 +245241,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(8), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 26530, - FzRepl: __ccgo_ts + 26522, + FzMatch: __ccgo_ts + 26646, + FzRepl: __ccgo_ts + 26638, }, 2: { Fc1: int8('n'), @@ -244733,7 +245257,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 26539, + FzMatch: __ccgo_ts + 26655, FzRepl: __ccgo_ts + 1660, }, 4: { @@ -244741,7 +245265,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 26544, + FzMatch: __ccgo_ts + 26660, FzRepl: __ccgo_ts + 1660, }, } @@ -244757,7 +245281,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26549, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26665, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -244775,23 +245299,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 } @@ -244869,7 +245393,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 @@ -244940,7 +245464,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) + } } } } @@ -245215,7 +245743,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+26592, int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+26708, 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') { @@ -245645,7 +246173,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 { @@ -245684,7 +246212,7 @@ parse_string: return int32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+9383, 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)) } @@ -245692,7 +246220,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+9388, 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)) } @@ -245769,14 +246297,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+26518, 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+26634, 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+26601) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+26717) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26608) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26724) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+26614, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+26730, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -245961,7 +246489,7 @@ _38: goto _51 } if int32(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26608) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26724) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -246006,7 +246534,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+26503, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26619, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -246019,7 +246547,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+26503, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26619, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -246068,10 +246596,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) @@ -246105,15 +246629,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 @@ -246186,11 +246710,11 @@ _2: return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+9383, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+9469, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+9388, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+9474, uint32(5)) return i + uint32(1) _6: ; @@ -246239,9 +246763,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 26522 + v19 = __ccgo_ts + 26638 } else { - v19 = __ccgo_ts + 13250 + v19 = __ccgo_ts + 13336 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -246277,9 +246801,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: ; @@ -246306,7 +246833,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26620, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26736, uint32(2)) zIn2++ sz2-- continue @@ -246329,7 +246856,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26623, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26739, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 25 @@ -246337,12 +246864,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26630, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26746, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26635, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26751, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -246522,7 +247049,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26642, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26758, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -246545,12 +247072,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+26645, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26761, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26642, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26758, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -246565,50 +247092,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 // // /* @@ -246660,6 +247143,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 // // /* @@ -246680,6 +247241,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)) @@ -246752,9 +247316,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 @@ -246797,7 +247361,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 @@ -247285,7 +247860,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+26503, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26619, -int32(1)) return } switch int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -247420,7 +247995,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 } @@ -247521,7 +248096,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26503, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26619, -int32(1)) return } @@ -247558,11 +248133,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+26474, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26590, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -247575,7 +248147,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+26503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint32(56)) return int32(1) @@ -247594,10 +248166,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+26608) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26724) } 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+26601) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+26717) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(n), z) } @@ -247636,7 +248208,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+26648, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26764, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -247652,7 +248224,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. // ** @@ -247733,7 +248305,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -247745,34 +248317,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; +// ** 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. +// ** 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) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { + return 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) - return 0 + 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 (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + if v4 = v2 && int32(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - 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 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) @@ -247855,7 +248447,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 @@ -247915,7 +248507,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -248050,7 +248642,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 + 26666 + v1 = __ccgo_ts + 26782 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -248060,7 +248652,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+26503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) } } eErr = uint8(1) @@ -248170,23 +248762,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+26668, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+26784, uint32(1)) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+26670, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+26786, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+6536, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+6623, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1687, 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+26672, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+26788, uint32(2)) _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+26675, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+26791, uint32(1)) } } } @@ -248226,7 +248818,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+26503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -248494,7 +249086,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+26503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -248518,7 +249110,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+26677, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26793, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -248529,7 +249121,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+26728, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26844, -int32(1)) _jsonStringReset(tls, bp) return } @@ -248601,7 +249193,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+26503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) } } goto json_remove_done @@ -248638,7 +249230,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+17266) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+17399) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -248669,9 +249261,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 26762 + v1 = __ccgo_ts + 26878 } else { - v1 = __ccgo_ts + 26766 + v1 = __ccgo_ts + 26882 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -248719,7 +249311,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+26503, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) } } goto json_type_done @@ -248766,7 +249358,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 + 26773 + (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent = __ccgo_ts + 26889 (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FszIndent = libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent) @@ -248840,17 +249432,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+26778, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26894, -int32(1)) return } flags = uint8(f & int64(0x0f)) @@ -248859,18 +249450,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 @@ -248932,9 +249522,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))) @@ -249041,7 +249629,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+26835, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+26951, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -249133,20 +249721,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))) + } } } @@ -249190,7 +249780,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+26838, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+26954, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -249297,7 +249887,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+26841) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+26957) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(16)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -249431,7 +250021,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+26924, 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+27040, 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 @@ -249457,9 +250047,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+40, __ccgo_ts+26931, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+40, __ccgo_ts+27047, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+40, __ccgo_ts+26939, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+40, __ccgo_ts+27055, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -249770,9 +250360,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))) @@ -249845,7 +250434,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+26945, uint32(1)) + _jsonAppendRaw(tls, p+40, __ccgo_ts+27061, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+168, i, bp) @@ -249869,7 +250458,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+26503, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26619, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -249930,186 +250519,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 + 26947, + FzName: __ccgo_ts + 27063, }, 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 + 26952, + FzName: __ccgo_ts + 27068, }, 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 + 26958, + FzName: __ccgo_ts + 27074, }, 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 + 26969, + FzName: __ccgo_ts + 27085, }, 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 + 26981, + FzName: __ccgo_ts + 27097, }, 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 + 26981, + FzName: __ccgo_ts + 27097, }, 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 + 26999, + FzName: __ccgo_ts + 27115, }, 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 + 27019, + FzName: __ccgo_ts + 27135, }, 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 + 27032, + FzName: __ccgo_ts + 27148, }, 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 + 27046, + FzName: __ccgo_ts + 27162, }, 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 + 27049, + FzName: __ccgo_ts + 27165, }, 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 + 27053, + FzName: __ccgo_ts + 27169, }, 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 + 27065, + FzName: __ccgo_ts + 27181, }, 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 + 27078, + FzName: __ccgo_ts + 27194, }, 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 + 27090, + FzName: __ccgo_ts + 27206, }, 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 + 27103, + FzName: __ccgo_ts + 27219, }, 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 + 27114, + FzName: __ccgo_ts + 27230, }, 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 + 27126, + FzName: __ccgo_ts + 27242, }, 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 + 27126, + FzName: __ccgo_ts + 27242, }, 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 + 27138, + FzName: __ccgo_ts + 27254, }, 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 + 27149, + FzName: __ccgo_ts + 27265, }, 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 + 27161, + FzName: __ccgo_ts + 27277, }, 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 + 27174, + FzName: __ccgo_ts + 27290, }, 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 + 27187, + FzName: __ccgo_ts + 27303, }, 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 + 27201, + FzName: __ccgo_ts + 27317, }, 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 + 27210, + FzName: __ccgo_ts + 27326, }, 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 + 27220, + FzName: __ccgo_ts + 27336, }, 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 + 27220, + FzName: __ccgo_ts + 27336, }, 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 + 27230, + FzName: __ccgo_ts + 27346, }, 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 + 27230, + FzName: __ccgo_ts + 27346, }, 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 + 27241, + FzName: __ccgo_ts + 27357, }, 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 + 27258, + FzName: __ccgo_ts + 27374, }, 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 + 27276, + FzName: __ccgo_ts + 27392, }, 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 + 27294, + FzName: __ccgo_ts + 27410, }, } @@ -250192,17 +250781,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 27313, + FzName: __ccgo_ts + 27429, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 27323, + FzName: __ccgo_ts + 27439, 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 @@ -250315,13 +250906,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 @@ -250613,17 +251203,18 @@ type RtreeGeomCallback1 = TRtreeGeomCallback1 ** 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 + F__ccgo_align [0]uint32 + FiSize Tu32 + Fcb TRtreeGeomCallback + FnParam int32 + FapSqlParam uintptr + F__ccgo_pad5 [4]byte } 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 ** clang, since clang works hard to be gcc compatible. So the gcc @@ -250868,7 +251459,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+27333, 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+27449, iNode, 0, pRtree+72) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -251173,7 +251764,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+27338, 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+27454, 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 { @@ -252090,7 +252681,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+27420) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+27536) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -252399,7 +252990,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 } @@ -252407,7 +252998,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 @@ -252645,7 +253236,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: @@ -253580,7 +254171,7 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -253597,7 +254188,7 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { } else { v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -253625,7 +254216,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+27434, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27550, 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 { @@ -253635,11 +254226,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+27454, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+27570, 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+27486, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+27602, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -253853,7 +254444,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+27523, 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+27639, 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)) @@ -253907,9 +254498,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 + 27668 + zFmt = __ccgo_ts + 27784 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+13079, 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+13165, 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) { @@ -253967,9 +254558,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 27724, - 1: __ccgo_ts + 6875, - 2: __ccgo_ts + 18162, + 0: __ccgo_ts + 27840, + 1: __ccgo_ts + 6962, + 2: __ccgo_ts + 18295, } var _rtreeModule = Tsqlite3_module{ @@ -254013,21 +254604,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+28138, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28254, 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+28200, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28316, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+28205, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+28269, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+28339, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28321, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28385, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28455, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -254057,7 +254648,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 + 28388 + zFormat = __ccgo_ts + 28504 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -254072,31 +254663,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+28496, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+28612, 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+28541, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28657, 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+14587, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+14673, int32(1)) } if ii1 < int32((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28568, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28684, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28590, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28706, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28598, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28714, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -254110,14 +254701,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 27729, - 1: __ccgo_ts + 27782, - 2: __ccgo_ts + 27827, - 3: __ccgo_ts + 27879, - 4: __ccgo_ts + 27933, - 5: __ccgo_ts + 27978, - 6: __ccgo_ts + 28036, - 7: __ccgo_ts + 28091, + 0: __ccgo_ts + 27845, + 1: __ccgo_ts + 27898, + 2: __ccgo_ts + 27943, + 3: __ccgo_ts + 27995, + 4: __ccgo_ts + 28049, + 5: __ccgo_ts + 28094, + 6: __ccgo_ts + 28152, + 7: __ccgo_ts + 28207, } // C documentation @@ -254175,7 +254766,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+28614, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+28730, 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) @@ -254183,17 +254774,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+4711, 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+28634, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+28750, 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+4711, 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+4711, 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))) @@ -254270,13 +254861,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+28877, uint32(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+28993, 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+28883, 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+28999, 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) { @@ -254285,7 +254876,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+28907, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29023, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if int32((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -254299,19 +254890,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28934, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29050, 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+4711, 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+4711, 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))) } } } @@ -254334,7 +254925,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+4711, 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)) @@ -254345,7 +254936,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+4711, 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 @@ -254361,8 +254952,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 28913, - 1: __ccgo_ts + 28924, + 0: __ccgo_ts + 29029, + 1: __ccgo_ts + 29040, } // C documentation @@ -254420,21 +255011,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+12699, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+12785, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+28937, libc.VaList(bp+592, (*(*TRtreeCell)(unsafe.Pointer(bp + 536))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+29053, 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+28943, libc.VaList(bp+592, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 536 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+29059, 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+28947, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+29063, int32(1)) goto _1 _1: ; @@ -254461,7 +255052,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+28949, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+29065, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -254564,7 +255155,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) @@ -254579,11 +255170,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 + 5578 + v1 = __ccgo_ts + 5665 } else { v1 = __ccgo_ts + 1674 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+28982, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+29098, 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) } @@ -254617,7 +255208,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+28989, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+29105, 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) @@ -254634,7 +255225,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+29034, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29150, libc.VaList(bp+8, iNode)) } } return pRet @@ -254663,8 +255254,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 + 29066, - 1: __ccgo_ts + 29120, + 0: __ccgo_ts + 29182, + 1: __ccgo_ts + 29236, } 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)) @@ -254677,21 +255268,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 + 29168 + v1 = __ccgo_ts + 29284 } else { - v1 = __ccgo_ts + 29176 + v1 = __ccgo_ts + 29292 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29185, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29301, 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 + 29168 + v2 = __ccgo_ts + 29284 } else { - v2 = __ccgo_ts + 29176 + v2 = __ccgo_ts + 29292 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29230, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29346, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -254736,7 +255327,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+29288, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29404, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -254754,7 +255345,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29336, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29452, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -254787,19 +255378,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+29403, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29519, 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+29437, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29553, 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+29467, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29583, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -254844,12 +255435,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+29522, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+29638, 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+29553, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29669, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -254878,7 +255469,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+29620, libc.VaList(bp+64, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+29736, libc.VaList(bp+64, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -254888,11 +255479,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+27434, libc.VaList(bp+64, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+27550, 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+29648, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+29764, 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)) @@ -254908,8 +255499,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+29679, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+29686, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+29795, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+29802, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -254936,7 +255527,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+29694, 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+29810, 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) } @@ -254987,13 +255578,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+29713, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+29829, -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 + 8021 + zDb = __ccgo_ts + 8107 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*4))) } @@ -255002,7 +255593,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 + 19940 + v1 = __ccgo_ts + 20073 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -255469,19 +256060,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+26668, int32(1)) + Xsqlite3_str_append(tls, x, __ccgo_ts+26784, int32(1)) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29764, 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+29880, 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+29775, 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+29891, 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) } @@ -255510,20 +256101,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+29786, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29902, 0) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29804, 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+29920, 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+29812, 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+29928, 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) { @@ -255531,14 +256122,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+29820, libc.VaList(bp+8, z)) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29936, libc.VaList(bp+8, z)) } goto _2 _2: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29824, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29940, 0) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -255584,8 +256175,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 @@ -255617,13 +256208,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 } @@ -255703,16 +256294,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 } @@ -255759,9 +256350,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: ; @@ -255987,7 +256578,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 // ** @@ -256026,7 +256617,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) } @@ -256130,7 +256721,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 @@ -256220,7 +256811,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 @@ -256504,7 +257095,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) { @@ -256673,13 +257264,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+28877, uint32(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+28993, 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+29837, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29953, 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) @@ -256688,13 +257279,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+29859, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29975, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28934, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29050, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -256702,7 +257293,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+4711, 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) @@ -256717,7 +257308,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+4711, 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 @@ -256929,7 +257520,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 + 18162 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 18295 (*(*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) @@ -256939,7 +257530,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 + 29863 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 29979 (*(*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) @@ -256947,7 +257538,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 + 29869 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 29985 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -257067,7 +257658,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+29878, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+29994, 0) } goto geopoly_update_end } @@ -257170,12 +257761,12 @@ geopoly_update_end: func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+29918) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+30034) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+29934) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+30050) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) @@ -257246,7 +257837,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+30111, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+30227, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -257260,61 +257851,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29949, + FzName: __ccgo_ts + 30065, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29962, + FzName: __ccgo_ts + 30078, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29975, + FzName: __ccgo_ts + 30091, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 29988, + FzName: __ccgo_ts + 30104, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 29934, + FzName: __ccgo_ts + 30050, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 30000, + FzName: __ccgo_ts + 30116, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 29918, + FzName: __ccgo_ts + 30034, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 30023, + FzName: __ccgo_ts + 30139, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 30037, + FzName: __ccgo_ts + 30153, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 30050, + FzName: __ccgo_ts + 30166, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 30064, + FzName: __ccgo_ts + 30180, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 30080, + FzName: __ccgo_ts + 30196, }, } @@ -257340,7 +257931,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 30092, + FzName: __ccgo_ts + 30208, }, } @@ -257365,20 +257956,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+30119, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30235, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30129, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30245, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30140, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30256, -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+29863, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+29979, 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+30151, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+30267, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -257452,7 +258043,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) @@ -257480,7 +258071,7 @@ 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+27420, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+27536, __ccgo_fp(_rtreeMatchArgFree)) } } } @@ -257721,7 +258312,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 @@ -258711,7 +259302,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+30161, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+30277, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -258721,7 +259312,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+30161, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+30277, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -258747,7 +259338,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+4711, 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 @@ -258770,7 +259361,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+4711, 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 } @@ -258902,7 +259493,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+30182, uintptr(0), uintptr(0), p+36) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30298, uintptr(0), uintptr(0), p+36) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -258991,7 +259582,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+27333, zIn, uint32(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+27449, 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')) { @@ -259028,13 +259619,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 + 30353 + v1 = __ccgo_ts + 30469 } else { v1 = __ccgo_ts + 1674 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30394, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30510, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+4, p+36, __ccgo_ts+30544) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+4, p+36, __ccgo_ts+30660) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -259201,7 +259792,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+4711, 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))) } } @@ -259262,7 +259853,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+30669, 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+30785, 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 @@ -259272,7 +259863,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+30788, 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+30904, libc.VaList(bp+24, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -259280,7 +259871,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+30809, 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+30925, 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) @@ -259292,7 +259883,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+30860, 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+30976, 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 { @@ -259336,7 +259927,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+30881, 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+30997, 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))) { @@ -259349,7 +259940,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+30909, 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+31025, 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 { @@ -259402,7 +259993,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+21448, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+21581, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -259413,7 +260004,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+30938, 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+31054, 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) @@ -259424,7 +260015,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+30957, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+31073, 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 @@ -259432,7 +260023,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+30962, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+31078, zName) { bRbuRowid = int32(1) } } @@ -259446,17 +260037,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 + 30972 + v4 = __ccgo_ts + 31088 } else { - v4 = __ccgo_ts + 30985 + v4 = __ccgo_ts + 31101 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30994, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31110, 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+31023, 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+31139, 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)) @@ -259478,7 +260069,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+31045, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31161, 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)) @@ -259524,8 +260115,8 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+31072, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 16460 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31188, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 16546 goto _1 _1: ; @@ -259559,7 +260150,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+31081, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+31197, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -259607,21 +260198,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+31094, 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+31210, 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+31126, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+31242, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16460, __ccgo_ts+31149) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+31155, __ccgo_ts+31162, __ccgo_ts+6481) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16460, __ccgo_ts+1674) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16546, __ccgo_ts+31265) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+31271, __ccgo_ts+31278, __ccgo_ts+6568) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16546, __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+31170, 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+31286, 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+31212, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+31328, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -259673,7 +260264,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { 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+30909, 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+31025, 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)) @@ -259695,15 +260286,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 + 31232 + zCol = __ccgo_ts + 31348 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*4)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+31240, libc.VaList(bp+16, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+31261, libc.VaList(bp+16, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+31297, libc.VaList(bp+16, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 16460 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+31356, libc.VaList(bp+16, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+31377, libc.VaList(bp+16, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+31413, libc.VaList(bp+16, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 16546 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -259712,7 +260303,7 @@ 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+31324, 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+31440, 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 + 1674 iCol = 0 @@ -259729,15 +260320,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+31372, libc.VaList(bp+16, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 16460 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+31488, libc.VaList(bp+16, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 16546 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+31379, libc.VaList(bp+16, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+31495, libc.VaList(bp+16, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -259795,7 +260386,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter 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+30909, 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+31025, 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)) @@ -259804,7 +260395,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+31391, 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)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+31507, 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 { @@ -259824,9 +260415,9 @@ 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 + 31232 + zCol = __ccgo_ts + 31348 } else { - zCol = __ccgo_ts + 30962 + zCol = __ccgo_ts + 31078 } } zType = __ccgo_ts + 1148 @@ -259834,24 +260425,24 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter 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+31413, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+31529, 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 + 31149 + v2 = __ccgo_ts + 31265 } else { v2 = __ccgo_ts + 1674 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+31433, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+31549, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+31454, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+31487, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+31570, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+31603, 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 + 16460 - zAnd = __ccgo_ts + 23557 + zCom = __ccgo_ts + 16546 + zAnd = __ccgo_ts + 23690 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -259905,11 +260496,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+31511, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+31627, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+31523, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+31639, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 16460 + zS = __ccgo_ts + 16546 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -259921,7 +260512,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+31532, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+31648, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -259947,7 +260538,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+31547, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+31663, 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 + 1674 @@ -259957,15 +260548,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+31561, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 23557 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31677, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 23690 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+31573, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+31689, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1674 i1 = 0 @@ -259975,8 +260566,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+31623, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 23557 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31739, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 23690 } goto _2 _2: @@ -259999,7 +260590,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+31636, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31752, 0) } // C documentation @@ -260041,16 +260632,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+31623, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) - zSep = __ccgo_ts + 16460 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31739, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) + zSep = __ccgo_ts + 16546 } else { if int32(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+31662, 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 + 16460 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31778, 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 + 16546 } else { if int32(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+31692, 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 + 16460 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31808, 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 + 16546 } } } @@ -260134,16 +260725,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 + 31729 + zSep = __ccgo_ts + 31845 *(*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+30881, 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+30997, 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+18050) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+18183) == 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+30909, 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+31025, libc.VaList(bp+16, zIdx))) } break } @@ -260154,16 +260745,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 + 31149 + v1 = __ccgo_ts + 31265 } else { v1 = __ccgo_ts + 1674 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+31742, libc.VaList(bp+16, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 16460 + z = _rbuMPrintf(tls, p, __ccgo_ts+31858, libc.VaList(bp+16, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 16546 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+31753, libc.VaList(bp+16, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+31869, libc.VaList(bp+16, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) } return z @@ -260209,7 +260800,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+36, __ccgo_ts+31757) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+31873) 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))) { @@ -260217,7 +260808,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+30909, 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+31025, 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))) { @@ -260226,21 +260817,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+31807, 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+31923, 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 + 31149 + v1 = __ccgo_ts + 31265 } else { v1 = __ccgo_ts + 1674 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+31829, libc.VaList(bp+16, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 16460 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+31945, libc.VaList(bp+16, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 16546 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+31839, libc.VaList(bp+16, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+31955, 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+8021, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31854, 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+8021, 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+31970, 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)) } } @@ -260277,7 +260868,7 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum 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+8021, 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) { @@ -260286,19 +260877,19 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { 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+8021, (*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 + 31916 + zPk = __ccgo_ts + 32032 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 31929 + v2 = __ccgo_ts + 32045 } else { v2 = __ccgo_ts + 1674 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+31939, 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 + 16460 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+32055, 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 + 16546 goto _1 _1: ; @@ -260307,17 +260898,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+31966, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+32082, 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+8021, 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 + 31973 + v3 = __ccgo_ts + 32089 } else { v3 = __ccgo_ts + 1674 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31988, 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+8021, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32104, 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)) } } @@ -260343,7 +260934,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+32020, 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+32136, libc.VaList(bp+8, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -260389,7 +260980,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+32077) + *(*int32)(unsafe.Pointer(bp + 4)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+32193) } 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)) @@ -260558,7 +261149,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+32143, libc.VaList(bp+24, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+32259, libc.VaList(bp+24, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -260575,18 +261166,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+8021, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8021, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32163, 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+8021, 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+32279, 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+32228, 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+32344, 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+32264, 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+32380, 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 { @@ -260601,26 +261192,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 32298 + v2 = __ccgo_ts + 32414 } else { - v2 = __ccgo_ts + 32302 + v2 = __ccgo_ts + 32418 } v1 = v2 } else { v1 = __ccgo_ts + 1674 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32308, libc.VaList(bp+24, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32424, 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+32369, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32485, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 32298 + v3 = __ccgo_ts + 32414 } else { - v3 = __ccgo_ts + 32302 + v3 = __ccgo_ts + 32418 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32430, 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+32546, 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 { @@ -260639,8 +261230,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+8032) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+8028) + 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). */ @@ -260649,39 +261240,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 + 1674 } else { - v4 = __ccgo_ts + 32589 + v4 = __ccgo_ts + 32705 } 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 + 32598 + v5 = __ccgo_ts + 32714 } else { v5 = __ccgo_ts + 1674 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, pz, Xsqlite3_mprintf(tls, __ccgo_ts+32608, 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+32724, 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+32644, 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+32760, 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 + 1674 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 32672 + zRbuRowid = __ccgo_ts + 32788 } /* 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 + 32684 + v6 = __ccgo_ts + 32800 } else { v6 = __ccgo_ts + 1674 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32701, 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+32777, libc.VaList(bp+24, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32817, 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+32893, 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+33076, libc.VaList(bp+24, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33192, libc.VaList(bp+24, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -260692,9 +261283,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 + 33175 + v7 = __ccgo_ts + 33291 } else { - v7 = __ccgo_ts + 33185 + v7 = __ccgo_ts + 33301 } zRbuRowid1 = v7 } @@ -260707,14 +261298,14 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+31232, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+31348, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16460, __ccgo_ts+1674) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16546, __ccgo_ts+1674) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 33196 + v8 = __ccgo_ts + 33312 } else { v8 = __ccgo_ts + 1674 } @@ -260724,11 +261315,11 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 v9 = __ccgo_ts + 1674 } if zOrder != 0 { - v10 = __ccgo_ts + 24813 + v10 = __ccgo_ts + 24946 } else { v10 = __ccgo_ts + 1674 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+76, pz, Xsqlite3_mprintf(tls, __ccgo_ts+33202, 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+33318, libc.VaList(bp+24, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -260816,9 +261407,9 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p if zSet != 0 { zPrefix = __ccgo_ts + 1674 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 32589 + zPrefix = __ccgo_ts + 32705 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+33250, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+33366, 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 } @@ -260845,7 +261436,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+4711, 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) } @@ -260892,7 +261483,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+33280, 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+33396, 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): @@ -260951,27 +261542,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+8021, 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+8021) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+33310, 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+33426, 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+33338, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+24, __ccgo_ts+15318, uint32(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33454, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+24, __ccgo_ts+15404, uint32(4)) } else { - libc.Xmemcpy(tls, p+24, __ccgo_ts+8021, 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+33356, libc.VaList(bp+8, p+24)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33472, 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+8021, 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 } @@ -261004,10 +261595,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+33422, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33538, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+26156, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint32(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+26289, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint32(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -261023,14 +261614,14 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) if zExtra == uintptr(0) { v2 = __ccgo_ts + 1674 } else { - v2 = __ccgo_ts + 33454 + v2 = __ccgo_ts + 33570 } if zExtra == uintptr(0) { v3 = __ccgo_ts + 1674 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+33456, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8021), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+33572, 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 @@ -261041,27 +261632,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+33488, -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+33604, -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+33503, 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+33619, 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+33520, -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+33636, -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+8021, 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+33536, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33652, 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+8021, 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+33564, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33680, 0) } } @@ -261147,7 +261738,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { if pState == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33536, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33652, uintptr(0), uintptr(0), uintptr(0)) } } /* Assuming no error has occurred, run a "restart" checkpoint with the @@ -261180,7 +261771,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CAPTURE) - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33582, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33698, uintptr(0), uintptr(0), uintptr(0)) if rc2 != int32(SQLITE_NOTICE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -261313,16 +261904,16 @@ 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+8021, 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+8021, int32(SQLITE_FCNTL_FILE_POINTER), bp) + 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_methods1)(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) } - Xsqlite3_file_control(tls, db, __ccgo_ts+8021, 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+8021, 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)) @@ -261344,7 +261935,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+33617, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+33733, 0) } // C documentation @@ -261361,13 +261952,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+8021) + 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+8021) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8107) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+33642, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+33649, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+33758, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+33765, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -261499,7 +262090,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+25713, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+25846, 0) return } if eType == int32(RBU_DELETE) && int32(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -261635,7 +262226,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+33656) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+36, __ccgo_ts+33772) 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 @@ -261648,7 +262239,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+33678, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33794, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -261675,7 +262266,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+33705, 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+33821, 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))) @@ -261711,9 +262302,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+33865, 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+33981, 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+33880, 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+33996, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -261736,9 +262327,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+33900, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34016, 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+33925) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+34041) } 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) @@ -261749,10 +262340,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+34033) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+34149) } 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+34098) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, __ccgo_ts+34214) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -261770,7 +262361,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+34142, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34258, uintptr(0), uintptr(0), p+36) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -261797,8 +262388,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+19156) - _rbuCopyPragma(tls, p, __ccgo_ts+18246) + _rbuCopyPragma(tls, p, __ccgo_ts+19289) + _rbuCopyPragma(tls, p, __ccgo_ts+18379) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -261806,7 +262397,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+34167, libc.VaList(bp+16, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+34283, libc.VaList(bp+16, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -261828,10 +262419,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+16364, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16450, 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+16364, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16450, uintptr(0), uintptr(0), p+36) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -261918,7 +262509,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+34195, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34311, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -261941,10 +262532,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+33642, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+33758, 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+8021, 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) } @@ -261966,7 +262557,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+34220, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+34336, 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) @@ -262013,7 +262604,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+34231, libc.VaList(bp+16, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+34347, 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 { @@ -262058,11 +262649,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+34303, 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+34419, 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+34317) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+34433) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -262071,7 +262662,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+34374) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+34490) 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) @@ -262119,7 +262710,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+4711, 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 @@ -262151,7 +262742,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+34448, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34564, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -262173,17 +262764,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 + 34480 + v3 = __ccgo_ts + 34596 } else { - v3 = __ccgo_ts + 34487 + v3 = __ccgo_ts + 34603 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34494, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34610, 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+16349, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16435, 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) @@ -262195,21 +262786,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+18870) - _rbuCopyPragma(tls, p, __ccgo_ts+18261) + _rbuCopyPragma(tls, p, __ccgo_ts+19003) + _rbuCopyPragma(tls, p, __ccgo_ts+18394) } /* 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+34526, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+34642, 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+8021, 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+34542, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+34658, uintptr(0), uintptr(0), p+36) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -262287,7 +262878,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+34566, zState+uintptr(n-uint32(7)), uint32(7)) { + if n >= uint32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+34682, zState+uintptr(n-uint32(7)), uint32(7)) { return _rbuMisuseError(tls) } } @@ -262334,7 +262925,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+32589, uint32(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+32705, 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++ @@ -262362,7 +262953,7 @@ 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+16364, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16450, 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) { @@ -262371,7 +262962,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { } _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+16364, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16450, uintptr(0), uintptr(0), p+36) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+56) @@ -262381,7 +262972,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+34574, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+34690, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -262482,7 +263073,7 @@ 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+16364, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16450, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ @@ -262495,19 +263086,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { 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+16364, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16450, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 16349 + v1 = __ccgo_ts + 16435 } else { - v1 = __ccgo_ts + 34526 + v1 = __ccgo_ts + 34642 } 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+34526, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34642, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -262993,7 +263584,7 @@ func _rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileSize})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, pSize) /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existence of a *-wal file. rbuVfsRead() contains ** similar logic. */ if rc == SQLITE_OK && *(*Tsqlite_int64)(unsafe.Pointer(pSize)) == 0 && (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpRbu)).FzTarget == uintptr(0) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_MAIN_DB) != 0 { *(*Tsqlite_int64)(unsafe.Pointer(pSize)) = int64(1024) @@ -263074,7 +263665,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xControl})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, int32(SQLITE_FCNTL_ZIPVFS), bp) if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34601, 0) + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34717, 0) } else { if rc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p @@ -263100,7 +263691,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r if rc == SQLITE_OK && op == int32(SQLITE_FCNTL_VFSNAME) { pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs zIn = *(*uintptr)(unsafe.Pointer(pArg)) - zOut = Xsqlite3_mprintf(tls, __ccgo_ts+34624, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + zOut = Xsqlite3_mprintf(tls, __ccgo_ts+34740, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -263295,7 +263886,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag if pDb != 0 { if (*Trbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == int32(RBU_STAGE_OAL) { if (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) { - zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+8021) + zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+8107) zOpen = Xsqlite3_filename_wal(tls, zOpen) } nOpen = libc.Xstrlen(tls, zOpen) @@ -263309,7 +263900,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag } else { (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu } - if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+34635, 0) != 0 { + if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+34751, 0) != 0 { oflags = libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) } @@ -263867,7 +264458,7 @@ func _statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint _sqlite3TokenInit(tls, bp, *(*uintptr)(unsafe.Pointer(argv + 3*4))) iDb = _sqlite3FindDb(tls, db, bp) if iDb < 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+13688, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + 3*4)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+13774, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + 3*4)))) return int32(SQLITE_ERROR) } } else { @@ -264367,7 +264958,7 @@ statNextRestart: (*(*TStatPage)(unsafe.Pointer(pCsr + 16))).FiPgno = iRoot (*(*TStatPage)(unsafe.Pointer(pCsr + 16))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v1 = Xsqlite3_mprintf(tls, __ccgo_ts+34646, 0) + v1 = Xsqlite3_mprintf(tls, __ccgo_ts+34762, 0) z = v1 (*(*TStatPage)(unsafe.Pointer(pCsr + 16))).FzPath = v1 if z == uintptr(0) { @@ -264405,8 +264996,8 @@ statNextRestart: if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { (*TStatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34648 - v2 = Xsqlite3_mprintf(tls, __ccgo_ts+34657, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34764 + v2 = Xsqlite3_mprintf(tls, __ccgo_ts+34773, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) z = v2 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v2 if z == uintptr(0) { @@ -264435,7 +265026,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage++ if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= int32(libc.Uint32FromInt64(1280)/libc.Uint32FromInt64(40)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226029)) + return _sqlite3CorruptError(tls, int32(227304)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*40))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -264446,7 +265037,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+34669, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+34785, 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) { @@ -264469,13 +265060,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34677 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34793 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34686 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34802 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34691 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34807 break } *(*int32)(unsafe.Pointer(pCsr + 1320)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -264484,7 +265075,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+4711, 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) { @@ -264573,12 +265164,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+34701, 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+34817, 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+34856, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+34972, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+34870, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+34986, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -264655,7 +265246,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+34885, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+35001, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -265950,11 +266541,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+13079, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13165, 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+34892, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+35008, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1674, 0) @@ -265963,7 +266554,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+35022, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+35138, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -265989,7 +266580,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte += int64(libc.Xstrlen(tls, __ccgo_ts+31232)) + nByte += int64(libc.Xstrlen(tls, __ccgo_ts+31348)) 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))) @@ -266013,8 +266604,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+31232) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+31232, nName+uint32(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+31348) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+31348, nName+uint32(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)) = pAlloc pAlloc += uintptr(nName + uint32(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -266078,7 +266669,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 @@ -266095,6 +266686,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 { @@ -266116,7 +266709,7 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13079, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13165, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { @@ -266410,10 +267003,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 + 12699 + zSep = __ccgo_ts + 12785 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+35052, 0) + _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+35168, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -266425,8 +267018,8 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin v2 = __ccgo_ts + 1675 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+6451, libc.VaList(bp+24, zSep, zDflt)) - zSep = __ccgo_ts + 16460 + _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+6538, libc.VaList(bp+24, zSep, zDflt)) + zSep = __ccgo_ts + 16546 goto _1 _1: ; @@ -267080,8 +267673,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+35059, 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 + 23557 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35175, 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 + 23690 if zRet == uintptr(0) { break } @@ -267110,8 +267703,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+35093, 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 + 35134 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35209, 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 + 35250 if zRet == uintptr(0) { break } @@ -267122,7 +267715,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1794, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1820, 0) } return zRet } @@ -267133,12 +267726,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 + 35139 + v1 = __ccgo_ts + 35255 } else { - v1 = __ccgo_ts + 8026 + v1 = __ccgo_ts + 8112 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35150, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35266, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -267199,11 +267792,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 16460 + v2 = __ccgo_ts + 16546 } else { v2 = __ccgo_ts + 1674 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35229, 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+35345, 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 } @@ -267231,7 +267824,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+35248, 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+35364, 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 { @@ -267260,17 +267853,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)) @@ -267283,7 +267877,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 } @@ -267294,18 +267890,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+35421, 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+35452, libc.VaList(bp+48, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -267331,7 +267953,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+35305, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+35473, 0) } rc = int32(SQLITE_SCHEMA) } @@ -267663,7 +268285,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+6513, 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) } @@ -267963,12 +268585,12 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt *(*TSessionBuffer)(unsafe.Pointer(bp + 16)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 28)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+16, __ccgo_ts+35332, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13079, zTab) { - _sessionAppendStr(tls, bp+16, __ccgo_ts+35336, bp) - _sessionAppendStr(tls, bp+28, __ccgo_ts+35360, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+35369, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+35414, bp) + _sessionAppendStr(tls, bp+16, __ccgo_ts+35500, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13165, zTab) { + _sessionAppendStr(tls, bp+16, __ccgo_ts+35504, bp) + _sessionAppendStr(tls, bp+28, __ccgo_ts+35528, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+35537, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35582, bp) } else { i = 0 for { @@ -267976,17 +268598,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+16460, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+16546, 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 + 16460 + zSep = __ccgo_ts + 16546 _sessionAppendIdent(tls, bp+28, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), bp) - _sessionAppendPrintf(tls, bp+40, bp, __ccgo_ts+35428, libc.VaList(bp+64, i+int32(1))) + _sessionAppendPrintf(tls, bp+40, bp, __ccgo_ts+35596, libc.VaList(bp+64, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+16, bp, __ccgo_ts+35432, 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+35600, libc.VaList(bp+64, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) } goto _1 _1: @@ -268000,7 +268622,7 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt } else { v2 = __ccgo_ts + 1674 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+35459, 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+35627, 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) } @@ -268142,7 +268764,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, 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+35501, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 12)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+35669, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 12)) } @@ -268248,7 +268870,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+35521, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35689, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 12)) } @@ -268503,13 +269125,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 } } @@ -268665,7 +269288,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(230285)) + rc = _sqlite3CorruptError(tls, int32(231591)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -268689,7 +269312,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(230305)) + rc = _sqlite3CorruptError(tls, int32(231611)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -268704,7 +269327,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(230315)) + rc = _sqlite3CorruptError(tls, int32(231621)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -268760,7 +269383,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(230363)) + rc = _sqlite3CorruptError(tls, int32(231669)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -268865,7 +269488,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(230451)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231757)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -268936,8 +269559,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) @@ -268971,7 +269594,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(230537)) + v7 = _sqlite3CorruptError(tls, int32(231843)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -268981,7 +269604,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(230543)) + v10 = _sqlite3CorruptError(tls, int32(231849)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -269060,7 +269683,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(230587)) + v16 = _sqlite3CorruptError(tls, int32(231893)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -269470,7 +270093,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230952)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232258)) goto finished_invert } if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf >= _sessions_strm_chunk_size { @@ -269673,7 +270296,7 @@ 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+13079) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+13165) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -269682,9 +270305,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 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+35539, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35707, bp) _sessionAppendIdent(tls, bp+4, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+35552, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35720, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -269694,9 +270317,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+35558, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35726, bp) _sessionAppendInteger(tls, bp+4, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 16460 + zSep = __ccgo_ts + 16546 } goto _2 _2: @@ -269705,7 +270328,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } /* Create the WHERE clause part of the UPDATE */ zSep = __ccgo_ts + 1674 - _sessionAppendStr(tls, bp+4, __ccgo_ts+35563, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35731, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -269714,13 +270337,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+35571, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35739, bp) } else { _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+35646, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35814, bp) _sessionAppendInteger(tls, bp+4, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 23557 + zSep = __ccgo_ts + 23690 } goto _3 _3: @@ -269807,9 +270430,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 4)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+4, __ccgo_ts+35652, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35820, bp) _sessionAppendIdent(tls, bp+4, zTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+35563, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35731, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -269819,9 +270442,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+35558, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35726, bp) _sessionAppendInteger(tls, bp+4, i+int32(1), bp) - zSep = __ccgo_ts + 23557 + zSep = __ccgo_ts + 23690 } goto _1 _1: @@ -269829,9 +270452,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+4, __ccgo_ts+35670, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35838, bp) _sessionAppendInteger(tls, bp+4, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+35134, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35250, bp) zSep = __ccgo_ts + 1674 i = 0 for { @@ -269841,16 +270464,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+35646, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35814, bp) _sessionAppendInteger(tls, bp+4, i+int32(1), bp) - zSep = __ccgo_ts + 35678 + zSep = __ccgo_ts + 35846 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+6481, 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)) @@ -269876,7 +270499,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+8021, 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 @@ -269899,16 +270522,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+35683, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35851, bp) _sessionAppendIdent(tls, bp+4, zTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+23563, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+23696, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+4, __ccgo_ts+16460, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+16546, bp) } _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp) goto _1 @@ -269916,19 +270539,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+35701, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35869, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+4, __ccgo_ts+35712, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35880, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+6481, 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)) } @@ -269951,12 +270574,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+13079, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+13165, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+35716) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+35884) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+4, __ccgo_ts+35829) + rc = _sessionPrepare(tls, db, p+4, __ccgo_ts+35997) } return rc } @@ -270022,7 +270645,7 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231434)) + rc = _sqlite3CorruptError(tls, int32(232740)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -270438,7 +271061,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35973, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36141, 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)) @@ -270451,7 +271074,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35994, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36162, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -270551,10 +271174,10 @@ 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+36013, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36181, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+36039, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36207, 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)) @@ -270585,7 +271208,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui ** 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)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+4711, 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 @@ -270595,7 +271218,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+8021, *(*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 } @@ -270614,18 +271237,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+36069, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+36237, 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+36113, 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+36281, 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+36184, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+36352, 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+13079) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+13165) { v2 = _sessionStat1Sql(tls, db, bp+4) rc = v2 if v2 != 0 { @@ -270682,17 +271305,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+36244, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+36412, 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+36274, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36442, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+36298, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+36274, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+36466, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+36442, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FbRebase != 0 { @@ -271468,7 +272091,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+4711, 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 { @@ -271504,11 +272127,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 @@ -272093,6 +272722,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 @@ -272140,8 +272770,7 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset @@ -272153,12 +272782,13 @@ type Fts5Colset = TFts5Colset ** This object is used by fts5_expr.c and fts5_index.c. */ type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 + FnCol 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 ** to parse the arguments passed to the CREATE VIRTUAL TABLE statement. @@ -272553,8 +273183,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr - F__ccgo_pad9 [4]byte } type Fts5ExprNode = TFts5ExprNode @@ -272582,16 +273210,14 @@ 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 @@ -272634,7 +273260,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 @@ -273438,7 +274064,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+36326, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36494, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -273794,7 +274420,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+36354, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36522, 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 */ } @@ -274083,7 +274709,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+36385, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+36553, 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) } @@ -274182,7 +274808,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 + 36392 + zErr = __ccgo_ts + 36560 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -274437,7 +275063,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 + 36442 + zErr = __ccgo_ts + 36610 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -274712,7 +275338,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))) @@ -274804,13 +275430,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) } @@ -274836,13 +275462,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 + 36490 + z = __ccgo_ts + 36658 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 + 36546 + z1 = __ccgo_ts + 36714 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -274875,19 +275501,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 36604, + FzFunc: __ccgo_ts + 36772, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 36612, + FzFunc: __ccgo_ts + 36780, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 36622, + FzFunc: __ccgo_ts + 36790, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 36627, + FzFunc: __ccgo_ts + 36795, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -275275,7 +275901,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 @@ -275751,7 +276377,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+36643, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36811, 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) { @@ -275777,12 +276403,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+36650, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36818, 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+36681, libc.VaList(bp+48, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36849, libc.VaList(bp+48, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -275791,7 +276417,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+36714, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36882, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -275801,14 +276427,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36751, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36919, 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+36760, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36928, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -275835,7 +276461,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+36793, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36961, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -275847,76 +276473,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+36827, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36995, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36835, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37003, 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+36867, libc.VaList(bp+48, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37035, 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+36873, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37041, 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+36892, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37060, 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+36935, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37103, 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+36892, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37060, 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+36957, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37125, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36971, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37139, 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+37009, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37177, 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+37020, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37188, 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+37055, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37223, 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+37062, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37230, 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+6890, 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 + 9715, + FzName: __ccgo_ts + 9801, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 19226, + FzName: __ccgo_ts + 19359, }, 2: { - FzName: __ccgo_ts + 37093, + FzName: __ccgo_ts + 37261, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -275924,20 +276550,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+37101, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37269, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+37132, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37300, 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+37142, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37310, 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+37176, libc.VaList(bp+48, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37344, libc.VaList(bp+48, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -275998,16 +276624,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+37204) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+18162) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37209, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+37372) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+18295) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37377, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+37239) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+37407) { *(*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+37249, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37417, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -276033,7 +276659,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+37280, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37448, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -276041,12 +276667,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+37285, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37453, 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+37292, libc.VaList(bp+24, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37460, libc.VaList(bp+24, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37300, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37468, 0) } } goto _1 @@ -276062,9 +276688,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+37307, libc.VaList(bp+24, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37475, libc.VaList(bp+24, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37300, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37468, 0) } goto _2 _2: @@ -276127,8 +276753,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+37204) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37315, 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+37372) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37483, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -276159,7 +276785,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+37344, libc.VaList(bp+32, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37512, libc.VaList(bp+32, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -276189,7 +276815,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+37364, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37532, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -276197,37 +276823,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+37414, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37582, 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+37469, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37637, 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 + 36827 + zTail = __ccgo_ts + 36995 } 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 + 36827 + zTail = __ccgo_ts + 36995 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 37522 + zTail = __ccgo_ts + 37690 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37530, 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+37698, 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+18162, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+18295, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -276296,7 +276922,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+37541, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37709, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -276305,16 +276931,16 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { if i == 0 { v2 = __ccgo_ts + 1674 } else { - v2 = __ccgo_ts + 16460 + v2 = __ccgo_ts + 16546 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37557, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*4)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37725, 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+37564, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+37204)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37732, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+37372)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -276472,7 +277098,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+37590) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37758) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -276483,7 +277109,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+37595) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37763) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -276494,7 +277120,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+37604) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37772) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -276508,7 +277134,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+37614) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37782) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -276519,7 +277145,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+37624) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37792) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -276536,7 +277162,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+37636) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37804) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -276551,7 +277177,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+37204) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37372) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+4) if rc == SQLITE_OK { @@ -276566,7 +277192,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37648) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37816) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -276582,7 +277208,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+37662) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37830) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -276625,7 +277251,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 + 37672 + zSelect = __ccgo_ts + 37840 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 4)) = SQLITE_OK iVersion = 0 @@ -276645,7 +277271,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+37704) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+37872) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 8)) = 0 @@ -276656,7 +277282,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+37712, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+37880, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -276762,12 +277388,12 @@ type TFts5ExprNode1 = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr - F__ccgo_pad9 [4]byte } type Fts5ExprNode1 = TFts5ExprNode1 +/* Size (in bytes) of an Fts5ExprNode object that holds up to N children */ + /* ** 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. @@ -276797,24 +277423,26 @@ type TFts5ExprPhrase1 = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase1 = TFts5ExprPhrase1 +/* Size (in bytes) of an Fts5ExprPhrase object that holds up to N terms */ + /* ** 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 + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset1 = TFts5ExprNearset1 +/* Size (in bytes) of an Fts5ExprNearset object covering up to N phrases */ + /* ** Parse context. */ @@ -276905,7 +277533,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+37783, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37951, 0) return FTS5_EOF } goto _1 @@ -276916,7 +277544,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+37803, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37971, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -276931,13 +277559,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+37834, uint32(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+38002, 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+37837, uint32(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+38005, 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+32298, uint32(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+32414, uint32(3)) == 0 { tok = int32(FTS5_AND) } break @@ -276981,7 +277609,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) @@ -278628,7 +279256,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) @@ -278638,7 +279266,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) @@ -278744,12 +279372,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 @@ -278883,7 +279511,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) @@ -278923,15 +279551,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)) @@ -278972,7 +279600,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 { @@ -279010,8 +279638,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+37841, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint32(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36354, 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+38009, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint32(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36522, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -279031,10 +279659,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+37846, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38014, 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: ; @@ -279068,7 +279699,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 { @@ -279118,7 +279749,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 @@ -279169,7 +279800,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+22560, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+22693, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -279196,7 +279827,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)) @@ -279293,7 +279924,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+37875, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38043, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -279378,7 +280009,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) @@ -279391,7 +280022,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) @@ -279465,7 +280096,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 @@ -279491,11 +280122,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 + 37928 + v2 = __ccgo_ts + 38096 } else { - v2 = __ccgo_ts + 37841 + v2 = __ccgo_ts + 38009 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37935, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38103, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -279508,7 +280139,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+37985, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38153, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -279988,7 +280619,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) { @@ -280053,7 +280684,7 @@ 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 +** to accumulate "term -> doclist" content before it is flushed to a level-0 ** segment. */ @@ -280113,7 +280744,7 @@ type TFts5HashEntry1 = struct { type Fts5HashEntry1 = TFts5HashEntry1 /* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -280998,7 +281629,6 @@ type TFts5DlidxIter = struct { F__ccgo_align [0]uint32 FnLvl int32 FiSegid int32 - FaLvl [1]TFts5DlidxLvl } type Fts5DlidxIter = TFts5DlidxIter @@ -281041,8 +281671,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 @@ -281126,8 +281755,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel - F__ccgo_pad6 [4]byte } type Fts5Structure = TFts5Structure @@ -281165,7 +281792,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -281181,9 +281807,8 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray @@ -281292,12 +281917,12 @@ type TFts5Structure1 = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel - F__ccgo_pad6 [4]byte } type Fts5Structure1 = TFts5Structure1 +/* Size (in bytes) of an Fts5Structure object holding up to N levels */ + /* ** An object of type Fts5SegWriter is used to write to segments. */ @@ -281438,13 +282063,14 @@ type Fts5SegIter1 = TFts5SegIter1 ** Array of tombstone pages. Reference counted. */ type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray1 = TFts5TombstoneArray1 +/* Size (in bytes) of an Fts5TombstoneArray holding up to N tombstones */ + /* ** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. @@ -281499,12 +282125,13 @@ type TFts5Iter1 = struct { F__ccgo_align9 [3]byte FiSwitchRowid Ti64 FaFirst uintptr - F__ccgo_align11 [4]byte - FaSeg [1]TFts5SegIter + F__ccgo_pad12 [4]byte } type Fts5Iter1 = TFts5Iter1 +/* Size (in bytes) of an Fts5Iter object holding up to N segment iterators */ + /* ** An instance of the following type is used to iterate through the contents ** of a doclist-index record. @@ -281535,11 +282162,12 @@ 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)) *(*Tu8)(unsafe.Pointer(aOut + 1)) = uint8(int32(iVal) & libc.Int32FromInt32(0xFF)) @@ -281718,7 +282346,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+38038, 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+38206, 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. @@ -281823,7 +282451,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+38044, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+56, Xsqlite3_mprintf(tls, __ccgo_ts+38212, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -281852,7 +282480,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+38095, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+38263, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+60, zSql) != 0 { return } @@ -281886,7 +282514,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+38144, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+68, Xsqlite3_mprintf(tls, __ccgo_ts+38312, 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) @@ -281964,7 +282592,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)) @@ -282055,7 +282683,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+38184, uint32(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+38352, uint32(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -282066,7 +282694,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+38184, uint32(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+38352, 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)) @@ -282747,7 +283375,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) @@ -282997,7 +283625,7 @@ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _ = nByte, nTomb, pNew nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone if nTomb > 0 { - nByte = int32(uint32(nTomb)*uint32(4) + uint32(12)) + nByte = int32(uint32(libc.UintptrFromInt32(0)+8) + uint32(nTomb+libc.Int32FromInt32(1))*libc.Uint32FromInt64(4)) pNew = _sqlite3Fts5MallocZero(tls, p+44, int64(nByte)) if pNew != 0 { (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb @@ -283707,7 +284335,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+38212, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+72, Xsqlite3_mprintf(tls, __ccgo_ts+38380, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -283796,7 +284424,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+38296, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+76, Xsqlite3_mprintf(tls, __ccgo_ts+38464, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -284443,7 +285071,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 @@ -285766,7 +286394,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+38378, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+38546, 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. */ @@ -286276,7 +286904,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+38435, 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+38603, 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) @@ -286445,7 +287073,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 } @@ -286763,7 +287391,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+38496, 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+38664, 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))) @@ -287038,7 +287666,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: @@ -287073,7 +287701,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)) @@ -287692,11 +288320,12 @@ type TFts5TokenDataIter1 = struct { 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 // // /* @@ -287764,7 +288393,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) { @@ -288012,7 +288641,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) @@ -288062,7 +288691,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 @@ -288144,15 +288773,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+1674, 0) - _fts5StructureWrite(tls, p, bp) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -288178,11 +288810,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+38547, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+38715, 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+27333, __ccgo_ts+38555, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+27449, __ccgo_ts+38723, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+13290, __ccgo_ts+38590, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+13376, __ccgo_ts+38758, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -288380,7 +289012,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) @@ -288635,7 +289267,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+38634) + _sqlite3Fts5BufferAppendBlob(tls, p+44, bp, uint32(1), __ccgo_ts+38802) } else { _sqlite3Fts5BufferSet(tls, p+44, bp, nToken, pToken) } @@ -288986,7 +289618,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') @@ -289108,7 +289740,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 { @@ -289228,7 +289860,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+38038, 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+38206, 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))) @@ -289822,7 +290454,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+38636, 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+38804, 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)) @@ -290053,7 +290685,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+38722) + _sqlite3Fts5BufferAppendBlob(tls, p+44, bp, uint32(4), __ccgo_ts+38890) 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)) @@ -290196,8 +290828,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 - F__ccgo_pad5 [4]byte } type Fts5Sorter = TFts5Sorter @@ -290358,12 +290988,12 @@ type TFts5Sorter1 = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 - F__ccgo_pad5 [4]byte } type Fts5Sorter1 = TFts5Sorter1 +/* Size (int bytes) of an Fts5Sorter object with N indexes */ + /* ** Virtual-table cursor object. ** @@ -290687,7 +291317,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+38727, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38895, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -290724,7 +291354,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+6513, 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++ @@ -290743,7 +291373,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+6513, 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 @@ -291193,7 +291823,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+4711, 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 @@ -291221,7 +291851,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+4711, 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) } @@ -291241,7 +291871,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) @@ -291256,7 +291886,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 + 16460 + v1 = __ccgo_ts + 16546 } else { v1 = __ccgo_ts + 1674 } @@ -291266,11 +291896,11 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int v2 = __ccgo_ts + 1674 } if bDesc != 0 { - v3 = __ccgo_ts + 38766 + v3 = __ccgo_ts + 38934 } else { - v3 = __ccgo_ts + 38771 + v3 = __ccgo_ts + 38939 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+38775, 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+38943, 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 @@ -291328,14 +291958,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+38830, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+38998, 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+6872, 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+38836, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39004, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -291385,7 +292015,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+38864, libc.VaList(bp+16, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+39032, 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)) @@ -291418,7 +292048,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+38874, libc.VaList(bp+16, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39042, libc.VaList(bp+16, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -291452,7 +292082,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+38895, libc.VaList(bp+16, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39063, libc.VaList(bp+16, z)) } } } else { @@ -291460,7 +292090,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 + 36622 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 36790 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -291617,7 +292247,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+38928, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 4)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+39096, 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))) } @@ -291817,7 +292447,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+38933, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+39101, 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 @@ -291950,10 +292580,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. @@ -294491,12 +295121,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+40282, 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+40450, 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+40386, 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+40554, 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+40424, 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+40592, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -294505,7 +295135,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+40462, 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+40630, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -294517,14 +295147,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+27333, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+13290, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+39616, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+27449, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+13376, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+39784, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+37522, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+37690, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36827, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36995, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -294544,13 +295174,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 + 31973 + v1 = __ccgo_ts + 32089 } else { v1 = __ccgo_ts + 1674 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+40504, 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+40672, 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+40534, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40702, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -294591,7 +295221,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+40578, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+40746, 0) iOff = int32(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -294599,7 +295229,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+40601, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+40769, libc.VaList(bp+8, i)) iOff += int32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -294614,7 +295244,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+40607, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+40775, libc.VaList(bp+8, i)) iOff += int32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -294623,22 +295253,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36827, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36995, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 40613 + zCols = __ccgo_ts + 40781 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 40645 + zCols = __ccgo_ts + 40813 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+37522, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+37690, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+39616, __ccgo_ts+40693, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+39784, __ccgo_ts+40861, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+37704, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+37872, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -295058,12 +295688,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+40710, 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+40878, 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+40760, 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+40928, 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+40789, 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)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -295071,7 +295701,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+37704, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+37872, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -295373,7 +296003,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+40818, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+40986, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -295607,14 +296237,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+36827, bp+56) + rc = _fts5StorageCount(tls, p, __ccgo_ts+36995, 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)) @@ -296819,64 +297449,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+40920, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41088, 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+40923, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41091, 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+40928, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41096, 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+40933, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41101, 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+40936, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41104, 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+40939, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41107, 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+40944, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41112, 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+40949, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41117, 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+40953, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41121, 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+40959, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41127, 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+40964, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41132, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -296885,49 +297515,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+40968, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41136, 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+40972, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41140, 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+40975, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41143, 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+40979, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41147, 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+40983, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41151, 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+40987, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41155, 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+40991, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41159, 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+40995, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41163, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -296944,20 +297574,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+40999, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40979, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41167, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+41147, 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+41002, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+41005, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41170, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+41173, 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+41009, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40995, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41177, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+41163, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -296973,75 +297603,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+41012, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41180, 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+40979, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41147, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41020, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41188, 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+41027, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+41195, uint32(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41032, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41200, 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+40928, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41096, uint32(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41037, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41205, 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+40923, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41091, uint32(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41042, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41210, 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+40995, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41163, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41047, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41215, 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+17363, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+17496, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41052, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41220, 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+41005, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41173, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41056, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41224, 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+40920, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41088, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41061, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41229, 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+40964, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41132, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41067, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41235, 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+41071, uint32(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41239, uint32(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41073, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41241, 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+40987, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41155, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -297050,48 +297680,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+41079, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41247, 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+40995, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41163, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41087, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41255, 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+40979, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41147, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41093, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41261, 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+40979, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41147, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41098, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41266, 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+40920, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41088, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41104, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41272, 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+40991, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41159, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41112, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41280, 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+41120, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41288, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41124, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41292, 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+40987, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41155, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -297099,21 +297729,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+41132, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41300, 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+40920, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41088, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41138, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41306, 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+40991, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41159, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41144, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41312, 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+41005, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+41173, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -297131,48 +297761,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+41151, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41319, 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+40936, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41104, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41156, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41324, 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+41161, 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+40936, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41104, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41167, 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+40936, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41104, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41120, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41288, 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+41173, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41341, 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+41179, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41347, 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+40920, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41088, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -297188,13 +297818,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+41185, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41353, 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+41189, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41357, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41192, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41360, 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) @@ -297202,7 +297832,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+41195, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41363, 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) @@ -297367,14 +297997,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+41199) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+41367) { 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+40892) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+41060) { 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 { @@ -297642,7 +298272,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+41214)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+41382)) } // C documentation @@ -297668,7 +298298,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 40910, + FzName: __ccgo_ts + 41078, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -297676,7 +298306,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 41222, + FzName: __ccgo_ts + 41390, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -297684,7 +298314,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 41214, + FzName: __ccgo_ts + 41382, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -297714,7 +298344,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+41228, 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+41396, pApi, bp+48, uintptr(0)) } return rc } @@ -303236,16 +303866,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+41235) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41403) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41239) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41407) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41243) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41411) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+41252, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+41420, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -303308,21 +303938,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 + 41286, - 1: __ccgo_ts + 41326, - 2: __ccgo_ts + 41361, + 0: __ccgo_ts + 41454, + 1: __ccgo_ts + 41494, + 2: __ccgo_ts + 41529, } 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+25302, *(*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+25435, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+41404, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+41572, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -303343,15 +303974,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)) @@ -303492,10 +304123,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+41437, 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+41605, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+41468, 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+41636, 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)) } @@ -303514,7 +304145,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+41519, 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+41687, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -303964,7 +304595,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+41545, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+41713, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -304019,7 +304650,7 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 41555 + return __ccgo_ts + 41723 } type TAggInfo_col = struct { @@ -304404,7 +305035,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 @@ -304452,11 +305083,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', '.', '1'} +var Xsqlite3_version = [7]int8{'3', '.', '5', '0', '.', '1'} 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_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)\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70\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\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\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-06-06 14:52:32 b77dc5e0f596d2140d9ac682b2893ff65d3a4140aa86067a3efebe29dc914c95\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods @@ -304466,3 +305097,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + diff --git a/vendor/modernc.org/sqlite/sqlite.go b/vendor/modernc.org/sqlite/sqlite.go index c60ca4c..b693956 100644 --- a/vendor/modernc.org/sqlite/sqlite.go +++ b/vendor/modernc.org/sqlite/sqlite.go @@ -510,6 +510,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 +523,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 +624,12 @@ 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 { + 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 +641,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; { @@ -2228,7 +2228,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 +2544,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 c1a80c3..f3deba0 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -33,7 +33,7 @@ github.com/emersion/go-msgauth/dkim # github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6 ## explicit; go 1.12 github.com/emersion/go-sasl -# github.com/emersion/go-smtp v0.21.3 +# github.com/emersion/go-smtp v0.22.0 ## explicit; go 1.13 github.com/emersion/go-smtp # github.com/etkecc/go-env v1.2.1 @@ -46,10 +46,10 @@ github.com/etkecc/go-fswatcher # github.com/etkecc/go-healthchecks/v2 v2.2.2 ## explicit; go 1.18 github.com/etkecc/go-healthchecks/v2 -# github.com/etkecc/go-kit v1.6.0 +# github.com/etkecc/go-kit v1.7.0 ## explicit; go 1.22 github.com/etkecc/go-kit -# github.com/etkecc/go-linkpearl v0.0.0-20250416104026-a65bda9f5f37 +# github.com/etkecc/go-linkpearl v0.0.0-20250617213914-419fd498ee39 ## explicit; go 1.23.0 github.com/etkecc/go-linkpearl # github.com/etkecc/go-mxidwc v1.0.1 @@ -64,6 +64,9 @@ github.com/etkecc/go-trysmtp # github.com/etkecc/go-validator/v2 v2.2.4 ## explicit; go 1.22.0 github.com/etkecc/go-validator/v2 +# github.com/fatih/color v1.18.0 +## explicit; go 1.17 +github.com/fatih/color # github.com/fsnotify/fsnotify v1.9.0 ## explicit; go 1.17 github.com/fsnotify/fsnotify @@ -74,9 +77,10 @@ github.com/gabriel-vasile/mimetype github.com/gabriel-vasile/mimetype/internal/charset github.com/gabriel-vasile/mimetype/internal/json github.com/gabriel-vasile/mimetype/internal/magic -# github.com/getsentry/sentry-go v0.32.0 +# github.com/getsentry/sentry-go v0.34.0 ## explicit; go 1.21 github.com/getsentry/sentry-go +github.com/getsentry/sentry-go/attribute github.com/getsentry/sentry-go/internal/debug github.com/getsentry/sentry-go/internal/otel/baggage github.com/getsentry/sentry-go/internal/otel/baggage/internal/baggage @@ -104,16 +108,16 @@ github.com/google/uuid github.com/hashicorp/golang-lru/v2 github.com/hashicorp/golang-lru/v2/internal github.com/hashicorp/golang-lru/v2/simplelru -# github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056 -## explicit -github.com/jaytaylor/html2text -# github.com/jhillyerd/enmime v1.3.0 -## explicit; go 1.18 -github.com/jhillyerd/enmime -github.com/jhillyerd/enmime/internal/coding -github.com/jhillyerd/enmime/internal/stringutil -github.com/jhillyerd/enmime/internal/textproto -github.com/jhillyerd/enmime/mediatype +# github.com/inbucket/html2text v1.0.0 +## explicit; go 1.24.3 +github.com/inbucket/html2text +# github.com/jhillyerd/enmime/v2 v2.2.0 +## explicit; go 1.23.9 +github.com/jhillyerd/enmime/v2 +github.com/jhillyerd/enmime/v2/internal/coding +github.com/jhillyerd/enmime/v2/internal/stringutil +github.com/jhillyerd/enmime/v2/internal/textproto +github.com/jhillyerd/enmime/v2/mediatype # github.com/josharian/intern v1.0.0 ## explicit; go 1.5 github.com/josharian/intern @@ -154,10 +158,21 @@ github.com/mileusna/crontab # github.com/ncruces/go-strftime v0.1.9 ## explicit; go 1.17 github.com/ncruces/go-strftime -# github.com/olekukonko/tablewriter v0.0.5 -## explicit; go 1.12 +# github.com/olekukonko/errors v1.1.0 +## explicit; go 1.21 +github.com/olekukonko/errors +# github.com/olekukonko/ll v0.0.9 +## explicit; go 1.21 +github.com/olekukonko/ll +github.com/olekukonko/ll/lh +github.com/olekukonko/ll/lx +# github.com/olekukonko/tablewriter v1.0.7 +## explicit; go 1.21 github.com/olekukonko/tablewriter -# github.com/petermattis/goid v0.0.0-20250319124200-ccd6737f222a +github.com/olekukonko/tablewriter/pkg/twwarp +github.com/olekukonko/tablewriter/renderer +github.com/olekukonko/tablewriter/tw +# github.com/petermattis/goid v0.0.0-20250508124226-395b08cebbdb ## explicit; go 1.17 github.com/petermattis/goid # github.com/pkg/errors v0.9.1 @@ -196,7 +211,7 @@ github.com/tidwall/pretty # github.com/tidwall/sjson v1.2.5 ## explicit; go 1.14 github.com/tidwall/sjson -# github.com/yuin/goldmark v1.7.10 +# github.com/yuin/goldmark v1.7.12 ## explicit; go 1.22 github.com/yuin/goldmark github.com/yuin/goldmark/ast @@ -207,7 +222,7 @@ github.com/yuin/goldmark/renderer github.com/yuin/goldmark/renderer/html github.com/yuin/goldmark/text github.com/yuin/goldmark/util -# go.mau.fi/util v0.8.6 +# go.mau.fi/util v0.8.8 ## explicit; go 1.23.0 go.mau.fi/util/base58 go.mau.fi/util/confusable @@ -218,6 +233,7 @@ go.mau.fi/util/exerrors go.mau.fi/util/exgjson go.mau.fi/util/exhttp go.mau.fi/util/exslices +go.mau.fi/util/exstrings go.mau.fi/util/exsync go.mau.fi/util/exzerolog go.mau.fi/util/glob @@ -226,7 +242,7 @@ go.mau.fi/util/jsontime go.mau.fi/util/ptr go.mau.fi/util/random go.mau.fi/util/retryafter -# golang.org/x/crypto v0.37.0 +# golang.org/x/crypto v0.39.0 ## explicit; go 1.23.0 golang.org/x/crypto/argon2 golang.org/x/crypto/blake2b @@ -240,25 +256,29 @@ golang.org/x/crypto/internal/poly1305 golang.org/x/crypto/pbkdf2 golang.org/x/crypto/ssh golang.org/x/crypto/ssh/internal/bcrypt_pbkdf -# golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 +# golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b ## explicit; go 1.23.0 golang.org/x/exp/constraints golang.org/x/exp/maps golang.org/x/exp/slices -# golang.org/x/net v0.39.0 +# golang.org/x/net v0.41.0 ## explicit; go 1.23.0 golang.org/x/net/context golang.org/x/net/html golang.org/x/net/html/atom +golang.org/x/net/http/httpguts +golang.org/x/net/http2 +golang.org/x/net/http2/hpack golang.org/x/net/idna +golang.org/x/net/internal/httpcommon golang.org/x/net/publicsuffix -# golang.org/x/sys v0.32.0 +# golang.org/x/sys v0.33.0 ## explicit; go 1.23.0 golang.org/x/sys/cpu golang.org/x/sys/execabs golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/text v0.24.0 +# golang.org/x/text v0.26.0 ## explicit; go 1.23.0 golang.org/x/text/cases golang.org/x/text/encoding @@ -282,7 +302,7 @@ golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm golang.org/x/text/width -# golang.org/x/tools v0.32.0 +# golang.org/x/tools v0.34.0 ## explicit; go 1.23.0 golang.org/x/tools/go/ast/astutil golang.org/x/tools/go/buildutil @@ -291,7 +311,7 @@ golang.org/x/tools/go/loader # gopkg.in/yaml.v2 v2.4.0 ## explicit; go 1.15 gopkg.in/yaml.v2 -# maunium.net/go/mautrix v0.23.3 +# maunium.net/go/mautrix v0.24.1 ## explicit; go 1.23.0 maunium.net/go/mautrix maunium.net/go/mautrix/crypto @@ -325,7 +345,7 @@ maunium.net/go/mautrix/format/mdext maunium.net/go/mautrix/id maunium.net/go/mautrix/pushrules maunium.net/go/mautrix/sqlstatestore -# modernc.org/libc v1.63.0 +# modernc.org/libc v1.66.0 ## explicit; go 1.23.0 modernc.org/libc modernc.org/libc/errno @@ -356,10 +376,10 @@ modernc.org/libc/wctype # modernc.org/mathutil v1.7.1 ## explicit; go 1.21 modernc.org/mathutil -# modernc.org/memory v1.10.0 +# modernc.org/memory v1.11.0 ## explicit; go 1.23.0 modernc.org/memory -# modernc.org/sqlite v1.37.0 +# modernc.org/sqlite v1.38.0 ## explicit; go 1.23.0 modernc.org/sqlite modernc.org/sqlite/lib