File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -1566,8 +1566,22 @@ bool METD_get_view_relation(jrd_tra* transaction, DsqlCompilerScratch* dsqlScrat
15661566 {
15671567 QualifiedName relationName(X.RDB$RELATION_NAME, X.RDB$RELATION_SCHEMA_NAME);
15681568
1569+ ObjectsArray<QualifiedMetaString> contextName;
1570+ try
1571+ {
1572+ QualifiedMetaString::parseSchemaObjectListNoSep(X.RDB$CONTEXT_NAME, contextName);
1573+ }
1574+ catch (const status_exception&)
1575+ {
1576+ // Legacy (restored from backups) data stored in RDB$CONTEXT_NAME may cause exceptions.
1577+ contextName.clear();
1578+ contextName.push(QualifiedMetaString(X.RDB$CONTEXT_NAME));
1579+ }
1580+
15691581 if (PASS1_compare_alias(relationName, relation_or_alias) ||
1570- (relation_or_alias.schema.isEmpty() && relation_or_alias.object == X.RDB$CONTEXT_NAME))
1582+ (relation_or_alias.schema.isEmpty() &&
1583+ contextName.getCount() == 1 &&
1584+ PASS1_compare_alias(contextName[0], relation_or_alias)))
15711585 {
15721586 if ((relation = METD_get_relation(transaction, dsqlScratch, relationName)))
15731587 return true;
You can’t perform that action at this time.
0 commit comments