8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 22:43:03 +01:00

Allow literal and conversion from timestamp with date and time zone but without time.

For example: timestamp '2018-01-02 America/Sao_Paulo'
This commit is contained in:
Adriano dos Santos Fernandes 2018-05-04 13:09:02 -03:00
parent 53be87c228
commit a65f8ffb5e

View File

@ -595,7 +595,8 @@ void CVT_string_to_datetime(const dsc* desc,
}
description[i] = precision;
}
else if (LETTER7(c) && !have_english_month)
// Month names are only allowed in first 2 positions
else if (LETTER7(c) && !have_english_month && i < 2)
{
TEXT temp[sizeof(YESTERDAY) + 1];
@ -620,8 +621,7 @@ void CVT_string_to_datetime(const dsc* desc,
const TEXT* const* month_ptr = FB_LONG_MONTHS_UPPER;
while (true)
{
// Month names are only allowed in first 2 positions
if (*month_ptr && i < 2)
if (*month_ptr)
{
t = temp;
const TEXT* m = *month_ptr++;
@ -699,9 +699,12 @@ void CVT_string_to_datetime(const dsc* desc,
}
else
{
// Not a digit and not a letter - must be punctuation
if (expect_type == expect_sql_date || i != 3)
CVT_conversion_error(desc, cb->err);
return;
// May be a timezone after a date when expecting a timestamp.
--i;
break;
}
components[i] = n;