Exemple #1
0
func (e *havingAndOrderbyResolver) addProjectionExpr(v *ast.ColumnNameExpr, projCol *expression.Column) {
	// Avoid to append same column repeatly.
	for i, expr := range e.proj.Exprs {
		if expr == projCol {
			e.mapper[v] = e.proj.schema[i]
			return
		}
	}
	e.proj.Exprs = append(e.proj.Exprs, projCol)
	schemaCols, _ := projCol.DeepCopy().(*expression.Column)
	e.mapper[v] = schemaCols
	e.proj.schema = append(e.proj.schema, schemaCols)
}
Exemple #2
0
func (e *havingAndOrderbyResolver) addProjectionExpr(v *ast.ColumnNameExpr, projCol *expression.Column) {
	e.proj.Exprs = append(e.proj.Exprs, projCol)
	schemaCols, _ := projCol.DeepCopy().(*expression.Column)
	e.mapper[v] = schemaCols
	e.proj.schema = append(e.proj.schema, schemaCols)
}