-
Notifications
You must be signed in to change notification settings - Fork 24
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
Select never finds if used not primary key #58
Comments
Do you get results if you modify the following line: $rows = $tarantool->select('tester', 10, 'secondary', 100, 0, 3); ? |
Yes! The code returns rows, thanks! Could you change nulls to zeros in https://github.com/tarantool/tarantool-php-stubs? |
Providing null as a default argument value is a valid use case, so I think it's a bug of this client. /cc @bigbes
Replacing nulls with zeros will not work, as these two lines are not the same: $rows = $tarantool->select('tester', 10, 'secondary', 0, 0);
$rows = $tarantool->select('tester', 10, 'secondary'); Didn't test it, but I guess the first call will return an empty result, while the second one all matched records. |
Thanks, i will write wrapper. |
When PHP strict types mode is enabled (`declare(strict_types=1);`) the `offset` parameter passed as `null` to select() method does not pass validation. It looks quite natural to accept `null` here, because when the parameter is omitted the default value (zero) is assumed. A user may want to set the next parameter (`iterator`) and left `offset` to be default, so (s)he'll use `null`. The similar change was made for the `limit` in the scope of #58. After this commit `offset` and `limit` parameters behave in the same way. The functionality is already covered by the test suite (DMLTest::test_14_select_limit_defaults()), but the problem was not catched until now, because strict types mode is not enabled in tests. It'll be enabled in a following commit and the problem will be actually tested. Fixes #154.
When PHP strict types mode is enabled (`declare(strict_types=1);`) the `offset` parameter passed as `null` to select() method does not pass validation. It looks quite natural to accept `null` here, because when the parameter is omitted the default value (zero) is assumed. A user may want to set the next parameter (`iterator`) and left `offset` to be default, so (s)he'll use `null`. The similar change was made for the `limit` in the scope of #58. After this commit `offset` and `limit` parameters behave in the same way. The functionality is already covered by the test suite (DMLTest::test_14_select_limit_defaults()), but the problem was not catched until now, because strict types mode is not enabled in tests. It'll be enabled in a following commit and the problem will be actually tested. Fixes #154.
When PHP strict types mode is enabled (`declare(strict_types=1);`) the `offset` parameter passed as `null` to select() method does not pass validation. It looks quite natural to accept `null` here, because when the parameter is omitted the default value (zero) is assumed. A user may want to set the next parameter (`iterator`) and left `offset` to be default, so (s)he'll use `null`. The similar change was made for the `limit` in the scope of #58. After this commit `offset` and `limit` parameters behave in the same way. The functionality is already covered by the test suite (DMLTest::test_14_select_limit_defaults()), but the problem was not catched until now, because strict types mode is not enabled in tests. It'll be enabled in a following commit and the problem will be actually tested. Fixes #154.
I have such space
I have script ( i want find all rows less 10):
Variable $rows is always empty array.
The text was updated successfully, but these errors were encountered: