I am running Firebird 2.1. I have a table with a field "ESTIMATEITEM#" - everything is working fine but if I specifically call .REFRESH it generates an error "Project XXX raised exception class EDatabaseError with message 'TABLE: Field 'ESTIMATEITEM' not found'.
As you can see it is cutting of the '#' in the SQL.
I have verified this with tests.
How to solve?
Bug: Calling TZTable.Refresh will ignore #'s in FIELDNAMEs
Moderators: gto, cipto_kh, EgonHugeist
Take a look at the Tokenizer.pas
Search
constructor TZWordState.Create;
begin
SetWordChars(#0, #255, False);
SetWordChars('a', 'z', True);
SetWordChars('A', 'Z', True);
SetWordChars('0', '9', True);
SetWordChars('-', '-', True);
SetWordChars('_', '_', True);
SetWordChars(#39, #39, True);
SetWordChars(Char($c0), Char($ff), True);
end;
Here is the place where add
SetWordChars('#', '#', True);
Search
constructor TZWordState.Create;
begin
SetWordChars(#0, #255, False);
SetWordChars('a', 'z', True);
SetWordChars('A', 'Z', True);
SetWordChars('0', '9', True);
SetWordChars('-', '-', True);
SetWordChars('_', '_', True);
SetWordChars(#39, #39, True);
SetWordChars(Char($c0), Char($ff), True);
end;
Here is the place where add
SetWordChars('#', '#', True);
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
This is dangerous, however. Didn't test this specific case, but mysql treats # as a comment marker. So this line should be added to your database specific tokenizer. (TZInterbaseWordState.Create)
Can you make a test case and add that to the bug tracker? Please add a table creation script so we don't depend on a specific FB version.
Mark
Can you make a test case and add that to the bug tracker? Please add a table creation script so we don't depend on a specific FB version.
Mark
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Well, that means the problem is not the tokenizer but the query being fired to the server. Where the sql statement is made there must be some call to IdentifierConverter.Quote. (Search for 'quote' in the component directory and you'll find some samples)
Or, if the statement is provided by the user, he should just quote himself.
Mark
Or, if the statement is provided by the user, he should just quote himself.
Mark