Spatter is a tool for finding Spatial related bugs in Spatial DBMS using Shape-Preserving Transformation.
- PostGIS
- MySQL
- DuckDB
- Make sure the docker name and port, for example:
docker_name=postgis-spatter
docker_port=15450
- Create a docker
cd src/postgis
./init-docker/start-docker.sh ${docker_name} ${docker_port}
- Install necessary dependancy
docker exec ${docker_name} sh -c "apt-get install -y bison flex cmake autoconf libtool libxml2-dev"
docker exec ${docker_name} sh -c "apt-get install -y libproj-dev libcunit1 libcunit1-doc libcunit1-dev lcov rsync"
docker exec ${docker_name} sh -c "pip install psycopg2-binary shapely "
- Copy postgis source code from "src/postgis/script/src-repo"
docker exec ${docker_name} sh -c "mv /script/src-repo/postgres-main /postgres"
docker exec ${docker_name} sh -c "mv /script/src-repo/geos-main /geos"
docker exec ${docker_name} sh -c "mv /script/src-repo/postgis-main /postgis"
Or choose the newest version of PostGIS through github:
docker exec ${docker_name} sh -c "git clone https://github.com/postgres/postgres.git || exit -1"
docker exec ${docker_name} sh -c "git clone https://github.com/libgeos/geos.git || exit -1"
docker exec ${docker_name} sh -c "git clone https://github.com/postgis/postgis.git || exit -1"
- Begin to compile
postgis_new='07a73c0f2'
geos_new='0a8fc37a9'
docker exec ${docker_name} sh /script/compile/compile.sh ${postgis_new} ${geos_new}
- Start postgres, create database, and create extension
./init-docker/prepare-psql.sh ${docker_name}
./init-docker/start-psql.sh ${docker_name}
- How to set parameter:
docker exec -it ${docker_name} sh -c "./script/SpatterRun.py -h"
- Run Spatter:
docker exec -it ${docker_name} sh -c "./script/SpatterRun.py"
- Reduce a single trigger case:
trigger_path=/log/trigger-cases/$(docker exec -it ${docker_name} sh -c "ls /log/trigger-cases/ | head -n 1")
docker exec -it ${docker_name} sh -c "./script/SpatterReduce.py ${trigger_path}"
- Make sure the docker name, for example:
docker_name=duckdb-spatter
- Create docker:
cd src/duckdb
./init-docker/start-docker.sh ${docker_name}
- Compile duckdb:
docker exec ${docker_name} sh /script/compile/compile.sh
- Run Spatter:
docker exec -it ${docker_name} sh -c "./script/SpatterRun.py"
- Reduce a single trigger case:
trigger_path=$(docker exec -it ${docker_name} sh -c 'echo /log/trigger-cases/* | cut -d" " -f1')
docker exec -it ${docker_name} sh -c "./script/SpatterReduce.py ${trigger_path}"
- Make sure the docker name, for example:
docker_name=mysql-spatter
docker_port=15451
- Create docker:
cd src/mysql
./init-docker/start-docker.sh ${docker_name} ${docker_port}
- Compile duckdb:
docker exec ${docker_name} sh /script/compile/compile.sh
- Start postgres, and create database:
./init-docker/start-mysql.sh ${docker_name}
- Run Spatter:
docker exec -it ${docker_name} sh -c "./script/SpatterRun.py"
- Reduce a Single Trigger Case:
trigger_path=$(docker exec -it ${docker_name} sh -c 'echo /log/trigger-cases/* | cut -d" " -f1')
docker exec -it ${docker_name} sh -c "./script/SpatterReduce.py ${trigger_path}"
- Run time distribution. Result and reproducing steps.
- Self-constructed baseline. Result and reproducing steps.