From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp53.i.mail.ru (smtp53.i.mail.ru [94.100.177.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 8AE4F4696C3 for ; Sun, 26 Apr 2020 21:22:29 +0300 (MSK) References: <9a402676dbab6bdc4b1cbbdfc1f5069214fdfa06.1584707598.git.imeevma@gmail.com> <876090db-cb61-0c46-427a-d5a856fad4f1@tarantool.org> <20200421124250.GA21105@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Sun, 26 Apr 2020 20:22:27 +0200 MIME-Version: 1.0 In-Reply-To: <20200421124250.GA21105@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v1 1/1] sql: remove implicit cast for COMPARISON List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mergen Imeev Cc: tarantool-patches@dev.tarantool.org Hi! Seems like you didn't push the latest version. > diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c > index 724bc18..34bd38d 100644 > --- a/src/box/sql/vdbe.c > +++ b/src/box/sql/vdbe.c > @@ -3471,6 +3459,26 @@ skip_truncate: > assert(oc!=OP_SeekLT || r.default_rc==+1); > > r.aMem = &aMem[pOp->p3]; > + for (int i = 0; i < r.nField; ++i) { > + enum field_type type = r.key_def->parts[i].type; > + struct Mem *mem = &r.aMem[i]; > + if ((mem->flags & MEM_Str) != 0 && sql_type_is_numeric(type)) { > + diag_set(ClientError, ER_SQL_TYPE_MISMATCH, > + field_type_strs[type], mem_type_to_str(mem)); > + goto abort_due_to_error; > + } > + if (mem_apply_type(mem, type) != 0) { > + diag_set(ClientError, ER_SQL_TYPE_MISMATCH, > + field_type_strs[type], mem_type_to_str(mem)); > + goto abort_due_to_error; > + } > + if ((mem->flags & MEM_Real) != 0 && > + (type == FIELD_TYPE_INTEGER || > + type == FIELD_TYPE_UNSIGNED)) { > + res = 1; > + goto seek_not_found; > + } > + } What is happening in this cycle and the cycle below? > #ifdef SQL_DEBUG > { int i; for(i=0; i #endif > diff --git a/test/sql-tap/in1.test.lua b/test/sql-tap/in1.test.lua > index 570cc17..e2f4988 100755 > --- a/test/sql-tap/in1.test.lua > +++ b/test/sql-tap/in1.test.lua > @@ -637,12 +637,12 @@ test:do_test( > "in-11.2", > function() > -- The '2' should be coerced into 2 because t6.b is NUMERIC The comment is irrelevant now. And therefore the test probably too. Please, locate all other tests, which become wrong after this commit, and fix their comments or remove completely.