-
Notifications
You must be signed in to change notification settings - Fork 146
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Assuming impl<T: Primitive> Primitive for Option<T> {} which does not exist as-of writing:
let result = client
.query("SELECT {val1: Nullable(String)} AS result")
.param("val1", Option::<String>::None)
.fetch_one::<Option<String>>()
.await
.expect("failed to fetch string");
assert_eq!(result, None);This will actually return the literal string "NULL" instead of None.
This is because ParamSerializer emits a literal string NULL for None:
Line 428 in 5fddaaa
| self.writer.write_str("NULL")?; |
However, the proper literal for NULL in query parameters is \N (which is not a valid string escape so it cannot be misinterpreted): ClickHouse/ClickHouse#29665 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working