From 9c85235bea0520fdb9d2e77da60289033916e77e Mon Sep 17 00:00:00 2001 From: vimiix Date: Mon, 26 Jun 2023 11:26:22 +0800 Subject: [PATCH] feat:support parse boolean from characters 0 and 1 --- psycopg/typecast_basic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/psycopg/typecast_basic.c b/psycopg/typecast_basic.c index f73f60b..33c18ff 100644 --- a/psycopg/typecast_basic.c +++ b/psycopg/typecast_basic.c @@ -97,11 +97,13 @@ typecast_BOOLEAN_cast(const char *s, Py_ssize_t len, PyObject *curs) if (s == NULL) { Py_RETURN_NONE; } switch (s[0]) { + case '1': case 't': case 'T': res = Py_True; break; + case '0': case 'f': case 'F': res = Py_False; -- Gitee