dolthub / dolt

Dolt – Git for Data
Apache License 2.0
17.96k stars 513 forks source link

Prepared statements don't work with `as of` #6300

Open macneale4 opened 1 year ago

macneale4 commented 1 year ago

Probably the easiest thing to do is show you code:

https://github.com/dolthub/dolt/pull/new/macneale4/prepared-bug-report

This temporary test shows a enginetest script which passes without trouble with enginetest.TestScript but fails with enginetest.TestScriptPrepared

The thing which distinguishes the failing queries is that they contain as of.

When running the following query:

select * from test as of 'HEAD' where pk = 2;

The following error is generated:

column "pk" could not be found in any table in scope

But the query works fine if you remove as of 'HEAD'

max-hoffman commented 1 year ago

When we were debugging this, expandStars was failing to convert the star expression in his example projection. That's as far as we got.