Description:
|
I ran into a problem with an unexpected behavior when running phpBB3.
There is a code inside phpBB3's includes/db/mysqli.php that does a float-based division. A floor() is then applied to it. The return value of a floor() is a float value, which is expected and is the proper behavior that Quercus exhibits.
However, the problem is that the floor'ed value is appended to a SQL query string for the "limit x, y" part of the query. Unfortunately, the toString() for the float value of 0 returned "0.0" when run under quercus. This turned the limit string into "limit 0.0, 10", which mysql driver throws an exception.
I recommend that the Double and Float and Decimal value types should check for 0, and if so, return "0" for the string instead of "0.0" to retain compatible behavior with PHP.
|