Skip to content

Commit

Permalink
MONDRIAN
Browse files Browse the repository at this point in the history
Modified DrillThroughQuerySpec to handle cases where DatabaseMetaData returns 0 for getMaxColumnNameLength(). From DatabaseMetaData: "a result of zero means that there is no limit or the limit is not known."  The code now interprets zero as no limit.

[git-p4: depot-paths = "//open/mondrian/": change = 11319]
  • Loading branch information
Mat Lowery committed Jul 18, 2008
1 parent 94dbc4d commit c021ebc
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main/mondrian/rolap/agg/DrillThroughQuerySpec.java
Expand Up @@ -33,14 +33,18 @@ class DrillThroughQuerySpec extends AbstractQuerySpec {
private final List<String> columnNames;
private final int maxColumnNameLength;

public DrillThroughQuerySpec(
CellRequest request,
boolean countOnly)
{
public DrillThroughQuerySpec(CellRequest request, boolean countOnly) {
super(request.getMeasure().getStar(), countOnly);
this.request = request;
this.maxColumnNameLength =
int tmpMaxColumnNameLength =
getStar().getSqlQueryDialect().getMaxColumnNameLength();
if (tmpMaxColumnNameLength == 0) {
// From java.sql.DatabaseMetaData: "a result of zero means that
// there is no limit or the limit is not known"
maxColumnNameLength = Integer.MAX_VALUE;
} else {
maxColumnNameLength = tmpMaxColumnNameLength;
}
this.columnNames = computeDistinctColumnNames();
}

Expand Down

0 comments on commit c021ebc

Please sign in to comment.