mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 09:24:07 +03:00
Don't segfault on empty queries anymore (closes: #24).
This commit is contained in:
parent
7ead773fc0
commit
7d2109f979
|
@ -1,3 +1,10 @@
|
|||
2005-06-13 Federico Di Gregorio <fog@initd.org>
|
||||
|
||||
* psycopg/cursor_type.c (_psyco_curs_execute): now checks for empty queries
|
||||
and raise a ProgrammingError if appropriate (closes: #24).
|
||||
|
||||
* setup.py: psycopg module renamed to psycopg2.
|
||||
|
||||
2005-06-02 Federico Di Gregorio <fog@debian.org>
|
||||
|
||||
* psycopg/cursor_type.c (_psyco_curs_execute): fixed segfault when
|
||||
|
|
|
@ -237,6 +237,11 @@ _psyco_curs_execute(cursorObject *self,
|
|||
}
|
||||
pthread_mutex_unlock(&(self->conn->lock));
|
||||
|
||||
if (!PyObject_IsTrue(operation)) {
|
||||
PyErr_SetString(ProgrammingError, "can't execute an empty query");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (PyUnicode_Check(operation)) {
|
||||
PyObject *enc = PyDict_GetItemString(psycoEncodings,
|
||||
self->conn->encoding);
|
||||
|
|
12
setup.py
12
setup.py
|
@ -318,26 +318,26 @@ if sys.platform == 'win32' and int(parser.get('build_ext', 'use_pg_dll')):
|
|||
|
||||
sources = map(lambda x: os.path.join('psycopg', x), sources)
|
||||
|
||||
ext.append(Extension("psycopg._psycopg", sources,
|
||||
ext.append(Extension("psycopg2._psycopg", sources,
|
||||
define_macros=define_macros,
|
||||
include_dirs=include_dirs,
|
||||
undef_macros=[]))
|
||||
|
||||
setup(name="psycopg",
|
||||
setup(name="psycopg2",
|
||||
version=PSYCOPG_VERSION,
|
||||
maintainer="Federico Di Gregorio",
|
||||
maintainer_email="fog@initd.org",
|
||||
author="Federico Di Gregorio",
|
||||
author_email="fog@initd.org",
|
||||
url="http://initd.org/software/initd/psycopg",
|
||||
download_url = "http://initd.org/software/initd/psycopg",
|
||||
url="http://initd.org/software/initd/psycopg2",
|
||||
download_url = "http://initd.org/software/initd/psycopg2",
|
||||
license="GPL or ZPL",
|
||||
platforms = ["any"],
|
||||
description=__doc__.split("\n")[0],
|
||||
long_description="\n".join(__doc__.split("\n")[2:]),
|
||||
classifiers=filter(None, classifiers.split("\n")),
|
||||
data_files=data_files,
|
||||
package_dir={'psycopg':'lib'},
|
||||
packages=['psycopg'],
|
||||
package_dir={'psycopg2':'lib'},
|
||||
packages=['psycopg2'],
|
||||
cmdclass={ 'build_ext': psycopg_build_ext },
|
||||
ext_modules=ext)
|
||||
|
|
Loading…
Reference in New Issue
Block a user