mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-07-30 09:59:53 +03:00
[adapter_list] Deactivate rewriting 'array[NULL]' to '{NULL}'
First proposal towards closing #1507.
This commit is contained in:
parent
87368be205
commit
dffebb603d
|
@ -47,7 +47,7 @@ list_quote(listObject *self)
|
||||||
/* list consisting of only NULL don't work with the ARRAY[] construct
|
/* list consisting of only NULL don't work with the ARRAY[] construct
|
||||||
* so we use the {NULL,...} syntax. The same syntax is also necessary
|
* so we use the {NULL,...} syntax. The same syntax is also necessary
|
||||||
* to convert array of arrays containing only nulls. */
|
* to convert array of arrays containing only nulls. */
|
||||||
int all_nulls = 1;
|
int all_nulls = 0;
|
||||||
|
|
||||||
Py_ssize_t i, len;
|
Py_ssize_t i, len;
|
||||||
|
|
||||||
|
|
|
@ -272,6 +272,8 @@ class TypesBasicTests(ConnectingTestCase):
|
||||||
]:
|
]:
|
||||||
curs.execute("select %s::int[]", (a,))
|
curs.execute("select %s::int[]", (a,))
|
||||||
self.assertEqual(curs.fetchone()[0], a)
|
self.assertEqual(curs.fetchone()[0], a)
|
||||||
|
curs.execute("select array[%s]::int[]", (a,))
|
||||||
|
self.assertEqual(curs.fetchone()[0], [a])
|
||||||
|
|
||||||
def testTypeRoundtripBytes(self):
|
def testTypeRoundtripBytes(self):
|
||||||
o1 = bytes(range(256))
|
o1 = bytes(range(256))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user