pike.git
/
lib
/
modules
/
Sql.pmod
/
pgsql_util.pmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:650:
if(sizeof(dtoid)!=sizeof(paramValues)) SUSERERROR("Invalid number of bindings, expected %d, got %d\n", sizeof(dtoid),sizeof(paramValues)); #ifdef PG_DEBUGMORE PD("ParamValues to bind: %O\n",paramValues); #endif Stdio.Buffer plugbuffer=Stdio.Buffer(); plugbuffer->add(_portalname= (_unnamedportalkey=pgsqlsess._unnamedportalmux->trylock(1)) ? "" : PORTALPREFIX+int2hex(pgsqlsess._pportalcount++) )->add_int8(0)
-
->add(_preparedname)->add_int8(0)->add_int16(sizeof(
paramValues
));
+
->add(_preparedname)->add_int8(0)->add_int16(sizeof(
dtoid
));
foreach(dtoid;;int textbin) plugbuffer->add_int16(oidformat(textbin));
-
plugbuffer->add_int16(sizeof(
paramValues
));
+
plugbuffer->add_int16(sizeof(
dtoid
));
string cenc=pgsqlsess._runtimeparameter[CLIENT_ENCODING]; foreach(paramValues;int i;mixed value) { if(undefinedp(value) || objectp(value)&&value->is_val_null) plugbuffer->add_int32(-1); // NULL else if(stringp(value) && !sizeof(value)) { int k=0; switch(dtoid[i]) { default: k=-1; // cast empty strings to NULL for non-string types case BYTEAOID:
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:821:
pgsqlsess->_waittocommit--; } lock=0; } PD("Bind portal %O statement %O\n",_portalname,_preparedname); _fetchlimit=pgsqlsess->_fetchlimit; _openportal(); conxion bindbuffer=c->start(1); _unnamedstatementkey=0; bindbuffer->add_int8('B')->add_hstring(plugbuffer,4,4);
-
if(!_tprepared)
+
if(!_tprepared
&& sizeof(_preparedname
)
)
closestatement(bindbuffer,_preparedname); _sendexecute(pgsqlsess->_fetchlimit && !(cachealways[_query] || sizeof(_query)>=MINPREPARELENGTH && execfetchlimit->match(_query)) && FETCHLIMITLONGRUN,bindbuffer); } } final void _openportal() {