[Tarantool-patches] [PATCH v2 4/7] sql: remove mem_apply_type() from OP_MustBeInt

Nikita Pettik korablev at tarantool.org
Mon Jun 22 13:07:49 MSK 2020


On 17 Jun 15:36, imeevma at tarantool.org wrote:
> This patch replaces mem_apply_type() with mem_check_types() in
> OP_MustBeInt, which allows to remove implicit cast in some places,
> for example, in the IN statement.
> 
> Part of #4230
> ---
>  src/box/sql/vdbe.c                   |   2 +-
>  test/sql-tap/e_select1.test.lua      |  17 +-
>  test/sql-tap/in4.test.lua            |  97 +--
>  test/sql-tap/join.test.lua           |   1 -
>  test/sql-tap/limit.test.lua          |   2 +-
>  test/sql-tap/tkt-9a8b09f8e6.test.lua |  24 +-
>  test/sql-tap/tkt-fc7bd6358f.test.lua | 111 ----
>  test/sql-tap/transitive1.test.lua    |   4 +-
>  test/sql-tap/whereB.test.lua         | 900 ---------------------------
>  test/sql-tap/whereC.test.lua         |   8 +-
>  10 files changed, 19 insertions(+), 1147 deletions(-)
>  delete mode 100755 test/sql-tap/tkt-fc7bd6358f.test.lua
>  delete mode 100755 test/sql-tap/whereB.test.lua
> 
> diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
> index eb5c89e9d..77b758833 100644
> --- a/src/box/sql/vdbe.c
> +++ b/src/box/sql/vdbe.c
> @@ -2096,7 +2096,7 @@ case OP_AddImm: {            /* in1 */
>  case OP_MustBeInt: {            /* jump, in1 */
>  	pIn1 = &aMem[pOp->p1];
>  	if ((pIn1->flags & (MEM_Int | MEM_UInt)) == 0) {
> -		mem_apply_type(pIn1, FIELD_TYPE_INTEGER);
> +		mem_check_types(pIn1, FIELD_TYPE_INTEGER);
>  		if ((pIn1->flags & (MEM_Int | MEM_UInt)) == 0) {
>  			if (pOp->p2==0) {
>  				diag_set(ClientError, ER_SQL_TYPE_MISMATCH,

Have the code coverage changed after these patches?
I'm wondering since a lot of tests are removed now (I believe
due to redundancy, so in perfect case coverage may even increase).

> index 7673426f4..578620fca 100755
> --- a/test/sql-tap/e_select1.test.lua
> +++ b/test/sql-tap/e_select1.test.lua
> @@ -1,6 +1,6 @@
>  #!/usr/bin/env tarantool
>  test = require("sqltester")
> -test:plan(510)
> +test:plan(509)
>  


More information about the Tarantool-patches mailing list