index ffddf979f5509593417c80d6b3358b0b75e27a34..514c4d524ce2dd04dc463ff6b7e51254dede129f 100644 (file)
--- a/src/include/core/data.h
+++ b/src/include/core/data.h
#endif
enum {
- SDB_TYPE_INTEGER = 1,
+ SDB_TYPE_NULL = 0,
+ SDB_TYPE_INTEGER,
SDB_TYPE_DECIMAL,
SDB_TYPE_STRING,
SDB_TYPE_DATETIME,
} re; /* SDB_TYPE_REGEX */
} data;
} sdb_data_t;
-#define SDB_DATA_INIT { 0, { .integer = 0 } }
+#define SDB_DATA_INIT { SDB_TYPE_NULL, { .integer = 0 } }
+
+extern const sdb_data_t SDB_DATA_NULL;
/*
* sdb_data_copy:
/*
* sdb_data_isnull:
* Determine whether a datum is NULL. A datum is considered to be NULL if
- * either datum is NULL or if the string or binary datum is NULL.
+ * either datum is NULL or if the type is SDB_TYPE_NULL or if the string or
+ * binary datum is NULL.
*/
_Bool
sdb_data_isnull(const sdb_data_t *datum);
* support the other operators. The result may be allocated dynamically and
* has to be freed by the caller (using sdb_data_free_datum).
*
+ * If any of the data points is a NULL value, the result is also NULL.
+ *
* The data-types of d1 and d2 have to be the same, except for the following
* cases:
* - <integer> or <decimal> <mul> <datetime>