Skip to content

Native UPDATE query not working #432

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

Open
god1dog opened this issue Feb 27, 2025 · 5 comments
Open

Native UPDATE query not working #432

god1dog opened this issue Feb 27, 2025 · 5 comments
Labels
needs feedback Something is unclear with the issue

Comments

@god1dog
Copy link

god1dog commented Feb 27, 2025

When sending the request via go-tarantool, nothing is updated and there are no errors with the CASE "id" WHEN ? THEN construct. However, when the same query is sent via DataGrip, everything works fine.

Example query:

UPDATE "attribute" SET "value" = CASE "id" WHEN ? THEN null END WHERE "id" IN (?)
req := tarantool.NewExecuteRequest(query).Args(args).Context(ctx)
@oleg-jukovec
Copy link
Collaborator

oleg-jukovec commented Feb 27, 2025

Please provide the space format and a minimal reproducer. Everything works in our test scenarios, so maybe you are doing something wrong:

updateQuery = "UPDATE SQL_SPACE SET NAME=? WHERE ID=?;"

go-tarantool/tarantool_test.go

Lines 1364 to 1370 in 5368646

{
updateQuery,
[]interface{}{"test_test", "1"},
SQLInfo{AffectedCount: 1},
[]interface{}{},
nil,
},

In addition, an execute response must be checked in the specific way:

go-tarantool/tarantool_test.go

Lines 1459 to 1461 in 5368646

exResp, ok := resp.(*ExecuteResponse)
assert.True(t, ok, "Got wrong response type")
sqlInfo, err := exResp.SQLInfo()

@oleg-jukovec oleg-jukovec added the needs feedback Something is unclear with the issue label Feb 27, 2025
@god1dog
Copy link
Author

god1dog commented Mar 10, 2025

@oleg-jukovec pay attention to the construction CASE "id" WHEN ? THEN null

@oleg-jukovec
Copy link
Collaborator

@oleg-jukovec pay attention to the construction CASE "id" WHEN ? THEN null

The connector does not process or affect such constructs in any way. It simply passes them on to the Tarantool as is.

@god1dog
Copy link
Author

god1dog commented Mar 11, 2025

But I have this problem.

@oleg-jukovec
Copy link
Collaborator

oleg-jukovec commented Mar 11, 2025

But I have this problem.

Please show the space format and provide a minimal reproducer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs feedback Something is unclear with the issue
Projects
None yet
Development

No branches or pull requests

2 participants