Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"SET BIND OF TS WITH TZ TO VARCHAR(128)" uses the date format of dialect 1. #7729

Closed
dmitry-lipetsk opened this issue Aug 29, 2023 · 7 comments

Comments

@dmitry-lipetsk
Copy link
Contributor

FB 4.0.3.2973, database with dialect 3.

SET BIND OF TIMESTAMP WITH TIME ZONE TO varchar(128);
select timestamp '2023-08-29 01:02:03.0123 +3:0' from rdb$database;

Server returns string "29-AUG-2023 1:02:03.0123 +03:00"

I think. when client uses dialect 3, server should return "2023-08-29 1:02:03.0123 +03:00"


The second problem(?) - server ignores the size of VARCHAR. It returns the string with 57 symbols.

RDB$TIME_ZONES table says that TIME ZONE name can be up to 63 symbols.


image

@dmitry-lipetsk dmitry-lipetsk changed the title Dialect 1 and "SET BIND OF TS WITH TZ TO VARCHAR(128)" "SET BIND OF TS WITH TZ TO VARCHAR(128)" uses the date format of dialect 1. Aug 29, 2023
@AlexPeshkoff AlexPeshkoff self-assigned this Aug 29, 2023
@AlexPeshkoff
Copy link
Member

RDB$TIME_ZONES table says that TIME ZONE name can be up to 63 symbols.
I do not know where did this 63 symbols came from. Actual maximum length is 32.

@dmitry-lipetsk
Copy link
Contributor Author

dmitry-lipetsk commented Aug 29, 2023

It was reserved for the future names?

Or it is the unification with FB4-object names.

Ok.

2023-SEP-01 01:02:03.1234 tz_with_32symbols ----> 4+1+3+1+2+1+13+1+32 ==58 :)

@AlexPeshkoff
Copy link
Member

Yep, when talking in dialect 1 overflow here is really possible. Will fix.

@dmitry-lipetsk
Copy link
Contributor Author

The first thought of day - it is needed to check and correct the bind of TIMESTAMP and DATE, too :)

@dyemanov
Copy link
Member

Should this ticket be closed?

@AlexPeshkoff
Copy link
Member

The only reason why it and #7731 were not closed - I doubt should they be backported to fb4 or not. Certainly both are bugs, but IMO not too critical and (on the other hand) affecting possible end-user soft behavior (changed rules of date parsing, changed column width).

Do you have an idea?

@dyemanov
Copy link
Member

IMHO, they should be backported.

AlexPeshkoff added a commit that referenced this issue Sep 19, 2023
… format of dialect 1

(cherry picked from commit c51f969)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants