From 69873480469fa1925608aab42268872f490180e7 Mon Sep 17 00:00:00 2001 From: Paul Stoellberger Date: Fri, 11 Mar 2011 03:10:41 +0000 Subject: [PATCH] fix bug (that was already fixed) for catalog restriction in XMLA requests (for ssas / palo) git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@403 c6a108a4-781c-0410-a6c6-c2d559e19af0 --- .../olap4j/driver/xmla/XmlaOlap4jConnection.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java b/src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java index 3723154..2798f0b 100644 --- a/src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java +++ b/src/org/olap4j/driver/xmla/XmlaOlap4jConnection.java @@ -852,15 +852,18 @@ public String generateRequest( } // If the request requires catalog name, and one wasn't specified in the - // restrictions, use the connection's current schema. (Note: What XMLA - // calls a catalog, JDBC calls a schema.) - if (context.olap4jSchema != null) { - requestCatalogName = context.olap4jSchema.getName(); + // restrictions, use the connection's current catalog. + if (context.olap4jCatalog != null) { + requestCatalogName = context.olap4jCatalog.getName(); } if (requestCatalogName == null && metadataRequest.requiresCatalogName()) { - requestCatalogName = context.olap4jConnection.getSchema().getName(); + List catalogs = + context.olap4jConnection.getMetaData().getOlapCatalogs(); + if (catalogs.size() > 0) { + requestCatalogName = catalogs.get(0).getName(); + } } // Add the catalog node only if this request has specified it as a