Package: postgresql-9.1-prefix Version: 1.1.1-1 Severity: important Tags: upstream
Hello I think I found a bug in you prefix extension. Using the test data from the source code, there is reproducible situation where a query stops delivering results just because I add a gist index for it! -- First prepare the database as described in the source codes TESTS.txt. -- The below should be symetrical as both <@ and @> list each other as COMMUTATOR. -- But there is no variant that gives the same output as "prefix <@ CONST" even -- though to my understanding "CONST @> prefix" is supposed to: test_prefix_orig=# SELECT * FROM ranges WHERE prefix <@ '01000'; prefix | name | shortname | state --------+------------------------------------------------------------+-----------+------- 010001 | COLT TELECOMMUNICATIONS FRANCE | COLT | S 010002 | EQUANT France | EQFR | S 010003 | NUMERICABLE | NURC | S 010004 | PROSODIE | PROS | S 010005 | INTERNATIONAL TELECOMMUNICATION NETWORK France (Vivaction) | ITNF | S 010006 | SOCIETE FRANCAISE DU RADIOTELEPHONE | SFR | S 010007 | SOCIETE FRANCAISE DU RADIOTELEPHONE | SFR | S 010008 | BJT PARTNERS | BJTP | S 010009 | LONG PHONE | LGPH | S (9 rows) test_prefix_orig=# SELECT * FROM ranges WHERE prefix @> '01000'; (0 rows) test_prefix_orig=# SELECT * FROM ranges WHERE '01000' <@ prefix; (0 rows) test_prefix_orig=# SELECT * FROM ranges WHERE '01000' @> prefix; (0 rows) test_prefix_orig=# SELECT * FROM ranges WHERE '010009888' @> prefix; (0 rows) test_prefix_orig=# SELECT * FROM ranges WHERE '010009888' <@ prefix; prefix | name | shortname | state --------+------------+-----------+------- 010009 | LONG PHONE | LGPH | S (1 row) test_prefix_orig=# SELECT * FROM ranges WHERE prefix @> '010009888'; prefix | name | shortname | state --------+------------+-----------+------- 010009 | LONG PHONE | LGPH | S (1 row) test_prefix_orig=# SELECT * FROM ranges WHERE prefix <@ '010009888'; (0 rows) -- -- Let's see if the index is causing the problem: -- test_prefix_orig=# DROP INDEX idx_prefix; DROP INDEX test_prefix_orig=# SELECT * FROM ranges WHERE '01000' @> prefix; prefix | name | shortname | state --------+------------------------------------------------------------+-----------+------- 010001 | COLT TELECOMMUNICATIONS FRANCE | COLT | S 010002 | EQUANT France | EQFR | S 010003 | NUMERICABLE | NURC | S 010004 | PROSODIE | PROS | S 010005 | INTERNATIONAL TELECOMMUNICATION NETWORK France (Vivaction) | ITNF | S 010006 | SOCIETE FRANCAISE DU RADIOTELEPHONE | SFR | S 010007 | SOCIETE FRANCAISE DU RADIOTELEPHONE | SFR | S 010008 | BJT PARTNERS | BJTP | S 010009 | LONG PHONE | LGPH | S (9 rows) test_prefix_orig=# CREATE INDEX idx_prefix ON ranges USING gist (prefix); CREATE INDEX test_prefix_orig=# SELECT * FROM ranges WHERE '01000' @> prefix; prefix | name | shortname | state --------+------+-----------+------- (0 rows) -- System Information: Debian Release: wheezy/sid APT prefers testing APT policy: (500, 'testing') Architecture: i386 (i686) Kernel: Linux 3.2.0-3-686-pae (SMP w/2 CPU cores) Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages postgresql-9.1-prefix depends on: ii libc6 2.13-35 ii postgresql-9.1 9.1.5-2 postgresql-9.1-prefix recommends no packages. postgresql-9.1-prefix suggests no packages. -- no debconf information -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

