You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the query DID produce a result, but the value actually received is NULL, then result.isNull will be FALSE, and result.get will produce a Variant which CONTAINS null. Check for this with result.get.type == typeid(typeof(null)).
This turns out to be either false or at least incosistent. My Field type is bigint(20) unsigned NULL. I receive one row with one column and the value is null.
I do
auto value = prep.queryValue();
assert(!value.isNull); // works
assert(value.get.type == typeid(typeof(null))); // fails
After some investigation it turns out the actual type is void.
The reason for that is this line
It turns out, binary is true for my query thus the loop is skipped, thus the setting to null is never done
The text was updated successfully, but these errors were encountered:
Marenz
changed the title
queryValue: result of one row & field NULLcheck inconsistency / errorqueryValue: result of 1 row & field NULL check inconsistency / error
Sep 27, 2017
This is indeed a bug. It appears prepared statements aren't necessary to trigger it, the BIGINT(20) alone appears to be sufficient to trigger. (Actually, even TINYINT does it for me.)
Scratch that, my test was in error (was inserting a 1 instead of NULL). Prepared statement does appear to be needed to trigger the issue (at least in this particular case). TINYINT still triggers it too, though.
The documentation for
queryValue()
says:This turns out to be either false or at least incosistent. My Field type is
bigint(20) unsigned NULL
. I receive one row with one column and the value is null.I do
After some investigation it turns out the actual type is
void
.The reason for that is this line
It turns out,
binary
is true for my query thus the loop is skipped, thus the setting to null is never doneThe text was updated successfully, but these errors were encountered: