-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix GH-10908: Bus error with PDO Firebird on RPI with 64 bit kernel and 32 bit userland #10920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
db0bc97
Fix GH-10908: Bus error with PDO Firebird on RPI with 64 bit kernel a…
nielsdos 716ceea
Also handle doubles
nielsdos 21b4f16
Also handle timestamp
nielsdos bc674ad
Rename helper macro and handle BLOB too
nielsdos aaa1c11
Update test
nielsdos 897352d
Fix CI compilation problem
nielsdos 0ef2772
Fix return type
nielsdos 5db2910
More testing
nielsdos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,155 @@ | ||
--TEST-- | ||
GH-10908 (Bus error with PDO Firebird on RPI with 64 bit kernel and 32 bit userland) | ||
--EXTENSIONS-- | ||
pdo_firebird | ||
--SKIPIF-- | ||
<?php require('skipif.inc'); ?> | ||
--ENV-- | ||
LSAN_OPTIONS=detect_leaks=0 | ||
--FILE-- | ||
<?php | ||
|
||
require("testdb.inc"); | ||
|
||
$sql = <<<EOT | ||
CREATE TABLE gh10908( | ||
ID BIGINT NOT NULL, | ||
CODE VARCHAR(60) NOT NULL, | ||
NUM NUMERIC(18, 3), | ||
DBL DOUBLE PRECISION, | ||
FLT FLOAT, | ||
TS TIMESTAMP, | ||
MYDATE DATE, | ||
MYTIME TIME, | ||
MYBLOB BLOB, | ||
MYBINARY BINARY(2), | ||
MYVARBINARY VARBINARY(2), | ||
MYSMALLINT SMALLINT, | ||
MYINT INT, | ||
MYCHAR CHAR(10), | ||
MYVARCHAR VARCHAR(5), | ||
MYBOOL BOOLEAN | ||
); | ||
EOT; | ||
$dbh->exec($sql); | ||
$dbh->exec("INSERT INTO gh10908 VALUES(1, 'ABC', 12.34, 1.0, 2.0, '2023-03-24 17:39', '2023-03-24', '17:39', 'abcdefg', 'ab', 'a', 32767, 200000, 'azertyuiop', 'ab', false);"); | ||
|
||
function query_and_dump($dbh, $sql) { | ||
foreach ($dbh->query($sql) as $row) { | ||
print_r($row); | ||
print("\n"); | ||
} | ||
} | ||
|
||
query_and_dump($dbh, "SELECT CODE FROM gh10908"); // works fine | ||
query_and_dump($dbh, "SELECT ID FROM gh10908"); // Used to "bus error" | ||
query_and_dump($dbh, "SELECT NUM FROM gh10908"); // Used to "bus error" | ||
query_and_dump($dbh, "SELECT DBL FROM gh10908"); // Used to "bus error" | ||
query_and_dump($dbh, "SELECT TS FROM gh10908"); // Used to "bus error" | ||
query_and_dump($dbh, "SELECT MYBLOB FROM gh10908"); // Used to "bus error" | ||
query_and_dump($dbh, "SELECT * FROM gh10908"); // Used to "bus error" | ||
|
||
query_and_dump($dbh, "SELECT CAST(NUM AS NUMERIC(9, 3)) FROM gh10908"); // works fine | ||
query_and_dump($dbh, "SELECT CAST(ID AS INTEGER) FROM gh10908"); // works fine | ||
query_and_dump($dbh, "SELECT CAST(ID AS BIGINT) FROM gh10908"); // Used to "bus error" | ||
|
||
echo "Did not crash\n"; | ||
|
||
?> | ||
--CLEAN-- | ||
<?php | ||
require 'testdb.inc'; | ||
$dbh->exec("DROP TABLE gh10908"); | ||
?> | ||
--EXPECT-- | ||
Array | ||
( | ||
[CODE] => ABC | ||
[0] => ABC | ||
) | ||
|
||
Array | ||
( | ||
[ID] => 1 | ||
[0] => 1 | ||
) | ||
|
||
Array | ||
( | ||
[NUM] => 12.340 | ||
[0] => 12.340 | ||
) | ||
|
||
Array | ||
( | ||
[DBL] => 1.000000 | ||
[0] => 1.000000 | ||
) | ||
|
||
Array | ||
( | ||
[TS] => 2023-03-24 17:39:00 | ||
[0] => 2023-03-24 17:39:00 | ||
) | ||
|
||
Array | ||
( | ||
[MYBLOB] => abcdefg | ||
[0] => abcdefg | ||
) | ||
|
||
Array | ||
( | ||
[ID] => 1 | ||
[0] => 1 | ||
[CODE] => ABC | ||
[1] => ABC | ||
[NUM] => 12.340 | ||
[2] => 12.340 | ||
[DBL] => 1.000000 | ||
[3] => 1.000000 | ||
[FLT] => 2.000000 | ||
[4] => 2.000000 | ||
[TS] => 2023-03-24 17:39:00 | ||
[5] => 2023-03-24 17:39:00 | ||
[MYDATE] => 2023-03-24 | ||
[6] => 2023-03-24 | ||
[MYTIME] => 17:39:00 | ||
[7] => 17:39:00 | ||
[MYBLOB] => abcdefg | ||
[8] => abcdefg | ||
[MYBINARY] => ab | ||
[9] => ab | ||
[MYVARBINARY] => a | ||
[10] => a | ||
[MYSMALLINT] => 32767 | ||
[11] => 32767 | ||
[MYINT] => 200000 | ||
[12] => 200000 | ||
[MYCHAR] => azertyuiop | ||
[13] => azertyuiop | ||
[MYVARCHAR] => ab | ||
[14] => ab | ||
[MYBOOL] => | ||
[15] => | ||
) | ||
|
||
Array | ||
( | ||
[CAST] => 12.340 | ||
[0] => 12.340 | ||
) | ||
|
||
Array | ||
( | ||
[CAST] => 1 | ||
[0] => 1 | ||
) | ||
|
||
Array | ||
( | ||
[CAST] => 1 | ||
[0] => 1 | ||
) | ||
|
||
Did not crash |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.