While working on other parts of Vitess, we encountered this issue. The faulty code is:
func (c *Column) typeof(env *ExpressionEnv, fields []*querypb.Field) (sqltypes.Type, typeFlag) {
// if we have an active row in the expression Env, use that as an authoritative source
if c.Offset < len(env.Row) {
value := env.Row[c.Offset]
if value.IsNull() {
return sqltypes.Null, flagNull | flagNullable
}
return value.Type(), typeFlag(0)
}
// cut for brevity
The issue with this code is the NULL handling - for queries with outer joins, some rows can contain null values for a given column, and some will not. We need a better fallback for these situations.
While working on other parts of Vitess, we encountered this issue. The faulty code is:
The issue with this code is the
NULL
handling - for queries with outer joins, some rows can contain null values for a given column, and some will not. We need a better fallback for these situations.