My coworker, Lena, informs me that this behavior also exists in SQL Server.
It is imperative that defaulted columns be NOT NULL so that structure changes 
do not introduce garbage data.

Dennis McGrath

________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of Dennis McGrath
Sent: Tuesday, November 09, 2010 11:10 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Expected behavior OR bug?

Sami,

I tested this in 7.6 DOS
The same thing happens.

It is certainly not what I would have expected, since I assumed 'default' would 
get applied only to new rows.

In any case, given this behavior, I would certainly recommend that any columns 
with a default should also be NOT NULL.

Dennis

________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of Sami Aaron
Sent: Tuesday, November 09, 2010 10:47 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Expected behavior OR bug?

I just had something occur that I don't remember seeing before and I wasn't 
sure if it was expected behavior or a bug that I should report.  I noticed it 
in a V-8 database first and then tested it in 9.0 and it's the same.

Start with a table with a currency column that has a default value of $100 in 
the field.

Update some records in the table to change the value to a different number than 
$100 and also to change some to NULL.

Then issue an ALTER TABLE ALTER SomeOtherColumn changing the width of a text 
field.

What happens is that in the currency column, any records that had the original 
$100 changed to a different number retained the changed value - so that was 
correct.  BUT any records that had a NULL value in the column now have the $100 
there.

What do you guys think?

Thanks,
Sami

____________________________
Sami Aaron
Software Management Specialists
913-915-1971
[email protected]
 P Please consider the environment before printing this e-mail



Reply via email to