Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to H2 2.3.230 #1391

Merged
merged 6 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
- Add the name of the file in the FGB header
- Fix null way id on OSM file-
- Use new sonatype auth
- Add ST_SnapToSelf function
- Add ST_SnapToSelf function
- Upgrade to H2 2.3.230
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ public static void unRegisterFunction(Statement st, Function function) throws SQ
* @param connection JDBC Connection
* @param packagePrepend For OSGi environment only, use
* Bundle-SymbolicName:Bundle-Version:
* @throws SQLException
* @throws SQLException Throw an exception if the functions are not registered
*/
private static void registerH2GISFunctions(Connection connection, String packagePrepend) throws SQLException {
Statement st = connection.createStatement();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public String getJavaStaticMethod() {
/**
* Read the ASCII file.
*
* @param connection
* @param fileName
* @param connection input database connection
* @param fileName file to read
* @throws IOException
* @throws SQLException
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void remove(SessionLocal session, Row row) {
}

@Override
public Cursor find(SessionLocal session, SearchRow first, SearchRow last) {
public Cursor find(SessionLocal session, SearchRow first, SearchRow last, boolean b) {
return new DummyCursor();
}

Expand Down Expand Up @@ -106,7 +106,7 @@ public long getRowCountApproximation(SessionLocal session) {
}

@Override
public long getDiskSpaceUsed() {
public long getDiskSpaceUsed(boolean approximate) {
return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public long getRowCountApproximation(SessionLocal session) {
}

@Override
public long getDiskSpaceUsed() {
public long getDiskSpaceUsed(boolean total, boolean approximate) {
return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private void rebuild(SessionLocal session, Index index){
Index scan = getScanIndex(session);
long remaining = scan.getRowCount(session);
long total = remaining;
Cursor cursor = scan.find(session, null, null);
Cursor cursor = scan.find(session, null, null, false);
long i = 0;
int bufferSize = (int) Math.min(total, database.getMaxMemoryRows());
ArrayList<Row> buffer = new ArrayList<>(bufferSize);
Expand Down Expand Up @@ -287,7 +287,7 @@ public long getRowCountApproximation(SessionLocal session) {
}

@Override
public long getDiskSpaceUsed() {
public long getDiskSpaceUsed(boolean total, boolean approximate) {
return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void remove(SessionLocal session, Row row) {
}

@Override
public Cursor find(SessionLocal session, SearchRow first, SearchRow last) {
public Cursor find(SessionLocal session, SearchRow first, SearchRow last, boolean reverse) {
if (!isScanIndex) {
Row remakefirst = Row.get(null, 0);
if(first != null) {
Expand Down Expand Up @@ -177,7 +177,7 @@ public long getRowCountApproximation(SessionLocal session) {
}

@Override
public long getDiskSpaceUsed() {
public long getDiskSpaceUsed(boolean approximate) {
return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@

/**
* Abstract class for test classes.
* <p>
*
* This abstract class contains method to create a test database and give access to a {@link Statement} to perform SQL
* queries. To initiate the {@link Statement}, call the {@link BaseTest#statementInit()} or
* {@link BaseTest#statementInit(String)} method.
* <p>
* <p>
*
* This abstract class contains geometries of each kind :
* ┬─ POINT ─────────────────┬──┬─ (0 0) centered ─┬──┬─ 2D ─┬─
* ├─ LINESTRING ─────────────────┤ └─ not centered ─┘ ├─ 3D ─┤
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public class TestUtilities {

/**
* A basic utilities to print the column names and values
* @param res
* @throws SQLException
* @param res data to print
* @throws SQLException Table read error.
*/
public static void printValues(ResultSet res) throws SQLException {
List<String> columns = JDBCUtilities.getColumnNames(res.getMetaData());
Expand All @@ -42,8 +42,8 @@ public static void printValues(ResultSet res) throws SQLException {

/**
* A basic utilities to print the column informations
* @param res
* @throws SQLException
* @param res data to print
* @throws SQLException Table read error.
*/
public static void printColumns(ResultSet res) throws SQLException {
ResultSetMetaData metadata = res.getMetaData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ public void testReadPrecip() throws IOException, SQLException {
/**
* Test reading two time the same asc by pushing more lines
* asc files may be tiled, it is interesting to have a method to read all asc files into the same output table
* @throws IOException
* @throws SQLException
*/
@Test
public void testReadPrecipTwoTimes() throws IOException, SQLException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public void testReopenMovedDbf() throws Exception {

/**
* Read a DBF where the encoding is missing in header. Then write it with a good header. Then check the content.
* @throws SQLException
*
*/
@Test
public void readDBFRussianWrongEncodingThenWriteThenRead() throws SQLException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ public void importTableTestGeomEnd() throws SQLException, IOException {

/**
* Read a DBF where the encoding is missing in header.
* @throws SQLException
*/
@Test
public void readDBFRussianEncodingTest() throws SQLException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ public void downloadOSMFileAndImport() throws SQLException, IOException {
/**
* A method to test if the internet network is active.
*
* @return
*/
public static boolean IsNetworkAvailable() {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,7 @@ private static boolean hasIndex(Connection connection, TableLocation tableLocati
}

/**
* Check the call of special case {@link H2TableIndex#find(org.h2.engine.SessionLocal, org.h2.result.SearchRow, org.h2.result.SearchRow)} with null at first and last
* @throws SQLException
* Check the call of special case {@link H2TableIndex} with null at first and last
*/
@Test
public void readSHPOrderDataTest() throws SQLException {
Expand Down Expand Up @@ -405,8 +404,7 @@ public void readSHPOrderDataTest() throws SQLException {
}

/**
* Check the call of special case {@link H2TableIndex#find(org.h2.engine.SessionLocal, org.h2.result.SearchRow, org.h2.result.SearchRow)} with null at last part only.
* @throws SQLException
* Check the call of special case {@link H2TableIndex} with null at last part only.
*/
@Test
public void readSHPFilteredOrderDataTest() throws SQLException {
Expand Down Expand Up @@ -437,7 +435,6 @@ public void readSHPFilteredOrderDataTest() throws SQLException {
/**
* About #806
* Fix were a pk Index of linked table return a superior cost than spatial index.
* @throws SQLException
*/
@Test
public void linkedShpSpatialIndexFlatQueryTest() throws SQLException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,6 @@ public void testST_MakeGridFromGeometryLatLon3() throws Exception {
/**
* Test to create a regular square grid from a subquery
*
* @throws Exception
*/
@Test
public void testST_MakeGridFromSubquery1() throws Exception {
Expand Down Expand Up @@ -540,7 +539,6 @@ public void testST_MakeGridFromSubquery1() throws Exception {
/**
* Test to create a regular square grid from a complex subquery
*
* @throws Exception
*/
@Test
public void testST_MakeGridFromSubquery2() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,8 @@ public void test_ST_Transform_envelope() throws Exception {

/**
* Check the projected geometry using the POSTGIS EWKT style
* @param inputGeom
* @param expectedGeom
* @throws SQLException
* @param inputGeom input geometry
* @param expectedGeom expected geometry
*/
private void checkProjectedGeom(String inputGeom, String expectedGeom) throws SQLException {
int outPutSRID = ValueGeometry.get(expectedGeom).getSRID();
Expand All @@ -226,9 +225,8 @@ private void checkProjectedGeom(String inputGeom, String expectedGeom) throws SQ

/**
* Check the projected geometry using the POSTGIS EWKT style
* @param inputGeom
* @param expectedGeom
* @throws SQLException
* @param inputGeom input geometry
* @param expectedGeom expected geometry
*/
private void checkProjectedGeom(String inputGeom, String expectedGeom, double tolerance) throws SQLException {
int outPutSRID = ValueGeometry.get(expectedGeom).getSRID();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ public void testCheckSRID() throws SQLException {
st.execute("DROP TABLE IF EXISTS geotable; CREATE TABLE geotable (the_geom GEOMETRY); ");
ResultSet res = st.executeQuery(
"SELECT "
+ "GEOMETRY_SRID as srid, "
+ "GEOMETRY_SRID as srid "
+ " FROM INFORMATION_SCHEMA.COLUMNS"
+ " WHERE DATA_TYPE = 'GEOMETRY' and TABLE_NAME='GEOTABLE';");
assertTrue(res.next());
assertNull(res.getObject("SRID"));

res = st.executeQuery(
"SELECT "
+ "CASE WHEN GEOMETRY_SRID IS NULL THEN 0 ELSE GEOMETRY_SRID END as srid, "
+ "CASE WHEN GEOMETRY_SRID IS NULL THEN 0 ELSE GEOMETRY_SRID END as srid "
+ " FROM INFORMATION_SCHEMA.COLUMNS"
+ " WHERE DATA_TYPE = 'GEOMETRY' and TABLE_NAME='GEOTABLE';");
assertTrue(res.next());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public static void tearUp() throws Exception {
/**
* For this test, we will check to see that all of the feature tables are
* represented by entries in the GEOMETRY_COLUMNS table/view.
* @throws Exception
*/
@Test
public void N1() throws Exception {
Expand All @@ -82,7 +81,6 @@ public void N1() throws Exception {
/**
* For this test, we will check to see that all of the geometry tables are
* represented by entries in the GEOMETRY_COLUMNS table/view.
* @throws Exception
*/
@Test
public void N2() throws Exception {
Expand All @@ -108,7 +106,6 @@ public void N2() throws Exception {
/**
* For this test, we will check to see that the correct storage type for
* the streams table is represented in the GEOMETRY_COLUMNS table/view.
* @throws Exception
*/
@Test
public void N3() throws Exception {
Expand All @@ -121,7 +118,6 @@ public void N3() throws Exception {
/**
* For this test, we will check to see that the correct geometry type for
* the streams table is represented in the GEOMETRY_COLUMNS table/view.
* @throws Exception
*/
@Test
public void N4() throws Exception {
Expand All @@ -134,7 +130,6 @@ public void N4() throws Exception {
/**
* For this test, we will check to see that the correct coordinate dimension for
* the streams table is represented in the GEOMETRY_COLUMNS table/view.
* @throws Exception
*/
@Test
public void N5() throws Exception {
Expand All @@ -147,7 +142,6 @@ public void N5() throws Exception {
/**
* For this test, we will check to see that the correct value of max_ppr
* for the streams table is represented in the GEOMETRY_COLUMNS table/view.
* @throws Exception
*/
@Test
public void N6() throws Exception {
Expand All @@ -160,7 +154,6 @@ public void N6() throws Exception {
/**
* For this test, we will check to see that the correct value of srid for
* the streams table is represented in the GEOMETRY_COLUMNS table/view.
* @throws Exception
*/
@Test
public void N7() throws Exception {
Expand All @@ -173,7 +166,6 @@ public void N7() throws Exception {
/**
* For this test, we will check to see that the correct value of srtext is
* represented in the SPATIAL_REF_SYS table/view.
* @throws Exception
*/
@Test
public void N8() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public static void tearUp() throws Exception {
/**
* For this test, we will check to see that all of the feature tables are
* represented by entries in the GEOMETRY_COLUMNS table/view.
* @throws Exception
*/
@Test
public void B1() throws Exception {
Expand All @@ -84,7 +83,6 @@ public void B1() throws Exception {
/**
* For this test, we will check to see that all of the geometry tables are
* represented by entries in the GEOMETRY_COLUMNS table/view.
* @throws Exception
*/
@Test
public void B2() throws Exception {
Expand All @@ -110,7 +108,6 @@ public void B2() throws Exception {
/**
* For this test, we will check to see that the correct storage type for
* the streams table is represented in the GEOMETRY_COLUMNS table/view.
* @throws Exception
*/
@Test
public void B3() throws Exception {
Expand All @@ -123,7 +120,6 @@ public void B3() throws Exception {
/**
* For this test, we will check to see that the correct geometry type for
* the streams table is represented in the GEOMETRY_COLUMNS table/view.
* @throws Exception
*/
@Test
public void B4() throws Exception {
Expand All @@ -136,7 +132,6 @@ public void B4() throws Exception {
/**
* For this test, we will check to see that the correct coordinate dimension for
* the streams table is represented in the GEOMETRY_COLUMNS table/view.
* @throws Exception
*/
@Test
public void B5() throws Exception {
Expand All @@ -149,7 +144,6 @@ public void B5() throws Exception {
/**
* For this test, we will check to see that the correct value of srid for
* the streams table is represented in the GEOMETRY_COLUMNS table/view.
* @throws Exception
*/
@Test
public void B6() throws Exception {
Expand All @@ -162,7 +156,6 @@ public void B6() throws Exception {
/**
* For this test, we will check to see that the correct value of srtext is
* represented in the SPATIAL_REF_SYS table/view.
* @throws Exception
*/
@Test
public void B7() throws Exception {
Expand Down
Loading
Loading