projects
/
m6w6
/
ext-pq
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
release 1.1.1
[m6w6/ext-pq]
/
src
/
php_pqstm.c
diff --git
a/src/php_pqstm.c
b/src/php_pqstm.c
index e075860193d97f249ac12ebae8f29482ff7473d2..1eb943bea1b4cac83db2d29c41c353f9fa28c5f0 100644
(file)
--- a/
src/php_pqstm.c
+++ b/
src/php_pqstm.c
@@
-52,7
+52,7
@@
static void php_pqstm_deallocate(php_pqstm_object_t *obj, zend_bool async, zend_
PGresult *res;
if ((res = php_pq_exec(obj->intern->conn->intern->conn, cmd.c))) {
PGresult *res;
if ((res = php_pq_exec(obj->intern->conn->intern->conn, cmd.c))) {
- php_pq
_clear_res
(res);
+ php_pq
res_clear
(res);
} else if (!silent) {
throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to deallocate statement (%s)", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
}
} else if (!silent) {
throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to deallocate statement (%s)", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
}
@@
-63,6
+63,7
@@
static void php_pqstm_deallocate(php_pqstm_object_t *obj, zend_bool async, zend_
}
obj->intern->allocated = 0;
}
obj->intern->allocated = 0;
+ zend_hash_del(&obj->intern->conn->intern->statements, obj->intern->name, strlen(obj->intern->name)+1);
}
}
}
}
@@
-164,6
+165,8
@@
php_pqstm_t *php_pqstm_init(php_pqconn_object_t *conn, const char *name, const c
ZEND_INIT_SYMTABLE(&stm->bound);
ZEND_INIT_SYMTABLE(&stm->bound);
+ zend_hash_add(&conn->intern->statements, name, strlen(name)+1, &stm, sizeof(stm), NULL);
+
return stm;
}
return stm;
}
@@
-350,7
+353,7
@@
static PHP_METHOD(pqstm, desc) {
add_next_index_long(return_value, PQparamtype(res, p));
}
}
add_next_index_long(return_value, PQparamtype(res, p));
}
}
- php_pq
_clear_res
(res);
+ php_pq
res_clear
(res);
php_pqconn_notify_listeners(obj->intern->conn TSRMLS_CC);
}
}
php_pqconn_notify_listeners(obj->intern->conn TSRMLS_CC);
}
}
@@
-420,7
+423,7
@@
static PHP_METHOD(pqstm, deallocateAsync)
php_pqstm_deallocate_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
php_pqstm_deallocate_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
-static
zend_always_
inline void php_pqstm_prepare_handler(INTERNAL_FUNCTION_PARAMETERS, zend_bool async)
+static inline void php_pqstm_prepare_handler(INTERNAL_FUNCTION_PARAMETERS, zend_bool async)
{
zend_error_handling zeh;
ZEND_RESULT_CODE rv;
{
zend_error_handling zeh;
ZEND_RESULT_CODE rv;
@@
-443,6
+446,9
@@
static zend_always_inline void php_pqstm_prepare_handler(INTERNAL_FUNCTION_PARAM
if (SUCCESS == rv) {
obj->intern->allocated = 1;
if (SUCCESS == rv) {
obj->intern->allocated = 1;
+
+ zend_hash_add(&obj->intern->conn->intern->statements,
+ obj->intern->name, strlen(obj->intern->name)+1, &obj->intern, sizeof(obj->intern), NULL);
}
}
}
}
}
}