fix resolve bugs

This commit is contained in:
2149
2023-09-13 12:40:24 +00:00
committed by ob-robot
parent 8a9e2edaab
commit 180330fca0
2 changed files with 15 additions and 0 deletions

View File

@ -6807,6 +6807,18 @@ int ObDDLResolver::check_index_name_duplicate(const ObTableSchema &table_schema,
}
}
if (is_oracle_mode() && !has_same_index_name) {
//in oracle mode, names of index and primary key can't be same
ObTableSchema::const_constraint_iterator iter = table_schema.constraint_begin();
for (; !has_same_index_name && iter != table_schema.constraint_end(); ++iter) {
if (CONSTRAINT_TYPE_PRIMARY_KEY == (*iter)->get_constraint_type()) {
if (0 == create_index_arg.index_name_.compare((*iter)->get_constraint_name_str())) {
has_same_index_name = true;
}
}
}
}
return ret;
}

View File

@ -336,6 +336,9 @@ int ObDeleteResolver::find_delete_table_with_mysql_rule(const ObString &db_name,
if (OB_SUCC(ret)) {
if (table_items.count() == 1) {
table_item = const_cast<TableItem*>(table_items.at(0));
if (!db_name.empty() && !table_item->alias_name_.empty()) {
table_item = NULL;
}
} else if (db_name.empty()) {
//如果table_items中有多个table_item,说明delete子句没有指定table的database_name
//而from子句中所有表都是基表,例如delete t1.* from db1.t1, db2.t1;