Lines Matching refs:querystr

1718 	smart_str querystr = {0};  in PHP_FUNCTION()  local
1719 smart_str_appends(&querystr, "select relname from pg_class where oid="); in PHP_FUNCTION()
1720 smart_str_append_unsigned(&querystr, oid); in PHP_FUNCTION()
1721 smart_str_0(&querystr); in PHP_FUNCTION()
1723 PGresult *tmp_res = PQexec(pg_result->conn, ZSTR_VAL(querystr.s)); in PHP_FUNCTION()
1724 smart_str_free(&querystr); in PHP_FUNCTION()
4519 smart_str querystr = {0}; in php_pgsql_meta_data() local
4540 smart_str_appends(&querystr, in php_pgsql_meta_data()
4550 smart_str_appends(&querystr, in php_pgsql_meta_data()
4562 smart_str_appendl(&querystr, escaped, new_len); in php_pgsql_meta_data()
4566 smart_str_appends(&querystr, "' AND n.nspname = '"); in php_pgsql_meta_data()
4571 smart_str_appendl(&querystr, escaped, new_len); in php_pgsql_meta_data()
4575 smart_str_appends(&querystr, "' ORDER BY a.attnum;"); in php_pgsql_meta_data()
4576 smart_str_0(&querystr); in php_pgsql_meta_data()
4579 pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s)); in php_pgsql_meta_data()
4582 smart_str_free(&querystr); in php_pgsql_meta_data()
4586 smart_str_free(&querystr); in php_pgsql_meta_data()
5463 static bool do_exec(smart_str *querystr, ExecStatusType expect, PGconn *pg_link, zend_ulong opt) /*… in do_exec() argument
5466 if (PQsendQuery(pg_link, ZSTR_VAL(querystr->s))) { in do_exec()
5472 pg_result = PQexec(pg_link, ZSTR_VAL(querystr->s)); in do_exec()
5486 static inline void build_tablename(smart_str *querystr, PGconn *pg_link, const zend_string *table) … in build_tablename() argument
5493 smart_str_appendl(querystr, ZSTR_VAL(table), len); in build_tablename()
5496 smart_str_appends(querystr, escaped); in build_tablename()
5504 smart_str_appendc(querystr, '.'); in build_tablename()
5505 smart_str_appendl(querystr, after_dot, len); in build_tablename()
5508 smart_str_appendc(querystr, '.'); in build_tablename()
5509 smart_str_appends(querystr, escaped); in build_tablename()
5522 smart_str querystr = {0}; in php_pgsql_insert() local
5532 smart_str_appends(&querystr, "INSERT INTO "); in php_pgsql_insert()
5533 build_tablename(&querystr, pg_link, table); in php_pgsql_insert()
5534 smart_str_appends(&querystr, " DEFAULT VALUES"); in php_pgsql_insert()
5548 smart_str_appends(&querystr, "INSERT INTO "); in php_pgsql_insert()
5549 build_tablename(&querystr, pg_link, table); in php_pgsql_insert()
5550 smart_str_appends(&querystr, " ("); in php_pgsql_insert()
5559 smart_str_appends(&querystr, tmp); in php_pgsql_insert()
5562 smart_str_append(&querystr, fld); in php_pgsql_insert()
5564 smart_str_appendc(&querystr, ','); in php_pgsql_insert()
5566 ZSTR_LEN(querystr.s)--; in php_pgsql_insert()
5567 smart_str_appends(&querystr, ") VALUES ("); in php_pgsql_insert()
5579 smart_str_appendc(&querystr, '\''); in php_pgsql_insert()
5580 smart_str_appendl(&querystr, tmp, new_len); in php_pgsql_insert()
5581 smart_str_appendc(&querystr, '\''); in php_pgsql_insert()
5584 smart_str_append(&querystr, Z_STR_P(val)); in php_pgsql_insert()
5588 smart_str_append_long(&querystr, Z_LVAL_P(val)); in php_pgsql_insert()
5591 smart_str_appendl(&querystr, buf, snprintf(buf, sizeof(buf), "%F", Z_DVAL_P(val))); in php_pgsql_insert()
5594 smart_str_appendl(&querystr, "NULL", sizeof("NULL")-1); in php_pgsql_insert()
5600 smart_str_appendc(&querystr, ','); in php_pgsql_insert()
5603 ZSTR_LEN(querystr.s)--; in php_pgsql_insert()
5604 smart_str_appends(&querystr, ");"); in php_pgsql_insert()
5608 smart_str_0(&querystr); in php_pgsql_insert()
5611 do_exec(&querystr, PGRES_COMMAND_OK, pg_link, (opt & PGSQL_CONV_OPTS))) { in php_pgsql_insert()
5621 *sql = querystr.s; in php_pgsql_insert()
5624 smart_str_free(&querystr); in php_pgsql_insert()
5724 static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr, HashTable *ht, int … in build_assignment_string() argument
5736 smart_str_appends(querystr, tmp); in build_assignment_string()
5739 smart_str_append(querystr, fld); in build_assignment_string()
5743 smart_str_appends(querystr, " IS "); in build_assignment_string()
5745 smart_str_appendc(querystr, '='); in build_assignment_string()
5753 smart_str_appendc(querystr, '\''); in build_assignment_string()
5754 smart_str_appendl(querystr, tmp, new_len); in build_assignment_string()
5755 smart_str_appendc(querystr, '\''); in build_assignment_string()
5758 smart_str_append(querystr, Z_STR_P(val)); in build_assignment_string()
5762 smart_str_append_long(querystr, Z_LVAL_P(val)); in build_assignment_string()
5766 …smart_str_appendl(querystr, buf, MIN(snprintf(buf, sizeof(buf), "%F", Z_DVAL_P(val)), sizeof(buf) … in build_assignment_string()
5770 smart_str_appendl(querystr, "NULL", sizeof("NULL")-1); in build_assignment_string()
5776 smart_str_appendl(querystr, pad, pad_len); in build_assignment_string()
5778 if (querystr->s) { in build_assignment_string()
5779 ZSTR_LEN(querystr->s) -= pad_len; in build_assignment_string()
5790 smart_str querystr = {0}; in php_pgsql_update() local
5819 smart_str_appends(&querystr, "UPDATE "); in php_pgsql_update()
5820 build_tablename(&querystr, pg_link, table); in php_pgsql_update()
5821 smart_str_appends(&querystr, " SET "); in php_pgsql_update()
5823 if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(var_array), 0, ",", 1, opt)) in php_pgsql_update()
5826 smart_str_appends(&querystr, " WHERE "); in php_pgsql_update()
5828 …if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")… in php_pgsql_update()
5831 smart_str_appendc(&querystr, ';'); in php_pgsql_update()
5832 smart_str_0(&querystr); in php_pgsql_update()
5834 if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt)) { in php_pgsql_update()
5844 *sql = querystr.s; in php_pgsql_update()
5847 smart_str_free(&querystr); in php_pgsql_update()
5904 smart_str querystr = {0}; in php_pgsql_delete() local
5925 smart_str_appends(&querystr, "DELETE FROM "); in php_pgsql_delete()
5926 build_tablename(&querystr, pg_link, table); in php_pgsql_delete()
5927 smart_str_appends(&querystr, " WHERE "); in php_pgsql_delete()
5929 …if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")… in php_pgsql_delete()
5932 smart_str_appendc(&querystr, ';'); in php_pgsql_delete()
5933 smart_str_0(&querystr); in php_pgsql_delete()
5935 if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt)) { in php_pgsql_delete()
5944 *sql = querystr.s; in php_pgsql_delete()
5947 smart_str_free(&querystr); in php_pgsql_delete()
6044 smart_str querystr = {0}; in php_pgsql_select() local
6069 smart_str_appends(&querystr, "SELECT * FROM "); in php_pgsql_select()
6070 build_tablename(&querystr, pg_link, table); in php_pgsql_select()
6073 smart_str_appends(&querystr, " WHERE "); in php_pgsql_select()
6074 …if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")… in php_pgsql_select()
6079 smart_str_appendc(&querystr, ';'); in php_pgsql_select()
6080 smart_str_0(&querystr); in php_pgsql_select()
6082 pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s)); in php_pgsql_select()
6087 php_error_docref(NULL, E_NOTICE, "Failed to execute '%s'", ZSTR_VAL(querystr.s)); in php_pgsql_select()
6096 *sql = querystr.s; in php_pgsql_select()
6099 smart_str_free(&querystr); in php_pgsql_select()