From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 7E83222086 for ; Wed, 20 Feb 2019 06:57:46 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F2f73oeZbH8K for ; Wed, 20 Feb 2019 06:57:46 -0500 (EST) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id B1B36211A1 for ; Wed, 20 Feb 2019 06:57:45 -0500 (EST) From: Nikita Pettik Subject: [tarantool-patches] [PATCH 0/4] Fix integer overflow behaviour during VDBE execution Date: Wed, 20 Feb 2019 14:57:36 +0300 Message-Id: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: v.shpilevoy@tarantool.org, Nikita Pettik Branch: https://github.com/tarantool/tarantool/tree/np/gh-3735-integer-overflow Issue: https://github.com/tarantool/tarantool/issues/3735 Current patch-set fixes integer overflow behaviour during VDBE execution. Originally, SQLite acts quite misleading in such situations: intead of raising error, it simply treats overflowed integers as floating point numbers. Lets fix it everywhere it is possible (math and CAST operators, validate decoded msgpack). Nikita Pettik (4): sql: raise an error if int is overflowed during math operations sql: raise an integer overflow error during CAST sql: refactor sqlVdbeMsgpackGet() sql: raise integer overflow error during msgpack decode src/box/sql/vdbe.c | 21 ++++-- src/box/sql/vdbeInt.h | 13 +++- src/box/sql/vdbeaux.c | 132 ++++++++++++++++++------------------- src/box/sql/vdbemem.c | 8 ++- test/sql/integer-overflow.result | 76 +++++++++++++++++++++ test/sql/integer-overflow.test.lua | 34 ++++++++++ 6 files changed, 205 insertions(+), 79 deletions(-) create mode 100644 test/sql/integer-overflow.result create mode 100644 test/sql/integer-overflow.test.lua -- 2.15.1