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

Merge pull request #774 from katzyn/misc

Assorted changes
*.bat eol=crlf
*.sh eol=lf
*.java diff=java
......@@ -43,19 +43,19 @@ import java.util.HashSet;
* @author Joel Turkel (Group sorted query)
*/
public class Select extends Query {
private TableFilter topTableFilter;
TableFilter topTableFilter;
private final ArrayList<TableFilter> filters = New.arrayList();
private final ArrayList<TableFilter> topFilters = New.arrayList();
private ArrayList<Expression> expressions;
ArrayList<Expression> expressions;
private Expression[] expressionArray;
private Expression having;
private Expression condition;
private int visibleColumnCount, distinctColumnCount;
int visibleColumnCount, distinctColumnCount;
private ArrayList<SelectOrderBy> orderList;
private ArrayList<Expression> group;
private int[] groupIndex;
private boolean[] groupByExpression;
private HashMap<Expression, Object> currentGroup;
int[] groupIndex;
boolean[] groupByExpression;
HashMap<Expression, Object> currentGroup;
private int havingIndex;
private boolean isGroupQuery, isGroupSortedQuery;
private boolean isForUpdate, isForUpdateMvcc;
......@@ -64,7 +64,7 @@ public class Select extends Query {
private boolean isPrepared, checkInit;
private boolean sortUsingIndex;
private SortOrder sort;
private int currentGroupRowId;
int currentGroupRowId;
public Select(Session session) {
super(session);
......@@ -164,7 +164,7 @@ public class Select extends Query {
return null;
}
private Value[] createGroupSortedRow(Value[] keyValues, int columnCount) {
Value[] createGroupSortedRow(Value[] keyValues, int columnCount) {
Value[] row = new Value[columnCount];
for (int j = 0; groupIndex != null && j < groupIndex.length; j++) {
row[groupIndex[j]] = keyValues[j];
......@@ -280,7 +280,7 @@ public class Select extends Query {
return count;
}
private boolean isConditionMet() {
boolean isConditionMet() {
return condition == null ||
Boolean.TRUE.equals(condition.getBooleanValue(session));
}
......@@ -640,7 +640,7 @@ public class Select extends Query {
return null;
}
private void resetJoinBatchAfterQuery() {
void resetJoinBatchAfterQuery() {
JoinBatch jb = getJoinBatch();
if (jb != null) {
jb.reset(false);
......
......@@ -59,8 +59,8 @@ public class SelectUnion extends Query {
public static final int INTERSECT = 3;
private int unionType;
private final Query left;
private Query right;
final Query left;
Query right;
private ArrayList<Expression> expressions;
private Expression[] expressionArray;
private ArrayList<SelectOrderBy> orderList;
......
......@@ -955,7 +955,7 @@ public class FullText {
}
}
private static boolean isMultiThread(Connection conn)
static boolean isMultiThread(Connection conn)
throws SQLException {
try (Statement stat = conn.createStatement()) {
ResultSet rs = stat.executeQuery(
......
......@@ -581,7 +581,7 @@ public class FullTextLucene extends FullText {
/**
* Commit all changes to the Lucene index.
*/
private void commitIndex() throws SQLException {
void commitIndex() throws SQLException {
try {
indexAccess.commit();
} catch (IOException e) {
......@@ -697,18 +697,18 @@ public class FullTextLucene extends FullText {
*/
private IndexSearcher searcher;
private IndexAccess(IndexWriter writer) throws IOException {
IndexAccess(IndexWriter writer) throws IOException {
this.writer = writer;
IndexReader reader = IndexReader.open(writer, true);
searcher = new IndexSearcher(reader);
}
private synchronized IndexSearcher getSearcher() {
synchronized IndexSearcher getSearcher() {
++counter;
return searcher;
}
private synchronized void returnSearcher(IndexSearcher searcher) {
synchronized void returnSearcher(IndexSearcher searcher) {
if (this.searcher == searcher) {
--counter;
assert counter >= 0;
......
......@@ -43,7 +43,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
/**
* The multi-value table.
*/
private final MVTable mvTable;
final MVTable mvTable;
private final int keyColumns;
private final TransactionMap<Value,Value> dataMap;
......@@ -85,7 +85,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
private static final class Source {
private final Iterator<ValueArray> iterator;
private ValueArray currentRowData;
ValueArray currentRowData;
public Source(Iterator<ValueArray> iterator) {
this.iterator = iterator;
......@@ -338,7 +338,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
* @param key the index key
* @return the row
*/
private SearchRow convertToSearchRow(ValueArray key) {
SearchRow convertToSearchRow(ValueArray key) {
Value[] array = key.getList();
SearchRow searchRow = mvTable.getTemplateRow();
searchRow.setKey((array[array.length - 1]).getLong());
......@@ -481,7 +481,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
private SearchRow searchRow;
private Row row;
private MVStoreCursor(Session session, Iterator<Value> it, SearchRow last) {
MVStoreCursor(Session session, Iterator<Value> it, SearchRow last) {
this.session = session;
this.it = it;
this.last = last;
......
......@@ -896,7 +896,7 @@ public class TransactionStore {
*/
final MVMap<K, VersionedValue> map;
private final Transaction transaction;
final Transaction transaction;
TransactionMap(Transaction transaction, MVMap<K, VersionedValue> map,
int mapId) {
......
......@@ -24,7 +24,6 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
import java.util.TimeZone;
import org.h2.engine.Constants;
import org.h2.engine.SysProperties;
import org.h2.message.DbException;
......
......@@ -497,6 +497,7 @@ public class Column {
}
}
buff.append(')');
break;
case Value.BYTES:
case Value.STRING:
case Value.STRING_IGNORECASE:
......
......@@ -205,7 +205,7 @@ public class MathUtils {
* @param s the message to print
* @param t the stack trace
*/
private static void warn(String s, Throwable t) {
static void warn(String s, Throwable t) {
// not a fatal problem, but maybe reduced security
System.out.println("Warning: " + s);
if (t != null) {
......
......@@ -914,7 +914,7 @@ public class ToChar {
* @return the capitalization / casing strategy which should be used
* when the first and second letters have the specified casing
*/
private static Capitalization toCapitalization(Boolean up1, Boolean up2) {
static Capitalization toCapitalization(Boolean up1, Boolean up2) {
if (up1 == null) {
return Capitalization.CAPITALIZE;
} else if (up2 == null) {
......
......@@ -15,7 +15,7 @@ import java.util.Comparator;
*/
public class CharsetCollator extends Collator {
private static final Comparator<byte[]> COMPARATOR = new Comparator<byte[]>() {
static final Comparator<byte[]> COMPARATOR = new Comparator<byte[]>() {
@Override
public int compare(byte[] b1, byte[] b2) {
int minLength = Math.min(b1.length, b2.length);
......@@ -43,7 +43,7 @@ public class CharsetCollator extends Collator {
return COMPARATOR.compare(toBytes(source), toBytes(target));
}
private byte[] toBytes(String source) {
byte[] toBytes(String source) {
return source.getBytes(charset);
}
......
......@@ -985,6 +985,7 @@ public abstract class Value {
if (DataType.isGeometry(object)) {
return ValueGeometry.getFromGeometry(object);
}
//$FALL-THROUGH$
case TIMESTAMP_TZ:
throw DbException.get(
ErrorCode.DATA_CONVERSION_ERROR_1, getString());
......
......@@ -5,6 +5,7 @@
*/
package org.h2.test.db;
import org.h2.engine.SysProperties;
import org.h2.test.TestBase;
/**
......@@ -32,8 +33,14 @@ public class TestPersistentCommonTableExpressions extends AbstractBaseForCommonT
}
private void testRecursiveTable() throws Exception {
String numericName;
if (SysProperties.BIG_DECIMAL_IS_DECIMAL) {
numericName = "DECIMAL";
} else {
numericName = "NUMERIC";
}
String[] expectedRowData = new String[]{"|meat|null", "|fruit|3", "|veg|2"};
String[] expectedColumnTypes = new String[]{"VARCHAR", "DECIMAL"};
String[] expectedColumnTypes = new String[]{"VARCHAR", numericName};
String[] expectedColumnNames = new String[]{"VAL",
"SUM(SELECT\n" +
" X\n" +
......
......@@ -156,7 +156,6 @@ public class TestSetCollation extends TestBase {
private List<String> orderedWithCollator(String collator) throws SQLException {
deleteDb(DB_NAME);
try (Connection con = getConnection(DB_NAME); Statement statement = con.createStatement()) {
;
if (collator != null) {
statement.execute("SET COLLATION " + collator);
}
......
......@@ -439,12 +439,12 @@ public class TestCustomDataTypesHandler extends TestBase {
/**
* Real part
*/
private double re;
double re;
/**
* Imaginary part
*/
private double im;
double im;
/**
* @param re real part
......
......@@ -111,6 +111,9 @@ public class TestMvccMultiThreaded2 extends TestBase {
public int iterationsProcessed;
SelectForUpdate() {
}
@Override
public void run() {
final long start = System.currentTimeMillis();
......
......@@ -656,7 +656,7 @@ public class ArchiveTool {
}
}
int[] key = new int[4];
; // TODO test if cs makes a difference
// TODO test if cs makes a difference
key[0] = (int) (min >>> 32);
key[1] = (int) min;
key[2] = cs;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论