Obj_ptr = 0

Ivan Smahin ivan_smahin at paradigmasoft.com
Tue Oct 9 03:18:35 CDT 2007


Hello Bart,

Tuesday, October 9, 2007, 11:11:19 AM, you wrote:

> Hi List,


> This table

>      aTable = CreateTable 
> ("tbl_rating_systems",EVTableKind.kTblPermanent)

>      VarCharField = aTable.CreateVarCharField("rs_name", 
> 512,EVFlag.fIndexed)
>      VarCharField = aTable.CreateVarCharField("rs_description",2044)

>      PtrField = aTable.CreateObjectPtrField 
> ("objptr_organisation",Table("tbl_organisations"),   
> EVOnDelete.kCascade, EVFlag.fIndexed,"rating_system_of_organisation")

>      DateTimeField = aTable.CreateDateTimeField("modification_dt")
>      DateTimeField = aTable.CreateDateTimeField("creation_dt")


>      PtrField =
> aTable.CreateObjectPtrField("objptr_modified_by",Table 
> ("tbl_users"),EVOnDelete.kSetNull ,EVFlag.fIndexed 
> +EVFlag.fNullable,"rating_system_modified_by_user")
>      PtrField = aTable.CreateObjectPtrField("objptr_created_by",Table 
> ("tbl_users"),EVOnDelete.kSetNull ,EVFlag.fIndexed 
> +EVFlag.fNullable,"rating_system_created_by_user")

>      VarCharField = aTable.CreateVarCharField("uniquers_by_org", 
> 2044,EVFlag.fIndexed+EVFlag.fUnique,"concat 
> (rs_name,objptr_organisation)")

>      accepts this query:

> insert into tbl_rating_systems(rs_name,rs_description) values  
> ('test','more test')

> I would expect that this statement would raise an error on the  
> objptr_organisation.
> I defined it to not allow null values so I expect an error when I  
> pass a null for this field;
> instead the null value is automatically converted to 0 AND accepted  
> in the table, the next time I would run this query of course would  
> generate a not unique error on the uniquers_by_organisation field,
> because now this field contains test0

> Is this the expected behaviour

No, but it is already reported to the Mantis.
http://valentina-db.com/bt/view.php?id=2712
Will be fixed soon - probably today.


-- 
Best regards,
Ivan Smahin 
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com



More information about the Valentina mailing list