Gossamer Forum
Home : Gossamer Threads Inc. : Discussion :

links sql 1.13 bug..

Quote Reply
links sql 1.13 bug..
once again.. i opened up dbsql.pm to see that the only change done to this line...

Code:
$rec_r->{$column} or next;
in DBSQL.pm sub add_record was a tab..

anyways.. alex.. i'm sure you understand why.. but explanation..

this line is pretty much an unless statement.. if $rec_r->{$column} if true it goes on.. if it is false it does next;..

in perl.. an empty string is considered false.. however.. 0 is also considered false.. 0, "0" both the same.. a number inside quotations is still considered a integer and not a string..

so.. just say someone left a required field with the value '0'...

0 = false.. so it skips this field in the coding.. and '0' is not set as the value for this field.. you then get a field with a NULL value..

the code needs to be..

$rec_r->{$column} =~ /^\s*$/ or next;



Jerry Su