Bug #79084 [Com]: mysqlnd may fetch wrong column indexes with MYSQLI_BOTH
| From: | bugreports at gmail dot com | Date: | Mon, 13 Jan 2020 16:46:34 +0000 |
| Subject: | Bug #79084 [Com]: mysqlnd may fetch wrong column indexes with MYSQLI_BOTH | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-224882@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79084&edit=1
ID: 79084
Comment by: bugreports at gmail dot com
Reported by: rob-phpbugs at tigertech dot com
Summary: mysqlnd may fetch wrong column indexes with
MYSQLI_BOTH
Status: Closed
Type: Bug
Package: MySQLi related
Operating System: Linux
PHP Version: 7.3.13
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
this was also broken in 7.2
print_r diff with the new expected array result
'select field_1 as
10, field_2 as 20, field_3 as 30 from
test_table'
(
[0] => zeile 1 - feld 1
[10] => zeile 1 - feld 1
- [1] => zeile 1 - feld 2
+ [11] => zeile 1 - feld 2
[20] => zeile 1 - feld 2
- [2] => zeile 1 - feld 3
+ [21] => zeile 1 - feld 3
[30] => zeile 1 - feld 3
)
Previous Comments:
------------------------------------------------------------------------
[2020-01-13 12:26:18] cmb@php.net
The fix for this bug has been committed.
If you are still experiencing this bug, try to check out latest source from https://github.com/php/php-src and re-test.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2020-01-13 12:24:48] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1752393bb4013ca94d45da5a4d43997a73ae9750
Log: Fix #79084: mysqlnd may fetch wrong column indexes with MYSQLI_BOTH
------------------------------------------------------------------------
[2020-01-12 18:17:07] cmb@php.net
That same issue affects PDO core (i.e. with any driver),
so I think it's better to track that as separate ticket,
so I have filed bug #79106.
------------------------------------------------------------------------
[2020-01-12 17:29:34] cmb@php.net
The following pull request has been associated:
Patch Name: Fix #79084: mysqlnd may fetch wrong column indexes with MYSQLI_BOTH
On GitHub: https://github.com/php/php-src/pull/5080
Patch: https://github.com/php/php-src/pull/5080.patch
------------------------------------------------------------------------
[2020-01-12 14:14:44] cmb@php.net
Ah, indeed, if mysqli uses libmysql-client, the numeric indexes
are explicitly specified when inserting to the row, but if mysqlnd
is used, the values with numeric indexes are added to the row, and
as such may be wrong if column names are numeric strings. This
likely affects PDO_MySQL as well.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=79084
--
Edit this bug report at https://bugs.php.net/bug.php?id=79084&edit=1