Lines Matching refs:pg_link

80 #define PQ_SETNONBLOCKING(pg_link, flag) PQsetnonblocking(pg_link, flag)  argument
82 #define PQ_SETNONBLOCKING(pg_link, flag) 0 argument
2323 PGconn *pg_link; local
2331 …if ((pg_link = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_…
5525 PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta, zend_boo… argument
5573 new_len = PQescapeStringConn(pg_link, escaped, tmp_name2, strlen(tmp_name2), NULL);
5581 new_len = PQescapeStringConn(pg_link, escaped, tmp_name, strlen(tmp_name), NULL);
5591 pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s));
5849 PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zv… argument
5856 assert(pg_link != NULL);
5867 if (php_pgsql_meta_data(pg_link, table_name, &meta, 0) == FAILURE) {
6104 …ZSTR_LEN(str) = PQescapeStringConn(pg_link, ZSTR_VAL(str), Z_STRVAL_P(val), Z_STRLEN_P(val), NULL);
6405 tmp = PQescapeByteaConn(pg_link, (unsigned char *)Z_STRVAL_P(val), Z_STRLEN_P(val), &to_len);
6490 char *escaped = PGSQLescapeIdentifier(pg_link, ZSTR_VAL(field), ZSTR_LEN(field));
6515 PGconn *pg_link; local
6530 …if ((pg_link = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_…
6534 if (php_pgsql_flush_query(pg_link)) {
6538 if (php_pgsql_convert(pg_link, table_name, values, return_value, option) == FAILURE) {
6545 static int do_exec(smart_str *querystr, ExecStatusType expect, PGconn *pg_link, zend_ulong opt) /* … argument
6548 if (PQsendQuery(pg_link, ZSTR_VAL(querystr->s))) {
6555 pg_result = PQexec(pg_link, ZSTR_VAL(querystr->s));
6569 static inline void build_tablename(smart_str *querystr, PGconn *pg_link, const char *table) /* {{{ … argument
6579 char *escaped = PGSQLescapeIdentifier(pg_link, table, len);
6591 char *escaped = PGSQLescapeIdentifier(pg_link, after_dot, len);
6602 PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var_array, zend_ulong … argument
6611 assert(pg_link != NULL);
6618 build_tablename(&querystr, pg_link, table);
6627 …if (php_pgsql_convert(pg_link, table, var_array, &converted, (opt & PGSQL_CONV_OPTS)) == FAILURE) {
6634 build_tablename(&querystr, pg_link, table);
6643 tmp = PGSQLescapeIdentifier(pg_link, ZSTR_VAL(fld), ZSTR_LEN(fld) + 1);
6663 new_len = PQescapeStringConn(pg_link, tmp, Z_STRVAL_P(val), Z_STRLEN_P(val), NULL);
6697 do_exec(&querystr, PGRES_COMMAND_OK, pg_link, (opt & PGSQL_CONV_OPTS)) == 0) {
6724 PGconn *pg_link; local
6739 …if ((pg_link = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_…
6743 if (php_pgsql_flush_query(pg_link)) {
6750 if (php_pgsql_insert(pg_link, table, values, option|PGSQL_DML_STRING, &sql) == FAILURE) {
6753 pg_result = PQexec(pg_link, ZSTR_VAL(sql));
6754 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pg_link) != CONNECTION_OK) {
6756 PQreset(pg_link);
6757 pg_result = PQexec(pg_link, ZSTR_VAL(sql));
6764 status = (ExecStatusType) PQstatus(pg_link);
6772 PHP_PQ_ERROR("Query failed: %s", pg_link);
6780 pgsql_handle->conn = pg_link;
6790 } else if (php_pgsql_insert(pg_link, table, values, option, &sql) == FAILURE) {
6801 static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr, HashTable *ht, int … argument
6812 char *tmp = PGSQLescapeIdentifier(pg_link, ZSTR_VAL(fld), ZSTR_LEN(fld) + 1);
6828 size_t new_len = PQescapeStringConn(pg_link, tmp, Z_STRVAL_P(val), Z_STRLEN_P(val), NULL);
6864 PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *var_array, zval *ids_a… argument
6870 assert(pg_link != NULL);
6885 …if (php_pgsql_convert(pg_link, table, var_array, &var_converted, (opt & PGSQL_CONV_OPTS)) == FAILU…
6890 …if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS)) == FAILU…
6897 build_tablename(&querystr, pg_link, table);
6900 if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(var_array), 0, ",", 1, opt))
6905 …if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")…
6911 if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt) == 0) {
6938 PGconn *pg_link; local
6951 …if ((pg_link = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_…
6955 if (php_pgsql_flush_query(pg_link)) {
6958 if (php_pgsql_update(pg_link, table, values, ids, option, &sql) == FAILURE) {
6970 PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids_array, zend_ulong … argument
6976 assert(pg_link != NULL);
6988 …if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS)) == FAILU…
6995 build_tablename(&querystr, pg_link, table);
6998 …if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")…
7004 if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt) == 0) {
7030 PGconn *pg_link; local
7043 …if ((pg_link = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_…
7047 if (php_pgsql_flush_query(pg_link)) {
7050 if (php_pgsql_delete(pg_link, table, ids, option, &sql) == FAILURE) {
7106 …PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids_array, zval *ret_… argument
7113 assert(pg_link != NULL);
7126 …if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS)) == FAILU…
7133 build_tablename(&querystr, pg_link, table);
7136 …if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")…
7142 pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s));
7171 PGconn *pg_link; local
7188 …if ((pg_link = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_…
7192 if (php_pgsql_flush_query(pg_link)) {
7196 if (php_pgsql_select(pg_link, table, ids, return_value, option, result_type, &sql) == FAILURE) {