|
Ran
|
Jobs
1
|
Files
120
|
Run time
1min
|
Badge
README BADGES
|
push
github
Fix for DATENAME() gives incorrect value with TZOFFSET part (#3895) * Fix for DATENAME() gives incorrect value with TZOFFSET part (#3846) Currently, DATENAME function returns a numeric value for TZOFFSET datepart, which does not match SQL Server's text output. Root cause: The function definition of sys.datename explicitly calls the DATEPART function for most argument values, including TZOFFSET, thereby returning a numerical offset value instead of the required text format (+/-HH:MM). Fix: Modified the sys function's SQL definition to extract and return the timezone offset substring from the input - similar to how the offset_string is determined in DATETRUNC/DATEBUCKET - if the argument matches tzoffset. Furthermore, translated the function from SQL language to plpgsql in order to enable raising an exception for unsupported input datetime datatypes such as date, time, datetime and smalldatetime. Task: BABEL-5846 Signed-off-by: Manisha Deshpande <mmdeshp@amazon.com> (cherry picked from commit debf90bee) * Fixed DATENAME to use datetimeoffset cast instead of sys.babelfish_conv_string_to_datetimeoffset While sys.babelfish_conv_string_to_datetimeoffset is a helpful way to validate datetimeoffset values before returning the offset string in DATENAME(TZOFFSET,...) it is crrently not present in 4_X. (BABEL-4896). Switching to a normal pg cast to datetimeoffset works as well, but does not validate out of boundary offset hour values above +/-14:00 since PG accepts upto hour 15. The incorrect output in the out-of-boundary test case in `datename+tzoffset-v-verify.sql` can be updated to the expected error (SQL Server), once the root cause jira BABEL-5827 is fixed. Task: BABEL-5846 Signed-off-by: Manisha Deshpande <mmdeshp@amazon.com> (cherry picked from commit 3140b6ca6)
49271 of 65010 relevant lines covered (75.79%)
323536.16 hits per line
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 16045199987.1 | 120 |
75.79 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|