Skip to content

Commit 4bab61b

Browse files
kyleconroyclaude
andcommitted
Uppercase TIMESTAMP column identifier in INSERT BULK
When TIMESTAMP is used alone as a column identifier without a data type in INSERT BULK statements, uppercase it to match ScriptDom behavior. Enables BulkInsertStatementTests test. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f23c6aa commit 4bab61b

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

parser/parse_dml.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,6 +2229,12 @@ func (p *Parser) parseInsertBulkColumnDefinition() (*ast.InsertBulkColumnDefinit
22292229
}
22302230
colDef.Column.DataType = dataType
22312231
}
2232+
} else if colDef.Column.DataType == nil {
2233+
// If no data type was parsed, check if the column name is TIMESTAMP
2234+
// This is a special case where TIMESTAMP alone is both the column name and type indicator
2235+
if strings.ToUpper(colDef.Column.ColumnIdentifier.Value) == "TIMESTAMP" {
2236+
colDef.Column.ColumnIdentifier.Value = "TIMESTAMP"
2237+
}
22322238
}
22332239

22342240
// Check for NULL or NOT NULL
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"todo": true}
1+
{}

0 commit comments

Comments
 (0)