Skip to content

Commit

Permalink
fix DML routed queries
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui committed Feb 15, 2024
1 parent 3d238cf commit 3fee6cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions go/vt/vtgate/planbuilder/dml_planner.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func rewriteRoutedTables(stmt sqlparser.Statement, vschema plancontext.VSchema)
// if the user hasn't specified an alias, we'll insert one here so the old table name still works
aliasTbl.As = sqlparser.NewIdentifierCS(name.String())
}
tableName.Qualifier = sqlparser.IdentifierCS{}
tableName.Name = sqlparser.NewIdentifierCS(vschemaTable.Name.String())
aliasTbl.Expr = tableName
}
Expand Down
4 changes: 2 additions & 2 deletions go/vt/vtgate/planbuilder/testdata/dml_cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -4966,8 +4966,8 @@
"Query": "insert into music(id, user_id) values (:_id_0, :_user_id_0)",
"TableName": "music",
"VindexValues": {
"music_user_map": "2",
"user_index": "null"
"music_user_map": "INT64(2)",
"user_index": "NULL"
}
},
"TablesUsed": [
Expand Down

0 comments on commit 3fee6cc

Please sign in to comment.