mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-10 19:16:34 +03:00
.callproc() patch from Moshe (support for result sets.)
This commit is contained in:
parent
3381b0362b
commit
d189203f9f
|
@ -2,6 +2,7 @@ recursive-include psycopg *.c *.h
|
|||
recursive-include lib *.py
|
||||
recursive-include tests *.py
|
||||
recursive-include ZPsycopgDA *.py *.gif *.dtml
|
||||
recursive-include psycopg2da *
|
||||
recursive-include examples *.py somehackers.jpg whereareyou.jpg
|
||||
recursive-include debian *
|
||||
recursive-include doc TODO HACKING SUCCESS ChangeLog-1.x async.txt
|
||||
|
|
|
@ -896,11 +896,11 @@ psyco_curs_callproc(cursorObject *self, PyObject *args, PyObject *kwargs)
|
|||
}
|
||||
|
||||
/* allocate some memory, build the SQL and create a PyString from it */
|
||||
sl = strlen(procname) + 10 + nparameters*3 - (nparameters ? 1 : 0);
|
||||
sl = strlen(procname) + 17 + nparameters*3 - (nparameters ? 1 : 0);
|
||||
sql = (char*)PyMem_Malloc(sl);
|
||||
if (sql == NULL) return NULL;
|
||||
|
||||
sprintf(sql, "SELECT %s(", procname);
|
||||
sprintf(sql, "SELECT * FROM %s(", procname);
|
||||
for(i=0; i<nparameters; i++) {
|
||||
strcat(sql, "%s,");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user