mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 09:24:07 +03:00
Dropped redundant semicolons at the end of internal queries
For consistency with other queries, and probably we give less work to do to the server parser (a ridiculously tiny amount).
This commit is contained in:
parent
5c13dac5ff
commit
0a1bbb56cd
|
@ -416,7 +416,7 @@ pq_begin_locked(connectionObject *conn, PGresult **pgres, char **error,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = pq_execute_command_locked(conn, "BEGIN;", pgres, error, tstate);
|
result = pq_execute_command_locked(conn, "BEGIN", pgres, error, tstate);
|
||||||
if (result == 0)
|
if (result == 0)
|
||||||
conn->status = CONN_STATUS_BEGIN;
|
conn->status = CONN_STATUS_BEGIN;
|
||||||
|
|
||||||
|
@ -616,7 +616,7 @@ pq_get_guc_locked(
|
||||||
|
|
||||||
Dprintf("pq_get_guc_locked: reading %s", param);
|
Dprintf("pq_get_guc_locked: reading %s", param);
|
||||||
|
|
||||||
size = PyOS_snprintf(query, sizeof(query), "SHOW %s;", param);
|
size = PyOS_snprintf(query, sizeof(query), "SHOW %s", param);
|
||||||
if (size >= sizeof(query)) {
|
if (size >= sizeof(query)) {
|
||||||
*error = strdup("SHOW: query too large");
|
*error = strdup("SHOW: query too large");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -674,11 +674,11 @@ pq_set_guc_locked(
|
||||||
|
|
||||||
if (0 == strcmp(value, "default")) {
|
if (0 == strcmp(value, "default")) {
|
||||||
size = PyOS_snprintf(query, sizeof(query),
|
size = PyOS_snprintf(query, sizeof(query),
|
||||||
"SET %s TO DEFAULT;", param);
|
"SET %s TO DEFAULT", param);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
size = PyOS_snprintf(query, sizeof(query),
|
size = PyOS_snprintf(query, sizeof(query),
|
||||||
"SET %s TO '%s';", param, value);
|
"SET %s TO '%s'", param, value);
|
||||||
}
|
}
|
||||||
if (size >= sizeof(query)) {
|
if (size >= sizeof(query)) {
|
||||||
*error = strdup("SET: query too large");
|
*error = strdup("SET: query too large");
|
||||||
|
@ -714,12 +714,12 @@ pq_tpc_command_locked(connectionObject *conn, const char *cmd, const char *tid,
|
||||||
{ goto exit; }
|
{ goto exit; }
|
||||||
|
|
||||||
/* prepare the command to the server */
|
/* prepare the command to the server */
|
||||||
buflen = 3 + strlen(cmd) + strlen(etid); /* add space, semicolon, zero */
|
buflen = 2 + strlen(cmd) + strlen(etid); /* add space, zero */
|
||||||
if (!(buf = PyMem_Malloc(buflen))) {
|
if (!(buf = PyMem_Malloc(buflen))) {
|
||||||
PyErr_NoMemory();
|
PyErr_NoMemory();
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
if (0 > PyOS_snprintf(buf, buflen, "%s %s;", cmd, etid)) { goto exit; }
|
if (0 > PyOS_snprintf(buf, buflen, "%s %s", cmd, etid)) { goto exit; }
|
||||||
|
|
||||||
/* run the command and let it handle the error cases */
|
/* run the command and let it handle the error cases */
|
||||||
*tstate = PyEval_SaveThread();
|
*tstate = PyEval_SaveThread();
|
||||||
|
|
|
@ -663,7 +663,7 @@ xid_recover(PyObject *conn)
|
||||||
|
|
||||||
/* curs.execute(...) */
|
/* curs.execute(...) */
|
||||||
if (!(tmp = PyObject_CallMethod(curs, "execute", "s",
|
if (!(tmp = PyObject_CallMethod(curs, "execute", "s",
|
||||||
"SELECT gid, prepared, owner, database FROM pg_prepared_xacts;")))
|
"SELECT gid, prepared, owner, database FROM pg_prepared_xacts")))
|
||||||
{
|
{
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user