Skip to content

fix(filter)!: keep a short fraction of a quoted time - #166

Open
pdevito3 wants to merge 1 commit into
mainfrom
fm/qk-breaking-short-time-fraction
Open

pdevito3 wants to merge 1 commit into
mainfrom
fm/qk-breaking-short-time-fraction

Conversation

@pdevito3

@pdevito3 pdevito3 commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

For later consideration in a major version. Do not merge now. This PR is one of two PRs that replace #144. Each PR has one breaking change. The captain decides on each PR separately.

#134 restored the v1.14.2 rule (restore commit b49ad2b). This PR re-applies this part of 5c84ef6.

What breaks

A quoted time with a fraction of 1 or 2 digits keeps the fraction. On v1.14.2 and main, a quoted time uses the milliseconds only when the fraction has 3 or more digits, and the microseconds only when it has 6 or more. An unquoted time already keeps every digit on main.

Example

Input v1.14.2 and main This PR
Time == "08:30:00.5" matches 08:30:00 matches 08:30:00.500
Time == "08:30:00.50" matches 08:30:00 matches 08:30:00.500
Time == "08:30:00.500" matches 08:30:00.500 matches 08:30:00.500 (no change)

Justification

.5 is half a second. A filter that drops it gives wrong rows without an error. A quoted time and an unquoted time now give the same value.

Migration

If you wrote a short fraction and expected the whole second, remove the fraction.

Code

The rightIsQuotedLiteral argument of CreateRightExpr and CreateRightExprFromType is removed. The time conversion was its only user.

README

The date and time format list says that a time fraction keeps every digit.

Tests

  • Unit FilterParsingRegressionTests.fractional_seconds_are_kept: the cases Time == "08:30:00.5" and Time == "08:30:00.50" expect the fraction again.
  • Unit quoted_time_with_fewer_than_three_fraction_digits_drops_the_fraction is removed. It held the v1.14.2 behavior.
  • Integration FilterParsingRegressionTests.fractional_second_value_matches_by_its_fraction: a quoted .5 matches the fraction row on Postgres.
  • dotnet test on this branch: 470 unit tests and 297 Postgres integration tests (Testcontainers) pass, 0 failures.

Rebase on main

This branch is rebased on current main. Main #169 added a call to CreateRightExprFromType in the conversion path. This PR removes the rightIsQuotedLiteral argument from that call too. The IsQuotedLiteral flag stays in the parse result, because the property path check on the right side uses it.

A quoted time dropped a fraction with fewer than 3 digits, so Time == "08:30:00.5" compared with 08:30:00. Keep every fraction digit of a quoted time, like an unquoted time. The rightIsQuotedLiteral argument of CreateRightExpr is removed, because the time conversion was its only user.

BREAKING CHANGE: a quoted time with a fraction of 1 or 2 digits now keeps the fraction. Time == "08:30:00.5" now matches 08:30:00.500, not 08:30:00. Remove the fraction to match the whole second.
@pdevito3
pdevito3 force-pushed the fm/qk-breaking-short-time-fraction branch from 58c8607 to f6385c0 Compare October 1, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant