Ticket #23 (assigned feature request)
tsp abnormal source_id and ids case
Reported by: | nagase | Owned by: | anton |
---|---|---|---|
Priority: | major | Milestone: | Version 1.2 |
Component: | TSP | Version: | |
Keywords: | error handling | Cc: |
Description
I did test pgRouting tsp function for the project(because routing web service, various input expected), but some critical bug occurred, so please check the cases as follows.
[Environment]
OS:CentOS 4.4
PostgreSQL:8.1.4
pgRouting:1.0.0b (with cgal & gaul)
[Data]
kanagawa(from http://files.orkney.jp/pgrouting/sample/pgRouting-sampleapp.tar.bz)
[Test Case] *over 188000 id means not exist in database.
1. normal
SELECT COUNT(*) FROM tsp('SELECT DISTINCT source::integer AS source_id, x1::double precision AS x, y1::double precision AS y FROM kanagawa WHERE source IN (125513,7731,17838,76309,124369)', '125513,7731,17838,76309,124369', '125513');
=> 5(1 row)
2. abnormal(ids count is 3)
SELECT COUNT(*) FROM tsp('SELECT DISTINCT source::integer AS source_id, x1::double precision AS x, y1::double precision AS y FROM kanagawa WHERE source IN (125513,7731,17838)', '125513,7731,17838', '125513');
=> server closed the connection unexpectedly...
3. abnormal(ids count is 2)
SELECT COUNT(*) FROM tsp('SELECT DISTINCT source::integer AS source_id, x1::double precision AS x, y1::double precision AS y FROM kanagawa WHERE source IN (125513,7731)', '125513,7731', '125513');
=> CPU 100% (It seems that infinite loop occurred)
4. abnormal(ids count is 1)
SELECT COUNT(*) FROM tsp('SELECT DISTINCT source::integer AS source_id, x1::double precision AS x, y1::double precision AS y FROM kanagawa WHERE source IN (125513)', '125513', '125513');
=> CPU 100% (It seems that infinite loop occurred)
5. abnormal(all source_id is the same)
SELECT COUNT(*) FROM tsp('SELECT DISTINCT source::integer AS source_id, x1::double precision AS x, y1::double precision AS y FROM kanagawa WHERE source IN (7731,7731,7731,7731,7731)', '7731,7731,7731,7731,7731', '7731');
=> CPU 100% (It seems that infinite loop occurred)
6. abnormal(not exist source_id)
SELECT COUNT(*) FROM tsp('SELECT DISTINCT source::integer AS source_id, x1::double precision AS x, y1::double precision AS y FROM kanagawa WHERE source IN (188000,7731,17838,76309,124369)', '188000,7731,17838,76309,124369', '188000');
=> server closed the connection unexpectedly...
7. abnormal(include not exist source in ids)
SELECT COUNT(*) FROM tsp('SELECT DISTINCT source::integer AS source_id, x1::double precision AS x, y1::double precision AS y FROM kanagawa WHERE source IN (7731,17838,76309,124369,188000)', '7731,17838,76309,124369,188000', '7731');
=> 4(1 row)
8. abnormal(include not exist source in ids)
SELECT COUNT(*) FROM tsp('SELECT DISTINCT source::integer AS source_id, x1::double precision AS x, y1::double precision AS y FROM kanagawa WHERE source IN (7731,17838,76309,188001,188000)', '7731,17838,76309,188001,188000', '7731');
=> server closed the connection unexpectedly...
9. abnormal(include not exist source in ids)
SELECT COUNT(*) FROM tsp('SELECT DISTINCT source::integer AS source_id, x1::double precision AS x, y1::double precision AS y FROM kanagawa WHERE source IN (7731,17838,188002,188001,188000)', '7731,17838,188002,188001,188000', '7731');
=> CPU 100% (It seems that infinite loop occurred)
10. abnormal(include not exist source in ids)
SELECT COUNT(*) FROM tsp('SELECT DISTINCT source::integer AS source_id, x1::double precision AS x, y1::double precision AS y FROM kanagawa WHERE source IN (7731,188003,188002,188001,188000)', '7731,188003,188002,188001,188000', '7731');
=> CPU 100% (It seems that infinite loop occurred)
11. abnormal(all source in ids and source_id not exist)
SELECT COUNT(*) FROM tsp('SELECT DISTINCT source::integer AS source_id, x1::double precision AS x, y1::double precision AS y FROM kanagawa WHERE source IN (188000,188001,188002,188003,188004)', '188000,188001,188002,188003,188004', '188000');
=> server closed the connection unexpectedly...