提交 a2f52638 authored 作者: Thomas Mueller's avatar Thomas Mueller

Documentation

上级 060abfca
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -358,8 +358,8 @@ public class AlterTableAddConstraint extends SchemaCommand { ...@@ -358,8 +358,8 @@ public class AlterTableAddConstraint extends SchemaCommand {
for (IndexColumn col : cols) { for (IndexColumn col : cols) {
// all columns of the list must be part of the index, // all columns of the list must be part of the index,
// but not all columns of the index need to be part of the list // but not all columns of the index need to be part of the list
// holes are not allowed (index=a,b,c & list=a,b is ok; but list=a,c // holes are not allowed (index=a,b,c & list=a,b is ok;
// is not) // but list=a,c is not)
int idx = existingIndex.getColumnIndex(col.column); int idx = existingIndex.getColumnIndex(col.column);
if (idx < 0 || idx >= cols.length) { if (idx < 0 || idx >= cols.length) {
return false; return false;
......
...@@ -205,7 +205,7 @@ public class CreateTable extends SchemaCommand { ...@@ -205,7 +205,7 @@ public class CreateTable extends SchemaCommand {
"with a higher ID: " + t + "with a higher ID: " + t +
", this is currently not supported, " + ", this is currently not supported, " +
"as it would prevent the database from " + "as it would prevent the database from " +
"beeing re-opened"); "being re-opened");
} }
} }
} }
......
...@@ -1341,6 +1341,11 @@ public class MVStore { ...@@ -1341,6 +1341,11 @@ public class MVStore {
return true; return true;
} }
/**
* Compact by moving all chunks next to each other.
*
* @return if anything was written
*/
public synchronized boolean compactMoveChunks() { public synchronized boolean compactMoveChunks() {
return compactMoveChunks(Long.MAX_VALUE); return compactMoveChunks(Long.MAX_VALUE);
} }
...@@ -2467,8 +2472,8 @@ public class MVStore { ...@@ -2467,8 +2472,8 @@ public class MVStore {
} }
/** /**
* Get the estimated memory (in bytes) of unsaved data. If the value exceeds the * Get the estimated memory (in bytes) of unsaved data. If the value exceeds
* auto-commit memory, the changes are committed. * the auto-commit memory, the changes are committed.
* <p> * <p>
* The returned value is an estimation only. * The returned value is an estimation only.
* *
......
...@@ -222,6 +222,12 @@ public class Page { ...@@ -222,6 +222,12 @@ public class Page {
return p != null ? p : map.readPage(children[index]); return p != null ? p : map.readPage(children[index]);
} }
/**
* Get the position of the child.
*
* @param index the index
* @return the position
*/
public long getChildPagePos(int index) { public long getChildPagePos(int index) {
return children[index]; return children[index];
} }
......
...@@ -226,6 +226,8 @@ public class MVTableEngine implements TableEngine { ...@@ -226,6 +226,8 @@ public class MVTableEngine implements TableEngine {
/** /**
* Remove all temporary maps. * Remove all temporary maps.
*
* @param objectIds the ids of the objects to keep
*/ */
public void removeTemporaryMaps(BitField objectIds) { public void removeTemporaryMaps(BitField objectIds) {
for (String mapName : store.getMapNames()) { for (String mapName : store.getMapNames()) {
......
...@@ -155,8 +155,8 @@ CREATE AGGREGATE [ IF NOT EXISTS ] newAggregateName FOR className ...@@ -155,8 +155,8 @@ CREATE AGGREGATE [ IF NOT EXISTS ] newAggregateName FOR className
"," ","
Creates a new user-defined aggregate function." Creates a new user-defined aggregate function."
"Commands (DDL)","CREATE ALIAS"," "Commands (DDL)","CREATE ALIAS","
CREATE ALIAS [ IF NOT EXISTS ] newFunctionAliasName [ DETERMINISTIC ] [ NOBUFFER ] CREATE ALIAS [ IF NOT EXISTS ] newFunctionAliasName [ DETERMINISTIC ]
{ FOR classAndMethodName | AS sourceCodeString } [ NOBUFFER ] { FOR classAndMethodName | AS sourceCodeString }
"," ","
Creates a new function alias." Creates a new function alias."
"Commands (DDL)","CREATE CONSTANT"," "Commands (DDL)","CREATE CONSTANT","
...@@ -171,13 +171,14 @@ CREATE DOMAIN [ IF NOT EXISTS ] newDomainName AS dataType ...@@ -171,13 +171,14 @@ CREATE DOMAIN [ IF NOT EXISTS ] newDomainName AS dataType
Creates a new data type (domain)." Creates a new data type (domain)."
"Commands (DDL)","CREATE INDEX"," "Commands (DDL)","CREATE INDEX","
CREATE CREATE
{ [ UNIQUE ] [ HASH ] [ SPATIAL] INDEX [ [ IF NOT EXISTS ] newIndexName ] { [ UNIQUE ] [ HASH | SPATIAL] INDEX [ [ IF NOT EXISTS ] newIndexName ]
| PRIMARY KEY [ HASH ] } | PRIMARY KEY [ HASH ] }
ON tableName ( indexColumn [,...] ) ON tableName ( indexColumn [,...] )
"," ","
Creates a new index." Creates a new index."
"Commands (DDL)","CREATE LINKED TABLE"," "Commands (DDL)","CREATE LINKED TABLE","
CREATE [ FORCE ] [ [ GLOBAL | LOCAL ] TEMPORARY ] LINKED TABLE [ IF NOT EXISTS ] CREATE [ FORCE ] [ [ GLOBAL | LOCAL ] TEMPORARY ]
LINKED TABLE [ IF NOT EXISTS ]
name ( driverString, urlString, userString, passwordString, name ( driverString, urlString, userString, passwordString,
[ originalSchemaString, ] originalTableString ) [ EMIT UPDATES | READONLY ] [ originalSchemaString, ] originalTableString ) [ EMIT UPDATES | READONLY ]
"," ","
......
...@@ -90,11 +90,11 @@ public class ResultTempTable implements ResultExternal { ...@@ -90,11 +90,11 @@ public class ResultTempTable implements ResultExternal {
private void createIndex() { private void createIndex() {
IndexColumn[] indexCols = null; IndexColumn[] indexCols = null;
if (sort != null) { if (sort != null) {
int[] colInd = sort.getQueryColumnIndexes(); int[] colIndex = sort.getQueryColumnIndexes();
indexCols = new IndexColumn[colInd.length]; indexCols = new IndexColumn[colIndex.length];
for (int i = 0; i < colInd.length; i++) { for (int i = 0; i < colIndex.length; i++) {
IndexColumn indexColumn = new IndexColumn(); IndexColumn indexColumn = new IndexColumn();
indexColumn.column = table.getColumn(colInd[i]); indexColumn.column = table.getColumn(colIndex[i]);
indexColumn.sortType = sort.getSortTypes()[i]; indexColumn.sortType = sort.getSortTypes()[i];
indexColumn.columnName = COLUMN_NAME + i; indexColumn.columnName = COLUMN_NAME + i;
indexCols[i] = indexColumn; indexCols[i] = indexColumn;
......
...@@ -239,8 +239,9 @@ public class TableView extends Table { ...@@ -239,8 +239,9 @@ public class TableView extends Table {
return item; return item;
} }
} }
// We cannot hold the lock during the ViewIndex creation or we risk ABBA deadlocks // We cannot hold the lock during the ViewIndex creation or we risk ABBA
// if the view creation calls back into H2 via something like a FunctionTable. // deadlocks if the view creation calls back into H2 via something like
// a FunctionTable.
ViewIndex i2 = new ViewIndex(this, index, session, masks); ViewIndex i2 = new ViewIndex(this, index, session, masks);
synchronized (this) { synchronized (this) {
// have to check again in case another session has beat us to it // have to check again in case another session has beat us to it
......
...@@ -28,13 +28,22 @@ public class AbbaDetector { ...@@ -28,13 +28,22 @@ public class AbbaDetector {
}; };
/** /**
* Map of (object A) -> ( map of (object locked before object A) -> (stacktrace where locked) ) * Map of (object A) -> (
* map of (object locked before object A) ->
* (stack trace where locked) )
*/ */
private static final Map<Object, Map<Object, Exception>> LOCK_ORDERING = private static final Map<Object, Map<Object, Exception>> LOCK_ORDERING =
new WeakHashMap<Object, Map<Object, Exception>>(); new WeakHashMap<Object, Map<Object, Exception>>();
private static final Set<String> KNOWN_DEADLOCKS = new HashSet<String>(); private static final Set<String> KNOWN_DEADLOCKS = new HashSet<String>();
/**
* This method is called just before or just after an object is
* synchronized.
*
* @param o the object, or null for the current class
* @return the object that was passed
*/
public static Object begin(Object o) { public static Object begin(Object o) {
if (o == null) { if (o == null) {
o = new SecurityManager() { o = new SecurityManager() {
...@@ -59,8 +68,8 @@ public class AbbaDetector { ...@@ -59,8 +68,8 @@ public class AbbaDetector {
} }
if (TRACE) { if (TRACE) {
String thread = "[thread " + Thread.currentThread().getId() + "]"; String thread = "[thread " + Thread.currentThread().getId() + "]";
String ident = new String(new char[stack.size() * 2]).replace((char) 0, ' '); String indent = new String(new char[stack.size() * 2]).replace((char) 0, ' ');
System.out.println(thread + " " + ident + System.out.println(thread + " " + indent +
"sync " + getObjectName(o)); "sync " + getObjectName(o));
} }
if (stack.size() > 0) { if (stack.size() > 0) {
...@@ -79,7 +88,7 @@ public class AbbaDetector { ...@@ -79,7 +88,7 @@ public class AbbaDetector {
return o.getClass().getSimpleName() + "@" + System.identityHashCode(o); return o.getClass().getSimpleName() + "@" + System.identityHashCode(o);
} }
public static synchronized void markHigher(Object o, Deque<Object> older) { private static synchronized void markHigher(Object o, Deque<Object> older) {
Object test = getTest(o); Object test = getTest(o);
Map<Object, Exception> map = LOCK_ORDERING.get(test); Map<Object, Exception> map = LOCK_ORDERING.get(test);
if (map == null) { if (map == null) {
...@@ -118,19 +127,4 @@ public class AbbaDetector { ...@@ -118,19 +127,4 @@ public class AbbaDetector {
} }
} }
public static void main(String... args) {
Integer a = 1;
Float b = 2.0f;
synchronized (a) {
synchronized (b) {
System.out.println("a, then b");
}
}
synchronized (b) {
synchronized (a) {
System.out.println("b, then a");
}
}
}
} }
...@@ -23,18 +23,20 @@ import java.util.WeakHashMap; ...@@ -23,18 +23,20 @@ import java.util.WeakHashMap;
*/ */
public class AbbaLockingDetector implements Runnable { public class AbbaLockingDetector implements Runnable {
private int tickInterval_ms = 2; private int tickIntervalMs = 2;
private volatile boolean stop; private volatile boolean stop;
private final ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); private final ThreadMXBean threadMXBean =
ManagementFactory.getThreadMXBean();
private Thread thread; private Thread thread;
/** /**
* Map of (object A) -> ( map of (object locked before object A) -> * Map of (object A) -> ( map of (object locked before object A) ->
* (stacktrace where locked) ) * (stack trace where locked) )
*/ */
private final Map<String, Map<String, String>> LOCK_ORDERING = new WeakHashMap<String, Map<String, String>>(); private final Map<String, Map<String, String>> lockOrdering =
private final Set<String> KNOWN_DEADLOCKS = new HashSet<String>(); new WeakHashMap<String, Map<String, String>>();
private final Set<String> knownDeadlocks = new HashSet<String>();
/** /**
* Start collecting locking data. * Start collecting locking data.
...@@ -48,9 +50,12 @@ public class AbbaLockingDetector implements Runnable { ...@@ -48,9 +50,12 @@ public class AbbaLockingDetector implements Runnable {
return this; return this;
} }
/**
* Reset the state.
*/
public synchronized void reset() { public synchronized void reset() {
LOCK_ORDERING.clear(); lockOrdering.clear();
KNOWN_DEADLOCKS.clear(); knownDeadlocks.clear();
} }
/** /**
...@@ -83,15 +88,19 @@ public class AbbaLockingDetector implements Runnable { ...@@ -83,15 +88,19 @@ public class AbbaLockingDetector implements Runnable {
} }
private void tick() { private void tick() {
if (tickInterval_ms > 0) { if (tickIntervalMs > 0) {
try { try {
Thread.sleep(tickInterval_ms); Thread.sleep(tickIntervalMs);
} catch (InterruptedException ex) { } catch (InterruptedException ex) {
// ignore // ignore
} }
} }
ThreadInfo[] list = threadMXBean.dumpAllThreads(true/* lockedMonitors */, false/* lockedSynchronizers */); ThreadInfo[] list = threadMXBean.dumpAllThreads(
// lockedMonitors
true,
// lockedSynchronizers
false);
processThreadList(list); processThreadList(list);
} }
...@@ -110,7 +119,8 @@ public class AbbaLockingDetector implements Runnable { ...@@ -110,7 +119,8 @@ public class AbbaLockingDetector implements Runnable {
* We cannot simply call getLockedMonitors because it is not guaranteed to * We cannot simply call getLockedMonitors because it is not guaranteed to
* return the locks in the correct order. * return the locks in the correct order.
*/ */
private static void generateOrdering(final List<String> lockOrder, ThreadInfo info) { private static void generateOrdering(final List<String> lockOrder,
ThreadInfo info) {
final MonitorInfo[] lockedMonitors = info.getLockedMonitors(); final MonitorInfo[] lockedMonitors = info.getLockedMonitors();
Arrays.sort(lockedMonitors, new Comparator<MonitorInfo>() { Arrays.sort(lockedMonitors, new Comparator<MonitorInfo>() {
@Override @Override
...@@ -132,28 +142,30 @@ public class AbbaLockingDetector implements Runnable { ...@@ -132,28 +142,30 @@ public class AbbaLockingDetector implements Runnable {
} }
} }
private synchronized void markHigher(List<String> lockOrder, ThreadInfo threadInfo) { private synchronized void markHigher(List<String> lockOrder,
ThreadInfo threadInfo) {
String topLock = lockOrder.get(lockOrder.size() - 1); String topLock = lockOrder.get(lockOrder.size() - 1);
Map<String, String> map = LOCK_ORDERING.get(topLock); Map<String, String> map = lockOrdering.get(topLock);
if (map == null) { if (map == null) {
map = new WeakHashMap<String, String>(); map = new WeakHashMap<String, String>();
LOCK_ORDERING.put(topLock, map); lockOrdering.put(topLock, map);
} }
String oldException = null; String oldException = null;
for (int i = 0; i < lockOrder.size() - 1; i++) { for (int i = 0; i < lockOrder.size() - 1; i++) {
String olderLock = lockOrder.get(i); String olderLock = lockOrder.get(i);
Map<String, String> oldMap = LOCK_ORDERING.get(olderLock); Map<String, String> oldMap = lockOrdering.get(olderLock);
boolean foundDeadLock = false; boolean foundDeadLock = false;
if (oldMap != null) { if (oldMap != null) {
String e = oldMap.get(topLock); String e = oldMap.get(topLock);
if (e != null) { if (e != null) {
foundDeadLock = true; foundDeadLock = true;
String deadlockType = topLock + " " + olderLock; String deadlockType = topLock + " " + olderLock;
if (!KNOWN_DEADLOCKS.contains(deadlockType)) { if (!knownDeadlocks.contains(deadlockType)) {
System.out.println(topLock + " synchronized after \n " + olderLock System.out.println(topLock + " synchronized after \n " + olderLock
+ ", but in the past before\n" + "AFTER\n" + getStackTraceForThread(threadInfo) + ", but in the past before\n" + "AFTER\n" +
getStackTraceForThread(threadInfo)
+ "BEFORE\n" + e); + "BEFORE\n" + e);
KNOWN_DEADLOCKS.add(deadlockType); knownDeadlocks.add(deadlockType);
} }
} }
} }
...@@ -172,13 +184,15 @@ public class AbbaLockingDetector implements Runnable { ...@@ -172,13 +184,15 @@ public class AbbaLockingDetector implements Runnable {
* stack frames) * stack frames)
*/ */
private static String getStackTraceForThread(ThreadInfo info) { private static String getStackTraceForThread(ThreadInfo info) {
StringBuilder sb = new StringBuilder("\"" + info.getThreadName() + "\"" + " Id=" + info.getThreadId() + " " StringBuilder sb = new StringBuilder("\"" +
+ info.getThreadState()); info.getThreadName() + "\"" + " Id=" +
info.getThreadId() + " " + info.getThreadState());
if (info.getLockName() != null) { if (info.getLockName() != null) {
sb.append(" on " + info.getLockName()); sb.append(" on " + info.getLockName());
} }
if (info.getLockOwnerName() != null) { if (info.getLockOwnerName() != null) {
sb.append(" owned by \"" + info.getLockOwnerName() + "\" Id=" + info.getLockOwnerId()); sb.append(" owned by \"" + info.getLockOwnerName() +
"\" Id=" + info.getLockOwnerId());
} }
if (info.isSuspended()) { if (info.isSuspended()) {
sb.append(" (suspended)"); sb.append(" (suspended)");
...@@ -191,9 +205,9 @@ public class AbbaLockingDetector implements Runnable { ...@@ -191,9 +205,9 @@ public class AbbaLockingDetector implements Runnable {
final MonitorInfo[] lockedMonitors = info.getLockedMonitors(); final MonitorInfo[] lockedMonitors = info.getLockedMonitors();
boolean startDumping = false; boolean startDumping = false;
for (int i = 0; i < stackTrace.length; i++) { for (int i = 0; i < stackTrace.length; i++) {
StackTraceElement ste = stackTrace[i]; StackTraceElement e = stackTrace[i];
if (startDumping) { if (startDumping) {
dumpStackTraceElement(info, sb, i, ste); dumpStackTraceElement(info, sb, i, e);
} }
for (MonitorInfo mi : lockedMonitors) { for (MonitorInfo mi : lockedMonitors) {
...@@ -202,7 +216,7 @@ public class AbbaLockingDetector implements Runnable { ...@@ -202,7 +216,7 @@ public class AbbaLockingDetector implements Runnable {
// something. // something.
// Removes a lot of unnecessary noise from the output. // Removes a lot of unnecessary noise from the output.
if (!startDumping) { if (!startDumping) {
dumpStackTraceElement(info, sb, i, ste); dumpStackTraceElement(info, sb, i, e);
startDumping = true; startDumping = true;
} }
sb.append("\t- locked " + mi); sb.append("\t- locked " + mi);
...@@ -213,8 +227,9 @@ public class AbbaLockingDetector implements Runnable { ...@@ -213,8 +227,9 @@ public class AbbaLockingDetector implements Runnable {
return sb.toString(); return sb.toString();
} }
private static void dumpStackTraceElement(ThreadInfo info, StringBuilder sb, int i, StackTraceElement ste) { private static void dumpStackTraceElement(ThreadInfo info,
sb.append("\tat " + ste.toString()); StringBuilder sb, int i, StackTraceElement e) {
sb.append('\t').append("at ").append(e.toString());
sb.append('\n'); sb.append('\n');
if (i == 0 && info.getLockInfo() != null) { if (i == 0 && info.getLockInfo() != null) {
Thread.State ts = info.getThreadState(); Thread.State ts = info.getThreadState();
...@@ -237,7 +252,8 @@ public class AbbaLockingDetector implements Runnable { ...@@ -237,7 +252,8 @@ public class AbbaLockingDetector implements Runnable {
} }
private static String getObjectName(MonitorInfo info) { private static String getObjectName(MonitorInfo info) {
return info.getClassName() + "@" + Integer.toHexString(info.getIdentityHashCode()); return info.getClassName() + "@" +
Integer.toHexString(info.getIdentityHashCode());
} }
} }
...@@ -52,7 +52,8 @@ public class DateTimeUtils { ...@@ -52,7 +52,8 @@ public class DateTimeUtils {
private static final int[] DAYS_OFFSET = { 0, 31, 61, 92, 122, 153, 184, private static final int[] DAYS_OFFSET = { 0, 31, 61, 92, 122, 153, 184,
214, 245, 275, 306, 337, 366 }; 214, 245, 275, 306, 337, 366 };
private static final ThreadLocal<Calendar> cachedCalendar = new ThreadLocal<Calendar>() { private static final ThreadLocal<Calendar> CACHED_CALENDAR =
new ThreadLocal<Calendar>() {
@Override @Override
protected Calendar initialValue() { protected Calendar initialValue() {
return Calendar.getInstance(); return Calendar.getInstance();
...@@ -67,7 +68,7 @@ public class DateTimeUtils { ...@@ -67,7 +68,7 @@ public class DateTimeUtils {
* Reset the calendar, for example after changing the default timezone. * Reset the calendar, for example after changing the default timezone.
*/ */
public static void resetCalendar() { public static void resetCalendar() {
cachedCalendar.remove(); CACHED_CALENDAR.remove();
} }
/** /**
...@@ -379,7 +380,7 @@ public class DateTimeUtils { ...@@ -379,7 +380,7 @@ public class DateTimeUtils {
int millis) { int millis) {
Calendar c; Calendar c;
if (tz == TimeZone.getDefault()) { if (tz == TimeZone.getDefault()) {
c = cachedCalendar.get(); c = CACHED_CALENDAR.get();
} else { } else {
c = Calendar.getInstance(tz); c = Calendar.getInstance(tz);
} }
...@@ -416,7 +417,7 @@ public class DateTimeUtils { ...@@ -416,7 +417,7 @@ public class DateTimeUtils {
* @return the value * @return the value
*/ */
public static int getDatePart(java.util.Date d, int field) { public static int getDatePart(java.util.Date d, int field) {
Calendar c = cachedCalendar.get(); Calendar c = CACHED_CALENDAR.get();
c.setTime(d); c.setTime(d);
if (field == Calendar.YEAR) { if (field == Calendar.YEAR) {
return getYear(c); return getYear(c);
...@@ -450,7 +451,7 @@ public class DateTimeUtils { ...@@ -450,7 +451,7 @@ public class DateTimeUtils {
* @return the milliseconds * @return the milliseconds
*/ */
public static long getTimeLocalWithoutDst(java.util.Date d) { public static long getTimeLocalWithoutDst(java.util.Date d) {
return d.getTime() + cachedCalendar.get().get(Calendar.ZONE_OFFSET); return d.getTime() + CACHED_CALENDAR.get().get(Calendar.ZONE_OFFSET);
} }
/** /**
...@@ -461,7 +462,7 @@ public class DateTimeUtils { ...@@ -461,7 +462,7 @@ public class DateTimeUtils {
* @return the number of milliseconds in UTC * @return the number of milliseconds in UTC
*/ */
public static long getTimeUTCWithoutDst(long millis) { public static long getTimeUTCWithoutDst(long millis) {
return millis - cachedCalendar.get().get(Calendar.ZONE_OFFSET); return millis - CACHED_CALENDAR.get().get(Calendar.ZONE_OFFSET);
} }
/** /**
...@@ -731,7 +732,7 @@ public class DateTimeUtils { ...@@ -731,7 +732,7 @@ public class DateTimeUtils {
* @return the date value * @return the date value
*/ */
public static long dateValueFromDate(long ms) { public static long dateValueFromDate(long ms) {
Calendar cal = cachedCalendar.get(); Calendar cal = CACHED_CALENDAR.get();
cal.clear(); cal.clear();
cal.setTimeInMillis(ms); cal.setTimeInMillis(ms);
return dateValueFromCalendar(cal); return dateValueFromCalendar(cal);
...@@ -759,7 +760,7 @@ public class DateTimeUtils { ...@@ -759,7 +760,7 @@ public class DateTimeUtils {
* @return the nanoseconds * @return the nanoseconds
*/ */
public static long nanosFromDate(long ms) { public static long nanosFromDate(long ms) {
Calendar cal = cachedCalendar.get(); Calendar cal = CACHED_CALENDAR.get();
cal.clear(); cal.clear();
cal.setTimeInMillis(ms); cal.setTimeInMillis(ms);
return nanosFromCalendar(cal); return nanosFromCalendar(cal);
......
...@@ -40,7 +40,8 @@ public class ValueTimestamp extends Value { ...@@ -40,7 +40,8 @@ public class ValueTimestamp extends Value {
static final int DEFAULT_SCALE = 10; static final int DEFAULT_SCALE = 10;
/** /**
* A bit field with bits for the year, month, and day (see DateTimeUtils for encoding) * A bit field with bits for the year, month, and day (see DateTimeUtils for
* encoding)
*/ */
private final long dateValue; private final long dateValue;
/** /**
...@@ -56,7 +57,8 @@ public class ValueTimestamp extends Value { ...@@ -56,7 +57,8 @@ public class ValueTimestamp extends Value {
/** /**
* Get or create a date value for the given date. * Get or create a date value for the given date.
* *
* @param dateValue the date value, a bit field with bits for the year, month, and day * @param dateValue the date value, a bit field with bits for the year,
* month, and day
* @param timeNanos the nanoseconds since midnight * @param timeNanos the nanoseconds since midnight
* @return the value * @return the value
*/ */
...@@ -81,6 +83,8 @@ public class ValueTimestamp extends Value { ...@@ -81,6 +83,8 @@ public class ValueTimestamp extends Value {
/** /**
* Get or create a timestamp value for the given date/time in millis. * Get or create a timestamp value for the given date/time in millis.
* *
* @param ms the milliseconds
* @param nanos the nanoseconds
* @return the value * @return the value
*/ */
public static ValueTimestamp fromMillisNanos(long ms, int nanos) { public static ValueTimestamp fromMillisNanos(long ms, int nanos) {
...@@ -92,6 +96,7 @@ public class ValueTimestamp extends Value { ...@@ -92,6 +96,7 @@ public class ValueTimestamp extends Value {
/** /**
* Get or create a timestamp value for the given date/time in millis. * Get or create a timestamp value for the given date/time in millis.
* *
* @param ms the milliseconds
* @return the value * @return the value
*/ */
public static ValueTimestamp fromMillis(long ms) { public static ValueTimestamp fromMillis(long ms) {
...@@ -193,7 +198,10 @@ public class ValueTimestamp extends Value { ...@@ -193,7 +198,10 @@ public class ValueTimestamp extends Value {
} }
/** /**
* A bit field with bits for the year, month, and day (see DateTimeUtils for encoding) * A bit field with bits for the year, month, and day (see DateTimeUtils for
* encoding).
*
* @return the data value
*/ */
public long getDateValue() { public long getDateValue() {
return dateValue; return dateValue;
...@@ -201,6 +209,8 @@ public class ValueTimestamp extends Value { ...@@ -201,6 +209,8 @@ public class ValueTimestamp extends Value {
/** /**
* The nanoseconds since midnight. * The nanoseconds since midnight.
*
* @return the nanoseconds
*/ */
public long getTimeNanos() { public long getTimeNanos() {
return timeNanos; return timeNanos;
......
...@@ -362,6 +362,9 @@ java org.h2.test.TestAll timer ...@@ -362,6 +362,9 @@ java org.h2.test.TestAll timer
*/ */
String cacheType; String cacheType;
/**
* The AB-BA locking detector.
*/
AbbaLockingDetector abbaLockingDetector; AbbaLockingDetector abbaLockingDetector;
private Server server; private Server server;
......
...@@ -840,7 +840,8 @@ public class TestSpatial extends TestBase { ...@@ -840,7 +840,8 @@ public class TestSpatial extends TestBase {
try { try {
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
stat.execute("drop table if exists test"); stat.execute("drop table if exists test");
stat.execute("create table test(id serial primary key, value double, the_geom geometry)"); stat.execute("create table test(id serial primary key, " +
"value double, the_geom geometry)");
stat.execute("create spatial index spatial on test(the_geom)"); stat.execute("create spatial index spatial on test(the_geom)");
ResultSet rs = stat.executeQuery("explain select * from test where _ROWID_ = 5"); ResultSet rs = stat.executeQuery("explain select * from test where _ROWID_ = 5");
assertTrue(rs.next()); assertTrue(rs.next());
......
...@@ -85,11 +85,15 @@ public class AbbaDetect { ...@@ -85,11 +85,15 @@ public class AbbaDetect {
// the word synchronized within single line comments comments // the word synchronized within single line comments comments
source = source.replaceAll("(// .* synchronized )([^ ])", "$1 $2"); source = source.replaceAll("(// .* synchronized )([^ ])", "$1 $2");
source = source.replaceAll("synchronized \\((.*)\\(\\)\\)", "synchronized \\(org.h2.util.AbbaDetector.begin\\($1\\(\\)\\)\\)"); source = source.replaceAll("synchronized \\((.*)\\(\\)\\)",
source = source.replaceAll("synchronized \\((.*)\\)", "synchronized \\(org.h2.util.AbbaDetector.begin\\($1\\)\\)"); "synchronized \\(org.h2.util.AbbaDetector.begin\\($1\\(\\)\\)\\)");
source = source.replaceAll("synchronized \\((.*)\\)",
"synchronized \\(org.h2.util.AbbaDetector.begin\\($1\\)\\)");
source = source.replaceAll("static synchronized ([^ (].*)\\{", "static synchronized $1{org.h2.util.AbbaDetector.begin\\(null\\);"); source = source.replaceAll("static synchronized ([^ (].*)\\{",
source = source.replaceAll("synchronized ([^ (].*)\\{", "synchronized $1{org.h2.util.AbbaDetector.begin\\(this\\);"); "static synchronized $1{org.h2.util.AbbaDetector.begin\\(null\\);");
source = source.replaceAll("synchronized ([^ (].*)\\{",
"synchronized $1{org.h2.util.AbbaDetector.begin\\(this\\);");
return source; return source;
} }
......
...@@ -755,4 +755,8 @@ predicted prediction wojtek hops jurczyk cbtree predict vast assumption upside ...@@ -755,4 +755,8 @@ predicted prediction wojtek hops jurczyk cbtree predict vast assumption upside
adjusted lastly sgtatham cleaning gillet prevented adjusted lastly sgtatham cleaning gillet prevented
angus bernd chatellier macdonald eckenfels granting moreover exponential transferring angus bernd chatellier macdonald eckenfels granting moreover exponential transferring
dedup megabyte breadth traversal affine tucc jentsch yyyymmdd vertica graf dedup megabyte breadth traversal affine tucc jentsch yyyymmdd vertica graf
mutate shard shards mutate shard shards succession recipients provisionally contributor statutory
inaccuracies detector logos launcher rewrite monitors equivalents trademarks
reinstated uninteresting dead defendant doctrines beat factual fair suspended
exploit noise ongoing disclaimers shrinks remedy party desirable timely construe
deque synchronizers affero
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论