Skip to content

Fix #9328: AT TIME ZONE / AT LOCAL with a non-TIME/TIMESTAMP argument reports only "expression evaluation not supported" - #9329

Open
vmzubov wants to merge 1 commit into
FirebirdSQL:masterfrom
vmzubov:fix-9328-at-time-zone
Open

vmzubov wants to merge 1 commit into
FirebirdSQL:masterfrom
vmzubov:fix-9328-at-time-zone

Conversation

@vmzubov

@vmzubov vmzubov commented Nov 20, 2026

Copy link
Copy Markdown

Fixes #9328.

AtNode::make() and AtNode::execute() raised a bare isc_expression_eval_err (marked //// TODO: more info) when the argument was not TIME or TIMESTAMP.

Changes:

  • new message isc_at_argmustbe_time_timestamp (JRD 1028, Argument for AT TIME ZONE or AT LOCAL must be of type TIME or TIMESTAMP, but @1 was given);
  • it is added as a secondary status after isc_expression_eval_err, so the primary error code and SQLSTATE 42000 stay the same (same pattern as isc_sysf_argmustbe_* in SysFunction.cpp);
  • src/include/gen/Firebird.pas updated with the new constant.

Before:

-expression evaluation not supported

After:

-expression evaluation not supported
-Argument for AT TIME ZONE or AT LOCAL must be of type TIME or TIMESTAMP, but DATE was given

Tested on Linux x64 (clang): make, make tests, make run_tests; manual check with DATE, INTEGER, and the regular TIME/TIMESTAMP cases (unchanged).

The patch was prepared with the help of Claude (AI assistant); I reviewed and tested it and take responsibility for it.

…MP argument reports only "expression evaluation not supported"

Add a secondary status with the expected and the actual data type,
keeping isc_expression_eval_err as the primary error.

Co-Authored-By: Claude <noreply@anthropic.com>
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.

AT TIME ZONE / AT LOCAL with a DATE (or other non-time) argument reports only "expression evaluation not supported"

1 participant