The "re-polling" hack to work-around the case in which both: read and write events occured within the same event processing call was being used for any CONNECTION_MADE status, without checking if the write really occured. Based on patch from Yichun Zhang (agentzh). Change-Id: Ia8310a109baf639d1c5c3c766d2298c3610e6d47 Signed-off-by: Piotr Sikora <email@example.com>
Reported by Yichun Zhang (agentzh). Change-Id: I9411e72ccfdbb0d974a92b6cba569dc15254ed3d Signed-off-by: Piotr Sikora <firstname.lastname@example.org>
The issue that hit many (most?) of PostgreSQL adapters is that libpq-8.x is unable to unescape bytea data from results in text format received from PostgreSQL-9.x. But we're always passing bytea data as is to the client (either from results in binary format when using "postgres_output binary_value" or escaped from results in text format), so this isn't problem for us. Patch from Yichun Zhang (agentzh).
Starting with PostgreSQL 9.0, libpq's PQcmdTuples() returns row count for SELECT queries (previously it returned empty string). Because we're using this value to detect number of changed rows, both: "postgres_rewrite" directive and "$postgres_affected" variable were working incorrectly. Reported by Yichun Zhang (agentzh).
…not found at all and returns 500 in this case instead of returning empty response.
… we should have defined rds_rough_col_type_t as a type rather than a global variable. thanks @姜大炮.
This is second part of the "write proper SQL queries" campaign. Queries that return more than one value will result in "500 Internal Server Error" response.
This is more general approach, which forces writing proper SQL queries instead of filtering results on the nginx side and allows for sending output from multiple rows to end-users. Discussed with Silly Sad.
Based on patch from Silly Sad.
Because ngx_http_upstream_finalize_request sends NGX_HTTP_LAST, having last_buf=1 in our module meant that last two chains always had last_buf=1, which resulted in duplicated last chunk sent for HTTP/1.1 requests. This pretty much killed keep-alived requests. Reported by Silly Sad, diagnosed by Maxim Dounin. Same issue was independently diagnosed and fixed in ngx_drizzle by Yichun Zhang (agentzh) few days ago.
…art from most of the ngx_log_error calls in ngx_postgres_keepalive.c because they are duplicate with the << upstream: "postgres://ip.add.re.ss:port" >> part automatically generated by the ngx_http_log_error_handler function in the nginx core.
…d "sockaddr" fields instead of passing pointers around.
…, "sockaddr", and "socklen" fields for the connection from the pool such that we can get more detailed error log messages with the "upstream: postgres://ip.add.re.ss:port" bit.