DSE DUMP ZWR/GLO correctly outputs records longer than maximum record size for region
Final Release Note
DSE DUMP ZWR/GLO correctly outputs records longer than the maximum record size for the region. Previously, it truncated them. This was discovered in the YottaDB development environment and never reported by a user. [#846 (closed)]
Description
This is an issue found as part of analyzing all callers of format2zwr()
for #843 (closed).
https://docs.yottadb.com/AdminOpsGuide/dse.html#z-wr and https://docs.yottadb.com/AdminOpsGuide/dse.html#g-lo describe how DSE DUMP -ZWR (or -GLO) can dump records into the current output file (basically an extract file that is later fed to a mupip load
command).
But this does not work in some cases when the maximum record size
of the region that dse is dumping records from is much small compared to the subscripted gvn that it is trying to dump.
Below is a simple test case demonstrating the issue.
$ cat dsedumpfile.sh
rm -f yottadb.gld yottadb.dat
export ydb_gbldir="yottadb.gld"
$ydb_dist/yottadb -run GDE << GDE_EOF >gde.out 2>&1
change -segment DEFAULT -file=yottadb.dat
change -region DEFAULT -record_size=1
change -region DEFAULT -key_size=1019
exit
GDE_EOF
$ydb_dist/mupip create >mupip.out 2>&1
$ydb_dist/yottadb -run %XCMD 'for i=1,8,9 set ^x($translate($justify("s",i)," ","s"))=1'
$ydb_dist/dse << DSE_EOF
open -file=dsedumpfile.txt
dump -glo -block=3
dump -block=3
DSE_EOF
cat dsedumpfile.txt
The above test case produces the following output.
$ . ./dsedumpfile.sh
File /tmp/yottadb.dat
Region DEFAULT
DSE> DSE>
3 GLO records written.
DSE>
Block 3 Size 31 Level 0 TN 3 V6
Rec:1 Blk 3 Off 10 Size B Cmpc 0 Key ^x("s")
10 : | B 0 0 0 78 0 FF 73 0 0 31 |
| . . . . x . . s . . 1 |
Rec:2 Blk 3 Off 1B Size E Cmpc 4 Key ^x("ssssssss")
1B : | E 0 4 0 73 73 73 73 73 73 73 0 0 31 |
| . . . . s s s s s s s . . 1 |
Rec:3 Blk 3 Off 29 Size 8 Cmpc B Key ^x("sssssssss")
29 : | 8 0 B 0 73 0 0 31 |
| . . . . s . . 1 |
DSE> ; DSE EXTRACT
; GLO
^x("s")
1
^x("ssssssss")
1
^x("ssssssss)
1
Notice that the dump -block=3
command output above is fine and has keys ^x("s")
, ^x("ssssssss")
and ^x("sssssssss")
(i.e. subscripts of length 1, 8 and 9).
But the dump of the extract file dsedumpfile.txt
shows keys ^x("s")
and ^x("ssssssss")
fine but shows ^x("ssssssss)
instead of ^x("sssssssss")
. The 9th s
is missing in the subscript. And a terminating double-quote is also missing.
Similar issues also exist for subscripts of length greater than 9.