TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
I try to use parser of tidb to parse statements like:
select * from d0.t0;
I wrote my visitor's Enter function like:
func (v *myVisitor) Enter(in ast.Node) (ast.Node, bool) {
...
if name, ok := in.(*ast.TableName); ok {
fmt.Println("schema is " + name.Schema.String())
}
...
}
The output of Schema.String() is empty.
This is because Schema.String() returns the value of Schema.O, and Schema.O is empty.
But Schema.L recorded the right schema name. I think Schema.O and Schema.L should return strings only have case-difference?
Bug Report
I try to use parser of tidb to parse statements like:
I wrote my visitor's Enter function like:
The output of Schema.String() is empty.
This is because Schema.String() returns the value of Schema.O, and Schema.O is empty.
But Schema.L recorded the right schema name. I think Schema.O and Schema.L should return strings only have case-difference?