bug_73396.phpt 659 B

12345678910111213141516171819202122
  1. --TEST--
  2. PDO_DBLIB: bigint columns are returned as strings
  3. --EXTENSIONS--
  4. pdo_dblib
  5. --SKIPIF--
  6. <?php
  7. require __DIR__ . '/config.inc';
  8. if (in_array($db->getAttribute(PDO::DBLIB_ATTR_TDS_VERSION), ['4.2', '4.6', '5.0', '6.0', '7.0'])) die('skip bigint type is unsupported by active TDS version');
  9. ?>
  10. --FILE--
  11. <?php
  12. require __DIR__ . '/config.inc';
  13. // on 64-bit machines, these columns should come back as ints
  14. // on 32-bit machines, they will come back as strings because zend_long isn't big enough
  15. $expected = PHP_INT_SIZE == 8 ? 1 : '1';
  16. $stmt = $db->query('SELECT CAST(1 AS bigint)');
  17. var_dump($stmt->fetchColumn() === $expected);
  18. ?>
  19. --EXPECT--
  20. bool(true)