com php-src: Add the name in a comment at commit/rollback, if provided: ext/mysqlnd/mysqlnd.c
| From: | Andrey Hristov | Date: | Thu, 07 Feb 2013 15:24:08 +0000 |
| Subject: | com php-src: Add the name in a comment at commit/rollback, if provided: ext/mysqlnd/mysqlnd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-71183@lists.php.net to get a copy of this message | ||
Commit: 49e3d91ad91bd3b65e2142641f80de0401396b85
Author: Andrey Hristov <andrey@php.net> Thu, 7 Feb 2013 16:24:08 +0100
Parents: 9fb0dba4be197b677b6ff7df23a110698d12530b
Branches: PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=49e3d91ad91bd3b65e2142641f80de0401396b85
Log:
Add the name in a comment at commit/rollback, if provided
Changed paths:
M ext/mysqlnd/mysqlnd.c
Diff:
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index d7ddcb5..0e47def 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -2678,8 +2678,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA *
con
smart_str_0(&tmp_str);
{
+ char * commented_name = NULL;
+ unsigned int commented_name_len = name? mnd_sprintf(&commented_name, 0, "
/*%s*/", name):0;
char * query;
- unsigned int query_len = mnd_sprintf(&query, 0, (commit? "COMMIT
%s":"ROLLBACK %s"), tmp_str.c? tmp_str.c:"");
+ unsigned int query_len = mnd_sprintf(&query, 0, (commit? "COMMIT%s
%s":"ROLLBACK%s %s"),
+ commented_name? commented_name:"", tmp_str.c? tmp_str.c:"");
smart_str_free(&tmp_str);
if (!query) {
@@ -2688,6 +2691,9 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA *
con
}
ret = conn->m->query(conn, query, query_len TSRMLS_CC);
mnd_sprintf_free(query);
+ if (commented_name) {
+ mnd_sprintf_free(commented_name);
+ }
}
} while (0);
conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);