提交 0a8384cb authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 2b2adb7c
...@@ -221,7 +221,7 @@ public class BtreeIndex extends BaseIndex implements RecordReader { ...@@ -221,7 +221,7 @@ public class BtreeIndex extends BaseIndex implements RecordReader {
return find(session, first, false, last); return find(session, first, false, last);
} }
public Cursor find(Session session, SearchRow first, boolean bigger, SearchRow last) throws SQLException { private Cursor find(Session session, SearchRow first, boolean bigger, SearchRow last) throws SQLException {
if (SysProperties.CHECK && storage == null) { if (SysProperties.CHECK && storage == null) {
throw Message.getSQLException(ErrorCode.OBJECT_CLOSED); throw Message.getSQLException(ErrorCode.OBJECT_CLOSED);
} }
......
...@@ -530,7 +530,7 @@ public class LogFile { ...@@ -530,7 +530,7 @@ public class LogFile {
} }
} }
public void updatePreparedCommit(boolean commit, int pos, int sessionId, int blocks) throws SQLException { void updatePreparedCommit(boolean commit, int pos, int sessionId, int blocks) throws SQLException {
synchronized (database) { synchronized (database) {
int posNow = getBlock(); int posNow = getBlock();
DataPage buff = rowBuff; DataPage buff = rowBuff;
......
...@@ -365,6 +365,15 @@ public class LogSystem { ...@@ -365,6 +365,15 @@ public class LogSystem {
} }
} }
/**
* Add a truncate entry.
*
* @param session the session
* @param file the disk file
* @param storageId the storage id
* @param recordId the id of the first record
* @param blockCount the number of blocks
*/
public void addTruncate(Session session, DiskFile file, int storageId, int recordId, int blockCount) public void addTruncate(Session session, DiskFile file, int storageId, int recordId, int blockCount)
throws SQLException { throws SQLException {
if (database == null) { if (database == null) {
......
...@@ -293,11 +293,35 @@ public class Schema extends DbObjectBase { ...@@ -293,11 +293,35 @@ public class Schema extends DbObjectBase {
freeUniqueName(objName); freeUniqueName(objName);
} }
public TableData createTable(String tempName, int id, ObjectArray newColumns, boolean persistent, boolean clustered) /**
* Add a {@link TableData} to the schema.
*
* @param tableName the table name
* @param id the object id
* @param columns the column list
* @param persistent if the table should be persistent
* @param clustered if a clustered table should be created
* @return the created {@link TableData} object
*/
public TableData createTable(String tableName, int id, ObjectArray columns, boolean persistent, boolean clustered)
throws SQLException { throws SQLException {
return new TableData(this, tempName, id, newColumns, persistent, clustered); return new TableData(this, tableName, id, columns, persistent, clustered);
} }
/**
* Add a {@link TableLink} to the schema.
*
* @param id the object id
* @param tableName the table name of the alias
* @param driver the driver class name
* @param url the database URL
* @param user the user name
* @param password the password
* @param originalTable the table name of the target table
* @param emitUpdates if updates should be emitted instead of delete/insert
* @param force create the object even if the database can not be accessed
* @return the {@link TableLink} object
*/
public TableLink createTableLink(int id, String tableName, String driver, String url, String user, String password, public TableLink createTableLink(int id, String tableName, String driver, String url, String user, String password,
String originalTable, boolean emitUpdates, boolean force) throws SQLException { String originalTable, boolean emitUpdates, boolean force) throws SQLException {
return new TableLink(this, id, tableName, driver, url, user, password, originalTable, emitUpdates, force); return new TableLink(this, id, tableName, driver, url, user, password, originalTable, emitUpdates, force);
......
...@@ -100,6 +100,14 @@ public class TriggerObject extends SchemaObjectBase { ...@@ -100,6 +100,14 @@ public class TriggerObject extends SchemaObjectBase {
return list; return list;
} }
/**
* Call the fire method of the user defined trigger class.
*
* @param session the session
* @param oldRow the old row
* @param newRow the new row
* @param beforeAction true if this method is called before the operation is applied
*/
public void fireRow(Session session, Row oldRow, Row newRow, boolean beforeAction) throws SQLException { public void fireRow(Session session, Row oldRow, Row newRow, boolean beforeAction) throws SQLException {
if (!rowBased || before != beforeAction) { if (!rowBased || before != beforeAction) {
return; return;
......
...@@ -190,6 +190,17 @@ public class PgServer implements Service { ...@@ -190,6 +190,17 @@ public class PgServer implements Service {
return ifExists; return ifExists;
} }
/**
* The Java implementation of the PostgreSQL function pg_get_indexdef.
* The method is used to get CREATE INDEX command for an index,
* or the column definition of one column in the index.
*
* @param conn the connection
* @param indexId the index id
* @param ordinalPosition the ordinal position (null if the SQL statement should be returned)
* @param pretty this flag is ignored
* @return the SQL statement or the column name
*/
public static String getIndexColumn(Connection conn, int indexId, Integer ordinalPosition, Boolean pretty) public static String getIndexColumn(Connection conn, int indexId, Integer ordinalPosition, Boolean pretty)
throws SQLException { throws SQLException {
if (ordinalPosition == null || ordinalPosition.intValue() == 0) { if (ordinalPosition == null || ordinalPosition.intValue() == 0) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论