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

Zero display instead of NULL [CORE1355] #1773

Closed
firebird-issue-importer opened this issue Jul 13, 2007 · 13 comments
Closed

Zero display instead of NULL [CORE1355] #1773

firebird-issue-importer opened this issue Jul 13, 2007 · 13 comments

Comments

@firebird-issue-importer

Submitted by: @pmakowski

Relate to CORE2696
Is related to QA533

After adding a new field, value is reported as zero instead of null, but the "value" is correct (null)
here the test :
SQL> CREATE database 'test.fdb';
SQL> create table test (test_value integer);
SQL> insert into test(test_value) values (9);
SQL> commit;
SQL> alter table test add test_id integer not null;
SQL> select * from test;

TEST_VALUE TEST_ID
============ ============

       9            0

SQL> select count(*) from test where TEST_ID=0;

   COUNT

============

       0

SQL> select count(*) from test where TEST_ID IS NULL;

   COUNT

============

       1

Commits: 218f419

====== Test Details ======

Test not needed here.

See tests that manipulates with NULL fields/domains and check results:
* CORE1518 Adding a non-null restricted column to a populated table renders the table inconsistent;
* CORE4453 (Regression: NOT NULL constraint, declared in domain, does not work);
* CORE4725 (Inconsistencies with ALTER DOMAIN and ALTER TABLE with DROP NOT NULL and PRIMARY KEYs);
* CORE4733 (Command "Alter table <T> alter TYPE <C> <DOMAIN_WITH_NOT_NULL" does not verifies data in column <C> and makes incorrect assignments in <C> to ZERO / JULIAN_DATE / ASCII(0) for types INT, TIMESTAMP and VARCHAR).

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jul 16, 2007

Commented by: @dyemanov

This is a historical issue. Although the column is defined as NOT NULL, the engine emulates a return of the NULL value anyway (there's just no other value in this column, so somewhat should be returned, huh?). But the client-side XSQLDA indicates that the column is non-nullable, so the client tools don't expect a NULL there, they just treat the result as zero (or empty string). Some other tools (IBExpert, for example) don't trust the XSQLDA nullability flag and rely on the sqlind value only, thus correctly showing you NULL.

Personally, I think that returning NULL from a NOT NULL column is much worse than ISQL's treating NULL as zero.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jul 18, 2007

Commented by: @pmakowski

I'm not sure I follow you
I'd prefer to have NULL instead of Zero

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jan 28, 2008

Modified by: @pcisar

Workflow: jira [ 12571 ] => Firebird [ 14199 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Oct 20, 2009

Modified by: @dyemanov

Link: This issue relate to CORE2696 [ CORE2696 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Nov 8, 2009

Commented by: @dyemanov

Adding NOT NULL columns without default values should be prohibited. As soon as it's done, this ticket will be resolved automagically.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Nov 8, 2009

Modified by: @dyemanov

Fix Version: 3.0 Alpha 1 [ 10331 ]

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Nov 17, 2009

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Mar 29, 2014

Modified by: @pcisar

Link: This issue is related to QA533 [ QA533 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jan 19, 2016

Modified by: @pavel-zotov

QA Status: No test

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 1, 2016

Modified by: @pavel-zotov

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

QA Status: No test => Done successfully

Test Details: Test not needed here.

See tests that manipulates with NULL fields/domains and check results:
* CORE1518 Adding a non-null restricted column to a populated table renders the table inconsistent;
* CORE4453 (Regression: NOT NULL constraint, declared in domain, does not work);
* CORE4725 (Inconsistencies with ALTER DOMAIN and ALTER TABLE with DROP NOT NULL and PRIMARY KEYs);
* CORE4733 (Command "Alter table <T> alter TYPE <C> <DOMAIN_WITH_NOT_NULL" does not verifies data in column <C> and makes incorrect assignments in <C> to ZERO / JULIAN_DATE / ASCII(0) for types INT, TIMESTAMP and VARCHAR).

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 1, 2016

Modified by: @pavel-zotov

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

Fix Version: 3.0.1 [ 10730 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 17, 2016

Modified by: @dyemanov

Fix Version: 3.0.1 [ 10730 ] =>

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 20, 2016

Modified by: @pavel-zotov

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

QA Status: Done successfully => Covered by another test(s)

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