Skip to content

Commit

Permalink
Merge pull request #58597 from rschu1ze/makedatetime64-nonconst-fraction
Browse files Browse the repository at this point in the history
`makeDateTime64()`: Allow non-const fraction argument
  • Loading branch information
Avogar committed Jan 9, 2024
2 parents 21e4e05 + f3c77c0 commit 22a0e08
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Functions/makeDate.cpp
Expand Up @@ -434,7 +434,7 @@ class FunctionMakeDateTime64 : public FunctionMakeDateTimeBase
};

FunctionArgumentDescriptors optional_args{
{optional_argument_names[0], &isNumber<IDataType>, isColumnConst, "const Number"},
{optional_argument_names[0], &isNumber<IDataType>, nullptr, "const Number"},
{optional_argument_names[1], &isNumber<IDataType>, isColumnConst, "const Number"},
{optional_argument_names[2], &isString<IDataType>, isColumnConst, "const String"}
};
Expand Down
1 change: 1 addition & 0 deletions tests/queries/0_stateless/02245_make_datetime64.reference
Expand Up @@ -67,3 +67,4 @@ DateTime64(7, \'UTC\')
1900-01-01 00:00:00.000
1900-01-01 00:00:00.000
1900-01-01 00:00:00.000
2024-01-08 11:12:13.014
3 changes: 3 additions & 0 deletions tests/queries/0_stateless/02245_make_datetime64.sql
Expand Up @@ -82,6 +82,9 @@ select makeDateTime64(1991, 8, 24, 65537, 4, 0);
select makeDateTime64(1991, 8, 24, 21, 65537, 0);
select makeDateTime64(1991, 8, 24, 21, 4, 65537);

-- bug 58590
select makeDateTime64(2024, 1, 8, 11, 12, 13, materialize(14));

select makeDateTime64(year, 1, 1, 1, 0, 0, 0, precision, timezone) from (
select 1984 as year, 5 as precision, 'UTC' as timezone
union all
Expand Down

0 comments on commit 22a0e08

Please sign in to comment.