1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 11:13:36 +02:00
Commit Graph

245 Commits

Author SHA1 Message Date
Andrey Hristov 1ed3da294b Remove dead code and add possibility to fine tune the size of
a mempool (used for result sets).
2010-04-22 15:07:40 +00:00
Andrey Hristov 12c9bde2e7 Add the posibility to switch off the compilation of statistics
collection, for those who want to optimize the last percent of their
binaries.
2010-04-22 13:03:44 +00:00
Andrey Hristov 6dec27d58b Hardening the reads of mysqlnd.
All packets but the row data packet are read into preallocated buffer,
either on the stack or on the heap (cmd_buffer). The size of the buffer
is always checked to skip buffer overruns. Only up to the size of the
buffer is stored into the buffer but packet->header.size has the size of
all data sent. In this case network layer bails.

This patch hardenes the reads, so if packets are malformed and shorter
than they should be there will be no further reads in the buffer.
In short, detection of malformed packets.
2010-04-20 20:02:32 +00:00
Andrey Hristov f2d23c7f37 put the trigger in the right place 2010-04-20 19:09:56 +00:00
Andrey Hristov eda9959e36 It is possible that change user tries an user who has old password.
Instead of error message that doesn't say much there is more information now.
2010-04-20 18:04:24 +00:00
Felipe Pena 6d951e2ded - Fix copyrights 2010-04-20 13:50:34 +00:00
Andrey Hristov fb76a3f2db Last batch of int/uint comparison fixes 2010-04-15 15:58:26 +00:00
Andrey Hristov 7f43fc3b02 More int/uint comparison warning fixes 2010-04-15 15:53:58 +00:00
Andrey Hristov f40779091c Fix some int/uint comparison warnings 2010-04-15 15:28:00 +00:00
Andrey Hristov 8912e8f04e Remove unused file 2010-04-15 15:22:56 +00:00
Andrey Hristov 6f0adc06fa more WS 2010-04-15 15:16:29 +00:00
Andrey Hristov a9880e78c6 CS + WS changes 2010-04-15 12:55:04 +00:00
Andrey Hristov c04f752625 Fix for bug#49234 method not found ssl_set
Patch was tested and compiles on Windows. (Thanks Kalle)
2010-04-15 11:01:30 +00:00
Andrey Hristov c0531d8db0 Fixint INT_AND_FLOAT_AS native. It was working ok on 64bit but
because on 32bit SIZEOF_LONG is 4 and INT64 from MySQL is 8 everything
was converted to string, even if it was able to put it in a long.
This closes Request #50651 Native type cast returns wrong result
2010-04-08 13:20:37 +00:00
Andrey Hristov 92698a331f Fix the Windows build (void* arithmetic) as well as --disable-zlib
build.
2010-04-06 18:14:23 +00:00
Andrey Hristov 3cb852fe6b Stricly C 2010-04-06 14:33:55 +00:00
Andrey Hristov b8484a2e89 Recommit with an Windows build fix:
Fix inconsistencies
- memory allocated with spprintf, or likes, outside of mysqlnd's
allocator functions should not be freed by the mysqlnd's allocator
(a wrapper around emalloc/malloc).
- memory allocated by the mysqlnd's allocator should only be freed
  by it.
- add a mode to track memory usage (malloc/free)
2010-04-06 13:28:23 +00:00
Andrey Hristov d339672e45 Fix inconsistencies
- memory allocated with spprintf, or likes, outside of mysqlnd's
allocator functions should not be freed by the mysqlnd's allocator
(a wrapper around emalloc/malloc).
- memory allocated by the mysqlnd's allocator should only be freed
  by it.
- add a mode to track memory usage (malloc/free)
2010-04-01 13:26:41 +00:00
Andrey Hristov ffb8df30ab Better fix for bug #51347 mysqli_close / connection memory leak 2010-04-01 12:46:21 +00:00
Andrey Hristov 4735c71283 Fixed bug #51347 mysqli_close / connection memory leak
Streams API registers every stream as resource, which lands then
in EG(regular_list), however doesn't clean that when the stream is
closed. At the end this is a para-leak. At the end of the script
all memory is cleaned, however this is a problem for long runnig
scripts that open connections. For every opened and closed connection
about 150 Bytes on 32bit and 250 Bytes on 64bit will be "lost",
according to memory_get_usage().
2010-04-01 11:50:24 +00:00
Andrey Hristov 4870cac70e Make it coupled - what is allocated with mnd_ should be freed
with mnd_ and vice versa.
Added mnd_pestrndup and mnd_pestrdup, which wrap the normal
calls to be able to track this calls.
Fixed some failing tests.
2010-03-29 17:04:16 +00:00
Andrey Hristov 7868bca437 Fix tests that fail when the MySQL's socket file is not /tmp/mysql.sock
as it is in when compiled from source and the default for mysqlnd.
SuSE for example uses /var/run/mysql/mysql.sock . Also, sql.safe_mode
(ext/mysql and ingres) needs the socket.
Fix possible crashes in mysqlnd. When packets are shorter, functions should
return error.
2010-03-26 16:58:25 +00:00
Andrey Hristov 293ba72451 Fix a segfault when using a mysqli object after unsuccesssful connect, the
handle should have been allocated with mysqli_init().
2010-03-24 15:17:57 +00:00
Kalle Sommer Nielsen c8b33a6a01 Fix declaring 2010-03-23 13:21:22 +00:00
Andrey Hristov 981ba00606 Fix for complaint from the Zend MM, efree of a NULL pointer. 2010-03-17 18:08:25 +00:00
Andrey Hristov 4941b23bcd Fix a bug that a statement that is reset doesn't clean
the wire properly (as it is done when the statement is closed).
If there is more that one result sets returned from the PS
(like a call to SP that returns at least one RSet next to the
status rset) then the line was blocked. PS Multi-Res is not supported
in any libmysql from a GA-ed MySQL.
2010-03-17 18:00:47 +00:00
Andrey Hristov 3ff193c05e fix valgrind warning introduced with the latest patch. The memory
should be calloc-ed, not malloced, because the code that uses the
stmt storage needs that.
2010-03-17 11:40:37 +00:00
Andrey Hristov 7496cc761e decouple the methods in MYSQLND_STMT from the data,
needed to move to a new structure MYSQLND_STMT. Makes
the code cleaner and less error-prone.
Also fix PDO/MySQL which directly touch mysqlnd internals
instead of using API calls.
2010-03-16 12:36:57 +00:00
Andrey Hristov ccfd9cd744 allow persistency of PS 2010-03-12 13:03:46 +00:00
Adam Harvey bdbb2e77ca Fixed bug #51242 (Empty mysql.default_port does not default to 3306 anymore, but 0). 2010-03-09 05:08:31 +00:00
Andrey Hristov 7db6387a7f Fix the text. Correct english and a bit shorter. 2010-02-24 21:16:04 +00:00
Andrey Hristov f8eb9abf44 add better description to the problem 2010-02-24 18:00:01 +00:00
Andrey Hristov c7f2f1a5b1 add typedefs for all structure methods, and then reuse these typedefs 2010-02-15 16:58:33 +00:00
Andrey Hristov 480c327ff5 make send_close a hook, too 2010-02-09 19:05:40 +00:00
Andrey Hristov e50de7d982 Pass tsrmls to all functions, which might need it in the future.
We are anyway breaking the internal ABI in 5.3.2 so this won't hurt
and make us prepared for the future.
2010-02-03 17:31:29 +00:00
Andrey Hristov 7b68aab24c Fix second bug in that code, + instead of += thus not increasing
a pointer and mangling data. Again, ext/mysql and ext/mysqli doesn't
have access to this codepath.
2010-02-01 17:12:40 +00:00
Andrey Hristov befab3e8c3 Fix a bug in mysqlnd where a pointer was not incremented
and thus wrong data was saved MYSQLND_FIELD::db. However, this
wasn't caught because there is no code in mysql/mysqli/pdo_mysql
which reads that field of the structure. The problem was found
during code review.
2010-02-01 16:12:03 +00:00
Andrey Hristov d9449d44a2 decrement correctly! 2010-01-21 18:17:19 +00:00
Andrey Hristov 2d7ca03976 Add possibility to restrain the number of levels 2010-01-21 18:12:18 +00:00
Andrey Hristov 6136b785b9 Fix possible lock-ups when a trigger triggers a trigger.
Hanging was possible on the subsequent try to acquire a mutex.
Now it is correctly implemented and if a trigger is being executed
then no other trigger will be fired, on recursive calls.
2010-01-19 15:31:39 +00:00
Andrey Hristov ac1a5cd0f7 Make it GCC only feature (tracing). VC7 and up do the work
too and it might be tweaked later.
2010-01-19 12:13:06 +00:00
Andrey Hristov f056cdaa3e fix windows 2010-01-19 11:44:43 +00:00
Andrey Hristov beaa4d0430 Fix compiler warning, copy&paste error 2010-01-14 12:31:29 +00:00
Andrey Hristov f551c57cf0 Fix compiler warning 2010-01-14 11:39:18 +00:00
Andrey Hristov fef4bf8a9d remove redefinition of bit_uint8korr 2010-01-14 10:35:28 +00:00
Andrey Hristov 6a8d4c3287 more PHPAPI for phpize-d builds 2010-01-13 18:07:02 +00:00
Andrey Hristov 4bbdce5ca7 export more functionality for phpize builds 2010-01-13 18:00:41 +00:00
Andrey Hristov 176e6dd2f2 make mysqlnd's tracing API more reusable 2010-01-13 14:06:02 +00:00
Andrey Hristov dc09fa81f5 more typedef cosmetics 2010-01-11 20:18:56 +00:00
Andrey Hristov c4b380a076 remove stale export 2010-01-11 20:12:46 +00:00