Commit Graph

219 Commits

Author SHA1 Message Date
Kalle Sommer Nielsen
87edd143ed Fixed compiler warnings in mysqli
- mysqli.c: Fix unused variables, they are only used in non-mysqlnd mode
 - mysqli_api.c (PHP_5_3 only): Fix constness, add_property_string expects a char *, not a const char *
 - mysqli_prop.c: Cast to long, as its below the LONG_MAX and therefore safe
 - mysqli_result_iterator.c: Cast to ulong as the iterator member expects that rather than a my_longlong

# In trunk only warnings regarding the zend_property_info 
# structure is present and PHP_5_3 is warning free now
2010-10-05 09:40:36 +00:00
Ulf Wendel
2d925fb216 Sorry for the commit but compiler warnings are annoying and so are white spaces at the end of a line, if one uses an editor which removes them on save and diff's get blown
up by white space changes...

Changes: 
- remove end of line white space
- fix compiler warning "ext/mysqli/mysqli_priv.h:156:27: warning: no newline at end of file"
- fix compiler warning "ext/mysqli/mysqli_fe.h:135:25: warning: no newline at end of file"
- fix compiler warning "ext/mysqli/mysqli.c:896:11: warning: extra tokens at end of #ifdef directive"
2010-10-04 10:02:58 +00:00
Andrey Hristov
60327d87a7 Plug a leak in mysqli when in the same script
a pconn is reused.
Call end_psession earlier - so will mysqlnd and
the plugins free data earlier.
2010-09-30 18:10:03 +00:00
Ulf Wendel
f671ad6275 Adding MYSQLI_OPT_SSL_VERIFY_SERVER_CERT for use with mysqli_options(). 2010-08-30 16:59:10 +00:00
Andrey Hristov
27567040d2 Fix for bug #52654 mysqli doesn't install headers with structures it uses 2010-08-20 12:25:17 +00:00
Andrey Hristov
83051b1a86 And a fix for MySQL Server which is pre 5.1.23, which doesn't support
preserving of the charset when performing change_user. This is libmysql
only code.
2010-06-14 18:19:13 +00:00
Andrey Hristov
4a0b4494d4 defensive programming, check before using a resource 2010-06-01 14:16:27 +00:00
Ulf Wendel
4b5666a539 Fixing mysqli_stmt_attr_set @ libmysql 2010-05-31 12:10:04 +00:00
Andrey Hristov
3aa95c59cc Check before use, because mysqlnd can return NULL
and this will crash. However, this can happen only in case of OOM.
2010-05-27 12:44:10 +00:00
Andrey Hristov
d6458c3b1e Add checks to check the underlying pointer in the resource.
It can happen that the underlying pointer is freed (like in
the case of connection reconnect), and then it cannot be allocated
anymore, which means that NULL will be used consequently by the
functions that fetch the resource and the crash is immediate.
2010-05-26 07:28:43 +00:00
Andrey Hristov
c91c86b743 Remove duplicated code.
Use one centralized functions for data extraction.
2010-05-18 11:50:31 +00:00
Andrey Hristov
87bac04bf1 Better fix for #51605 2010-05-13 11:05:09 +00:00
Andrey Hristov
962aa93ec7 Fix for bug #51605 (Mysqli zombie links) 2010-05-11 10:03:16 +00:00
Kalle Sommer Nielsen
cb30330800 Merge safe_mode changes into extensions that are in sync in both branches 2010-04-26 23:55:03 +00:00
Felipe Pena
45b68febe9 - Fix mem. leak 2010-04-21 12:52:24 +00:00
Andrey Hristov
dd9fc198ce Fix for bug#49234 method not found ssl_set
Patch was tested and compiles on Windows. (Thanks Kalle)
2010-04-15 11:01:30 +00:00
Andrey Hristov
8338d48828 Fix for bug #51026 ssl not working 2010-04-08 09:01:21 +00:00
Andrey Hristov
ccfd9cd744 allow persistency of PS 2010-03-12 13:03:46 +00:00
Andrey Hristov
6407250e70 Fix for bug#50772
mysqli constructor without parameters does not return a working mysqli object
2010-01-25 13:23:32 +00:00
Andrey Hristov
36a037d236 Fix build of mysqli when libmysql is used, mysqlnd_portability.h
might not be available for some weird reasons. Added the macros
that we need, in that case

Code by Jess Portnoy
2010-01-14 09:47:57 +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
01adfaee5f Unify. The typedef-ed structs in mysqlnd are always capitalized. 2009-12-23 11:58:45 +00:00
Rasmus Lerdorf
2bdd3538de Fix broken build.
This constant is not in older versions of MySQL.
2009-12-01 21:39:19 +00:00
Ulf Wendel
4a95aa3989 Fix for bug #49965 . Let mysqli_options() try to cast option values to the appropriate type. 2009-11-03 14:56:04 +00:00
Ulf Wendel
ab4670ee53 Fixing problems when calling connect (again and again) on a valid connection handle. Most of the patch comes from Andrey. 2009-10-15 15:49:40 +00:00
Andrey Hristov
3828ca158e Fix mysqli_stmt_attr_set in libmysql mode.
mysql_stmt_attr_set returns my_bool instead of int.
If it was int, then 0 is success and !0 is failure, but
for my_bool 0 (FALSE) is failure and !0 is success.
2009-09-25 12:25:54 +00:00
Andrey Hristov
9b44cbb490 Remove unused variable 2009-09-25 10:55:06 +00:00
Andrey Hristov
eea0660def Fix error code checking for mysql_stmt_attr_set. There
is a test that checks this.
2009-09-25 10:52:29 +00:00
Andrey Hristov
dcb5c5b0a4 MFH: Fix handling of BIT fields in mysqli, when libmysql is used
We need to use macros from mysqlnd to be able to read the
bit fields, as they are specially encoded. mysqlnd is always
there, 5.3+, so its macros can be used, even if mysqlnd is
not compiled as library of choice.
2009-09-22 13:59:29 +00:00
Andrey Hristov
967239727e MFH:Fix for bug#48909 Segmentation fault in mysqli_stmt_execute 2009-09-18 14:33:08 +00:00
Ulf Wendel
617b4e9bd1 Fix for bug #49357 (MySQLi extension fails to recognize POINT (spatial) colums).
Do yourself a favour and use mysqlnd. mysqlnd has no isuses here.

If you insist on using the MySQL Client Library (libmysql) I strongly recommend to use mysqli_stmt_store_result() when fetching geometry data using prepared statements. When streaming data, which is the default for prepared statements, ext/mysqli will have to make a guess on the size of the result buffer it needs. The guess is based on a length reported by the MySQL CLient Library (libmysql). The MySQL Client Library reports 4GB (!) for a POINT - a conservative and safe guess. Consequently, ext/mysqli will try to allocate 4GB of RAM. The true (maximum) size of the column is not available before buffering the result on the client using mysqli_stmt_store_result(). If you call mysqli_stmt_store_result(), the result buffers will not get bigger than needed. However, store_result()/buffering is usually not what you want when you ask for prepared statements.
2009-09-11 13:38:47 +00:00
Ulf Wendel
5dfd12ddb7 Stepping back to PHP 5.2.x and earlier logic of allocating even huge pieces of memory for large BLOB types to avoid data truncation. This fixes the test failure of 005.phpt when using MySQL Client
Library (libmysql). The test does pass with mysqlnd because mysqlnd does not have any issues here.
2009-09-11 12:28:47 +00:00
Ulf Wendel
c4c11fd38a Fixing a crash which must have existed since PHP 5.0. At least the crash can be reproduced with PHP 5.0.6. The crash happens only when using the MySQL Client Library (libmysql) - it does not happen
when using mysqlnd.
2009-09-11 12:16:56 +00:00
Jani Taskinen
b312b3af2e - Revert bad fix for bug #49122 and only enable this when mysqlnd is used 2009-08-04 14:49:33 +00:00
Jani Taskinen
7b411d7cdf - Fixed bug #49122 (undefined reference to mysqlnd_stmt_next_result on compile with --with-mysqli and MySQL 6.0) 2009-08-02 01:07:38 +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
Kalle Sommer Nielsen
e26710bfc4 Fixed compiler warning again, uint8_t is only available with mysqlnd. This is not affecting HEAD 2009-05-23 02:58:15 +00:00
Ilia Alshanetsky
52f599687a Fixed build 2009-05-20 13:10:49 +00:00
Kalle Sommer Nielsen
f02ebe4a08 MFH: Fix compiler warnings in ext/mysql, ext/mysqli and ext/pdo_mysql 2009-05-20 08:30:12 +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
Johannes Schlüter
7d3d47fa27 MFH: Fixed bug #46653 2009-01-09 14:30:00 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Andrey Hristov
bf20aa12c7 MFH:Fix for bug#46019 MySQLi::init() leaks memory 2008-09-19 11:38:46 +00:00
Felipe Pena
e304515ddb - MFH: Added parameter TSRMLS_DC in zend_is_callable() 2008-08-02 04:46:07 +00:00
Andrey Hristov
7833cf9f10 MFH: Fixed bug#45019 Segmentation fault with SELECT ? and UNION 2008-07-25 12:46:03 +00:00
Dmitry Stogov
833a2295d1 Support for closures 2008-07-17 09:53:42 +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
de560f3161 MFB: Update CVS from the development tree 2008-04-16 12:57:38 +00:00
Andrey Hristov
6867385d75 - 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
  (bug#44390 bind_param / bind_result and Object member variables)
- 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 14:03:30 +00:00
Andrey Hristov
725b31fc6c Update mysqlnd, ext/mysql and ext/mysqli - now possible to compile with different
configurations one or the another extension to use libmysql or mysqlnd mixed in
one binary
2008-03-10 20:15:38 +00:00