[CONPY-172] None is not converted to NULL Created: 2021-10-15  Updated: 2021-10-18  Resolved: 2021-10-17

Status: Closed
Project: MariaDB Connector/Python
Component/s: Generic
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Jonny Assignee: Georg Richter
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

This is working:

cur.execute("insert into test (foo) values (%s)", [None])

But this not

cur.execute("select * from test where foo is %s", [None])



 Comments   
Comment by Georg Richter [ 2021-10-17 ]

Parameters can be used for an expression, like WHERE column=?. IS NULL and IS NOT NULL are syntactical units but not expressions.

Comment by Jonny [ 2021-10-18 ]

I understand your concerns, but IMHO treating NULL <-> None should be consistent in all places.

There may be reasons why this is possible in psycopg2 and mysql.connector.

Generated at Thu Feb 08 03:30:47 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.