summaryrefslogtreecommitdiff
path: root/execute.c
diff options
context:
space:
mode:
authorHeikki Linnakangas2014-10-29 14:35:05 +0000
committerHeikki Linnakangas2014-10-29 16:19:27 +0000
commit341a6fccd8a5b2bcdacabb1e58c6620d518ccd09 (patch)
treec6947b88023505409ffc3f4a7e8eeee3df4a89e2 /execute.c
parent6e6229e67d92823317dd5a3dd7d46d79b1e25460 (diff)
Remove support for protocol versions older than 3.
PostgreSQL added support for protocol version 3 in server version 7.4. There's no need to support servers older than that. This simplifies the code a lot, removing a lot of corner cases that haven't been properly regression tested for a long time anyway. Original patch by me, with some tweaks by Michael Paquier.
Diffstat (limited to 'execute.c')
-rw-r--r--execute.c54
1 files changed, 10 insertions, 44 deletions
diff --git a/execute.c b/execute.c
index cad32ea..65aa729 100644
--- a/execute.c
+++ b/execute.c
@@ -207,8 +207,7 @@ inquireHowToPrepare(const StatementClass *stmt)
conn = SC_get_conn(stmt);
ci = &(conn->connInfo);
- if (!ci->use_server_side_prepare ||
- PG_VERSION_LT(conn, 7.3))
+ if (!ci->use_server_side_prepare)
{
/* Do prepare operations by the driver itself */
return PREPARE_BY_THE_DRIVER;
@@ -224,9 +223,15 @@ inquireHowToPrepare(const StatementClass *stmt)
}
if (stmt->multi_statement < 0)
PGAPI_NumParams((StatementClass *) stmt, &num_params);
- if (stmt->multi_statement > 0) /* would divide the query into multiple commands and apply V3 parse requests for each of them */
- ret = PROTOCOL_74(ci) ? PARSE_REQ_FOR_INFO : PREPARE_BY_THE_DRIVER;
- else if (PROTOCOL_74(ci))
+ if (stmt->multi_statement > 0)
+ {
+ /*
+ * divide the query into multiple commands and apply V3 parse
+ * requests for each of them
+ */
+ ret = PARSE_REQ_FOR_INFO;
+ }
+ else
{
if (SC_may_use_cursor(stmt))
{
@@ -240,17 +245,6 @@ inquireHowToPrepare(const StatementClass *stmt)
else
ret = PARSE_TO_EXEC_ONCE;
}
- else
- {
- if (SC_may_use_cursor(stmt) &&
- (SQL_CURSOR_FORWARD_ONLY != stmt->options.cursor_type ||
- ci->drivers.use_declarefetch))
- ret = PREPARE_BY_THE_DRIVER;
- else if (SC_is_prepare_statement(stmt))
- ret = USING_PREPARE_COMMAND;
- else
- ret = PREPARE_BY_THE_DRIVER;
- }
}
if (SC_is_prepare_statement(stmt) && (PARSE_TO_EXEC_ONCE == ret))
ret = NAMED_PARSE_REQUEST;
@@ -314,8 +308,6 @@ int HowToPrepareBeforeExec(StatementClass *stmt, BOOL checkOnly)
{
switch (how_to_prepare)
{
- case USING_PREPARE_COMMAND:
- return checkOnly ? doNothing : usingCommand;
case NAMED_PARSE_REQUEST:
return shouldParse;
case PARSE_TO_EXEC_ONCE:
@@ -335,9 +327,6 @@ int HowToPrepareBeforeExec(StatementClass *stmt, BOOL checkOnly)
return doNothing;
}
}
- if (PG_VERSION_LE(conn, 7.3) ||
- !PROTOCOL_74(ci))
- return nCallParse;
if (num_params > 0)
{
@@ -532,29 +521,6 @@ mylog("about to begin SC_execute\n");
res = kres;
}
}
-#ifdef NOT_USED
- else if (SC_is_concat_prepare_exec(stmt))
- {
- if (res && QR_command_maybe_successful(res))
- {
- QResultClass *kres;
-
- kres = res->next;
-inolog("res->next=%p\n", kres);
- res->next = NULL;
- SC_set_Result(stmt, kres);
- res = kres;
- SC_set_prepared(stmt, PREPARED_PERMANENTLY);
- }
- else
- {
- retval = SQL_ERROR;
- if (stmt->execute_statement)
- free(stmt->execute_statement);
- stmt->execute_statement = NULL;
- }
- }
-#endif /* NOT_USED */
#if (ODBCVER >= 0x0300)
ipdopts = SC_get_IPDF(stmt);
if (ipdopts->param_status_ptr)