summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_driver.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2015-10-29 17:52:10 +0100
committerAndrey Hristov <andrey@php.net>2015-11-12 16:19:16 +0100
commit5609eabc6f1ee7592fcc0185cb61eaf34a67024d (patch)
tree411ab209880c9fa654301f1260627bac456f68ad /ext/mysqlnd/mysqlnd_driver.c
parent092afe7212c65f4eb26f4f180280746f90352851 (diff)
downloadphp-git-5609eabc6f1ee7592fcc0185cb61eaf34a67024d.tar.gz
MDNR:
- make MYSQLND_UPSERT_STATUS more like an object that a simple structure Still use macros to make updates simple
Diffstat (limited to 'ext/mysqlnd/mysqlnd_driver.c')
-rw-r--r--ext/mysqlnd/mysqlnd_driver.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/mysqlnd/mysqlnd_driver.c b/ext/mysqlnd/mysqlnd_driver.c
index 00e38adde2..8c11093826 100644
--- a/ext/mysqlnd/mysqlnd_driver.c
+++ b/ext/mysqlnd/mysqlnd_driver.c
@@ -135,7 +135,10 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_connection)(struct st_mysqlnd_object_
data->error_info = &(data->error_info_impl);
data->options = &(data->options_impl);
+
+ mysqlnd_upsert_status_init(&data->upsert_status_impl);
data->upsert_status = &(data->upsert_status_impl);
+ UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(data->upsert_status);
data->persistent = persistent;
data->m = mysqlnd_conn_data_get_methods();
@@ -151,7 +154,6 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_connection)(struct st_mysqlnd_object_
zend_llist_init(data->error_info->error_list, sizeof(MYSQLND_ERROR_LIST_ELEMENT), (llist_dtor_func_t)mysqlnd_error_list_pdtor, persistent);
mysqlnd_stats_init(&data->stats, STAT_LAST, persistent);
- SET_ERROR_AFF_ROWS(data);
data->net = mysqlnd_net_init(persistent, data->stats, data->error_info);
data->payload_decoder_factory = mysqlnd_protocol_payload_decoder_factory_init(data, persistent);
@@ -219,6 +221,7 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_prepared_statement)(MYSQLND_CONN_DATA
}
stmt->persistent = persistent;
stmt->error_info = &(stmt->error_info_impl);
+ mysqlnd_upsert_status_init(&stmt->upsert_status_impl);
stmt->upsert_status = &(stmt->upsert_status_impl);
stmt->state = MYSQLND_STMT_INITTED;
stmt->execute_cmd_buffer.length = 4096;