Andrey Hristov
a712d9cefb
Better fix for bug #51347 mysqli_close / connection memory leak
2010-04-01 12:46:21 +00:00
Andrey Hristov
311ab2c822
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
94cd357f5b
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
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
9f20131311
fix build failure after recent commit by Kalle
2010-03-24 10:06:42 +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
Andrey Hristov
2331e28509
cosmetics. typedef-ed types should be in capital case
2010-01-11 20:10:10 +00:00
Andrey Hristov
1a108f1bae
remove extern defintion of a variable that is no more
...
used outside of the file where it is declared.
Also really export with PHPAPI the protocol init/deinit functions
2010-01-11 19:13:43 +00:00
Andrey Hristov
8b3931b444
this function should be exporten in all cases, not only under PHP6
2010-01-11 18:40:11 +00:00
Andrey Hristov
d999552ae7
missed to commit in 5_3, here it comes, reusability of stats
2010-01-11 18:31:02 +00:00
Andrey Hristov
9b8d026d86
Rework the statistics macros to be reusable by external entities.
...
Rename handlers to triggers. Dynamically allocate space for the
statistics thus allow reusability.
2010-01-11 14:27:35 +00:00
Andrey Hristov
4a549fbb3d
missed to commit to the branch
2010-01-11 12:37:42 +00:00
Andrey Hristov
81695689b9
export some calls to init/deinit code outside of the module
2010-01-08 18:52:08 +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
3264e51983
add restart_psession and end_psession hooks
2010-01-08 13:47:03 +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
Sebastian Bergmann
9ba1e81665
sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php
2010-01-03 09:23:27 +00:00
Andrey Hristov
d76fa2b46c
move network creation to the init hook
2009-12-28 11:17:10 +00:00
Andrey Hristov
01adfaee5f
Unify. The typedef-ed structs in mysqlnd are always capitalized.
2009-12-23 11:58:45 +00:00
Johannes Schlüter
c764995c8e
install mysqlnd headers to allow shared build of extensions
2009-12-22 19:30:09 +00:00
Andrey Hristov
c95fa280ed
Fix double calls to free_contents if the connection cannot be
...
opened. mysqlnd have no probs, external code should not have too.
In any case, double call is not needed.
2009-12-22 17:44:42 +00:00
Andrey Hristov
e1251edc16
move state setting to the right place, in mysqlnd_init, no more
...
in mysqlnd::connect
2009-12-22 17:31:31 +00:00
Andrey Hristov
41ac91aecf
Move this function to MYSQLND_NET as it works on the
...
php stream
2009-12-21 16:52:10 +00:00
Andrey Hristov
ce349e3540
magic numbers to macros
2009-12-21 16:17:31 +00:00