mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-07 12:50:32 +03:00
Patchset copy_expert 1/5.
This commit is contained in:
parent
a779c8ef99
commit
a23de80c6b
|
@ -1,3 +1,7 @@
|
|||
2007-05-29 Federico Di Gregorio <fog@initd.org>
|
||||
|
||||
* Applied whitespace normalization patch from David Rushby (copy_expert set.)
|
||||
|
||||
2007-04-25 Federico Di Gregorio <fog@initd.org>
|
||||
|
||||
* psycopg/connection_type.c: added support for a new method
|
||||
|
|
4
NEWS
4
NEWS
|
@ -17,6 +17,10 @@ What's new in psycopg 2.0.6
|
|||
|
||||
* copy_to and copy_from now take an extra "columns" parameter.
|
||||
|
||||
* Python tuples are now adapted to SQL sequences that can be used with
|
||||
the "IN" operator by default if the psycopg2.extensions module is
|
||||
imported (i.e., the SQL_IN adapter was moved from extras to extensions.)
|
||||
|
||||
* Fixed some small buglets and build glitches:
|
||||
- removed double mutex destroy
|
||||
- removed all non-constant initializers
|
||||
|
|
|
@ -100,8 +100,8 @@ _mogrify(PyObject *var, PyObject *fmt, connectionObject *conn, PyObject **new)
|
|||
4/ ...and add it to the new dictionary to be used as argument
|
||||
*/
|
||||
else if (c[0] == '%' && c[1] == '(') {
|
||||
|
||||
/* check if some crazy guy mixed formats */
|
||||
|
||||
/* check if some crazy guy mixed formats */
|
||||
if (kind == 2) {
|
||||
Py_XDECREF(n);
|
||||
psyco_set_error(ProgrammingError, (PyObject*)conn,
|
||||
|
@ -1090,7 +1090,7 @@ static int _psyco_curs_copy_columns(PyObject *columns, char *columnlist)
|
|||
|
||||
coliter = PyObject_GetIter(columns);
|
||||
if (coliter == NULL) return 0;
|
||||
|
||||
|
||||
columnlist[0] = '(';
|
||||
|
||||
while ((col = PyIter_Next(coliter)) != NULL) {
|
||||
|
@ -1174,7 +1174,7 @@ psyco_curs_copy_from(cursorObject *self, PyObject *args, PyObject *kwargs)
|
|||
EXC_IF_CURS_CLOSED(self);
|
||||
|
||||
if (null) {
|
||||
PyOS_snprintf(query, DEFAULT_COPYBUFF-1,
|
||||
PyOS_snprintf(query, DEFAULT_COPYBUFF-1,
|
||||
"COPY %s%s FROM stdin USING DELIMITERS '%s'"
|
||||
" WITH NULL AS '%s'", table_name, columnlist, sep, null);
|
||||
}
|
||||
|
@ -1234,7 +1234,7 @@ psyco_curs_copy_to(cursorObject *self, PyObject *args, PyObject *kwargs)
|
|||
&table_name, &sep, &null, &columns)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
if (_psyco_curs_copy_columns(columns, columnlist) == -1)
|
||||
return NULL;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user