This comment exists in mysql.result:
I have been agitating for some kind of null indicator that can be set for a
Variant without destroying its inherent type information. If this were the
case, then the bool array could disappear.
Looking at the code in mysql.comms, when a field is null, it's value is set to null, meaning the type information is gone anyway. Essentially you can replace _nulls[i] with _values[i].type == typeid(typeof(null)) and I think you can remove that array.
I would hold off until the safe update, as the code to do this is MUCH simpler and better performing when we are using MySQLVal instead of Variant (i.e. _values[i].kind == MySQLVal.Kind.Null). I don't want to do it in that PR since there's enough happening.
But I wanted to leave this enhancement in here so I don't forget.
This comment exists in mysql.result:
Looking at the code in
mysql.comms, when a field is null, it's value is set tonull, meaning the type information is gone anyway. Essentially you can replace_nulls[i]with_values[i].type == typeid(typeof(null))and I think you can remove that array.I would hold off until the safe update, as the code to do this is MUCH simpler and better performing when we are using
MySQLValinstead ofVariant(i.e._values[i].kind == MySQLVal.Kind.Null). I don't want to do it in that PR since there's enough happening.But I wanted to leave this enhancement in here so I don't forget.