Fixed issue with test metadata/queries/custord_q5.aql.
git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization@198 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/DdlTranslator.java b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/DdlTranslator.java
index f3dc2d4..32b5058 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/DdlTranslator.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/DdlTranslator.java
@@ -155,10 +155,14 @@
IDatasetDetails datasetDetails = null;
Dataset ds = MetadataManager.INSTANCE.getDataset(mdTxnCtx, compiledDeclarations.getDataverseName(),
datasetName);
- if (ds != null && !dd.getIfNotExists()) {
- throw new AlgebricksException("A dataset with this name " + datasetName
- + " already exists.");
- }
+ if (ds != null) {
+ if (dd.getIfNotExists()) {
+ continue;
+ } else {
+ throw new AlgebricksException("A dataset with this name " + datasetName
+ + " already exists.");
+ }
+ }
itemTypeName = dd.getItemTypeName().getValue();
Datatype dt = MetadataManager.INSTANCE.getDatatype(mdTxnCtx,
compiledDeclarations.getDataverseName(), itemTypeName);