I think this is what is confusing python -
MariaDB [tstbtcart]> SELECT max(tstamp) AS tstamp FROM ratedata;
+--------+
| tstamp |
+--------+
| NULL |
+--------+
1 row in set (0.00 sec)
MariaDB [tstbtcart]>
It seems to be interpreting NULL as a result row even in the CLI client. With PDO driver in PHP it does not.
When I ask python to print the row the result is
which is different from NULL and I am guessing it is the driver that does that.
In cases where MySQL returns NULL is there a way in python to detect that opposed to it returning a result?
With SELECT max(foo) it looks like the row count will always be 1 whether or not the result is null (because no records exist) or has a value.