From 534825490d7068ab228e72f9ebca91b14f344583 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Wed, 11 Oct 2023 11:50:55 +0530 Subject: [PATCH] added failing insert with negative value Signed-off-by: Harshit Gangal --- go/test/endtoend/vtgate/misc_test.go | 8 ++++++++ go/test/endtoend/vtgate/schema.sql | 3 +++ 2 files changed, 11 insertions(+) diff --git a/go/test/endtoend/vtgate/misc_test.go b/go/test/endtoend/vtgate/misc_test.go index 65a6a0525d6..83c41fd7183 100644 --- a/go/test/endtoend/vtgate/misc_test.go +++ b/go/test/endtoend/vtgate/misc_test.go @@ -27,6 +27,14 @@ import ( "github.com/stretchr/testify/require" ) +func TestInsertNeg(t *testing.T) { + conn, closer := start(t) + defer closer() + + utils.Exec(t, conn, "insert ignore into t10(id, sharding_key, col1, col2, col3) values(10, 20, 'a', 1, 2), (20, -20, 'b', 3, 4), (30, -40, 'c', 6, 7), (40, 60, 'd', 4, 10)") + utils.Exec(t, conn, "insert ignore into t10(id, sharding_key, col1, col2, col3) values(1, 2, 'a', 1, 2), (2, -2, 'b', -3, 4), (3, -4, 'c', 6, -7), (4, 6, 'd', 4, -10)") +} + func TestSelectNull(t *testing.T) { conn, closer := start(t) defer closer() diff --git a/go/test/endtoend/vtgate/schema.sql b/go/test/endtoend/vtgate/schema.sql index 536bec397ec..a883a26519f 100644 --- a/go/test/endtoend/vtgate/schema.sql +++ b/go/test/endtoend/vtgate/schema.sql @@ -143,6 +143,9 @@ create table t10 ( id bigint, sharding_key bigint, + col1 varchar(50), + col2 int, + col3 int, primary key (id) ) Engine = InnoDB;