In 1.5.3 queryFactory class has been modified. The problem is that Execute function returns a different value for a successful MySQL UPDATE query than it did in 1.5.1.
Let's take a look at the following piece of code:
Line 266-269 includes\classes\db\mysql\query_factory.php
Code:
if (FALSE === $zp_db_resource){
$obj = null;
return true;
}
Essentially variable $zp_db_resource stores mysqli_query function result. Quoting PHP manual "Returns FALSE on failure". Why is that function returning boolean true when the actual query execution failed?
For a comparison in 1.5.1 it looked like this:
Line 230-233 includes\classes\db\mysql\query_factory.php
Code:
if(!is_resource($zp_db_resource)){
$obj = null;
return true;
}
Here it is only checked whether $zp_db_resource is not a resource.
On a successful UPDATE query this function will return boolean true in 1.5.1. In 1.5.3 it won't. Instead it will return a queryFactory object:
Line 293 includes\classes\db\mysql\query_factory.php
Is that how it is supposed to work or is that a bug?
Bookmarks