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

DEFAULT values are unnecessary evaluated [CORE1842] #2271

Closed
firebird-automations opened this issue Apr 17, 2008 · 10 comments
Closed

DEFAULT values are unnecessary evaluated [CORE1842] #2271

firebird-automations opened this issue Apr 17, 2008 · 10 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Alex Karp (karp)

Is related to QA313

create the table:

create table tb_date (
tb_date_id integer not null primary key,
f_date date default 0);

after this inse we attempt insert new record:

INSERT INTO TB_DATE (
TB_DATE_ID, F_DATE)
VALUES (
1, '09-MAY-1945');

or

insert into tb_date (
tb_date_id, f_date)
values (
2, null);

and obtain the error:
The next statement causes the following error:
Overflow occurred during data type conversion.
conversion error from string "0".

although the inserted value f_date is correct - engine is checked the correctness default value of field f_date

Alex Karpeykin

Commits: 97693bc

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

First of all, Firebird doesn't support zero dates, so I'll rename the ticket description.

Second, I don't see this as a bug. Defaults are first evaluated and then assignments are made. Fields that doesn't are assigned become with the default value. So I'll change to improvement.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

issuetype: Bug [ 1 ] => Improvement [ 4 ]

Version: 2.5 Initial [ 10260 ]

summary: zero default value for field date types => DEFAULT values are unnecessary evaluated

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Adriano, I disagree. While we of course don't support zero dates, the error is thrown for a perfectly valid SQL statement. And IMHO this is a bug, regardless of our internal algorithms.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

We support a very limited set of expressions in DEFAULT, so any (possible) incorrect DEFAULT are going to cause problem in an INSERT that needs to evaluate defaults.

I see this as an implementation detail (if the standard doesn't specify WHEN they should be evaluated) that *currently* doesn't affect real-life usage.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 2.5 Beta 1 [ 10251 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA313 [ QA313 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

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