Skip to content

Commit f5341c5

Browse files
authored
fix sql table column type throws error (#3501)
1 parent 67ab932 commit f5341c5

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

catalog/resource_sql_table_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,33 @@ func TestResourceSqlTableUpdateTable_ColumnsTypeThrowsError(t *testing.T) {
934934
)
935935
}
936936

937+
func TestResourceSqlTableUpdateTable_ColumnsTypeUpperLowerCaseThrowsError(t *testing.T) {
938+
resourceSqlTableUpdateColumnHelper(t,
939+
resourceSqlTableUpdateColumnTestMetaData{
940+
oldColumns: []SqlColumnInfo{
941+
{
942+
Name: "one",
943+
Type: "string", // Lower Case.
944+
Comment: "old comment",
945+
Nullable: false,
946+
},
947+
},
948+
newColumns: []SqlColumnInfo{
949+
{
950+
Name: "one",
951+
Type: "STRING", // Upper Case.
952+
Comment: "old comment",
953+
Nullable: true,
954+
},
955+
},
956+
allowedCommands: []string{
957+
"ALTER TABLE `main`.`foo`.`bar` ALTER COLUMN `one` DROP NOT NULL",
958+
},
959+
expectedErrorMsg: "",
960+
},
961+
)
962+
}
963+
937964
func TestResourceSqlTableUpdateTable_ColumnsAdditionAndUpdateThrowsError(t *testing.T) {
938965
resourceSqlTableUpdateColumnHelper(t,
939966
resourceSqlTableUpdateColumnTestMetaData{

0 commit comments

Comments
 (0)