Skip to content

Commit

Permalink
TEIID-5517 correcting dependency logic with nested procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Oct 25, 2018
1 parent 35d5df1 commit 3afb9a5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Expand Up @@ -726,7 +726,7 @@ public static void determineDependencies(AbstractMetadataRecord p, Command comma
Block b = cpc.getBlock();
PreOrderNavigator.doVisit(b, new LanguageVisitor() {
public void visit(CommandStatement obj) {
if (!obj.isReturnable() || obj.getCommand() instanceof DynamicCommand) {
if (!obj.isReturnable() || obj.getCommand() instanceof DynamicCommand || !obj.getCommand().returnsResultSet()) {
return;
}
for (int i = 0; i < proc.getResultSet().getColumns().size(); i++) {
Expand Down
Expand Up @@ -145,7 +145,19 @@ public void testResolveMetadata() throws Exception {
new MetadataValidator.ResolveQueryPlans().execute(vdb, store, report, new MetadataValidator());
assertTrue(printError(report), report.hasItems());
}


@Test
public void testProcDependencies() throws Exception {
String ddl = "create virtual procedure proc1(IN e1 varchar) as begin end; "
+ "create virtual procedure proc2(IN e1 varchar) RETURNS (x integer) as begin call proc1(e1); select 1; end; ";
buildModel("vm1", false, this.vdb, this.store, ddl);
buildTransformationMetadata();
ValidatorReport report = new ValidatorReport();
new MetadataValidator.ResolveQueryPlans().execute(vdb, store, report,
new MetadataValidator());
assertFalse(printError(report), report.hasItems());
}

@Test
public void testInvalidView() throws Exception {
String ddl = "create view g1 (e1 integer, e2 varchar(12)) AS select 'a';";
Expand Down

0 comments on commit 3afb9a5

Please sign in to comment.