[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. |