summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2008-03-20 14:03:30 +0000
committerAndrey Hristov <andrey@php.net>2008-03-20 14:03:30 +0000
commit6867385d75e7f4623bd24203dd37be4603e6f420 (patch)
tree9e00e8bdf76d548c7de5cc869289c87d2c93b0ac /ext/mysqlnd/mysqlnd.c
parentb2af8cac942340ab9e32de48532e45aa10743725 (diff)
downloadphp-git-6867385d75e7f4623bd24203dd37be4603e6f420.tar.gz
- 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.
Diffstat (limited to 'ext/mysqlnd/mysqlnd.c')
-rw-r--r--ext/mysqlnd/mysqlnd.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index b3ac202441..82702254bc 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -591,6 +591,7 @@ PHPAPI MYSQLND *mysqlnd_connect(MYSQLND *conn,
if (hashed_details) {
mnd_efree(hashed_details);
}
+ errcode = CR_CONNECTION_ERROR;
goto err;
}
@@ -748,7 +749,7 @@ PHPAPI MYSQLND *mysqlnd_connect(MYSQLND *conn,
conn->net.cmd_buffer.length = 128L*1024L;
conn->net.cmd_buffer.buffer = mnd_pemalloc(conn->net.cmd_buffer.length, conn->persistent);
- mysqlnd_local_infile_default(conn);
+ mysqlnd_local_infile_default(conn);
{
uint buf_size;
buf_size = MYSQLND_G(net_read_buffer_size); /* this is long, cast to uint*/
@@ -807,11 +808,12 @@ err:
DBG_ERR_FMT("[%d] %.64s (trying to connect via %s)", errcode, errstr, conn->scheme);
SET_CLIENT_ERROR(conn->error_info, errcode? errcode:CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, errstr);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "[%d] %.64s (trying to connect via %s)", errcode, errstr, conn->scheme);
-
- mnd_efree(errstr);
+ /* no mnd_ since we don't allocate it */
+ efree(errstr);
}
if (conn->scheme) {
- mnd_pefree(conn->scheme, conn->persistent);
+ /* no mnd_ since we don't allocate it */
+ pefree(conn->scheme, conn->persistent);
conn->scheme = NULL;
}
@@ -1315,7 +1317,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn, get_state)(MYSQLND * const conn TSRMLS_DC)
{
enum mysqlnd_connection_state state;
DBG_ENTER("mysqlnd_conn::get_state");
- tsrm_mutex_lock(conn->LOCK_state);
+ tsrm_mutex_lock(conn->LOCK_state);
state = conn->state;
tsrm_mutex_unlock(conn->LOCK_state);
DBG_RETURN(state);