Skip to content

Commit 144a91f

Browse files
committed
correct checking null value for the inputs when get range
1 parent 2d0bd5b commit 144a91f

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

src/gstype_python.i

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -519,13 +519,8 @@ static bool convertToRowKeyFieldWithType(griddb::Field &field, PyObject* value,
519519
field.type = type;
520520

521521
if (value == Py_None) {
522-
%#if GS_COMPATIBILITY_SUPPORT_3_5
523-
field.type = GS_TYPE_NULL;
524-
return true;
525-
%#else
526522
//Not support NULL
527523
return false;
528-
%#endif
529524
}
530525

531526
int checkConvert = 0;
@@ -1735,8 +1730,16 @@ static bool getRowFields(GSRow* row, int columnCount, GSType* typeList, bool tim
17351730
PyErr_SetString(PyExc_ValueError, "Memory allocation for row is error");
17361731
SWIG_fail;
17371732
}
1738-
PyList_SetItem($result, 0, convertFieldToObject(&($1->value), $1->type, arg1->timestamp_output_with_float));
1739-
PyList_SetItem($result, 1, convertFieldToObject(&($2->value), $1->type, arg1->timestamp_output_with_float));
1733+
if ($1->type != -1) { // -1 for all versions which do not support GS_TYPE_NULL
1734+
PyList_SetItem($result, 0, convertFieldToObject(&($1->value), $1->type, arg1->timestamp_output_with_float));
1735+
} else {
1736+
PyList_SetItem($result, 0, Py_None);
1737+
}
1738+
if ($2->type != -1) { // -1 for all versions which do not support GS_TYPE_NULL
1739+
PyList_SetItem($result, 1, convertFieldToObject(&($2->value), $1->type, arg1->timestamp_output_with_float));
1740+
} else {
1741+
PyList_SetItem($result, 1, Py_None);
1742+
}
17401743
}
17411744

17421745
/**

0 commit comments

Comments
 (0)