FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.24k stars 213 forks source link

ISQL returns illegal NULLs as zeroes [CORE1087] #1508

Open firebird-automations opened 17 years ago

firebird-automations commented 17 years ago

Submitted by: @paulvink

When a NOT NULL column contains NULLs, isql reports these as zeroes (0, emptystring, etc.) to the user.

The heart of the problem is in the engine, which allows these illegal NULLs to exist in the first place, and in the way the API is set up (describing a column as NOT NULL through the same structure that is later used to fetch the output rows).

Still, a good client should be aware of this and always assume that a column may contain NULLs. In the case of illegal NULLs it's even more important that the user be aware of them, so s/he can do something about it. At present, most users assume that Firebird has somehow automatically applied a default value when they add a NOT NULL column or change an existing column to a NOT NULL domain. This leaves them with corrupted data, and unrestorable backups later.

firebird-automations commented 16 years ago
Modified by: @pcisar Workflow: jira \[ 11500 \] =\> Firebird \[ 15486 \]
firebird-automations commented 13 years ago

Commented by: @dyemanov

With NULLs never appearing in NOT NULL columns (in FB 3.0), shouldn't we close this ticket as well? Or is it exclusively about ISQL intelligence?

firebird-automations commented 13 years ago

Commented by: @paulvink

Not exclusively, but "also".

Detecting illegal nulls is dead easy to implement, so I see no reason not to fix isql on this point, preferably as early as 2.5.1 ;-)

Many users don't know of this problem, and only discover it when they try to restore a backup that contains nulls in NOT NULL columns.

If isql would show illegal nulls as e.g. <ILL_NULL> (or *ERROR*, or something else that gives the user a good fright) and print a warning at the bottom of sets that contain such nulls, it would be really helpful.