[bug_fixed] ztable problem : editing and TableName

In this forum all bug reports concerning the 6.x branch will be gahtered. You have the possibility to track the bug fix process.

Moderators: EgonHugeist, mdaems

Post Reply
domi.papin
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 12.09.2006, 11:15

[bug_fixed] ztable problem : editing and TableName

Post by domi.papin »

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é ! :D
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

This backtick problem should be solved in Testing branch now. Will move to Trunk in a few weeks. Will be included in next beta/gamma release.

Can you please test and confirm? Now or at next release, it's up to you.

Mark
domi.papin
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 12.09.2006, 11:15

Post by domi.papin »

Hello,

Tested with latest svn testing branch. Backticks are ok for me, now.
Thanks for fixing that Mark.

Dominique
Post Reply