Commit Graph

75 Commits

Author SHA1 Message Date
Andrey Hristov
e6dc3a5cbc Give an error when USE_RESULT is used with fetch_all 2010-07-13 13:02:00 +00:00
Andrey Hristov
53324e8830 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
5a4a66cdd5 Fix for bug #52115 mysqli_result::fetch_all returns null, not an empty array 2010-06-18 17:25:41 +00:00
Andrey Hristov
047d6f2855 Handle problems in the row_decoder, return type used to be void,
now it can return on problems.
2010-05-31 17:57:03 +00:00
Andrey Hristov
ce2fbe1931 Fix possible crashes, in case of OOM, due to half-baken
objects.
2010-05-27 12:05:02 +00:00
Andrey Hristov
58f13c3c9f Handle the situation when MYSQLND_PROTOCOL's methods return NULL.
mysqlnd should not crash but gracefully return with an error.
2010-05-25 23:18:13 +00:00
Andrey Hristov
337513ffa0 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
29c99daa0f Check set->data for validity before using it.
Prevents crashes after OOM.
2010-05-21 13:37:18 +00:00
Andrey Hristov
c881ee30ea Allow overloading of mysqlnd_result_meta_init().
Add free space for future hooks.
2010-05-14 15:11:56 +00:00
Andrey Hristov
b86ebe46cb - 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
a78fa3fcaf - 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
ebae62d7c4 OOM stability fixes 2010-05-04 14:02:42 +00:00
Andrey Hristov
6202b46f2a Handle OOM in mysqlnd_res::store_result_fetch_data 2010-05-03 19:32:07 +00:00
Andrey Hristov
cac3520882 Handle OOM in mysqlnd_fetch_row_buffered_c() 2010-05-03 19:09:45 +00:00
Andrey Hristov
4a8d751cff Handle OOM in mysqlnd_fetch_row_unbuffered_c() 2010-05-03 19:02:48 +00:00
Andrey Hristov
d0cef550a3 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
6dff9e55be Handle gracefully OOM in mysqlnd_mempool_create and up the stack 2010-05-03 17:07:18 +00:00
Andrey Hristov
864f2da733 Remove unused parameter 2010-05-03 16:09:05 +00:00
Andrey Hristov
34e56fea0b 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
a175419f84 - Fix copyrights 2010-04-20 13:50:34 +00:00
Andrey Hristov
cdac2b4ecf Fix some int/uint comparison warnings 2010-04-15 15:28:00 +00:00
Andrey Hristov
48e413eb28 more WS 2010-04-15 15:16:29 +00:00
Andrey Hristov
6aa682f564 CS + WS changes 2010-04-15 12:55:04 +00:00
Andrey Hristov
ec36ac1610 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
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
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
4bbdce5ca7 export more functionality for phpize builds 2010-01-13 18:00:41 +00:00
Andrey Hristov
2331e28509 cosmetics. typedef-ed types should be in capital case 2010-01-11 20:10:10 +00:00
Andrey Hristov
d20fdd603b 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
73b23fca37 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
00d76a8445 Add plugin storage for MYSQLND_STMT too 2009-12-10 11:18:05 +00:00
Andrey Hristov
06a417b6a9 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
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
Pierre Joye
2a3ec70d10 - 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
5143fe41e2 Compressed protocol support + extensibility for mysqlnd 2009-11-20 08:12:14 +00:00
Ulf Wendel
08db32e073 Fix: log slow queries in stats regardless of mysqlnd.log_mask setting. 2009-10-23 12:44:05 +00:00
Andrey Hristov
ba5c40b2ad Use mnd_ wrappers wherever possible. Needed for
statistics.
2009-09-30 23:13:43 +00:00
Andrey Hristov
b9dcc28c24 Fix trace output. DBG_RETURN should be used in traced
functions.
2009-09-30 22:26:19 +00:00
Ulf Wendel
9408303390 Fixing a leak in mysqlnd when passing invalid fetch modes to mysqlnd. 2009-09-30 14:39:33 +00:00
Andrey Hristov
9bf747605d Fix for bug#48745
mysqlnd: mysql_num_fields returns wrong column count for mysql_list_fields
2009-08-28 09:30:16 +00:00
Johannes Schlüter
9485cad688 Revert mysqlnd to RC3 state after issues with pconnects 2009-06-25 19:03:52 +00:00
David Soria Parra
4d7e6edd63 MFH: Fix bug #48644 mysqlnd does not compile with '--enable-mysqlnd-threading' 2009-06-23 14:15:28 +00:00
Johannes Schlüter
067276a043 Temporarily disable this optimization causing too much trouble, kept in HEAD 2009-06-18 15:07:23 +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
27270621cb MFH:
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:38 +00:00
Andrey Hristov
804f6138a6 MFH:Fix a valgrind warning as well as more trace log information 2009-05-28 17:49:29 +00:00
Andrey Hristov
76d091d5f5 MFH: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:41 +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