We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$ genji version Genji v0.13.0 Genji CLI v0.13.0
Yes
genji test_index.db CREATE TABLE cars (name TEXT NOT NULL, color TEXT NOT NULL, price VARCHAR(128)); CREATE UNIQUE INDEX idx_cars_name_color ON cars(name, color); INSERT INTO cars (name, color, price) VALUES ("Tesla", "Red", "100000"); { "name": "Tesla", "color": "Red", "price": "100000" } UPDATE cars SET price = '500000' WHERE (name = 'Tesla' AND color = 'Red'); exit genji test_index.db UPDATE cars SET price = '777777' WHERE (name = 'Tesla' AND color = 'Red'); wrong index arity <- here I get an ERROR!
The same behavior is observed in the runnable program, not only in CLI. The problem only occurs when you run it again on an already created database.
Correct record update, no mistake.
Error: wrong index arity
$ go version go version go1.17 linux/amd64
go env
$ go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/misha/.cache/go-build" GOENV="/home/misha/.config/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/misha/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/misha/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.17" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/dev/null" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2235764675=/tmp/go-build -gno-record-gcc-switches"
In my research on the code, I came to the conclusion that this problem may be because when indexes loading from existing database https://github.com/genjidb/genji/blob/b9b312418718f6eb24f7fea5ce480aa133e526e3/internal/catalog/catalog.go#L73 their types are not filled https://github.com/genjidb/genji/blob/b9b312418718f6eb24f7fea5ce480aa133e526e3/internal/database/info.go#L90
In the case when the database is created for the first time, the types are successfully added when creating the index https://github.com/genjidb/genji/blob/b9b312418718f6eb24f7fea5ce480aa133e526e3/internal/catalog/catalog.go#L300
The text was updated successfully, but these errors were encountered:
Thanks for reporting @abramlab ! @KudinovKV fixed this issue (#434), feel free to reopen if you still experience the same problem
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
What version of Genji are you using?
Does this issue reproduce with the latest release?
Yes
What did you do?
The same behavior is observed in the runnable program, not only in CLI.
The problem only occurs when you run it again on an already created database.
What did you expect to see?
Correct record update, no mistake.
What did you see instead?
Error: wrong index arity
What Go version and environment are you using?
go env
OutputCode research
In my research on the code, I came to the conclusion that this problem may be because when indexes loading from existing database https://github.com/genjidb/genji/blob/b9b312418718f6eb24f7fea5ce480aa133e526e3/internal/catalog/catalog.go#L73
their types are not filled
https://github.com/genjidb/genji/blob/b9b312418718f6eb24f7fea5ce480aa133e526e3/internal/database/info.go#L90
In the case when the database is created for the first time, the types are successfully added when creating the index
https://github.com/genjidb/genji/blob/b9b312418718f6eb24f7fea5ce480aa133e526e3/internal/catalog/catalog.go#L300
The text was updated successfully, but these errors were encountered: