andrey Tue, 25 May 2010 22:38:11 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=299760
Log:
Use the specialized macro for this case
Changed paths:
U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps_codec.c
U php/php-src/trunk/ext/mysqlnd/mysqlnd_ps_codec.c
Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps_codec.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps_codec.c 2010-05-25
22:36:33 UTC (rev 299759)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps_codec.c 2010-05-25
22:38:11 UTC (rev 299760)
@@ -621,7 +621,7 @@
*buf_len = offset + stmt->param_count * 2 + 20;
tmp_buf = mnd_emalloc(*buf_len);
if (!tmp_buf) {
- SET_STMT_ERROR(stmt, CR_UNKNOWN_ERROR,
UNKNOWN_SQLSTATE, "OOM");
+ SET_OOM_ERROR(stmt->error_info);
goto end;
}
memcpy(tmp_buf, *buf, offset);
@@ -655,7 +655,7 @@
if (stmt->param_bind[j].zv == the_var) {
/* Double binding of the same zval, make a copy
*/
if (PASS != mysqlnd_stmt_copy_it(&copies,
the_var, stmt->param_count, i TSRMLS_CC)) {
- SET_STMT_ERROR(stmt, CR_UNKNOWN_ERROR,
UNKNOWN_SQLSTATE, "OOM");
+ SET_OOM_ERROR(stmt->error_info);
goto end;
}
break;
@@ -668,7 +668,7 @@
if (Z_TYPE_P(the_var) != IS_DOUBLE) {
if (!copies || !copies[i]) {
if (PASS !=
mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i TSRMLS_CC)) {
- SET_STMT_ERROR(stmt,
CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "OOM");
+
SET_OOM_ERROR(stmt->error_info);
goto end;
}
}
@@ -686,7 +686,7 @@
if (Z_TYPE_P(the_var) != IS_LONG) {
if (!copies || !copies[i]) {
if (PASS !=
mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i TSRMLS_CC)) {
- SET_STMT_ERROR(stmt,
CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "OOM");
+
SET_OOM_ERROR(stmt->error_info);
goto end;
}
}
@@ -712,7 +712,7 @@
{
if (!copies || !copies[i]) {
if (PASS !=
mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i TSRMLS_CC)) {
- SET_STMT_ERROR(stmt,
CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "OOM");
+
SET_OOM_ERROR(stmt->error_info);
goto end;
}
}
@@ -738,7 +738,7 @@
*buf_len = offset + data_size + 10; /* Allocate + 10 for safety
*/
tmp_buf = mnd_emalloc(*buf_len);
if (!tmp_buf) {
- SET_STMT_ERROR(stmt, CR_UNKNOWN_ERROR,
UNKNOWN_SQLSTATE, "OOM");
+ SET_OOM_ERROR(stmt->error_info);
goto end;
}
memcpy(tmp_buf, *buf, offset);
Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_ps_codec.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_ps_codec.c 2010-05-25 22:36:33 UTC
(rev 299759)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_ps_codec.c 2010-05-25 22:38:11 UTC
(rev 299760)
@@ -621,7 +621,7 @@
*buf_len = offset + stmt->param_count * 2 + 20;
tmp_buf = mnd_emalloc(*buf_len);
if (!tmp_buf) {
- SET_STMT_ERROR(stmt, CR_UNKNOWN_ERROR,
UNKNOWN_SQLSTATE, "OOM");
+ SET_OOM_ERROR(stmt->error_info);
goto end;
}
memcpy(tmp_buf, *buf, offset);
@@ -655,7 +655,7 @@
if (stmt->param_bind[j].zv == the_var) {
/* Double binding of the same zval, make a copy
*/
if (PASS != mysqlnd_stmt_copy_it(&copies,
the_var, stmt->param_count, i TSRMLS_CC)) {
- SET_STMT_ERROR(stmt, CR_UNKNOWN_ERROR,
UNKNOWN_SQLSTATE, "OOM");
+ SET_OOM_ERROR(stmt->error_info);
goto end;
}
break;
@@ -668,7 +668,7 @@
if (Z_TYPE_P(the_var) != IS_DOUBLE) {
if (!copies || !copies[i]) {
if (PASS !=
mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i TSRMLS_CC)) {
- SET_STMT_ERROR(stmt,
CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "OOM");
+
SET_OOM_ERROR(stmt->error_info);
goto end;
}
}
@@ -686,7 +686,7 @@
if (Z_TYPE_P(the_var) != IS_LONG) {
if (!copies || !copies[i]) {
if (PASS !=
mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i TSRMLS_CC)) {
- SET_STMT_ERROR(stmt,
CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "OOM");
+
SET_OOM_ERROR(stmt->error_info);
goto end;
}
}
@@ -712,7 +712,7 @@
{
if (!copies || !copies[i]) {
if (PASS !=
mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i TSRMLS_CC)) {
- SET_STMT_ERROR(stmt,
CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "OOM");
+
SET_OOM_ERROR(stmt->error_info);
goto end;
}
}
@@ -738,7 +738,7 @@
*buf_len = offset + data_size + 10; /* Allocate + 10 for safety
*/
tmp_buf = mnd_emalloc(*buf_len);
if (!tmp_buf) {
- SET_STMT_ERROR(stmt, CR_UNKNOWN_ERROR,
UNKNOWN_SQLSTATE, "OOM");
+ SET_OOM_ERROR(stmt->error_info);
goto end;
}
memcpy(tmp_buf, *buf, offset);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php