]> git.ipfire.org Git - thirdparty/psycopg.git/log
thirdparty/psycopg.git
3 years agoAdd Alpine support to `wheel_linux_before_all.sh` script 141/head
Peter Lithammer [Mon, 8 Nov 2021 16:06:22 +0000 (17:06 +0100)] 
Add Alpine support to `wheel_linux_before_all.sh` script

3 years agoUpdate cibuildwheel to v2.2.2
Peter Lithammer [Mon, 8 Nov 2021 14:24:03 +0000 (15:24 +0100)] 
Update cibuildwheel to v2.2.2

The v2.2.x version of cibuildwheel adds supports for building
`musllinux`[^1] wheels. Meaning Alpine users can finally take advantage
of binary installations.

[^1]: https://www.python.org/dev/peps/pep-0656/

3 years agoExpose the C package version in the _cmodule module
Daniele Varrazzo [Mon, 8 Nov 2021 21:28:02 +0000 (22:28 +0100)] 
Expose the C package version in the _cmodule module

"Expose" just to say: this interface remains internal. But it's handy
for development and testing nonetheless.

3 years agoAllow to run typing tests from an arbitrary location
Daniele Varrazzo [Mon, 8 Nov 2021 19:38:47 +0000 (20:38 +0100)] 
Allow to run typing tests from an arbitrary location

3 years agoInclude typing information in psycopg-binary distribution
Daniele Varrazzo [Mon, 8 Nov 2021 19:54:31 +0000 (20:54 +0100)] 
Include typing information in psycopg-binary distribution

3 years agoMerge branch 'wheel-strip' into packaging-love
Daniele Varrazzo [Mon, 8 Nov 2021 20:09:58 +0000 (21:09 +0100)] 
Merge branch 'wheel-strip' into packaging-love

3 years agoMention binary package size reduction in changelog
Daniele Varrazzo [Mon, 8 Nov 2021 20:08:42 +0000 (21:08 +0100)] 
Mention binary package size reduction in changelog

3 years agoInstall the zip command in the cibuildwheel image
Daniele Varrazzo [Mon, 8 Nov 2021 18:33:23 +0000 (19:33 +0100)] 
Install the zip command in the cibuildwheel image

Required to unpack the wheel archive and strip symbols.

3 years agoStrip only psycopg dynamic libraries, not the system ones
Daniele Varrazzo [Mon, 8 Nov 2021 18:14:28 +0000 (19:14 +0100)] 
Strip only psycopg dynamic libraries, not the system ones

Stripping symbols is beneficial (reduction of 30% of the final package, > %90%
of the installed libraries. However just running `auditwheel repair --strip`
breaks some of the libraries included from the system, which fail at import
with errors such as "ELF load command address/offset not properly aligned".

3 years agoStrip debug symbols from wheel packages
Daniele Varrazzo [Mon, 8 Nov 2021 16:55:54 +0000 (17:55 +0100)] 
Strip debug symbols from wheel packages

Close #142

3 years agoBump to next dev release
Daniele Varrazzo [Mon, 8 Nov 2021 18:55:06 +0000 (19:55 +0100)] 
Bump to next dev release

3 years agoAdd Generic Counter and Deque to compat module
Daniele Varrazzo [Mon, 8 Nov 2021 15:00:18 +0000 (16:00 +0100)] 
Add Generic Counter and Deque to compat module

3 years agoSet version number to 3.0.2 3.0.2
Daniele Varrazzo [Mon, 8 Nov 2021 14:03:45 +0000 (15:03 +0100)] 
Set version number to 3.0.2

3 years agoMerge branch 'mypy-tests/scripts'
Daniele Varrazzo [Wed, 3 Nov 2021 15:56:12 +0000 (16:56 +0100)] 
Merge branch 'mypy-tests/scripts'

3 years agoLet mypy check tests/scripts code
Denis Laxalde [Tue, 2 Nov 2021 14:25:23 +0000 (15:25 +0100)] 
Let mypy check tests/scripts code

3 years agoMake spiketest.py script mypy-clean
Denis Laxalde [Tue, 2 Nov 2021 14:19:57 +0000 (15:19 +0100)] 
Make spiketest.py script mypy-clean

- allow untyped defs/calls (as everywhere else in tests/*)
- avoid list comprehension filled with no value
- add a type variable to Connection subclass
- drop useless sys.exit() call, since main() does not return a value

3 years agoAdd a type hint for main() in dectest's scripts
Denis Laxalde [Tue, 2 Nov 2021 14:15:11 +0000 (15:15 +0100)] 
Add a type hint for main() in dectest's scripts

3 years agoAllow Iterable type for cursor.executemany() parameters
Denis Laxalde [Tue, 2 Nov 2021 14:12:43 +0000 (15:12 +0100)] 
Allow Iterable type for cursor.executemany() parameters

An iterable is enough since we only iterate over the parameters value
using a for loop (in _executemany_gen()).

There's an usage with a generator expression in
tests/scripts/dectest.py. (Spotted by running mypy.)

3 years agoMerge branch 'mypy-tests/pool'
Daniele Varrazzo [Wed, 3 Nov 2021 15:55:26 +0000 (16:55 +0100)] 
Merge branch 'mypy-tests/pool'

3 years agoLet mypy check tests/pool code
Denis Laxalde [Tue, 2 Nov 2021 12:11:19 +0000 (13:11 +0100)] 
Let mypy check tests/pool code

3 years agoIgnore mypy errors about cursor.fetchone()
Denis Laxalde [Tue, 2 Nov 2021 13:44:38 +0000 (14:44 +0100)] 
Ignore mypy errors about cursor.fetchone()

fetchone() can return None, so mypy complains that '"None" object is
not iterable' (or not indexable).

3 years agoUse the correct connection class in test_pool_async.py::test_putconn_no_pool()
Denis Laxalde [Tue, 2 Nov 2021 12:41:29 +0000 (13:41 +0100)] 
Use the correct connection class in test_pool_async.py::test_putconn_no_pool()

3 years agoDeclare type variable for Counter in pool tests
Denis Laxalde [Tue, 2 Nov 2021 12:40:59 +0000 (13:40 +0100)] 
Declare type variable for Counter in pool tests

We use the comment-style for type annotation because collections.Counter
is generic only since Python 3.9.

3 years agoDeclare types for dynamically populated lists in pool tests
Denis Laxalde [Tue, 2 Nov 2021 12:40:27 +0000 (13:40 +0100)] 
Declare types for dynamically populated lists in pool tests

3 years agoAdd required type variable to (Async)Connection in pool tests
Denis Laxalde [Tue, 2 Nov 2021 12:39:30 +0000 (13:39 +0100)] 
Add required type variable to (Async)Connection in pool tests

3 years agoAvoid unassigned list comprehensions in pool tests
Denis Laxalde [Tue, 2 Nov 2021 12:34:42 +0000 (13:34 +0100)] 
Avoid unassigned list comprehensions in pool tests

Mypy complains that Thread.start()/join() does not return a value.

3 years agoUse setattr() when monkeypatching in pool tests
Denis Laxalde [Tue, 2 Nov 2021 12:14:12 +0000 (13:14 +0100)] 
Use setattr() when monkeypatching in pool tests

This is to avoid mypy error: Cannot assign to a method.

3 years agoMake tests/pool a Python package
Denis Laxalde [Tue, 2 Nov 2021 12:09:05 +0000 (13:09 +0100)] 
Make tests/pool a Python package

Otherwise, per-module mypy configuration does not apply (and we, e.g.,
get error about "no-untyped-defs").

3 years agoMerge branch 'mypy-tests/dbapi20'
Daniele Varrazzo [Wed, 3 Nov 2021 15:54:50 +0000 (16:54 +0100)] 
Merge branch 'mypy-tests/dbapi20'

3 years agoMake dbapi20 tests mypy-clean
Denis Laxalde [Tue, 2 Nov 2021 10:07:34 +0000 (11:07 +0100)] 
Make dbapi20 tests mypy-clean

3 years agoCatch only expected exception in test_psycopg_dbapi20.py::test_connect_args()
Denis Laxalde [Tue, 2 Nov 2021 10:44:23 +0000 (11:44 +0100)] 
Catch only expected exception in test_psycopg_dbapi20.py::test_connect_args()

3 years agoDrop duplicated test_nextset() method of DatabaseAPI20Test
Denis Laxalde [Tue, 2 Nov 2021 10:05:05 +0000 (11:05 +0100)] 
Drop duplicated test_nextset() method of DatabaseAPI20Test

Spotted by mypy:

  error: Name "test_nextset" already defined on line 742

3 years agoMerge branch 'mypy-tests/test_sql'
Daniele Varrazzo [Wed, 3 Nov 2021 15:54:06 +0000 (16:54 +0100)] 
Merge branch 'mypy-tests/test_sql'

3 years agoLet mypy check tests/test_sql.py
Denis Laxalde [Tue, 2 Nov 2021 10:32:46 +0000 (11:32 +0100)] 
Let mypy check tests/test_sql.py

3 years agoFix type of re.sub() call in sql tests
Denis Laxalde [Tue, 2 Nov 2021 10:30:00 +0000 (11:30 +0100)] 
Fix type of re.sub() call in sql tests

All values of re.sub() must be of the type, here bytes.

3 years agoLet mypy ignore expected type errors in sql tests
Denis Laxalde [Tue, 2 Nov 2021 10:26:14 +0000 (11:26 +0100)] 
Let mypy ignore expected type errors in sql tests

3 years agoWork around a mypy 'Incompatible types in assignment' in sql tests
Denis Laxalde [Tue, 2 Nov 2021 10:24:30 +0000 (11:24 +0100)] 
Work around a mypy 'Incompatible types in assignment' in sql tests

By defining 'obj' as a Composed value, we avoid the mypy error about
variable type change.

3 years agoMerge branch 'mypy-tests/pq'
Daniele Varrazzo [Wed, 3 Nov 2021 15:53:16 +0000 (16:53 +0100)] 
Merge branch 'mypy-tests/pq'

3 years agoLet mypy check tests/pq code
Denis Laxalde [Thu, 28 Oct 2021 09:35:04 +0000 (11:35 +0200)] 
Let mypy check tests/pq code

3 years agoLet mypy ignore an expected type error in pq tests
Denis Laxalde [Tue, 2 Nov 2021 09:26:33 +0000 (10:26 +0100)] 
Let mypy ignore an expected type error in pq tests

3 years agoAdjust test_pgconn::test_info() for mypy
Denis Laxalde [Tue, 2 Nov 2021 09:26:22 +0000 (10:26 +0100)] 
Adjust test_pgconn::test_info() for mypy

Resolves the following error:
  error: Item "None" of "Optional[bytes]" has no attribute "decode"

3 years agoRename a variable in test_conninfo_parse()
Denis Laxalde [Tue, 2 Nov 2021 09:18:06 +0000 (10:18 +0100)] 
Rename a variable in test_conninfo_parse()

To silent a 'incompatible types in assignment' mypy error.

3 years agoRename a variable in tests/pq/test_copy.py
Denis Laxalde [Tue, 2 Nov 2021 09:18:06 +0000 (10:18 +0100)] 
Rename a variable in tests/pq/test_copy.py

To silent a 'incompatible types in assignment' mypy error.

3 years agoAdjust test_pq::test_build_version() for mypy
Denis Laxalde [Tue, 2 Nov 2021 09:07:47 +0000 (10:07 +0100)] 
Adjust test_pq::test_build_version() for mypy

pq.__build_version__ might be None.

3 years agoRename a variable in test_conninfo_parse() to silent a mypy error
Denis Laxalde [Tue, 2 Mar 2021 11:25:10 +0000 (12:25 +0100)] 
Rename a variable in test_conninfo_parse() to silent a mypy error

3 years agoMerge branch 'mypy-tests/types'
Daniele Varrazzo [Wed, 3 Nov 2021 15:52:39 +0000 (16:52 +0100)] 
Merge branch 'mypy-tests/types'

3 years agoLet mypy check tests/types code 132/head
Denis Laxalde [Thu, 28 Oct 2021 09:35:04 +0000 (11:35 +0200)] 
Let mypy check tests/types code

We configure mypy to check untyped defs in tests/ directory, but only
let it check tests/types files at the moment.

3 years agoRename a variable in test_composite.py::test_register_scope()
Denis Laxalde [Thu, 28 Oct 2021 08:42:49 +0000 (10:42 +0200)] 
Rename a variable in test_composite.py::test_register_scope()

To make mypy happy.

3 years agoAdd a couple of "# type: ignore" in datetime tests
Denis Laxalde [Thu, 28 Oct 2021 08:55:21 +0000 (10:55 +0200)] 
Add a couple of "# type: ignore" in datetime tests

Mypy cannot check map() calls on split-strings.

3 years agoRename a variable in test_array.py::test_all_chars()
Denis Laxalde [Thu, 28 Oct 2021 08:42:49 +0000 (10:42 +0200)] 
Rename a variable in test_array.py::test_all_chars()

To make mypy happy.

3 years agoMake test_multirange.py mypy-clean
Denis Laxalde [Thu, 28 Oct 2021 08:24:44 +0000 (10:24 +0200)] 
Make test_multirange.py mypy-clean

Either ignoring errors (often intended) or adding type hints/ignore as
in previous commit.

3 years agoMake test_range.py mypy-clean
Denis Laxalde [Thu, 28 Oct 2021 08:40:28 +0000 (10:40 +0200)] 
Make test_range.py mypy-clean

This consists in adding the type variable to Range type when it makes
sense or to let mypy ignore the 'var-annotated' error for ranges
declared as empty, and where we do not use the underlying value.

In test_in(), we add an extra check to verify that mypy warns about
types incompatibility.

3 years agoIgnore typing errors in test_no_info_error() tests
Denis Laxalde [Thu, 28 Oct 2021 07:59:11 +0000 (09:59 +0200)] 
Ignore typing errors in test_no_info_error() tests

3 years agoPass a dummy oid in test_hstore::test_parse_{ok,bad}
Denis Laxalde [Thu, 28 Oct 2021 07:57:31 +0000 (09:57 +0200)] 
Pass a dummy oid in test_hstore::test_parse_{ok,bad}

HstoreLoader() wants an integer value as first parameter 'oid'. In these
tests, the value does not matter but at least pass the expected type.

3 years agoMake __version__ importable, although not included in __all__ 131/head
Daniele Varrazzo [Thu, 28 Oct 2021 15:33:00 +0000 (17:33 +0200)] 
Make __version__ importable, although not included in __all__

3 years agoMake the mypy fixture available to the whole test suite
Daniele Varrazzo [Thu, 28 Oct 2021 15:30:40 +0000 (17:30 +0200)] 
Make the mypy fixture available to the whole test suite

Also make mypy tests automatically slow.

See #130 for other cases where a mypy fixture would be useful.

3 years agoHarmless refactoring to server-side cursors
Daniele Varrazzo [Sat, 30 Oct 2021 16:30:17 +0000 (18:30 +0200)] 
Harmless refactoring to server-side cursors

It's cool that mypy finds the common base of the two expressions in the
ternary operator.

3 years agoShorten server-side cursor execute() tracebacks
Daniele Varrazzo [Sat, 30 Oct 2021 15:26:54 +0000 (17:26 +0200)] 
Shorten server-side cursor execute() tracebacks

3 years agoMerge remote-tracking branch 'sureshdsk/issue-125'
Daniele Varrazzo [Sat, 30 Oct 2021 15:24:07 +0000 (17:24 +0200)] 
Merge remote-tracking branch 'sureshdsk/issue-125'

3 years agoIgnore .venv dir in any subdir
Daniele Varrazzo [Sat, 30 Oct 2021 15:22:55 +0000 (17:22 +0200)] 
Ignore .venv dir in any subdir

3 years agoadded async server cursor close tests for fetchone, fetchmany, fetchall 126/head
Suresh Kumar [Sat, 30 Oct 2021 15:13:21 +0000 (20:43 +0530)] 
added async server cursor close tests for fetchone, fetchmany, fetchall

3 years agofixed cursor close check + updated news
Suresh Kumar [Sat, 30 Oct 2021 15:08:27 +0000 (20:38 +0530)] 
fixed cursor close check + updated news

3 years agoadded issue-125 fix to news
Suresh Kumar [Sat, 30 Oct 2021 14:39:56 +0000 (20:09 +0530)] 
added issue-125 fix to news

3 years agoFix Sphinx setup version specification
Daniele Varrazzo [Sat, 30 Oct 2021 14:36:57 +0000 (16:36 +0200)] 
Fix Sphinx setup version specification

Also specify other dependencies using the ~= operator.

3 years agoadded async cursor close tests for fetchone, fetchmany, fetchall
Suresh Kumar [Sat, 30 Oct 2021 14:28:27 +0000 (19:58 +0530)] 
added async cursor close tests for fetchone, fetchmany, fetchall

3 years agofixed cursor close check + added tests for fetchone, fetchmany, fetchall
Suresh Kumar [Sat, 30 Oct 2021 14:16:33 +0000 (19:46 +0530)] 
fixed cursor close check + added tests for fetchone, fetchmany, fetchall

3 years agofix: check if cursor is closed
Suresh Kumar [Sat, 23 Oct 2021 14:45:36 +0000 (20:15 +0530)] 
fix: check if cursor is closed

3 years agoFix test range comparison with empty ranges
Daniele Varrazzo [Thu, 28 Oct 2021 23:36:03 +0000 (01:36 +0200)] 
Fix test range comparison with empty ranges

3 years agoMark slow every test taking more than 0.1s to run
Daniele Varrazzo [Thu, 28 Oct 2021 23:08:12 +0000 (01:08 +0200)] 
Mark slow every test taking more than 0.1s to run

3 years agoBetter workaround for bad datetime comparison Python bug
Daniele Varrazzo [Thu, 28 Oct 2021 22:51:11 +0000 (00:51 +0200)] 
Better workaround for bad datetime comparison Python bug

The problem doesn't just happen far away in the future. 2255 is enough.
See https://bugs.python.org/issue45347#msg405284

Compare timestamps by checking if their delta is 0, convert ranges bounds
to utc.

Fun fact: pytest --randomly-seed=293472621 triggers both the multirange
array bug and this.

3 years agoAvoid error in multirange arrays random testing
Daniele Varrazzo [Thu, 28 Oct 2021 22:49:57 +0000 (00:49 +0200)] 
Avoid error in multirange arrays random testing

Don't create arrays with first element empty if dumping in binary. It is
known to not work (see xfail in multirange tests).

3 years agoRetry a brittle test
Daniele Varrazzo [Thu, 28 Oct 2021 21:20:32 +0000 (23:20 +0200)] 
Retry a brittle test

3 years agoMake ServerCursorHelper.format private
Daniele Varrazzo [Thu, 28 Oct 2021 16:11:16 +0000 (18:11 +0200)] 
Make ServerCursorHelper.format private

Reduce duplicate code, remove a race condition (the format set outside
the lock section), make _declare_gen() interface more similar to
_execute_gen().

3 years agorefactor: compose DECLARE in the helper common path
Daniele Varrazzo [Thu, 28 Oct 2021 15:55:37 +0000 (17:55 +0200)] 
refactor: compose DECLARE in the helper common path

...instead of in the separate sync/async branches.

3 years agoClean up imports/exports in psycopg package
Daniele Varrazzo [Thu, 28 Oct 2021 11:34:45 +0000 (13:34 +0200)] 
Clean up imports/exports in psycopg package

Drop file-level F401 ignore and declare explicitly what is exported.

Something reordered to keep together package-level types registration,
to use a somewhat alphabetical order to group of things.

3 years agoRename test file dropping the 3 from psycopg
Daniele Varrazzo [Tue, 26 Oct 2021 15:56:14 +0000 (16:56 +0100)] 
Rename test file dropping the 3 from psycopg

3 years agoRaise a TypeError when slice-setting a Multirange with a non-iterable value
Denis Laxalde [Thu, 28 Oct 2021 08:13:39 +0000 (10:13 +0200)] 
Raise a TypeError when slice-setting a Multirange with a non-iterable value

The type declaration is:

    def __setitem__(index: slice, value: Iterable[Range[T]]) -> None:
        ...

so passing a non-iterable value should not be allowed. However, the
method implementation makes a special-case for non-iterable values with
a slice.

In accordance with MutableSequence behavior, e.g.:

  >>> x = [1, 2, 3]
  >>> x[1:3] = 0
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  TypeError: can only assign an iterable

it seems more correct to raise a TypeError.

3 years agoRe-export DB-API type constructors and singletons
Denis Laxalde [Thu, 28 Oct 2021 09:31:25 +0000 (11:31 +0200)] 
Re-export DB-API type constructors and singletons

Following https://www.python.org/dev/peps/pep-0249/#type-objects-and-constructors

3 years agoFix formatting in news page
Daniele Varrazzo [Tue, 26 Oct 2021 12:16:01 +0000 (13:16 +0100)] 
Fix formatting in news page

3 years agoFix type hint for `Connection.notifies()`
Daniele Varrazzo [Tue, 26 Oct 2021 12:14:59 +0000 (13:14 +0100)] 
Fix type hint for `Connection.notifies()`

Close #128.

3 years agoFix type hint for `sql.SQL.join()`
Daniele Varrazzo [Tue, 26 Oct 2021 12:11:59 +0000 (13:11 +0100)] 
Fix type hint for `sql.SQL.join()`

Close #127.

3 years agoRemove the pgresult structure from the cursor on close
Daniele Varrazzo [Mon, 25 Oct 2021 08:59:09 +0000 (09:59 +0100)] 
Remove the pgresult structure from the cursor on close

This is what the dbapi demands and helps with make the cursor
unavailable after close.

3 years agoBump sphinx to 4.2 to build docs
Daniele Varrazzo [Mon, 25 Oct 2021 10:14:40 +0000 (11:14 +0100)] 
Bump sphinx to 4.2 to build docs

Version 4.1 has problems with Python 3.10

3 years agoInstall shapely requirements to validate docs
Daniele Varrazzo [Mon, 25 Oct 2021 09:15:06 +0000 (10:15 +0100)] 
Install shapely requirements to validate docs

If it works the same change will be applied to the psycopg-website
repos.

Close #123

3 years agoExtend docs about connection context
Daniele Varrazzo [Thu, 21 Oct 2021 11:47:44 +0000 (12:47 +0100)] 
Extend docs about connection context

Highlight the difference from normal connection (implicit rollback vs.
explicit commit) after conversation on the mailing list about the
inconsistency between the operations.

3 years agoFix wrong error message on unknown PostgreSQL encoding
Daniele Varrazzo [Wed, 20 Oct 2021 11:16:42 +0000 (13:16 +0200)] 
Fix wrong error message on unknown PostgreSQL encoding

Reported in #122.

3 years agoBump version number to next dev release
Daniele Varrazzo [Wed, 20 Oct 2021 11:20:07 +0000 (13:20 +0200)] 
Bump version number to next dev release

3 years agoFix var name in transactions doc examples
Ramiro Morales [Sun, 17 Oct 2021 01:04:35 +0000 (22:04 -0300)] 
Fix var name in transactions doc examples

3 years agoHighlight meaningful lines in transaction examples
Daniele Varrazzo [Sat, 16 Oct 2021 10:16:56 +0000 (12:16 +0200)] 
Highlight meaningful lines in transaction examples

3 years agoFix docs wording after Daniel Fortunov's suggestion
Daniele Varrazzo [Sat, 16 Oct 2021 10:04:54 +0000 (12:04 +0200)] 
Fix docs wording after Daniel Fortunov's suggestion

3 years agoTweak "Multiple statements in the same query" docs
Daniel Fortunov [Fri, 15 Oct 2021 21:22:26 +0000 (22:22 +0100)] 
Tweak "Multiple statements in the same query" docs

Minor wording and typographical tweaks in follow-up to 650e215b

3 years agoAdd documentation about multiple statements execution
Daniele Varrazzo [Fri, 15 Oct 2021 11:53:59 +0000 (13:53 +0200)] 
Add documentation about multiple statements execution

Close #109.

3 years agoImprove transactions documentation
Daniele Varrazzo [Fri, 15 Oct 2021 10:47:43 +0000 (12:47 +0200)] 
Improve transactions documentation

close #110

3 years agoBump to version 3.0.1 3.0.1
Daniele Varrazzo [Thu, 14 Oct 2021 09:36:14 +0000 (11:36 +0200)] 
Bump to version 3.0.1

3 years agoMerge branch 'bug-112'
Daniele Varrazzo [Thu, 14 Oct 2021 08:59:35 +0000 (10:59 +0200)] 
Merge branch 'bug-112'

3 years agoMention bug fixed in news file
Daniele Varrazzo [Thu, 14 Oct 2021 00:26:02 +0000 (02:26 +0200)] 
Mention bug fixed in news file

Close #112.

3 years agoDon't use row dumpers to dump a sequence in C implementation either
Daniele Varrazzo [Thu, 14 Oct 2021 00:21:25 +0000 (02:21 +0200)] 
Don't use row dumpers to dump a sequence in C implementation either

As per previous commit, the assumption that different rows will need the
different dumper is easily broken.

Ref. bug #112

3 years agoAdd tests on executemany to check the same problem of bug #112
Daniele Varrazzo [Wed, 13 Oct 2021 23:32:23 +0000 (01:32 +0200)] 
Add tests on executemany to check the same problem of bug #112

3 years agoDon't use row dumpers to dump a sequence
Daniele Varrazzo [Wed, 13 Oct 2021 23:26:09 +0000 (01:26 +0200)] 
Don't use row dumpers to dump a sequence

Using row dumpers uses the assumption that the types will be the same if
we see the same query. It's easy to break this assumption. Being cheeky
is a way (like passing arguments 1, '2' to the same query...) but it's
easy to trigger the problem dumping numbers and going from in2-size to
int4-size.

This commit only fixes the Python implementation.

Ref. bug #112

3 years agoAdd test to reproduce bug #112
Daniele Varrazzo [Wed, 13 Oct 2021 21:41:26 +0000 (23:41 +0200)] 
Add test to reproduce bug #112

Our first bug!