1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 19:23:22 +02:00
Commit Graph

109 Commits

Author SHA1 Message Date
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 0aada07656 MFH:
Fix two problems:
- The value of mysqli_get_client_info() has been changed recently and did
not include "mysqlnd" anymore thus the test suite was thinking the build
is always libmysql. This did not kept the suite from running pconn tests
- Going back to the libc allocator because the memory arena could be on a
  persistent connections. If the build is not debug there will be no error
  but the memory will be freed and in the second use of this pconn freed
  memory will be used - not good! For now the arena doesn't take an argument
  whether it should allocate persistently or not, thus persistent is safe
  for now.

Johannes gave his +1 to commit this.
2009-06-17 16:22:13 +00:00
Andrey Hristov 30800a79b9 MFH: C-comments 2009-06-16 18:00:00 +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 a2acaa7fcd MFH:
Use Zend's allocator instead of libc's and also don't try to work on
zvals that are NULLs.
2009-06-16 07:53:35 +00:00
Andrey Hristov 22c8786493 MFH:
Fix crash when tracing is enabled. Position after buffer was used also
direct usage of MYSQLND_STRING pointer instead of the "s" property of the
structure.
2009-06-12 13:24:57 +00:00
Andrey Hristov 9a2cc0ce67 Put these in an ifdef because they are not used at all if the zval cache
is off.
2009-06-11 17:54:04 +00:00
Pierre Joye f2fcd8fb29 - silent warning and make it less ambiguous 2009-06-11 14:36:48 +00:00
Johannes Schlüter 11340cf299 MFH: Use a better extension version 2009-06-11 10:18:08 +00:00
Andrey Hristov 28c8d25dca MFH:
Protect the code when variable is NULL, which should never happen, but
anyway, you know about "never happens" :)
2009-06-11 08:52:06 +00:00
Andrey Hristov cff09ba5df MFH:
Check the pointer before calling a function on it, or we will crash.
  This is a very rare situation where the server is totally broken.
2009-06-11 08:35:47 +00:00
Andrey Hristov a3b85c28c6 Sync with PHP6 - TSRMLS_FETCH
Extract reference decrement in own function
Remove PHPAPI of a function and make it static as it is not called
externally
2009-06-11 08:30:08 +00:00
Andrey Hristov ec777b89f4 Merge with HEAD. Someone committed changes to HEAD and did not merge back to
the branch.
Also switch off the zval cache, for now.
2009-06-08 10:20:27 +00:00
Andrey Hristov c1d46eb502 MFH:Add support for mysql_stmt_store_result() from libmysql 6.0.8+ and 5.4.x 2009-05-29 13:09:47 +00:00
Andrey Hristov ccf0665170 MFH:Fix for the failing mysql_stmt_execute() test. Data was cleaned after
stmt_reset() but it should stay and be freed as later as next stmt_execute()
2009-05-29 12:19:40 +00:00
Andrey Hristov 133296f962 MFH:Fix a very well hidden error because of not being careful with CPP.
I usually don't make this mistake :)
2009-05-29 08:05: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
Andrey Hristov 7ae2505cab Fix a typo, utf8 is 3 byte max, for us, for now
Add a another cset
2009-05-26 13:41:18 +00:00
Johannes Schlüter 501ecb10f4 Fix #47535 Compilation failure in ps_fetch_from_1_to_8_bytes() 2009-04-20 09:16:51 +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
Johannes Schlüter 5942f27d86 MFH: mark mysqlnd's threading (which can be used for background pre-fetching)
experimental
2009-03-17 10:05:19 +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 8f102c1697 MFH: Add charsets from MySQL 6.0 as a structure to be used later 2009-02-20 13:25:12 +00:00
Johannes Schlüter ebef020ecc - MFH: Improve mysqlnd's internal method registration 2009-02-16 17:26:43 +00:00
Johannes Schlüter 074b084852 MFH: export mysql_refresh
[DOC] This makes mysql_refresh() as described in
      http://dev.mysql.com/doc/refman/6.0/en/mysql-refresh.html
      available as mysqli_Refresh() and mysqli->refresh()
      MYSQLI_REFRESH_BACKUP_LOG is only available when linking libmysql 6.0
      or mysqlnd
2009-01-22 21:01:58 +00:00
Sebastian Bergmann 08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Johannes Schlüter 836dd82c8e MFH: No infinite loop in case the connection broke 2008-11-28 14:38:03 +00:00
Andrey Hristov d43b7b022f MFH:
Windows fixes for mysqlnd
Less warnings + PHPAPI for mysqlnd_poll
2008-11-20 17:21:36 +00:00
Andrey Hristov e62f5f8f03 MFH:
Fix a small bug that mysqlnd::next_result didn't care about an error in a
multi-statement. In an inner layer the error has been already set, thus it
needed better massage on the top level.
2008-11-19 17:45:43 +00:00
Andrey Hristov 3343619b9a MFH: Fix Windows build, pure C compiler 2008-11-18 18:02:44 +00:00
Andrey Hristov 825034cea5 MFH:
Asynchronous queries for mysqli, when mysqlnd is enabled.
Includes 4 tests for mysqli_poll
2008-11-18 17:02:18 +00:00
Andrey Hristov 737c3c89c6 MFB: More Windows types cleanup 2008-11-06 18:48:55 +00:00
Andrey Hristov e49366850f MFH: Use win32/php_stdint.h for stdint types on Windows 2008-11-06 14:21:50 +00:00
Andrey Hristov e099d732a6 MFH: More cleanup of config-win.h 2008-11-06 11:29:20 +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 a836ea7b71 Fix windows build 2008-11-01 21:22:29 +00:00
Andrey Hristov 9726d6b047 Fix the build 2008-10-31 21:29:54 +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
Johannes Schlüter 04d9bbe65e MFH: Fix #46285 (lastInsertId() returns "0" when a deferenced PDOStatement is
executed)
2008-10-27 17:21:22 +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 b18bf1f880 Fix a name 2008-10-27 14:38:31 +00:00
Johannes Schlüter c3dab8f191 MFH: Don't dereference NULL-pointer 2008-10-19 12:28:43 +00:00
Johannes Schlüter 80720205c0 MFH: Improve order in MINFO output 2008-10-01 21:36:43 +00:00
Johannes Schlüter 3c335a3b5e MFH: Handle failed connections right 2008-10-01 19:47:17 +00:00
Andrey Hristov b429a84c2b MFH:
Fix a crash introduced yesterday in mysqlnd, non-zts mode - missing if () for
STAT_LAST was accessing wrong memory thus overwritting method pointers.

Windows doesn't have atoll(), which is C99, C89 has only atoi() + atol().
Win has _atoi64, so use it.
2008-09-16 14:35:01 +00:00
Andrey Hristov 8bb2465a51 MFH:
Add float conversions too. Float users should understand how float works!!!
2008-09-15 18:09:20 +00:00