Skip to content

Commit

Permalink
a fix for the use-case of not-operator on a string (#153)
Browse files Browse the repository at this point in the history
Signed-off-by: Gal Salomon <[email protected]>
  • Loading branch information
galsalomon66 authored Mar 26, 2024
1 parent 9a28798 commit 2a050da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/s3select_oper.h
Original file line number Diff line number Diff line change
Expand Up @@ -2260,6 +2260,10 @@ class negate_function_operation : public base_statement
res = (bool)1;
}
}
else if(res.is_string())
{
res = (bool)false;
}

return res;
}
Expand Down
1 change: 1 addition & 0 deletions test/s3select_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1726,6 +1726,7 @@ TEST(TestS3selectFunctions, truefalse)
test_single_column_single_row("select (not 1 > 2) as a1,cast(a1 as int)*4 from s3object;","true,4\n");
test_single_column_single_row("select (1 > 2) from s3object;","false\n");
test_single_column_single_row("select case when (nullif(3,3) is null) = true then \"case-1-1\" else \"case-2-2\" end, case when (\"a\" in (\"a\",\"b\")) = true then \"case-3-3\" else \"case-4-4\" end, case when 1>3 then \"case_5_5\" else \"case-6-6\" end from s3object where (3*3 = 9);","case-1-1,case-3-3,case-6-6\n");
test_single_column_single_row("select (not 'any_string') from s3object;","false\n");
}

TEST(TestS3selectFunctions, boolcast)
Expand Down

0 comments on commit 2a050da

Please sign in to comment.