diff --git a/go/vt/vtgate/engine/insert.go b/go/vt/vtgate/engine/insert.go index ec2a54f106e..a15c2c0e668 100644 --- a/go/vt/vtgate/engine/insert.go +++ b/go/vt/vtgate/engine/insert.go @@ -588,16 +588,22 @@ func (ins *Insert) processUnowned(vcursor VCursor, vindexColumnsKeys [][]sqltype if err != nil { return err } + + var mismatchVindexKeys [][]sqltypes.Value for i, v := range verified { + rowNum := verifyIndexes[i] if !v { if ins.Opcode != InsertShardedIgnore { - return fmt.Errorf("values %v for column %v does not map to keyspace ids", vindexColumnsKeys, colVindex.Columns) + mismatchVindexKeys = append(mismatchVindexKeys, vindexColumnsKeys[rowNum]) + continue } // InsertShardedIgnore: skip the row. ksids[verifyIndexes[i]] = nil - continue } } + if len(mismatchVindexKeys) > 0 { + return fmt.Errorf("values %v for column %v does not map to keyspace ids", mismatchVindexKeys, colVindex.Columns) + } } return nil }