Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: evalengine TypeOf for Columns #13149

Closed
systay opened this issue May 25, 2023 · 1 comment
Closed

Bug Report: evalengine TypeOf for Columns #13149

systay opened this issue May 25, 2023 · 1 comment

Comments

@systay
Copy link
Collaborator

systay commented May 25, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants