Skip to content

Commit 52ac432

Browse files
author
James Cor
committed
comments
1 parent ebe6018 commit 52ac432

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

sql/analyzer/fix_exec_indexes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ func (s *idxScope) visitSelf(n sql.Node) error {
454454
break
455455
}
456456
}
457+
// unable to find column, use copy with OnDupValuesPrefix or fallback
457458
if newC == nil {
458459
if len(destSch) != len(srcSch) {
459460
newC = c.Copy()

sql/planbuilder/dml.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ func (b *Builder) buildInsert(inScope *scope, i *ast.Insert) (outScope *scope) {
120120
combinedScope.insertColumnAliases = inScope.insertColumnAliases
121121
for i, c := range destScope.cols {
122122
combinedScope.newColumn(c)
123+
// if the srcScope is empty, it is a values statement
123124
if len(srcScope.cols) == 0 {
124125
// The to-be-inserted values can be referenced via the provided alias.
125126
c.table = combinedScope.insertTableAlias

0 commit comments

Comments
 (0)