summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqlnd/mysqlnd.c')
-rw-r--r--ext/mysqlnd/mysqlnd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index f6a3fffac8..513df95a80 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
@@ -2496,7 +2496,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option_2d)(MYSQLND_CONN_DATA * cons
DBG_INF_FMT("Adding [%s][%s]", key, value);
{
zval attrz;
- ZVAL_STR(&attrz, zend_string_init(value, strlen(value), 1));
+ ZVAL_NEW_STR(&attrz, zend_string_init(value, strlen(value), 1));
zend_hash_str_update(conn->options->connect_attr, key, strlen(key), &attrz);
}
break;
@@ -2798,18 +2798,18 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsi
smart_str_appendl(&tmp_str, "WITH CONSISTENT SNAPSHOT", sizeof("WITH CONSISTENT SNAPSHOT") - 1);
}
if (mode & (TRANS_START_READ_WRITE | TRANS_START_READ_ONLY)) {
- unsigned long server_version = conn->m->get_server_version(conn TSRMLS_CC);
+ zend_ulong server_version = conn->m->get_server_version(conn TSRMLS_CC);
if (server_version < 50605L) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required");
smart_str_free(&tmp_str);
break;
} else if (mode & TRANS_START_READ_WRITE) {
- if (tmp_str.s->len) {
+ if (tmp_str.s && tmp_str.s->len) {
smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1);
}
smart_str_appendl(&tmp_str, "READ WRITE", sizeof("READ WRITE") - 1);
} else if (mode & TRANS_START_READ_ONLY) {
- if (tmp_str.s->len) {
+ if (tmp_str.s && tmp_str.s->len) {
smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1);
}
smart_str_appendl(&tmp_str, "READ ONLY", sizeof("READ ONLY") - 1);