You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// in file: pkg/sql/parser/parser.go:253
func ParseTableName(sql string) (*tree.UnresolvedObjectName, error) {
// We wrap the name we want to parse into a dummy statement since our parser
// can only parse full statements.
stmt, err := ParseOne(fmt.Sprintf("ALTER TABLE %s RENAME TO x", sql))
if err != nil {
return nil, err
}
rename, ok := stmt.AST.(*tree.RenameTable)
if !ok {
return nil, errors.AssertionFailedf("expected an ALTER TABLE statement, but found %T", stmt)
}
return rename.Name, nil
}
I think this function maybe parser tableName From a sql.
But when put sql into ALTER TABLE %s RENAME TO x, It mustn't be parsed ok
The text was updated successfully, but these errors were encountered:
what does function
ParseTableName
mean?I think this function maybe parser tableName From a sql.
But when put
sql
intoALTER TABLE %s RENAME TO x
, It mustn't be parsed okThe text was updated successfully, but these errors were encountered: