From: Ulf Wendel Date: Thu, 24 Jul 2008 12:54:50 +0000 (+0000) Subject: MFH (32bit fix) X-Git-Tag: php-5.3.0alpha1~159 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=60e70d1760e3588435587c7de9e720326a39f040;p=php MFH (32bit fix) --- diff --git a/ext/pdo_mysql/tests/pdo_mysql_types.phpt b/ext/pdo_mysql/tests/pdo_mysql_types.phpt index ae4005b8c6..7bd58232c5 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_types.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_types.phpt @@ -10,7 +10,7 @@ MySQLPDOTest::skip(); exec('DROP TABLE IF EXISTS test'); $sql = sprintf('CREATE TABLE test(id INT, label %s) ENGINE=%s', $sql_type, MySQLPDOTest::getTableEngine()); @@ -57,10 +57,11 @@ MySQLPDOTest::skip(); // typically the difference is only the type $exp = $ret_value; } - if ($row['label'] !== $exp) { - printf("[%03d + 4] %s - input = %s/%s, output = %s/%s\n", $offset, + if ($row['label'] !== $exp && !is_null($alternative_type) && gettype($row['label']) != $alternative_type) { + printf("[%03d + 4] %s - input = %s/%s, output = %s/%s (alternative type: %s)\n", $offset, $sql_type, var_export($exp, true), gettype($exp), - var_export($row['label'], true), gettype($row['label'])); + var_export($row['label'], true), gettype($row['label']), + $alternative_type); return false; } @@ -102,8 +103,11 @@ MySQLPDOTest::skip(); test_type($db, 80, 'MEDIUMINT', -8388608, ($is_mysqlnd) ? -8388608 : '-8388608'); test_type($db, 90, 'MEDIUMINT UNSIGNED', 16777215, ($is_mysqlnd) ? 16777215 : '16777215'); - test_type($db, 100, 'INT', -2147483648, ($is_mysqlnd) ? -2147483648 : '-2147483648'); - test_type($db, 110, 'INT UNSIGNED', 4294967295, ($is_mysqlnd) ? 4294967295 : '4294967295'); + test_type($db, 100, 'INT', -2147483648, + ($is_mysqlnd) ? ((PHP_INT_SIZE > 4) ? (int)-2147483648 : (double)-2147483648) : '-2147483648', + NULL, ($is_mysqlnd) ? 'integer' : NULL); + + test_type($db, 110, 'INT UNSIGNED', 4294967295, ($is_mysqlnd) ? ((PHP_INT_SIZE > 4) ? 4294967295 : '4294967295') : '4294967295'); // no chance to return int with the current PDO version - we are forced to return strings test_type($db, 120, 'BIGINT', 1, ($is_mysqlnd) ? 1 : '1');