Skip to content

Commit

Permalink
processor_sql: add missing handling of conditionals for unsigned values
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Mar 25, 2024
1 parent f278982 commit ce7b583
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plugins/processor_sql/sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ce7b583

Please sign in to comment.