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-issue-importer opened this issue Apr 17, 2008 · 10 comments
Closed

DEFAULT values are unnecessary evaluated [CORE1842] #2271

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

Comments

@firebird-issue-importer

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 17, 2008

Modified by: @dyemanov

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 17, 2008

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 17, 2008

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 17, 2008

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 17, 2008

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 29, 2008

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 2.5 Beta 1 [ 10251 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 23, 2011

Modified by: @pcisar

Link: This issue is related to QA313 [ QA313 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 23, 2011

Modified by: @pmakowski

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 19, 2016

Modified by: @pavel-zotov

QA Status: No test

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 19, 2016

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants