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
Comments
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. |
Commented by: @pmakowski I'm not sure I follow you |
Modified by: @pcisarWorkflow: jira [ 12571 ] => Firebird [ 14199 ] |
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. |
Modified by: @dyemanovFix Version: 3.0 Alpha 1 [ 10331 ] assignee: Adriano dos Santos Fernandes [ asfernandes ] |
Modified by: @pavel-zotovQA Status: No test |
Modified by: @pavel-zotovstatus: 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: |
Modified by: @dyemanovFix Version: 3.0.1 [ 10730 ] => |
Modified by: @pavel-zotovstatus: Closed [ 6 ] => Closed [ 6 ] QA Status: Done successfully => Covered by another test(s) |
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
============ ============
SQL> select count(*) from test where TEST_ID=0;
============
SQL> select count(*) from test where TEST_ID IS NULL;
============
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).
The text was updated successfully, but these errors were encountered: