MCPcopy
hub / github.com/pingcap/tidb / toTable

Method toTable

pkg/planner/core/expression_rewriter.go:2501–2511  ·  view source on GitHub ↗

Now TableName in expression only used by sequence function like nextval(seq). The function arg should be evaluated as a table name rather than normal column name like mysql does.

(v *ast.TableName)

Source from the content-addressed store, hash-verified

2499// Now TableName in expression only used by sequence function like nextval(seq).
2500// The function arg should be evaluated as a table name rather than normal column name like mysql does.
2501func (er *expressionRewriter) toTable(v *ast.TableName) {
2502 fullName := v.Name.L
2503 if len(v.Schema.L) != 0 {
2504 fullName = v.Schema.L + "." + fullName
2505 }
2506 val := &expression.Constant{
2507 Value: types.NewDatum(fullName),
2508 RetType: types.NewFieldType(mysql.TypeString),
2509 }
2510 er.ctxStackAppend(val, types.EmptyName)
2511}
2512
2513func (er *expressionRewriter) toParamMarker(v *driver.ParamMarkerExpr) {
2514 var value *expression.Constant

Callers 1

LeaveMethod · 0.95

Calls 3

ctxStackAppendMethod · 0.95
NewDatumFunction · 0.92
NewFieldTypeFunction · 0.92

Tested by

no test coverage detected