summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_connection.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix #80329: Add option to specify LOAD DATA LOCAL white list folderDarek Slusarczyk2021-02-231-0/+17
| | | | | | | | | | | | | | | | | * allow the user to specify a folder where files that can be sent via LOAD DATA LOCAL can exist * add mysqli.local_infile_directory for mysqli (ignored if mysqli.allow_local_infile is enabled) * add PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY for pdo_mysql (ignored if PDO::MYSQL_ATTR_LOCAL_INFILE is enabled) * add related tests * fixes for building with libmysql 8.x * small improvement in existing tests * update php.ini-[development|production] files Closes GH-6448. Co-authored-by: Nikita Popov <nikic@php.net>
* Replace zend_bool uses with boolNikita Popov2021-01-151-16/+16
| | | | | | | We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
* Avoid throwing warnings in mysqlndDharman2021-01-041-5/+7
| | | | | | Instead report them as proper client errors. Closes GH-6530.
* MySQLnd: Clean up and optimize mysqlnd result set handlingNikita Popov2020-12-171-24/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a larger overhaul of the mysqlnd result set infrastructure: * Drop support for two different types of buffered results sets ("c" and "zval"). Possibly these made sense at some earlier time, but now (with minor adjustments) one option is strictly worse than the other. Buffered result sets already buffer the full row packets, from which zvals can be decoded. The "zval" style additionally also buffered the decoded zvals. As result sets, even buffered ones, are generally only traversed once, this just ends up wasting memory. Now, a potentially useful variation here would be to buffer the decoded zvals instead of the row packets, but that's not what the code was doing. * To make it really strictly better, pre-allocate the zval row buffer and reuse it for all rows. Previously the "c" style always allocated a new buffer for each row. * The fetch_row API now provides a populated zval[]. The task of populating an array is deferred to fetch_row_into, which also avoids duplicating this code in multiple places. The fetch_row_c API is also implemented on top of fetch_row now, rather than duplicating large parts of the code. * The row fetching code for prepared statements and normal result sets has been mostly merged. These already used the same infrastructure, but prepared statements used separate row fetching functions that were nearly the same as the normal ones. This requires passing the stmt into the result set, rather than just a flag. The only part that remains separate is reading of unbuffered results in the presence of PS cursors.
* mysqlnd_error_info_init() cannot failNikita Popov2020-12-141-2/+2
|
* Remove MYSQLND_STRING_TO_INT_CONVERSION defineNikita Popov2020-12-141-2/+0
| | | | | This has been unconditionally enabled for a long time already (the actual conversion is behind an additional runtime flag).
* MySQLnd: Remove some unnecessary allocator failure checksNikita Popov2020-12-141-39/+1
| | | | emalloc/pemalloc are infallible.
* Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-12-101-5/+7
|\ | | | | | | | | * PHP-7.4: Fixed bug #71145
| * Fixed bug #71145Nikita Popov2020-12-101-5/+7
| | | | | | | | Consume any additional result sets when running INIT_COMMAND.
* | Promote a few forgotten warnings to exceptionsMáté Kocsis2020-09-251-1/+1
| | | | | | | | Closes GH-6211
* | Merge branch 'PHP-7.4'Nikita Popov2020-09-181-16/+14
|\ \ | |/ | | | | | | * PHP-7.4: Fix #78179: mysqli/mysqlnd transaction extensions
| * Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-09-181-16/+14
| |\ | | | | | | | | | | | | * PHP-7.3: Fix #78179: mysqli/mysqlnd transaction extensions
| | * Fix #78179: mysqli/mysqlnd transaction extensionsDaniel Black2020-09-181-16/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | MariaDB versioning created a mess with regarding testing features based on version. We sidestep the problem here by assuming the extensions are present, and if a syntax error occurs with a SQL mode TRANS_START_READ_WRITE | TRANS_START_READ_ONLY enabled, then output the same warning as before.
* | | mysqli_set_charset now throws an mysqli_sql_exception when incorrect charset ↵Dharman2020-09-181-5/+2
| | | | | | | | | | | | | | | | | | is provided Closes GH-6142.
* | | Fix expression warnings and break warningstwosee2020-06-071-5/+5
| | | | | | | | | | | | Close GH-5675.
* | | Fix warning of strict-prototypestwosee2020-06-071-2/+2
| | | | | | | | | | | | Closes GH-5673.
* | | Make error messages more consistent by fixing capitalizationMáté Kocsis2020-01-171-1/+1
| | | | | | | | | | | | Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-12-271-4/+0
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | * 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
| * | Fix unix socket check during caching_sha2_passwordNikita Popov2019-12-271-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
|/ / | | | | | | Closes GH-4732.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-08-201-1/+8
|\ \ | |/ | | | | | | * PHP-7.3: fix the problem for connect_attr, set db condition, and add a new attribute _server_host
| * Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-08-201-1/+8
| |\ | | | | | | | | | | | | * PHP-7.2: fix the problem for connect_attr, set db condition, and add a new attribute _server_host
| | * fix the problem for connect_attr, set db condition, and add a new attribute ↵Qianqian Bu2019-08-201-1/+8
| | | | | | | | | | | | _server_host
* | | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-08-021-0/+8
|\ \ \ | |/ / | | | | | | | | | * PHP-7.3: Fix #78179: MariaDB server version incorrectly detected
| * | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-08-021-0/+8
| |\ \ | | |/ | | | | | | | | | * PHP-7.2: Fix #78179: MariaDB server version incorrectly detected
| | * Fix #78179: MariaDB server version incorrectly detectedChristoph M. Becker2019-08-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | As of MariaDB 10.0.2, the server reports a fake version number as work- around for replication issues[1]. We apply the same "fix" as in the MariaDB client to cater to this. [1] <https://github.com/MariaDB/server/commit/c50ee6c23dbeb090963580754bec2f0a96ac0557#diff-5b45fa673c88c06a9651c7906364f592>
* | | Remove always true conditionNikita Popov2019-06-121-1/+1
| | |
* | | Merge branch 'PHP-7.3' into PHP-7.4Darek Slusarczyk2019-02-111-1/+2
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Darek Slusarczyk2019-02-111-1/+2
| |\ \ | | |/
| | * Merge branch 'PHP-7.1' into PHP-7.2Darek Slusarczyk2019-02-111-1/+2
| | |\
| | | * security fix - by default 'local infile' is disabled:Darek Slusarczyk2019-02-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - set default for mysqli.allow_local_infile=0 - explicitly disable PDO::MYSQL_ATTR_LOCAL_INFILE in case of lack of driver options - add getAttribute support for PDO::MYSQL_ATTR_LOCAL_INFILE - update existing tests where needed - add new tests [checking default value and setting on] the 'local infile' in ext/mysqli and ext/pdo_mysql
* | | | Update and fix remaining year ranges (2019)Peter Kokot2019-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This patch follows previous license year ranges updates. With new approach source code files now have simplified headers with license information without year ranges.
* | | | Remove local variablesPeter Kokot2019-02-031-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Simplify the command factoryAndrey Hristov2019-01-071-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since more than an year it not possible to create commands in the heap but they are allocated on the stack and directly run. In this regard, it doesn't make sense to have all the vararg stuff. Commands made sense to be created and pushed onto a stack then a general executor will run thru the stack and execute/handle the commands.
* | | | Clean up unnecessary ternary expressions and simplify some returnsGabriel Caruso2018-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Simplify conditions - Use ZEND_HASH_APPLY_* instead of hard-coded booleans - Use ZEND_NORMALIZE_BOOL - Drop sign in favor of ZEND_NORMALIZE_BOOL
* | | | Re-commit MySQL 8 cached SHA auth supportNikita Popov2018-11-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 63072e9c0ebbb676cd39d0f867d873737c676add, reversing changes made to 4cbabb6852d2a7d966fb78a53d9d4c1cac18f10b.
* | | | Use persistent strings only for persistent connectionsDmitry Stogov2018-10-231-4/+11
|/ / /
* | | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2018-09-041-4/+0
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.1' into PHP-7.2Nikita Popov2018-09-041-4/+0
| |\ \ | | |/
| | * Revert all MySQL auth related changesNikita Popov2018-09-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 d6e81f0bfd0cb90586dd83d4fd47a4302605261a (avoid keeping "invalid" pointer)" This reverts commit 11507c0e1bfa17a96480f3648397f6975c31551e. Revert "Fix mysqlnd build without openssl" This reverts commit 6c9db02ff7812c298d1e7e292ba731d9d3a66790. Revert "Fix VC compilation as variable size array is not supported" This reverts commit f96df64cb2219fda42ca875483f874cf3052647c. Revert "Fix MySQL 8 auth" This reverts commit d6e81f0bfd0cb90586dd83d4fd47a4302605261a.
* | | Merge branch 'PHP-7.2'Dmitry Stogov2018-06-141-0/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.2: Fixed invalid free introduced by d6e81f0bfd0cb90586dd83d4fd47a4302605261a (avoid keeping "invalid" pointer)
| * | Merge branch 'PHP-7.1' into PHP-7.2Dmitry Stogov2018-06-141-0/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.1: Fixed invalid free introduced by d6e81f0bfd0cb90586dd83d4fd47a4302605261a (avoid keeping "invalid" pointer)
| | * Fixed invalid free introduced by d6e81f0bfd0cb90586dd83d4fd47a4302605261a ↵Dmitry Stogov2018-06-141-0/+1
| | | | | | | | | | | | (avoid keeping "invalid" pointer)
| * | Merge branch 'PHP-7.1' into PHP-7.2Anatol Belski2018-06-061-0/+3
| |\ \ | | |/ | | | | | | | | | | | | * PHP-7.1: Fix VC compilation as variable size array is not supported Fix MySQL 8 auth
| * | year++Xinchen Hui2018-01-021-1/+1
| | |
* | | Merge branch 'master' of git.php.net:/php-srcJohannes Schlüter2018-06-061-2/+2
|\ \ \
| * | | Use zend_string_release_ex() instread of zend_string_release() in places, ↵Dmitry Stogov2018-05-281-2/+2
| | | | | | | | | | | | | | | | where we sure about string persistence.
* | | | Merge branch 'PHP-7.1'Johannes Schlüter2018-06-061-0/+3
|\ \ \ \ | |/ / / |/| | / | | |/ | |/|
| * | Fix MySQL 8 authJohannes Schlüter2018-06-061-0/+3
| | |
| * | year++Xinchen Hui2018-01-021-1/+1
| | |