Modify previous no_fill setting

HDF5 does not permit a variable to have no_fill == TRUE if the variable type is variable length.  This includes types NC_STRING and NC_VLEN.  

The test above also excludes user-defined types which I'm not sure is needed or not.
This commit is contained in:
Greg Sjaardema 2016-12-05 11:08:26 -07:00 committed by GitHub
parent 8401e2087e
commit f8e818385e

View File

@ -456,7 +456,6 @@ nc_def_var_nc4(int ncid, const char *name, nc_type xtype,
var->varid = grp->nvars++;
var->ndims = ndims;
var->is_new_var = NC_TRUE;
var->no_fill = h5->fill_mode;
nc4_vararray_add(grp, var);
@ -528,6 +527,13 @@ nc_def_var_nc4(int ncid, const char *name, nc_type xtype,
BAIL(NC_ENOMEM);
}
/* Set variables no_fill to match the database default
* unless the variable type is variable length (NC_STRING or NC_VLEN)
* or is user-defined type.
*/
if (var->type_info->nc_type_class < NC_STRING)
var->no_fill = h5->fill_mode;
/* Assign dimensions to the variable */
/* At the same time, check to see if this is a coordinate
* variable. If so, it will have the same name as one of its