pike.git/
lib/
modules/
Sql.pmod/
pgsql.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2017-06-27
2017-06-27 10:30:15 by Stephen R. van den Berg <srb@cuci.nl>
66d6ffe9de148d15a4d52e25f23a66d81e98e0f8 (
9
lines) (+
7
/-
2
)
[
Show
|
Annotate
]
Branch:
8.1
pgsql: Short circuit prepared statement-cache race.
1923:
/* * FIXME What happens with regards to this detection when presented with * multistatement text-queries?
+
* The primary function of this detection is to ensure a SYNC
+
* right after a COMMIT, and no SYNC after a BEGIN.
*/ int transtype = .pgsql_util.transendprefix->match(q) ? TRANSEND : .pgsql_util.transbeginprefix->match(q) ? TRANSBEGIN : NOTRANS;
2016:
->add(PGFLUSH) #endif ;
-
} else
-
PD("Using prepared statement for %O\n", q);
+
} else
{ // Use the name from the cache
+
preparedname = tp.preparedname; // to shortcut a potential race
+
PD("Using prepared statement
%s
for %O\n",
preparedname,
q);
+
}
portal._preparedname=preparedname; if(!tp || !tp.datatypeoid) { PD("Describe statement %O\n",preparedname);