提交 288e4846 authored 作者: ebocher's avatar ebocher

Add test for spatial index

上级 3f5cad84
...@@ -21,6 +21,8 @@ Change Log ...@@ -21,6 +21,8 @@ Change Log
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul> <ul>
<li>Add a test case to ensure that spatial index is used with and order by command, by Bocher E
</li>
<li>Fix multi-threaded mode update exception "NullPointerException", test case by Anatolii K <li>Fix multi-threaded mode update exception "NullPointerException", test case by Anatolii K
</li> </li>
<li>Fix multi-threaded mode insert exception "Unique index or primary key violation", test case by Anatolii K <li>Fix multi-threaded mode insert exception "Unique index or primary key violation", test case by Anatolii K
......
...@@ -577,7 +577,7 @@ compare { { { ALL | ANY | SOME } ( select ) } | operand } ...@@ -577,7 +577,7 @@ compare { { { ALL | ANY | SOME } ( select ) } | operand }
| IS [ NOT ] [ DISTINCT FROM ] operand | IS [ NOT ] [ DISTINCT FROM ] operand
| BETWEEN operand AND operand | BETWEEN operand AND operand
| IN ( { select | expression [,...] } ) | IN ( { select | expression [,...] } )
| [ NOT ] LIKE operand [ ESCAPE string ] | [ NOT ] [ LIKE | ILIKE ] operand [ ESCAPE string ]
| [ NOT ] REGEXP operand | [ NOT ] REGEXP operand
"," ","
The right hand side of a condition." The right hand side of a condition."
...@@ -947,6 +947,11 @@ Calculate the angle when converting the rectangular coordinates to polar coordin ...@@ -947,6 +947,11 @@ Calculate the angle when converting the rectangular coordinates to polar coordin
BITAND(long, long) BITAND(long, long)
"," ","
The bitwise AND operation." The bitwise AND operation."
"Functions (Numeric)","BITGET","
BITGET(long, int)
","
Returns true if and only if the first parameter has a bit set in the
position specified by the second parameter."
"Functions (Numeric)","BITOR"," "Functions (Numeric)","BITOR","
BITOR(long, long) BITOR(long, long)
"," ","
......
...@@ -94,6 +94,7 @@ public class TestSpatial extends TestBase { ...@@ -94,6 +94,7 @@ public class TestSpatial extends TestBase {
testNullableGeometryUpdate(); testNullableGeometryUpdate();
testIndexUpdateNullGeometry(); testIndexUpdateNullGeometry();
testInsertNull(); testInsertNull();
testSpatialIndexWithOrder();
} }
private void testBug1() throws SQLException { private void testBug1() throws SQLException {
...@@ -1138,4 +1139,21 @@ public class TestSpatial extends TestBase { ...@@ -1138,4 +1139,21 @@ public class TestSpatial extends TestBase {
} }
} }
private void testSpatialIndexWithOrder() throws SQLException {
deleteDb("spatial");
Connection conn = getConnection(URL);
Statement stat = conn.createStatement();
stat.execute("DROP TABLE IF EXISTS BUILDINGS;" +
"CREATE TABLE BUILDINGS (PK serial, THE_GEOM geometry);" +
"insert into buildings(the_geom) SELECT 'POINT(1 1)" +
"'::geometry from SYSTEM_RANGE(1,10000);\n" +
"CREATE SPATIAL INDEX ON PUBLIC.BUILDINGS(THE_GEOM);\n");
try (ResultSet rs = stat.executeQuery("EXPLAIN SELECT * FROM " +
"BUILDINGS ORDER BY PK LIMIT 51;")) {
assertTrue(rs.next());
assertTrue(rs.getString(1).contains("PRIMARY_KEY"));
}
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论