Commit Graph

208 Commits

Author SHA1 Message Date
Andrey Hristov
6aa682f564 CS + WS changes 2010-04-15 12:55:04 +00:00
Andrey Hristov
a9880e78c6 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
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
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
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
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
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
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
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
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
311684e1e4 Add plugin storage for MYSQLND_STMT too 2009-12-10 11:18:05 +00:00
Andrey Hristov
00d76a8445 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
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
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
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
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
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
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
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
bc7bbaa65a Use mnd_ wrappers wherever possible. Needed for
statistics.
2009-09-30 23:13:43 +00:00
Andrey Hristov
ba5c40b2ad 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
Andrey Hristov
b9dcc28c24 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
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
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
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
David Soria Parra
565e6bdbdf Fix bug #48644 mysqlnd does not compile with '--enable-mysqlnd-threading' 2009-06-23 14:14:32 +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
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
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
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
804f6138a6 MFH:Fix a valgrind warning as well as more trace log information 2009-05-28 17:49:29 +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
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
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
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
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
dcd86aebd2 - MFH: Removed UG(unicode) checks 2009-03-30 16:52:33 +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
df7ebb5d41 MFH: Fix the build because the macro name has changed 2009-03-17 09:51:31 +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
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Sebastian Bergmann
7f4dc8702a Bump copyright year, 3 of 3. 2008-12-31 11:12:40 +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
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
77c1e145e1 MFB:
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:32:17 +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
7d4c51c2bd MFH:
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:14:17 +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
e49404929a Fix a bug that let PDO fail. It has been long fixed, but locally. Now I know
what it fixes :)
2008-05-29 15:49:32 +00:00
Andrey Hristov
493b0bb51b Update mysqlnd - new ini variable 2008-05-07 15:16:27 +00:00
Andrey Hristov
8256272540 Update mysqlnd 2008-05-07 15:14:26 +00:00
Andrey Hristov
f4e659d2af Update ext/mysql's and ext/mysqli's tests
Add mysqli_stmt_more_result()/mysqli_stmt_next_result(), but only in
mysqlnd builds as libmysql doesn't support this feature.
2008-04-24 14:22:19 +00:00
Andrey Hristov
5da78b297b Update ext/mysql's and ext/mysqli's tests
Add mysqli_stmt_more_result()/mysqli_stmt_next_result(), but only in
mysqlnd builds as libmysql doesn't support this feature.
2008-04-24 14:04:58 +00:00
Andrey Hristov
de560f3161 MFB: Update CVS from the development tree 2008-04-16 12:57:38 +00:00
Andrey Hristov
c931468b88 Update ext/mysql, ext/mysqli and ext/mysqlnd from development tree 2008-04-16 12:53:18 +00:00
Andrey Hristov
0e884df573 - Don't modify the variables which are passed for parameter binding.
We need to clone them, if there will be a transformation (convert_to_xxx)
  which will change the origin.
- Make mysqlnd more compatible to libmysql, in this case if the execute of
  a statement fails set the state of the statement back to PREPARED
- A test case to check the case of a failing statement.
2008-03-20 13:25:49 +00:00
Andrey Hristov
5855e35b01 Fix memory leak 2008-02-20 15:20:14 +00:00
Andrey Hristov
7d0cee8c80 Fix memory leak 2008-02-20 15:18:17 +00:00
Andrey Hristov
77d6a5afe8 Update mysqlnd - fix bg_store 2008-02-14 12:51:00 +00:00
Andrey Hristov
2d9d22395f Update mysqlnd - fix bg_store 2008-02-14 12:49:30 +00:00
Andrey Hristov
9790d7bfe8 MFH: Fix a compatibility bug and a failing test 2008-02-06 14:12:32 +00:00
Andrey Hristov
0c65a68fc9 Fix a bug and a test 2008-02-06 14:11:32 +00:00
Andrey Hristov
1caa85a682 Pconnect working with mysqli_real_connect(). To less failing tests. 2008-02-06 11:34:44 +00:00
Andrey Hristov
2d5e8a1e55 Fix a leak, memory warning and failing test case. 2008-02-04 17:33:46 +00:00
Andrey Hristov
cfcf16f0f7 Fix a leak and memory warning. 2008-02-04 17:32:43 +00:00
Rob Richards
d7622b8ecf MFH: fix win32 build 2008-01-29 22:06:43 +00:00
Rob Richards
65c4bd9d08 fix win32 build 2008-01-29 22:06:16 +00:00
Andrey Hristov
508841bb5c Fix the build, add a missing file 2008-01-29 18:13:12 +00:00
Andrey Hristov
829831f5ba Fix the build, add a missing file 2008-01-29 18:11:46 +00:00
Andrey Hristov
6d9fdbce50 MFB:
some config.w32 fixes
moved mysqlnd's block allocator to a separate file and also now
it's part of the connection, no MT problems.
2008-01-28 22:54:21 +00:00
Andrey Hristov
2033c1b7f2 some config.w32 fixes
moved mysqlnd's block allocator to a separate file and also now
it's part of the connection, no MT problems.
2008-01-28 22:50:06 +00:00
Andrey Hristov
18c8e6501b MFB: More optimizations - less MM calls
Clearly separated fetching (physical reading) from decoding phases (data
interpretation). Threaded fetching added but disabled as needs more work for
Windows. For Linux needs some touches to add pthreads if this is enabled,
probably with a compile-time switch.
The code reorganisation makes it easy to add also async API, similar to
cURL's one.
2008-01-28 18:27:49 +00:00
Andrey Hristov
7932ccba6d More optimizations - less MM calls
Clearly separated fetching (physical reading) from decoding phases (data
interpretation). Threaded fetching added but disabled as needs more work for
Windows. For Linux needs some touches to add pthreads if this is enabled,
probably with a compile-time switch.
The code reorganisation makes it easy to add also async API, similar to
cURL's one.
2008-01-28 18:25:50 +00:00
Rob Richards
b65adbb4fb MFH: fix win32 compile 2008-01-25 15:54:58 +00:00
Rob Richards
3b37e3a80d fix win32 compile 2008-01-25 15:54:31 +00:00
Andrey Hristov
c52b63ea1d Merge with internal version 2008-01-23 19:11:28 +00:00
Andrey Hristov
69f4a40d99 Merge with internal version 2008-01-23 19:09:33 +00:00
Andrey Hristov
69f7eaa749 - Fix problems with double definitions
- Clean up a bit a type mess - 4 types less. No need to have aliases
  for the same thing (unification is the name).
- New macro for Johannes mysqlnd_stmt_ro_result_metadata
----------------------------------------------------------------------
2008-01-02 21:16:46 +00:00
Andrey Hristov
fdf20a8287 - Fix problems with double definitions
- Clean up a bit a type mess - 4 types less. No need to have aliases
  for the same thing (unification is the name).
- New macro for Johannes mysqlnd_stmt_ro_result_metadata
2008-01-02 21:14:35 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Sebastian Bergmann
9b620d50b4 Bump copyright year, 2 of 2. 2007-12-31 07:12:20 +00:00
Yiduo (David) Wang
f4f0a47433 Fix build for mysqlnd 2007-10-07 21:47:36 +00:00
Antony Dovgal
e9ded30d23 fix typos 2007-10-07 12:23:29 +00:00
Yiduo (David) Wang
95da0dc570 Added macros for managing zval refcounts and is_ref statuses 2007-10-07 05:15:07 +00:00
Andrey Hristov
8b9b553aa2 Import mysqlnd
Patch ext/mysql and ext/mysqli to support mysqlnd
2007-10-05 21:23:56 +00:00
Andrey Hristov
9ac92cfecb Update mysqlnd in HEAD
Updated ext/mysql and ext/mysqli in HEAD
2007-10-02 10:45:27 +00:00
Andrey Hristov
de29322de4 Fix crashes with pconn in ext/mysql 2007-08-06 15:11:46 +00:00
Andrey Hristov
7186530157 Update CVS
- Fix BIT problem for BIT values represented with 5 bytes. Typo.
- Make it possible with an ini variable to switch off/on statistics
  collection.
- Compile-out debug checking of uneaten data from the line, when the
  build is release. According to callgrind this was eating some percentage.
2007-08-03 16:32:27 +00:00
Jani Taskinen
f3c2a33f42 - Moved mysqnd to it's own directory: It is sort of an extension itself.
(Similar to what ext/libxml is..)
2007-07-25 23:47:33 +00:00