From: Adam Dickmeiss Date: Mon, 11 Apr 2011 09:20:10 +0000 (+0200) Subject: Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/yaz X-Git-Tag: v4.2.0~46 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=dbd362a3dc1cfcafbcbafee0d5b28a4397fe7f03;hp=d6717ba6822aea328e4a456edcf0318261cdc175 Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/yaz --- diff --git a/src/rpn2cql.c b/src/rpn2cql.c index ea21793..b1063a1 100644 --- a/src/rpn2cql.c +++ b/src/rpn2cql.c @@ -182,11 +182,11 @@ static int checkForTruncation(int flag, Z_AttributeList *attributes) }; static int checkForLeftTruncation(Z_AttributeList *attributes) { - return checkForTruncation(1, attributes); + return checkForTruncation(2, attributes); } static int checkForRightTruncation(Z_AttributeList *attributes) { - return checkForTruncation(2, attributes); + return checkForTruncation(1, attributes); }; static int rpn2cql_simple(cql_transform_t ct, diff --git a/src/rpn2solr.c b/src/rpn2solr.c index 6390ebb..89b8b91 100644 --- a/src/rpn2solr.c +++ b/src/rpn2solr.c @@ -184,7 +184,10 @@ static int checkForTruncation(int flag, Z_AttributeList *attributes) if (truncation <= 3) return ((int) truncation & flag); } - /* Complex: Shouldn't happen */ + else if (ae->which == Z_AttributeValue_complex) { + //yaz_log(YLOG_DEBUG, "Z_Attribute_complex"); + /* Complex: Shouldn't happen */ + } } } /* No truncation or unsupported */ @@ -192,11 +195,11 @@ static int checkForTruncation(int flag, Z_AttributeList *attributes) }; static int checkForLeftTruncation(Z_AttributeList *attributes) { - return checkForTruncation(1, attributes); + return checkForTruncation(2, attributes); } static int checkForRightTruncation(Z_AttributeList *attributes) { - return checkForTruncation(2, attributes); + return checkForTruncation(1, attributes); }; static int rpn2solr_simple(solr_transform_t ct, diff --git a/test/test_rpn2cql.c b/test/test_rpn2cql.c index cb2dacb..bdb4972 100644 --- a/test/test_rpn2cql.c +++ b/test/test_rpn2cql.c @@ -82,15 +82,19 @@ static void tst2(void) YAZ_CHECK(compare(ct, "@attr 1=4 abc", "dc.title=abc")); YAZ_CHECK(compare(ct, "@attr 1=4 @attr 4=108 abc", "dc.title=/exact abc")); YAZ_CHECK(compare(ct, "@attr 1=4 @attr 3=1 @attr 6=1 abc", "dc.title=abc")); - YAZ_CHECK(compare(ct, "@attr 1=4 @attr 4=1 @attr 6=1 abc", - "dc.title=abc")); + YAZ_CHECK(compare(ct, "@attr 1=4 @attr 4=1 @attr 6=1 abc", "dc.title=abc")); YAZ_CHECK(compare(ct, "@attr 1=1016 abc", "abc")); + /* Date tests */ YAZ_CHECK(compare(ct, "@attr 2=1 @attr 1=30 1980", "dc.date<1980")); YAZ_CHECK(compare(ct, "@attr 1=30 @attr 2=3 1980", "dc.date=1980")); YAZ_CHECK(compare(ct, "@attr 1=30 @attr 2=5 1980", "dc.date>1980")); YAZ_CHECK(compare(ct, "@attr 1=30 @attr 2=2 1980", "dc.date<=1980")); YAZ_CHECK(compare(ct, "@attr 1=30 @attr 2=4 1980", "dc.date>=1980")); - + /* Truncation */ + YAZ_CHECK(compare(ct, "@attr 5=1 water", "water*")); + YAZ_CHECK(compare(ct, "@attr 5=2 water", "*water")); + YAZ_CHECK(compare(ct, "@attr 5=3 water", "*water*")); + /* Other */ YAZ_CHECK(compare(ct, "@attr 2=103 @attr 1=_ALLRECORDS 1", "cql.allRecords=1")); YAZ_CHECK(compare(ct, "@attr 1=500 abc", 0)); cql_transform_close(ct); diff --git a/test/test_rpn2solr.c b/test/test_rpn2solr.c index a5956dd..1fc1695 100644 --- a/test/test_rpn2solr.c +++ b/test/test_rpn2solr.c @@ -70,6 +70,12 @@ static void tst1(void) solr_transform_define_pattern(ct, "index.foo", "1=bar"); YAZ_CHECK(compare(ct, "@attr 1=bar abc", "foo:abc")); + + /* Truncation */ + YAZ_CHECK(compare(ct, "@attr 5=1 water", "water*")); + YAZ_CHECK(compare(ct, "@attr 5=2 water", "*water")); + YAZ_CHECK(compare(ct, "@attr 5=3 water", "*water*")); + /* YAZ_CHECK(compare(ct, "@or @attr 1=1016 water @attr 7=1 @attr 1=4 0", "any:water rank:??"); */ diff --git a/win/makefile b/win/makefile index b850872..05269e8 100644 --- a/win/makefile +++ b/win/makefile @@ -52,9 +52,12 @@ dist: yaz.win32.nsi yaz.nsi distclean $(NSIS) yaz.win32.nsi dist64: yaz.win64.nsi yaz.nsi distclean - nmake DEBUG=0 HAVE_LIBXSLT=1 HAVE_LIBXML2=1 HAVE_ICONV=0 HAVE_ICU=1 LIBXML2_DIR=c:\libxml2-2.7.8.win64 LIBXSLT_DIR=c:\libxslt-1.1.26.win64 ICU_LIB=\icu64\lib64 ICU_INCLUDE=\icu64\include ICU_BIN=\icu64\bin64 + nmake make64 $(NSIS) yaz.win64.nsi +make64: + nmake DEBUG=0 HAVE_LIBXSLT=1 HAVE_LIBXML2=1 HAVE_ICONV=0 HAVE_ICU=1 LIBXML2_DIR=c:\libxml2-2.7.8.win64 LIBXSLT_DIR=c:\libxslt-1.1.26.win64 ICU_LIB=\icu64\lib64 ICU_INCLUDE=\icu64\include ICU_BIN=\icu64\bin64 + distclean: nmake DEBUG=1 clean nmake DEBUG=0 clean diff --git a/win/yaz.nsi b/win/yaz.nsi index be73f62..9e45f74 100644 --- a/win/yaz.nsi +++ b/win/yaz.nsi @@ -37,7 +37,6 @@ ComponentText "This will install the YAZ Toolkit on your computer:" InstType "Full (w/ Source)" InstType "Lite (w/o Source)" -InstallDir "$PROGRAMFILES\YAZ" InstallDirRegKey HKLM "SOFTWARE\Index Data\YAZ" "" diff --git a/win/yaz.win32.nsi b/win/yaz.win32.nsi index dfa475c..15c3843 100644 --- a/win/yaz.win32.nsi +++ b/win/yaz.win32.nsi @@ -2,5 +2,7 @@ !define VS_RUNTIME_DLL "c:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\msvc*90.dll" !define VS_RUNTIME_MANIFEST "c:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest" +InstallDir "$PROGRAMFILES\YAZ" + !include yaz.nsi diff --git a/win/yaz.win64.nsi b/win/yaz.win64.nsi index c2be7d4..63208ba 100644 --- a/win/yaz.win64.nsi +++ b/win/yaz.win64.nsi @@ -2,5 +2,7 @@ !define VS_RUNTIME_DLL "c:\Program Files\Microsoft Visual Studio 9.0\VC\redist\amd64\Microsoft.VC90.CRT\msvc*90.dll" !define VS_RUNTIME_MANIFEST "c:\Program Files\Microsoft Visual Studio 9.0\VC\redist\amd64\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest" +InstallDir "$PROGRAMFILES64\YAZ" + !include yaz.nsi