Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 8.1k
PDO_Firebird: Add connection level SESSION_TIMEZONE attribute#15480
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
06fd88147c92e49b621c783f3535adf9826cc0073f1d290b0a9eeb2eFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| --TEST-- | ||
| PDO_Firebird: Firebird 4.0 set session time zone | ||
| --EXTENSIONS-- | ||
| pdo_firebird | ||
| --SKIPIF-- | ||
| <?php require('skipif.inc'); | ||
| if (Pdo\Firebird::getApiVersion() < 40) { | ||
| die('skip: Firebird API version must be greater than or equal to 40'); | ||
| } | ||
| require 'testdb.inc'; | ||
| checkMinServerVersion('4.0.0'); | ||
| ?> | ||
| --XLEAK-- | ||
| A bug in firebird causes a memory leak when calling `isc_attach_database()`. | ||
| See https://github.com/FirebirdSQL/firebird/issues/7849 | ||
| --FILE-- | ||
| <?php | ||
| require 'testdb.inc'; | ||
| $sql = <<<'SQL' | ||
| SELECT | ||
| rdb$get_context('SYSTEM', 'SESSION_TIMEZONE') as tz, | ||
| trim(replace(current_timestamp, localtimestamp, '')) as tz1, | ||
| trim(replace(current_time, localtime, '')) as tz2 | ||
| FROM rdb$database | ||
| SQL; | ||
| $dbh = connectToDb([ | ||
| Pdo\Firebird::SESSION_TIMEZONE => 'Europe/Rome', | ||
| ]); | ||
| $stmt = $dbh->prepare($sql); | ||
| $stmt->execute(); | ||
| $data = $stmt->fetch(\PDO::FETCH_ASSOC); | ||
| $stmt->closeCursor(); | ||
| var_dump($data); | ||
| echo "\ndone\n"; | ||
| ?> | ||
| --EXPECT-- | ||
| array(3) { | ||
| ["TZ"]=> | ||
| string(11) "Europe/Rome" | ||
| ["TZ1"]=> | ||
| string(11) "Europe/Rome" | ||
| ["TZ2"]=> | ||
| string(11) "Europe/Rome" | ||
| } | ||
| done |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.