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

Server adds "NOT" at the end of default value for the TIMESTAMP field [CORE2430] #2846

Closed
firebird-automations opened this issue Apr 15, 2009 · 12 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Sergey Mereutsa (green_dq)

Is related to QA400

When you execute this script:

CREATE TABLE T1 (
F1 BIGINT NOT NULL,
F2 BIGINT NOT NULL,
F3 TIMESTAMP DEFAULT current_timestamp NOT NULL
);

ALTER TABLE T1 ADD CONSTRAINT PK_T1 PRIMARY KEY (F1, F2);

and show table t1 (in isql), you can see, that "NOT" word was added to the default timestamp value:

Database: localhost/3055:universe, User: dqdev
SQL> CREATE TABLE T1 (
CON> F1 BIGINT NOT NULL,
CON> F2 BIGINT NOT NULL,
CON> F3 TIMESTAMP DEFAULT current_timestamp NOT NULL
CON> );
SQL>
SQL> ALTER TABLE T1 ADD CONSTRAINT PK_T1 PRIMARY KEY (F1, F2);
SQL> GRANT ALL ON T1 TO DQDEV WITH GRANT OPTION;
SQL> commit;
SQL> exit;

Database: localhost/3055:universe, User: dqdev
SQL> show table t1;
F1 BIGINT Not Null
F2 BIGINT Not Null
F3 TIMESTAMP Not Null DEFAULT current_timestamp NOT
CONSTRAINT PK_T1:
Primary key (F1, F2)

P.S.

Vlad indicated, that this bug was added by Dmitry Emanov, when fixed this: CORE1512

Commits: d04031e

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Before the change end of default's source was determined using end_default_opt rule which is used lex.last_token.
After the change end of default's source is determined using end_trigger rule which is used lex_ptr (current position of lexer).
But lexer's current position could be after of actual end of currently expanded rule if some look-ahead is performed.

@firebird-automations
Copy link
Collaborator Author

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => In Progress [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Version: 2.5 Alpha 1 [ 10224 ]

summary: Server add "NOT" at the end of default value for the TIMESTAMP field => Server adds "NOT" at the end of default value for the TIMESTAMP field

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: In Progress [ 3 ] => Open [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5 RC1 [ 10300 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA400 [ QA400 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pcisar

QA test added.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test => Done successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment