The database is inconsistently returning nan instead of NULL. This only appears to happen when selecting more than one row and only if all rows are numeric.
CREATE TABLE test_nan_bug (alpha DOUBLE, beta DOUBLE, str VARCHAR(40));
INSERT INTO test_nan_bug VALUES();
data = system.db.runQuery("""
SELECT alpha FROM test_nan_bug
""")
for row in data:
print list(row)
data = system.db.runQuery("""
SELECT alpha, beta FROM test_nan_bug
""")
for row in data:
print list(row)
data = system.db.runQuery("""
SELECT alpha, beta, str FROM test_nan_bug
""")
for row in data:
print list(row)
[None]
[nan, nan]
[None, None, None]
viewtopic.php?f=70&t=5898&p=15794
According to this thread, this behaviour is deliberate?? Some sort of optimisation?
I have spent over an hour tracking this down and I cannot find any mention of it in the documentation.
Even if this is deliberate behaviour, it seems somewhat inconsistent. Why does it not happen for single-column datasets? Why does mixing it with non-numeric columns deactivate it for all columns?
Some clarification on this issue would be appreciated.
We are using Ignition 7.5.2 (b1146).
Thanks.