-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Array indexes are changed #16
Comments
@nekufa The similar issue is discussed here: tarantool/tarantool-php#89 |
I don't think it should be fixed on the client side. It looks like a Tarantool issue to me, the client receives |
As discussed on Tarantool chat, to force Tarantool to pack in to map/array structures you need to specify the __serialize hint: print_r($client->evaluate('
local result = {}
result[8] = 15
return result
')->getData());
print_r($client->evaluate('
local result = setmetatable({}, { __serialize = "map" })
result[8] = 15
return result
')->getData()); Output:
|
Thanks |
I use this code to calculate something in lua grouped by integer key
Running the code will provide this result.
Please note that index was decreased by one.
I found workaround - initialize with non-integer key, so the result keeps good:
This way i see expected result.
Maybe there is a way to keep it working without any workaround?
For example, change indexes only when all keys are integer, goes one by one and last equals table size.
The text was updated successfully, but these errors were encountered: