anewt-developers team mailing list archive
-
anewt-developers team
-
Mailing list archive
-
Message #00186
[Bug 503538] Re: MySQL's BIGINT doesn't fit into PHP's 32 bit integer datatype
For AnewtDatabaseConnectionMySQL this should do the trick (part of the
patch):
+ case MYSQLI_TYPE_LONGLONG:
+ /* Only cast BIGINTs on 64 bit platforms that can actually
+ hold the values in an integer data type. */
+ if (PHP_INT_SIZE >= 8)
+ $value = (int) $value;
For AnewtDatabaseConnectionMySQLOld the issue cannot be solved, unfortunately:
+ /* Issue: this doesn't work for BIGINTs on 32 bits
+ * platforms, but there is no way to find out when this
+ * happens (both have a 'int' field type). :( The solution
+ * is to use MySQLi instead. */
Here's the commit message:
1742 Wouter Bolsterlee 2010-01-05
[database] Only cast MySQL's BIGINT to PHP integers on 64bit
... and leave it as a string on 32 bit platforms, so that no
information is silently lost. Fixes bug #503538.
** Changed in: anewt
Status: In Progress => Fix Released
--
MySQL's BIGINT doesn't fit into PHP's 32 bit integer datatype
https://bugs.launchpad.net/bugs/503538
You received this bug notification because you are a member of Anewt
developers, which is subscribed to Anewt.
References