Skip to content

Commit

Permalink
MONDRIAN-613 Missing xsd:type attribute in drill-down rowset makes Ex…
Browse files Browse the repository at this point in the history
…cel 2007 crash. Also, when returning a drillthrough query result, use the actual DB specified type for the row set XSD infos rather than the schema infos.

[git-p4: depot-paths = "//open/mondrian-release/3.2/": change = 13913]
  • Loading branch information
lucboudreau committed Nov 16, 2010
1 parent cb8ddd1 commit 3d5a297
Show file tree
Hide file tree
Showing 2 changed files with 238 additions and 197 deletions.
21 changes: 19 additions & 2 deletions src/main/mondrian/xmla/XmlaHandler.java
Expand Up @@ -1512,7 +1512,23 @@ public void unparse(SaxWriter writer) throws SAXException {
for (Object[] row : rows) {
writer.startElement("row");
for (int i = 0; i < row.length; i++) {
writer.startElement(columns.get(i).encodedName);
writer.startElement(
columns.get(i).encodedName,
new Object[] {
"xsi:type",
columns.get(i).xsdType});

// final String xsdType = columns.get(i).xsdType;
// if (xsdType.equals(XSD_STRING)) {
// writer.startElement(columns.get(i).encodedName);
// } else {
// writer.startElement(
// columns.get(i).encodedName,
// new Object[] {"xsi:type", xsdType});
// }

// writer.startElement(columns.get(i).encodedName);

Object value = row[i];
if (value == null) {
writer.characters("null");
Expand Down Expand Up @@ -1607,9 +1623,10 @@ private static String sqlToXsdType(int sqlType) {
switch (sqlType) {
// Integer
case Types.INTEGER:
case Types.BIGINT:
case Types.SMALLINT:
case Types.TINYINT:
return XSD_INT;
case Types.BIGINT:
return XSD_INTEGER;
case Types.NUMERIC:
return XSD_DECIMAL;
Expand Down

0 comments on commit 3d5a297

Please sign in to comment.