Commit Graph

1488 Commits

Author SHA1 Message Date
vanviegen
732f67ee6f
Fix for sporadic segfault with MYSQLI_OPT_INT_AND_FLOAT_NATIVE
Fixes bug #73800

news entry for PR #2250
2017-01-02 14:54:45 +00:00
Andrey Hristov
675fc9e04e Merge branch 'PHP-7.1' 2016-12-12 22:00:30 +02: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
Andrey Hristov
5d319269f6 Merge branch 'PHP-7.1' 2016-12-12 21:17:25 +02:00
Andrey Hristov
2819a28ac3 Merge branch 'PHP-7.0' into PHP-7.1 2016-12-12 21:12:44 +02:00
Andrey Hristov
e15c418c4c Fix off by 1 problem.
The problem was manifestated only with BIT columns and only when more than
one row was fetched. The problem was coming from the fact that in pre-7.0
times mysqlnd was using a no-copy optimization. This optimization kept the
strings (and also the BIT mask equivalents as strings) in the packet and the
zval referred to them. 7.0+ zvals cannot use no-copy and always copy. Because
of this the allocated memory for the packet was reduced by 1 by the person who
ported the driver, but the starting address of the bit area wasn't reduced.
Because of this the bit_area started at wrong address and the length decoded
wrong.
2016-12-12 21:11:02 +02:00
Anatol Belski
b204b3abd1 further normalizations, uint vs uint32_t
fix merge mistake

yet one more replacement run
2016-11-26 17:29:01 +01:00
Kalle Sommer Nielsen
2104bea5d7 Remove Netware support
If this does not break the Unix system somehow, I'll be amazed. This should get most of it out, apologies for any errors this may cause on non-Windows ends which I cannot test atm.
2016-11-12 11:20:01 +01:00
Andrey Hristov
47993d0c59 Merge branch 'PHP-7.0' into PHP-7.1 2016-10-17 19:31:29 +03:00
Andrey Hristov
2b047617af Merge branch 'PHP-5.6' into PHP-7.0 2016-10-17 19:30:08 +03:00
Andrey Hristov
543cc08a75 Lower the value to 24 hours from 1 year, which due to a overflow in
php_tvtoto (bug#71507) is just 17 days.
2016-10-17 19:25:01 +03:00
Andrey Hristov
7108db3022 Merge branch 'PHP-7.0' into PHP-7.1 2016-10-17 19:11:54 +03:00
Andrey Hristov
66d4a2e13f Merge branch 'PHP-5.6' into PHP-7.0 2016-10-17 19:01:12 +03:00
Andrey Hristov
9594e364ed This is a very very old thing dated back to year 2009.
MYSQL_OPT_READ_TIMEOUT was never a macro in mysqlnd but an enum value.
So this never actually worked correctly. mysqlnd provides these so it is
safe to have them when mysqlnd used.
2016-10-17 18:58:14 +03:00
Remi Collet
55237fe153 fix ZTS build 2016-09-15 13:27:20 +02:00
Stanislav Malyshev
caea2c876b Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields 2016-09-12 21:07:44 -07:00
Stanislav Malyshev
28f80baf3c Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields 2016-09-12 21:04:23 -07:00
Stanislav Malyshev
c984661d39 Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields 2016-09-12 20:28:50 -07:00
Anatol Belski
8033fb4044 Fixed bug #72701 mysqli_get_host_info() wrong output 2016-07-29 17:00:52 +02:00
Andrey Hristov
b27ff62ee0 Fix for bug #71863 Segfault when EXPLAIN with "Unknown column" error
The reason was that after the big refactoring of mysqlnd at the end of
last year code that is initializing the error_info structure in the
result set was not added. It existed already for connections and PS.
The code that segfaults is hit only with MariaDB because MariaDB sends
full metadata about the EXPLAIN query + EOF packet and only then it sends
an error packet. MySQL doesn't do that but sends directly an error which
is caught (by different code path). As errors during execution (which means
after sending meta) are pretty rare there was no test case of MySQL to
catch it.
2016-07-25 21:59:27 +02:00
Dmitry Stogov
adc95c5114 Fixed compilation warnings 2016-06-23 12:47:06 +03: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
Xinchen Hui
d12a4693c5 Merge branch 'PHP-7.0'
* PHP-7.0:
  Remove typo
2016-03-17 15:27:56 +08:00
Xinchen Hui
e12456603a Remove typo 2016-03-17 15:27:36 +08:00
Kalle Sommer Nielsen
9a83a679ef Fix build 2016-03-17 03:45:04 +01:00
Andrey Hristov
1c295d4a9a Fix more emails 2016-03-16 10:57:12 +01:00
Andrey Hristov
61a6109298 Merge branch 'PHP-7.0' 2016-03-16 10:55:09 +01:00
Andrey Hristov
fa4addd409 More email fixing 2016-03-16 10:54:56 +01: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
5602f64213 Eliminate usages of _PP macros
These are either in debug code (fix them), commented out (drop
them) or in dead compatibility macros (drop them).

One usage was in php_stream_get_from_zval(), which we have not used
since at least PHP 5.2 and, judging from the fact that nobody
complained about it causing compile errors in PHP 7, nobody else
uses it either, so drop it.

There are still remaining uses in mysqli embedded and odbc birdstep.
These probably need to be dropped outright.
2016-03-03 23:20:12 +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
Nikita Popov
2d1559f827 Move free_chunk and resize_chunk into memory pool
Drops 24 bytes from each chunk. For the example in bug #71468 it
reduces memory usage by 30%.
2016-02-22 19:40:32 +01:00
Nikita Popov
42fe5e6791 Drop mysqlnd mempool refcount
This member was no longer used.

Also fix handling of from_pool in resize_chunk. It was setting
pool to NULL instead of from_pool to FALSE.
2016-02-22 19:40:32 +01:00
Nikita Popov
93dc91b386 Remove version checks
PHP_VERSION_ID
PHP_API_VERSION
ZEND_MODULE_API_NO
PHP_MAJOR_VERSION, PHP_MINOR_VERSION
ZEND_ENGINE_2

I've left litespeed alone, as it seems to genuinely maintain support
for many PHP versions.
2016-01-30 15:35:28 +01:00
Andrey Hristov
64cb71cc8b Add missing macro 2016-01-21 12:59:23 +01:00
Andrey Hristov
7e9a6f7202 Move cleanup code to a separate function and export it. Export also
other functions that can be of use for plugins
2016-01-15 03:08:02 +01:00
Andrey Hristov
bcf7172258 Forgot to add const-ness to the macro 2016-01-14 14:55:23 +01:00
Andrey Hristov
c69c23ba2f Convenience macros 2016-01-14 12:58:41 +01:00
Andrey Hristov
4e8988b45a commit 597db443cd
Author: John Bafford <john@bafford.com>
Date:   Mon Jan 11 17:17:44 2016 -0500

    MYSQLND_METHOD(mysqlnd_conn_data, get_scheme) should take socket_or_pipe by reference to allow modifications

    Fixes a read-from-null crash in mnd_pestrdup when trying to duplicate the socket filename. (Fixes regression in e81ecc80c)
2016-01-13 16:30:23 +01:00
Andrey Hristov
37418deb02 Fix reloc for the allocator. Original files and lines were not showing
correct. This seems to be a PHP7 issue.
2016-01-05 16:29:22 +01:00
Andrey Hristov
e64b845c89 Fix typo that was unhiding only with USE_ZEND_ALLOC 2016-01-05 13:19:32 +01:00
Andrey Hristov
a19173e4af - Make functions static, as they are not needed to be public - exported
through a structure
- Fixed typo in statistic name
- Added 2 static functions for copying a MYSQLND_CSTRING and converting
  a CSTRING to STRING.
2016-01-04 16:48:35 +01:00
Lior Kaplan
71c1980025 Happy new year (Update copyright to 2016) 2016-01-01 20:06:12 +02: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
139af35c25 Add a method for checking if the underlying stream is valid. 2015-12-01 12:52:36 +01:00
Xinchen Hui
3aa2182db6 Merge branch 'PHP-7.0' 2015-11-27 15:53:19 +08:00
Xinchen Hui
a347b0be48 Fixed bug #70949 (SQL Result Sets With NULL Can Cause Fatal Memory Errors) 2015-11-27 15:52:55 +08:00
Andrey Hristov
85e4fcf647 Give the possibility of the client to pass a factory 2015-11-24 10:23:44 +01:00
Andrey Hristov
6b0d026c76 Remove unused variable 2015-11-23 11:36:25 +01: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
ee396aa566 Revert "Fixed compilation on 32-bit Linux"
This reverts commit 11c9729a9c.
2015-11-18 10:13:34 +01:00
Andrey Hristov
d477557094 Revert "Add some const-ness to the protocol frame codec"
This reverts commit f8c2b45948.
2015-11-17 17:55:32 +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
Dmitry Stogov
11c9729a9c Fixed compilation on 32-bit Linux 2015-11-17 19:01:50 +03: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
4ee4a4bb52 constify parameters 2015-11-17 14:49:18 +01:00
Andrey Hristov
43bfbd86d9 Rename from previous acronym (ppec became pfc) 2015-11-17 14:40:03 +01:00
Andrey Hristov
fae994fed9 Bring consistency to the class by renaming the methods too (from the
old temporary name)
2015-11-17 13:28:47 +01:00
Andrey Hristov
f8c2b45948 Add some const-ness to the protocol frame codec 2015-11-17 13:17:17 +01:00
Andrey Hristov
33e97d465d mysqlnd refactoring:
- move MYSQLND_READ_BUFFER to own file
2015-11-17 12:32:01 +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
4fed8a28d0 mysqlnd refactoring :
- move the command buffer out of the networking code to the protocol frame
  codec.
2015-11-16 15:37:11 +01:00
Andrey Hristov
24cb185cb3 Merge branch 'PHP-7.0' 2015-11-16 13:03:12 +01:00
Andrey Hristov
96406f0842 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-16 12:39:04 +01:00
Andrey Hristov
822400ef3b News for fixed bug #68344 2015-11-16 12:38:25 +01:00
Andrey Hristov
398caf9336 - Remove dead macrom mysql_list_fields()
- Small optimizations here and there
2015-11-16 11:55:46 +01:00
Xinchen Hui
f5be26e04b Unused var 2015-11-16 18:22:56 +08:00
Xinchen Hui
5bdc5f4e2b Merge branch 'PHP-7.0' 2015-11-16 17:59:54 +08:00
Xinchen Hui
9134f9e98f Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/mysql/php_mysql.c
2015-11-16 17:59:46 +08:00
Xinchen Hui
be6fd4ba89 Fixed bug #68077 (LOAD DATA LOCAL INFILE / open_basedir restriction)
Actually, this only be fixed if php uses mysqlnd
2015-11-16 16:59:55 +08:00
Dmitry Stogov
485408b20d Fixed compilation errors 2015-11-13 00:46:13 +03:00
Andrey Hristov
067380d7c6 MNDR:
- constify some parameters to MYSQLND_RES functions
2015-11-12 16:19:16 +01:00
Andrey Hristov
0a7e08d385 MNDR:
- cleanup in mysqlnd_result.c
- switch from zend_ulong to size_t for lengths. Accordingly change
  mysqli and pdo_mysql for this.
2015-11-12 16:19:16 +01:00
Andrey Hristov
abc8c00072 MNDR:
- rename mysqlnd.c to mysqlnd_connection.c
2015-11-12 16:19:16 +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
94ce013bff MNDR:
- remove unused macros
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
e8ace2d4db MNDR:
- remove inclusion of uneeded headers
2015-11-12 16:19:16 +01:00
Andrey Hristov
4248240648 MNDR:
- move the command factory to own file - mysqlnd_commands.c
2015-11-12 16:19:16 +01:00
Andrey Hristov
3f0a542d04 MNDR:
- route the option to the right handler
2015-11-12 16:19:16 +01:00
Andrey Hristov
2cea04165c MNDR:
- move all data members from MYSQLND_PFC to MYSQLND_PFC_DATA
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
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
80d59a3a36 MNDR:
- intermediate step to move MYSQLND_NET from mysqlnd_vio.c to mysqlnd_wireprotocol.c
  In following commits MYSQLND_NET's methods and data will be moved to MYSQLND_PROTOCOL
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
a990573752 MNDR:
- some small renaming of methods
2015-11-12 16:19:16 +01:00
Andrey Hristov
0d3329fc93 MNDR:
- send_command and send_command_handle_response_* moved to a structure
2015-11-12 16:19:16 +01:00
Andrey Hristov
e81ecc80ca MNDR:
- Move transport string generation to own function, which can be overloaded or sniffed
2015-11-12 16:19:16 +01:00
Andrey Hristov
51085dac1a MNDR:
- remove double decrement
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
e6419ab401 MNDR:
- convert the API of MYSQLND_NET to MYSQLND_STRING
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
5abee1948e MNDR:
- remove dead code
2015-11-12 16:19:16 +01:00
Andrey Hristov
71e703761f MNDR:
- clean up some things
2015-11-12 16:19:16 +01:00
Andrey Hristov
e30e884e53 MNDR:
- move COM_INIT_DE result handling to the command
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
75a1fcc724 MNDR:
- move handling of commands to the command itself
2015-11-12 16:19:16 +01:00
Andrey Hristov
7e6f9a84cb MNDR:
- split handle_response() into handle_OK and handle_EOF
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
f7a445856d MNDR:
- pass connection closer and its context
- remove unused parameter
2015-11-12 16:19:16 +01:00
Andrey Hristov
280c834c49 MNDR:
- rename the macro for updating the connection state
2015-11-12 16:19:16 +01:00
Andrey Hristov
109dc08ffd MNDR:
- make the connection state a class
2015-11-12 16:19:16 +01:00
Andrey Hristov
78cb5456da MNDR:
- simplify the macroses for the types
2015-11-12 16:19:16 +01:00
Andrey Hristov
e9bccffe29 MNDR:
- switch to macro generation of structure names for the methods
2015-11-12 16:19:16 +01:00
Andrey Hristov
3eee292669 MNDR:
- Remove the SET_STMT_ERROR macro
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
fb1b5abe31 MNDR:
- switch to MYSQLND_CLASS_METHOD_TABLE_NAME_DECL() for automatic naming
  of class methods
2015-11-12 16:19:16 +01:00
Andrey Hristov
5609eabc6f MDNR:
- make MYSQLND_UPSERT_STATUS more like an object that a simple structure
  Still use macros to make updates simple
2015-11-12 16:19:16 +01:00
Andrey Hristov
092afe7212 MNDR:
- abstract SSL enabling into COM_ENABLE_SSL
2015-11-12 16:19:16 +01:00
Andrey Hristov
10d4fb8a94 MDNR:
- Refactor the command factory. Let the factory be exchangeable.
2015-11-12 16:19:16 +01:00
Andrey Hristov
e24dc94f32 MDNR:
- remove dead code
2015-11-12 16:19:16 +01:00
Andrey Hristov
7d7ff67b82 MDNR:
- send_command() is no more, thus we need commands for all COM_STMT_*
  + CHANGE_USER
2015-11-12 16:19:16 +01:00
Andrey Hristov
f6ec3df895 MNDR:
- Switch for directly executing a command over the wire to creating a
  command object which is then executed.
2015-11-12 16:19:16 +01:00
Andrey Hristov
2a44cee4d5 MNDR:
- Remove unused variable
2015-11-12 16:19:16 +01:00
Andrey Hristov
c33d3b6e5b MDNR:
- remove dead code
2015-11-12 16:19:16 +01:00
Andrey Hristov
ab961ca347 MNDR:
- remove export of functions and have things exported thru an interface
  with default implementation
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
f16686faa7 MNDR:
- don't use the static function name but the hook
2015-11-12 16:19:16 +01:00
Andrey Hristov
19443351ed MNDR:
- remove static function and make it a method. The function doesn't need to
  be in mysqlnd_ps.c as it doesn't use any resources anymore from it (it used
  in the past)
2015-11-12 16:19:16 +01:00
Andrey Hristov
3f7a7837cd MDNR:
- cleanup after PHP7 changes (removal of TSRMLS_**)
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
75dc67c6ae MNDR:
- move macro to a function
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
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
Andrey Hristov
4c83582c74 MNDR
- enum_mysqlnd_protocol_type -> enum_mysqlnd_session_protocol_type
2015-11-12 16:19:16 +01:00
Andrey Hristov
3091a01799 MNDR
- mysqlnd_option -> mysqlnd_client_option
2015-11-12 16:19:16 +01:00
Andrey Hristov
6051a47776 MNDR
- Rename simple_command* to send_command
2015-11-12 16:19:16 +01:00
Andrey Hristov
0f38d479e1 MNDR :
- Rename MYSQLND_OPTIONS to MYSQLND_SESSION_OPTIONS
- Rename MYSQLND_NET_OPTIONS to MYSQLND_IO_OPTIONS
2015-11-12 16:19:16 +01:00
Andrey Hristov
6d51b7b2e3 Another Fix for Bug #68344 MySQLi does not provide way to disable peer certificate validation
Added the possibility to explicitly state that the peer certificate should not be checked.
Back to the default - checking the certificate.
Exported MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT
Usage : mysqli_real_connect( , , , , , MYSQLI_CLIENT_SSL | MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT)

If mysqli_ssl_set() is not called, but only MYSQLI_CLIENT_SSL is passed, without the (don't) very flag,
then no verification takes place.
2015-10-27 12:59:09 +01:00
Dmitry Stogov
c67fc6bb09 Fixed memory leak in php_stream_context_set_option() 2015-10-29 20:06:55 +03:00
Andrey Hristov
c133515811 Merge branch 'PHP-5.6' into PHP-7.0 2015-10-27 13:32:45 +01:00
Andrey Hristov
3dc0bf7428 Merge branch 'PHP-5.6' into PHP-7.0 2015-10-22 11:50:12 +02:00
Andrey Hristov
afd31489d0 Improve fix for Bug #68344 MySQLi does not provide way to disable peer certificate validation 2015-10-22 11:48:53 +02:00
Andrey Hristov
8f9b2b68ee Merge branch 'PHP-5.6' into PHP-7.0 2015-10-21 15:52:38 +02:00
Andrey Hristov
8292260515 Fix for Bug #68344 MySQLi does not provide way to disable peer certificate validation 2015-10-21 15:10:24 +02:00
Andrey Hristov
7e3cd7cadf Merge branch 'PHP-5.6' into PHP-7.0 2015-09-25 14:29:06 +02:00
Andrey Hristov
59de2c037c Fixed bug #70572 segfault in mysqlnd_connect 2015-09-25 14:06:28 +02:00
Andrey Hristov
003b764a49 Fix for Bug #70384 mysqli_real_query(): Unknown type 245 sent by the server 2015-09-23 18:38:29 +02:00
Andrey Hristov
f79cd18789 Fix for Bug #70384 mysqli_real_query(): Unknown type 245 sent by the server 2015-09-23 18:25:12 +02:00
Dmitry Stogov
6a3580fd56 Use Zend MM to keep statistic of non-persistent connections (calloc/free->pecalloc/pefree) 2015-09-18 10:36:09 +03:00
Christoph M. Becker
71f90dfbad Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix #70456: mysqlnd doesn't activate TCP keep-alive when connecting to a server

Resolved conflicts:
	ext/mysqlnd/mysqlnd_net.c
2015-09-09 03:19:55 +02:00
Sergei Turchanov
7b3616db77 Fix #70456: mysqlnd doesn't activate TCP keep-alive when connecting to a server
libmysqlclient activates TCP keep-alive when connecting to a server. PHP
mysqlnd extension must do the same to maintain compatibility.
2015-09-09 01:43:29 +02:00
Anatol Belski
545b364d56 remove TSRMLS_*
either remains or merged in from PHP5
2015-08-02 13:42:01 +02:00
Anatol Belski
4e66cce87c switch to the unified globals accessor where appropriate 2015-07-29 13:26:35 +02:00
Nikita Popov
8a9eee8f7e Fix mysqlnd warnings 2015-07-17 17:48:02 +02:00
Stanislav Malyshev
d8aa5675ad Fix bug #69669 (mysqlnd is vulnerable to BACKRONYM) 2015-07-07 10:16:54 -07:00
Stanislav Malyshev
6c884e8e84 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Better fix for bug #69958
  update news
  Fix bug #69669 (mysqlnd is vulnerable to BACKRONYM)
  Fix bug #69923 - Buffer overflow and stack smashing error in phar_fix_filepath
  Fix bug #69958 - Segfault in Phar::convertToData on invalid file
  Better fix for bug #69958
  Better fix for bug #69958
  update news
  Fix bug #69669 (mysqlnd is vulnerable to BACKRONYM)
  Fix bug #69923 - Buffer overflow and stack smashing error in phar_fix_filepath
  Fix bug #69958 - Segfault in Phar::convertToData on invalid file

Conflicts:
	ext/phar/phar_object.c
2015-07-07 10:12:51 -07:00
Stanislav Malyshev
b4b082e63e Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Better fix for bug #69958
  update news
  Fix bug #69669 (mysqlnd is vulnerable to BACKRONYM)
  Fix bug #69923 - Buffer overflow and stack smashing error in phar_fix_filepath
  Fix bug #69958 - Segfault in Phar::convertToData on invalid file

Conflicts:
	ext/mysqlnd/mysqlnd.c
2015-07-07 10:09:34 -07:00
Stanislav Malyshev
97aa752fee Fix bug #69669 (mysqlnd is vulnerable to BACKRONYM) 2015-07-07 09:38:31 -07:00
Stanislav Malyshev
303d97feda Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #69669 (mysqlnd is vulnerable to BACKRONYM)
  Fix bug #69923 - Buffer overflow and stack smashing error in phar_fix_filepath
  Fix bug #69958 - Segfault in Phar::convertToData on invalid file

Conflicts:
	ext/mysqlnd/mysqlnd.c
2015-07-06 21:52:49 -07:00
Stanislav Malyshev
0d2f147d80 Fix bug #69669 (mysqlnd is vulnerable to BACKRONYM) 2015-07-06 21:50:01 -07:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Dmitry Stogov
4bd22cf1c1 Improved zend_string API (Francois Laupretre)
Squashed commit of the following:

commit d96eab8d79
Author: Francois Laupretre <francois@tekwire.net>
Date:   Fri Jun 26 01:23:31 2015 +0200

    Use the new 'ZSTR' macros in the rest of the code.

    Does not change anything to the generated code (thanks to compat macros) but cleaner.

commit b352643910
Author: Francois Laupretre <francois@tekwire.net>
Date:   Thu Jun 25 13:45:06 2015 +0200

    Improve zend_string API

    Add missing methods
2015-06-29 16:44:54 +03:00
Xinchen Hui
141f0ca18c Fixed Bug #69796 mysqli_stmt::fetch doesn't assign null values to bound variables 2015-06-11 13:35:43 +08:00
Dmitry Stogov
4d9a1883aa Fixed bug #68887 (resources are not freed correctly) 2015-04-08 13:29:42 +03: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
Andrey Hristov
a970ae76e2 Add more info to the calls:
- let the callee knows whether it was called directly or indirectly
- two NULL zval * parameters for future extension in a pecl plugin
2015-04-07 20:45:17 +02:00
Dmitry Stogov
83a15801cc Use PHP memory manager for mysqlnd memory pools. 2015-04-02 14:28:39 +03:00
Kalle Sommer Nielsen
3d4aad5e27 Remove this VC8 check as our minimum target version of VC is higher 2015-03-29 06:50:09 +02:00
Anatol Belski
2d78023244 cleanup the mod version macros, round 2 2015-03-23 20:33:54 +01:00
Lior Kaplan
a4384bd3d4 s/PHP Version 5/PHP Version 7/g
Follow up for d0cb7153
2015-03-13 11:09:42 +02:00
Dmitry Stogov
bb91bf83f9 Minimize copying of HashTable realocation 2015-03-05 17:22:10 +03:00
Anatol Belski
af3ca74501 made ZEND_TSRMLS_CACHE_* macros look like function calls
which also comply with the current semantics for such macros
2015-02-16 17:19:32 +01:00
Dmitry Stogov
1eb4352143 Use new ZEND_HASH_FOREACH_... API. 2015-02-10 15:43:12 +03:00
Stanislav Malyshev
bf55a4e223 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix sizeof size
2015-02-01 12:42:00 -08:00
Stanislav Malyshev
969e389121 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix sizeof size
2015-02-01 12:41:33 -08:00
Stanislav Malyshev
f66f5b2ffa Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix sizeof size
2015-02-01 12:41:00 -08:00
Stanislav Malyshev
7efbd70b03 fix sizeof size 2015-02-01 12:40:38 -08:00
Keyur Govande
4c6918ec17 Patch commit d9f85373e3 by moving the float_to_double function to
a header file.
2015-01-26 21:20:29 +00:00
Keyur Govande
b34f8ef599 Fix for bugs #68114 (Build fails on OS X due to undefined symbols)
and #68657 (Reading 4 byte floats with Mysqli and libmysqlclient
has rounding errors).

The patch removes support for Decimal floating point numbers and
now defaults to using similar logic as what libmysqlclient does:
convert a 4 byte floating point number into a string, and then the
string into a double. The quirks of MySQL are maintained as seen in
Field_Float::val_str()
2015-01-26 21:20:29 +00:00
Keyur Govande
1933b556b9 Patch commit d9f85373e3 by moving the float_to_double function to
a header file.
2015-01-26 21:19:00 +00:00
Keyur Govande
e51980f4e6 Fix for bugs #68114 (Build fails on OS X due to undefined symbols)
and #68657 (Reading 4 byte floats with Mysqli and libmysqlclient
has rounding errors).

The patch removes support for Decimal floating point numbers and
now defaults to using similar logic as what libmysqlclient does:
convert a 4 byte floating point number into a string, and then the
string into a double. The quirks of MySQL are maintained as seen in
Field_Float::val_str()
2015-01-26 21:19:00 +00: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
Xinchen Hui
73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Keyur Govande
961da40809 Merge branch 'PHP-5.6'
* PHP-5.6:
  Add NEWS
  Add NEWS
  Patch commit d9f85373e3 by moving the float_to_double function to a header file.
  Fix for bugs #68114 (Build fails on OS X due to undefined symbols) and #68657 (Reading 4 byte floats with Mysqli and libmysqlclient has rounding errors).
  5.5.22 now

Conflicts:
	ext/mysqli/mysqli_api.c
2015-01-07 23:23:26 +00:00
Keyur Govande
90144c0d08 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Add NEWS
  Patch commit d9f85373e3 by moving the float_to_double function to a header file.
  Fix for bugs #68114 (Build fails on OS X due to undefined symbols) and #68657 (Reading 4 byte floats with Mysqli and libmysqlclient has rounding errors).
  5.5.22 now

Conflicts:
	configure.in
	main/php_version.h
2015-01-07 22:50:55 +00:00
Keyur Govande
3062cf1b42 Patch commit d9f85373e3 by moving the float_to_double function to
a header file.
2015-01-07 22:45:23 +00:00
Keyur Govande
f2eadb93b9 Fix for bugs #68114 (Build fails on OS X due to undefined symbols)
and #68657 (Reading 4 byte floats with Mysqli and libmysqlclient
has rounding errors).

The patch removes support for Decimal floating point numbers and
now defaults to using similar logic as what libmysqlclient does:
convert a 4 byte floating point number into a string, and then the
string into a double. The quirks of MySQL are maintained as seen in
Field_Float::val_str()
2015-01-07 22:45:23 +00:00
Keyur Govande
e4ef6bf2e5 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix for failing tests. gcc 4.8.3 would optimize away the assigment.
2014-12-26 20:38:26 +00:00
Keyur Govande
83e5547827 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix for failing tests. gcc 4.8.3 would optimize away the assigment.
2014-12-26 20:37:50 +00:00
Keyur Govande
aa192f57c9 Fix for failing tests. gcc 4.8.3 would optimize away the assigment. 2014-12-26 20:36:19 +00:00
Nikita Popov
2d212b426a Drop duplicate arg from hash_get_current_key_ex 2014-12-26 21:06:18 +01:00
Anatol Belski
386cb177bd remove unused ZTS macros 2014-12-17 11:05:23 +01:00
Anatol Belski
99d0078ab9 remove TSRMLS_* occurence 2014-12-17 11:03:13 +01:00
Anatol Belski
7b6ed8db2f almost all the replacements of TSRMLS_* are done
Some places have to be yet touched as they use different/custom
macros namings for the same. Also some places in the code became
redundant now, this is the next task. To name some: ext/mysqlnd,
sapi/embed, ext/curl and some smaller places here and there.
2014-12-14 14:22:42 +01:00
Anatol Belski
e112f6a04e second shot on removing TSRMLS_* 2014-12-14 14:07:59 +01:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Anatol Belski
4f3ac2cdbe Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (36 commits)
  NEWS
  adapt test for error message introduce in fix for #68463
  Fix bug #68463 listen.allowed_clients can silently result in no allowed access
  run a few request in this test
  fix test
  fix test
  added info about some other macro changes
  added note about toolset and phpize
  added note about the response files
  split msgfmt_format_intlcalendar_variant*.phpt for ICU 54.1
  split formatter_format*.phpt for ICP 54.1
  split dateformat_timezone_arg_variations*.phpt for ICU 54.1
  split dateformat_get_set_timezone_variant*.phpt for ICU 54.1
  fix icu version to test
  split ext/intl/tests/dateformat_get_set_calendar_variant*.phpt for 54.1
  split dateformat_formatObject_datetime_variant*.phpt for ICU 54.1
  split dateformat_formatObject_calendar_variant*.phpt for ICU 54.1
  split dateformat_create_cal_arg_variant2.phpt for ICU 53.1 and 54.1
  clone dateformat_calendars_variant3.phpt for ICU 54.1
  split collator_get_sort_key_variant3.phpt for icu 54.1
  ...
2014-11-20 15:20:18 +01:00
Veres Lajos
4b9535341a typo fixes - https://github.com/vlajos/misspell_fixer 2014-11-19 20:23:00 +00:00
Anatol Belski
c6bad96f30 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (398 commits)
  NEWS
  add test for bug #68381
  Fixed bug #68381 Set FPM log level earlier during init
  proper dllexport
  move to size_t where zend_string is used internally
  fix some datatype mismatches
  return after the warning, to fix uninitialized salt usage
  fix datatype mismatches
  add missing type specifier
  fix datatype mismatches
  fix unsigned check
  "extern" shouldn't be used for definitions
  joined identical conditional blocks
  simplify fpm tests
  SEND_VAR_NO_REF optimization
  Add test for bug #68442
  Add various tests for FPM - covering recent bugs (68420, 68421, 68423, 68428) - for UDS - for ping and status URI - for multi pool and multi mode
  Include small MIT FastCGI client library from https://github.com/adoy/PHP-FastCGI-Client
  Get rid of zend_free_op structure (use zval* instead). Get rid of useless TSRMLS arguments.
  Add new FPM test for IPv4/IPv6
  ...

Conflicts:
	win32/build/config.w32
2014-11-18 21:18:52 +01:00
Anatol Belski
8434a7f2ab validate sockets portable way 2014-11-14 17:39:38 +01:00
Anatol Belski
2942a4aa45 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  check for zlib headers as well as lib for mysqlnd
  a realpath cache key can be int or float, catching this
  TLS 1.0, 1.1 and 1.2 Curl constants - bug #68247
  Micro optimizations for isset/empty
  Micro optimization for zend_hash_next_index_insert_new()
  Fix array_keys() on $GLOBALS
  Fix procedural finfo calls in methods

Conflicts:
	ext/mysqlnd/config.w32
2014-10-17 10:13:08 +02:00
Anatol Belski
1f6bd98143 check for zlib headers as well as lib for mysqlnd 2014-10-17 10:09:40 +02:00
Anatol Belski
98a8481e5e converted some ext/mysql* and fixed ext/zlib 2014-10-15 12:08:25 +02:00
Anatol Belski
c00424e427 bring back all the TSRMLS_FETCH() stuff
for better comparability with the mainstream
2014-10-15 09:37:55 +02:00
Anatol Belski
9af9f874c7 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  Add to NEWS
  Add to NEWS
  Fix for bug #68087 (ODBC not reading DATE columns correctly)
  Add to NEWS
  Add to NEWS
  Fix for bug #68114 (Build fails on OS X due to undefined symbols)
  Micro optimization
  Improved return by reference handling
2014-10-08 09:32:19 +02:00
Keyur Govande
07e285d880 Merge branch 'PHP-5.6'
* PHP-5.6:
  Add to NEWS
  Fix for bug #68114 (Build fails on OS X due to undefined symbols)
2014-10-07 21:08:33 +00:00
Keyur Govande
bcda6c9392 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Add to NEWS
  Fix for bug #68114 (Build fails on OS X due to undefined symbols)
2014-10-07 21:08:18 +00:00
Keyur Govande
648673bffe Fix for bug #68114 (Build fails on OS X due to undefined symbols)
gcc (i686-apple-darwin10-gcc-4.2.1) on OS X cannot link fixed-width
decimals and fails with undefined symbols errors like ___extendsddf.
If configure used gcc for compiling it would notice and mark the
feature HAVE_DECIMAL_FP_SUPPORT as unsupported.
But configure seems to use cc (i686-apple-darwin10-llvm-gcc-4.2)
instead, which doesn't support fixed-width decimals either, but the
code compiles and links just fine. I suspect it may have something
to do with the llvm backend printed in the version.
Lacking the time to debug this further, the patch fixes the issue by
checking the expected output when fixed-width decimal support is
present and correctly implemented.
2014-10-07 20:58:43 +00:00
Anatol Belski
57dbe02364 drop unused tsrm_ls 2014-09-26 20:48:41 +02:00
krakjoe
7ceff7780e remove fetches from mysqlnd 2014-09-26 11:28:37 +01:00
Anatol Belski
31cc63b1a4 fix some extension builds 2014-09-25 20:02:48 +02:00
Nikita Popov
e33f3d3b7c Move smart_str implementation into Zend/
So we can use it there as well...

For now I've retained the zend_smart_str_public.h header, though
it would probably be better to just move that one struct into
zend_types.h.
2014-09-21 20:49:39 +02:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Dmitry Stogov
3bc8a958c5 Fixed useless or duplicated IS_INTERNED() checks 2014-09-19 15:41:01 +04:00
Anatol Belski
db24742f01 fixed type 2014-09-16 21:17:18 +02:00
Anatol Belski
77137b56b8 align 4 byte to the start of the word 2014-09-14 10:27:00 +02:00
Anatol Belski
ea4ab02446 fix conditions
substraction from an unsigned
2014-09-14 10:24:10 +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
27d0cfb8a7 reduce the struct size by 8 byte on 64 bit 2014-09-14 09:25:09 +02:00
Anatol Belski
273763dd63 reduce the struct size by 8 byte on 64 bit 2014-09-14 09:22:02 +02:00
Anatol Belski
cac71ecc93 reduce the struct size by 8 byte on 64 bit 2014-09-14 01:22:55 +02:00
Anatol Belski
35a2937e6b reduce the struct size by 8 byte on 64 bit 2014-09-14 01:12:12 +02:00
Anatol Belski
b056859d17 reduce the struct size by 8 byte on 64 bit 2014-09-14 00:59:46 +02:00
Anatol Belski
99fb5d0ea8 remove extra semicolon 2014-09-12 14:39:18 +02:00
Anatol Belski
e699f654f0 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix precision when fetching float through mysqlnd
2014-09-10 19:32:25 +02:00
Anatol Belski
0b89bb83ba Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix precision when fetching float through mysqlnd
2014-09-10 19:31:59 +02:00
Anatol Belski
dff820cea3 fix precision when fetching float through mysqlnd
fixes failing ext/mysqli/tests/010.phpt
2014-09-10 19:29:11 +02:00
Anatol Belski
5661a1ba0b fix null pointer deref 2014-09-07 20:26:01 +02:00
Xinchen Hui
bb92801338 it's should be zend_ulong 2014-09-04 16:26:53 +08:00
Anatol Belski
fee39d0868 fix type 2014-09-02 15:56:13 +02:00
Dmitry Stogov
88d7ca44f6 Refactored INI subsystem to use zend_string* instead of char* 2014-09-01 20:57:33 +04:00
Christopher Jones
e39cc57bbd Merge branch 'PHP-5.6'
* PHP-5.6:
  Remove 550+ compile warnings on OS X
2014-08-29 08:48:56 -07:00
Christopher Jones
6fe0bdda9c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Remove 550+ compile warnings on OS X
2014-08-29 08:48:43 -07:00
Christopher Jones
9063188fad Remove 550+ compile warnings on OS X
The warnings had the signature:
php-src/ext/mysqlnd/mysqlnd_debug.h:127:25: note: expanded from macro 'DBG_ENTER_EX2'
                          if (dbg_skip_trace); /* shut compiler's mouth */\
                                             ^
php-src/ext/mysqlnd/mysqlnd.c:114:2: note: put the semicolon on a separate line to silence this warning
2014-08-29 08:48:10 -07:00
Anatol Belski
a831bd40d0 Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed DBG_INF macro name
  reworked NEWS for 5.6.0GA
2014-08-27 12:11:59 +02:00
Anatol Belski
4d667eeaf3 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fixed DBG_INF macro name
2014-08-27 12:11:35 +02:00
Anatol Belski
7fac56e072 fixed DBG_INF macro name 2014-08-27 12:10:35 +02:00
Xinchen Hui
6469339a58 Fixed incompatible pointer 2014-08-26 12:19:09 +08:00
Anatol Belski
af59e92b24 master renames phase 7 2014-08-25 21:51:49 +02:00
Anatol Belski
b9514bb8fd master renames phase 6 2014-08-25 21:26:42 +02:00
Anatol Belski
28b7a03318 master renamings phase 5 2014-08-25 21:20:44 +02:00
Anatol Belski
4d997f63d9 master renames phase 3 2014-08-25 20:22:49 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
70de6180d5 fixes to %pd format usage 2014-08-24 02:35:34 +02:00
Anatol Belski
eb1871b3fb yet trivial fixes to mysql exts 2014-08-21 09:54:40 +02:00
Anatol Belski
bdbf47df18 ported mysql and mysqlnd 2014-08-19 16:51:06 +02:00
Anatol Belski
63d3f0b844 basic macro replacements, all at once 2014-08-19 08:07:31 +02:00
Lior Kaplan
543d5eb495 Merge branch 'PHP-5.6'
* PHP-5.6:
  typofixes

Conflicts:
	ext/spl/php_spl.c
2014-08-17 15:53:33 +03:00