php-src/ext/pdo_odbc
Calvin Buckley 0d584c32c5
pdo_odbc: Don't fetch 256 byte blocks for long columns (#10809)
* pdo_odbc: Don't fetch 256 byte blocks for long columns

Fetching 256 byte blocks can confuse some drivers with conversion
routines. That, and it seems to me the round trips to and from a
database could be a major performance impact.

Instead, we try to fetch all at once, and continue fetching if a
driver somehow has more for us.

This has been tested with a problematic case with the Db2i driver
with stateful MBCS encodings.

See GH-10733 for discussion about this and issues it can resolve.

* change to separate by 256 bytes, when C->fetched_len == SQL_NO_TOTAL

change to separate by 256 bytes, when C->fetched_len == SQL_NO_TOTAL

changed from 256 byte to 2048 byte buf block.

* Make long column buffer size single define

Could be configurable maybe, but best to avoid magic numbers even for a
compile-time constant.

* Use ZendMM page size minus zend_string overhead

Change recommended by Christoph.

Probably a little better performance wise I have to guess.

* [skip ci] Update comment to mention constant

* Update UPGRADING for PDO_ODBC change

mention GH issues in UPGRADING too

* Update NEWS for PDO_ODBC change

---------

Co-authored-by: SakiTakamachi <saki@sakiot.com>
2025-07-10 13:03:11 -03:00
..
tests Upgrade master to Ubuntu 24.04 (GH-16704) 2024-11-07 16:32:45 +01:00
config.m4 Autotools: Sync CS in pdo_odbc (#15466) 2024-08-17 18:39:31 +02:00
config.w32
CREDITS
odbc_driver.c ext/pdo_{odbc|pgsql}: Use precomputed data_source_len (#17744) 2025-02-09 13:10:20 +00:00
odbc_stmt.c pdo_odbc: Don't fetch 256 byte blocks for long columns (#10809) 2025-07-10 13:03:11 -03:00
pdo_odbc.c Preferably include from build dir (#13516) 2024-06-26 00:26:43 +02:00
pdo_odbc.stub.php Fixed parent class of stub (#14990) 2024-07-17 21:38:59 +09:00
pdo_odbc_arginfo.h Generated arginfo header files: remove empty zend_function_entry arrays (#15705) 2024-09-03 23:19:53 +02:00
php_pdo_odbc.h
php_pdo_odbc_int.h Add comments about internal headers (GH-15689) 2024-09-08 16:11:25 +02:00