summaryrefslogtreecommitdiff
path: root/psycopg/adapter_binary.c
Commit message (Collapse)AuthorAgeFilesLines
* Dropped ifdef guards against obsolete libpq versionsDaniele Varrazzo2016-08-151-2/+0
| | | | | One of them was actually wrong: lobject_type.c wouldn't have compiled pre 8.3 (broken in 6e841a41, 2 years ago).
* Dropped PG_VERSION_HEX constantDaniele Varrazzo2015-06-021-1/+1
| | | | At PostgreSQL 10.0 it would have become awkward.
* Dropped simple type wrapper functionsDaniele Varrazzo2014-08-151-14/+0
| | | | | These functions don't need to exist: exposing the type in the module is enough. It is actually better as one may use isinstance and such.
* Dropped almost-no-op customized objects repr()Daniele Varrazzo2014-08-151-6/+1
| | | | | | | | The default repr is enough: it prints <TypeName at 0xADDR> instead of <TypeName object at 0xADDR>. The only people being hurt by this change are the ones using doctests: they deserve it.
* Name the types after the module they are exposed fromDaniele Varrazzo2014-08-151-2/+2
|
* Use the Py_RETURN_NONE macroDaniele Varrazzo2013-04-051-2/+1
|
* Dropped GC support for several objectsDaniele Varrazzo2013-04-051-13/+2
| | | | | | Non-containers don't need GC. It was half-baked anyway as the tp_clear was often not set. Dropped tp_traverse too for these objects as unused.
* PyType_GenericAlloc is the default allocator: no need to specifyDaniele Varrazzo2013-03-201-1/+1
|
* Dropped "customized" pg_free functionsDaniele Varrazzo2013-03-201-27/+1
| | | | The defaut is already to call PyObject_GC_Del.
* Check if the object wrapped in binary is not None before trying the other typesDaniele Varrazzo2012-03-051-7/+8
| | | | Otherwise it seems we clobber some result with NULL.
* Proper type check in prepare() methods for list, binary, qstringDaniele Varrazzo2012-03-041-6/+4
|
* Make Binary(None) work as expected, adapting to NULLDaniele Varrazzo2011-02-181-0/+6
| | | | Issue reported by Stefano Dal Pra.
* Added adaptation for objects supporting the new-style buffer interfaceDaniele Varrazzo2011-02-161-36/+56
| | | | | | Supporting this interface is required to adapt memoryview on Python 2.7 as they don't support the old style. But because the old style is long deprecated it makes sense to start supporting the new one.
* Adapt bytearray and memoryview to bytes if availableDaniele Varrazzo2011-02-151-1/+4
|
* Fixed error message on Binary(str) in Python 3Daniele Varrazzo2011-02-151-2/+2
|
* Fixed adaptation in several adapters.Daniele Varrazzo2010-12-311-8/+4
| | | | | The getquoted methods always return bytes. The str() convert this representation to string on the fly.
* Redefining the microprotocol on Py3 as returning bytes.Daniele Varrazzo2010-12-311-5/+12
|
* The library can be compiled with Python 3.Daniele Varrazzo2010-12-211-2/+8
| | | | | | | | | Just compiled! No test run yet and many points to review, marked in the code. The patch is largely Martin von Löwis work, simplified after refactoring in the previous commits and adapted to the new code (as the patch was originally for Psycopg 2.0.9)
* Import structmember/stringobject headers from python.h.Daniele Varrazzo2010-12-211-2/+0
| | | | stringobject is not to be imported with Python 3.
* Using PyVarObject_HEAD_INIT macro.Daniele Varrazzo2010-12-211-2/+1
|
* Using Py_TYPE and Py_REFCNT macros.Daniele Varrazzo2010-12-211-4/+4
|
* Changed Python const RO -> READONLY.Daniele Varrazzo2010-12-121-2/+2
|
* Internal imports simplified.Daniele Varrazzo2010-12-121-11/+7
| | | | | | | | | | .c files only need to import psycopg.h: it will in turn import dependencies from Python and libpq and configure.h. psycopg.h should be the first to be imported, so the basic imports are not required in the .h's As a guideline I'm trying to import from the most specific to the most generic to detect missing imports in the .h's.
* Dropped PyArg_ParseTuple() calls in functions taking no arguments.Daniele Varrazzo2010-11-091-2/+1
|
* Replaced PyObject_CallFunction() with *ObjArgs() where more efficient.Daniele Varrazzo2010-11-091-1/+1
|
* Dropped PSYCOPG_OWN_QUOTING.Daniele Varrazzo2010-10-081-77/+0
| | | | | | | | It was deprecated for version 2.1. There are bugs to be fixed made more complex by its presence and it doesn't keep into account PostgreSQL 9.0 new binary format. Time to go!
* Adapt buffer objects using an explicit cast on the string literal.Daniele Varrazzo2010-05-151-2/+2
| | | | | | | | | | | | Don't rely on Postgres casting the literal according to the context: this doesn't work e.g. passing the object as function argument where a function with the same name but taking a text exists. It doesn't work either when the object is in an ARRAY construct. Added test to check the type is respected in a complete Py -> PG -> Py roundtrip without context. Bug and solution reported by Peter Eisentraut.
* Changes license to LGPL3 + OpenSSL exception on all source filesFederico Di Gregorio2010-02-121-12/+16
|
* * psycopg/utils.c (psycopg_escape_string): same here.James Henstridge2009-02-171-3/+1
| | | | | | | | | * psycopg/adapter_binary.c (binary_escape): simplify PostgreSQL version check. * setup.py (psycopg_build_ext.finalize_options): use a single define of the PostgreSQL version in a form that can easily be used by #ifdefs.
* Use Py_CLEAR() in a few more places, and do INCREF's before setting James Henstridge2008-07-211-4/+4
| | | | struct members rather than afterwards.
* * psycopg/adapter_binary.c (binary_traverse): add cyclic GCJames Henstridge2008-07-011-3/+14
| | | | traversal for binary adapters.
* * psycopg/typecast_array.c (typecast_array_scan): set an initialJames Henstridge2008-01-131-3/+3
| | | | | | value for quotes to keep gcc happy. * psycopg/*.c: add missing static modifier on many functions.
* * psycopg/adapter_binary.c (binary_quote): apply Brandon Rhodes'James Henstridge2008-01-101-1/+3
| | | | | | | | | | | patch from ticket #209 to check return value from PyObject_AsCharBuffer(). This fixes the segfault. (binary_quote): switch from PyObject_AsCharBuffer() to PyObject_AsReadBuffer() to support buffer objects that don't implement the bf_getcharbuf protocol. * tests/types_basic.py (TypesBasicTests.testBinary): Test round tripping of bytea buffers. Currently segfaults.
* Use escape string syntax for string escape if connected to a server Daniele Varrazzo2007-11-111-27/+4
| | | | | | | | | | | requiring it. Added a connection flag to store whether E''-style quoting is required: this avoids repeated PQparameterStatus() calls. Added a test case to verify correct behavior on strings, unicode and binary data. Tested with PG versions from 7.4 to 8.3b2, with any server 'standard_conforming_strings' setting and with 'PSYCOPG_OWN_QUOTING' too.
* Fixed selection of the proper binary string quoting.Daniele Varrazzo2007-11-091-18/+22
|
* Use escape string syntax for binary escape if connected with aDaniele Varrazzo2007-11-091-5/+27
| | | | | | | server with ver >= 8.2. The feature is only enabled when compiling psycopg with libpq ver >= 8.0.
* Fixed both Python 2.5 and 64 bit problems.Federico Di Gregorio2007-04-101-37/+43
|
* Piet Delport patches: 2 of 3.Federico Di Gregorio2006-09-231-1/+1
|
* Preparing 2.0.5.2_0_5Federico Di Gregorio2006-09-011-6/+3
|
* Fixed patch from #119.Federico Di Gregorio2006-09-011-5/+9
|
* Empty binary buffer segfault fix (closes: #119).Federico Di Gregorio2006-09-011-2/+5
|
* Fixed segfault in Binary/QString.Federico Di Gregorio2006-06-181-7/+5
|
* #warning fix.Federico Di Gregorio2006-06-111-0/+2
|
* Better PostgreSQL version check.Federico Di Gregorio2006-05-261-5/+7
|
* Final of 8.1.4 securiy patch.Federico Di Gregorio2006-05-241-0/+2
|
* Second half of 8.1.4 securiy patch.Federico Di Gregorio2006-05-241-4/+37
|
* Code cleanup.Federico Di Gregorio2005-10-181-3/+3
|
* Fixing gcc 4 warnings.Federico Di Gregorio2005-07-261-1/+1
|
* Various fixes.Federico Di Gregorio2005-05-091-1/+1
|
* mingw patch from Daniele Varazzo.Federico Di Gregorio2005-04-101-1/+1
|