diff --git a/go/libraries/doltcore/sqle/enginetest/ddl_queries.go b/go/libraries/doltcore/sqle/enginetest/ddl_queries.go index 98c0164a6a..50e11ef5fc 100755 --- a/go/libraries/doltcore/sqle/enginetest/ddl_queries.go +++ b/go/libraries/doltcore/sqle/enginetest/ddl_queries.go @@ -644,4 +644,30 @@ var BrokenDDLScripts = []queries.ScriptTest{ }, }, }, + { + Name: "alter string column to truncate data", + SetUpScript: []string{ + "create table t1 (a int primary key, b varchar(3))", + "insert into t1 values (1, 'hi'), (2, 'bye')", + }, + Assertions: []queries.ScriptTestAssertion{ + { + Query: "alter table t1 modify b varchar(2)", + ExpectedErr: sql.ErrInvalidValue, // not sure of the type of error, but it should give one + }, + }, + }, + { + Name: "alter datetime column with invalid values", + SetUpScript: []string{ + "CREATE TABLE t3(pk BIGINT PRIMARY KEY, v1 DATETIME, INDEX(v1))", + "INSERT INTO t3 VALUES (0,'1999-11-02 17:39:38'),(1,'3021-01-08 02:59:27');", + }, + Assertions: []queries.ScriptTestAssertion{ + { + Query: "alter table t3 modify v1 timestamp", + ExpectedErr: sql.ErrInvalidValue, // not sure of the type of error, but it should give one + }, + }, + }, } diff --git a/integration-tests/bats/sql.bats b/integration-tests/bats/sql.bats index a5381ef3cf..2d4e3efd19 100755 --- a/integration-tests/bats/sql.bats +++ b/integration-tests/bats/sql.bats @@ -1026,18 +1026,10 @@ SQL skip_nbf_dolt_1 dolt sql <