Subject Re: Re[4]: [firebird-support] Why PLAN token is not allowed after ORDER BY?
Author Alec Swan
I would have never expected a parser token error if the query syntax is
correct but the plan itself is bad. That would have been a run-time, not
compile-time error!

And I just verified that what I am saying looks like an FB bug. Here is a
very simple example that reproduces the bug:

create table T (a int);
create asc index idx_Ta on T (a);
select * from T order by a; -- generates PLAN (T ORDER IDX_TA)
select * from T order by a PLAN (T ORDER IDX_TA);
ERROR: An "Invalid token ... Token unknown - line 4, column 28 PLAN"

Is there a workaround for specifying PLAN after ORDER BY?

Thanks,

Alec


On Sat, Jun 2, 2012 at 4:27 PM, Dmitry Kuzmenko <kdv@...> wrote:

> **
>
>
> Hello, Alec!
>
> AS> 2. Changed the query to "A INNER JOIN B ORDER BY X PLAN P", where P is
> the
> AS> plan generated by FB in #1. Received "Unexpected token PLAN" error.
> AS> 3. Change the query to "A INNER JOIN B PLAN P ORDER BY X" - success!
>
> AS> Why does #3 succeed but #2 fail?
>
> because inner join is not equal to left join.
>
> --
> Dmitry Kuzmenko, www.ib-aid.com
>
>
>


[Non-text portions of this message have been removed]