Skip to content

Commit 17c249b

Browse files
authored
Fix intDiv
Essential fix based on [thread suggestion](duckdb/community-extensions#43 (review))
1 parent f069686 commit 17c249b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/chsql_extension.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static DefaultMacro chsql_macros[] = {
6868
{DEFAULT_SCHEMA, "toFloatOrNull", {"x", nullptr}, R"(TRY_CAST(x AS DOUBLE))"},
6969
{DEFAULT_SCHEMA, "toFloatOrZero", {"x", nullptr}, R"(CASE WHEN TRY_CAST(x AS DOUBLE) IS NOT NULL THEN CAST(x AS DOUBLE) ELSE 0 END)"},
7070
// -- Arithmetic macros
71-
{DEFAULT_SCHEMA, "intDiv", {"a", "b"}, R"((CAST(a AS BIGINT) / CAST(b AS BIGINT)))"},
71+
{DEFAULT_SCHEMA, "intDiv", {"a", "b"}, R"((CAST(a AS BIGINT) // CAST(b AS BIGINT)))"},
7272
// -- String matching macros
7373
{DEFAULT_SCHEMA, "match", {"string", "token"}, R"(string LIKE token)"},
7474
// -- Array macros

0 commit comments

Comments
 (0)