[Tarantool-patches] [PATCH v5 3/6] sql: change comparison between numbers using index

Nikita Pettik korablev at tarantool.org
Fri Sep 18 11:08:21 MSK 2020


On 21 Aug 12:19, imeevma at tarantool.org wrote:
> This patch disables number conversions in ApplyType in wherecode.c. This
> allows conversions between numbers introduced in previous commit to be
> used.
> 
> Part of #4230
> ---
>  src/box/sql/sqlInt.h                 |  2 +
>  src/box/sql/vdbe.c                   |  3 +-
>  src/box/sql/wherecode.c              | 76 +---------------------------
>  test/sql-tap/in4.test.lua            |  4 +-
>  test/sql-tap/join.test.lua           |  4 +-
>  test/sql-tap/tkt-9a8b09f8e6.test.lua |  8 +--
>  test/sql/types.result                | 54 ++++++++++++++++++++
>  test/sql/types.test.lua              | 12 +++++
>  8 files changed, 79 insertions(+), 84 deletions(-)
> 
> diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
> index adf90d824..1e6f0f41f 100644
> --- a/src/box/sql/sqlInt.h
> +++ b/src/box/sql/sqlInt.h
> @@ -2309,6 +2309,8 @@ struct Parse {
>  #define OPFLAG_SYSTEMSP      0x20	/* OP_Open**: set if space pointer
>  					 * points to system space.
>  					 */
> +/** OP_ApplyType: Do not convert numbers. */

Useless comment.

> +#define OPFLAG_DO_NOT_CONVERT_NUMBERS	0x01
> diff --git a/test/sql/types.result b/test/sql/types.result
> index 442245186..8810a9f82 100644
> --- a/test/sql/types.result
> +++ b/test/sql/types.result
> @@ -2795,3 +2795,57 @@ box.execute([[DROP TABLE ts;]])
>  ---
>  - row_count: 1
>  ...
> +--
> +-- gh-4230: Make sure the comparison between numbers that use
> +-- index is working correctly.
> +--
> +box.execute([[CREATE TABLE t (i INTEGER PRIMARY KEY, a DOUBLE);]])
> +---
> +- row_count: 1
> +...
> +box.execute([[INSERT INTO t VALUES (1, ?);]], {2^60})

I'd place also eqp statements to make sure that index is really used.

> +---
> +- row_count: 1
> +...


More information about the Tarantool-patches mailing list