Topic: Possible bug?

Hi,

have a database with 3 tables, one of which was called 'Selections'. I was not able to open it with the SQLitePass dataset, receiving an InternalOpen failure. The other tables opened just fine and so did this one from other tools like SQLiteSpy etc.

It occured to me that it might be because the table name started with a reserved SQL word, so I renamed it and, voila, it opens just fine....

Can you verify if this is a valid assessment?

Thanks
Kai

Re: Possible bug?

Hello Kai,

I don't think the bug is due to the table name.
Did you create new tables or modify the existing ones with different tools (sqlite administrator,  sqlite expert ...) ?

Could you please send your db by mail to let me check this out ? (even with empty table or fake data  if you are concerned by privacy).

Thanks.
Luc

Re: Possible bug?

Kai,

Thanks for your Db sample. You were right. The TSqlitePassSQLTokenizer doesn't do his job properly...

The problem occurs in the function IsKeyword (located in SqlitePassSQLStmts.inc)

function IsKeyword: Boolean;
    var
    i: Integer;
    TempText: WideString;
    begin
    Result := False;
    { Checks if the token is a SQL Keyword }
    For i := 0 to High(SelectStmtKeywords) do
        begin
        SetString(TempText, TokenStart, Length(SelectStmtKeywords[i]));
        if AnsiCompareText(TempText, SelectStmtKeywords[i]) = 0 then
           begin
           Result := True;
           Inc(CurrentChar, Length(SelectStmtKeywords[i]));
           Break;
           end;
        end;
    end;

I fix this bug in the next 0.55 version in order to have a more efficient parser with quoted identifiers and reserved SQL words.

Let me know if you have already an idea on How to code this part.
Many thanks for your "assessment".

Regards.
Luc

Re: Possible bug?

thanks lucky,..
for sharing nice and informative solution of many problems,...

Re: Possible bug?

I'm glad you fixed it Kai.

Re: Possible bug?

thanks too , i had same problem