Commit Graph

190 Commits

Author SHA1 Message Date
Kamil Tekiela
885dca3762 Remove mysqlnd_unbuffered_skip_result and voidify skip_result 2021-10-22 11:10:53 +01:00
Nikita Popov
277e169ef3 Remove mysqlnd local_tx functionality
These are not used in-tree and cause unnecessary complexity and
untestable failure modes.
2021-08-12 15:21:21 +02:00
Kamil Tekiela
fb85731c67 Remove get_parameter_metadata 2021-07-29 14:21:13 +01:00
Kamil Tekiela
254d1641bb Remove mysqlnd_field_type_name 2021-07-29 14:21:13 +01:00
Nikita Popov
b0961f2d04 Remove uses of TRUE/FALSE in mysqli/pdo_mysql
Replace with standard uses of true/false.
2021-05-26 15:07:23 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
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.
2021-01-15 12:33:06 +01:00
Nikita Popov
037512cfce Move fetch_all implementation out of mysqlnd
There doesn't seem to be any compelling reason to implement this
in mysqlnd rather than mysqli. It's just a loop over fetch_into.

This makes the function available under libmysqlclient as well,
and thus fixes bug #79372.
2020-12-18 12:27:30 +01:00
Nikita Popov
108d1e9a50 MySQLnd: Remove mnd_malloc/free etc.
There were only two uses of non-zmm allocation functions left,
which really did not need to use the system allocator. Remove
them, and remove the system allocator based APIs.
2020-12-17 17:01:09 +01:00
Nikita Popov
c18b1aea28 PDO MySQL: Use native types for results
Previously, PDO MySQL only fetched data as native int/float if
native prepared statements were used. This patch updates PDO to
have the same behavior for emulated prepared statements, and thus
removes the largest remaining discrepancy between these two modes.

Note that PDO already has a ATTR_STRINGIFY_FETCHES option to control
whether native types are desired or not. The previous output can
be restored by enabling this option.

Most of the tests make use of that option, because this allows the
tests to work under libmysqlclient as well, which currently always
returns string results (independently of whether native or emulated
PS are used).
2020-12-17 10:54:34 +01:00
Nikita Popov
33e904915e MySQLnd: Clean up and optimize mysqlnd result set handling
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.
2020-12-17 10:15:02 +01:00
Nikita Popov
362c29241d Remove mysqlnd_extension enum
ext/mysql is no longer supported, drop handling for it from
mysqlnd.
2020-12-15 10:55:53 +01:00
Nikita Popov
be4f73f328 MySQLnd: Remove unused fetch_field_data method
This method is not used, and is implemented in a very dubious
way.
2020-12-15 10:47:39 +01:00
Nikita Popov
141eb346b0 Remove MYSQLND_STRING_TO_INT_CONVERSION define
This has been unconditionally enabled for a long time already
(the actual conversion is behind an additional runtime flag).
2020-12-14 12:03:43 +01:00
Nikita Popov
86e317ad80 MySQLnd: Remove fail thresholds from infallible allocators
emalloc() etc are infallibe by design. Having a failure threshold
for them is a violation of the API contract.
2020-12-14 11:51:30 +01:00
twosee
1b85e749c7 Fix warning of strict-prototypes
Closes GH-5673.
2020-06-07 10:36:50 +02:00
Nikita Popov
4984bd100b Remove MYSQLND_COMPRESSION_WANTED define
Instead directly define MYSQLND_COMPRESSION_ENABLED. This also
matches what config.w32 does.
2020-06-04 10:03:39 +02:00
Nikita Popov
fc458eee3b Merge branch 'PHP-7.4'
* PHP-7.4:
  mysqlnd: Remove unnecessary check for HAVE_ZLIB
2020-06-04 10:02:12 +02:00
talyz
a230717fbb mysqlnd: Remove unnecessary check for HAVE_ZLIB
If MYSQLND_COMPRESSION_WANTED is set, we already guarantee that
zlib is linked, but don't necessarily set HAVE_ZLIB.

Closes GH-5658.
2020-06-04 10:01:17 +02:00
George Peter Banyard
1330359515 Fix [-Wundef] warning in MySQLnd extension 2020-05-18 00:37:20 +02:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Christoph M. Becker
37043e07df Sync mysqlnd version with PHP version
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).
2019-07-15 14:20:58 +02: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
Andrey Hristov
f1ede80781 const-ify some functions 2019-01-04 13:55:34 +02:00
Andrey Hristov
71ffae9605 Revert visibility 2019-01-04 12:24:10 +02:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Nikita Popov
26f8fc833b Enable and fix printf() format warnings
Add _unchecked() variants of zend_spprintf and zend_strpprintf for
cases where we specifically want to disable these checks, such as
use of %H.
2017-11-16 21:15:36 +01:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06: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
Nikita Popov
f57c0b3249 Merge branch 'PHP-7.0' 2016-03-03 16:50:47 +01:00
Nikita Popov
1ac152938c Move semicolon into TSRMLS_CACHE_EXTERN/DEFINE
Also re bug #71575.
2016-03-03 16:50:01 +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
e59814ff34 Fix the macro in case of no statistics 2015-11-18 10:49:37 +01:00
Andrey Hristov
b7b4364269 Fix wrong macro name 2015-11-18 10:35:10 +01:00
Andrey Hristov
057ad5626b Don't use the specific translated name but use the macro for this 2015-11-17 17:48:27 +01:00
Andrey Hristov
e4173bd15c mysqlnd refactoring:
- reorganize the statistics code a bit. There is one mysqlnd specific function,
  for convenience, in mysqlnd_statistics.c - namelyu _mysqlnd_get_client_stats().
  The mysqlnd specific stats macros are moved to mysqlnd.h to keep
  mysqlnd_statistics.h from being mysqlnd specific.
2015-11-16 16:23:39 +01:00
Andrey Hristov
398caf9336 - Remove dead macrom mysql_list_fields()
- Small optimizations here and there
2015-11-16 11:55:46 +01:00
Andrey Hristov
abc8c00072 MNDR:
- rename mysqlnd.c to mysqlnd_connection.c
2015-11-12 16:19:16 +01:00
Andrey Hristov
2e3fc57c5c MNDR:
- move things out of mysqlnd_priv.h
2015-11-12 16:19:16 +01:00
Andrey Hristov
c286d7075d MNDR:
- move from char* + len to MYSQLND_STRING
- add some more const modifiers
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
784a371829 MNDR:
- Inject the object factory
2015-11-12 16:19:16 +01:00
Andrey Hristov
2ea4891e75 MNDR:
- rename mysqlnd_init to mysqlnd_connection_init
- rename mysqlnd_connect to mysqlnd_connection_connect
- created macros for BC
2015-11-12 16:19:16 +01:00
Anatol Belski
4e66cce87c switch to the unified globals accessor where appropriate 2015-07-29 13:26:35 +02:00
Andrey Hristov
871ff65fd1 Rename prefixed mysqlnd functions - prefixed with undescore, which were
accessible through a macro. Also removing the access macros.
These prefixed functions were used, similarly to many functions in Zend2,
because of TSRMLS - the macro was adding the the tsrm pointer to the call.
However, as in Zend3 no TSRM pointers are passed down the stack, because of
the usage of cached TSRM pointer in a real thread local variable, these
macros and prefixed naming have lost their purpose.
2015-04-07 21:48:08 +02:00
Andrey Hristov
ed0f134a64 Split mysqlnd_stmt::execute in 2 logical parts :
- mysqlnd_stmt::send_execute() which just creates the wire message by using
  an aux function and sends it to the server
- mysqlnd_stmt::parse_execute_respose() which is responsible for handling
  the bytes sent from the server in response to COM_EXECUTE.
This makes it possible to implement finer method overwriting in mysqlnd
plugins.
2015-04-07 21:39:29 +02:00