[adapter_list] Deactivate rewriting 'array[NULL]' to '{NULL}'

First proposal towards closing #1507.
This commit is contained in:
Ion Alberdi 2022-10-10 21:10:45 +02:00
parent 87368be205
commit dffebb603d
2 changed files with 3 additions and 1 deletions

View File

@ -47,7 +47,7 @@ list_quote(listObject *self)
/* list consisting of only NULL don't work with the ARRAY[] construct
* so we use the {NULL,...} syntax. The same syntax is also necessary
* to convert array of arrays containing only nulls. */
int all_nulls = 1;
int all_nulls = 0;
Py_ssize_t i, len;

View File

@ -272,6 +272,8 @@ class TypesBasicTests(ConnectingTestCase):
]:
curs.execute("select %s::int[]", (a,))
self.assertEqual(curs.fetchone()[0], a)
curs.execute("select array[%s]::int[]", (a,))
self.assertEqual(curs.fetchone()[0], [a])
def testTypeRoundtripBytes(self):
o1 = bytes(range(256))