summaryrefslogtreecommitdiff
path: root/ext/mysqlnd
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-09-132-15/+14
|\
| * Fix bug #78525Nikita Popov2019-09-132-15/+14
| | | | | | | | | | | | | | 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.
* | Remove --with-zlib-dir option from mysqlnd configNikita Popov2019-09-051-9/+0
| | | | | | | | | | mysqlnd doesn't actually use this. PDO MySQL uses it, but also declares it separately.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-08-203-2/+12
|\ \ | |/ | | | | | | * 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-203-2/+12
| |\ | | | | | | | | | | | | * 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-203-2/+12
| | | | | | | | | | | | _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>
* | | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-07-311-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.3: Fix 78213: Empty row pocket
| * | Fix 78213: Empty row pocketChristoph M. Becker2019-07-311-1/+1
| | | | | | | | | | | | | | | We have to ensure that we don't create an arena which is smaller than its header, regardless of the configured alignment.
* | | Report errors from stream read and write operationsNikita Popov2019-07-224-21/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The php_stream_read() and php_stream_write() functions now return an ssize_t value, with negative results indicating failure. Functions like fread() and fwrite() will return false in that case. As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams should not be regarded as error conditions, and be reported as successful zero-length reads/writes instead. The handling of EINTR remains unclear and is internally inconsistent (e.g. some code-paths will automatically retry on EINTR, while some won't). I'm landing this now to make sure the stream wrapper ops API changes make it into 7.4 -- however, if the user-facing changes turn out to be problematic we have the option of clamping negative returns to zero in php_stream_read() and php_stream_write() to restore the old behavior in a relatively non-intrusive manner.
* | | Remove HAVE_DSA_DEFAULT_METHODPeter Kokot2019-07-221-3/+0
| | | | | | | | | | | | | | | | | | Last usage removed via 6a813634052710f3f4bf6e2e03ca1b6c7be3bcee. Closes GH-4455
* | | Sync mysqlnd version with PHP versionChristoph M. Becker2019-07-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Since mysqlnd is solely developed in the php-src repository, it makes not much sense to have its own version number, particularly since nobody cares to update it. Therefore we use PHP's version number, but stick with the "mysqlnd" prefix which can be important to distinguish the mysqli driver (libmysqlclient vs. mysqlnd).
* | | Removed mysqlnd stats from phpinfo pagePieter Hordijk2019-07-031-27/+0
| | | | | | | | | | | | All information can already be retrieved using the APIs at https://www.php.net/manual/en/mysqlnd.stats.php. Closes https://bugs.php.net/bug.php?id=60594
* | | Add tracked arena allocatorNikita Popov2019-06-281-81/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Available under -DZEND_TRACK_ARENA_ALLOC. This will use the system allocator combined with arena checkpointing & release semantics and allows analyzing arena usage under asan/valgrind. I've sacrificed the duplicate arena implementation in mysqlnd, as the integration with mysqlnd alloc is not worth the code duplication to me.
* | | Fix mysqlnd memory leakNikita Popov2019-06-282-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The actual leak is observed in ext/pdo_mysql/tests/bug_74376.phpt. The persistent connection leaks because a refcount decrement on a result is missed. The refcount decrement is missed because free_result_contents is used, rather than free_result. Looking at other uses of free_result_contents, it looks like they could also suffer from this problem. Apart from one case, free_result_contents is always used to release the result entirely (I've adjusted the one differing case to only free meta), so I'm moving most of the logic from free_result into free_result_contents. The only difference is now that free_result will skip_result first.
* | | Fix use-after-free in stream freeing during shutdownNikita Popov2019-06-271-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Streams will be freed in an unpredictable order during shutdown. Ignore explicit calls to php_stream_close() entirely to avoid use-after-free -- instead let the stream resource destructor deal with it. We have to account for a few special cases: * Enclosed streams should be freed, as the resource destructor will forward to the enclosing stream. * Stream cookies also directly free streams, because we delegate to the cookie destruction if one exists. * Mysqlnd also directly frees streams, because it explicitly removes stream resources (because mysqlnd!)
* | | Merge branch 'PHP-7.3' into PHP-7.4Andrey Hristov2019-06-211-1/+3
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Andrey Hristov2019-06-211-1/+3
| |\ \ | | |/
| | * Add explicit cast to uint32_t.Andrey Hristov2019-06-211-1/+3
| | | | | | | | | | | | | | | It works even without it but explicit stuff is better. The compiler probably converts the 16-bit uint16_t to uint32_t before doing the shift.
* | | Fix shift UB in sint4korr()Nikita Popov2019-06-191-4/+4
| | |
* | | Fix incorrect shift in mysqlnd_wireprotocolNikita Popov2019-06-191-1/+1
| | | | | | | | | | | | | | | This one looks like a genuine bug: We're shifting a uint16_t by 16 bits. On x86 that likely results in no shift happening.
* | | Fix ifdef positionNikita Popov2019-06-121-1/+1
| | | | | | | | | | | | Hopefully fixes the release build...
* | | Remove always true conditionNikita Popov2019-06-121-1/+1
| | |
* | | Remove MYSQLND_LLU_SPEC/MYSQLND_LL_SPECNikita Popov2019-06-121-59/+0
| | | | | | | | | | | | No longer used, replaced by PRIu64/PRIi64.
* | | Fix mysqlnd printf modifiersNikita Popov2019-06-124-6/+6
| | | | | | | | | | | | By moving the the standard macros...
* | | Fix warnings in mysqlnd_alloc.cNikita Popov2019-06-121-91/+60
| | | | | | | | | | | | | | | And also separate the PHP_DEBUG codepaths more, to avoids having an ifdef every other line...
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-06-071-1/+8
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-06-071-1/+8
| |\ \ | | |/
| | * Fixed bug #38546Cameron Porter2019-06-071-1/+8
| | | | | | | | | | | | | | | | | | Properly support binding boolean parameters with emulated prepared statements disabled. Also add the necessary mysqlnd support for MYSQL_TYPE_TINY.
* | | Allow exceptions in __toString()Nikita Popov2019-06-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/tostring_exceptions And convert some object to string conversion related recoverable fatal errors into Error exceptions. Improve exception safety of internal code performing string conversions.
* | | Make "MySQL server has gone away" errors more consistentNikita Popov2019-06-032-4/+4
| | | | | | | | | | | | | | | | | | Don't generate explicit warnings for these in two places, use usual error handling mechanism. Additionally suppress a number of warnings if the server has gone away.
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-05-231-2/+3
|\ \ \ | |/ /
| * | Fix bug #77955Nikita Popov2019-05-231-2/+3
| | | | | | | | | | | | | | | | | | Free metadata before freeing the arena. I don't have a repro script, but the added assertion fails for many existing tests prior to this change.
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-05-221-0/+2
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-05-221-0/+2
| |\ \ | | |/
| | * Fix #77956 - When mysqli.allow_local_infile = Off, return a client errorSjon Hortensius2019-05-221-0/+2
| | |
* | | Normalize comments in *nix build system m4 filesPeter Kokot2019-05-121-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Normalization include: - Use dnl for everything that can be ommitted when configure is built in favor of the shell comment character # which is visible in the output. - Line length normalized to 80 columns - Dots for most of the one line sentences - Macro definitions include similar pattern header comments now
* | | Fix pointer signedness warning in mysqlndNikita Popov2019-04-111-1/+2
| | |
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-03-221-0/+9
|\ \ \ | |/ /
| * | Fixed bug #77773Nikita Popov2019-03-221-0/+9
| | |
* | | Sync AC_CHECK_SIZEOF m4 macro callsPeter Kokot2019-03-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - AC_CHECK_SIZEOF is now called mostly only in PHP_CHECK_STDINT_TYPES() macro except for some parts checking for the 32 or 64 bit architecture. - SIZEOF_CHAR removed since it is always 1 - ZEND_BIN_ID is now of a more logical pattern `BIN_48888` on 64bit architectures and `BIN_44444` on 32bit instead of literal string `BIN_SIZEOF_CHAR48888` on 64bit and `BIN_SIZEOF_CHAR44444` on 32bit. The unneeded SIZEOF_CHAR part has been removed. - XMLRPC_TYPE_CHECKS removed - The `long long int` is the same as `long long` and redundant checks removed accordingly. - Removed PHP_CHECK_64BIT macro. Checking if current platform is 64bit or not can be also done simply by using a check of the long type on place. This removes redundant m4 macro PHP_CHECK_64BIT.
* | | Add AS_HELP_STRING to *nix build configure optionsPeter Kokot2019-03-071-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | The Autoconf's default AS_HELP_STRING macro can properly format help strings [1] so watching out if columns are aligned manually is not anymore. [1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
* | | Remove legacy AC_CHECK_TYPE calls for uint and ulongPeter Kokot2019-03-063-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The AC_CHECK_TYPE was refactored in more recent versions of Autoconf and the call with two arguments is obsolete and not recommended anymore. This patch also refactors some leftovers of using ulong and uint which are not standard nor common usages of types in C. The ulong can be used as zend_ulong and uint usage is actually `unsigned int`. The usage of HAVE_ULONG removed since it is not used in current code base. Legacy edgecase for some legacy HPUX systems removed: - sys/stream.h header is not checked and the HAVE_SYS_STREAM_H is not defined with current build system. - flags are unsigned int - max_allowed_packet changed to unsigned int
* | | Remove unused PHP_AC_BROKEN_SPRINTF and AC_ZEND_BROKEN_SPRINTFPeter Kokot2019-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sprintf function has been normalized to php_sprintf via 61364b5bb172fa512c871b795c2613b1b587e4cd. This patch removes the checks to make a custom sprintf function The ZEND_BROKEN_SPRINTF has been removed and the hardcoded #define zend_sprintf sprintf is used. The php_sprintf and zend_sprintf are now symbols to sprintf. This patch now removes the custom PHP definitions of the php_sprintf and zend_sprintf functions in favor of the C99 sprintf which is also standardized in C89 already. Once, on some systems sprintf didn't behave in same way.
* | | Fix typo in error messageFabien Villepinte2019-02-211-1/+1
| | |
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-02-211-12/+12
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-02-211-12/+12
| |\ \ | | |/
| | * Fixed bug #77597Nikita Popov2019-02-211-11/+11
| | | | | | | | | | | | | | | | | | The same variable was reused in two nested loops... The test doesn't fail on 7.2, but I'm fixing this here anyway as the code is clearly wrong, and probably erroneous in other situations.