diff --git a/src/38query.js b/src/38query.js index e97e3b2bca..212c045487 100755 --- a/src/38query.js +++ b/src/38query.js @@ -1,6 +1,5 @@ // Main query procedure function queryfn(query, oldscope, cb, A, B) { - query.sourceslen = query.sources.length; let slen = query.sourceslen; query.query = query; // TODO Remove to prevent memory leaks @@ -44,7 +43,6 @@ function queryfn(query, oldscope, cb, A, B) { // console.log(query.queriesdata[0]); } - query.scope = oldscope ? cloneDeep(oldscope) : {}; // First - refresh data sources @@ -159,8 +157,9 @@ function queryfn3(query) { var gfns = ''; query.aggrKeys.forEach(function (col) { gfns += ` - g[${JSON.stringify(col.nick)}] = alasql.aggr[${JSON.stringify(col.funcid) - }](undefined,g[${JSON.stringify(col.nick)}],3); `; + g[${JSON.stringify(col.nick)}] = alasql.aggr[${JSON.stringify( + col.funcid + )}](undefined,g[${JSON.stringify(col.nick)}],3); `; }); var gfn = new Function('g,params,alasql', 'var y;' + gfns); } @@ -294,7 +293,6 @@ function queryfn3(query) { // Reduce to limit and offset doLimit(query); - // TODO: Check what artefacts rest from Angular.js if (typeof angular != 'undefined') { query.removeKeys.push('$$hashKey'); @@ -375,7 +373,6 @@ function queryfn3(query) { res = query.data; if (query.cb) res = query.cb(query.data, query.A, query.B); return res; - } // Limiting @@ -436,7 +433,7 @@ var preIndex = function (query) { // Check if index already exists let ixx = alasql.databases[source.databaseid].tables[source.tableid].indices[ - hash(source.onrightfns + '`' + source.srcwherefns) + hash(source.onrightfns + '`' + source.srcwherefns) ]; if (!alasql.databases[source.databaseid].tables[source.tableid].dirty && ixx) { source.ix = ixx; @@ -489,7 +486,7 @@ var preIndex = function (query) { // Check if index exists ixx = alasql.databases[source.databaseid].tables[source.tableid].indices[ - hash(source.wxleftfns + '`') + hash(source.wxleftfns + '`') ]; } if (!alasql.databases[source.databaseid].tables[source.tableid].dirty && ixx) { diff --git a/src/39dojoin.js b/src/39dojoin.js index 68fc1f54e0..9c65c6af28 100755 --- a/src/39dojoin.js +++ b/src/39dojoin.js @@ -8,7 +8,6 @@ function doJoin(query, scope, h) { // Todo: check if this runs once too many // Then apply where and select if (query.wherefn(scope, query.params, alasql)) { - // If there is a GROUP BY then pipe to grouping function if (query.groupfn) { query.groupfn(scope, query.params, alasql); @@ -35,14 +34,12 @@ function doJoin(query, scope, h) { }, scope ); - } else { // STEP 1 let source = query.sources[h]; let nextsource = query.sources[h + 1]; - let tableid = source.alias || source.tableid; let pass = false; // For LEFT JOIN let data = source.data; @@ -58,7 +55,6 @@ function doJoin(query, scope, h) { ) { data = source.ix[source.onleftfn(scope, query.params, alasql)] || []; opt = true; - } } @@ -112,8 +108,6 @@ function doJoin(query, scope, h) { doJoin(query, scope, h + 1); } - - // STEP 2 if (h == 0) { @@ -159,8 +153,6 @@ function doJoin(query, scope, h) { } scope[tableid] = undefined; - - } } diff --git a/src/40select.js b/src/40select.js index e6682a3b7b..a578b4b103 100755 --- a/src/40select.js +++ b/src/40select.js @@ -462,7 +462,7 @@ function modify(query, res) { } columns = Object.keys(allcol).map(function (columnid) { - return { columnid: columnid }; + return {columnid: columnid}; }); } else { // Cannot recognize columns @@ -540,7 +540,7 @@ function modify(query, res) { res = ar; // res = arrayOfArrays(res); } else if (modifier === 'RECORDSET') { - res = new alasql.Recordset({ columns: columns, data: res }); + res = new alasql.Recordset({columns: columns, data: res}); // res = arrayOfArrays(res); } else if (modifier === 'TEXTSTRING') { var key;