CaselIT opened a new issue, #3585:
URL: https://github.com/apache/arrow-adbc/issues/3585
### What happened?
An empty string is inserted as null in postgresql when it's passed as a
parameter
### Stack Trace
```
Traceback (most recent call last):
File "file.py", line 268, in <module>
assert res == [('',), ('',)], res
^^^^^^^^^^^^^^^^^^^^^
AssertionError: [('',), (None,)]
```
### How can we reproduce the bug?
```py
from adbc_driver_postgresql.dbapi import connect
url = 'postgresql://scott:tiger@localhost/test'
with connect(url) as conn:
with conn.cursor() as cur:
cur.execute('''CREATE TABLE text_table (text_data TEXT)''')
with conn.cursor() as cur:
cur.execute("INSERT INTO text_table VALUES ('')")
cur.execute("INSERT INTO text_table VALUES ($1)", ('',))
with conn.cursor() as cur:
cur.execute("SELECT text_data FROM text_table")
res = cur.fetchall()
print(res)
assert res == [('',), ('',)], res
```
the issue seems to be on the postgresql side, since trying the same code
with sqlite works without errors
```py
from adbc_driver_sqlite.dbapi import connect
with connect() as conn:
with conn.cursor() as cur:
cur.execute('''CREATE TABLE text_table (text_data TEXT)''')
with conn.cursor() as cur:
cur.execute("INSERT INTO text_table VALUES ('')")
cur.execute("INSERT INTO text_table VALUES ($1)", ('',))
with conn.cursor() as cur:
cur.execute("SELECT text_data FROM text_table")
res = cur.fetchall()
print(res)
assert res == [('',), ('',)], res
```
### Environment/Setup
adbc_driver_manager = 1.8.0
adbc_driver_postgresql = 1.8.0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]