forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #73396: bigint columns are returned as strings
- Loading branch information
1 parent
886e721
commit 0a2c02c
Showing
4 changed files
with
35 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--TEST-- | ||
PDO_DBLIB: bigint columns are returned as strings | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('pdo_dblib')) die('skip not loaded'); | ||
require dirname(__FILE__) . '/config.inc'; | ||
?> | ||
--FILE-- | ||
<?php | ||
require dirname(__FILE__) . '/config.inc'; | ||
|
||
// on 64-bit machines, these columns should come back as ints | ||
// on 32-bit machines, they will come back as strings because zend_long isn't big enough | ||
$expected = PHP_INT_SIZE == 8 ? 1 : '1'; | ||
|
||
$stmt = $db->query('SELECT CAST(1 AS bigint)'); | ||
var_dump($stmt->fetchColumn() === $expected); | ||
?> | ||
--EXPECT-- | ||
bool(true) |