Subject RE: [firebird-support] Re: Update numeric problem
Author Maya Opperman
--- In firebird-support@yahoogroups.com, Maya Opperman <maya@...> wrote:
>> Do you have any other statements in your app which also update that same field?

>Yes I have many statements that update the column. All work a treat like the one below
>update mytable set total=22.2 where mykey=10

Maybe take your earlier example:
update mytable set total=total+10.12, databasename='Firebird' where mykey=10

and adapt it as a kind of test (I presume databasename is a test field, else create a new one)

ie.

update mytable set total=22.2, statementid='A' where mykey=10

update mytable set total=total+10.12, statementid ='B' where mykey=10

and so on.

It is important that any statement that touches the total field, also updates the statementid field as well.

That will prove that it is the total=total+ that is the problem, and not just a concurrency issue where the old value has been picked up, then the total=total+ has been run, followed a slit second later by a total=old_value statement.

Forgive my pessimism, but it's just that if there was such a bug, there should be a huge number of reports on it... although I must say, I don't think I actually use that feature myself, so maybe... I also find as a developer it's much easier to find an elusive bug, when you know without a doubt it's really there.. Just my 2c