Unverified 提交 e2742465 authored 作者: Noel Grandin's avatar Noel Grandin 提交者: GitHub

Merge pull request #820 from katzyn/warnings

Fix some compiler warnings
......@@ -4006,8 +4006,10 @@ public class Parser {
case '#':
if (database.getMode().supportPoundSymbolForColumnNames) {
type = CHAR_NAME;
break;
} else {
type = CHAR_SPECIAL_1;
}
break;
default:
if (c >= 'a' && c <= 'z') {
if (identifiersToUpper) {
......
......@@ -1483,7 +1483,7 @@ public class Select extends Query {
Value[] row = new Value[columnCount];
for (int i = 0; i < columnCount; i++) {
Expression expr = expressions.get(i);
row[i] = expr.getValue(session);
row[i] = expr.getValue(getSession());
}
return row;
}
......@@ -1521,7 +1521,7 @@ public class Select extends Query {
for (int i = 0; i < groupIndex.length; i++) {
int idx = groupIndex[i];
Expression expr = expressions.get(idx);
keyValues[i] = expr.getValue(session);
keyValues[i] = expr.getValue(getSession());
}
Value[] row = null;
......@@ -1538,7 +1538,7 @@ public class Select extends Query {
for (int i = 0; i < columnCount; i++) {
if (groupByExpression == null || !groupByExpression[i]) {
Expression expr = expressions.get(i);
expr.updateAggregate(session);
expr.updateAggregate(getSession());
}
}
if (row != null) {
......
......@@ -919,17 +919,18 @@ public class PgServerThread implements Runnable {
private void initDb() throws SQLException {
Statement stat = null;
ResultSet rs = null;
try {
synchronized (server) {
// better would be: set the database to exclusive mode
rs = conn.getMetaData().getTables(null, "PG_CATALOG", "PG_VERSION", null);
boolean tableFound = rs.next();
boolean tableFound;
try (ResultSet rs = conn.getMetaData().getTables(null, "PG_CATALOG", "PG_VERSION", null)) {
tableFound = rs.next();
}
stat = conn.createStatement();
if (!tableFound) {
installPgCatalog(stat);
}
rs = stat.executeQuery("select * from pg_catalog.pg_version");
try (ResultSet rs = stat.executeQuery("select * from pg_catalog.pg_version")) {
if (!rs.next() || rs.getInt(1) < 2) {
// installation incomplete, or old version
installPgCatalog(stat);
......@@ -941,17 +942,18 @@ public class PgServerThread implements Runnable {
}
}
}
}
stat.execute("set search_path = PUBLIC, pg_catalog");
HashSet<Integer> typeSet = server.getTypeSet();
if (typeSet.size() == 0) {
rs = stat.executeQuery("select oid from pg_catalog.pg_type");
try (ResultSet rs = stat.executeQuery("select oid from pg_catalog.pg_type")) {
while (rs.next()) {
typeSet.add(rs.getInt(1));
}
}
}
} finally {
JdbcUtils.closeSilently(stat);
JdbcUtils.closeSilently(rs);
}
}
......
......@@ -956,7 +956,7 @@ public abstract class TestBase {
* @param condition the condition
* @throws AssertionError if the condition is false
*/
protected void assertTrue(String message, boolean condition) {
public void assertTrue(String message, boolean condition) {
if (!condition) {
fail(message);
}
......@@ -1058,7 +1058,7 @@ public abstract class TestBase {
*
* @param stat the statement
*/
protected void execute(PreparedStatement stat) throws SQLException {
public void execute(PreparedStatement stat) throws SQLException {
execute(stat, null);
}
......@@ -1651,7 +1651,10 @@ public abstract class TestBase {
throw (E) e;
}
protected String getTestName() {
/**
* @return the name of the test class
*/
public String getTestName() {
return getClass().getSimpleName();
}
......
......@@ -389,7 +389,7 @@ public class TestPgServer extends TestBase {
}
}
private void testBinaryTypes() throws SQLException, InterruptedException {
private void testBinaryTypes() throws SQLException {
if (!getPgJdbcDriver()) {
return;
}
......@@ -464,7 +464,7 @@ public class TestPgServer extends TestBase {
}
}
private void testDateTime() throws SQLException, InterruptedException {
private void testDateTime() throws SQLException {
if (!getPgJdbcDriver()) {
return;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论