go-tarantool icon indicating copy to clipboard operation
go-tarantool copied to clipboard

Native UPDATE query not working

Open god1dog opened this issue 9 months ago • 5 comments

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)

god1dog avatar Feb 27 '25 11:02 god1dog

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

https://github.com/tarantool/go-tarantool/blob/536864682eaaad428cb2491131ad2c8ab8ae0506/tarantool_test.go#L1293

https://github.com/tarantool/go-tarantool/blob/536864682eaaad428cb2491131ad2c8ab8ae0506/tarantool_test.go#L1364-L1370

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

https://github.com/tarantool/go-tarantool/blob/536864682eaaad428cb2491131ad2c8ab8ae0506/tarantool_test.go#L1459-L1461

oleg-jukovec avatar Feb 27 '25 11:02 oleg-jukovec

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

god1dog avatar Mar 10 '25 11:03 god1dog

@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.

oleg-jukovec avatar Mar 10 '25 13:03 oleg-jukovec

But I have this problem.

god1dog avatar Mar 11 '25 05:03 god1dog

But I have this problem.

Please show the space format and provide a minimal reproducer.

oleg-jukovec avatar Mar 11 '25 05:03 oleg-jukovec