-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
50662: sql: disable arrays in forward indexes r=mjibson a=mjibson There are some open questions about inverted index types being used in forward indexes. Disable those for now. Fixes #50656 See #50659 See #17154 Release note (sql change): disable arrays in non-inverted indexes. 50742: sql: granular detection of non-immutable constant casts r=RaduBerinde a=RaduBerinde #### opt: improve tests for parsing timestamps Add more `sem/tree` unit tests for parsing time-related types. In particular: - relative timestamps ('now', 'tomorrow') - TZ variants - timestamps that include timezones for DDate, DTime - cases where the result depends on the current time and/or timezone. In a future change, the parsing functions will also return a flag indicating if the result depends on the context or not; these tests will be updated to check that flag as well. Release note: None #### pgdate: add WithoutTimezone variants The way we parse DTimestamp (and other non-TZ variants) is convoluted: we initially parse it just like a DTimestampTZ, and then we strip away the timezone (adjusting it so the timestamp looks the same as before, except with UTC location). This means that we incorporate the local timezone, even though it is inconsequential. This change adds WithoutTimezone API variants to `pgdate` which avoids using the local timezone. This will allow extending the parsing APIs to indicate whether the result depends on the current time or timezone. Release note: None #### sql: use dummy ParseTimeContext during type-checking We are not supposed to use any context-dependent parsing results during type-checking. As such, use a dummy ParseTimeContext instead of having SemaContext implement the interface. Release note: None #### sql: granular detection of non-immutable constant casts Interpreting a timestamp (and similar types) can depend on the current timezone or even the current time. A recent change prevented these casts from happening during type-checking. Unfortunately, this includes a lot of common cases which aren't actually context-dependent. The most important are dates and timestamps without time zone (except rare cases like 'now' or 'tomorrow'). In these cases, the type-checked expressions won't seem constant and won't be able to be used for partitioning, index predicates, etc. This change improves the parsing functions to return a `dependsOnContext` boolean. When this flag is false, the result is immutable and is replaced during type-checking. The volatility of the version of date_trunc that returns a TIMESTAMPTZ is corrected to Stable. Release note: None Co-authored-by: Matt Jibson <[email protected]> Co-authored-by: Radu Berinde <[email protected]>
- Loading branch information
Showing
44 changed files
with
1,019 additions
and
421 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.