Skip to content

Conversation

max-hoffman
Copy link
Contributor

@max-hoffman max-hoffman commented Jun 10, 2022

Prepared AS OFs errored when the asof target was not a bindvar. All of our previous tests treated ASOF also as a bindvar.

companion PR: dolthub/dolt#3592

to, err = resolveTable(ctx, plan.NewUnresolvedTable(n.Name(), db), a)
var asof sql.Expression
if n.AsOf != nil {
asof = expression.NewLiteral(n.AsOf, nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this conversion step necessary? Why not just resolveTable(plan.NewUnresolvedTableAsOf(n.name, db, n.AsOf)?

to, err = resolveTable(ctx, plan.NewUnresolvedTable(n.Name(), db), a)
var asof sql.Expression
if n.AsOf != nil {
asof = expression.NewLiteral(n.AsOf, nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this conversion step necessary? Why not just resolveTable(plan.NewUnresolvedTableAsOf(n.name, db, n.AsOf)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The constructor expected an sql.Expression argument

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could do more work to clean up asof handling/do a type inference if you want

Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the test case that would have caught this?

@max-hoffman
Copy link
Contributor Author

@max-hoffman max-hoffman merged commit b82fd65 into main Jun 10, 2022
@max-hoffman max-hoffman deleted the max/prep-asof branch June 10, 2022 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants