提交 0d532981 authored 作者: Noel Grandin's avatar Noel Grandin 提交者: GitHub

Merge pull request #412 from ebocher/addOrderBySpatialTest

About #385 
......@@ -21,6 +21,8 @@ Change Log
<h2>Next Version (unreleased)</h2>
<ul>
<li>Add a test case to ensure that spatial index is used with and order by command by Fortin N
</li>
<li>Fix multi-threaded mode update exception "NullPointerException", test case by Anatolii K
</li>
<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 }
| IS [ NOT ] [ DISTINCT FROM ] operand
| BETWEEN operand AND operand
| IN ( { select | expression [,...] } )
| [ NOT ] LIKE operand [ ESCAPE string ]
| [ NOT ] [ LIKE | ILIKE ] operand [ ESCAPE string ]
| [ NOT ] REGEXP operand
","
The right hand side of a condition."
......@@ -947,6 +947,11 @@ Calculate the angle when converting the rectangular coordinates to polar coordin
BITAND(long, long)
","
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","
BITOR(long, long)
","
......
......@@ -94,6 +94,7 @@ public class TestSpatial extends TestBase {
testNullableGeometryUpdate();
testIndexUpdateNullGeometry();
testInsertNull();
testSpatialIndexWithOrder();
}
private void testBug1() throws SQLException {
......@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论