Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When doing prefetch in DAP2, ignore invisible variables. #1301

Merged
merged 3 commits into from
Jan 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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