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

remove unused methods and fields;

small documentation improvements
上级 9f46d4ef
...@@ -487,8 +487,17 @@ Therefore the ODBC driver should not be used where security is important. ...@@ -487,8 +487,17 @@ Therefore the ODBC driver should not be used where security is important.
<br /><a name="microsoft_dot_net"></a> <br /><a name="microsoft_dot_net"></a>
<h2>Using H2 in Microsoft .NET</h2> <h2>Using H2 in Microsoft .NET</h2>
<p> <p>
The database can be used from Microsoft .NET even without using Java, by using IKVM.NET: The database can be used from Microsoft .NET even without using Java, by using IKVM.NET.
You can access a H2 database on .NET using the JDBC API, or using the ADO.NET interface.
</p> </p>
<h3>Using the ADO.NET API on .NET</h3>
<p>
An implementation of the ADO.NET interface is available in the open source project
<a href="http://code.google.com/p/h2sharp">H2Sharp</a>.
</p>
<h3>Using the JDBC API on .NET</h3>
<ul><li>Install the .NET Framework from <a href="http://www.microsoft.com">Microsoft</a>. <ul><li>Install the .NET Framework from <a href="http://www.microsoft.com">Microsoft</a>.
Mono has not yet been tested. Mono has not yet been tested.
</li><li>Install <a href="http://www.ikvm.net">IKVM.NET</a>. </li><li>Install <a href="http://www.ikvm.net">IKVM.NET</a>.
......
...@@ -24,6 +24,10 @@ If you want to add a link, please send it to the support email address or post i ...@@ -24,6 +24,10 @@ If you want to add a link, please send it to the support email address or post i
Seam In Action</a> Seam In Action</a>
<h2>Extensions</h2> <h2>Extensions</h2>
<p><a href="http://code.google.com/p/h2sharp">
H2Sharp</a><br />
ADO.NET interface for the H2 database engine.
</p>
<a href="http://geosysin.iict.ch/irstv-trac/wiki/H2spatial/Download"> <a href="http://geosysin.iict.ch/irstv-trac/wiki/H2spatial/Download">
Spatial capabilities</a> Spatial capabilities</a>
......
...@@ -334,16 +334,6 @@ to avoid recovery when the databases are opened the next time. ...@@ -334,16 +334,6 @@ to avoid recovery when the databases are opened the next time.
To stop remote server, remote connections must be enabled on the server. To stop remote server, remote connections must be enabled on the server.
</p> </p>
<h3>Limitations of the Server</h3>
<p>
There currently are a few limitations when using the server or cluster mode:
</p>
<ul>
<li>Statement.cancel() is only supported in embedded mode.
A connection can only execute one operation at a time in server or cluster mode,
and is blocked until this operation is finished.
</li></ul>
<br /><a name="using_hibernate"></a> <br /><a name="using_hibernate"></a>
<h2>Using Hibernate</h2> <h2>Using Hibernate</h2>
<p> <p>
......
...@@ -11,7 +11,7 @@ Initial Developer: H2 Group ...@@ -11,7 +11,7 @@ Initial Developer: H2 Group
<title>H2 Documentation</title> <title>H2 Documentation</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" /> <link rel="stylesheet" type="text/css" href="stylesheet.css" />
</head> </head>
<frameset cols="188,*" rows="*" frameborder="2" framespacing="4" border="4" > <frameset cols="190,*" rows="*" frameborder="2" framespacing="4" border="4" >
<frame frameborder="0" marginheight="0" marginwidth="0" src="classes.html" name="classes" /> <frame frameborder="0" marginheight="0" marginwidth="0" src="classes.html" name="classes" />
<frame frameborder="0" marginheight="0" marginwidth="0" src="overview.html" name="javadoc" /> <frame frameborder="0" marginheight="0" marginwidth="0" src="overview.html" name="javadoc" />
</frameset> </frameset>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -170,7 +170,8 @@ public class Parser { ...@@ -170,7 +170,8 @@ public class Parser {
private String currentToken; private String currentToken;
private boolean currentTokenQuoted; private boolean currentTokenQuoted;
private Value currentValue; private Value currentValue;
private String sqlCommand, originalSQL; private String sqlCommand;
private String originalSQL;
private char[] sqlCommandChars; private char[] sqlCommandChars;
private int lastParseIndex; private int lastParseIndex;
private int parseIndex; private int parseIndex;
...@@ -2650,10 +2651,6 @@ public class Parser { ...@@ -2650,10 +2651,6 @@ public class Parser {
currentTokenType = VALUE; currentTokenType = VALUE;
} }
public String getOriginalSQL() {
return originalSQL;
}
public Session getSession() { public Session getSession() {
return session; return session;
} }
......
...@@ -410,8 +410,4 @@ public class AlterTableAddConstraint extends SchemaCommand { ...@@ -410,8 +410,4 @@ public class AlterTableAddConstraint extends SchemaCommand {
this.primaryKeyHash = b; this.primaryKeyHash = b;
} }
public boolean getPrimaryKeyHash() {
return primaryKeyHash;
}
} }
...@@ -52,14 +52,6 @@ public class CreateIndex extends SchemaCommand { ...@@ -52,14 +52,6 @@ public class CreateIndex extends SchemaCommand {
this.indexColumns = columns; this.indexColumns = columns;
} }
public boolean getPrimaryKey() {
return primaryKey;
}
public IndexColumn[] getIndexColumns() {
return indexColumns;
}
public int update() throws SQLException { public int update() throws SQLException {
// TODO cancel: may support for index creation // TODO cancel: may support for index creation
session.commit(true); session.commit(true);
...@@ -111,10 +103,6 @@ public class CreateIndex extends SchemaCommand { ...@@ -111,10 +103,6 @@ public class CreateIndex extends SchemaCommand {
this.hash = b; this.hash = b;
} }
public boolean getHash() {
return hash;
}
public void setComment(String comment) { public void setComment(String comment) {
this.comment = comment; this.comment = comment;
} }
......
...@@ -693,7 +693,7 @@ public class Select extends Query { ...@@ -693,7 +693,7 @@ public class Select extends Query {
if (isGroupQuery && groupIndex == null && havingIndex < 0 && filters.size() == 1) { if (isGroupQuery && groupIndex == null && havingIndex < 0 && filters.size() == 1) {
if (condition == null) { if (condition == null) {
ExpressionVisitor optimizable = ExpressionVisitor.get(ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL); ExpressionVisitor optimizable = ExpressionVisitor.get(ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL);
optimizable.table = ((TableFilter) filters.get(0)).getTable(); optimizable.setTable(((TableFilter) filters.get(0)).getTable());
isQuickAggregateQuery = isEverything(optimizable); isQuickAggregateQuery = isEverything(optimizable);
} }
} }
...@@ -995,7 +995,7 @@ public class Select extends Query { ...@@ -995,7 +995,7 @@ public class Select extends Query {
} }
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
switch(visitor.type) { switch(visitor.getType()) {
case ExpressionVisitor.SET_MAX_DATA_MODIFICATION_ID: { case ExpressionVisitor.SET_MAX_DATA_MODIFICATION_ID: {
for (int i = 0; i < filters.size(); i++) { for (int i = 0; i < filters.size(); i++) {
TableFilter f = (TableFilter) filters.get(i); TableFilter f = (TableFilter) filters.get(i);
...@@ -1020,7 +1020,7 @@ public class Select extends Query { ...@@ -1020,7 +1020,7 @@ public class Select extends Query {
break; break;
} }
} }
visitor.queryLevel(1); visitor.incrementQueryLevel(1);
boolean result = true; boolean result = true;
for (int i = 0; i < expressions.size(); i++) { for (int i = 0; i < expressions.size(); i++) {
Expression e = (Expression) expressions.get(i); Expression e = (Expression) expressions.get(i);
...@@ -1035,7 +1035,7 @@ public class Select extends Query { ...@@ -1035,7 +1035,7 @@ public class Select extends Query {
if (result && having != null && !having.isEverything(visitor)) { if (result && having != null && !having.isEverything(visitor)) {
result = false; result = false;
} }
visitor.queryLevel(-1); visitor.incrementQueryLevel(-1);
return result; return result;
} }
......
...@@ -104,14 +104,6 @@ public abstract class Constraint extends SchemaObjectBase implements Comparable ...@@ -104,14 +104,6 @@ public abstract class Constraint extends SchemaObjectBase implements Comparable
*/ */
public abstract boolean isBefore(); public abstract boolean isBefore();
/**
* Get a short description of the constraint. This includes the constraint
* name (if set), and the constraint expression.
*
* @return the description
*/
public abstract String getShortDescription();
/** /**
* Check the existing data. This method is called if the constraint is added * Check the existing data. This method is called if the constraint is added
* after data has been inserted into the table. * after data has been inserted into the table.
......
...@@ -168,6 +168,13 @@ public class ConstraintReferential extends Constraint { ...@@ -168,6 +168,13 @@ public class ConstraintReferential extends Constraint {
return buff.toString(); return buff.toString();
} }
/**
* Get a short description of the constraint. This includes the constraint
* name (if set), and the constraint expression.
*
* @return the description
*/
public String getShortDescription() { public String getShortDescription() {
StringBuffer buff = new StringBuffer(); StringBuffer buff = new StringBuffer();
buff.append(getName()); buff.append(getName());
......
...@@ -76,22 +76,6 @@ public class ConstraintUnique extends Constraint { ...@@ -76,22 +76,6 @@ public class ConstraintUnique extends Constraint {
} }
} }
public String getShortDescription() {
StringBuffer buff = new StringBuffer();
buff.append(getName());
buff.append(": ");
buff.append(getTypeName());
buff.append('(');
for (int i = 0; i < columns.length; i++) {
if (i > 0) {
buff.append(", ");
}
buff.append(Parser.quoteIdentifier(columns[i].column.getName()));
}
buff.append(")");
return buff.toString();
}
public String getCreateSQLWithoutIndexes() { public String getCreateSQLWithoutIndexes() {
return getCreateSQLForCopy(table, getSQL(), false); return getCreateSQLForCopy(table, getSQL(), false);
} }
......
...@@ -128,7 +128,6 @@ public class Database implements DataHandler { ...@@ -128,7 +128,6 @@ public class Database implements DataHandler {
private int lockMode = SysProperties.DEFAULT_LOCK_MODE; private int lockMode = SysProperties.DEFAULT_LOCK_MODE;
private boolean logIndexChanges; private boolean logIndexChanges;
private int logLevel = 1; private int logLevel = 1;
private int cacheSize;
private int maxLengthInplaceLob = Constants.DEFAULT_MAX_LENGTH_INPLACE_LOB; private int maxLengthInplaceLob = Constants.DEFAULT_MAX_LENGTH_INPLACE_LOB;
private long biggestFileSize; private long biggestFileSize;
private int allowLiterals = Constants.DEFAULT_ALLOW_LITERALS; private int allowLiterals = Constants.DEFAULT_ALLOW_LITERALS;
...@@ -1244,10 +1243,6 @@ public class Database implements DataHandler { ...@@ -1244,10 +1243,6 @@ public class Database implements DataHandler {
return new ObjectArray(users.values()); return new ObjectArray(users.values());
} }
public int getCacheSize() {
return cacheSize;
}
public String getCacheType() { public String getCacheType() {
return cacheType; return cacheType;
} }
...@@ -1576,7 +1571,6 @@ public class Database implements DataHandler { ...@@ -1576,7 +1571,6 @@ public class Database implements DataHandler {
fileData.getCache().setMaxSize(kb); fileData.getCache().setMaxSize(kb);
int valueIndex = kb <= 32 ? kb : (kb >>> SysProperties.CACHE_SIZE_INDEX_SHIFT); int valueIndex = kb <= 32 ? kb : (kb >>> SysProperties.CACHE_SIZE_INDEX_SHIFT);
fileIndex.getCache().setMaxSize(valueIndex); fileIndex.getCache().setMaxSize(valueIndex);
cacheSize = kb;
} }
} }
...@@ -1833,10 +1827,6 @@ public class Database implements DataHandler { ...@@ -1833,10 +1827,6 @@ public class Database implements DataHandler {
return closing; return closing;
} }
public int getWriteDelay() {
return writeDelay;
}
public void setMaxLengthInplaceLob(int value) { public void setMaxLengthInplaceLob(int value) {
this.maxLengthInplaceLob = value; this.maxLengthInplaceLob = value;
} }
......
...@@ -35,6 +35,13 @@ public class MetaRecord { ...@@ -35,6 +35,13 @@ public class MetaRecord {
objectType = r.getValue(2).getInt(); objectType = r.getValue(2).getInt();
sql = r.getValue(3).getString(); sql = r.getValue(3).getString();
} }
MetaRecord(DbObject obj) {
id = obj.getId();
objectType = obj.getType();
headPos = obj.getHeadPos();
sql = obj.getCreateSQL();
}
/** /**
* Sort the list of meta records by 'create order'. * Sort the list of meta records by 'create order'.
...@@ -56,20 +63,13 @@ public class MetaRecord { ...@@ -56,20 +63,13 @@ public class MetaRecord {
}); });
} }
public void setRecord(SearchRow r) { void setRecord(SearchRow r) {
r.setValue(0, ValueInt.get(id)); r.setValue(0, ValueInt.get(id));
r.setValue(1, ValueInt.get(headPos)); r.setValue(1, ValueInt.get(headPos));
r.setValue(2, ValueInt.get(objectType)); r.setValue(2, ValueInt.get(objectType));
r.setValue(3, ValueString.get(sql)); r.setValue(3, ValueString.get(sql));
} }
public MetaRecord(DbObject obj) {
id = obj.getId();
objectType = obj.getType();
headPos = obj.getHeadPos();
sql = obj.getCreateSQL();
}
void execute(Database db, Session systemSession, DatabaseEventListener listener) throws SQLException { void execute(Database db, Session systemSession, DatabaseEventListener listener) throws SQLException {
try { try {
Prepared command = systemSession.prepare(sql); Prepared command = systemSession.prepare(sql);
...@@ -88,36 +88,16 @@ public class MetaRecord { ...@@ -88,36 +88,16 @@ public class MetaRecord {
} }
} }
public int getHeadPos() {
return headPos;
}
public void setHeadPos(int headPos) {
this.headPos = headPos;
}
public int getId() { public int getId() {
return id; return id;
} }
public void setId(int id) {
this.id = id;
}
public int getObjectType() { public int getObjectType() {
return objectType; return objectType;
} }
public void setObjectType(int objectType) {
this.objectType = objectType;
}
public String getSQL() { public String getSQL() {
return sql; return sql;
} }
public void setSql(String sql) {
this.sql = sql;
}
} }
...@@ -79,7 +79,6 @@ public class Session implements SessionInterface { ...@@ -79,7 +79,6 @@ public class Session implements SessionInterface {
private String currentTransactionName; private String currentTransactionName;
private volatile long cancelAt; private volatile long cancelAt;
private boolean closed; private boolean closed;
private boolean rollbackMode;
private long sessionStart = System.currentTimeMillis(); private long sessionStart = System.currentTimeMillis();
private long currentCommandStart; private long currentCommandStart;
private HashMap variables; private HashMap variables;
...@@ -395,12 +394,7 @@ public class Session implements SessionInterface { ...@@ -395,12 +394,7 @@ public class Session implements SessionInterface {
public void rollbackTo(int index) throws SQLException { public void rollbackTo(int index) throws SQLException {
while (undoLog.size() > index) { while (undoLog.size() > index) {
UndoLogRecord entry = undoLog.getAndRemoveLast(); UndoLogRecord entry = undoLog.getAndRemoveLast();
rollbackMode = true; entry.undo(this);
try {
entry.undo(this);
} finally {
rollbackMode = false;
}
} }
if (savepoints != null) { if (savepoints != null) {
String[] names = new String[savepoints.size()]; String[] names = new String[savepoints.size()];
...@@ -868,10 +862,6 @@ public class Session implements SessionInterface { ...@@ -868,10 +862,6 @@ public class Session implements SessionInterface {
autoCommit = false; autoCommit = false;
} }
public boolean getRollbackMode() {
return rollbackMode;
}
public long getSessionStart() { public long getSessionStart() {
return sessionStart; return sessionStart;
} }
......
...@@ -427,10 +427,6 @@ public class Aggregate extends Expression { ...@@ -427,10 +427,6 @@ public class Aggregate extends Expression {
} }
} }
public int getAggregateType() {
return type;
}
private Index getColumnIndex(boolean first) { private Index getColumnIndex(boolean first) {
if (on instanceof ExpressionColumn) { if (on instanceof ExpressionColumn) {
ExpressionColumn col = (ExpressionColumn) on; ExpressionColumn col = (ExpressionColumn) on;
...@@ -446,10 +442,10 @@ public class Aggregate extends Expression { ...@@ -446,10 +442,10 @@ public class Aggregate extends Expression {
} }
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
if (visitor.type == ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL) { if (visitor.getType() == ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL) {
switch (type) { switch (type) {
case COUNT_ALL: case COUNT_ALL:
return visitor.table.canGetRowCount(); return visitor.getTable().canGetRowCount();
case MIN: case MIN:
case MAX: case MAX:
if (!SysProperties.OPTIMIZE_MIN_MAX) { if (!SysProperties.OPTIMIZE_MIN_MAX) {
......
...@@ -25,12 +25,50 @@ import org.h2.value.ValueNull; ...@@ -25,12 +25,50 @@ import org.h2.value.ValueNull;
*/ */
public class Comparison extends Condition { public class Comparison extends Condition {
public static final int EQUAL = 0, BIGGER_EQUAL = 1, BIGGER = 2, SMALLER_EQUAL = 3, SMALLER = 4, NOT_EQUAL = 5, /**
IS_NULL = 6, IS_NOT_NULL = 7; * The comparison type meaning = as in ID=1.
*/
public static final int EQUAL = 0;
/**
* The comparison type meaning &gt;= as in ID&gt;=1.
*/
public static final int BIGGER_EQUAL = 1;
/**
* The comparison type meaning &gt; as in ID&gt;1.
*/
public static final int BIGGER = 2;
// TODO refactor: comparison: a comparison is never 'false'; the constant is /**
// used only for index conditions * The comparison type meaning &lt;= as in ID&lt;=1.
*/
public static final int SMALLER_EQUAL = 3;
/**
* The comparison type meaning &lt; as in ID&lt;1.
*/
public static final int SMALLER = 4;
/**
* The comparison type meaning &lt;&gt; as in ID&lt;&gt;1.
*/
public static final int NOT_EQUAL = 5;
/**
* The comparison type meaning IS NULL as in NAME IS NULL.
*/
public static final int IS_NULL = 6;
/**
* The comparison type meaning IS NOT NULL as in NAME IS NOT NULL.
*/
public static final int IS_NOT_NULL = 7;
/**
* This is a pseudo comparison type that is only used for index conditions.
* It means the comparison will always yield FALSE. Example: 1=0.
*/
public static final int FALSE = 8; public static final int FALSE = 8;
private final Database database; private final Database database;
...@@ -277,11 +315,15 @@ public class Comparison extends Condition { ...@@ -277,11 +315,15 @@ public class Comparison extends Condition {
return; return;
} }
if (l == null) { if (l == null) {
if (!left.isEverything(ExpressionVisitor.getNotFromResolver(filter))) { ExpressionVisitor visitor = ExpressionVisitor.get(ExpressionVisitor.NOT_FROM_RESOLVER);
visitor.setResolver(filter);
if (!left.isEverything(visitor)) {
return; return;
} }
} else if (r == null) { } else if (r == null) {
if (!right.isEverything(ExpressionVisitor.getNotFromResolver(filter))) { ExpressionVisitor visitor = ExpressionVisitor.get(ExpressionVisitor.NOT_FROM_RESOLVER);
visitor.setResolver(filter);
if (!right.isEverything(visitor)) {
return; return;
} }
} else { } else {
...@@ -355,7 +397,7 @@ public class Comparison extends Condition { ...@@ -355,7 +397,7 @@ public class Comparison extends Condition {
return left.getCost() + (right == null ? 0 : right.getCost()) + 1; return left.getCost() + (right == null ? 0 : right.getCost()) + 1;
} }
public Comparison getAdditional(Session session, Comparison other) { Comparison getAdditional(Session session, Comparison other) {
if (compareType == other.compareType && compareType == EQUAL) { if (compareType == other.compareType && compareType == EQUAL) {
boolean lc = left.isConstant(), rc = right.isConstant(); boolean lc = left.isConstant(), rc = right.isConstant();
boolean l2c = other.left.isConstant(), r2c = other.right.isConstant(); boolean l2c = other.left.isConstant(), r2c = other.right.isConstant();
...@@ -377,6 +419,13 @@ public class Comparison extends Condition { ...@@ -377,6 +419,13 @@ public class Comparison extends Condition {
return null; return null;
} }
/**
* Get the left or the right sub-expression of this condition.
*
* @param left true to get the left sub-expression, false to get the right
* sub-expression.
* @return the sub-expression
*/
public Expression getExpression(boolean left) { public Expression getExpression(boolean left) {
return left ? this.left : right; return left ? this.left : right;
} }
......
...@@ -23,7 +23,15 @@ import org.h2.value.ValueNull; ...@@ -23,7 +23,15 @@ import org.h2.value.ValueNull;
*/ */
public class ConditionAndOr extends Condition { public class ConditionAndOr extends Condition {
public static final int AND = 0, OR = 1; /**
* The AND condition type as in ID=1 AND NAME='Hello'.
*/
public static final int AND = 0;
/**
* The OR condition type as in ID=1 OR NAME='Hello'.
*/
public static final int OR = 1;
private final int andOrType; private final int andOrType;
private Expression left, right; private Expression left, right;
...@@ -241,6 +249,13 @@ public class ConditionAndOr extends Condition { ...@@ -241,6 +249,13 @@ public class ConditionAndOr extends Condition {
return this; return this;
} }
/**
* Get the left or the right sub-expression of this condition.
*
* @param left true to get the left sub-expression, false to get the right
* sub-expression.
* @return the sub-expression
*/
public Expression getExpression(boolean left) { public Expression getExpression(boolean left) {
return left ? this.left : right; return left ? this.left : right;
} }
......
...@@ -104,7 +104,7 @@ public class ConditionIn extends Condition { ...@@ -104,7 +104,7 @@ public class ConditionIn extends Condition {
if (SysProperties.OPTIMIZE_IN) { if (SysProperties.OPTIMIZE_IN) {
int dataType = left.getType(); int dataType = left.getType();
ExpressionVisitor independent = ExpressionVisitor.get(ExpressionVisitor.INDEPENDENT); ExpressionVisitor independent = ExpressionVisitor.get(ExpressionVisitor.INDEPENDENT);
independent.queryLevel = queryLevel; independent.setQueryLevel(queryLevel);
if (areAllValues(independent)) { if (areAllValues(independent)) {
if (left instanceof ExpressionColumn) { if (left instanceof ExpressionColumn) {
Column column = ((ExpressionColumn) left).getColumn(); Column column = ((ExpressionColumn) left).getColumn();
......
...@@ -230,19 +230,19 @@ public class ExpressionColumn extends Expression { ...@@ -230,19 +230,19 @@ public class ExpressionColumn extends Expression {
} }
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
switch (visitor.type) { switch (visitor.getType()) {
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL: case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
return false; return false;
case ExpressionVisitor.READONLY: case ExpressionVisitor.READONLY:
case ExpressionVisitor.DETERMINISTIC: case ExpressionVisitor.DETERMINISTIC:
return true; return true;
case ExpressionVisitor.INDEPENDENT: case ExpressionVisitor.INDEPENDENT:
return this.queryLevel < visitor.queryLevel; return this.queryLevel < visitor.getQueryLevel();
case ExpressionVisitor.EVALUATABLE: case ExpressionVisitor.EVALUATABLE:
// if the current value is known (evaluatable set) // if the current value is known (evaluatable set)
// or if this columns belongs to a 'higher level' query and is // or if this columns belongs to a 'higher level' query and is
// therefore just a parameter // therefore just a parameter
return evaluatable || visitor.queryLevel < this.queryLevel; return evaluatable || visitor.getQueryLevel() < this.queryLevel;
case ExpressionVisitor.SET_MAX_DATA_MODIFICATION_ID: case ExpressionVisitor.SET_MAX_DATA_MODIFICATION_ID:
visitor.addDataModificationId(column.getTable().getMaxDataModificationId()); visitor.addDataModificationId(column.getTable().getMaxDataModificationId());
return true; return true;
...@@ -252,7 +252,7 @@ public class ExpressionColumn extends Expression { ...@@ -252,7 +252,7 @@ public class ExpressionColumn extends Expression {
visitor.addDependency(column.getTable()); visitor.addDependency(column.getTable());
return true; return true;
default: default:
throw Message.getInternalError("type=" + visitor.type); throw Message.getInternalError("type=" + visitor.getType());
} }
} }
......
...@@ -26,7 +26,8 @@ public class ExpressionVisitor { ...@@ -26,7 +26,8 @@ public class ExpressionVisitor {
public static final int INDEPENDENT = 0; public static final int INDEPENDENT = 0;
/** /**
* Are all aggregates MIN(column), MAX(column), or COUNT(*)? * Are all aggregates MIN(column), MAX(column), or COUNT(*) for the given
* table (getTable)?
*/ */
public static final int OPTIMIZABLE_MIN_MAX_COUNT_ALL = 1; public static final int OPTIMIZABLE_MIN_MAX_COUNT_ALL = 1;
...@@ -52,7 +53,8 @@ public class ExpressionVisitor { ...@@ -52,7 +53,8 @@ public class ExpressionVisitor {
public static final int READONLY = 5; public static final int READONLY = 5;
/** /**
* Does an expression have no relation to the given table filter? * Does an expression have no relation to the given table filter
* (getResolver)?
*/ */
public static final int NOT_FROM_RESOLVER = 6; public static final int NOT_FROM_RESOLVER = 6;
...@@ -61,9 +63,9 @@ public class ExpressionVisitor { ...@@ -61,9 +63,9 @@ public class ExpressionVisitor {
*/ */
public static final int GET_DEPENDENCIES = 7; public static final int GET_DEPENDENCIES = 7;
int queryLevel; private int queryLevel;
public Table table; private Table table;
public int type; private int type;
private long maxDataModificationId; private long maxDataModificationId;
private ColumnResolver resolver; private ColumnResolver resolver;
private HashSet dependencies; private HashSet dependencies;
...@@ -71,43 +73,126 @@ public class ExpressionVisitor { ...@@ -71,43 +73,126 @@ public class ExpressionVisitor {
public static ExpressionVisitor get(int type) { public static ExpressionVisitor get(int type) {
return new ExpressionVisitor(type); return new ExpressionVisitor(type);
} }
public long getMaxDataModificationId() { private ExpressionVisitor(int type) {
return maxDataModificationId; this.type = type;
} }
/**
* Add a new dependency to the set of dependencies.
* This is used for GET_DEPENDENCIES visitors.
*
* @param obj the additional dependency.
*/
public void addDependency(DbObject obj) { public void addDependency(DbObject obj) {
dependencies.add(obj); dependencies.add(obj);
} }
/**
* Get the dependency set.
* This is used for GET_DEPENDENCIES visitors.
*
* @return the set
*/
public HashSet getDependencies() { public HashSet getDependencies() {
return dependencies; return dependencies;
} }
/**
* Set all dependencies.
* This is used for GET_DEPENDENCIES visitors.
*
* @param dependencies the dependency set
*/
public void setDependencies(HashSet dependencies) { public void setDependencies(HashSet dependencies) {
this.dependencies = dependencies; this.dependencies = dependencies;
} }
private ExpressionVisitor(int type) { /**
this.type = type; * Increment or decrement the query level.
} *
* @param offset 1 to increment, -1 to decrement
public void queryLevel(int offset) { */
public void incrementQueryLevel(int offset) {
queryLevel += offset; queryLevel += offset;
} }
/**
* Get the column resolver.
* This is used for NOT_FROM_RESOLVER visitors.
*
* @return the column resolver
*/
public ColumnResolver getResolver() { public ColumnResolver getResolver() {
return resolver; return resolver;
} }
/**
* Set the column resolver.
* This is used for NOT_FROM_RESOLVER visitors.
*
* @param resolver
*/
public void setResolver(ColumnResolver resolver) {
this.resolver = resolver;
}
/**
* Update the field maxDataModificationId if this value is higher
* than the current value.
* This is used for SET_MAX_DATA_MODIFICATION_ID visitors.
*
* @param value the data modification id
*/
public void addDataModificationId(long value) {
maxDataModificationId = Math.max(maxDataModificationId, value);
}
/**
* Get the last data modification.
* This is used for SET_MAX_DATA_MODIFICATION_ID visitors.
*
* @return the maximum modification id
*/
public long getMaxDataModificationId() {
return maxDataModificationId;
}
public void addDataModificationId(long v) { int getQueryLevel() {
maxDataModificationId = Math.max(maxDataModificationId, v); return queryLevel;
} }
public static ExpressionVisitor getNotFromResolver(ColumnResolver resolver) { void setQueryLevel(int queryLevel) {
ExpressionVisitor v = new ExpressionVisitor(NOT_FROM_RESOLVER); this.queryLevel = queryLevel;
v.resolver = resolver; }
return v;
/**
* Set the table.
* This is used for OPTIMIZABLE_MIN_MAX_COUNT_ALL visitors.
*
* @param table the table
*/
public void setTable(Table table) {
this.table = table;
}
/**
* Get the table.
* This is used for OPTIMIZABLE_MIN_MAX_COUNT_ALL visitors.
*
* @return the table
*/
public Table getTable() {
return table;
}
/**
* Get the visitor type.
*
* @return the type
*/
public int getType() {
return type;
} }
} }
...@@ -323,10 +323,23 @@ public class Function extends Expression implements FunctionCall { ...@@ -323,10 +323,23 @@ public class Function extends Expression implements FunctionCall {
addFunction(name, type, parameterCount, dataType, false, true); addFunction(name, type, parameterCount, dataType, false, true);
} }
/**
* Get the function info object for this function, or null if there is no
* such function.
*
* @param name the function name
*/
public static FunctionInfo getFunctionInfo(String name) { public static FunctionInfo getFunctionInfo(String name) {
return (FunctionInfo) FUNCTIONS.get(name); return (FunctionInfo) FUNCTIONS.get(name);
} }
/**
* Get an instance of the given function for this database.
*
* @param database the database
* @param name the function name
* @return the function object
*/
public static Function getFunction(Database database, String name) throws SQLException { public static Function getFunction(Database database, String name) throws SQLException {
FunctionInfo info = getFunctionInfo(name); FunctionInfo info = getFunctionInfo(name);
if (info == null) { if (info == null) {
...@@ -351,6 +364,12 @@ public class Function extends Expression implements FunctionCall { ...@@ -351,6 +364,12 @@ public class Function extends Expression implements FunctionCall {
} }
} }
/**
* Set the parameter expression at the given index.
*
* @param index the index (0, 1,...)
* @param param the expression
*/
public void setParameter(int index, Expression param) throws SQLException { public void setParameter(int index, Expression param) throws SQLException {
if (varArgs != null) { if (varArgs != null) {
varArgs.add(param); varArgs.add(param);
...@@ -786,7 +805,7 @@ public class Function extends Expression implements FunctionCall { ...@@ -786,7 +805,7 @@ public class Function extends Expression implements FunctionCall {
return false; return false;
} }
public Value getValueWithArgs(Session session, Expression[] args) throws SQLException { private Value getValueWithArgs(Session session, Expression[] args) throws SQLException {
if (info.nullIfParameterIsNull) { if (info.nullIfParameterIsNull) {
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {
if (getNullOrValue(session, args, i) == ValueNull.INSTANCE) { if (getNullOrValue(session, args, i) == ValueNull.INSTANCE) {
...@@ -1490,6 +1509,12 @@ public class Function extends Expression implements FunctionCall { ...@@ -1490,6 +1509,12 @@ public class Function extends Expression implements FunctionCall {
} }
} }
/**
* This method is called after all the parameters have been set.
* It checks if the parameter count is correct.
*
* @throws SQLException if the parameter count is incorrect.
*/
public void doneWithParameters() throws SQLException { public void doneWithParameters() throws SQLException {
if (info.parameterCount == VAR_ARGS) { if (info.parameterCount == VAR_ARGS) {
int len = varArgs.size(); int len = varArgs.size();
...@@ -1837,7 +1862,7 @@ public class Function extends Expression implements FunctionCall { ...@@ -1837,7 +1862,7 @@ public class Function extends Expression implements FunctionCall {
} }
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
if (visitor.type == ExpressionVisitor.DETERMINISTIC && !info.isDeterministic) { if (visitor.getType() == ExpressionVisitor.DETERMINISTIC && !info.isDeterministic) {
return false; return false;
} }
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {
......
...@@ -82,7 +82,7 @@ public class JavaAggregate extends Expression { ...@@ -82,7 +82,7 @@ public class JavaAggregate extends Expression {
} }
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
switch(visitor.type) { switch(visitor.getType()) {
case ExpressionVisitor.DETERMINISTIC: case ExpressionVisitor.DETERMINISTIC:
// TODO optimization: some functions are deterministic, but we don't // TODO optimization: some functions are deterministic, but we don't
// know (no setting for that) // know (no setting for that)
......
...@@ -97,10 +97,6 @@ public class JavaFunction extends Expression implements FunctionCall { ...@@ -97,10 +97,6 @@ public class JavaFunction extends Expression implements FunctionCall {
} }
} }
public FunctionAlias getFunctionAlias() {
return functionAlias;
}
public String getName() { public String getName() {
return functionAlias.getName(); return functionAlias.getName();
} }
...@@ -119,7 +115,7 @@ public class JavaFunction extends Expression implements FunctionCall { ...@@ -119,7 +115,7 @@ public class JavaFunction extends Expression implements FunctionCall {
} }
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
switch(visitor.type) { switch(visitor.getType()) {
case ExpressionVisitor.DETERMINISTIC: case ExpressionVisitor.DETERMINISTIC:
// TODO optimization: some functions are deterministic, but we don't // TODO optimization: some functions are deterministic, but we don't
// know (no setting for that) // know (no setting for that)
......
...@@ -128,7 +128,7 @@ public class Parameter extends Expression implements ParameterInterface { ...@@ -128,7 +128,7 @@ public class Parameter extends Expression implements ParameterInterface {
} }
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
switch(visitor.type) { switch(visitor.getType()) {
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL: case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
return true; return true;
case ExpressionVisitor.DETERMINISTIC: case ExpressionVisitor.DETERMINISTIC:
...@@ -147,7 +147,7 @@ public class Parameter extends Expression implements ParameterInterface { ...@@ -147,7 +147,7 @@ public class Parameter extends Expression implements ParameterInterface {
case ExpressionVisitor.GET_DEPENDENCIES: case ExpressionVisitor.GET_DEPENDENCIES:
return true; return true;
default: default:
throw Message.getInternalError("type="+visitor.type); throw Message.getInternalError("type="+visitor.getType());
} }
} }
......
...@@ -65,7 +65,7 @@ public class Rownum extends Expression { ...@@ -65,7 +65,7 @@ public class Rownum extends Expression {
} }
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
switch(visitor.type) { switch(visitor.getType()) {
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL: case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
return false; return false;
case ExpressionVisitor.DETERMINISTIC: case ExpressionVisitor.DETERMINISTIC:
...@@ -84,7 +84,7 @@ public class Rownum extends Expression { ...@@ -84,7 +84,7 @@ public class Rownum extends Expression {
case ExpressionVisitor.GET_DEPENDENCIES: case ExpressionVisitor.GET_DEPENDENCIES:
return true; return true;
default: default:
throw Message.getInternalError("type="+visitor.type); throw Message.getInternalError("type="+visitor.getType());
} }
} }
......
...@@ -71,7 +71,7 @@ public class SequenceValue extends Expression { ...@@ -71,7 +71,7 @@ public class SequenceValue extends Expression {
} }
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
switch(visitor.type) { switch(visitor.getType()) {
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL: case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
return true; return true;
case ExpressionVisitor.DETERMINISTIC: case ExpressionVisitor.DETERMINISTIC:
...@@ -90,7 +90,7 @@ public class SequenceValue extends Expression { ...@@ -90,7 +90,7 @@ public class SequenceValue extends Expression {
visitor.addDependency(sequence); visitor.addDependency(sequence);
return true; return true;
default: default:
throw Message.getInternalError("type="+visitor.type); throw Message.getInternalError("type="+visitor.getType());
} }
} }
......
...@@ -68,29 +68,6 @@ public class TableFunction extends Function implements FunctionCall { ...@@ -68,29 +68,6 @@ public class TableFunction extends Function implements FunctionCall {
return distinct ? "TABLE_DISTINCT" : "TABLE"; return distinct ? "TABLE_DISTINCT" : "TABLE";
} }
/**
* Get the row count of the table.
*
* @param session the session
* @return the row count
*/
public int getRowCount(Session session) throws SQLException {
int len = columnList.length;
int rowCount = 0;
for (int i = 0; i < len; i++) {
Expression expr = args[i];
if (expr.isConstant()) {
Value v = expr.getValue(session);
if (v != ValueNull.INSTANCE) {
ValueArray array = (ValueArray) v.convertTo(Value.ARRAY);
Value[] l = array.getList();
rowCount = Math.max(rowCount, l.length);
}
}
}
return rowCount;
}
public ValueResultSet getValueForColumnList(Session session, Expression[] nullArgs) throws SQLException { public ValueResultSet getValueForColumnList(Session session, Expression[] nullArgs) throws SQLException {
return getTable(session, args, true, false); return getTable(session, args, true, false);
} }
......
...@@ -115,7 +115,7 @@ public class ValueExpression extends Expression { ...@@ -115,7 +115,7 @@ public class ValueExpression extends Expression {
} }
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
switch (visitor.type) { switch (visitor.getType()) {
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL: case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
return true; return true;
case ExpressionVisitor.DETERMINISTIC: case ExpressionVisitor.DETERMINISTIC:
...@@ -132,7 +132,7 @@ public class ValueExpression extends Expression { ...@@ -132,7 +132,7 @@ public class ValueExpression extends Expression {
case ExpressionVisitor.GET_DEPENDENCIES: case ExpressionVisitor.GET_DEPENDENCIES:
return true; return true;
default: default:
throw Message.getInternalError("type=" + visitor.type); throw Message.getInternalError("type=" + visitor.getType());
} }
} }
......
...@@ -58,7 +58,7 @@ public class Variable extends Expression { ...@@ -58,7 +58,7 @@ public class Variable extends Expression {
} }
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
switch(visitor.type) { switch(visitor.getType()) {
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL: case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
return true; return true;
case ExpressionVisitor.DETERMINISTIC: case ExpressionVisitor.DETERMINISTIC:
...@@ -78,7 +78,7 @@ public class Variable extends Expression { ...@@ -78,7 +78,7 @@ public class Variable extends Expression {
case ExpressionVisitor.GET_DEPENDENCIES: case ExpressionVisitor.GET_DEPENDENCIES:
return true; return true;
default: default:
throw Message.getInternalError("type="+visitor.type); throw Message.getInternalError("type="+visitor.getType());
} }
} }
......
...@@ -66,10 +66,6 @@ public class Wildcard extends Expression { ...@@ -66,10 +66,6 @@ public class Wildcard extends Expression {
throw Message.getInternalError(); throw Message.getInternalError();
} }
public String getSchema() {
return schema;
}
public String getTableAlias() { public String getTableAlias() {
return table; return table;
} }
......
...@@ -33,7 +33,6 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index { ...@@ -33,7 +33,6 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
protected IndexColumn[] indexColumns; protected IndexColumn[] indexColumns;
protected Column[] columns; protected Column[] columns;
protected int[] columnIds; protected int[] columnIds;
protected boolean[] descending;
protected Table table; protected Table table;
protected IndexType indexType; protected IndexType indexType;
protected long rowCount; protected long rowCount;
......
...@@ -242,15 +242,6 @@ public class BtreeIndex extends BaseIndex implements RecordReader { ...@@ -242,15 +242,6 @@ public class BtreeIndex extends BaseIndex implements RecordReader {
} }
} }
public int getLookupCost(int rowCount) {
for (int i = 0, j = 1;; i++) {
j *= BtreePage.BLOCKS_PER_PAGE;
if (j > rowCount) {
return (i + 1);
}
}
}
public double getCost(Session session, int[] masks) throws SQLException { public double getCost(Session session, int[] masks) throws SQLException {
return 10 * getCostRangeIndex(masks, tableData.getRowCount(session)); return 10 * getCostRangeIndex(masks, tableData.getRowCount(session));
} }
......
...@@ -142,9 +142,5 @@ public class IndexCondition { ...@@ -142,9 +142,5 @@ public class IndexCondition {
public boolean isEvaluatable() { public boolean isEvaluatable() {
return expression.isEverything(ExpressionVisitor.EVALUATABLE); return expression.isEverything(ExpressionVisitor.EVALUATABLE);
} }
public Expression getExpression() {
return expression;
}
} }
...@@ -132,15 +132,6 @@ public class LinkedIndex extends BaseIndex { ...@@ -132,15 +132,6 @@ public class LinkedIndex extends BaseIndex {
} }
} }
public int getLookupCost(int rowCount) {
for (int i = 0, j = 1;; i++) {
j *= 10;
if (j > rowCount) {
return i + 1;
}
}
}
public double getCost(Session session, int[] masks) throws SQLException { public double getCost(Session session, int[] masks) throws SQLException {
return 100 + getCostRangeIndex(masks, rowCount + Constants.COST_ROW_OFFSET); return 100 + getCostRangeIndex(masks, rowCount + Constants.COST_ROW_OFFSET);
} }
......
...@@ -309,10 +309,4 @@ public class MultiVersionIndex implements Index { ...@@ -309,10 +309,4 @@ public class MultiVersionIndex implements Index {
base.setTemporary(temporary); base.setTemporary(temporary);
} }
void debug(String s, Session session, SearchRow row) throws SQLException {
// System.out.println(this + " " + s + " session:" +
// (session == null ? -1: session.getId()) + " " +
// (row == null ? "" : row.getValue(0).getString()));
}
} }
...@@ -293,15 +293,6 @@ public class TreeIndex extends BaseIndex { ...@@ -293,15 +293,6 @@ public class TreeIndex extends BaseIndex {
} }
} }
public int getLookupCost(int rowCount) {
for (int i = 0, j = 1;; i++) {
j += j;
if (j >= rowCount) {
return i;
}
}
}
public double getCost(Session session, int[] masks) throws SQLException { public double getCost(Session session, int[] masks) throws SQLException {
return getCostRangeIndex(masks, tableData.getRowCount(session)); return getCostRangeIndex(masks, tableData.getRowCount(session));
} }
......
...@@ -3384,18 +3384,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -3384,18 +3384,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
} }
} }
/**
* Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
* @param length the number of characters
* @throws SQLException if the result set is closed
*/
public void updateNCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
updateNCharacterStream(columnIndex, x, (long) length);
}
/** /**
* Updates a column in the current or insert row. * Updates a column in the current or insert row.
* *
...@@ -3428,18 +3416,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet { ...@@ -3428,18 +3416,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
} }
} }
/**
* Updates a column in the current or insert row.
*
* @param columnName the name of the column label
* @param x the value
* @param length the number of characters
* @throws SQLException if the result set is closed
*/
public void updateNCharacterStream(String columnName, Reader x, int length) throws SQLException {
updateNCharacterStream(columnName, x, (long) length);
}
/** /**
* Updates a column in the current or insert row. * Updates a column in the current or insert row.
* *
......
...@@ -237,7 +237,6 @@ implements XAConnection, XAResource, JdbcConnectionListener ...@@ -237,7 +237,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
list.toArray(result); list.toArray(result);
return result; return result;
} catch (SQLException e) { } catch (SQLException e) {
getTrace().debug("throw XAException.XAER_RMERR", e);
throw new XAException(XAException.XAER_RMERR); throw new XAException(XAException.XAER_RMERR);
} finally { } finally {
JdbcUtils.closeSilently(stat); JdbcUtils.closeSilently(stat);
...@@ -257,7 +256,6 @@ implements XAConnection, XAResource, JdbcConnectionListener ...@@ -257,7 +256,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
} }
checkOpen(); checkOpen();
if (!currentTransaction.equals(xid)) { if (!currentTransaction.equals(xid)) {
getTrace().debug("throw XAException.XAER_INVAL");
throw new XAException(XAException.XAER_INVAL); throw new XAException(XAException.XAER_INVAL);
} }
Statement stat = null; Statement stat = null;
...@@ -270,7 +268,6 @@ implements XAConnection, XAResource, JdbcConnectionListener ...@@ -270,7 +268,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
} finally { } finally {
JdbcUtils.closeSilently(stat); JdbcUtils.closeSilently(stat);
} }
getTrace().debug("return XA_OK");
return XA_OK; return XA_OK;
} }
//## Java 1.4 end ## //## Java 1.4 end ##
...@@ -304,7 +301,6 @@ implements XAConnection, XAResource, JdbcConnectionListener ...@@ -304,7 +301,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
} catch (SQLException e) { } catch (SQLException e) {
throw convertException(e); throw convertException(e);
} }
getTrace().debug("rolled back");
currentTransaction = null; currentTransaction = null;
} }
//## Java 1.4 end ## //## Java 1.4 end ##
...@@ -325,7 +321,6 @@ implements XAConnection, XAResource, JdbcConnectionListener ...@@ -325,7 +321,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
return; return;
} }
if (!currentTransaction.equals(xid)) { if (!currentTransaction.equals(xid)) {
getTrace().debug("throw XAException.XAER_OUTSIDE");
throw new XAException(XAException.XAER_OUTSIDE); throw new XAException(XAException.XAER_OUTSIDE);
} }
} }
...@@ -346,7 +341,6 @@ implements XAConnection, XAResource, JdbcConnectionListener ...@@ -346,7 +341,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
return; return;
} }
if (currentTransaction != null) { if (currentTransaction != null) {
getTrace().debug("throw XAException.XAER_NOTA");
throw new XAException(XAException.XAER_NOTA); throw new XAException(XAException.XAER_NOTA);
} }
try { try {
...@@ -354,7 +348,6 @@ implements XAConnection, XAResource, JdbcConnectionListener ...@@ -354,7 +348,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
} catch (SQLException e) { } catch (SQLException e) {
throw convertException(e); throw convertException(e);
} }
getTrace().debug("currentTransaction=xid");
currentTransaction = xid; currentTransaction = xid;
} }
//## Java 1.4 end ## //## Java 1.4 end ##
...@@ -383,7 +376,6 @@ implements XAConnection, XAResource, JdbcConnectionListener ...@@ -383,7 +376,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
} finally { } finally {
JdbcUtils.closeSilently(stat); JdbcUtils.closeSilently(stat);
} }
getTrace().debug("committed");
currentTransaction = null; currentTransaction = null;
} }
//## Java 1.4 end ## //## Java 1.4 end ##
...@@ -437,10 +429,9 @@ implements XAConnection, XAResource, JdbcConnectionListener ...@@ -437,10 +429,9 @@ implements XAConnection, XAResource, JdbcConnectionListener
} }
private XAException convertException(SQLException e) { private XAException convertException(SQLException e) {
if (isDebugEnabled()) { XAException xa = new XAException(e.getMessage());
getTrace().debug("throw XAException("+e.getMessage()+");"); xa.initCause(e);
} return xa;
return new XAException(e.getMessage());
} }
private String quoteXid(Xid xid) { private String quoteXid(Xid xid) {
...@@ -494,7 +485,6 @@ implements XAConnection, XAResource, JdbcConnectionListener ...@@ -494,7 +485,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
private void checkOpen() throws XAException { private void checkOpen() throws XAException {
if (conn == null) { if (conn == null) {
getTrace().debug("conn==null");
throw new XAException(XAException.XAER_RMERR); throw new XAException(XAException.XAER_RMERR);
} }
} }
......
...@@ -62,14 +62,6 @@ public class InDoubtTransaction { ...@@ -62,14 +62,6 @@ public class InDoubtTransaction {
} }
} }
public int getPos() {
return pos;
}
public int getSessionId() {
return sessionId;
}
public String getTransaction() { public String getTransaction() {
return transaction; return transaction;
} }
......
...@@ -68,10 +68,6 @@ public class TraceObject { ...@@ -68,10 +68,6 @@ public class TraceObject {
return trace.isInfoEnabled(); return trace.isInfoEnabled();
} }
protected Trace getTrace() {
return trace;
}
protected void debugCodeAssign(String className, int type, int id, String value) { protected void debugCodeAssign(String className, int type, int id, String value) {
if (trace.isDebugEnabled()) { if (trace.isDebugEnabled()) {
trace.debugCode(className + " " + PREFIX[type] + id + " = " + getTraceObjectName() + "." + value + ";"); trace.debugCode(className + " " + PREFIX[type] + id + " = " + getTraceObjectName() + "." + value + ";");
......
...@@ -2696,7 +2696,7 @@ CSVREAD(fileNameString [, columnNamesString [, charsetString [, fieldSeparatorSt ...@@ -2696,7 +2696,7 @@ CSVREAD(fileNameString [, columnNamesString [, charsetString [, fieldSeparatorSt
[, escapeCharacterString [, nullString]]]]]]): resultSet [, escapeCharacterString [, nullString]]]]]]): resultSet
"," ","
Returns the result set of reading the CSV (comma separated values) file. Returns the result set of reading the CSV (comma separated values) file.
If the column names are specified (a comma separated list of column names), If the column names are specified (a list of column names separated with the fieldSeparator),
those are used they are read from the file, otherwise (or if they are set to NULL) the first line those are used they are read from the file, otherwise (or if they are set to NULL) the first line
of the file is interpreted as the column names. of the file is interpreted as the column names.
The default charset is the default value for this system, and the default field separator is a comma. The default charset is the default value for this system, and the default field separator is a comma.
...@@ -2705,7 +2705,9 @@ This function can be used like a table: SELECT * FROM CSVREAD(...). ...@@ -2705,7 +2705,9 @@ This function can be used like a table: SELECT * FROM CSVREAD(...).
Instead of a file, an URL may be used, for example jar:file:///c:/temp/example.zip!/org/example/nested.zip. Instead of a file, an URL may be used, for example jar:file:///c:/temp/example.zip!/org/example/nested.zip.
Admin rights are required to execute this command. Admin rights are required to execute this command.
"," ","
CALL CSVREAD('test.csv') CALL CSVREAD('test.csv');
-- Read a file containing the columns ID, NAME with UTF-8 encoding and the pipe (|) as field separator
CALL CSVREAD('test2.csv', 'ID|NAME', 'UTF-8', '|');
" "
"Functions (System)","CSVWRITE"," "Functions (System)","CSVWRITE","
...@@ -2720,7 +2722,9 @@ The default line separator is the default value for this system ('line.separator ...@@ -2720,7 +2722,9 @@ The default line separator is the default value for this system ('line.separator
The returned value is the number or rows written. The returned value is the number or rows written.
Admin rights are required to execute this command. Admin rights are required to execute this command.
"," ","
CALL CSVWRITE('test.csv', 'SELECT * FROM TEST') CALL CSVWRITE('test.csv', 'SELECT * FROM TEST');
-- Write a file with UTF-8 encoding and the pipe (|) as field separator
CALL CSVWRITE('test2.csv', 'SELECT * FROM TEST', 'UTF-8', '|');
" "
"Functions (System)","DATABASE"," "Functions (System)","DATABASE","
...@@ -2728,7 +2732,7 @@ DATABASE(): string ...@@ -2728,7 +2732,7 @@ DATABASE(): string
"," ","
Returns the name of the database. Returns the name of the database.
"," ","
DATABASE() CALL DATABASE();
" "
"Functions (System)","DATABASE_PATH"," "Functions (System)","DATABASE_PATH","
...@@ -2737,7 +2741,7 @@ DATABASE_PATH(): string ...@@ -2737,7 +2741,7 @@ DATABASE_PATH(): string
Returns the directory of the database files and the database name, if it is file based. Returns the directory of the database files and the database name, if it is file based.
Returns NULL otherwise. Returns NULL otherwise.
"," ","
DATABASE_PATH() CALL DATABASE_PATH();
" "
"Functions (System)","FILE_READ"," "Functions (System)","FILE_READ","
...@@ -2759,7 +2763,7 @@ GREATEST(aValue, bValue [,...]): value ...@@ -2759,7 +2763,7 @@ GREATEST(aValue, bValue [,...]): value
"," ","
Returns the largest value that is not NULL, or NULL if all values are NULL. Returns the largest value that is not NULL, or NULL if all values are NULL.
"," ","
GREATEST(A, B, C) CALL GREATEST(1, 2, 3);
" "
"Functions (System)","IDENTITY"," "Functions (System)","IDENTITY","
...@@ -2767,7 +2771,7 @@ IDENTITY(): long ...@@ -2767,7 +2771,7 @@ IDENTITY(): long
"," ","
Returns the last inserted identity value for this session. Returns the last inserted identity value for this session.
"," ","
IDENTITY() CALL IDENTITY();
" "
"Functions (System)","IFNULL"," "Functions (System)","IFNULL","
...@@ -2775,7 +2779,7 @@ IFNULL(aValue, bValue): value ...@@ -2775,7 +2779,7 @@ IFNULL(aValue, bValue): value
"," ","
Returns the value of 'a' if it is not null, otherwise 'b'. Returns the value of 'a' if it is not null, otherwise 'b'.
"," ","
IFNULL(A, B) CALL IFNULL(NULL, '');
" "
"Functions (System)","LEAST"," "Functions (System)","LEAST","
...@@ -2783,7 +2787,7 @@ LEAST(aValue, bValue [,...]): value ...@@ -2783,7 +2787,7 @@ LEAST(aValue, bValue [,...]): value
"," ","
Returns the smallest value that is not NULL, or NULL if all values are NULL. Returns the smallest value that is not NULL, or NULL if all values are NULL.
"," ","
LEAST(A, B, C) CALL LEAST(1, 2, 3);
" "
"Functions (System)","LOCK_MODE"," "Functions (System)","LOCK_MODE","
...@@ -2791,7 +2795,7 @@ LOCK_MODE(): int ...@@ -2791,7 +2795,7 @@ LOCK_MODE(): int
"," ","
Returns the current lock mode. See SET LOCK_MODE. Returns the current lock mode. See SET LOCK_MODE.
"," ","
LOCK_MODE() CALL LOCK_MODE();
" "
"Functions (System)","LOCK_TIMEOUT"," "Functions (System)","LOCK_TIMEOUT","
......
...@@ -43,8 +43,6 @@ public class LocalResult implements ResultInterface { ...@@ -43,8 +43,6 @@ public class LocalResult implements ResultInterface {
private int offset, limit; private int offset, limit;
private ResultExternal disk; private ResultExternal disk;
private int diskOffset; private int diskOffset;
private boolean isUpdateCount;
private int updateCount;
private boolean distinct; private boolean distinct;
private boolean closed; private boolean closed;
...@@ -82,16 +80,27 @@ public class LocalResult implements ResultInterface { ...@@ -82,16 +80,27 @@ public class LocalResult implements ResultInterface {
return cols; return cols;
} }
public LocalResult(int updateCount) { public LocalResult() {
this.isUpdateCount = true; }
this.updateCount = updateCount;
public LocalResult(Session session, Expression[] expressions, int visibleColumnCount) {
this.session = session;
if (session == null) {
this.maxMemoryRows = Integer.MAX_VALUE;
} else {
this.maxMemoryRows = session.getDatabase().getMaxMemoryRows();
}
rows = new ObjectArray();
this.visibleColumnCount = visibleColumnCount;
rowId = -1;
this.expressions = expressions;
} }
public LocalResult createShallowCopy(Session session) { public LocalResult createShallowCopy(Session session) {
if (disk == null && (rows == null || rows.size() < rowCount)) { if (disk == null && (rows == null || rows.size() < rowCount)) {
return null; return null;
} }
LocalResult copy = new LocalResult(0); LocalResult copy = new LocalResult();
copy.maxMemoryRows = this.maxMemoryRows; copy.maxMemoryRows = this.maxMemoryRows;
copy.session = session; copy.session = session;
copy.visibleColumnCount = this.visibleColumnCount; copy.visibleColumnCount = this.visibleColumnCount;
...@@ -107,19 +116,9 @@ public class LocalResult implements ResultInterface { ...@@ -107,19 +116,9 @@ public class LocalResult implements ResultInterface {
copy.limit = 0; copy.limit = 0;
copy.disk = this.disk; copy.disk = this.disk;
copy.diskOffset = this.diskOffset; copy.diskOffset = this.diskOffset;
copy.isUpdateCount = this.isUpdateCount;
copy.updateCount = this.updateCount;
return copy; return copy;
} }
public boolean isUpdateCount() {
return isUpdateCount;
}
public int getUpdateCount() {
return updateCount;
}
public LocalResult(Session session, ObjectArray expressionList, int visibleColumnCount) { public LocalResult(Session session, ObjectArray expressionList, int visibleColumnCount) {
this(session, getList(expressionList), visibleColumnCount); this(session, getList(expressionList), visibleColumnCount);
} }
...@@ -130,19 +129,6 @@ public class LocalResult implements ResultInterface { ...@@ -130,19 +129,6 @@ public class LocalResult implements ResultInterface {
return expressions; return expressions;
} }
public LocalResult(Session session, Expression[] expressions, int visibleColumnCount) {
this.session = session;
if (session == null) {
this.maxMemoryRows = Integer.MAX_VALUE;
} else {
this.maxMemoryRows = session.getDatabase().getMaxMemoryRows();
}
rows = new ObjectArray();
this.visibleColumnCount = visibleColumnCount;
rowId = -1;
this.expressions = expressions;
}
public void setSortOrder(SortOrder sort) { public void setSortOrder(SortOrder sort) {
this.sort = sort; this.sort = sort;
} }
......
...@@ -144,17 +144,4 @@ public interface ResultInterface { ...@@ -144,17 +144,4 @@ public interface ResultInterface {
*/ */
int getNullable(int i); int getNullable(int i);
/**
* Check if this result is in fact an update count.
*
* @return if it is an update count
*/
boolean isUpdateCount();
/**
* Get the update count for this result.
*
* @return the update count
*/
int getUpdateCount();
} }
...@@ -34,14 +34,6 @@ public class ResultRemote implements ResultInterface { ...@@ -34,14 +34,6 @@ public class ResultRemote implements ResultInterface {
private ObjectArray result; private ObjectArray result;
private ObjectArray lobValues; private ObjectArray lobValues;
public boolean isUpdateCount() {
return false;
}
public int getUpdateCount() {
return 0;
}
public ResultRemote(SessionRemote session, Transfer transfer, int id, int columnCount, int fetchSize) public ResultRemote(SessionRemote session, Transfer transfer, int id, int columnCount, int fetchSize)
throws IOException, SQLException { throws IOException, SQLException {
this.session = session; this.session = session;
......
...@@ -40,11 +40,6 @@ public class Row extends Record implements SearchRow { ...@@ -40,11 +40,6 @@ public class Row extends Record implements SearchRow {
this.version = version; this.version = version;
} }
public Row(Row old) {
this.data = old.data;
this.memory = old.memory;
}
public Value getValue(int i) { public Value getValue(int i) {
return data[i]; return data[i];
} }
......
...@@ -32,10 +32,6 @@ public class SimpleRowValue implements SearchRow { ...@@ -32,10 +32,6 @@ public class SimpleRowValue implements SearchRow {
return version; return version;
} }
public void setVersion(int version) {
this.version = version;
}
public int getColumnCount() { public int getColumnCount() {
return virtualColumnCount; return virtualColumnCount;
} }
......
...@@ -100,20 +100,6 @@ public class TcpServer implements Service { ...@@ -100,20 +100,6 @@ public class TcpServer implements Service {
SERVERS.put("" + port, this); SERVERS.put("" + port, this);
} }
/**
* Get the list of ports of all running TCP server.
*
* @return the list of ports
*/
public static int[] getAllServerPorts() {
Object[] servers = SERVERS.keySet().toArray();
int[] ports = new int[servers.length];
for (int i = 0; i < servers.length; i++) {
ports[i] = Integer.parseInt(servers[i].toString());
}
return ports;
}
synchronized void addConnection(int id, String url, String user) { synchronized void addConnection(int id, String url, String user) {
try { try {
managementDbAdd.setInt(1, id); managementDbAdd.setInt(1, id);
...@@ -280,6 +266,14 @@ public class TcpServer implements Service { ...@@ -280,6 +266,14 @@ public class TcpServer implements Service {
} }
} }
/**
* Stop a running server. This method is called via reflection from the
* STOP_SERVER function.
*
* @param port the port where the server runs
* @param password the password
* @param shutdownMode the shutdown mode, SHUTDOWN_NORMAL or SHUTDOWN_FORCE.
*/
public static void stopServer(int port, String password, int shutdownMode) { public static void stopServer(int port, String password, int shutdownMode) {
TcpServer server = (TcpServer) SERVERS.get("" + port); TcpServer server = (TcpServer) SERVERS.get("" + port);
if (server == null) { if (server == null) {
......
...@@ -243,12 +243,26 @@ public class PgServer implements Service { ...@@ -243,12 +243,26 @@ public class PgServer implements Service {
} }
} }
/**
* Get the name of the current schema.
* This method is called by the database.
*
* @param conn the connection
* @return the schema name
*/
public static String getCurrentSchema(Connection conn) throws SQLException { public static String getCurrentSchema(Connection conn) throws SQLException {
ResultSet rs = conn.createStatement().executeQuery("call schema()"); ResultSet rs = conn.createStatement().executeQuery("call schema()");
rs.next(); rs.next();
return rs.getString(1); return rs.getString(1);
} }
/**
* Get the name of this encoding code.
* This method is called by the database.
*
* @param code the encoding code
* @return the encoding name
*/
public static String getEncodingName(int code) throws SQLException { public static String getEncodingName(int code) throws SQLException {
switch (code) { switch (code) {
case 0: case 0:
...@@ -262,14 +276,34 @@ public class PgServer implements Service { ...@@ -262,14 +276,34 @@ public class PgServer implements Service {
} }
} }
/**
* Get the version. This method must return PostgreSQL to keep some clients
* happy. This method is called by the database.
*
* @return the server name and version
*/
public static String getVersion() { public static String getVersion() {
return "PostgreSQL 8.1.4 server protocol using H2 " + Constants.getFullVersion(); return "PostgreSQL 8.1.4 server protocol using H2 " + Constants.getFullVersion();
} }
/**
* Get the current system time.
* This method is called by the database.
*
* @return the current system time
*/
public static Timestamp getStartTime() { public static Timestamp getStartTime() {
return new Timestamp(System.currentTimeMillis()); return new Timestamp(System.currentTimeMillis());
} }
/**
* Get the user name for this id.
* This method is called by the database.
*
* @param conn the connection
* @param id the user id
* @return the user name
*/
public static String getUserById(Connection conn, int id) throws SQLException { public static String getUserById(Connection conn, int id) throws SQLException {
PreparedStatement prep = conn.prepareStatement("SELECT NAME FROM INFORMATION_SCHEMA.USERS WHERE ID=?"); PreparedStatement prep = conn.prepareStatement("SELECT NAME FROM INFORMATION_SCHEMA.USERS WHERE ID=?");
prep.setInt(1, id); prep.setInt(1, id);
...@@ -280,14 +314,38 @@ public class PgServer implements Service { ...@@ -280,14 +314,38 @@ public class PgServer implements Service {
return null; return null;
} }
/**
* Check if the this session has the given database privilege.
* This method is called by the database.
*
* @param id the session id
* @param privilege the privilege to check
* @return true
*/
public static boolean hasDatabasePrivilege(int id, String privilege) { public static boolean hasDatabasePrivilege(int id, String privilege) {
return true; return true;
} }
/**
* Check if the current session has access to this table.
* This method is called by the database.
*
* @param table the table name
* @param privilege the privilege to check
* @return true
*/
public static boolean hasTablePrivilege(String table, String privilege) { public static boolean hasTablePrivilege(String table, String privilege) {
return true; return true;
} }
/**
* Get the current transaction id.
* This method is called by the database.
*
* @param table the table name
* @param id the id
* @return 1
*/
public static int getCurrentTid(String table, String id) { public static int getCurrentTid(String table, String id) {
return 1; return 1;
} }
......
...@@ -133,11 +133,6 @@ public class WebServer implements Service { ...@@ -133,11 +133,6 @@ public class WebServer implements Service {
return data; return data;
} }
String getTextFile(String file) throws IOException {
byte[] bytes = getFile(file);
return new String(bytes);
}
synchronized void remove(WebThread t) { synchronized void remove(WebThread t) {
running.remove(t); running.remove(t);
} }
......
...@@ -114,11 +114,6 @@ public class FileStore { ...@@ -114,11 +114,6 @@ public class FileStore {
} }
} }
protected FileStore(DataHandler handler, byte[] magic) {
this.handler = handler;
this.magic = magic;
}
protected byte[] generateSalt() { protected byte[] generateSalt() {
return magic; return magic;
} }
......
...@@ -524,7 +524,7 @@ public class Column { ...@@ -524,7 +524,7 @@ public class Column {
} }
boolean isEverything(ExpressionVisitor visitor) { boolean isEverything(ExpressionVisitor visitor) {
if (visitor.type == ExpressionVisitor.GET_DEPENDENCIES) { if (visitor.getType() == ExpressionVisitor.GET_DEPENDENCIES) {
if (sequence != null) { if (sequence != null) {
visitor.getDependencies().add(sequence); visitor.getDependencies().add(sequence);
} }
......
...@@ -138,7 +138,7 @@ public class FunctionTable extends Table { ...@@ -138,7 +138,7 @@ public class FunctionTable extends Table {
function.optimize(session); function.optimize(session);
Value v = function.getValue(session); Value v = function.getValue(session);
if (v == ValueNull.INSTANCE) { if (v == ValueNull.INSTANCE) {
return new LocalResult(0); return new LocalResult();
} else { } else {
ValueResultSet value = (ValueResultSet) v; ValueResultSet value = (ValueResultSet) v;
ResultSet rs = value.getResultSet(); ResultSet rs = value.getResultSet();
......
...@@ -1279,10 +1279,6 @@ public class MetaTable extends Table { ...@@ -1279,10 +1279,6 @@ public class MetaTable extends Table {
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
public void removeIndex(String indexName) throws SQLException {
throw Message.getUnsupportedException();
}
public void removeChildrenAndResources(Session session) throws SQLException { public void removeChildrenAndResources(Session session) throws SQLException {
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
} }
......
...@@ -607,14 +607,6 @@ public abstract class Table extends SchemaObjectBase { ...@@ -607,14 +607,6 @@ public abstract class Table extends SchemaObjectBase {
} }
} }
public Column[] getColumns(String[] columnNames) throws SQLException {
Column[] cols = new Column[columnNames.length];
for (int i = 0; i < cols.length; i++) {
cols[i] = getColumn(columnNames[i]);
}
return cols;
}
public boolean getGlobalTemporary() { public boolean getGlobalTemporary() {
return false; return false;
} }
......
...@@ -177,10 +177,6 @@ public class TableView extends Table { ...@@ -177,10 +177,6 @@ public class TableView extends Table {
return false; return false;
} }
public void removeIndex(String indexName) throws SQLException {
throw Message.getUnsupportedException();
}
public Index addIndex(Session session, String indexName, int indexId, IndexColumn[] cols, IndexType indexType, public Index addIndex(Session session, String indexName, int indexId, IndexColumn[] cols, IndexType indexType,
int headPos, String comment) throws SQLException { int headPos, String comment) throws SQLException {
throw Message.getUnsupportedException(); throw Message.getUnsupportedException();
...@@ -253,10 +249,6 @@ public class TableView extends Table { ...@@ -253,10 +249,6 @@ public class TableView extends Table {
return null; return null;
} }
public ObjectArray getTables() {
return tables;
}
public void recompile(Session session) throws SQLException { public void recompile(Session session) throws SQLException {
for (int i = 0; i < tables.size(); i++) { for (int i = 0; i < tables.size(); i++) {
Table t = (Table) tables.get(i); Table t = (Table) tables.get(i);
......
...@@ -250,10 +250,6 @@ public class IOUtils { ...@@ -250,10 +250,6 @@ public class IOUtils {
return new ByteArrayInputStream(StringUtils.utf8Encode(s)); return new ByteArrayInputStream(StringUtils.utf8Encode(s));
} }
public static InputStream getInputStream(Reader x) throws SQLException {
return x == null ? null : new ReaderInputStream(x);
}
public static Reader getReader(String s) { public static Reader getReader(String s) {
return s == null ? null : new StringReader(s); return s == null ? null : new StringReader(s);
} }
......
...@@ -62,9 +62,6 @@ public class DataType { ...@@ -62,9 +62,6 @@ public class DataType {
public boolean hidden; public boolean hidden;
public int memory; public int memory;
// for operations that include different types, convert both to the higher order
public int order;
// JDK 1.3 compatibility: Types.BOOLEAN // JDK 1.3 compatibility: Types.BOOLEAN
public static final int TYPE_BOOLEAN = 16; public static final int TYPE_BOOLEAN = 16;
...@@ -276,10 +273,6 @@ public class DataType { ...@@ -276,10 +273,6 @@ public class DataType {
} }
} }
public static String getJdbcString(int type) {
return typesByValueType[type].jdbc;
}
private static DataType createDecimal(int maxPrecision, int defaultPrecision, int defaultScale, int defaultDisplaySize, boolean needsPrecisionAndScale, boolean autoInc) { private static DataType createDecimal(int maxPrecision, int defaultPrecision, int defaultScale, int defaultDisplaySize, boolean needsPrecisionAndScale, boolean autoInc) {
DataType dataType = new DataType(); DataType dataType = new DataType();
dataType.maxPrecision = maxPrecision; dataType.maxPrecision = maxPrecision;
......
...@@ -160,6 +160,19 @@ java org.h2.test.TestAll timer ...@@ -160,6 +160,19 @@ java org.h2.test.TestAll timer
/* /*
-- Wildcard schema bug:
create schema a;
create table a.x(ax int);
create schema b;
create table b.x(bx int);
select * from a.x, b.x;
in help.csv, use complete examples for functions; add a test case
upload and test javadoc/index.html
Test Bnf.COMBINE_KEYWORDS
improve javadocs improve javadocs
write complete page right after checkpoint write complete page right after checkpoint
......
...@@ -11,6 +11,7 @@ import java.io.InputStream; ...@@ -11,6 +11,7 @@ import java.io.InputStream;
import java.io.Reader; import java.io.Reader;
import java.io.StringReader; import java.io.StringReader;
import org.h2.dev.util.ReaderInputStream;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.util.IOUtils; import org.h2.util.IOUtils;
...@@ -22,7 +23,7 @@ public class TestReader extends TestBase { ...@@ -22,7 +23,7 @@ public class TestReader extends TestBase {
public void test() throws Exception { public void test() throws Exception {
String s = "\u00ef\u00f6\u00fc"; String s = "\u00ef\u00f6\u00fc";
StringReader r = new StringReader(s); StringReader r = new StringReader(s);
InputStream in = IOUtils.getInputStream(r); InputStream in = new ReaderInputStream(r);
byte[] buff = IOUtils.readBytesAndClose(in, 0); byte[] buff = IOUtils.readBytesAndClose(in, 0);
InputStream in2 = new ByteArrayInputStream(buff); InputStream in2 = new ByteArrayInputStream(buff);
Reader r2 = IOUtils.getReader(in2); Reader r2 = IOUtils.getReader(in2);
......
...@@ -509,5 +509,5 @@ worldwide everyone additions expense lawsuit checksums jazoon flashback ...@@ -509,5 +509,5 @@ worldwide everyone additions expense lawsuit checksums jazoon flashback
dieguez dfile mvn dversion dgroup dpackaging dartifact durl dpom pom dieguez dfile mvn dversion dgroup dpackaging dartifact durl dpom pom
subpackages slowed deactivate throttled noindex expired arizona export subpackages slowed deactivate throttled noindex expired arizona export
intentional knowing jcl plug facade deployment logback confusion visited intentional knowing jcl plug facade deployment logback confusion visited
pickle associate subtraction negation multiplication connector derbynet pickle associate subtraction negation multiplication visitors sharp connector
derbyclient derbynet ado happy derbyclient
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* (http://h2database.com/html/license.html). * (http://h2database.com/html/license.html).
* Initial Developer: H2 Group * Initial Developer: H2 Group
*/ */
package org.h2.dev.net; package org.h2.dev.util;
import java.util.Random; import java.util.Random;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* (http://h2database.com/html/license.html). * (http://h2database.com/html/license.html).
* Initial Developer: H2 Group * Initial Developer: H2 Group
*/ */
package org.h2.util; package org.h2.dev.util;
import java.io.BufferedWriter; import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2008 H2 Group. Multiple-Licensed under the H2 License, Version 1.0,,
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>
Javadoc package documentation
</title></head><body style="font: 9pt/130% Tahoma, Arial, Helvetica, sans-serif; font-weight: normal;">
Utility classes that are currently not used in the database engine.
</body></html>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论