| It looks like there are two different problems here.
The first is that DECC is longword aligning the field 'body' in struct DbUser,
and SQL isn't. DECC seems to align a structure based on the size of its
largest element; SQLMOD aligns based on the first element of the structure.
The second problem is caused by date types being a vector of longwords
in DECC and a quadword in SQL. This makes DECC longword align dates
and SQL quadword align dates. In this case, it happened to re-synch
the fields at createDate.
I would bug this.
|
| I investigated it further and I found out the adresses of the fields in the
different situations. Only the last 3 digits of the adresses are relevant.
In the situations NOALIGN and NOMEMNER all fields are put behind each other. In
the situation MEMBER in DECC the structures start at the boundary at which the
biggest type is aligned.
The first structure containts the longword id and is therefore aligned at a
longword boundary at 424.
The second structure is a character field and is aligned on a byte boundary,
this means right behind id at 428.
The third structure contains character fields and longwords and is therefore
longword aligned on 444. name, department, extension and discipline are put
behind each other because they are byte aligned. The last byte of these
characters is on 492. createUser starts on the first longword boundary after
492. This is 496. The rest are also longwords, so they all are put behind each
other.
In SQLMOD there are no structures, so the character fields are byte aligned,
the longwords longword aligned and the quadwords quadword aligned.
id starts at the longword boundary 424 and the character fields are put right
behind that. The last byte is at 490. The longword createUser starts at the
first longword after that at 492. The createDate quadword at the quadword
boundary 496. The longword moduser fits right behind createDate, but the
quadword ModDate must start at the quadword boundary 512.
field type nomem mem align noalign
----- ---- ----- --- ----- -------
id long 424 424 424 424 ______
vmsId char(13+1) 428 428 428 428 ______
name char(20+1) 442 444 442 442
department char(20+1) 463 465 463 463
extension char(4+1) 484 486 484 484
discipline char(1+1) 489 491 489 489
createUser long 491 496 492 491
createDate long(2) 495 500 - - C
createDate quadword - - 496 495 SQLMOD
moduser long 503 508 504 503
modDate long(2) 507 512 - - C
modDate quadword - - 512 507 SQLMOD
Marcel Willems
|