Commit Graph

119 Commits

Author SHA1 Message Date
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
6225137b4a Support auth switch request during caching sha2 auth 2019-12-27 17:27:04 +01:00
Peter Kokot
c245898bfa Update and fix remaining year ranges (2019)
This patch follows previous license year ranges updates. With new
approach source code files now have simplified headers with license
information without year ranges.
2019-02-08 23:14:29 +01:00
Peter Kokot
92ac598aab 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.
2019-02-03 21:03:00 +01:00
Nikita Popov
4f06e67ad2 Re-commit MySQL 8 cached SHA auth support
With changes to (hopefully) correctly fall back if OpenSSL support
is missing. Furthermore the hard-coded dependency on ext/hash is
no longer an issue, as this extension is required in master.

This reverts commit 63072e9c0e, reversing
changes made to 4cbabb6852.
2018-11-21 20:16:44 +01:00
Nikita Popov
63072e9c0e Merge branch 'PHP-7.2' into PHP-7.3 2018-09-04 05:57:07 +02:00
Nikita Popov
03740ef7df Revert all MySQL auth related changes
Per bug #76651 these changes do not appear to work correctly in
some cases. As no immediate fix seems to be forthcoming, I'm
reverting these changes.

Revert "Fixed invalid free introduced by d6e81f0bfd (avoid keeping "invalid" pointer)"

This reverts commit 11507c0e1b.

Revert "Fix mysqlnd build without openssl"

This reverts commit 6c9db02ff7.

Revert "Fix VC compilation as variable size array is not supported"

This reverts commit f96df64cb2.

Revert "Fix MySQL 8 auth"

This reverts commit d6e81f0bfd.
2018-09-04 05:47:28 +02:00
Johannes Schlüter
84f6f693e7 Merge branch 'PHP-7.1' 2018-06-06 00:24:19 +02:00
Johannes Schlüter
d6e81f0bfd Fix MySQL 8 auth 2018-06-06 00:17:34 +02:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
6bcace1b72 Use single memory pool for result metadata and result set. 2017-11-15 14:07:09 +03:00
Dmitry Stogov
e2c9dfb5de Cleanup. Make difference between MYSQLND_ROW_BUFFER and MYSQLND_MEMORY_POOL_CHUNK (the last one is completely removed). 2017-11-15 11:33:32 +03:00
Dmitry Stogov
93334b5fc2 Use stack-allocated packets. 2017-11-14 15:10:27 +03:00
Dmitry Stogov
a7305eb539 Made "result", "statement" and "last_message" to always use Zend MM heap. (even for persistent connections these entities don't relive request boundary) 2017-11-02 03:27:25 +03:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Andrey Hristov
9eca4dca73 Optimized memory handling of BIT fields. Less memory copies and less
memory usage.
2016-12-12 21:59:29 +02:00
Dmitry Stogov
323b2733f6 Fixed compilation warnings 2016-06-22 00:40:50 +03:00
Kalle Sommer Nielsen
bb198ec9a6 Fix compiler warnings in mysqlnd 2016-04-03 02:27:25 +02:00
Andrey Hristov
3a33ee63e8 Merge branch 'PHP-7.0' 2016-03-16 10:47:27 +01:00
Andrey Hristov
f2ab731a8c Fix emails in headers. @mysql.com addresses are no more since many years. 2016-03-16 10:24:52 +01:00
Lior Kaplan
3d5438bf7b Merge branch 'PHP-7.0'
* PHP-7.0:
  Update header to PHP Version 7
  Happy new year (Update copyright to 2016)
  Happy new year (Update copyright to 2016)
2016-01-01 20:04:31 +02:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Andrey Hristov
a6b79f08b3 More const and moved the declaration of php_mysqlnd_scramble() to mysqlnd_auth.h 2015-11-17 14:59:59 +01:00
Andrey Hristov
c24d452f60 MNDR:
- less dereferencing in mysqlnd_ps . Dereference stmt->conn only once and
  use a stack variable. Also make the source cleaner.
2015-11-12 16:19:16 +01:00
Andrey Hristov
a530ecff97 MNDR:
- better name for MYSQLND_PPEC - MYSQLND_PFC (protocol frame codec)
2015-11-12 16:19:16 +01:00
Andrey Hristov
654d1a7caf MNDR:
- rename MYSQLND_NET to MYSQLND_PPEC (protocol packet envelope codec).
  PPEC does only the encoding and decoding to the protocol frame.
2015-11-12 16:19:16 +01:00
Andrey Hristov
05c5e051be MNDR:
- moved networking code to mysqlnd_vio.c
2015-11-12 16:19:16 +01:00
Andrey Hristov
e9f3139f43 MNDR:
- split MYSQLND_NET into MYSQLND_NET and MYSQLND_VIO
  MYSQLND_NET is above MYSQLND_VIO. _NET takes care of protocol packet
  counting (even with compressed), while VIO is just about the network
  (or in case of windows, non-network, but PIPE) transport.
2015-11-12 16:19:16 +01:00
Andrey Hristov
b8b1d45c3c MNDR:
- move connection establishment code to own command - COM_HANDSHAKE
2015-11-12 16:19:16 +01:00
Andrey Hristov
baab519ae5 MNDR:
- decouple the commands from the connection. CONN ist passed now only in 1 case
2015-11-12 16:19:16 +01:00
Andrey Hristov
fefc3045a3 MNDR:
- remove COM_FIELD_LIST
2015-11-12 16:19:16 +01:00
Andrey Hristov
aa4966d4e3 MNDR:
- now send_command_handle_response() also doesn't depend directly on
  MYSQLND_CONN_DATA
2015-11-12 16:19:16 +01:00
Andrey Hristov
4bb784cd0d MNDR:
- make MYSQLND_ERROR_INFO a class
2015-11-12 16:19:16 +01:00
Andrey Hristov
cfd868651a MDNR:
- removed init() method from mysqlnd_conn_data and moved the initialization
  to the object factory->get_connection(). Now it is unified as with the prepared
  statement which doesn't have any init() method
- the protocol decoder factory now takes connection as parameter at creation and
  thus there is no need to pass the connection as parameter when calling the read
  or the write method of a packet.
- saved the protocol payload decoder factory as pointer in every packet (read/write)
  so the connection doesn't need to be passed on every call of read/write (dependency
  has been already injected at creation). This will alow to move protocol specific
  code from MYSQLND_NET (send_ex()) to make MYSQLND_NET leaner and free from protocol
  stuff.
2015-11-12 16:19:16 +01:00
Andrey Hristov
34a33928d6 MNDR:
- Rename MYSQLND_PROTOCOL to MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY
- Rename other symbols related to MYSQLND_PROTOCOL accordingly
2015-11-12 16:19:16 +01:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Anatol Belski
65100a6474 reduce the struct size by 8 byte on 64 bit 2014-09-14 09:40:56 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
bdbf47df18 ported mysql and mysqlnd 2014-08-19 16:51:06 +02:00
Xinchen Hui
8ce23d8f4f Don't use zend_string for other fields (only name here is enough) 2014-06-25 00:42:20 +08:00
Xinchen Hui
92a7089893 Use zend_string in mysqlnd 2014-06-23 19:27:24 +08:00
Xinchen Hui
6288bb8ffe Refactoring mysqlnd (incompleted, only mysqlnd ext compilable) 2014-06-18 12:09:37 +08:00
Andrey Hristov
63791d055a New result fetching mode for mysqlnd, which should use less memory but
implies more memory copy. The old method is still available and can be used.
It stays as default. Choosing the method is through a flag to mysqli_query()/mysqli_real_query()
New mode can be forced with an INI setting, for all extensions that support this mode
(ext/mysql and mysqli, because PDO due to it's architecture can't support it)
The setting is mysqlnd.fetch_data_copy=[0|1]
2014-04-10 16:44:54 +03:00
Andrey Hristov
0c90c207a7 Backport refactoring from php-src 2014-01-24 11:39:24 +02:00