提交 2b2adb7c authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 dd54730f
......@@ -70,10 +70,27 @@ public class ConstraintReferential extends Constraint {
}
}
/**
* Create the SQL statement of this object so a copy of the table can be made.
*
* @param table the table to create the object for
* @param quotedName the name of this object (quoted if necessary)
* @return the SQL statement
*/
public String getCreateSQLForCopy(Table table, String quotedName) {
return getCreateSQLForCopy(table, refTable, quotedName, true);
}
int test;
/**
* Create the SQL statement of this object so a copy of the table can be made.
*
* @param table the table to create the object for
* @param refTable the referenced table
* @param quotedName the name of this object (quoted if necessary)
* @param internalIndex add the index name to the statement
* @return the SQL statement
*/
public String getCreateSQLForCopy(Table table, Table refTable, String quotedName, boolean internalIndex) {
StringBuffer buff = new StringBuffer();
buff.append("ALTER TABLE ");
......
......@@ -40,7 +40,7 @@ public class ConstraintUnique extends Constraint {
return getCreateSQLForCopy(table, quotedName, true);
}
public String getCreateSQLForCopy(Table table, String quotedName, boolean internalIndex) {
private String getCreateSQLForCopy(Table table, String quotedName, boolean internalIndex) {
StringBuffer buff = new StringBuffer();
buff.append("ALTER TABLE ");
buff.append(table.getSQL());
......
......@@ -1088,6 +1088,13 @@ public class Database implements DataHandler {
addMeta(session, obj);
}
/**
* Rename a schema object.
*
* @param session the session
* @param obj the object
* @param newName the new name
*/
public synchronized void renameSchemaObject(Session session, SchemaObject obj, String newName) throws SQLException {
obj.getSchema().rename(obj, newName);
updateWithChildren(session, obj);
......@@ -1109,6 +1116,13 @@ public class Database implements DataHandler {
}
}
/**
* Rename a database object.
*
* @param session the session
* @param obj the object
* @param newName the new name
*/
public synchronized void renameDatabaseObject(Session session, DbObject obj, String newName) throws SQLException {
int type = obj.getType();
HashMap map = getMap(type);
......@@ -1177,6 +1191,14 @@ public class Database implements DataHandler {
}
}
/**
* Get or create the specified storage object.
*
* @param reader the record reader
* @param id the object id
* @param dataFile true if the data is in the data file
* @return the storage
*/
public Storage getStorage(RecordReader reader, int id, boolean dataFile) {
DiskFile file;
if (dataFile) {
......@@ -1421,6 +1443,16 @@ public class Database implements DataHandler {
}
}
/**
* Set the progress of a long running operation.
* This method calls the {@link DatabaseEventListener} if one is registered.
*
* @param state the {@link DatabaseEventListener} state
* @param name the object name
* @param x the current position
* @param max the highest value
*/
public void setProgress(int state, String name, int x, int max) {
if (eventListener != null) {
try {
......
......@@ -153,6 +153,14 @@ public class FunctionAlias extends DbObjectBase {
return getValue(session, args, false);
}
/**
* Call the user defined function and return the value.
*
* @param session the session
* @param args the argument list
* @param columnList true if the function should only return the column list
* @return the value
*/
public synchronized Value getValue(Session session, Expression[] args, boolean columnList) throws SQLException {
load();
Class[] paramClasses = javaMethod.getParameterTypes();
......
......@@ -94,6 +94,13 @@ public abstract class RightOwner extends DbObjectBase {
}
}
/**
* Grant a role to this object.
*
* @param session the session
* @param role the role
* @param right the right to grant
*/
public void grantRole(Session session, Role role, Right right) {
if (grantedRoles == null) {
grantedRoles = new HashMap();
......
......@@ -358,6 +358,13 @@ public class Session implements SessionInterface {
locks.add(table);
}
/**
* Add an undo log entry to this session.
*
* @param table the table
* @param type the operation type (see {@link UndoLogRecord})
* @param row the row
*/
public void log(Table table, short type, Row row) throws SQLException {
log(new UndoLogRecord(table, type, row));
}
......
......@@ -259,6 +259,14 @@ public class CompareLike extends Condition {
return si == sLen;
}
/**
* Test if the value matches the pattern.
*
* @param pattern the pattern
* @param value the value
* @param escape the escape character
* @return true if the value matches
*/
public boolean test(String pattern, String value, char escape) throws SQLException {
initPattern(pattern, escape);
return compareAt(value, 0, 0, value.length());
......
......@@ -176,7 +176,7 @@ public class Comparison extends Condition {
return ValueBoolean.get(result);
}
public static boolean compareNotNull(Database database, Value l, Value r, int compareType) throws SQLException {
static boolean compareNotNull(Database database, Value l, Value r, int compareType) throws SQLException {
boolean result;
switch (compareType) {
case EQUAL:
......
......@@ -379,7 +379,7 @@ public class Function extends Expression implements FunctionCall {
return null;
}
public Value getSimpleValue(Session session, Value v0, Expression[] args) throws SQLException {
private Value getSimpleValue(Session session, Value v0, Expression[] args) throws SQLException {
Value result;
switch (info.type) {
case ABS:
......@@ -1558,6 +1558,14 @@ public class Function extends Expression implements FunctionCall {
}
}
/**
* Set the result data type of this function.
*
* @param dataType the data type
* @param precision the precision
* @param scale the scale
* @param displaySize the display size
*/
public void setDataType(int dataType, long precision, int scale, int displaySize) {
this.dataType = dataType;
this.precision = precision;
......
......@@ -93,7 +93,7 @@ public class TableFunction extends Function implements FunctionCall {
columns.toArray(columnList);
}
public ValueResultSet getTable(Session session, Expression[] args, boolean onlyColumnList, boolean distinct) throws SQLException {
private ValueResultSet getTable(Session session, Expression[] args, boolean onlyColumnList, boolean distinct) throws SQLException {
int len = columnList.length;
Expression[] header = new Expression[len];
Database db = session.getDatabase();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论