* [tarantool-patches] [PATCH 1/1] sql: drop a useless check from lookupName()
@ 2019-04-22 18:34 Vladislav Shpilevoy
2019-04-23 10:24 ` [tarantool-patches] " Kirill Yukhin
0 siblings, 1 reply; 2+ messages in thread
From: Vladislav Shpilevoy @ 2019-04-22 18:34 UTC (permalink / raw)
To: tarantool-patches; +Cc: kyukhin
There was a variable used as a counter from 0 to
uint32_t space_def->field_count. Obviously it can't be < 0, but
there was a check for that. Drop it.
The check was revealed during SQL BOOLEAN review, where one of
patches gets rid of some explicit Expr.type assignments.
---
Branch: https://github.com/tarantool/tarantool/tree/gerold103/drop-useless-check-from-resolve
src/box/sql/resolve.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/src/box/sql/resolve.c b/src/box/sql/resolve.c
index f601bca7b..504096e6d 100644
--- a/src/box/sql/resolve.c
+++ b/src/box/sql/resolve.c
@@ -337,18 +337,11 @@ lookupName(Parse * pParse, /* The parsing context */
}
if (iCol < (int)space_def->field_count) {
cnt++;
- if (iCol < 0) {
- pExpr->type =
- FIELD_TYPE_INTEGER;
- } else {
- uint64_t *mask =
- pExpr->iTable == 0 ?
- &pParse->oldmask :
- &pParse->newmask;
- column_mask_set_fieldno(mask,
- iCol);
- }
- pExpr->iColumn = (i16) iCol;
+ uint64_t *mask = pExpr->iTable == 0 ?
+ &pParse->oldmask :
+ &pParse->newmask;
+ column_mask_set_fieldno(mask, iCol);
+ pExpr->iColumn = iCol;
pExpr->space_def = space_def;
isTrigger = 1;
}
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-04-23 10:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-22 18:34 [tarantool-patches] [PATCH 1/1] sql: drop a useless check from lookupName() Vladislav Shpilevoy
2019-04-23 10:24 ` [tarantool-patches] " Kirill Yukhin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox