Bugs item #692528, was opened at 2003-02-24 15:51
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=403611&aid=692528&group_id=31885
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Sven Eichler (koala_s)
Assigned to: Nobody/Anonymous (nobody)
Summary: affected_rows() and update in new_user_md5.php
Initial Comment:
I have found a bug in new_user_md5.php at this line:
$query = "update auth_user_md5 set
username='$username', $password_query
perms='$permlist' where user_id='$u_id'";
$db->query($query);
if ($db->affected_rows() == 0) {
....
From
http://www.php.net/manual/en/function.mysql-affected-rows.php:
"When using UPDATE, MySQL will not update columns
where the new value is the same as the old value. This
creates the possiblity that mysql_affected_rows() may not
actually equal the number of rows matched, only the
number of rows that were literally affected by the query."
I mean that the 0 comparison with $db->affected_rows()
is not enough for a correct error test.
A test with the output of mysql_errno() can fix this
problem. But it give in db_mysql.inc, at this time, not a
function to return direkt this result.
----------------------------------------------------------------------
Comment By: Adam Thompson (athompso)
Date: 2003-02-24 20:53
Message:
Logged In: YES
user_id=339498
My original fix for this problem appears to still be present in
db_mysql.inc(? I think - maybe ct_sql.inc?); the same theory
of operation can be adapted to this case. Unfortunately, it
triples the size of the error-checking code...
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=403611&aid=692528&group_id=31885
|