Commit Graph

1409 Commits

Author SHA1 Message Date
Daniele Varrazzo
96d6260706 Parse the rowcount as long 2014-05-13 14:21:06 +01:00
Daniele Varrazzo
755a5b143f Skip rowcount on copy test on postgres < 8.2
It looks like the server doesn't send the message.
2014-05-13 14:20:56 +01:00
Daniele Varrazzo
e7fc781280 Copy operations correctly set the cursor.rowcount attribute
Fixes ticket #180.
2014-05-13 12:07:21 +01:00
Daniele Varrazzo
a1344f30f3 Fixed explicit connection.cursor(cursor_factory=None)
Fixes issue #210.
2014-04-30 18:05:36 +01:00
Daniele Varrazzo
e1eb7a71b0 Fixed merge errors in the test suite
All the bugfixes from psycopg 2.5 backported on 2.4. I've done this
because I've noticed Ubuntu 14.04 LTS is being released with psycopg
2.4.6: if they don't plan to switch to 2.5.x better have these bugs
fixed.
2014-04-07 18:38:47 +01:00
Daniele Varrazzo
ed968dd913 Merge branch 'connection-closed' into maint_2_4 2014-04-07 18:30:33 +01:00
Daniele Varrazzo
e53f63b2d6 Don't specify 0 or 1 in closed docs
There's also 2 which means broken. But I prefer to leave that as
implementation detail.
2014-04-07 18:30:14 +01:00
Daniele Varrazzo
71eeb9086a Close the connection if discovered bad on poll()
Conflicts:

	NEWS
2014-04-07 18:30:08 +01:00
Daniele Varrazzo
cdb206d3e7 Check the connection is really bad on exception before closing it
We end up here without a pgres sometimes (e.g. from lobject errors)
2014-04-07 18:29:35 +01:00
Daniele Varrazzo
ddf97a0cdc Fixed attempt of closing an already closed lobject on dealloc
This results in a "null without exception set" in the corrent state, which
is caused by the connection being unexpectedly closed anyway.
2014-04-07 18:29:27 +01:00
Daniele Varrazzo
bbe5a2597c Don't set an exception witout GIL closing lobjects with a bad conn
We ended up in this branch only for an excessively aggressive closing
of the transaction that now I'm going to fix.
2014-04-07 18:29:18 +01:00
Daniele Varrazzo
c8ee04a9fa Close a connection if PQexec returned NULL
This happens for Socket connections, not for TCP ones, where a result
containing an error is returned and correctly handled by pq_raise()

Closes ticket #196 but not #192: poll() still doesn't change the
connection closed.

Conflicts:

	NEWS
	psycopg/pqpath.c
2014-04-07 18:29:14 +01:00
Daniele Varrazzo
ae67f353d2 Allow get_transaction_status on closed connections
It's a local operation and the libpq functions has a NULL guard.

Conflicts:

	NEWS
2014-04-07 18:01:30 +01:00
Daniele Varrazzo
7ed593504c Avoid printing the typecast name in debug statement
The way we were doing it is unsafe and causes assertion failures on Py3.

Fixes ticket #188

Conflicts:

	NEWS
2014-04-07 17:58:54 +01:00
Daniele Varrazzo
7faedd0a90 Fixed use of Python object with refcount 0 in cursor_init
Caused segfault running test_cursor.CursorTests.test_invalid_name under
Python 3.4 built in debug mode.

Conflicts:

	NEWS
2014-04-07 17:57:46 +01:00
Daniele Varrazzo
26349bf8d3 Work around pip issue #1630 breaking 'pip -e git+url'
https://github.com/pypa/pip/issues/1630

Fixes ticket #18 (opened in 2010!)

Conflicts:

	NEWS
2014-04-07 17:57:07 +01:00
Daniele Varrazzo
df148f733d Clarify in the docs that mogrify() and query always return bytes 2014-04-07 17:55:34 +01:00
Daniele Varrazzo
06b1db942f Fixed overflow opening a lobject with an oid not fitting in a signed int
Fixes 🎫`203`.

Conflicts:

	NEWS
2014-04-07 17:55:26 +01:00
Daniele Varrazzo
0f6122242c Dropped unneeded pass in test 2014-04-07 17:53:52 +01:00
Daniele Varrazzo
863a89228c Explicit the fact that closed connections have undefined status 2014-04-07 17:53:47 +01:00
Daniele Varrazzo
eddb0e3d90 Fixed dsn and closed attributes in failing connection subclasses.
From ticket #192 discussion.

Conflicts:

	NEWS
	tests/test_connection.py
2014-04-07 17:53:38 +01:00
Erwin de Keijzer
36a7deed52 Fixed DNS typo in examples 2014-04-07 17:52:02 +01:00
Daniele Varrazzo
6b43b0088e Don't segfault on uninitialized cursor
It can happen with bad cursor subclasses not calling super's init. Raise
an exception instead of segfaulting.

Closes #195

Conflicts:

	NEWS
2014-04-07 17:51:53 +01:00
Daniele Varrazzo
d777b73301 Use the do-while 0 idiom for cursor guards macro 2014-04-07 17:49:34 +01:00
Daniele Varrazzo
27949b7d45 Merge branch 'ticket-194' into maint_2_4 2014-04-07 17:49:13 +01:00
Daniele Varrazzo
956560325e Bug #194 confirmed fixed: newsfile updated.
Conflicts:

	NEWS
2014-04-07 17:48:59 +01:00
Daniele Varrazzo
33db3ecfc3 Set the connection async before polling for connection
It should fix ticket #194
2014-04-07 17:48:10 +01:00
Daniele Varrazzo
3a8dec76a0 Set the connection async earlier in green mode
The moment it is called shouldn't have really changed, but it's more
explicit when it happens. Previously it was sort of obfuscated behind a
roundtrip through the green callback and poll.
2014-04-07 17:48:05 +01:00
Daniele Varrazzo
731dc2a3ef Fixed debug build on Windows
Patches on master by James Emerton, from github pull request #8.

Conflicts:

	NEWS
2014-04-07 17:46:58 +01:00
Daniele Varrazzo
dbdd0c822f Fixed dealloc of lobject->smode
I put it by mistake into the in the self->conn checked block in the
previous commit.
2014-04-07 17:43:44 +01:00
Daniele Varrazzo
ff341077e0 Check connection type in lobject init
Fixes ticket #187.

Conflicts:

	NEWS
2014-04-07 17:43:37 +01:00
Daniele Varrazzo
2840643924 Typo fixes and improvements to new_array_type() docs 2014-04-07 17:41:52 +01:00
Daniele Varrazzo
5a55339e11 Really test named cursors in test_scroll_named() 2014-04-07 17:40:32 +01:00
Daniele Varrazzo
970bb1d1b1 Document that named cursors don't raise an exception going out-of-bound
See issue #174 for the details.

Conflicts:

	doc/src/cursor.rst
2014-04-07 17:40:17 +01:00
Daniele Varrazzo
b95bb2c641 Document that using %, (, ) in the placeholder name is not supported 2014-04-07 17:38:26 +01:00
Daniele Varrazzo
fb5e14c701 Meaningful connection errors report a meaningful message
Fixes issue #173.

Conflicts:

	NEWS
2014-04-07 17:38:17 +01:00
Daniele Varrazzo
00c1d867c2 Added regression test for infinity parsing in dates
...and a couple of typos.
2014-04-07 17:30:58 +01:00
Daniele Varrazzo
0914323328 Added test to verify copysize handling in copy_expert
Not an original psycopg2 bug but present in pure python implementation,
e.g. ctypes issue #25 and cffi issue #5.

https://github.com/mvantellingen/psycopg2-ctypes/issues/25
https://github.com/chtd/psycopg2cffi/pull/5
2014-04-07 17:29:50 +01:00
Daniele Varrazzo
d0f49f9887 Skip tests on python implementations without getrefcount()
PyPy is one of these.

Conflicts:

	tests/test_cursor.py
	tests/test_module.py
2014-04-07 17:29:36 +01:00
Daniele Varrazzo
50b68aa987 Merge branch 'solaris-round' into maint_2_4 2014-04-07 17:23:33 +01:00
Daniele Varrazzo
75947a6fef Mention Solaris round fix in NEWS file 2014-04-07 17:19:47 +01:00
Daniele Varrazzo
0973d02b4b Long ifdef reformatted for readibility 2014-04-07 17:16:52 +01:00
Daniel Enman
5eefec4f5e Remove extra || 2014-04-07 17:16:34 +01:00
Daniel Enman
eafcc650c8 Solaris 10+, and illumos distros have round() 2014-04-07 17:16:29 +01:00
Daniele Varrazzo
6ab195d957 The UUID adapter returns bytes instead of str in Python 3
Also added __conform__ method to the adapter.
2014-04-07 17:15:47 +01:00
Daniele Varrazzo
cdbcd8a2e5 Script to test ticket #58 moved into sandbox
We don't need it distributed in the sdist
2014-04-07 17:15:23 +01:00
Piotr Kasprzyk
5a74117118 Fix multiple misspellings
Conflicts:

	NEWS
	doc/src/usage.rst
	psycopg/pqpath.c
	setup.cfg
2013-04-26 10:17:17 +01:00
Daniele Varrazzo
802381358a Fixed broken test decorator preventing 3 tests to run 2013-03-20 17:33:42 +00:00
Daniele Varrazzo
0f8de70e59 Fixed leak of cancel key on connection.reset()
Moving the final free into the destructor is not necessary but looks
appropriate.
2013-03-20 16:49:52 +00:00
Daniele Varrazzo
1cb78f1cc4 Fixed bad interaction of setup.py with other dependencies
The problem is in Distribute dependencies on Python 3. Create a new command
class instead of changing inplace the one other projects may use.

Close ticket #153.
2013-03-20 12:21:36 +00:00