Skip to content

Commit

Permalink
Updated drill through return list preparation
Browse files Browse the repository at this point in the history
To be compatible with Mondrian 3.11
  • Loading branch information
rsim committed Oct 20, 2015
1 parent 6781626 commit 0c10ce5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/mondrian/olap/result.rb
Expand Up @@ -333,7 +333,7 @@ def self.generate_drill_through_sql(rolap_cell, result, params)

def self.parse_return_fields(result, params)
return_field_names = []
return_expressions = nil
return_expressions = []
nonempty_columns = []

if params[:return] || params[:nonempty]
Expand All @@ -354,10 +354,10 @@ def self.parse_return_fields(result, params)

case level_or_member
when Java::MondrianOlap::Level
Java::MondrianMdx::LevelExpr.new level_or_member
level_or_member
when Java::MondrianOlap::Member
raise ArgumentError, "cannot use calculated member #{return_field} as return field" if level_or_member.isCalculated
Java::mondrian.mdx.MemberExpr.new level_or_member
level_or_member
else
raise ArgumentError, "return field #{return_field} should be level or measure"
end
Expand Down
10 changes: 6 additions & 4 deletions spec/query_spec.rb
Expand Up @@ -791,12 +791,14 @@ def sql_select_numbers(select_string)
end if %w(mysql postgresql).include? MONDRIAN_DRIVER

it "should return table names" do
@drill_through.table_names.should == [
# ignore calculated customer full name column name which is shown differently on each database
@drill_through.table_names[0..12].should == [
"time", "time", "time", "time", "time",
"product_classes", "product_classes", "product_classes", "product_classes", "products", "products",
"customers", "customers", "", "customers",
"customers",
"sales"
"customers", "customers"
]
@drill_through.table_names[14..16].should == [
"customers", "customers", "sales"
]
end if %w(mysql postgresql).include? MONDRIAN_DRIVER

Expand Down

0 comments on commit 0c10ce5

Please sign in to comment.