Gary Bentley - 2009-03-31

Hi,

Thanks for reporting this.

This is due to the way that inner selects work. Because they cannot be inited until execution time the anonymous bind variable has not been allocated an internal name, so in effect (for the 2nd query) "johnnyTester" becomes bind variable 1 and then "key" becomes 2 and "val" becomes 3. For the first query it just so happens that the bind variables will be in the correct order at execution time.

The fix for this will take a while and probably needs to be placed into the parser (where there is at least a single place where the anonymous names can be allocated). For now I'd recommend that you use named variables which won't have the same issue.

Thanks,

Gary