cql2pqf: refactor truncation handling and fix Z39.58 mode
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 30 Aug 2011 10:26:29 +0000 (12:26 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 30 Aug 2011 10:26:29 +0000 (12:26 +0200)
commit135a70856fc99547451ea919da242e7e7382acea
treeba3661c849f7667d94048590373ea3252eb3c3bd
parentc508282c3e52e145f998d0bb85c0ea6b36fe956c
cql2pqf: refactor truncation handling and fix Z39.58 mode

Refactor the CQL to PQF term code in cqltransform.c. Characters that
don't need escaping aren't and characters that do need escaping are.
For example CQL query a#a? must be handled as a Z39.58 mode query
because the trailing ? (single-character mask in CQL). But since the
generated term includes #, it must be escaped and survive the PQF parse,
thus the result is "\\#a#" (was "a#a# before). Also the CQL term a*3 now
produces "a?\\3" rather than "a?3" . This is becauase a?n has special
meaning in Z39.58. Characters that do need escaping are the PQF specials
" and \\. Rest are preseved and \-sequence in CQL are otherwise removed.
50 files changed:
src/cqltransform.c
test/cql2pqf/1.1.out
test/cql2pqf/1.2.out
test/cql2pqf/1.3.out
test/cql2pqf/2.1.out
test/cql2pqf/2.2.out
test/cql2pqf/3.1.out
test/cql2pqf/3.2.out
test/cql2pqf/3.3.out
test/cql2pqf/3.4.out
test/cql2pqf/3.5.out
test/cql2pqf/3.6.out
test/cql2pqf/3.7.out
test/cql2pqf/3.8.out
test/cql2pqf/3.9.out
test/cql2pqf/4.1.err [new file with mode: 0644]
test/cql2pqf/4.1.out [new file with mode: 0644]
test/cql2pqf/4.10.err [new file with mode: 0644]
test/cql2pqf/4.10.out [new file with mode: 0644]
test/cql2pqf/4.11.err [new file with mode: 0644]
test/cql2pqf/4.11.out [new file with mode: 0644]
test/cql2pqf/4.12.err [new file with mode: 0644]
test/cql2pqf/4.12.out [new file with mode: 0644]
test/cql2pqf/4.2.err [new file with mode: 0644]
test/cql2pqf/4.2.out [new file with mode: 0644]
test/cql2pqf/4.3.err [new file with mode: 0644]
test/cql2pqf/4.3.out [new file with mode: 0644]
test/cql2pqf/4.4.err [new file with mode: 0644]
test/cql2pqf/4.4.out [new file with mode: 0644]
test/cql2pqf/4.5.err [new file with mode: 0644]
test/cql2pqf/4.5.out [new file with mode: 0644]
test/cql2pqf/4.6.err [new file with mode: 0644]
test/cql2pqf/4.6.out [new file with mode: 0644]
test/cql2pqf/4.7.err [new file with mode: 0644]
test/cql2pqf/4.7.out [new file with mode: 0644]
test/cql2pqf/4.8.err [new file with mode: 0644]
test/cql2pqf/4.8.out [new file with mode: 0644]
test/cql2pqf/4.9.err [new file with mode: 0644]
test/cql2pqf/4.9.out [new file with mode: 0644]
test/cql2pqf/5.1.err [new file with mode: 0644]
test/cql2pqf/5.1.out [new file with mode: 0644]
test/cql2pqf/5.2.err [new file with mode: 0644]
test/cql2pqf/5.2.out [new file with mode: 0644]
test/cql2pqf/5.3.err [new file with mode: 0644]
test/cql2pqf/5.3.out [new file with mode: 0644]
test/cql2pqf/5.4.err [new file with mode: 0644]
test/cql2pqf/5.4.out [new file with mode: 0644]
test/cql2pqfsample
test/test_cql2pqf.sh
util/cql2pqf.c