On 12/25/2010 08:34 PM, Vikram Ambrose wrote:
> The first issue I had was that the parser was unable to find Tables in
> the SQL statement. This was because the parser assumed that the only
> possible white space around keywords was ' ' or 0x20;
>
> [...]
>
> The second bug was that the parser would always read past the first
> "endword" if there was a JOIN just before it. Resulting in tables
> being added to the list that don't exist. (eg. Artist.name, not a
> table but a field). Thus in order to fix this you need to check for
> endwords right away if you're parsing through JOINs.
>
>
And here is an update to the patch for a third bug.
The third bug is where the driver is unable to find functions in the SQL
query.
[...]
if ( function_flag == 1 ) {
free(statement_copy);
strcpy(curr_field,itemstore);
[...]
"itemstore" is a pointer into "statement_copy", and as such you cannot
free it before the strcpy().
The patch moves the free() after the strcpy() and the parser is now able
to correctly identify function return types.
Again, 380 tests pass, 0 fail.
By the way, Merry Christmas and a Happy New Year to everyone.
Vikram.
|