Commit Graph

53 Commits

Author SHA1 Message Date
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Andrey Hristov
f06443593e add a proxy for sppintf and vspprintf 2011-03-18 14:56:20 +00:00
Andrey Hristov
8c14436f73 split mysqlnd_debug.c in 3 files 2011-03-18 11:58:46 +00:00
Andrey Hristov
5d9b15feb1 allocate persistently 2011-03-16 12:42:59 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Andrey Hristov
cfac5f5b67 extending the API interface - plugins can register
themselves with a structure and can be searched.
Every plugin can have statistics and they are shown
under the statistics of mysqlnd in MINFO.
2010-12-28 15:16:21 +00:00
Pierre Joye
87fd3737b4 -fix build 2010-11-15 23:53:13 +00:00
Andrey Hristov
769a3cf0c3 - More features for the profiling, create aggregates and dump them
on file close.
- Also add a trace modifier to switch on and off the profiling.
- With additional compiler switch the profiling can be completely omitted,
of course it makes sense only when --enable-debug. Because otherwise
there is no tracing, thus no profiling.
- Added a fix for Windows for handling trace files on different devices
 (special handing of ':' )
2010-10-29 15:02:39 +00:00
Andrey Hristov
e70b2fcda4 rename and remove usage of inttypes.h, not needed 2010-10-25 13:44:11 +00:00
Andrey Hristov
fe719c5e42 profiling in trace mode 2010-10-22 15:46:26 +00:00
Andrey Hristov
0e519d247e fix some uninitialized variables. also fix shadowing of global symbols 2010-10-07 13:49:00 +00:00
Andrey Hristov
859a1404bf WS fixes 2010-09-23 16:03:22 +00:00
Andrey Hristov
7346d8d590 small macro fix 2010-09-22 14:54:43 +00:00
Andrey Hristov
c974313aed Switch from using PHP_MAJOR_VERSION to separate define for
unicode. Unicode is no more, but these are "bookmarks" where
to change mysqlnd, if Unicode becomes trendy again.
2010-08-12 12:02:02 +00:00
Dmitry Stogov
df8bf2a2de Fixed checks for PHP_DEBUG macro 2010-07-08 07:38:59 +00:00
Andrey Hristov
baf72b7336 Fix sprintf modifiers all around the place. In most cases
%u should be used. Where size_t is used then MYSQLND_SZ_T_SPEC should be
the modifier
2010-06-21 15:32:26 +00:00
Andrey Hristov
95d4f2ac66 Fix crashes in the allocator in case of OOM. 2010-05-27 12:00:48 +00:00
Andrey Hristov
844b435655 Fix shared build 2010-05-25 21:54:21 +00:00
Andrey Hristov
476391c02e When OOM hits the wire, don't crash. 2010-05-21 13:06:52 +00:00
Andrey Hristov
447c693b2d Add possibility to control the allocator in when PHP is compiled
with debug
2010-05-04 13:49:43 +00:00
Andrey Hristov
2da3f5ba90 Fix compiler warnings - unused functions 2010-05-03 13:51:30 +00:00
Andrey Hristov
3dbf6acd7b Change the way the allocator is called - through an abstraction
to give the possibility of pluggability. Thanks to the macros
already used the changes are not pervasive.
2010-04-22 16:28:50 +00:00
Felipe Pena
6d951e2ded - Fix copyrights 2010-04-20 13:50:34 +00:00
Andrey Hristov
7f43fc3b02 More int/uint comparison warning fixes 2010-04-15 15:53:58 +00:00
Andrey Hristov
a9880e78c6 CS + WS changes 2010-04-15 12:55:04 +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
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
981ba00606 Fix for complaint from the Zend MM, efree of a NULL pointer. 2010-03-17 18:08:25 +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
f551c57cf0 Fix compiler warning 2010-01-14 11:39:18 +00:00
Andrey Hristov
176e6dd2f2 make mysqlnd's tracing API more reusable 2010-01-13 14:06:02 +00:00
Andrey Hristov
6f598e62ff Remove the zval caching from mysqlnd. It was disabled versions ago
due to problems on windows, which were not debugged. Better have 
code that is disabled not in the core.
2009-12-09 20:21:05 +00:00
Andrey Hristov
4d2735007d Remove disabled code - threaded fetching. This can be implemented
on a upper level and by offloading it we reduce the complexity of
the core.
2009-12-09 16:57:03 +00:00
Johannes Schlüter
9485cad688 Revert mysqlnd to RC3 state after issues with pconnects 2009-06-25 19:03:52 +00:00
Andrey Hristov
10ee06ca48 MFH:
Memory usage optimisation. mysqlnd is not libmysql. mysqlnd does use the
Zend allocator, which means that is easier to hit memory_limit if you
have big stored (buffered) result sets. Before with libmysql you won't
hit memory_limit because libmysql uses libc's allocator and nothing is
checked. Now, with mysqlnd the situation is stricter and it is easier to
hit memory_limit. We try to optimize for big result sets. If a result set
is larger than 10 rows we will start freeing some data to keep memory usage
after 10 rows constant. This will help in the cases where a buffered result
set is scrolled forward only and just only once, or mysqlnd will need to
decode data from the network buffers again - yes, it is a trade-off between
CPU time and memory size. The best for big result sets is of course using
unbuffered queries - for comparison : 3 Million rows with buffered take
at least 180MB, with buffered you will stay at 3MB, and unbuffered will be
just 7-8% slower.
2009-06-16 13:07:14 +00:00
Andrey Hristov
6c4e8fa4f9 MFH:
Fix a bug with mysqlnd_fetch_field(_direct()). With mysqlnd the optimised
function was called, which however, doesn't respect that during store the
raw data is not unpacked, to be lazy. The data is unpacked to zvals later,
during every row fetch. However, this way max_length won't be calculated
correctly. So, if a mysqlnd_fetch_field(_direct) call comes we need to
unpack everything and then calculate max_length...and that is expensive,
defies our lazy unpacking optimisation.
2009-05-28 11:47:48 +00:00
Felipe Pena
dcd86aebd2 - MFH: Removed UG(unicode) checks 2009-03-30 16:52:33 +00:00
Johannes Schlüter
bcb40030a5 MFH Fix #47819 (Getting pdo_mysql.so: undefined symbol: mysqlnd_debug_init at
startup)
2009-03-30 13:55:47 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Andrey Hristov
9186528994 MFH:
Get rid of many defines (which simplifies the code a lot),
as well as uint->unsigned int
2008-11-06 10:37:47 +00:00
Andrey Hristov
99ea8068df MFH:
- More statistics
- Fixed endless loop - mysqlnd_stmt_next_result() returned FAIL but as it
  is defined to be 1 (and PASS is 0), checking for mysqlnd_stmt_more_result()
  was successful although we were expecting a FAIL.
2008-09-12 15:08:41 +00:00
Felipe Pena
0fbe6a0c14 - MFH: Added TSRMLS_DC to apply_func_args_t and zend_hash_apply_with_arguments. 2008-07-24 19:52:24 +00:00
Johannes Schlüter
1a419cac12 - MFH: Fix Windows build 2008-04-23 16:56:51 +00:00
Andrey Hristov
7d0cee8c80 Fix memory leak 2008-02-20 15:18:17 +00:00
Andrey Hristov
28e7d996df Another fix 2008-02-14 15:20:49 +00:00
Andrey Hristov
2d9d22395f Update mysqlnd - fix bg_store 2008-02-14 12:49:30 +00:00