Skip to content
New issue

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

First create_index then select always resulting "has not index with name column_name" #264

Closed
kokizzu opened this issue Jan 14, 2023 · 1 comment

Comments

@kokizzu
Copy link

kokizzu commented Jan 14, 2023

How to reproduce:

git clone git@github.com:kokizzu/gorm-vs-korm.git
./clean-start.sh

go test -bench=Taran -benchmem .
2023-01-14 22:05:13.576 IsError ▶ go/src/gorm-vs-korm/mTest/rqTest/rqTest__ORM.GEN.go:63:  korm1/mTest/rqTest.(*TestTable2).FindByContent: TestTable2.FindByContent failed: test_table2
2023-01-14 21:47:55.114 IsError ▶ &errors.errorString{s:"space test_table2 has not index with name content"}
    StackTrace: 
        me/kyz/go/src/gorm-vs-korm/tarantool_test.go:137  korm1.BenchmarkGetRowS_Taran_ORM.func1

go test -bench=Taran -benchmem .
# no error on second run
@kokizzu kokizzu changed the title First create_index then select always resulting "has not index with name" First create_index then select always resulting "has not index with name column_name" Jan 14, 2023
@oleg-jukovec
Copy link
Collaborator

oleg-jukovec commented Jan 14, 2023

Hello, thank you for the issue. The reproducer code is too complicated for a reproducer and I could not run it:

$ go test -bench=Taran -benchmem .
# korm1 [korm1.test]
./main_test.go:82:4: undefined: gormPostgres
./main_test.go:84:10: undefined: gormPostgres
FAIL	korm1 [build failed]
FAIL

If I understand the problem correctly, the connector does not support auto-reload of the schema. It is a known issue:

#7
#259

The easiest way to solve the problem is to create a new connection after the index has been created. Also you could try to reload schema manually.

I close the issue as a duplicate, but you could re-open it if I'm wrong about the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants