Roy Lyseng wrote:
What should happen when the following occurs?
CREATE TABLE t1 (id INT NOT NULL);
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL),(NULL);
The behaviour in both cases would be to throw an exception and reject
the statements. The only exception (I think) is the case where you have
a trigger that catches the NULL and an replaces it with something else.
But I guess there are people with more familiarity with triggers than me
who can tell you more about that.
The before action trigger fires before constraints, so a before
action trigger that catches and changes the null to something
else would allow those statements to succeed. An after action
trigger will not.
As for NULL behavior being ill-defined, unless my memory is up to
its usual tricks, the only aspect of NULL behavior which is not
clearly defined is whether NULLs sort first, last, high, or
low - that is implementor defined. First means nulls come
first regardless of the sort order; last means they come last
regardless of order; high means they come first on a descending
sort and last when the sort is ascending; low is an exercise
for the reader.
Best,
Ann
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp