提交 b4fd4d5f authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Do not quote name of _ROWID_ pseudocolumn

上级 801e2304
......@@ -876,6 +876,7 @@ public class MVTable extends TableBase {
if (rowIdColumn == null) {
rowIdColumn = new Column(Column.ROWID, Value.LONG);
rowIdColumn.setTable(this, SearchRow.ROWID_INDEX);
rowIdColumn.setRowId(true);
}
return rowIdColumn;
}
......
......@@ -84,6 +84,7 @@ public class Column {
private String comment;
private boolean primaryKey;
private boolean visible = true;
private boolean rowId;
private Domain domain;
/**
......@@ -288,11 +289,11 @@ public class Column {
}
public String getSQL() {
return Parser.quoteIdentifier(name);
return rowId ? name : Parser.quoteIdentifier(name);
}
public StringBuilder getSQL(StringBuilder builder) {
return Parser.quoteIdentifier(builder, name);
return rowId ? builder.append(name) : Parser.quoteIdentifier(builder, name);
}
public String getName() {
......@@ -323,6 +324,24 @@ public class Column {
this.domain = domain;
}
/**
* Returns whether this column is a row identity column.
*
* @return true for _ROWID_ column, false otherwise
*/
public boolean isRowId() {
return rowId;
}
/**
* Set row identity flag.
*
* @param rowId true _ROWID_ column, false otherwise
*/
public void setRowId(boolean rowId) {
this.rowId = rowId;
}
/**
* Validate the value, convert it if required, and update the sequence value
* if required. If the value is null, the default value (NULL if no default
......
......@@ -729,6 +729,7 @@ public class RegularTable extends TableBase {
if (rowIdColumn == null) {
rowIdColumn = new Column(Column.ROWID, Value.LONG);
rowIdColumn.setTable(this, -1);
rowIdColumn.setRowId(true);
}
return rowIdColumn;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论