From f5341c586dd5d4c48f7270ef741adff25d39bbb3 Mon Sep 17 00:00:00 2001 From: case-k <40357957+case-k-git@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:01:48 +0900 Subject: [PATCH] fix sql table column type throws error (#3501) --- catalog/resource_sql_table_test.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/catalog/resource_sql_table_test.go b/catalog/resource_sql_table_test.go index b4e2ef0861..db26ccab51 100644 --- a/catalog/resource_sql_table_test.go +++ b/catalog/resource_sql_table_test.go @@ -934,6 +934,33 @@ func TestResourceSqlTableUpdateTable_ColumnsTypeThrowsError(t *testing.T) { ) } +func TestResourceSqlTableUpdateTable_ColumnsTypeUpperLowerCaseThrowsError(t *testing.T) { + resourceSqlTableUpdateColumnHelper(t, + resourceSqlTableUpdateColumnTestMetaData{ + oldColumns: []SqlColumnInfo{ + { + Name: "one", + Type: "string", // Lower Case. + Comment: "old comment", + Nullable: false, + }, + }, + newColumns: []SqlColumnInfo{ + { + Name: "one", + Type: "STRING", // Upper Case. + Comment: "old comment", + Nullable: true, + }, + }, + allowedCommands: []string{ + "ALTER TABLE `main`.`foo`.`bar` ALTER COLUMN `one` DROP NOT NULL", + }, + expectedErrorMsg: "", + }, + ) +} + func TestResourceSqlTableUpdateTable_ColumnsAdditionAndUpdateThrowsError(t *testing.T) { resourceSqlTableUpdateColumnHelper(t, resourceSqlTableUpdateColumnTestMetaData{