feristhia / xmla4js

Automatically exported from code.google.com/p/xmla4js
0 stars 0 forks source link

Infinit loop when calling Xmla.Dataset.Cellset.eachCell(); #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using the following code

    var cellset = xmlaDataset.getCellset();

    //for each and every cell do the following
    cellset.eachCell(function(cell){
    // do something with the cell here
    });

2. This will cause the code to go into an infinite loop. Debugging shows that 
in the function hasMoreCells(), the idx value keeps going from 0 to number of 
cells.

What is the expected output? What do you see instead?
Stop! Browser crash :)

What version of the product are you using? On what operating system?
checked out r134 on Windows 7. It happens in firefox as well as chrome

Please provide any additional information below.
Using a for loop and using the indices doesn't cause the issue.
Using mondrian as an OLAP server

Original issue reported on code.google.com by yong.c...@incentro.com on 26 Mar 2012 at 4:15

GoogleCodeExporter commented 9 years ago
Thanks for your bug report, I appreciate it.

Can you post some code immediately before calling eachCell? In particular I'd 
like to see what query caused it, and how you obtained the cellset.

Original comment by roland.bouman on 26 Mar 2012 at 4:34

GoogleCodeExporter commented 9 years ago
For testing purposes im using the foodmart db which comes with mondrian

//The query is as follows:

    query = "SELECT [Measures].[Unit Sales] ON 0,
             [Time].[1997].Children ON 1,
             [Store].[USA].Children ON 2
             FROM [Sales]";

//and with that query i do the following:

    var datasource = getDataSourceInfo();
    // initialize the properties object
    var properties = {};
    properties[Xmla.PROP_DATASOURCEINFO] = getDataSourceInfo();
    properties[Xmla.PROP_CATALOG] = getCatalogName();
    properties[Xmla.PROP_FORMAT] = "Multidimensional";
    if ("Multidimensional" === Xmla.PROP_FORMAT_MULTIDIMENSIONAL ){
       properties[Xmla.PROP_AXISFORMAT] = "TupleFormat";
    }

    // execute the query with the url and given properties
    xmlaDataset= xmla.execute({
        url: getUrl(),
        statement: query,
        properties: properties
    });

// i get the cellset

    var cellset = xmlaDataset.getCellset();

// then pop goes the weasel

    //for each and every cell do the following
    cellset.eachCell(function(cell){
    // do something with the cell here
    });

Hope this helps! 

Original comment by yong.c...@incentro.com on 27 Mar 2012 at 11:25

GoogleCodeExporter commented 9 years ago
Thanks! this is a huge help. I will investigate and get back to you. Will try 
to get it fixed during the weekend.

Original comment by roland.bouman on 27 Mar 2012 at 11:32

GoogleCodeExporter commented 9 years ago

Original comment by roland.bouman on 27 Mar 2012 at 11:32