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

Small improvements.

上级 523a345d
......@@ -4493,11 +4493,13 @@ public class Parser {
return table;
}
String[] schemaNames = session.getSchemaSearchPath();
for (int i = 0; schemaNames != null && i < schemaNames.length; i++) {
Schema s = database.getSchema(schemaNames[i]);
table = s.findTableOrView(session, tableName);
if (table != null) {
return table;
if (schemaNames != null) {
for (String name : schemaNames) {
Schema s = database.getSchema(name);
table = s.findTableOrView(session, tableName);
if (table != null) {
return table;
}
}
}
throw DbException.get(ErrorCode.TABLE_OR_VIEW_NOT_FOUND_1, tableName);
......
......@@ -220,10 +220,11 @@ public class CreateTable extends SchemaCommand {
*/
private boolean setPrimaryKeyColumns(IndexColumn[] columns) {
if (pkColumns != null) {
if (columns.length != pkColumns.length) {
int len = columns.length;
if (len != pkColumns.length) {
throw DbException.get(ErrorCode.SECOND_PRIMARY_KEY);
}
for (int i = 0; i < columns.length; i++) {
for (int i = 0; i < len; i++) {
if (!columns[i].columnName.equals(pkColumns[i].columnName)) {
throw DbException.get(ErrorCode.SECOND_PRIMARY_KEY);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论