Lines Matching refs:pg_result

232 static void pgsql_result_free(pgsql_result_handle *pg_result)  in pgsql_result_free()  argument
234 PQclear(pg_result->result); in pgsql_result_free()
235 pg_result->result = NULL; in pgsql_result_free()
240 pgsql_result_handle *pg_result = pgsql_result_from_obj(obj); in pgsql_result_free_obj() local
242 if (pg_result->result) { in pgsql_result_free_obj()
243 pgsql_result_free(pg_result); in pgsql_result_free_obj()
246 zend_object_std_dtor(&pg_result->std); in pgsql_result_free_obj()
434 PGresult *pg_result = PQexec(conn, query); in PQchangePassword() local
440 return pg_result; in PQchangePassword()
665 PGresult *pg_result; in php_pgsql_do_connect() local
718 PGresult *pg_result; in php_pgsql_do_connect() local
720 while ((pg_result = PQgetResult(le->ptr))) { in php_pgsql_do_connect()
721 PQclear(pg_result); in php_pgsql_do_connect()
729 PGresult *pg_result; in php_pgsql_do_connect() local
730 pg_result = PQexec(le->ptr, "select 1"); in php_pgsql_do_connect()
731 PQclear(pg_result); in php_pgsql_do_connect()
749 pg_result = PQexec(pgsql, "RESET ALL;"); in php_pgsql_do_connect()
750 PQclear(pg_result); in php_pgsql_do_connect()
1188 pgsql_result_handle *pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION() local
1189 pg_result->conn = pgsql; in PHP_FUNCTION()
1190 pg_result->result = pgsql_result; in PHP_FUNCTION()
1191 pg_result->row = 0; in PHP_FUNCTION()
1227 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1314 pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION()
1315 pg_result->conn = pgsql; in PHP_FUNCTION()
1316 pg_result->result = pgsql_result; in PHP_FUNCTION()
1317 pg_result->row = 0; in PHP_FUNCTION()
1337 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1397 pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION()
1398 pg_result->conn = pgsql; in PHP_FUNCTION()
1399 pg_result->result = pgsql_result; in PHP_FUNCTION()
1400 pg_result->row = 0; in PHP_FUNCTION()
1423 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1509 pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION()
1510 pg_result->conn = pgsql; in PHP_FUNCTION()
1511 pg_result->result = pgsql_result; in PHP_FUNCTION()
1512 pg_result->row = 0; in PHP_FUNCTION()
1530 pgsql_result_handle *pg_result; in php_pgsql_get_result_info() local
1536 pg_result = Z_PGSQL_RESULT_P(result); in php_pgsql_get_result_info()
1537 CHECK_PGSQL_RESULT(pg_result); in php_pgsql_get_result_info()
1538 pgsql_result = pg_result->result; in php_pgsql_get_result_info()
1679 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1690 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
1691 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
1698 if (fnum >= PQnfields(pg_result->result)) { in PHP_FUNCTION()
1703 Oid oid = PQftable(pg_result->result, (int)fnum); in PHP_FUNCTION()
1723 PGresult *tmp_res = PQexec(pg_result->conn, ZSTR_VAL(querystr.s)); in PHP_FUNCTION()
1757 pgsql_result_handle *pg_result; in php_pgsql_get_field_info() local
1765 pg_result = Z_PGSQL_RESULT_P(result); in php_pgsql_get_field_info()
1766 CHECK_PGSQL_RESULT(pg_result); in php_pgsql_get_field_info()
1773 pgsql_result = pg_result->result; in php_pgsql_get_field_info()
1788 RETURN_STR(get_field_name(pg_result->conn, PQftype(pgsql_result, (int)field))); in php_pgsql_get_field_info()
1835 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1842 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
1843 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
1844 pgsql_result = pg_result->result; in PHP_FUNCTION()
1881 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1909 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
1910 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
1911 pgsql_result = pg_result->result; in PHP_FUNCTION()
1914 if (pg_result->row < 0) { in PHP_FUNCTION()
1915 pg_result->row = 0; in PHP_FUNCTION()
1917 pgsql_row = pg_result->row; in PHP_FUNCTION()
1921 pg_result->row++; in PHP_FUNCTION()
1954 pgsql_result_handle *pg_result; in php_pgsql_fetch_hash() local
1994 pg_result = Z_PGSQL_RESULT_P(result); in php_pgsql_fetch_hash()
1995 CHECK_PGSQL_RESULT(pg_result); in php_pgsql_fetch_hash()
1996 pgsql_result = pg_result->result; in php_pgsql_fetch_hash()
2005 pg_result->row = pgsql_row; in php_pgsql_fetch_hash()
2008 pgsql_row = pg_result->row; in php_pgsql_fetch_hash()
2012 pg_result->row++; in php_pgsql_fetch_hash()
2107 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2120 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2121 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2122 pgsql_result = pg_result->result; in PHP_FUNCTION()
2134 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2145 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2146 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2153 pgsql_result = pg_result->result; in PHP_FUNCTION()
2182 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2189 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2190 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2192 if (row < 0 || row >= PQntuples(pg_result->result)) { in PHP_FUNCTION()
2197 pg_result->row = (int)row; in PHP_FUNCTION()
2213 pgsql_result_handle *pg_result; in php_pgsql_data_info() local
2242 pg_result = Z_PGSQL_RESULT_P(result); in php_pgsql_data_info()
2243 CHECK_PGSQL_RESULT(pg_result); in php_pgsql_data_info()
2244 pgsql_result = pg_result->result; in php_pgsql_data_info()
2247 if (pg_result->row < 0) { in php_pgsql_data_info()
2248 pg_result->row = 0; in php_pgsql_data_info()
2250 pgsql_row = pg_result->row; in php_pgsql_data_info()
2316 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2322 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2323 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2325 pgsql_result_free(pg_result); in PHP_FUNCTION()
2335 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2342 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2343 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2344 pgsql_result = pg_result->result; in PHP_FUNCTION()
3119 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
3125 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
3126 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
3128 RETURN_LONG(PQresultMemorySize(pg_result->result)); in PHP_FUNCTION()
3671 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
3678 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
3679 pgsql_result = pg_result->result; in PHP_FUNCTION()
3695 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
3703 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
3704 pgsql_result = pg_result->result; in PHP_FUNCTION()
4239 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
4256 pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION()
4257 pg_result->conn = pgsql; in PHP_FUNCTION()
4258 pg_result->result = pgsql_result; in PHP_FUNCTION()
4259 pg_result->row = 0; in PHP_FUNCTION()
4270 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
4278 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
4279 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
4280 pgsql_result = pg_result->result; in PHP_FUNCTION()
4516 PGresult *pg_result; in php_pgsql_meta_data() local
4579 pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s)); in php_pgsql_meta_data()
4580 if (PQresultStatus(pg_result) != PGRES_TUPLES_OK || (num_rows = PQntuples(pg_result)) == 0) { in php_pgsql_meta_data()
4583 PQclear(pg_result); in php_pgsql_meta_data()
4592 add_assoc_long_ex(&elem, "num", sizeof("num") - 1, atoi(PQgetvalue(pg_result, i, 1))); in php_pgsql_meta_data()
4594 add_assoc_string_ex(&elem, "type", sizeof("type") - 1, PQgetvalue(pg_result, i, 2)); in php_pgsql_meta_data()
4596 add_assoc_long_ex(&elem, "len", sizeof("len") - 1, atoi(PQgetvalue(pg_result,i,3))); in php_pgsql_meta_data()
4598 …add_assoc_bool_ex(&elem, "not null", sizeof("not null") - 1, !strcmp(PQgetvalue(pg_result, i, 4), … in php_pgsql_meta_data()
4600 …add_assoc_bool_ex(&elem, "has default", sizeof("has default") - 1, !strcmp(PQgetvalue(pg_result,i,… in php_pgsql_meta_data()
4602 …add_assoc_long_ex(&elem, "array dims", sizeof("array dims") - 1, atoi(PQgetvalue(pg_result, i, 6))… in php_pgsql_meta_data()
4604 …add_assoc_bool_ex(&elem, "is enum", sizeof("is enum") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "e… in php_pgsql_meta_data()
4607 …add_assoc_bool_ex(&elem, "is base", sizeof("is base") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "b… in php_pgsql_meta_data()
4608 …l_ex(&elem, "is composite", sizeof("is composite") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "c")); in php_pgsql_meta_data()
4609 …add_assoc_bool_ex(&elem, "is pseudo", sizeof("is pseudo") - 1, !strcmp(PQgetvalue(pg_result, i, 7)… in php_pgsql_meta_data()
4611 … add_assoc_string_ex(&elem, "description", sizeof("description") - 1, PQgetvalue(pg_result, i, 8)); in php_pgsql_meta_data()
4614 name = PQgetvalue(pg_result,i,0); in php_pgsql_meta_data()
4617 PQclear(pg_result); in php_pgsql_meta_data()
5470 PGresult *pg_result; in do_exec() local
5472 pg_result = PQexec(pg_link, ZSTR_VAL(querystr->s)); in do_exec()
5473 if (PQresultStatus(pg_result) == expect) { in do_exec()
5474 PQclear(pg_result); in do_exec()
5477 php_error_docref(NULL, E_WARNING, "%s", PQresultErrorMessage(pg_result)); in do_exec()
5478 PQclear(pg_result); in do_exec()
5638 PGresult *pg_result; in PHP_FUNCTION() local
5675 pg_result = PQexec(pg_link, ZSTR_VAL(sql)); in PHP_FUNCTION()
5677 PQclear(pg_result); in PHP_FUNCTION()
5679 pg_result = PQexec(pg_link, ZSTR_VAL(sql)); in PHP_FUNCTION()
5683 if (pg_result) { in PHP_FUNCTION()
5684 status = PQresultStatus(pg_result); in PHP_FUNCTION()
5695 PQclear(pg_result); in PHP_FUNCTION()
5700 if (pg_result) { in PHP_FUNCTION()
5704 pg_res->result = pg_result; in PHP_FUNCTION()
5708 PQclear(pg_result); in PHP_FUNCTION()
6000 PHP_PGSQL_API void php_pgsql_result2array(PGresult *pg_result, zval *ret_array, long result_type) in php_pgsql_result2array() argument
6010 pg_numrows = PQntuples(pg_result); in php_pgsql_result2array()
6013 for (i = 0, num_fields = PQnfields(pg_result); i < num_fields; i++) { in php_pgsql_result2array()
6014 field_name = PQfname(pg_result, i); in php_pgsql_result2array()
6015 if (PQgetisnull(pg_result, pg_row, i)) { in php_pgsql_result2array()
6023 char *element = PQgetvalue(pg_result, pg_row, i); in php_pgsql_result2array()
6046 PGresult *pg_result; in php_pgsql_select() local
6082 pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s)); in php_pgsql_select()
6083 if (PQresultStatus(pg_result) == PGRES_TUPLES_OK) { in php_pgsql_select()
6084 php_pgsql_result2array(pg_result, ret_array, result_type); in php_pgsql_select()
6089 PQclear(pg_result); in php_pgsql_select()
6166 PGresult *pg_result; in PHP_FUNCTION() local
6189 pg_result = PQchangePassword(link->conn, ZSTR_VAL(user), ZSTR_VAL(passwd)); in PHP_FUNCTION()
6190 RETVAL_BOOL(PQresultStatus(pg_result) == PGRES_COMMAND_OK); in PHP_FUNCTION()
6191 PQclear(pg_result); in PHP_FUNCTION()