Commit graph

1568 commits

Author SHA1 Message Date
George Peter Banyard
1330359515 Fix [-Wundef] warning in MySQLnd extension 2020-05-18 00:37:20 +02:00
Christoph M. Becker
2393692937 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79596: MySQL FLOAT truncates to int some locales
2020-05-15 09:13:22 +02:00
Christoph M. Becker
844a1245ef Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79596: MySQL FLOAT truncates to int some locales
2020-05-15 09:11:44 +02:00
Christoph M. Becker
d1cd489a53 Fix #79596: MySQL FLOAT truncates to int some locales
We must not do locale aware float to string conversion here; instead
we using our `snprintf()` implementation with the `F` specifier.
2020-05-15 09:09:41 +02:00
George Peter Banyard
f91f72607b Drop unnecessary stdint and inttypes header checks
These are always available as of C99.

Closes GH-5323

Co-authored-by: "Christoph M. Becker" <cmbecker69@gmx.de>
2020-04-22 20:18:19 +02:00
George Peter Banyard
594287a736 Fix [-Wjump-misses-init] warning in MySQL new driver extension 2020-04-18 14:52:49 +02:00
Nikita Popov
a866ef88ed Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix MySQL local infile / attr handling on big endian systems
2020-04-16 11:23:11 +02:00
Nikita Popov
f684553c2c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix MySQL local infile / attr handling on big endian systems
2020-04-16 11:22:43 +02:00
guirish
a1c1736bfb Fix MySQL local infile / attr handling on big endian systems
Make sure pointer types match what is used by libmysql everywhere.

Closes GH-5380.
2020-04-16 11:22:17 +02:00
Nikita Popov
d4471c6aae Remove int6store()
The implementation is broken (syntactically). As it's not used
anyway, I'm just dropping it instead.
2020-04-14 10:37:37 +02:00
Nikita Popov
6e1ff5f951 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix incorrect free for last_message
2020-04-03 10:06:52 +02:00
Nikita Popov
37a179bd3c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix incorrect free for last_message
2020-04-03 10:06:09 +02:00
Qianqian Bu
ee21657a6a Fix incorrect free for last_message
In commit a7305eb539 the last_message
field of the connection object was changed to be always non-persistent.
But there is a place on change_user path that still treats it
depending on conn->persistent flag. This will cause PHP crash after
com_change_user success when there is last_message set
2020-04-03 10:05:16 +02:00
Christoph M. Becker
3b26a3868e Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix leak on Windows as well
2020-03-23 16:33:26 +01:00
Christoph M. Becker
0afdf194f0 Fix leak on Windows as well
Cf. <http://git.php.net/?p=php-src.git;a=commit;h=db08ef0d3274b239a6b9e68d71d02bb6acb71d82>
2020-03-23 16:32:52 +01:00
Nikita Popov
e9c2dec720 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix RSA memory leak in mysqlnd auth
2020-03-23 12:01:15 +01:00
Nikita Popov
db08ef0d32 Fix RSA memory leak in mysqlnd auth 2020-03-23 11:55:22 +01:00
Christoph M. Becker
3abe64f16a Merge branch 'PHP-7.4'
* PHP-7.4:
  Native Windows support for mysqlnd sha256 authentification
  Abstract over crypto operations
2020-03-02 16:33:40 +01:00
Christoph M. Becker
a0377021c5 Native Windows support for mysqlnd sha256 authentification
We implement that on top of Cryptography API: Next Generation (CNG).
2020-03-02 16:32:51 +01:00
Christoph M. Becker
a7400d5fd3 Abstract over crypto operations 2020-03-02 16:26:53 +01:00
Nikita Popov
172010a08d Merge branch 'PHP-7.4'
* PHP-7.4:
  Don't use VLA in mysqlnd auth
2020-02-18 16:18:50 +01:00
Nikita Popov
9d31a42a30 Don't use VLA in mysqlnd auth
We use alloca instead of VLA. This should also allow building
this code on Windows.
2020-02-18 16:17:56 +01:00
George Peter Banyard
01957adb7f Fix [-Wmissing-field-initializers] compiler warning in mysqlnd_result.c
Explicitly initialize to NULL the unused pointers to preserve
ABI forwards compatibility.
2020-02-10 12:14:47 +01:00
Christoph M. Becker
7e5a8d9faa Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79172: STRUCT_OFFSET() relies on undefined behavior
2020-01-28 09:19:45 +01:00
Christoph M. Becker
412b476b7f Fix #79172: STRUCT_OFFSET() relies on undefined behavior
Since this pattern is understood by compilers, not a real issue, but
certainly cleaner this way.
2020-01-28 09:18:05 +01:00
Nikita Popov
dc6ede092f Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79011
  Fix memory leaks in mysqlnd debug functionality
2020-01-24 14:55:00 +01:00
Nikita Popov
bb5cdd9b74 Fixed bug #79011
auth_plugin_data_len here is 21, including the trailing null byte.
Directly use SCRAMBLE_LENGTH instead. Also add a sanity check that
the provided scramble is long enough.
2020-01-24 14:54:46 +01:00
Nikita Popov
555567468a Fix memory leaks in mysqlnd debug functionality 2020-01-24 14:54:46 +01:00
Máté Kocsis
d1764ca330
Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Máté Kocsis
afdaa91170
Fix #78880: Final spelling fixes 2020-01-16 19:14:31 +01:00
Christoph M. Becker
8ea190ba95 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79084: mysqlnd may fetch wrong column indexes with MYSQLI_BOTH
2020-01-13 13:24:12 +01:00
Christoph M. Becker
b0cdd8cc53 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79084: mysqlnd may fetch wrong column indexes with MYSQLI_BOTH
2020-01-13 13:23:12 +01:00
Christoph M. Becker
1752393bb4 Fix #79084: mysqlnd may fetch wrong column indexes with MYSQLI_BOTH
Column names can be numeric strings, so we have to make sure to insert
the column values with the appropriate numeric keys, instead of adding
them.
2020-01-13 13:21:45 +01:00
Nikita Popov
184f118d3f Merge branch 'PHP-7.4'
* PHP-7.4:
  Handle empty password fast path in caching_sha2_password
  Handle error response during caching_sha2_password auth
  Add support for caching_sha2_password in change user authentication
  Fix unix socket check during caching_sha2_password
  Support auth switch request during caching sha2 auth
2019-12-27 17:31:27 +01:00
Nikita Popov
32cd373dfd Handle empty password fast path in caching_sha2_password
If an empty password is used, no additional packets are exchanged
during caching_sha2_password auth. We're only looking for an
OK/ERR response.
2019-12-27 17:27:45 +01:00
Nikita Popov
813d4a00b4 Handle error response during caching_sha2_password auth
In particular, this fixes handling of expired passwords.
2019-12-27 17:27:45 +01:00
Nikita Popov
e7e1254f3e Add support for caching_sha2_password in change user authentication
Same as for connection handshakes.
2019-12-27 17:27:45 +01:00
Nikita Popov
03ee36d1c5 Fix unix socket check during caching_sha2_password
The fact that conn->unix_socket is set does not mean that a Unix
socket is actually in use -- this member is set in a default
configuration.

Instead check whether a unix_socket stream ops is used.
2019-12-27 17:27:41 +01:00
Nikita Popov
6225137b4a Support auth switch request during caching sha2 auth 2019-12-27 17:27:04 +01:00
Nikita Popov
e2a1dbd502 Merge branch 'PHP-7.4'
* PHP-7.4:
  Free RSA public key in mysqlnd sha256 auth
2019-12-11 10:32:06 +01:00
Nikita Popov
b6a59cee47 Free RSA public key in mysqlnd sha256 auth
Not sure why this only started showing up as a leak now.
2019-12-11 10:31:56 +01:00
Nikita Popov
af301be4ef Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #78823: add zlib library to mysqlnd
2019-12-05 07:25:26 +01:00
Arjen de Korte
ee4295b4ce Fix bug #78823: add zlib library to mysqlnd
The problem is newer binutils will no longer default to --copy-dt-needed-entries but use --no-copy-dt-needed-entries instead. So all libraries needed *must* be provided.

Workarounds (either one works)
1) Add "-Wl,--copy-dt-needed-entries" to LDFLAGS to bring back the old behavior of the linker
2) Add "-lz" to list of libraries to be added

In "ext/mysqlnd/mysqlnd_protocol_frame_codec.c" when the "zlib.h" header is included should also trigger adding '-lz' to the list of libraries.
2019-12-05 07:24:52 +01:00
Nikita Popov
56cee36374 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove dead code `ext/mysqlnd/mysqlnd_net.c`.
2019-11-04 21:36:36 +01:00
Adam Saponara
6c9821a531 Remove dead code ext/mysqlnd/mysqlnd_net.c.
I believe this code has been dead since 05c5e05 (2015) now replaced
by `ext/mysqlnd/mysqlnd_vio.c`.

Closes GH-4888.
2019-11-04 21:36:13 +01:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Nikita Popov
c25104bb5b Merge branch 'PHP-7.3' into PHP-7.4 2019-09-13 14:37:15 +02:00
Nikita Popov
df982da587 Fix bug #78525
When calling free_result_buffers(), also free field metadata and
restore the mempool state to what it was before any allocations
have been made. Remove the mempool save/restore logic for the
inner result set as this is now handled on a higher level.
2019-09-13 14:37:03 +02:00
Nikita Popov
a2c21e10b2 Remove --with-zlib-dir option from mysqlnd config
mysqlnd doesn't actually use this. PDO MySQL uses it, but also
declares it separately.
2019-09-05 10:39:04 +02:00
Christoph M. Becker
a18f53ec2c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix the problem for connect_attr, set db condition, and add a new attribute _server_host
2019-08-20 13:35:17 +02:00