I'm trying to update a row in an InnoDB table with a FK constraint on it. Using the replace function I see the UPDATE being issued. In this case, the update is failing because the FK constraint is failing.
With debug set to true I see the error:
1216: Cannot add a child row: a foreign key constraint fails
BUT , because of $this->poorAffectedRows is true, it immediately issues a Select count(*). This wipes out any errors that the update would have returned. Therefore when I check my error codes after the replace is done, I get 0 and the function returns as if the statement worked.
In my particular case, adding:
if ($this->ErrorNo()<>0) return 0;
just after the initial Execute (line 945 of adodb-connection.inc.php)
helps. However, I have not tested this with other database drivers.
Other suggestions would be appreciated.
=C=
* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com |