Hello,
I'm using svn trunk of zeos and delphi6 to access a Mysql5 server.
First problem : TableName
If I set TableName to 8Image, zeos raise an error like "table Image does not exist". After some debugging, I found that the tokenizer split the '8' char and the following of table name. There is a workaround if I surround TableName with Backquote. for my purpose, I have set this automatically in TZAbstractTable.SetTableName method.
Second problem: Editing
My ZTable is a datasource for a DBGrid that as editing capabilities. But, commiting won't work and raise the error 'Cannot update this query type'. Any hint ?
Update 1:
I have made some debug on the second problem. Unfortunately, it seems that my workaround for TableName leads to the second error. In TZGenericStatementAnalyser.FillTableRefs my table name is parsed as a ttQuoted token AND seems untreated in the following algo. am i right ?
Update 2 :
After debugging this afternoon, I found out how to correct the misbehaviours described above. Effectively, there is I think two bugs in the tokenizer.
The first one is for sql token that should be of ttWord type like a table name but begins with a digit. In that case the tokenizer calls a TZMySQLNumberState.NextToken which is incomplete and does not detect the problem. I hacked the code to call a TZMySQLWordState instead if it does not find indeed a number.
Second is perhaps a bug but i can't be sure.... But As I said in my update 1, If you use a quoted table name then TZGenericStatementAnalyser.FillTableRefs ignore it and doesn't fill the structure needed for update queries.... There I also blame the tokenizer and hacked TZGenericStatementAnalyser.TokenizeQuery and TZTokenizer.TokenizeStreamToList. I have added toDecodeStrings on the call of the second function and forced a knew TokenType after decoding.
Finally, I am here with something that works great. Pffou ! Sauvé !
[bug_fixed] ztable problem : editing and TableName
Moderators: EgonHugeist, mdaems
-
- Fresh Boarder
- Posts: 13
- Joined: 12.09.2006, 11:15
-
- Fresh Boarder
- Posts: 13
- Joined: 12.09.2006, 11:15