Lines Matching refs:pg_result

229 static void pgsql_result_free(pgsql_result_handle *pg_result)  in pgsql_result_free()  argument
231 PQclear(pg_result->result); in pgsql_result_free()
232 pg_result->result = NULL; in pgsql_result_free()
237 pgsql_result_handle *pg_result = pgsql_result_from_obj(obj); in pgsql_result_free_obj() local
239 if (pg_result->result) { in pgsql_result_free_obj()
240 pgsql_result_free(pg_result); in pgsql_result_free_obj()
243 zend_object_std_dtor(&pg_result->std); in pgsql_result_free_obj()
544 PGresult *pg_result; in php_pgsql_do_connect() local
598 PGresult *pg_result; in php_pgsql_do_connect() local
600 while ((pg_result = PQgetResult(le->ptr))) { in php_pgsql_do_connect()
601 PQclear(pg_result); in php_pgsql_do_connect()
613 PGresult *pg_result; in php_pgsql_do_connect() local
614 pg_result = PQexec(le->ptr, "select 1"); in php_pgsql_do_connect()
615 PQclear(pg_result); in php_pgsql_do_connect()
633 pg_result = PQexec(pgsql, "RESET ALL;"); in php_pgsql_do_connect()
634 PQclear(pg_result); in php_pgsql_do_connect()
1047 pgsql_result_handle *pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION() local
1048 pg_result->conn = pgsql; in PHP_FUNCTION()
1049 pg_result->result = pgsql_result; in PHP_FUNCTION()
1050 pg_result->row = 0; in PHP_FUNCTION()
1086 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1173 pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION()
1174 pg_result->conn = pgsql; in PHP_FUNCTION()
1175 pg_result->result = pgsql_result; in PHP_FUNCTION()
1176 pg_result->row = 0; in PHP_FUNCTION()
1196 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1256 pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION()
1257 pg_result->conn = pgsql; in PHP_FUNCTION()
1258 pg_result->result = pgsql_result; in PHP_FUNCTION()
1259 pg_result->row = 0; in PHP_FUNCTION()
1282 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1368 pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION()
1369 pg_result->conn = pgsql; in PHP_FUNCTION()
1370 pg_result->result = pgsql_result; in PHP_FUNCTION()
1371 pg_result->row = 0; in PHP_FUNCTION()
1389 pgsql_result_handle *pg_result; in php_pgsql_get_result_info() local
1395 pg_result = Z_PGSQL_RESULT_P(result); in php_pgsql_get_result_info()
1396 CHECK_PGSQL_RESULT(pg_result); in php_pgsql_get_result_info()
1397 pgsql_result = pg_result->result; in php_pgsql_get_result_info()
1538 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1549 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
1550 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
1557 if (fnum >= PQnfields(pg_result->result)) { in PHP_FUNCTION()
1562 Oid oid = PQftable(pg_result->result, (int)fnum); in PHP_FUNCTION()
1582 PGresult *tmp_res = PQexec(pg_result->conn, ZSTR_VAL(querystr.s)); in PHP_FUNCTION()
1616 pgsql_result_handle *pg_result; in php_pgsql_get_field_info() local
1624 pg_result = Z_PGSQL_RESULT_P(result); in php_pgsql_get_field_info()
1625 CHECK_PGSQL_RESULT(pg_result); in php_pgsql_get_field_info()
1632 pgsql_result = pg_result->result; in php_pgsql_get_field_info()
1647 RETURN_STR(get_field_name(pg_result->conn, PQftype(pgsql_result, (int)field))); in php_pgsql_get_field_info()
1694 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1701 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
1702 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
1703 pgsql_result = pg_result->result; in PHP_FUNCTION()
1740 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1768 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
1769 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
1770 pgsql_result = pg_result->result; in PHP_FUNCTION()
1773 if (pg_result->row < 0) { in PHP_FUNCTION()
1774 pg_result->row = 0; in PHP_FUNCTION()
1776 pgsql_row = pg_result->row; in PHP_FUNCTION()
1780 pg_result->row++; in PHP_FUNCTION()
1813 pgsql_result_handle *pg_result; in php_pgsql_fetch_hash() local
1853 pg_result = Z_PGSQL_RESULT_P(result); in php_pgsql_fetch_hash()
1854 CHECK_PGSQL_RESULT(pg_result); in php_pgsql_fetch_hash()
1855 pgsql_result = pg_result->result; in php_pgsql_fetch_hash()
1864 pg_result->row = pgsql_row; in php_pgsql_fetch_hash()
1867 pgsql_row = pg_result->row; in php_pgsql_fetch_hash()
1871 pg_result->row++; in php_pgsql_fetch_hash()
1966 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
1979 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
1980 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
1981 pgsql_result = pg_result->result; in PHP_FUNCTION()
1993 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2004 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2005 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2012 pgsql_result = pg_result->result; in PHP_FUNCTION()
2041 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2048 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2049 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2051 if (row < 0 || row >= PQntuples(pg_result->result)) { in PHP_FUNCTION()
2056 pg_result->row = (int)row; in PHP_FUNCTION()
2072 pgsql_result_handle *pg_result; in php_pgsql_data_info() local
2101 pg_result = Z_PGSQL_RESULT_P(result); in php_pgsql_data_info()
2102 CHECK_PGSQL_RESULT(pg_result); in php_pgsql_data_info()
2103 pgsql_result = pg_result->result; in php_pgsql_data_info()
2106 if (pg_result->row < 0) { in php_pgsql_data_info()
2107 pg_result->row = 0; in php_pgsql_data_info()
2109 pgsql_row = pg_result->row; in php_pgsql_data_info()
2175 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2181 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2182 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2184 pgsql_result_free(pg_result); in PHP_FUNCTION()
2194 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2201 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2202 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2203 pgsql_result = pg_result->result; in PHP_FUNCTION()
2983 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
2989 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
2990 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
2992 RETURN_LONG(PQresultMemorySize(pg_result->result)); in PHP_FUNCTION()
3506 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
3513 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
3514 pgsql_result = pg_result->result; in PHP_FUNCTION()
3530 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
3538 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
3539 pgsql_result = pg_result->result; in PHP_FUNCTION()
4074 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
4091 pg_result = Z_PGSQL_RESULT_P(return_value); in PHP_FUNCTION()
4092 pg_result->conn = pgsql; in PHP_FUNCTION()
4093 pg_result->result = pgsql_result; in PHP_FUNCTION()
4094 pg_result->row = 0; in PHP_FUNCTION()
4105 pgsql_result_handle *pg_result; in PHP_FUNCTION() local
4113 pg_result = Z_PGSQL_RESULT_P(result); in PHP_FUNCTION()
4114 CHECK_PGSQL_RESULT(pg_result); in PHP_FUNCTION()
4115 pgsql_result = pg_result->result; in PHP_FUNCTION()
4351 PGresult *pg_result; in php_pgsql_meta_data() local
4412 pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s)); in php_pgsql_meta_data()
4413 if (PQresultStatus(pg_result) != PGRES_TUPLES_OK || (num_rows = PQntuples(pg_result)) == 0) { in php_pgsql_meta_data()
4416 PQclear(pg_result); in php_pgsql_meta_data()
4425 add_assoc_long_ex(&elem, "num", sizeof("num") - 1, atoi(PQgetvalue(pg_result, i, 1))); in php_pgsql_meta_data()
4427 add_assoc_string_ex(&elem, "type", sizeof("type") - 1, PQgetvalue(pg_result, i, 2)); in php_pgsql_meta_data()
4429 add_assoc_long_ex(&elem, "len", sizeof("len") - 1, atoi(PQgetvalue(pg_result,i,3))); in php_pgsql_meta_data()
4431 …add_assoc_bool_ex(&elem, "not null", sizeof("not null") - 1, !strcmp(PQgetvalue(pg_result, i, 4), … in php_pgsql_meta_data()
4433 …add_assoc_bool_ex(&elem, "has default", sizeof("has default") - 1, !strcmp(PQgetvalue(pg_result,i,… in php_pgsql_meta_data()
4435 …add_assoc_long_ex(&elem, "array dims", sizeof("array dims") - 1, atoi(PQgetvalue(pg_result, i, 6))… in php_pgsql_meta_data()
4437 …add_assoc_bool_ex(&elem, "is enum", sizeof("is enum") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "e… in php_pgsql_meta_data()
4440 …add_assoc_bool_ex(&elem, "is base", sizeof("is base") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "b… in php_pgsql_meta_data()
4441 …l_ex(&elem, "is composite", sizeof("is composite") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "c")); in php_pgsql_meta_data()
4442 …add_assoc_bool_ex(&elem, "is pseudo", sizeof("is pseudo") - 1, !strcmp(PQgetvalue(pg_result, i, 7)… in php_pgsql_meta_data()
4444 … add_assoc_string_ex(&elem, "description", sizeof("description") - 1, PQgetvalue(pg_result, i, 8)); in php_pgsql_meta_data()
4447 name = PQgetvalue(pg_result,i,0); in php_pgsql_meta_data()
4450 PQclear(pg_result); in php_pgsql_meta_data()
5359 PGresult *pg_result; in do_exec() local
5361 pg_result = PQexec(pg_link, ZSTR_VAL(querystr->s)); in do_exec()
5362 if (PQresultStatus(pg_result) == expect) { in do_exec()
5363 PQclear(pg_result); in do_exec()
5366 php_error_docref(NULL, E_WARNING, "%s", PQresultErrorMessage(pg_result)); in do_exec()
5367 PQclear(pg_result); in do_exec()
5527 PGresult *pg_result; in PHP_FUNCTION() local
5564 pg_result = PQexec(pg_link, ZSTR_VAL(sql)); in PHP_FUNCTION()
5566 PQclear(pg_result); in PHP_FUNCTION()
5568 pg_result = PQexec(pg_link, ZSTR_VAL(sql)); in PHP_FUNCTION()
5572 if (pg_result) { in PHP_FUNCTION()
5573 status = PQresultStatus(pg_result); in PHP_FUNCTION()
5584 PQclear(pg_result); in PHP_FUNCTION()
5589 if (pg_result) { in PHP_FUNCTION()
5593 pg_res->result = pg_result; in PHP_FUNCTION()
5597 PQclear(pg_result); in PHP_FUNCTION()
5889 PHP_PGSQL_API void php_pgsql_result2array(PGresult *pg_result, zval *ret_array, long result_type) in php_pgsql_result2array() argument
5899 pg_numrows = PQntuples(pg_result); in php_pgsql_result2array()
5902 for (i = 0, num_fields = PQnfields(pg_result); i < num_fields; i++) { in php_pgsql_result2array()
5903 field_name = PQfname(pg_result, i); in php_pgsql_result2array()
5904 if (PQgetisnull(pg_result, pg_row, i)) { in php_pgsql_result2array()
5912 char *element = PQgetvalue(pg_result, pg_row, i); in php_pgsql_result2array()
5935 PGresult *pg_result; in php_pgsql_select() local
5971 pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s)); in php_pgsql_select()
5972 if (PQresultStatus(pg_result) == PGRES_TUPLES_OK) { in php_pgsql_select()
5973 php_pgsql_result2array(pg_result, ret_array, result_type); in php_pgsql_select()
5978 PQclear(pg_result); in php_pgsql_select()