Files
dolt/integration-tests/bats/spatial-index.bats
2023-05-24 15:23:02 -07:00

24 lines
604 B
Bash

#!/usr/bin/env bats
load $BATS_TEST_DIRNAME/helper/common.bash
setup() {
setup_common
}
teardown() {
assert_feature_version
teardown_common
}
@test "spatial-index: spatial indexes enabled" {
run dolt sql -q "create table t (p point srid 0 not null, spatial index(p))"
[ "$status" -eq 0 ]
}
@test "spatial-index: not supported in old format" {
rm -rf .dolt
dolt init --old-format
run dolt sql -q "create table t (p point srid 0 not null, spatial index(p))"
[ "$status" -eq 1 ]
[[ "$output" =~ "spatial indexes are only supported in storage format" ]] || false
}