Skip to content

Commit

Permalink
chore: fix flaky datetime test
Browse files Browse the repository at this point in the history
  • Loading branch information
TCeason committed Jan 7, 2025
1 parent 99cb6e1 commit 936e80c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -882,11 +882,16 @@ SELECT substr(DATE_ADD(month, 1, now())::String, 11)=substr(now()::String, 11);

# format: 11
query T
SELECT substr(DATE_ADD(month, 1, now())::String, 6, 2) =
CASE
WHEN substr(now()::String, 6, 2) = '12' THEN '01'
ELSE LPAD((substr(now()::String, 6, 2)::int + 1)::String, 2, '0')
END;
SELECT
substr(DATE_ADD(month, 1, now())::String, 6, 2)=
CASE
WHEN substr(now()::String, 6, 2) = '12' THEN '01'
ELSE
IF(length((substr(now()::String, 6, 2)::int + 1)::String) = 1,
LPAD((substr(now()::String, 6, 2)::int + 1)::String, 2, '0'),
(substr(now()::String, 6, 2)::int + 1)::String
)
END;
----
1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,11 +756,16 @@ SELECT substr(DATE_ADD(month, 1, now())::String, 11)=substr(now()::String, 11);

# format: 11
query T
SELECT substr(DATE_ADD(month, 1, now())::String, 6, 2) =
CASE
WHEN substr(now()::String, 6, 2) = '12' THEN '01'
ELSE LPAD((substr(now()::String, 6, 2)::int + 1)::String, 2, '0')
END;
SELECT
substr(DATE_ADD(month, 1, now())::String, 6, 2)=
CASE
WHEN substr(now()::String, 6, 2) = '12' THEN '01'
ELSE
IF(length((substr(now()::String, 6, 2)::int + 1)::String) = 1,
LPAD((substr(now()::String, 6, 2)::int + 1)::String, 2, '0'),
(substr(now()::String, 6, 2)::int + 1)::String
)
END;
----
1

Expand Down

0 comments on commit 936e80c

Please sign in to comment.