From ce7b583e0168e8aeb173f478dd0a9139025cf519 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Mon, 25 Mar 2024 12:07:46 -0600 Subject: [PATCH] processor_sql: add missing handling of conditionals for unsigned values Signed-off-by: Eduardo Silva --- plugins/processor_sql/sql.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/processor_sql/sql.c b/plugins/processor_sql/sql.c index c9859d0e90d..eb8ec89640c 100644 --- a/plugins/processor_sql/sql.c +++ b/plugins/processor_sql/sql.c @@ -433,6 +433,16 @@ static int sql_key_to_value(char *name, struct flb_mp_chunk_record *record, stru val->type = SQL_EXP_INT; val->val.i64 = kvpair->val->data.as_int64; } + else if (var->type == CFL_VARIANT_UINT) { + /* + * Note on uint64 handling: our parsing rules in sql-parser.l handles the strings + * that represents integers through an atol() conversion. If we get a case of a + * long unsigned value, we can adjust it here by extending the sql_val union. + * + */ + val->type = SQL_EXP_INT; + val->val.i64 = kvpair->val->data.as_uint64; + } else if (var->type == CFL_VARIANT_DOUBLE) { val->type = SQL_EXP_FLOAT; val->val.f64 = kvpair->val->data.as_double;