You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Forgot to mention product version: YottaDB r1.10 Linux x86_64.
ksbhaskar
changed the title
mupip load on an empty ZWR file gives you incorrect error messages
mupip load on an empty ZWR file reports an incorrect error messages
Nov 22, 2017
…ords loaded (instead of MAXSTRLEN/LDBINFMT errors)
The main change is to get_load_format() in sr_unix/mupip_cvtgbl.c. It assumed that in case of
a non-binary format extract file (MU_FMT_GO or MU_FMT_ZWR), there is always a non-empty 3rd line
in the extract file.
Although it is not possible for YottaDB (%GO or MUPIP EXTRACT) to create an empty extract file,
it is possible for the user to delete entries in a ZWR or GO format extract file (which is an
ascii file) effectively creating a file with just the first 2 lines (header).
In that case, MUPIP LOAD currently issue a MAXSTRLEN error (in get_load_format()). This is
get_load_format() assumes that a negative return from go_get() implies a string that is too
long to fit in the passed in buffer. But there are 2 negative return values possible from that
function, FILE_INPUT_GET_LINE2LONG and FILE_INPUT_GET_ERROR. A MAXSTRLEN error in the former case
is correct but not in the latter case which effectively implies an EOF. Therefore this case is
handled separately now by not issuing an error but instead returning as is to the caller function
mupip_cvtgbl(). At this point, we are guaranteed *line3_len is set to 0 indicating there is no
3rd line seen.
In mupip_cvtgbl(), line3_len is examined to see if it is 0 and if so it now knows the extract file
only has 2 lines and so sets "end" to 2 (corresponding to the 2 lines of the extract file header)
before calling go_load() which then knows not to read the extract file any more (i.e. no records to load).
While at this, minor changes were done to go_load() so the last processed record in the
LOADRECCNT message is displayed as 2 (and not 3) in this empty-extract-file case. A value of 3
implies there was 1 non-header line which is not correct for an empty extract file.
Final Release Note
Description
E.g.
Correct behavior is for it to load 0 records with no error messages.
Draft Release Note
When asked to load an empty file, MUPIP LOAD reports 0 records loaded. Previously, it reported MAXSTRLEN and LDBINFMT errors. (YDB#95)
The text was updated successfully, but these errors were encountered: