Commit Graph

71 Commits

Author SHA1 Message Date
Andrey Hristov
954e7db644 Handle OOM in the code that generates PS Execute requests
to the server. Fixes crashes in case of OOM.
2010-05-25 19:19:29 +00:00
Andrey Hristov
a25482105e Check set->data for validity before using it.
Prevents crashes after OOM.
2010-05-21 13:37:18 +00:00
Andrey Hristov
8a093b3811 Allow overloading of mysqlnd_result_meta_init().
Add free space for future hooks.
2010-05-14 15:11:56 +00:00
Andrey Hristov
8691786ebd - Give possibility to overload mysqlnd_result_init().
- Always use conn->m->stmt_init instead of mysqlnd_stmt_init()
2010-05-14 13:18:39 +00:00
Andrey Hristov
07619b7190 - initialize some variables
- initialize the methods in a shorter way, use the compiler.
 = on structures copies them. Allows also exportability of
 the methods.
2010-05-13 15:29:08 +00:00
Andrey Hristov
d53337bbe7 OOM stability fixes 2010-05-04 14:02:42 +00:00
Andrey Hristov
5ca71c00f5 Handle OOM in mysqlnd_res::store_result_fetch_data 2010-05-03 19:32:07 +00:00
Andrey Hristov
9c276eee6c Handle OOM in mysqlnd_fetch_row_buffered_c() 2010-05-03 19:09:45 +00:00
Andrey Hristov
2b00096004 Handle OOM in mysqlnd_fetch_row_unbuffered_c() 2010-05-03 19:02:48 +00:00
Andrey Hristov
2b18a3ff93 Handle OOM stemming from mysqlnd_result_init in the same
function and up the stack.
2010-05-03 18:50:47 +00:00
Andrey Hristov
7de2607c12 Handle gracefully OOM in mysqlnd_mempool_create and up the stack 2010-05-03 17:07:18 +00:00
Andrey Hristov
ec0fe858c6 Remove unused parameter 2010-05-03 16:09:05 +00:00
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
Felipe Pena
6d951e2ded - Fix copyrights 2010-04-20 13:50:34 +00:00
Andrey Hristov
f40779091c Fix some int/uint comparison warnings 2010-04-15 15:28:00 +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
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
a8460553be 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
564a1d07f8 allow persistency of PS 2010-03-12 13:03:46 +00:00
Andrey Hristov
055f558554 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
204f52f7e0 export more functionality for phpize builds 2010-01-13 18:00:41 +00:00
Andrey Hristov
a449a371a8 cosmetics. typedef-ed types should be in capital case 2010-01-11 20:10:10 +00:00
Andrey Hristov
a98a67940a improve the stats subsystem. Reduce the number of macro definitions
in half by smartly introducing 2 new macros. Make MYSQLND::stats a pointer
from being aggregated and add triggers.
2010-01-08 17:35:20 +00:00
Andrey Hristov
81b0630f5a Change of way the packet objects are created/initialised
If the protocol gets changed, ever, we can decide at runtime
easily which protocol to use by instantiating the right protocol
object. But this is restricted to the structure of the packets, not
the flow.
2010-01-07 19:44:59 +00:00
Andrey Hristov
311684e1e4 Add plugin storage for MYSQLND_STMT too 2009-12-10 11:18:05 +00:00
Andrey Hristov
3a7f8ea575 Remove stub code which never actually was used for anything.
Things like this can be built on top of the core.
2009-12-09 20:38:11 +00:00
Andrey Hristov
fd44827701 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
157f1bddf1 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
Pierre Joye
80e5ef6fa5 - void is NaN, you can't do math ops on void. Declarations go first. Fix TS build 2009-11-30 10:56:01 +00:00
Andrey Hristov
7674c942c7 Compressed protocol support + extensibility for mysqlnd 2009-11-20 08:12:14 +00:00
Ulf Wendel
bd64a66e1a Fix: log slow queries in stats regardless of mysqlnd.log_mask setting. 2009-10-23 12:44:05 +00:00
Andrey Hristov
bc7bbaa65a Use mnd_ wrappers wherever possible. Needed for
statistics.
2009-09-30 23:13:43 +00:00
Andrey Hristov
4af8d99eb6 Fix trace output. DBG_RETURN should be used in traced
functions.
2009-09-30 22:26:19 +00:00
Ulf Wendel
d79cba2afd Fixing a leak in mysqlnd when passing invalid fetch modes to mysqlnd. 2009-09-30 14:39:33 +00:00
Andrey Hristov
e8412fb61c Fix for bug#48745
mysqlnd: mysql_num_fields returns wrong column count for mysql_list_fields
2009-08-28 09:30:16 +00:00
David Soria Parra
565e6bdbdf Fix bug #48644 mysqlnd does not compile with '--enable-mysqlnd-threading' 2009-06-23 14:14:32 +00:00
Andrey Hristov
7289831fe0 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:06:45 +00:00
Andrey Hristov
5d3ea92ee9 Hardwire function call instead of using callbacks. We don't actually need
callbacks, it was done for making 2 functions static, not to pollute the
global functions space but that had its price of 8 bytes overheat per
allocation, which is just too much. Also making the app member 32b instead
of 64b, which should save additional 4 byte, to the total of 12 byte per
allocation of a row buffer.
2009-06-16 09:15:09 +00:00
Andrey Hristov
86aa4e8035 Fix a valgrind warning as well as more trace log information 2009-05-28 17:49:00 +00:00
Andrey Hristov
09b56ed2a5 Fix a problem with cursors, which did not happen with unbuffered PS for
some reason. Double free of the data, which led to valgrind warnigns.
The fix actually optimizes the code in this cases because the old code
used copy_ctor while the new one skips it because it is not needed.
Transferring data ownership and nulling works best, for PS where we
always copy the string from the result set, unlike the text protocol.
2009-05-28 16:35:16 +00:00
Andrey Hristov
c90b10a290 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:15 +00:00
Felipe Pena
04c90a0f51 - Removed:
- UG(unicode) checks
- Changed:
     - ZEND_STR_TYPE -> IS_UNICODE
     - convert_to_text -> convert_to_unicode
2009-03-27 19:28:26 +00:00
Andrey Hristov
7271069329 Fix the build, because the macro's name has changed 2009-03-17 09:51:04 +00:00
Sebastian Bergmann
7f4dc8702a Bump copyright year, 3 of 3. 2008-12-31 11:12:40 +00:00
Andrey Hristov
0b46d6b5a5 Get rid of many defines (which simplifies the code a lot),
as well as uint->unsigned int
2008-11-06 10:36:30 +00:00
Andrey Hristov
65f5d4e434 64bit fixes:
- fixes to sprintf modifiers, cleaning warnings
- use _t types, like uint64_t instead of uint64, thus skipping series of
typedefs.
2008-10-31 20:30:33 +00:00
Andrey Hristov
0b77134114 Fix overusage of memory when the result set is empty. Then no memory will be
allocated compared to before. Also grow (realloc) the rset with 10% instead
of 33% - more reallocs but better memory usage. Of course later theres is a
realloc to shrink the rset t ofree it from unused rows but its better to
to eat too much at once.
2008-10-27 15:13:42 +00:00
Andrey Hristov
8a72f8d6ed MFB 2008-05-29 15:50:10 +00:00
Andrey Hristov
493b0bb51b Update mysqlnd - new ini variable 2008-05-07 15:16:27 +00:00