Skip to content

Commit

Permalink
Merge pull request #1301 from Unidata/zerodim.dmh
Browse files Browse the repository at this point in the history
When doing prefetch in DAP2, ignore invisible variables.
  • Loading branch information
WardF authored Jan 30, 2019
2 parents 9b07389 + 1272483 commit 69c4ed6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
4 changes: 3 additions & 1 deletion libdap2/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ nclog(NCLOGDBG,"prefetch: %s",var->ncfullname);
newconstraint->selections = dceclonelist(urlconstraint->selections);

for(i=0;i<nclistlength(vars);i++) {
CDFnode* var = (CDFnode*)nclistget(vars,i);
DCEprojection* varprojection;
CDFnode* var = (CDFnode*)nclistget(vars,i);
/* Ignore invisible vars */
if(var->invisible) continue;
/* convert var to a projection */
ncstat = dapvar2projection(var,&varprojection);
if(ncstat != NC_NOERR) {THROWCHK(ncstat); goto done;}
Expand Down
1 change: 1 addition & 0 deletions ncdap_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ IF(ENABLE_TESTS)
IF(BUILD_UTILITIES)
add_sh_test(ncdap tst_ber)
add_sh_test(ncdap tst_remote3)
add_sh_test(ncdap tst_zero_len_var)
# not yet add_sh_test(ncdap tst_hyrax)
add_sh_test(ncdap tst_fillmismatch)
IF(ENABLE_DAP_LONG_TESTS)
Expand Down
3 changes: 2 additions & 1 deletion ncdap_test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ check_PROGRAMS += findtestserver
findtestserver_SOURCES = findtestserver.c

if BUILD_UTILITIES
TESTS += tst_ber.sh tst_remote3.sh tst_formatx.sh testurl.sh tst_fillmismatch.sh
TESTS += tst_ber.sh tst_remote3.sh tst_formatx.sh testurl.sh tst_fillmismatch.sh tst_zero_len_var.sh
endif

TESTS += test_partvar
Expand Down Expand Up @@ -83,6 +83,7 @@ SUBDIRS = testdata3 expected3 expectremote3
EXTRA_DIST = tst_ncdap3.sh \
tst_remote3.sh \
tst_longremote3.sh \
tst_zero_len_var.sh \
tst_filelists.sh tst_urls.sh tst_utils.sh \
t_dap.c CMakeLists.txt tst_formatx.sh testauth.sh testurl.sh \
t_ncf330.c tst_ber.sh tst_fillmismatch.sh \
Expand Down
24 changes: 24 additions & 0 deletions ncdap_test/tst_zero_len_var.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

if test "x$SETX" != x ; then set -x; fi
set -e

if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh

##
# If the bug referenced in https://github.com/Unidata/netcdf-c/issues/1300
# reoccurs, then the following command would fail.

${NCDUMP} http://test.opendap.org/opendap/data/nc/zero_length_array.nc > tst_zero_len_var.cdl

RES=$?

if [ $RES -ne 0 ]; then
echo "Error $RES"
exit $RES
fi

rm -f tst_zero_len_var.cdl

exit 0

0 comments on commit 69c4ed6

Please sign in to comment.