Lines Matching refs:pg_link

4541 PHP_PGSQL_API zend_result php_pgsql_meta_data(PGconn *pg_link, const zend_string *table_name, zval …  in php_pgsql_meta_data()  argument
4587 new_len = PQescapeStringConn(pg_link, escaped, tmp_name2, len, NULL); in php_pgsql_meta_data()
4596 new_len = PQescapeStringConn(pg_link, escaped, tmp_name, len, NULL); in php_pgsql_meta_data()
4606 pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s)); in php_pgsql_meta_data()
4847 PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string *table_name, const z… in php_pgsql_convert() argument
4854 ZEND_ASSERT(pg_link != NULL); in php_pgsql_convert()
4864 if (php_pgsql_meta_data(pg_link, table_name, &meta, 0) == FAILURE) { in php_pgsql_convert()
5097 …ZSTR_LEN(str) = PQescapeStringConn(pg_link, ZSTR_VAL(str), Z_STRVAL_P(val), Z_STRLEN_P(val), NULL); in php_pgsql_convert()
5354 tmp = PQescapeByteaConn(pg_link, (unsigned char *)Z_STRVAL_P(val), Z_STRLEN_P(val), &to_len); in php_pgsql_convert()
5430 char *escaped = PQescapeIdentifier(pg_link, ZSTR_VAL(field), ZSTR_LEN(field)); in php_pgsql_convert()
5454 PGconn *pg_link; in PHP_FUNCTION() local
5477 pg_link = link->conn; in PHP_FUNCTION()
5479 if (php_pgsql_flush_query(pg_link)) { in PHP_FUNCTION()
5483 if (php_pgsql_convert(pg_link, table_name, values, return_value, option) == FAILURE) { in PHP_FUNCTION()
5490 static bool do_exec(smart_str *querystr, ExecStatusType expect, PGconn *pg_link, zend_ulong opt) /*… in do_exec() argument
5493 if (PQsendQuery(pg_link, ZSTR_VAL(querystr->s))) { in do_exec()
5499 pg_result = PQexec(pg_link, ZSTR_VAL(querystr->s)); in do_exec()
5513 static inline void build_tablename(smart_str *querystr, PGconn *pg_link, const zend_string *table) … in build_tablename() argument
5522 char *escaped = PQescapeIdentifier(pg_link, ZSTR_VAL(table), len); in build_tablename()
5534 char *escaped = PQescapeIdentifier(pg_link, after_dot, len); in build_tablename()
5544 PHP_PGSQL_API zend_result php_pgsql_insert(PGconn *pg_link, const zend_string *table, zval *var_arr… in php_pgsql_insert() argument
5553 ZEND_ASSERT(pg_link != NULL); in php_pgsql_insert()
5560 build_tablename(&querystr, pg_link, table); in php_pgsql_insert()
5569 …if (php_pgsql_convert(pg_link, table, var_array, &converted, (opt & PGSQL_CONV_OPTS)) == FAILURE) { in php_pgsql_insert()
5576 build_tablename(&querystr, pg_link, table); in php_pgsql_insert()
5585 tmp = PQescapeIdentifier(pg_link, ZSTR_VAL(fld), ZSTR_LEN(fld) + 1); in php_pgsql_insert()
5605 new_len = PQescapeStringConn(pg_link, tmp, Z_STRVAL_P(val), Z_STRLEN_P(val), NULL); in php_pgsql_insert()
5638 do_exec(&querystr, PGRES_COMMAND_OK, pg_link, (opt & PGSQL_CONV_OPTS))) { in php_pgsql_insert()
5664 PGconn *pg_link; in PHP_FUNCTION() local
5690 pg_link = link->conn; in PHP_FUNCTION()
5692 if (php_pgsql_flush_query(pg_link)) { in PHP_FUNCTION()
5699 if (php_pgsql_insert(pg_link, table, values, option|PGSQL_DML_STRING, &sql) == FAILURE) { in PHP_FUNCTION()
5702 pg_result = PQexec(pg_link, ZSTR_VAL(sql)); in PHP_FUNCTION()
5703 if ((PGG(auto_reset_persistent) & 2) && PQstatus(pg_link) != CONNECTION_OK) { in PHP_FUNCTION()
5705 PQreset(pg_link); in PHP_FUNCTION()
5706 pg_result = PQexec(pg_link, ZSTR_VAL(sql)); in PHP_FUNCTION()
5713 status = (ExecStatusType) PQstatus(pg_link); in PHP_FUNCTION()
5721 PHP_PQ_ERROR("Query failed: %s", pg_link); in PHP_FUNCTION()
5730 pg_res->conn = pg_link; in PHP_FUNCTION()
5740 } else if (php_pgsql_insert(pg_link, table, values, option, &sql) == FAILURE) { in PHP_FUNCTION()
5751 static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr, HashTable *ht, int … in build_assignment_string() argument
5762 char *tmp = PQescapeIdentifier(pg_link, ZSTR_VAL(fld), ZSTR_LEN(fld) + 1); in build_assignment_string()
5779 size_t new_len = PQescapeStringConn(pg_link, tmp, Z_STRVAL_P(val), Z_STRLEN_P(val), NULL); in build_assignment_string()
5814 PHP_PGSQL_API zend_result php_pgsql_update(PGconn *pg_link, const zend_string *table, zval *var_arr… in php_pgsql_update() argument
5820 ZEND_ASSERT(pg_link != NULL); in php_pgsql_update()
5835 …if (php_pgsql_convert(pg_link, table, var_array, &var_converted, (opt & PGSQL_CONV_OPTS)) == FAILU… in php_pgsql_update()
5840 …if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS)) == FAILU… in php_pgsql_update()
5847 build_tablename(&querystr, pg_link, table); in php_pgsql_update()
5850 if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(var_array), 0, ",", 1, opt)) in php_pgsql_update()
5855 …if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")… in php_pgsql_update()
5861 if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt)) { in php_pgsql_update()
5887 PGconn *pg_link; in PHP_FUNCTION() local
5912 pg_link = link->conn; in PHP_FUNCTION()
5914 if (php_pgsql_flush_query(pg_link)) { in PHP_FUNCTION()
5917 if (php_pgsql_update(pg_link, table, values, ids, option, &sql) == FAILURE) { in PHP_FUNCTION()
5928 PHP_PGSQL_API zend_result php_pgsql_delete(PGconn *pg_link, const zend_string *table, zval *ids_arr… in php_pgsql_delete() argument
5934 ZEND_ASSERT(pg_link != NULL); in php_pgsql_delete()
5946 …if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS)) == FAILU… in php_pgsql_delete()
5953 build_tablename(&querystr, pg_link, table); in php_pgsql_delete()
5956 …if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")… in php_pgsql_delete()
5962 if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt)) { in php_pgsql_delete()
5987 PGconn *pg_link; in PHP_FUNCTION() local
6011 pg_link = link->conn; in PHP_FUNCTION()
6013 if (php_pgsql_flush_query(pg_link)) { in PHP_FUNCTION()
6016 if (php_pgsql_delete(pg_link, table, ids, option, &sql) == FAILURE) { in PHP_FUNCTION()
6068 PHP_PGSQL_API zend_result php_pgsql_select(PGconn *pg_link, const zend_string *table, zval *ids_arr… in php_pgsql_select() argument
6075 ZEND_ASSERT(pg_link != NULL); in php_pgsql_select()
6089 …if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS)) == FAILU… in php_pgsql_select()
6097 build_tablename(&querystr, pg_link, table); in php_pgsql_select()
6101 …if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")… in php_pgsql_select()
6109 pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s)); in php_pgsql_select()
6141 PGconn *pg_link; in PHP_FUNCTION() local
6171 pg_link = link->conn; in PHP_FUNCTION()
6173 if (php_pgsql_flush_query(pg_link)) { in PHP_FUNCTION()
6177 if (php_pgsql_select(pg_link, table, ids, return_value, option, result_type, &sql) == FAILURE) { in PHP_FUNCTION()