Skip to content

Write in log when see select(nil) #276

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

Closed
kyukhin opened this issue Apr 21, 2022 · 2 comments · Fixed by #277
Closed

Write in log when see select(nil) #276

kyukhin opened this issue Apr 21, 2022 · 2 comments · Fixed by #277
Assignees
Labels
feature A new functionality

Comments

@kyukhin
Copy link

kyukhin commented Apr 21, 2022

Extracted from tarantool/tarantool#6539

After internal discussion, we decided:

  • Warn the user about potentially dangerous code
  • With logging level - CRIT
  • For all cases:
    • crud:select()
    • crud:select(nil)
    • crud:select{}
  • With ratelimit (it's worth raising it higher than 0.5 sec for this particular case)
  • Add the option fullscan=true to suppress the message in the log
@Totktonada
Copy link
Member

How it is implemented in tarantool: tarantool/tarantool#7064. (At the moment of writing this, the pull request is in review and things may change.)

oleg-jukovec added a commit that referenced this issue Apr 29, 2022
Empty or nil select calls on user spaces tend to be
dangerous.

To mitigate this, a critical log entry containing the current stack
traceback is created upon such function calls — a user can explicitly
request a full scan though by passing fullscan = true to select's
options table argument in which a case a log entry will not be created.

Closes #276
oleg-jukovec added a commit that referenced this issue Apr 29, 2022
Empty or nil select calls on user spaces tend to be
dangerous.

To mitigate this, a critical log entry containing the current stack
traceback is created upon such function calls — a user can explicitly
request a full scan though by passing fullscan = true to select's
options table argument in which a case a log entry will not be created.

Closes #276
oleg-jukovec added a commit that referenced this issue Apr 29, 2022
Empty or nil select calls on user spaces tend to be
dangerous.

To mitigate this, a critical log entry containing the current stack
traceback is created upon such function calls — a user can explicitly
request a full scan though by passing fullscan = true to select's
options table argument in which a case a log entry will not be created.

Closes #276
oleg-jukovec added a commit that referenced this issue Apr 29, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue Apr 29, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue Apr 29, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue May 4, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue May 4, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue May 5, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue May 5, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue May 5, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue May 5, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue May 5, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue May 5, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue May 5, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue May 5, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue May 5, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue May 5, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue May 5, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue May 5, 2022
Empty or nil select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon empty or nil select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
@oleg-jukovec
Copy link
Contributor

Requirements have been updated:

tarantool/tarantool#7129

oleg-jukovec added a commit that referenced this issue May 13, 2022
Unlimited select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon unlimited select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Closes #276
oleg-jukovec added a commit that referenced this issue May 13, 2022
Unlimited select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon unlimited select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Part of #276
oleg-jukovec added a commit that referenced this issue May 13, 2022
Unlimited select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon unlimited select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Part of #276
oleg-jukovec added a commit that referenced this issue May 13, 2022
Unlimited select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon unlimited select calls — a user can explicitly request a full
scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1].

1. tarantool/tarantool#7064

Part of #276
oleg-jukovec added a commit that referenced this issue May 13, 2022
Unlimited count calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon unlimited count calls — a user can explicitly request a full
scan though by passing fullscan = true to count's options table
argument in which a case a log entry will not be created.

Closes #276
oleg-jukovec added a commit that referenced this issue May 16, 2022
Potentially long select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long select calls — a user can explicitly request a
full scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1][2].

1. tarantool/tarantool#7064
2. tarantool/tarantool#7131

Part of #276
oleg-jukovec added a commit that referenced this issue May 16, 2022
Potentially long count calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long count calls — a user can explicitly request a
full scan though by passing fullscan = true to count's options table
argument in which a case a log entry will not be created.

Closes #276
oleg-jukovec added a commit that referenced this issue May 16, 2022
Potentially long select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long select calls — a user can explicitly request a
full scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1][2].

1. tarantool/tarantool#7064
2. tarantool/tarantool#7131

Part of #276
oleg-jukovec added a commit that referenced this issue May 16, 2022
Potentially long count calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long count calls — a user can explicitly request a
full scan though by passing fullscan = true to count's options table
argument in which a case a log entry will not be created.

Closes #276
oleg-jukovec added a commit that referenced this issue May 16, 2022
Potentially long select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long select calls — a user can explicitly request a
full scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1][2].

1. tarantool/tarantool#7064
2. tarantool/tarantool#7131

Part of #276
oleg-jukovec added a commit that referenced this issue May 16, 2022
Potentially long count calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long count calls — a user can explicitly request a
full scan though by passing fullscan = true to count's options table
argument in which a case a log entry will not be created.

Closes #276
oleg-jukovec added a commit that referenced this issue May 24, 2022
Potentially long select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long select calls — a user can explicitly request a
full scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1][2].

1. tarantool/tarantool#7064
2. tarantool/tarantool#7131

Part of #276
oleg-jukovec added a commit that referenced this issue May 24, 2022
Potentially long count calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long count calls — a user can explicitly request a
full scan though by passing fullscan = true to count's options table
argument in which a case a log entry will not be created.

Closes #276
oleg-jukovec added a commit that referenced this issue May 24, 2022
Potentially long select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long select calls — a user can explicitly request a
full scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1][2].

1. tarantool/tarantool#7064
2. tarantool/tarantool#7131

Part of #276
oleg-jukovec added a commit that referenced this issue May 24, 2022
Potentially long count calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long count calls — a user can explicitly request a
full scan though by passing fullscan = true to count's options table
argument in which a case a log entry will not be created.

Closes #276
oleg-jukovec added a commit that referenced this issue May 24, 2022
Potentially long count calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long count calls — a user can explicitly request a
full scan though by passing fullscan = true to count's options table
argument in which a case a log entry will not be created.

Closes #276
oleg-jukovec added a commit that referenced this issue May 25, 2022
Potentially long count calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long count calls — a user can explicitly request a
full scan though by passing fullscan = true to count's options table
argument in which a case a log entry will not be created.

Closes #276
oleg-jukovec added a commit that referenced this issue Jun 1, 2022
Potentially long select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long select calls — a user can explicitly request a
full scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1][2].

1. tarantool/tarantool#7064
2. tarantool/tarantool#7131

Part of #276
oleg-jukovec added a commit that referenced this issue Jun 1, 2022
Potentially long count calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long count calls — a user can explicitly request a
full scan though by passing fullscan = true to count's options table
argument in which a case a log entry will not be created.

Closes #276
oleg-jukovec added a commit that referenced this issue Jun 9, 2022
Potentially long select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long select calls — a user can explicitly request a
full scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1][2].

1. tarantool/tarantool#7064
2. tarantool/tarantool#7131

Part of #276
oleg-jukovec added a commit that referenced this issue Jun 9, 2022
Potentially long count calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long count calls — a user can explicitly request a
full scan though by passing fullscan = true to count's options table
argument in which a case a log entry will not be created.

Closes #276
oleg-jukovec added a commit that referenced this issue Jun 14, 2022
Potentially long select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long select calls — a user can explicitly request a
full scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1][2].

1. tarantool/tarantool#7064
2. tarantool/tarantool#7131

Part of #276
oleg-jukovec added a commit that referenced this issue Jun 14, 2022
Potentially long count calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long count calls — a user can explicitly request a
full scan though by passing fullscan = true to count's options table
argument in which a case a log entry will not be created.

Closes #276
oleg-jukovec added a commit that referenced this issue Jun 15, 2022
Potentially long select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long select calls — a user can explicitly request a
full scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1][2].

1. tarantool/tarantool#7064
2. tarantool/tarantool#7131

Part of #276
oleg-jukovec added a commit that referenced this issue Jun 15, 2022
Potentially long count calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long count calls — a user can explicitly request a
full scan though by passing fullscan = true to count's options table
argument in which a case a log entry will not be created.

Closes #276
DifferentialOrange pushed a commit that referenced this issue Jun 15, 2022
Potentially long select calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long select calls — a user can explicitly request a
full scan though by passing fullscan = true to select's options table
argument in which a case a log entry will not be created.

Tarantool has a similar implementation[1][2].

1. tarantool/tarantool#7064
2. tarantool/tarantool#7131

Part of #276
DifferentialOrange pushed a commit that referenced this issue Jun 15, 2022
Potentially long count calls on user spaces tend to be dangerous.

A critical log entry containing the current stack traceback is created
upon potentially long count calls — a user can explicitly request a
full scan though by passing fullscan = true to count's options table
argument in which a case a log entry will not be created.

Closes #276
DifferentialOrange added a commit that referenced this issue Jun 15, 2022
Overview

    This is a bugfix release. Several cases of pagination using select
    with after was fixed or improved. Warning has been added to
    potentially long select and count calls. Storage select errors
    were reworked to be consistent with other calls errors.

Breaking changes

    There are no breaking changes in the release.

New features

    * Optimize `crud.select()` without conditions and with
    `after` (PR #295).

    * A critical log entry containing the current stack traceback is
    created upon potentially long `select` and `count` calls —
    an user can explicitly request a full scan through by passing
    `fullscan=true` to `select` or `count` options table argument
    in which case a log entry will not be created (#276).

Bugfixes

    * Make select error description more informative when merger
    built-in module or tuple-merger external module is used
    in case of disabled/uninit storage (#229).

    * `crud.select()` if a condition is '<=' and it's
    value < `after` (PR #295).

    Previous releases:

    tarantool> crud.select('developers',
             > {{'<=', 'id', 3}}, {first = 10, after = rows[5]}).rows
    ---
    - - [2, 401, 'Sergey', 'Allred', 21]
      - [1, 477, 'Alexey', 'Adams', 20]
    ...

    After this release:

    tarantool> crud.select('developers',
             > {{'<=', 'id', 3}}, {first = 10, after = rows[5]}).rows
    ---
    - - [3, 2804, 'Pavel', 'Adams', 27]
      - [2, 401, 'Sergey', 'Allred', 21]
      - [1, 477, 'Alexey', 'Adams', 20]
    ...

    * `crud.select()` filtration by a first condition if the condition
    is '>' or '>=' and it's value > `after` (PR #295).

    Previous releases:

    tarantool> crud.select('developers',
             > {{'>=', 'id', 5}}, {first = 10, after = rows[2]}).rows
    ---
    - - [3, 2804, 'Pavel', 'Adams', 27]
      - [4, 1161, 'Mikhail', 'Liston', 51]
      - [5, 1172, 'Dmitry', 'Jacobi', 16]
      - [6, 1064, 'Alexey', 'Sidorov', 31]
    ...

    After this release:

    tarantool> crud.select('developers',
             > {{'>=', 'id', 5}}, {first = 10, after = rows[2]}).rows
    ---
      - [5, 1172, 'Dmitry', 'Jacobi', 16]
      - [6, 1064, 'Alexey', 'Sidorov', 31]
    ...

    * `crud.select()` results order with negative `first` (PR #295).
    * `crud.select()` if a condition is '=' or '==' with
    negative `first` (PR #295).

    Suppose we have a non-unique secondary index by the field `age`
    field and a space:

    tarantool> crud.select('developers', nil, {first = 10})
    ---
    - metadata: [{'name': 'id', 'type': 'unsigned'},
        {'name': 'bucket_id', 'type': 'unsigned'},
        {'name': 'name', 'type': 'string'},
        {'name': 'surname', 'type': 'string'},
        {'name': 'age', 'type': 'number'}]
      rows:
      - [1, 477, 'Alexey', 'Adams', 20]
      - [2, 401, 'Sergey', 'Allred', 27]
      - [3, 2804, 'Pavel', 'Adams', 27]
      - [4, 1161, 'Mikhail', 'Liston', 27]
      - [5, 1172, 'Dmitry', 'Jacobi', 27]
      - [6, 1064, 'Alexey', 'Sidorov', 31]
    - null
    ...

    Previous releases:

    tarantool> crud.select('developers',
             > {{'=', 'age', 27}}, {first = -10, after = rows[4]}).rows
    ---
    - []
    ...

    After this release:

    tarantool> crud.select('developers',
             > {{'=', 'age', 27}}, {first = -10, after = rows[4]}).rows
    ---
    - - [2, 401, 'Sergey', 'Allred', 27]
      - [3, 2804, 'Pavel', 'Adams', 27]
    ...
DifferentialOrange added a commit that referenced this issue Jun 15, 2022
Overview

    This is a bugfix release. Several cases of pagination using select
    with after was fixed or improved. Warning has been added to
    potentially long select and count calls. Storage select errors
    were reworked to be consistent with other calls errors.

Breaking changes

    There are no breaking changes in the release.

New features

    * Optimize `crud.select()` without conditions and with
    `after` (PR #295).

    * A critical log entry containing the current stack traceback is
    created upon potentially long `select` and `count` calls —
    an user can explicitly request a full scan through by passing
    `fullscan=true` to `select` or `count` options table argument
    in which case a log entry will not be created (#276).

Bugfixes

    * Make select error description more informative when merger
    built-in module or tuple-merger external module is used
    in case of disabled/uninit storage (#229).

    * `crud.select()` if a condition is '<=' and it's
    value < `after` (PR #295).

    Previous releases:

    tarantool> crud.select('developers',
             > {{'<=', 'id', 3}}, {first = 10, after = rows[5]}).rows
    ---
    - - [2, 401, 'Sergey', 'Allred', 21]
      - [1, 477, 'Alexey', 'Adams', 20]
    ...

    After this release:

    tarantool> crud.select('developers',
             > {{'<=', 'id', 3}}, {first = 10, after = rows[5]}).rows
    ---
    - - [3, 2804, 'Pavel', 'Adams', 27]
      - [2, 401, 'Sergey', 'Allred', 21]
      - [1, 477, 'Alexey', 'Adams', 20]
    ...

    * `crud.select()` filtration by a first condition if the condition
    is '>' or '>=' and it's value > `after` (PR #295).

    Previous releases:

    tarantool> crud.select('developers',
             > {{'>=', 'id', 5}}, {first = 10, after = rows[2]}).rows
    ---
    - - [3, 2804, 'Pavel', 'Adams', 27]
      - [4, 1161, 'Mikhail', 'Liston', 51]
      - [5, 1172, 'Dmitry', 'Jacobi', 16]
      - [6, 1064, 'Alexey', 'Sidorov', 31]
    ...

    After this release:

    tarantool> crud.select('developers',
             > {{'>=', 'id', 5}}, {first = 10, after = rows[2]}).rows
    ---
      - [5, 1172, 'Dmitry', 'Jacobi', 16]
      - [6, 1064, 'Alexey', 'Sidorov', 31]
    ...

    * `crud.select()` results order with negative `first` (PR #295).
    * `crud.select()` if a condition is '=' or '==' with
    negative `first` (PR #295).

    Suppose we have a non-unique secondary index by the field `age`
    field and a space:

    tarantool> crud.select('developers', nil, {first = 10})
    ---
    - metadata: [{'name': 'id', 'type': 'unsigned'},
        {'name': 'bucket_id', 'type': 'unsigned'},
        {'name': 'name', 'type': 'string'},
        {'name': 'surname', 'type': 'string'},
        {'name': 'age', 'type': 'number'}]
      rows:
      - [1, 477, 'Alexey', 'Adams', 20]
      - [2, 401, 'Sergey', 'Allred', 27]
      - [3, 2804, 'Pavel', 'Adams', 27]
      - [4, 1161, 'Mikhail', 'Liston', 27]
      - [5, 1172, 'Dmitry', 'Jacobi', 27]
      - [6, 1064, 'Alexey', 'Sidorov', 31]
    - null
    ...

    Previous releases:

    tarantool> crud.select('developers',
             > {{'=', 'age', 27}}, {first = -10, after = rows[4]}).rows
    ---
    - []
    ...

    After this release:

    tarantool> crud.select('developers',
             > {{'=', 'age', 27}}, {first = -10, after = rows[4]}).rows
    ---
    - - [2, 401, 'Sergey', 'Allred', 27]
      - [3, 2804, 'Pavel', 'Adams', 27]
    ...
@Totktonada Totktonada added the 3sp label Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants