History log of /PHP-8.2/ext/pdo_firebird/firebird_statement.c (Results 1 – 25 of 128)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# dfaf7986 27-Nov-2023 Saki Takamachi <34942839+SakiTakamachi@users.noreply.github.com>

[pdo_firebird] Transaction management optimization (#12741)

take2 of #12657

## About Firebird transaction

Firebird is a full transactional database, so the DB itself does n

[pdo_firebird] Transaction management optimization (#12741)

take2 of #12657

## About Firebird transaction

Firebird is a full transactional database, so the DB itself does not support autocommit mode. (Strictly, there is an autocommit mode, but it is a different concept from the "autocommit" that we are used to with MySQL and others.)

Therefore, a transaction must have started before any operation is performed, and autocommit mode had to be emulated in PHP.

I made sure that a transaction always exists when in autocommit mode. Since the `in_transacntion` function does not work as expected, I have introduced `H->in_manually_txn` to determine whether a transaction is being manually manipulated.

## There are two types of commit/rollback

(I'm not talking about two-phase commit. This change does not take into account two-phase commit.)

There are `isc_commit_retaining` which starts a transaction again in the same context immediately after committing, and `isc_commit_transaction` which closes the transaction as is.

Similarly, there are two types of rollback.

-----------

Due to the default value of the transaction isolation level, autocommit mode may obtain unintended results.
Regarding this, it would be too large to include support for transaction isolation levels in this PR, so I will leave it as is for now.

show more ...


# 54b12bcd 22-Nov-2023 SakiTakamachi

Unified function naming conventions


# 239379b7 20-Nov-2023 Saki Takamachi <34942839+SakiTakamachi@users.noreply.github.com>

ext/pdo_firebird: Output correct error messages


# 7f7da6ae 17-Nov-2023 KentarouTakeda

Enable `pdo-firebird` nightly testing (#12699)

* Enable `pdo-firebird` Testing in Nightly

* fix(ext/pdo_firebird/tests): dont detect memory leak

* fix(ext/pdo_firebird): me

Enable `pdo-firebird` nightly testing (#12699)

* Enable `pdo-firebird` Testing in Nightly

* fix(ext/pdo_firebird/tests): dont detect memory leak

* fix(ext/pdo_firebird): memory alignment error

show more ...


# fa751c7d 13-Jan-2024 SakiTakamachi

Fix GH-13119 (#13125)

Fixed an issue where pdo_firebird float and double type values were wrong.

Changed from using `%F` format with `zend_strpprintf` to using `%H` format with

Fix GH-13119 (#13125)

Fixed an issue where pdo_firebird float and double type values were wrong.

Changed from using `%F` format with `zend_strpprintf` to using `%H` format with
`zend_strpprintf_unchecked`.

Fixes GH-13119
Closes GH-13125

show more ...


# 21e0305f 23-Mar-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-10908: Bus error with PDO Firebird on RPI with 64 bit kernel and 32 bit userland

The alignment of sqldata is in most cases only the basic alignment,
so the code type-puns it to a

Fix GH-10908: Bus error with PDO Firebird on RPI with 64 bit kernel and 32 bit userland

The alignment of sqldata is in most cases only the basic alignment,
so the code type-puns it to a larger type, it *can* crash due to the
misaligned access. This is only an issue for types > 4 bytes because
every sensible system requires an alignment of at least 4 bytes for
allocated data.

Even though this patch uses memcpy, the compiler is smart enough to
optimise it to something more efficient, especially on x86.
This is just the usual approach to solve these alignment problems.

Actually, unaligned memory access is undefined behaviour, so even on x86
platforms, where the bug doesn't cause a crash, this can be problematic.
Furthermore, even though the issue talks about a 64-bit kernel and
32-bit userspace, this doesn't necessarily need to be the case to
trigger this crash.

Test was Co-authored-by: rvk01

Closes GH-10920.

show more ...


# 44377c3c 29-Nov-2022 Christoph M. Becker

Fix GH-9971: Incorrect NUMERIC value returned from PDO_Firebird

Dialect 1 databases store and transfer `NUMERIC(15,2)` values as
doubles, which we need to cater to in `firebird_stmt_get_

Fix GH-9971: Incorrect NUMERIC value returned from PDO_Firebird

Dialect 1 databases store and transfer `NUMERIC(15,2)` values as
doubles, which we need to cater to in `firebird_stmt_get_col()` to
avoid `ZEND_ASSUME(0)` to ever be triggered, since that may result
in undefined behavior.

Since adding a regression test would require to create a dialect 1
database, we go without it.

Closes GH-10021.

show more ...


# ba9debb5 28-Jul-2022 Nikita Popov

Fix parentheses warnings


# 2fc9e769 05-Jul-2022 Christoph M. Becker

Fix GH-8576: Bad interpretation of length when char is UTF-8

For columns of type `SQL_TEXT`, Firebird does not properly report the
actual column length, but rather only the maximum colum

Fix GH-8576: Bad interpretation of length when char is UTF-8

For columns of type `SQL_TEXT`, Firebird does not properly report the
actual column length, but rather only the maximum column length, so for
multi-byte encodings like UTF-8, such columns may have trailing
spaces. We work around that by treating such columns as `SQL_VARYING`
when we ask the server to describe the colum, what yields the desired
results.

Given that this is a work-around, and may break code which expects the
results with trailing spaces, we target "master" only.

Closes GH-8926.

show more ...


# a6a13139 07-Jun-2022 Ben Ramsey

Fix #76452: Crash while parsing blob data in firebird_fetch_blob

This reapplies 286162e9b03071c4308e7e92597bca4239f49d89 to the PHP-8.1 (and up)
branches, fixing what might have been cau

Fix #76452: Crash while parsing blob data in firebird_fetch_blob

This reapplies 286162e9b03071c4308e7e92597bca4239f49d89 to the PHP-8.1 (and up)
branches, fixing what might have been caused by a bad merge conflict resolution.

show more ...


# bcbf8aa0 30-Apr-2021 Christoph M. Becker

Fix #76450: SIGSEGV in firebird_stmt_execute

We need to verify that the `result_size` is not larger than our buffer,
and also should make sure that the `len` which is passed to
`isc_

Fix #76450: SIGSEGV in firebird_stmt_execute

We need to verify that the `result_size` is not larger than our buffer,
and also should make sure that the `len` which is passed to
`isc_vax_integer()` has a permissible value; otherwise we bail out.

show more ...


# 286162e9 05-May-2021 Christoph M. Becker

Fix #76452: Crash while parsing blob data in firebird_fetch_blob

We need to prevent integer overflow when calling `erealloc()` with
`len+1`.


# 01b3fc03 06-May-2021 KsaR

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |

show more ...


# 5caaf40b 29-Sep-2020 George Peter Banyard

Introduce pseudo-keyword ZEND_FALLTHROUGH

And use it instead of comments


# 128082c8 17-Mar-2021 Christoph M. Becker

Initalize return_value before use

Otherwise we likely segfault[1]. We fix the same issue for
PDO_Firebird as well.

[1] <https://ci.appveyor.com/project/php/php-src/builds/38267

Initalize return_value before use

Otherwise we likely segfault[1]. We fix the same issue for
PDO_Firebird as well.

[1] <https://ci.appveyor.com/project/php/php-src/builds/38267250/job/6y3ngn1k6ryxx6j3?fullLog=true#L9783>

Closes GH-6785.

show more ...


# caa71003 17-Dec-2020 Nikita Popov

Rewrite PDO result binding

Instead of requiring the type to be determined in advance by the
describer function and then requiring get_col to return a buffer
of appropriate type, allo

Rewrite PDO result binding

Instead of requiring the type to be determined in advance by the
describer function and then requiring get_col to return a buffer
of appropriate type, allow get_col to return an arbitrary zval.
See UPGRADING.INTERNALS for a more detailed description of the
change.

This makes the result fetching simpler, more efficient and more
flexible. The general possibility already existed via the special
PDO_PARAM_ZVAL type, but the usage was very inconvenient and/or
inefficient. Now it's possible to easily implement behavior like
"return int if it fits, otherwise string" and to avoid any kind
of complex management of temporary buffers.

This also fixes bug #40913 (our second highest voted bug of all
time, for some reason). PARAM_LOB result bindings will now
consistently return a stream resource, independently of the used
database driver.

I've tried my best to update all PDO drivers for this change, but
some of the changes may be broken, as I cannot test or even build
some of these drivers (in particular PDO dblib and PDO oci).
Fixes are appreciated -- a working CI setup would be even more
appreciated ;)

show more ...


# cc23fcfc 21-Dec-2020 Nikita Popov

PDO Firebird: Fix uninitialized var warning


# 58b17906 03-Feb-2020 Nikita Popov

Apply tidy formatting

Mostly reindent PHP scripts to spaces.


Revision tags: php-7.3.13RC1, php-7.2.26RC1, php-7.4.0, php-7.2.25, php-7.3.12, php-7.4.0RC6, php-7.3.12RC1, php-7.2.25RC1, php-7.4.0RC5
# 3fb42a38 25-Oct-2019 Simonov Denis

Add support for Interbase 1 dialect


Revision tags: php-7.1.33, php-7.2.24, php-7.3.11, php-7.4.0RC4, php-7.3.11RC1, php-7.2.24RC1, php-7.4.0RC3
# 5d6e923d 24-Sep-2019 Gabriel Caruso

Remove mention of PHP major version in Copyright headers

Closes GH-4732.


Revision tags: php-7.2.23, php-7.3.10, php-7.4.0RC2, php-7.2.23RC1, php-7.3.10RC1
# 481f8955 10-Sep-2019 Simonov Denis

Request #77863: PDO firebird support type Boolean in input parameters


Revision tags: php-7.4.0RC1, php-7.1.32, php-7.2.22, php-7.3.9, php-7.4.0beta4, php-7.2.22RC1, php-7.3.9RC1, php-7.4.0beta2, php-7.1.31, php-7.2.21, php-7.3.8, php-7.4.0beta1, php-7.2.21RC1, php-7.3.8RC1, php-7.4.0alpha3, php-7.3.7, php-7.2.20, php-7.4.0alpha2, php-7.3.7RC3, php-7.3.7RC2, php-7.2.20RC2, php-7.4.0alpha1, php-7.3.7RC1, php-7.2.20RC1, php-7.2.19, php-7.3.6, php-7.1.30, php-7.2.19RC1, php-7.3.6RC1, php-7.1.29, php-7.2.18, php-7.3.5, php-7.2.18RC1, php-7.3.5RC1, php-7.2.17, php-7.3.4, php-7.1.28, php-7.3.4RC1, php-7.2.17RC1, php-7.1.27, php-7.3.3, php-7.2.16
# a31f4642 26-Feb-2019 Nikita Popov

Allow exceptions in __toString()

RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error excep

Allow exceptions in __toString()

RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.

show more ...


# ae21dc46 04-May-2019 Christoph M. Becker

Fix memory leak exhibited by bug_aaa.phpt

Since a statement may be executed multiple times, we need to free
already allocated storage for output data before allocating new
storage.


Revision tags: php-7.3.3RC1, php-7.2.16RC1, php-7.2.15, php-7.3.2, php-7.2.15RC1
# 92ac598a 22-Jan-2019 Peter Kokot

Remove local variables

This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly

Remove local variables

This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files. All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.

show more ...


# 0cf7de1c 30-Jan-2019 Zeev Suraski

Remove yearly range from copyright notice


123456