Hi Michale,
thank you for the quick reply. I'll test myself as soon as I get around and will post the result here. By the way, i found another thread which has been locked a long time ago. It is related to this bug, interestingly:
http://zeoslib.sourceforge.net/viewtopi ... 9&start=45
Funny enough, 7.1.4. can write BIT columns but fails to read them correctly (always return 0). What happened now, is this:
- actual value = 1
- Zeos reads 0
- program tries to update to 1
- exception thrown because nothing got updated
- programmer furious!
As you can see, throwing an exception in this case is a bad thing. I give you a another, real life example:
- program reads row without transaction (not really unusual in MySQL as you should be aware, as the popular storage engine does not even support transactions)
- column has value X
- program decides that value Y would be better
- another process, user, whatever, gets the same idea, but is faster: updates to X -> Y
- now program intends to update the column and... exception!
I understand the intention of this check. If one is not using a primary key and a very selective query (only a few columns) with wmWhereAll, it might be possible to update hundreds of columns instead of one. That would indeed be a real bummer. The intention of this warning is implied by the wording of the message "only one...". However, it does not say "at least one and only one...".
If I remember the source code correctly, there is a check if "columns updated" <> "columns intended to update". Wouldn't it better to code it if "columns updated" > "columns intended to update"? Or accept the value 0 explicitly?
By the way, I m not aware of other DBMS to report "zero rows updated" in that case. At least not so in MS-SQL and DB/2. IMHO this is an idiosyncrasy of MySQL. The RDMS should report how many rows *qualified* for an update, not if anything has really changed.
Let me repeat, this check fails, if:
- there is another bug in ZEOS which reports a wrong value for a column (this thread)
- the stored value in the Dataset is out-of-date due to lack of transaction control.
Sorry for hijacking this thread, but as I said in the beginning, this bug bit me at the same time as the original bug.
Oh, by the way. I also had a bad time installing ZeosLib 7.1.4 on Delphi 7, namely ZComponents70.bpl being created in the wrong folder (in the ZeosLib build folder instead of the Delphi folder, like all other packages). Has this bug been fixed?
Sorry for ranting, but had a real bad day with ZeosLib yesterday: first, have to find out that BIT does not work at all in 6.6.x. After that the install issues, but at least now I could write the BIT column. Finally, the read bug and the follow-up exception!
Unfortunately, the database is not designed by me, I only have to read/update the rows from my app. A five minute job turned into an endless hair raising nightmare!
Was just going to report the various bugs when I found this thread! Heck, I was even going to fix it myself :-)
Cheers,
Christian