From c15912d11a8cc69e5693e89867adf1d08199482e Mon Sep 17 00:00:00 2001 From: Mathias Rangel Wulff Date: Thu, 6 Apr 2017 17:19:13 +1000 Subject: [PATCH] Correct OFFSET (fix #858) --- dist/alasql-worker.js | 4 ++-- dist/alasql-worker.min.js | 2 +- dist/alasql.d.ts | 1 + dist/alasql.fs.js | 13 ++++++++----- dist/alasql.js | 13 ++++++++----- dist/alasql.min.js | 4 ++-- src/38query.js | 7 +++++-- test/test030.js | 2 +- test/test035.js | 4 ++-- test/test368.js | 6 +++--- 10 files changed, 33 insertions(+), 23 deletions(-) diff --git a/dist/alasql-worker.js b/dist/alasql-worker.js index c6b46e208b..e68631a709 100755 --- a/dist/alasql-worker.js +++ b/dist/alasql-worker.js @@ -1,7 +1,7 @@ -//! AlaSQL v0.3.9-develop-1512 | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT +//! AlaSQL v0.3.9-develop-1513 | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT /* @module alasql -@version 0.3.9-develop-1512 +@version 0.3.9-develop-1513 AlaSQL - JavaScript SQL database © 2014-2016 Andrey Gershun & Mathias Rangel Wulff diff --git a/dist/alasql-worker.min.js b/dist/alasql-worker.min.js index cc8468393e..e9a9a54f4d 100755 --- a/dist/alasql-worker.min.js +++ b/dist/alasql-worker.min.js @@ -1,2 +1,2 @@ -//! AlaSQL v0.3.9-develop-1512 | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT +//! AlaSQL v0.3.9-develop-1513 | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT !function(r,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():r.alasql=e()}(this,function(){function r(e,t,o){t=t||[],"function"==typeof t&&(scope=o,o=t,t=[]),"object"!=typeof t&&(t=[t]);var n=r.lastid++;r.buffer[n]=o,r.webworker.postMessage({id:n,sql:e,params:t})}if(r.options={},r.options.progress=function(){},isArray=function(r){return"[object Array]"===Object.prototype.toString.call(r)},r.promise=function(){throw new Error("Please include a Promise/A+ library")},"undefined"!=typeof Promise){var e=function(e,t,o,n){return new Promise(function(s,i){r(e,t,function(e,t){t?i(t):(o&&n&&r.options.progress!==!1&&r.options.progress(o,n),s(e))})})},t=function(r){if(!(r.length<1)){for(var t,o,n,s=[],i=0;i1){r("REQUIRE "+t.map(function(r){return'"'+r+'"'}).join(","),[],o)}}else if(e===!1)return void delete r.webworker}),r.lastid=0,r.buffer={},r.worker(),r}); \ No newline at end of file diff --git a/dist/alasql.d.ts b/dist/alasql.d.ts index f9360fa098..4a7a3b5081 100644 --- a/dist/alasql.d.ts +++ b/dist/alasql.d.ts @@ -71,6 +71,7 @@ declare namespace alaSQLSpace { fn: userDefinedFunctionLookUp; aggr: userAggregatorLookUp; autoval(tablename: string, colname: string, getNext?:boolean): number; + yy:{}; } } diff --git a/dist/alasql.fs.js b/dist/alasql.fs.js index 09ce7eab6e..5668a3c333 100755 --- a/dist/alasql.fs.js +++ b/dist/alasql.fs.js @@ -1,7 +1,7 @@ -//! AlaSQL v0.3.9-develop-1512 | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT +//! AlaSQL v0.3.9-develop-1513 | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT /* @module alasql -@version 0.3.9-develop-1512 +@version 0.3.9-develop-1513 AlaSQL - JavaScript SQL database © 2014-2016 Andrey Gershun & Mathias Rangel Wulff @@ -137,7 +137,7 @@ var alasql = function(sql, params, cb, scope) { Current version of alasql @constant {string} */ -alasql.version = '0.3.9-develop-1512'; +alasql.version = '0.3.9-develop-1513'; /** Debug flag @@ -6646,10 +6646,13 @@ function doLimit (query) { if(query.limit) { var offset = 0; - if(query.offset) offset = ((query.offset|0)-1)||0; + if(query.offset){ + offset = (query.offset|0)||0; + offset = offset<0 ? 0 : offset; + } var limit; if(query.percent) { - limit = ((query.data.length*query.limit/100)| 0)+offset; + limit = ((query.data.length*query.limit/100)|0)+offset; } else { limit = (query.limit|0) + offset; } diff --git a/dist/alasql.js b/dist/alasql.js index 7438cc5497..a43aac4042 100755 --- a/dist/alasql.js +++ b/dist/alasql.js @@ -1,7 +1,7 @@ -//! AlaSQL v0.3.9-develop-1512 | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT +//! AlaSQL v0.3.9-develop-1513 | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT /* @module alasql -@version 0.3.9-develop-1512 +@version 0.3.9-develop-1513 AlaSQL - JavaScript SQL database © 2014-2016 Andrey Gershun & Mathias Rangel Wulff @@ -137,7 +137,7 @@ var alasql = function(sql, params, cb, scope) { Current version of alasql @constant {string} */ -alasql.version = '0.3.9-develop-1512'; +alasql.version = '0.3.9-develop-1513'; /** Debug flag @@ -6646,10 +6646,13 @@ function doLimit (query) { if(query.limit) { var offset = 0; - if(query.offset) offset = ((query.offset|0)-1)||0; + if(query.offset){ + offset = (query.offset|0)||0; + offset = offset<0 ? 0 : offset; + } var limit; if(query.percent) { - limit = ((query.data.length*query.limit/100)| 0)+offset; + limit = ((query.data.length*query.limit/100)|0)+offset; } else { limit = (query.limit|0) + offset; } diff --git a/dist/alasql.min.js b/dist/alasql.min.js index f5751cf2ff..05b1978da4 100755 --- a/dist/alasql.min.js +++ b/dist/alasql.min.js @@ -1,5 +1,5 @@ -//! AlaSQL v0.3.9-develop-1512 | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT -!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():e.alasql=t()}(this,function(){function e(e){return"(y="+e+",y===y?y:undefined)"}function t(e,t){return"(y="+e+',typeof y=="undefined"?undefined:'+t+")"}function r(){return!0}function n(){}function a(){var e=navigator.userAgent.toLowerCase();return e.indexOf("msie")!==-1&&parseInt(e.split("msie")[1])}function i(e,t,r){function n(e,r,a){var o,u,c,l=e[r];if(l.selid){if("PATH"===l.selid){for(var h=[{node:a,stack:[]}],d={},f=A.databases[A.useid].objects;h.length>0;){var p=h.shift(),b=p.node,E=p.stack,c=n(l.args,0,b);if(c.length>0){if(r+1+1>e.length)return E;var g=[];return E&&E.length>0&&E.forEach(function(t){g=g.concat(n(e,r+1,t))}),g}void 0===d[b.$id]&&(d[b.$id]=!0,b.$out&&b.$out.length>0&&b.$out.forEach(function(e){var t=f[e],r=E.concat(t);r.push(f[t.$out[0]]),h.push({node:f[t.$out[0]],stack:r})}))}return[]}if("NOT"===l.selid){var u=n(l.args,0,a);return u.length>0?[]:r+1+1>e.length?[a]:n(e,r+1,a)}if("DISTINCT"===l.selid){var u;if(u=void 0===l.args||0===l.args.length?q(a):n(l.args,0,a),0===u.length)return[];var m=q(u);return r+1+1>e.length?m:n(e,r+1,m)}if("AND"===l.selid){var m=!0;return l.args.forEach(function(e){m=m&&n(e,0,a).length>0}),m?r+1+1>e.length?[a]:n(e,r+1,a):[]}if("OR"===l.selid){var m=!1;return l.args.forEach(function(e){m=m||n(e,0,a).length>0}),m?r+1+1>e.length?[a]:n(e,r+1,a):[]}if("ALL"===l.selid){var u=n(l.args[0],0,a);return 0===u.length?[]:r+1+1>e.length?u:n(e,r+1,u)}if("ANY"===l.selid){var u=n(l.args[0],0,a);return 0===u.length?[]:r+1+1>e.length?[u[0]]:n(e,r+1,[u[0]])}if("UNIONALL"===l.selid){var u=[];return l.args.forEach(function(e){u=u.concat(n(e,0,a))}),0===u.length?[]:r+1+1>e.length?u:n(e,r+1,u)}if("UNION"===l.selid){var u=[];l.args.forEach(function(e){u=u.concat(n(e,0,a))});var u=q(u);return 0===u.length?[]:r+1+1>e.length?u:n(e,r+1,u)}if("IF"===l.selid){var u=n(l.args,0,a);return 0===u.length?[]:r+1+1>e.length?[a]:n(e,r+1,a)}if("REPEAT"===l.selid){var v,S,T=l.args[0].value;S=l.args[1]?l.args[1].value:T,l.args[2]&&(v=l.args[2].variable);var y=[];if(0===T&&(r+1+1>e.length?y=[a]:(v&&(A.vars[v]=0),y=y.concat(n(e,r+1,a)))),S>0)for(var N=[{value:a,lvl:1}],C=0;N.length>0;){var u=N[0];if(N.shift(),u.lvl<=S){v&&(A.vars[v]=u.lvl);var R=n(l.sels,0,u.value);R.forEach(function(e){N.push({value:e,lvl:u.lvl+1})}),u.lvl>=T&&(r+1+1>e.length?y=y.concat(R):R.forEach(function(t){y=y.concat(n(e,r+1,t))}))}if(++C>1e5)throw new Error("Security brake. Number of iterations = "+C)}return y}if("OF"===l.selid){if(r+1+1>e.length)return[a];var O=[];return Object.keys(a).forEach(function(t){A.vars[l.args[0].variable]=t,O=O.concat(n(e,r+1,a[t]))}),O}if("TO"===l.selid){var w=A.vars[l.args[0]],I=[];if(I=void 0!==w?w.slice(0):[],I.push(a),r+1+1>e.length)return[a];A.vars[l.args[0]]=I;var O=n(e,r+1,a);return A.vars[l.args[0]]=w,O}if("ARRAY"===l.selid){var u=n(l.args,0,a);return u.length>0?(o=u,r+1+1>e.length?[o]:n(e,r+1,o)):[]}if("SUM"===l.selid){var u=n(l.args,0,a);if(!(u.length>0))return[];var o=u.reduce(function(e,t){return e+t},0);return r+1+1>e.length?[o]:n(e,r+1,o)}if("AVG"===l.selid)return u=n(l.args,0,a),u.length>0?(o=u.reduce(function(e,t){return e+t},0)/u.length,r+1+1>e.length?[o]:n(e,r+1,o)):[];if("COUNT"===l.selid)return u=n(l.args,0,a),u.length>0?(o=u.length,r+1+1>e.length?[o]:n(e,r+1,o)):[];if("FIRST"===l.selid)return u=n(l.args,0,a),u.length>0?(o=u[0],r+1+1>e.length?[o]:n(e,r+1,o)):[];if("LAST"===l.selid)return u=n(l.args,0,a),u.length>0?(o=u[u.length-1],r+1+1>e.length?[o]:n(e,r+1,o)):[];if("MIN"===l.selid){if(u=n(l.args,0,a),0===u.length)return[];var o=u.reduce(function(e,t){return Math.min(e,t)},1/0);return r+1+1>e.length?[o]:n(e,r+1,o)}if("MAX"===l.selid){var u=n(l.args,0,a);if(0===u.length)return[];var o=u.reduce(function(e,t){return Math.max(e,t)},-(1/0));return r+1+1>e.length?[o]:n(e,r+1,o)}if("PLUS"===l.selid){var y=[],N=n(l.args,0,a).slice();r+1+1>e.length?y=y.concat(N):N.forEach(function(t){y=y.concat(n(e,r+1,t))});for(var C=0;N.length>0;){var u=N.shift();if(u=n(l.args,0,u),N=N.concat(u),r+1+1>e.length?y=y.concat(u):u.forEach(function(t){var a=n(e,r+1,t);y=y.concat(a)}),++C>1e5)throw new Error("Security brake. Number of iterations = "+C)}return y}if("STAR"===l.selid){var y=[];y=n(e,r+1,a);var N=n(l.args,0,a).slice();r+1+1>e.length?y=y.concat(N):N.forEach(function(t){y=y.concat(n(e,r+1,t))});for(var C=0;N.length>0;){var u=N[0];if(N.shift(),u=n(l.args,0,u),N=N.concat(u),r+1+1<=e.length&&u.forEach(function(t){y=y.concat(n(e,r+1,t))}),++C>1e5)throw new Error("Loop brake. Number of iterations = "+C)}return y}if("QUESTION"===l.selid){var y=[];y=y.concat(n(e,r+1,a));var u=n(l.args,0,a);return r+1+1<=e.length&&u.forEach(function(t){y=y.concat(n(e,r+1,t))}),y}if("WITH"!==l.selid){if("ROOT"===l.selid)return r+1+1>e.length?[a]:n(e,r+1,s);throw new Error("Wrong selector "+l.selid)}var u=n(l.args,0,a);if(0===u.length)return[];var c={status:1,values:u}}else{if(!l.srchid)throw new Error("Selector not found");var c=A.srch[l.srchid.toUpperCase()](a,l.args,i,t)}void 0===c&&(c={status:1,values:[a]});var m=[];if(1===c.status){var x=c.values;if(r+1+1>e.length)m=x;else for(var C=0;C0&&(o&&o[0]&&"PROP"===o[0].srchid&&o[0].args&&o[0].args[0]&&("XML"===o[0].args[0].toUpperCase()?(i.mode="XML",o.shift()):"HTML"===o[0].args[0].toUpperCase()?(i.mode="HTML",o.shift()):"JSON"===o[0].args[0].toUpperCase()&&(i.mode="JSON",o.shift())),o.length>0&&"VALUE"===o[0].srchid&&(i.value=!0,o.shift())),this.from instanceof Q.Column){var u=this.from.databaseid||e;s=A.databases[u].tables[this.from.columnid].data}else if(this.from instanceof Q.FuncValue&&A.from[this.from.funcid.toUpperCase()]){var c=this.from.args.map(function(e){var r=e.toJS();return new Function("params,alasql","var y;return "+r).bind(this)(t,A)});s=A.from[this.from.funcid.toUpperCase()].apply(this,c)}else if(void 0===this.from)s=A.databases[e].objects;else{var l=new Function("params,alasql","var y;return "+this.from.toJS());s=l(t,A),"object"==typeof Mongo&&"object"!=typeof Mongo.Collection&&s instanceof Mongo.Collection&&(s=s.find().fetch())}if(a=void 0!==o&&o.length>0?n(o,0,s):s,this.into){var h,d;void 0!==this.into.args[0]&&(h=new Function("params,alasql","var y;return "+this.into.args[0].toJS())(t,A)),void 0!==this.into.args[1]&&(d=new Function("params,alasql","var y;return "+this.into.args[1].toJS())(t,A)),a=A.into[this.into.funcid.toUpperCase()](h,d,a,[],r)}else i.value&&a.length>0&&(a=a[0]),r&&(a=r(a));return a}function o(e,t,r,n,a){e.sources.length;e.sourceslen=e.sources.length;var s=e.sourceslen;e.query=e,e.A=n,e.B=a,e.cb=r,e.oldscope=t,e.queriesfn&&(e.sourceslen+=e.queriesfn.length,s+=e.queriesfn.length,e.queriesdata=[],e.queriesfn.forEach(function(t,r){t.query.params=e.params,u([],-r-1,e)}));var i;i=t?F(t):{},e.scope=i;var o;return e.sources.forEach(function(t,r){t.query=e;var n=t.datafn(e,e.params,u,r,A);void 0!==n&&((e.intofn||e.intoallfn)&&Array.isArray(n)&&(n=n.length),o=n),t.queriesdata=e.queriesdata}),0!=e.sources.length&&0!==s||(o=c(e)),o}function u(e,t,r){if(t>=0){var n=r.sources[t];n.data=e,"function"==typeof n.data&&(n.getfn=n.data,n.dontcache=n.getfn.dontcache,"OUTER"!=n.joinmode&&"RIGHT"!=n.joinmode&&"ANTI"!=n.joinmode||(n.dontcache=!1),n.data={})}else r.queriesdata[-t-1]=V(e);if(!(--r.sourceslen>0))return c(r)}function c(e){var t,r=e.scope;ee(e),e.data=[],e.xgroups={},e.groups=[];if(d(e,r,0),e.groupfn){if(e.data=[],0===e.groups.length){var n={};e.selectGroup.length>0&&e.selectGroup.forEach(function(e){"COUNT"==e.aggregatorid||"SUM"==e.aggregatorid?n[e.nick]=0:n[e.nick]=void 0}),e.groups=[n]}if(e.aggrKeys.length>0){var a="";e.aggrKeys.forEach(function(e){a+="g['"+e.nick+"']=alasql.aggr['"+e.funcid+"'](undefined,g['"+e.nick+"'],3);"});var s=new Function("g,params,alasql","var y;"+a)}for(var i=0,o=e.groups.length;i0){var g=e.removeKeys;if((t=g.length)>0)for(o=e.data.length,i=0;i0&&(e.columns=e.columns.filter(function(e){var t=!1;return g.forEach(function(r){e.columnid==r&&(t=!0)}),!t}))}if(void 0!==e.removeLikeKeys&&e.removeLikeKeys.length>0){for(var m=e.removeLikeKeys,i=0,o=e.data.length;i0&&(e.columns=e.columns.filter(function(e){var t=!1;return m.forEach(function(r){A.utils.like(r,e.columnid)&&(t=!0)}),!t}))}if(e.pivotfn&&e.pivotfn(),e.unpivotfn&&e.unpivotfn(),e.intoallfn){var S=e.intoallfn(e.columns,e.cb,e.params,e.alasql);return S}if(e.intofn){for(o=e.data.length,i=0;i=e.sources.length)e.wherefn(t,e.params,A)&&(e.groupfn?e.groupfn(t,e.params,A):e.data.push(e.selectfn(t,e.params,A)));else if(e.sources[r].applyselect){var n=e.sources[r];n.applyselect(e.params,function(a){if(a.length>0)for(var s=0;s0){for(var a={},s=Math.min(t.length,A.options.columnlookup||10)-1;0<=s;s--)for(var i in t[s])a[i]=!0;n=Object.keys(a).map(function(e){return{columnid:e}})}else n=[];if("VALUE"===r)if(t.length>0){var i;i=n&&n.length>0?n[0].columnid:Object.keys(t[0])[0],t=t[0][i]}else t=void 0;else if("ROW"===r)if(t.length>0){var i,o=[];for(var i in t[0])o.push(t[0][i]);t=o}else t=void 0;else if("COLUMN"===r){var u=[];if(t.length>0){var i;i=n&&n.length>0?n[0].columnid:Object.keys(t[0])[0];for(var s=0,c=t.length;s0)i=n[0].columnid,d=n[1].columnid;else{var f=Object.keys(t[0]);i=f[0],d=f[1]}for(var s=0,c=t.length;s0?n[0].columnid:Object.keys(t[0])[0];for(var s=0,c=t.length;s0?s.forEach(function(s){r&&"underscore"==A.options.joinstar?a.push("'"+t+"_"+s.columnid+"':p['"+t+"']['"+s.columnid+"']"):r&&"json"==A.options.joinstar?n+="r['"+t+"']['"+s.columnid+"']=p['"+t+"']['"+s.columnid+"'];":a.push("'"+s.columnid+"':p['"+t+"']['"+s.columnid+"']"),e.selectColumns[R(s.columnid)]=!0;var i={columnid:s.columnid,dbtypeid:s.dbtypeid,dbsize:s.dbsize,dbprecision:s.dbprecision,dbenum:s.dbenum};e.columns.push(i),e.xcolumns[i.columnid]=i}):(n+='var w=p["'+t+'"];for(var k in w){r[k]=w[k]};',e.dirtyColumns=!0),{s:a.join(","),sp:n}}function b(e,t){if(Array.isArray(e)){for(var r=[[]],n=0;n"+(a+1),r.forEach(function(r){t+=" ",e[a][r]==+e[a][r]?(t+='
',t+=void 0===e[a][r]?"NULL":e[a][r],t+="
"):t+=void 0===e[a][r]?"NULL":"string"==typeof e[a][r]?e[a][r]:ce(e[a][r])});t+=""}else t+="

"+ce(e)+"

";return t}function m(e,t,r){if(!(r<=0)){var n=t-e.scrollTop,a=n/r*10;setTimeout(function(){e.scrollTop!==t&&(e.scrollTop=e.scrollTop+a,m(e,t,r-10))},10)}}function S(e,t,r,n,a,s){function i(e){for(var t="",r=0,n=10240;r0&&T[T.length-1]&&0==Object.keys(T[T.length-1]).length&&T.pop(),n&&(T=n(T,a,s))},function(e){throw e})}function T(e){function t(){if(i(/^<\?xml\s*/)){for(var e={attributes:{}};!o()&&!u("?>");){var t=a();if(!t)return e;e.attributes[t.name]=t.value}return i(/\?>\s*/),e}}function r(){var e=i(/^<([\w-:.]+)\s*/);if(e){for(var t={name:e[1],attributes:{},children:[]};!(o()||u(">")||u("?>")||u("/>"));){var s=a();if(!s)return t;t.attributes[s.name]=s.value}if(i(/^\s*\/>\s*/))return t;i(/\??>\s*/),t.content=n();for(var c;c=r();)t.children.push(c);return i(/^<\/[\w-:.]+>\s*/),t}}function n(){var e=i(/^([^<]*)/);return e?e[1]:""}function a(){var e=i(/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/);if(e)return{name:e[1],value:s(e[2])}}function s(e){return e.replace(/^['"]|['"]$/g,"")}function i(t){var r=e.match(t);if(r)return e=e.slice(r[0].length),r}function o(){return 0==e.length}function u(t){return 0==e.indexOf(t)}return e=e.trim(),e=e.replace(//g,""),function(){return{declaration:t(),root:r()}}()}var A=function(e,t,r,n){if(t=t||[],"function"!=typeof importScripts&&A.webworker){var a=A.lastid++;return A.buffer[a]=r,void A.webworker.postMessage({id:a,sql:e,params:t})}return 0===arguments.length?new Q.Select({columns:[new Q.Column({columnid:"*"})],from:[new Q.ParamValue({param:0})]}):1===arguments.length&&e.constructor===Array?A.promise(e):("function"==typeof t&&(n=r,r=t,t=[]),"object"!=typeof t&&(t=[t]),"string"==typeof e&&"#"===e[0]&&"object"==typeof document?e=document.querySelector(e).textContent:"object"==typeof e&&e instanceof HTMLElement?e=e.textContent:"function"==typeof e&&(e=e.toString().slice(14,-3)),A.exec(e,t,r,n))};A.version="0.3.9-develop-1512",A.debug=void 0;var y=function(){return null},N=function(){function e(){this.yy={}}var t=function(e,t,r,n){for(r=r||{},n=e.length;n--;r[e[n]]=t);return r +//! AlaSQL v0.3.9-develop-1513 | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT +!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():e.alasql=t()}(this,function(){function e(e){return"(y="+e+",y===y?y:undefined)"}function t(e,t){return"(y="+e+',typeof y=="undefined"?undefined:'+t+")"}function r(){return!0}function n(){}function a(){var e=navigator.userAgent.toLowerCase();return e.indexOf("msie")!==-1&&parseInt(e.split("msie")[1])}function i(e,t,r){function n(e,r,a){var o,u,c,l=e[r];if(l.selid){if("PATH"===l.selid){for(var h=[{node:a,stack:[]}],d={},f=A.databases[A.useid].objects;h.length>0;){var p=h.shift(),b=p.node,E=p.stack,c=n(l.args,0,b);if(c.length>0){if(r+1+1>e.length)return E;var g=[];return E&&E.length>0&&E.forEach(function(t){g=g.concat(n(e,r+1,t))}),g}void 0===d[b.$id]&&(d[b.$id]=!0,b.$out&&b.$out.length>0&&b.$out.forEach(function(e){var t=f[e],r=E.concat(t);r.push(f[t.$out[0]]),h.push({node:f[t.$out[0]],stack:r})}))}return[]}if("NOT"===l.selid){var u=n(l.args,0,a);return u.length>0?[]:r+1+1>e.length?[a]:n(e,r+1,a)}if("DISTINCT"===l.selid){var u;if(u=void 0===l.args||0===l.args.length?q(a):n(l.args,0,a),0===u.length)return[];var m=q(u);return r+1+1>e.length?m:n(e,r+1,m)}if("AND"===l.selid){var m=!0;return l.args.forEach(function(e){m=m&&n(e,0,a).length>0}),m?r+1+1>e.length?[a]:n(e,r+1,a):[]}if("OR"===l.selid){var m=!1;return l.args.forEach(function(e){m=m||n(e,0,a).length>0}),m?r+1+1>e.length?[a]:n(e,r+1,a):[]}if("ALL"===l.selid){var u=n(l.args[0],0,a);return 0===u.length?[]:r+1+1>e.length?u:n(e,r+1,u)}if("ANY"===l.selid){var u=n(l.args[0],0,a);return 0===u.length?[]:r+1+1>e.length?[u[0]]:n(e,r+1,[u[0]])}if("UNIONALL"===l.selid){var u=[];return l.args.forEach(function(e){u=u.concat(n(e,0,a))}),0===u.length?[]:r+1+1>e.length?u:n(e,r+1,u)}if("UNION"===l.selid){var u=[];l.args.forEach(function(e){u=u.concat(n(e,0,a))});var u=q(u);return 0===u.length?[]:r+1+1>e.length?u:n(e,r+1,u)}if("IF"===l.selid){var u=n(l.args,0,a);return 0===u.length?[]:r+1+1>e.length?[a]:n(e,r+1,a)}if("REPEAT"===l.selid){var v,S,T=l.args[0].value;S=l.args[1]?l.args[1].value:T,l.args[2]&&(v=l.args[2].variable);var y=[];if(0===T&&(r+1+1>e.length?y=[a]:(v&&(A.vars[v]=0),y=y.concat(n(e,r+1,a)))),S>0)for(var N=[{value:a,lvl:1}],C=0;N.length>0;){var u=N[0];if(N.shift(),u.lvl<=S){v&&(A.vars[v]=u.lvl);var R=n(l.sels,0,u.value);R.forEach(function(e){N.push({value:e,lvl:u.lvl+1})}),u.lvl>=T&&(r+1+1>e.length?y=y.concat(R):R.forEach(function(t){y=y.concat(n(e,r+1,t))}))}if(++C>1e5)throw new Error("Security brake. Number of iterations = "+C)}return y}if("OF"===l.selid){if(r+1+1>e.length)return[a];var O=[];return Object.keys(a).forEach(function(t){A.vars[l.args[0].variable]=t,O=O.concat(n(e,r+1,a[t]))}),O}if("TO"===l.selid){var w=A.vars[l.args[0]],I=[];if(I=void 0!==w?w.slice(0):[],I.push(a),r+1+1>e.length)return[a];A.vars[l.args[0]]=I;var O=n(e,r+1,a);return A.vars[l.args[0]]=w,O}if("ARRAY"===l.selid){var u=n(l.args,0,a);return u.length>0?(o=u,r+1+1>e.length?[o]:n(e,r+1,o)):[]}if("SUM"===l.selid){var u=n(l.args,0,a);if(!(u.length>0))return[];var o=u.reduce(function(e,t){return e+t},0);return r+1+1>e.length?[o]:n(e,r+1,o)}if("AVG"===l.selid)return u=n(l.args,0,a),u.length>0?(o=u.reduce(function(e,t){return e+t},0)/u.length,r+1+1>e.length?[o]:n(e,r+1,o)):[];if("COUNT"===l.selid)return u=n(l.args,0,a),u.length>0?(o=u.length,r+1+1>e.length?[o]:n(e,r+1,o)):[];if("FIRST"===l.selid)return u=n(l.args,0,a),u.length>0?(o=u[0],r+1+1>e.length?[o]:n(e,r+1,o)):[];if("LAST"===l.selid)return u=n(l.args,0,a),u.length>0?(o=u[u.length-1],r+1+1>e.length?[o]:n(e,r+1,o)):[];if("MIN"===l.selid){if(u=n(l.args,0,a),0===u.length)return[];var o=u.reduce(function(e,t){return Math.min(e,t)},1/0);return r+1+1>e.length?[o]:n(e,r+1,o)}if("MAX"===l.selid){var u=n(l.args,0,a);if(0===u.length)return[];var o=u.reduce(function(e,t){return Math.max(e,t)},-(1/0));return r+1+1>e.length?[o]:n(e,r+1,o)}if("PLUS"===l.selid){var y=[],N=n(l.args,0,a).slice();r+1+1>e.length?y=y.concat(N):N.forEach(function(t){y=y.concat(n(e,r+1,t))});for(var C=0;N.length>0;){var u=N.shift();if(u=n(l.args,0,u),N=N.concat(u),r+1+1>e.length?y=y.concat(u):u.forEach(function(t){var a=n(e,r+1,t);y=y.concat(a)}),++C>1e5)throw new Error("Security brake. Number of iterations = "+C)}return y}if("STAR"===l.selid){var y=[];y=n(e,r+1,a);var N=n(l.args,0,a).slice();r+1+1>e.length?y=y.concat(N):N.forEach(function(t){y=y.concat(n(e,r+1,t))});for(var C=0;N.length>0;){var u=N[0];if(N.shift(),u=n(l.args,0,u),N=N.concat(u),r+1+1<=e.length&&u.forEach(function(t){y=y.concat(n(e,r+1,t))}),++C>1e5)throw new Error("Loop brake. Number of iterations = "+C)}return y}if("QUESTION"===l.selid){var y=[];y=y.concat(n(e,r+1,a));var u=n(l.args,0,a);return r+1+1<=e.length&&u.forEach(function(t){y=y.concat(n(e,r+1,t))}),y}if("WITH"!==l.selid){if("ROOT"===l.selid)return r+1+1>e.length?[a]:n(e,r+1,s);throw new Error("Wrong selector "+l.selid)}var u=n(l.args,0,a);if(0===u.length)return[];var c={status:1,values:u}}else{if(!l.srchid)throw new Error("Selector not found");var c=A.srch[l.srchid.toUpperCase()](a,l.args,i,t)}void 0===c&&(c={status:1,values:[a]});var m=[];if(1===c.status){var x=c.values;if(r+1+1>e.length)m=x;else for(var C=0;C0&&(o&&o[0]&&"PROP"===o[0].srchid&&o[0].args&&o[0].args[0]&&("XML"===o[0].args[0].toUpperCase()?(i.mode="XML",o.shift()):"HTML"===o[0].args[0].toUpperCase()?(i.mode="HTML",o.shift()):"JSON"===o[0].args[0].toUpperCase()&&(i.mode="JSON",o.shift())),o.length>0&&"VALUE"===o[0].srchid&&(i.value=!0,o.shift())),this.from instanceof Q.Column){var u=this.from.databaseid||e;s=A.databases[u].tables[this.from.columnid].data}else if(this.from instanceof Q.FuncValue&&A.from[this.from.funcid.toUpperCase()]){var c=this.from.args.map(function(e){var r=e.toJS();return new Function("params,alasql","var y;return "+r).bind(this)(t,A)});s=A.from[this.from.funcid.toUpperCase()].apply(this,c)}else if(void 0===this.from)s=A.databases[e].objects;else{var l=new Function("params,alasql","var y;return "+this.from.toJS());s=l(t,A),"object"==typeof Mongo&&"object"!=typeof Mongo.Collection&&s instanceof Mongo.Collection&&(s=s.find().fetch())}if(a=void 0!==o&&o.length>0?n(o,0,s):s,this.into){var h,d;void 0!==this.into.args[0]&&(h=new Function("params,alasql","var y;return "+this.into.args[0].toJS())(t,A)),void 0!==this.into.args[1]&&(d=new Function("params,alasql","var y;return "+this.into.args[1].toJS())(t,A)),a=A.into[this.into.funcid.toUpperCase()](h,d,a,[],r)}else i.value&&a.length>0&&(a=a[0]),r&&(a=r(a));return a}function o(e,t,r,n,a){e.sources.length;e.sourceslen=e.sources.length;var s=e.sourceslen;e.query=e,e.A=n,e.B=a,e.cb=r,e.oldscope=t,e.queriesfn&&(e.sourceslen+=e.queriesfn.length,s+=e.queriesfn.length,e.queriesdata=[],e.queriesfn.forEach(function(t,r){t.query.params=e.params,u([],-r-1,e)}));var i;i=t?F(t):{},e.scope=i;var o;return e.sources.forEach(function(t,r){t.query=e;var n=t.datafn(e,e.params,u,r,A);void 0!==n&&((e.intofn||e.intoallfn)&&Array.isArray(n)&&(n=n.length),o=n),t.queriesdata=e.queriesdata}),0!=e.sources.length&&0!==s||(o=c(e)),o}function u(e,t,r){if(t>=0){var n=r.sources[t];n.data=e,"function"==typeof n.data&&(n.getfn=n.data,n.dontcache=n.getfn.dontcache,"OUTER"!=n.joinmode&&"RIGHT"!=n.joinmode&&"ANTI"!=n.joinmode||(n.dontcache=!1),n.data={})}else r.queriesdata[-t-1]=V(e);if(!(--r.sourceslen>0))return c(r)}function c(e){var t,r=e.scope;ee(e),e.data=[],e.xgroups={},e.groups=[];if(d(e,r,0),e.groupfn){if(e.data=[],0===e.groups.length){var n={};e.selectGroup.length>0&&e.selectGroup.forEach(function(e){"COUNT"==e.aggregatorid||"SUM"==e.aggregatorid?n[e.nick]=0:n[e.nick]=void 0}),e.groups=[n]}if(e.aggrKeys.length>0){var a="";e.aggrKeys.forEach(function(e){a+="g['"+e.nick+"']=alasql.aggr['"+e.funcid+"'](undefined,g['"+e.nick+"'],3);"});var s=new Function("g,params,alasql","var y;"+a)}for(var i=0,o=e.groups.length;i0){var g=e.removeKeys;if((t=g.length)>0)for(o=e.data.length,i=0;i0&&(e.columns=e.columns.filter(function(e){var t=!1;return g.forEach(function(r){e.columnid==r&&(t=!0)}),!t}))}if(void 0!==e.removeLikeKeys&&e.removeLikeKeys.length>0){for(var m=e.removeLikeKeys,i=0,o=e.data.length;i0&&(e.columns=e.columns.filter(function(e){var t=!1;return m.forEach(function(r){A.utils.like(r,e.columnid)&&(t=!0)}),!t}))}if(e.pivotfn&&e.pivotfn(),e.unpivotfn&&e.unpivotfn(),e.intoallfn){var S=e.intoallfn(e.columns,e.cb,e.params,e.alasql);return S}if(e.intofn){for(o=e.data.length,i=0;i=e.sources.length)e.wherefn(t,e.params,A)&&(e.groupfn?e.groupfn(t,e.params,A):e.data.push(e.selectfn(t,e.params,A)));else if(e.sources[r].applyselect){var n=e.sources[r];n.applyselect(e.params,function(a){if(a.length>0)for(var s=0;s0){for(var a={},s=Math.min(t.length,A.options.columnlookup||10)-1;0<=s;s--)for(var i in t[s])a[i]=!0;n=Object.keys(a).map(function(e){return{columnid:e}})}else n=[];if("VALUE"===r)if(t.length>0){var i;i=n&&n.length>0?n[0].columnid:Object.keys(t[0])[0],t=t[0][i]}else t=void 0;else if("ROW"===r)if(t.length>0){var i,o=[];for(var i in t[0])o.push(t[0][i]);t=o}else t=void 0;else if("COLUMN"===r){var u=[];if(t.length>0){var i;i=n&&n.length>0?n[0].columnid:Object.keys(t[0])[0];for(var s=0,c=t.length;s0)i=n[0].columnid,d=n[1].columnid;else{var f=Object.keys(t[0]);i=f[0],d=f[1]}for(var s=0,c=t.length;s0?n[0].columnid:Object.keys(t[0])[0];for(var s=0,c=t.length;s0?s.forEach(function(s){r&&"underscore"==A.options.joinstar?a.push("'"+t+"_"+s.columnid+"':p['"+t+"']['"+s.columnid+"']"):r&&"json"==A.options.joinstar?n+="r['"+t+"']['"+s.columnid+"']=p['"+t+"']['"+s.columnid+"'];":a.push("'"+s.columnid+"':p['"+t+"']['"+s.columnid+"']"),e.selectColumns[R(s.columnid)]=!0;var i={columnid:s.columnid,dbtypeid:s.dbtypeid,dbsize:s.dbsize,dbprecision:s.dbprecision,dbenum:s.dbenum};e.columns.push(i),e.xcolumns[i.columnid]=i}):(n+='var w=p["'+t+'"];for(var k in w){r[k]=w[k]};',e.dirtyColumns=!0),{s:a.join(","),sp:n}}function b(e,t){if(Array.isArray(e)){for(var r=[[]],n=0;n"+(a+1),r.forEach(function(r){t+=" ",e[a][r]==+e[a][r]?(t+='
',t+=void 0===e[a][r]?"NULL":e[a][r],t+="
"):t+=void 0===e[a][r]?"NULL":"string"==typeof e[a][r]?e[a][r]:ce(e[a][r])});t+=""}else t+="

"+ce(e)+"

";return t}function m(e,t,r){if(!(r<=0)){var n=t-e.scrollTop,a=n/r*10;setTimeout(function(){e.scrollTop!==t&&(e.scrollTop=e.scrollTop+a,m(e,t,r-10))},10)}}function S(e,t,r,n,a,s){function i(e){for(var t="",r=0,n=10240;r0&&T[T.length-1]&&0==Object.keys(T[T.length-1]).length&&T.pop(),n&&(T=n(T,a,s))},function(e){throw e})}function T(e){function t(){if(i(/^<\?xml\s*/)){for(var e={attributes:{}};!o()&&!u("?>");){var t=a();if(!t)return e;e.attributes[t.name]=t.value}return i(/\?>\s*/),e}}function r(){var e=i(/^<([\w-:.]+)\s*/);if(e){for(var t={name:e[1],attributes:{},children:[]};!(o()||u(">")||u("?>")||u("/>"));){var s=a();if(!s)return t;t.attributes[s.name]=s.value}if(i(/^\s*\/>\s*/))return t;i(/\??>\s*/),t.content=n();for(var c;c=r();)t.children.push(c);return i(/^<\/[\w-:.]+>\s*/),t}}function n(){var e=i(/^([^<]*)/);return e?e[1]:""}function a(){var e=i(/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/);if(e)return{name:e[1],value:s(e[2])}}function s(e){return e.replace(/^['"]|['"]$/g,"")}function i(t){var r=e.match(t);if(r)return e=e.slice(r[0].length),r}function o(){return 0==e.length}function u(t){return 0==e.indexOf(t)}return e=e.trim(),e=e.replace(//g,""),function(){return{declaration:t(),root:r()}}()}var A=function(e,t,r,n){if(t=t||[],"function"!=typeof importScripts&&A.webworker){var a=A.lastid++;return A.buffer[a]=r,void A.webworker.postMessage({id:a,sql:e,params:t})}return 0===arguments.length?new Q.Select({columns:[new Q.Column({columnid:"*"})],from:[new Q.ParamValue({param:0})]}):1===arguments.length&&e.constructor===Array?A.promise(e):("function"==typeof t&&(n=r,r=t,t=[]),"object"!=typeof t&&(t=[t]),"string"==typeof e&&"#"===e[0]&&"object"==typeof document?e=document.querySelector(e).textContent:"object"==typeof e&&e instanceof HTMLElement?e=e.textContent:"function"==typeof e&&(e=e.toString().slice(14,-3)),A.exec(e,t,r,n))};A.version="0.3.9-develop-1513",A.debug=void 0;var y=function(){return null},N=function(){function e(){this.yy={}}var t=function(e,t,r,n){for(r=r||{},n=e.length;n--;r[e[n]]=t);return r },r=[2,13],n=[1,104],a=[1,102],s=[1,103],i=[1,6],o=[1,42],u=[1,79],c=[1,76],l=[1,94],h=[1,93],d=[1,69],f=[1,101],p=[1,85],b=[1,64],E=[1,71],g=[1,84],m=[1,66],v=[1,70],S=[1,68],T=[1,61],y=[1,74],N=[1,62],C=[1,67],R=[1,83],O=[1,77],I=[1,86],x=[1,87],D=[1,81],k=[1,82],L=[1,80],$=[1,88],M=[1,89],U=[1,90],_=[1,91],F=[1,92],P=[1,98],q=[1,65],G=[1,78],V=[1,72],B=[1,96],j=[1,97],H=[1,63],J=[1,73],Y=[1,108],W=[1,107],X=[10,306,602,764],K=[10,306,310,602,764],Q=[1,115],z=[1,116],Z=[1,117],ee=[1,118],te=[1,119],re=[130,353,410],ne=[1,127],ae=[1,126],se=[1,134],ie=[1,164],oe=[1,175],ue=[1,178],ce=[1,173],le=[1,181],he=[1,185],de=[1,160],fe=[1,182],pe=[1,169],be=[1,171],Ee=[1,174],ge=[1,183],me=[1,166],ve=[1,193],Se=[1,188],Te=[1,189],Ae=[1,194],ye=[1,195],Ne=[1,196],Ce=[1,197],Re=[1,198],Oe=[1,199],we=[1,200],Ie=[1,201],xe=[1,202],De=[1,176],ke=[1,177],Le=[1,179],$e=[1,180],Me=[1,186],Ue=[1,192],_e=[1,184],Fe=[1,187],Pe=[1,172],qe=[1,170],Ge=[1,191],Ve=[1,203],Be=[2,4,5],je=[2,471],He=[1,206],Je=[1,211],Ye=[1,220],We=[1,216],Xe=[10,72,78,93,98,118,128,162,168,169,183,198,232,245,247,306,310,602,764],Ke=[2,4,5,10,72,76,77,78,112,115,116,118,122,123,124,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,183,185,187,198,280,281,282,283,284,285,286,287,288,306,310,420,424,602,764],Qe=[2,4,5,10,53,72,74,76,77,78,89,93,95,98,99,107,112,115,116,118,122,123,124,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,179,180,181,183,185,187,189,198,206,208,222,223,224,225,226,227,228,229,232,239,242,243,245,247,266,267,280,281,282,283,284,285,286,287,288,290,296,300,306,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,330,331,332,333,335,338,339,396,400,401,404,406,408,409,417,418,420,424,434,436,437,439,440,441,442,443,447,448,451,452,464,470,505,507,508,517,602,764],ze=[1,249],Ze=[1,256],et=[1,265],tt=[1,270],rt=[1,269],nt=[2,4,5,10,72,77,78,93,98,107,118,128,131,132,137,143,145,149,152,154,156,162,168,169,179,180,181,183,198,232,245,247,265,266,270,271,273,280,281,282,283,284,285,286,287,288,290,291,292,293,294,295,296,297,298,299,302,303,306,310,312,317,420,424,602,764],at=[2,162],st=[1,281],it=[10,74,78,306,310,505,602,764],ot=[2,4,5,10,53,72,74,76,77,78,89,93,95,98,99,107,112,115,116,118,122,123,124,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,179,180,181,183,185,187,189,193,198,206,208,222,223,224,225,226,227,228,229,230,231,232,239,242,243,245,247,266,267,280,281,282,283,284,285,286,287,288,290,296,297,300,302,306,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,330,331,332,333,335,338,339,343,344,356,368,369,370,373,374,386,389,396,400,401,402,403,404,405,406,408,409,417,418,420,424,426,433,434,436,437,439,440,441,442,443,447,448,451,452,464,470,505,507,508,514,515,516,517,602,764],ut=[2,4,5,10,53,72,89,124,146,156,189,266,267,290,306,335,338,339,396,400,401,404,406,408,409,417,418,434,436,437,439,440,441,442,443,447,448,451,452,505,507,508,517,602,764],ct=[1,562],lt=[1,564],ht=[2,503],dt=[1,569],ft=[1,580],pt=[1,583],bt=[1,584],Et=[10,78,89,132,137,146,189,296,306,310,470,602,764],gt=[10,74,306,310,602,764],mt=[2,567],vt=[1,602],St=[2,4,5,156],Tt=[1,640],At=[1,612],yt=[1,646],Nt=[1,647],Ct=[1,620],Rt=[1,631],Ot=[1,618],wt=[1,626],It=[1,619],xt=[1,627],Dt=[1,629],kt=[1,621],Lt=[1,622],$t=[1,641],Mt=[1,638],Ut=[1,639],_t=[1,615],Ft=[1,617],Pt=[1,609],qt=[1,610],Gt=[1,611],Vt=[1,613],Bt=[1,614],jt=[1,616],Ht=[1,623],Jt=[1,624],Yt=[1,628],Wt=[1,630],Xt=[1,632],Kt=[1,633],Qt=[1,634],zt=[1,635],Zt=[1,636],er=[1,642],tr=[1,643],rr=[1,644],nr=[1,645],ar=[2,287],sr=[2,4,5,10,53,72,74,76,77,78,89,93,95,98,99,107,112,115,116,118,122,123,124,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,179,180,181,183,185,187,189,198,206,208,222,223,224,225,226,227,228,229,230,231,232,239,242,243,245,247,266,267,280,281,282,283,284,285,286,287,288,290,296,297,300,306,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,330,331,332,333,335,338,339,343,356,368,369,373,374,396,400,401,404,406,408,409,417,418,420,424,426,434,436,437,439,440,441,442,443,447,448,451,452,464,470,505,507,508,517,602,764],ir=[2,359],or=[1,668],ur=[1,678],cr=[2,4,5,10,53,72,74,76,77,78,89,93,95,98,99,107,112,115,116,118,122,123,124,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,179,180,181,183,185,187,189,198,206,208,222,223,224,225,226,227,228,229,230,231,232,239,242,243,245,247,266,267,280,281,282,283,284,285,286,287,288,290,296,300,306,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,330,331,332,333,335,338,339,396,400,401,404,406,408,409,417,418,420,424,426,434,436,437,439,440,441,442,443,447,448,451,452,464,470,505,507,508,517,602,764],lr=[1,694],hr=[1,703],dr=[1,702],fr=[2,4,5,10,72,74,78,93,98,118,128,162,168,169,206,208,222,223,224,225,226,227,228,229,230,231,232,245,247,306,310,602,764],pr=[10,72,74,78,93,98,118,128,162,168,169,206,208,222,223,224,225,226,227,228,229,230,231,232,245,247,306,310,602,764],br=[2,202],Er=[1,725],gr=[10,72,78,93,98,118,128,162,168,169,183,232,245,247,306,310,602,764],mr=[2,163],vr=[1,728],Sr=[2,4,5,112],Tr=[1,741],Ar=[1,760],yr=[1,740],Nr=[1,739],Cr=[1,734],Rr=[1,735],Or=[1,737],wr=[1,738],Ir=[1,742],xr=[1,743],Dr=[1,744],kr=[1,745],Lr=[1,746],$r=[1,747],Mr=[1,748],Ur=[1,749],_r=[1,750],Fr=[1,751],Pr=[1,752],qr=[1,753],Gr=[1,754],Vr=[1,755],Br=[1,756],jr=[1,757],Hr=[1,759],Jr=[1,761],Yr=[1,762],Wr=[1,763],Xr=[1,764],Kr=[1,765],Qr=[1,766],zr=[1,767],Zr=[1,770],en=[1,771],tn=[1,772],rn=[1,773],nn=[1,774],an=[1,775],sn=[1,776],on=[1,777],un=[1,778],cn=[1,779],ln=[1,780],hn=[1,781],dn=[74,89,189],fn=[10,74,78,154,187,230,297,306,310,343,356,368,369,373,374,602,764],pn=[1,798],bn=[10,74,78,300,306,310,602,764],En=[1,799],gn=[1,805],mn=[1,806],vn=[1,810],Sn=[10,74,78,306,310,602,764],Tn=[2,4,5,77,131,132,137,143,145,149,152,154,156,179,180,181,265,266,270,271,273,280,281,282,283,284,285,286,287,288,290,291,292,293,294,295,296,297,298,299,302,303,312,317,420,424],An=[10,72,78,93,98,107,118,128,162,168,169,183,198,232,245,247,306,310,602,764],yn=[2,4,5,10,72,77,78,93,98,107,118,128,131,132,137,143,145,149,152,154,156,162,164,168,169,179,180,181,183,185,187,195,198,232,245,247,265,266,270,271,273,280,281,282,283,284,285,286,287,288,290,291,292,293,294,295,296,297,298,299,302,303,306,310,312,317,420,424,602,764],Nn=[2,4,5,132,296],Cn=[1,844],Rn=[10,74,76,78,306,310,602,764],On=[2,738],wn=[10,74,76,78,132,139,141,145,152,306,310,420,424,602,764],In=[2,1161],xn=[10,74,76,78,139,141,145,152,306,310,420,424,602,764],Dn=[10,74,76,78,139,141,145,306,310,420,424,602,764],kn=[10,74,78,139,141,306,310,602,764],Ln=[10,78,89,132,146,189,296,306,310,470,602,764],$n=[335,338,339],Mn=[2,764],Un=[1,869],_n=[1,870],Fn=[1,871],Pn=[1,872],qn=[1,881],Gn=[1,880],Vn=[164,166,334],Bn=[2,444],jn=[1,936],Hn=[2,4,5,77,131,156,290,291,292,293],Jn=[1,951],Yn=[2,4,5,10,53,72,74,76,77,78,89,93,95,98,99,107,112,118,122,124,128,129,130,131,132,134,135,137,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,179,181,183,185,187,189,198,206,208,222,223,224,225,226,227,228,229,232,239,242,243,245,247,266,267,280,281,282,283,284,285,286,287,288,290,296,300,306,308,309,310,311,313,314,315,317,318,319,320,321,322,323,324,325,326,330,331,332,333,335,338,339,396,400,401,404,406,408,409,417,418,420,424,434,436,437,439,440,441,442,443,447,448,451,452,464,470,505,507,508,517,602,764],Wn=[2,4,5,10,53,72,74,76,77,78,89,93,95,98,99,107,112,115,116,118,122,123,124,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,179,180,181,183,185,187,189,198,206,208,222,223,224,225,226,227,228,229,232,239,242,243,245,247,266,267,280,281,282,283,284,285,286,287,288,290,296,300,306,308,309,310,311,312,313,314,315,317,318,319,320,321,322,323,324,325,326,330,331,332,333,335,338,339,396,400,401,404,406,408,409,417,418,420,424,434,436,437,439,440,441,442,443,447,448,451,452,464,470,505,507,508,517,602,764],Xn=[2,375],Kn=[1,958],Qn=[306,308,310],zn=[74,300],Zn=[74,300,426],ea=[1,965],ta=[2,4,5,10,53,72,74,76,78,89,93,95,98,99,107,112,115,116,118,122,123,124,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,179,180,181,183,185,187,189,198,206,208,222,223,224,225,226,227,228,229,232,239,242,243,245,247,266,267,280,281,282,283,284,285,286,287,288,290,296,300,306,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,330,331,332,333,335,338,339,396,400,401,404,406,408,409,417,418,420,424,434,436,437,439,440,441,442,443,447,448,451,452,464,470,505,507,508,517,602,764],ra=[74,426],na=[1,978],aa=[1,977],sa=[1,984],ia=[10,72,78,93,98,118,128,162,168,169,232,245,247,306,310,602,764],oa=[1,1010],ua=[10,72,78,306,310,602,764],ca=[1,1016],la=[1,1017],ha=[1,1018],da=[2,4,5,10,72,74,76,77,78,112,115,116,118,122,123,124,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,179,180,181,183,185,187,198,280,281,282,283,284,285,286,287,288,306,310,420,424,602,764],fa=[1,1068],pa=[1,1067],ba=[1,1081],Ea=[1,1080],ga=[1,1088],ma=[10,72,74,78,93,98,107,118,128,162,168,169,183,198,232,245,247,306,310,602,764],va=[1,1119],Sa=[10,78,89,146,189,306,310,470,602,764],Ta=[1,1139],Aa=[1,1138],ya=[1,1137],Na=[2,4,5,10,53,72,74,76,77,78,89,93,95,98,99,107,112,115,116,118,122,123,124,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,179,180,181,183,185,187,189,198,206,208,222,223,224,225,226,227,228,229,230,232,239,242,243,245,247,266,267,280,281,282,283,284,285,286,287,288,290,296,297,300,306,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,330,331,332,333,335,338,339,343,356,368,369,373,374,396,400,401,404,406,408,409,417,418,420,424,434,436,437,439,440,441,442,443,447,448,451,452,464,470,505,507,508,517,602,764],Ca=[1,1153],Ra=[2,4,5,10,53,72,74,76,77,78,89,93,95,98,99,107,112,118,122,124,128,129,130,131,132,134,135,137,139,140,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,181,183,185,187,189,198,206,208,222,223,224,225,226,227,228,229,232,239,242,243,245,247,266,267,280,281,282,283,284,285,286,287,288,290,296,300,306,308,309,310,311,313,314,315,320,321,322,323,324,325,326,330,331,332,333,335,338,339,396,400,401,404,406,408,409,417,418,420,424,434,436,437,439,440,441,442,443,447,448,451,452,464,470,505,507,508,517,602,764],Oa=[2,4,5,10,53,72,74,76,77,78,89,93,95,98,99,107,112,118,122,124,128,129,130,131,132,134,135,137,139,140,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,181,183,185,187,189,198,206,208,222,223,224,225,226,227,228,229,232,239,242,243,245,247,266,267,280,281,282,283,284,285,286,287,288,290,296,300,306,308,309,310,311,313,315,320,321,322,323,324,325,326,330,331,332,333,335,338,339,396,400,401,404,406,408,409,417,418,420,424,434,436,437,439,440,441,442,443,447,448,451,452,464,470,505,507,508,517,602,764],wa=[2,4,5,10,53,72,74,76,77,78,89,93,95,98,99,107,112,118,122,124,128,129,130,131,132,133,134,135,137,138,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,179,180,181,183,185,187,189,198,206,208,222,223,224,225,226,227,228,229,232,239,242,243,245,247,266,267,280,281,282,283,284,285,286,287,288,290,296,300,306,308,309,310,311,313,314,315,317,318,319,320,321,322,323,324,325,326,330,331,332,333,335,338,339,396,400,401,404,406,408,409,417,418,420,424,434,436,437,439,440,441,442,443,447,448,451,452,464,470,505,507,508,517,602,764],Ia=[2,4,5,10,53,72,74,76,77,78,89,93,95,98,99,107,112,118,122,124,128,129,130,131,132,134,135,137,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,181,183,185,187,189,198,206,208,222,223,224,225,226,227,228,229,232,239,242,243,245,247,266,267,280,281,282,283,284,285,286,287,288,290,296,300,306,308,309,310,311,313,314,315,318,319,320,321,322,323,324,325,326,330,331,332,333,335,338,339,396,400,401,404,406,408,409,417,418,420,424,434,436,437,439,440,441,442,443,447,448,451,452,464,470,505,507,508,517,602,764],xa=[2,4,5,10,53,72,74,76,77,78,89,93,95,98,99,107,118,122,124,128,129,130,131,132,134,135,137,139,140,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,181,183,185,187,189,198,206,208,222,223,224,225,226,227,228,229,232,239,242,243,245,247,266,267,280,281,282,283,284,285,286,287,288,290,296,300,306,308,309,310,314,320,321,322,323,324,325,326,330,331,333,335,338,339,396,400,401,404,406,408,409,417,418,420,424,434,436,437,439,440,441,442,443,447,448,451,452,464,470,505,507,508,517,602,764],Da=[2,406],ka=[2,4,5,10,53,72,74,76,77,78,89,93,95,98,107,118,122,128,129,130,131,132,134,135,137,143,145,146,148,149,150,152,156,162,164,166,168,169,170,171,172,173,175,181,183,185,187,189,198,206,208,222,223,224,225,226,227,228,229,232,239,242,243,245,247,266,267,280,281,282,283,284,285,286,287,288,290,296,300,306,308,309,310,314,330,331,333,335,338,339,396,400,401,404,406,408,409,417,418,420,424,434,436,437,439,440,441,442,443,447,448,451,452,464,470,505,507,508,517,602,764],La=[2,285],$a=[2,4,5,10,53,72,74,76,77,78,89,93,95,98,99,107,112,115,116,118,122,123,124,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,179,180,181,183,185,187,189,198,206,208,222,223,224,225,226,227,228,229,232,239,242,243,245,247,266,267,280,281,282,283,284,285,286,287,288,290,296,300,306,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,330,331,332,333,335,338,339,396,400,401,404,406,408,409,417,418,420,424,426,434,436,437,439,440,441,442,443,447,448,451,452,464,470,505,507,508,517,602,764],Ma=[10,78,306,310,602,764],Ua=[1,1189],_a=[10,77,78,143,145,152,181,302,306,310,420,424,602,764],Fa=[10,74,78,306,308,310,464,602,764],Pa=[1,1200],qa=[10,72,78,118,128,162,168,169,232,245,247,306,310,602,764],Ga=[10,72,74,78,93,98,118,128,162,168,169,183,198,232,245,247,306,310,602,764],Va=[2,4,5,72,76,77,78,112,115,116,118,122,123,124,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,185,187,280,281,282,283,284,285,286,287,288,420,424],Ba=[2,4,5,72,74,76,77,78,112,115,116,118,122,123,124,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,185,187,280,281,282,283,284,285,286,287,288,420,424],ja=[2,1085],Ha=[2,4,5,72,74,76,77,112,115,116,118,122,123,124,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,185,187,280,281,282,283,284,285,286,287,288,420,424],Ja=[1,1252],Ya=[10,74,78,128,306,308,310,464,602,764],Wa=[115,116,124],Xa=[2,584],Ka=[1,1280],Qa=[76,139],za=[2,724],Za=[1,1297],es=[1,1298],ts=[2,4,5,10,53,72,76,89,124,146,156,189,230,266,267,290,306,310,335,338,339,396,400,401,404,406,408,409,417,418,434,436,437,439,440,441,442,443,447,448,451,452,505,507,508,517,602,764],rs=[2,330],ns=[1,1322],as=[1,1336],ss=[1,1338],is=[2,487],os=[74,78],us=[10,306,308,310,464,602,764],cs=[10,72,78,118,162,168,169,232,245,247,306,310,602,764],ls=[1,1354],hs=[1,1358],ds=[1,1359],fs=[1,1361],ps=[1,1362],bs=[1,1363],Es=[1,1364],gs=[1,1365],ms=[1,1366],vs=[1,1367],Ss=[1,1368],Ts=[10,72,74,78,93,98,118,128,162,168,169,206,208,222,223,224,225,226,227,228,229,232,245,247,306,310,602,764],As=[1,1393],ys=[10,72,78,118,162,168,169,245,247,306,310,602,764],Ns=[10,72,78,93,98,118,128,162,168,169,206,208,222,223,224,225,226,227,228,229,232,245,247,306,310,602,764],Cs=[1,1490],Rs=[1,1492],Os=[2,4,5,77,143,145,152,156,181,290,291,292,293,302,420,424],ws=[1,1506],Is=[10,72,74,78,162,168,169,245,247,306,310,602,764],xs=[1,1524],Ds=[1,1526],ks=[1,1527],Ls=[1,1523],$s=[1,1522],Ms=[1,1521],Us=[1,1528],_s=[1,1518],Fs=[1,1519],Ps=[1,1520],qs=[1,1545],Gs=[2,4,5,10,53,72,89,124,146,156,189,266,267,290,306,310,335,338,339,396,400,401,404,406,408,409,417,418,434,436,437,439,440,441,442,443,447,448,451,452,505,507,508,517,602,764],Vs=[1,1556],Bs=[1,1564],js=[1,1563],Hs=[10,72,78,162,168,169,245,247,306,310,602,764],Js=[10,72,78,93,98,118,128,162,168,169,206,208,222,223,224,225,226,227,228,229,230,231,232,245,247,306,310,602,764],Ys=[2,4,5,10,72,78,93,98,118,128,162,168,169,206,208,222,223,224,225,226,227,228,229,230,231,232,245,247,306,310,602,764],Ws=[1,1621],Xs=[1,1623],Ks=[1,1620],Qs=[1,1622],zs=[187,193,368,369,370,373],Zs=[2,515],ei=[1,1628],ti=[1,1647],ri=[10,72,78,162,168,169,306,310,602,764],ni=[1,1657],ai=[1,1658],si=[1,1659],ii=[1,1678],oi=[4,10,243,306,310,343,356,602,764],ui=[1,1726],ci=[10,72,74,78,118,162,168,169,239,245,247,306,310,602,764],li=[2,4,5,77],hi=[1,1820],di=[1,1832],fi=[1,1851],pi=[10,72,78,162,168,169,306,310,415,602,764],bi=[10,74,78,230,306,310,602,764],Ei={trace:function(){},yy:{},symbols_:{error:2,Literal:3,LITERAL:4,BRALITERAL:5,NonReserved:6,LiteralWithSpaces:7,main:8,Statements:9,EOF:10,Statements_group0:11,AStatement:12,ExplainStatement:13,EXPLAIN:14,QUERY:15,PLAN:16,Statement:17,AlterTable:18,AttachDatabase:19,Call:20,CreateDatabase:21,CreateIndex:22,CreateGraph:23,CreateTable:24,CreateView:25,CreateEdge:26,CreateVertex:27,Declare:28,Delete:29,DetachDatabase:30,DropDatabase:31,DropIndex:32,DropTable:33,DropView:34,If:35,Insert:36,Merge:37,Reindex:38,RenameTable:39,Select:40,ShowCreateTable:41,ShowColumns:42,ShowDatabases:43,ShowIndex:44,ShowTables:45,TruncateTable:46,WithSelect:47,CreateTrigger:48,DropTrigger:49,BeginTransaction:50,CommitTransaction:51,RollbackTransaction:52,EndTransaction:53,UseDatabase:54,Update:55,JavaScript:56,Source:57,Assert:58,While:59,Continue:60,Break:61,BeginEnd:62,Print:63,Require:64,SetVariable:65,ExpressionStatement:66,AddRule:67,Query:68,Echo:69,CreateFunction:70,CreateAggregate:71,WITH:72,WithTablesList:73,COMMA:74,WithTable:75,AS:76,LPAR:77,RPAR:78,SelectClause:79,Select_option0:80,IntoClause:81,FromClause:82,Select_option1:83,WhereClause:84,GroupClause:85,OrderClause:86,LimitClause:87,UnionClause:88,SEARCH:89,Select_repetition0:90,Select_option2:91,PivotClause:92,PIVOT:93,Expression:94,FOR:95,PivotClause_option0:96,PivotClause_option1:97,UNPIVOT:98,IN:99,ColumnsList:100,PivotClause_option2:101,PivotClause2:102,AsList:103,AsLiteral:104,AsPart:105,RemoveClause:106,REMOVE:107,RemoveClause_option0:108,RemoveColumnsList:109,RemoveColumn:110,Column:111,LIKE:112,StringValue:113,ArrowDot:114,ARROW:115,DOT:116,SearchSelector:117,ORDER:118,BY:119,OrderExpressionsList:120,SearchSelector_option0:121,DOTDOT:122,CARET:123,EQ:124,SearchSelector_repetition_plus0:125,SearchSelector_repetition_plus1:126,SearchSelector_option1:127,WHERE:128,OF:129,CLASS:130,NUMBER:131,STRING:132,SLASH:133,VERTEX:134,EDGE:135,EXCLAMATION:136,SHARP:137,MODULO:138,GT:139,LT:140,GTGT:141,LTLT:142,DOLLAR:143,Json:144,AT:145,SET:146,SetColumnsList:147,TO:148,VALUE:149,ROW:150,ExprList:151,COLON:152,PlusStar:153,NOT:154,SearchSelector_repetition2:155,IF:156,SearchSelector_repetition3:157,Aggregator:158,SearchSelector_repetition4:159,SearchSelector_group0:160,SearchSelector_repetition5:161,UNION:162,SearchSelectorList:163,ALL:164,SearchSelector_repetition6:165,ANY:166,SearchSelector_repetition7:167,INTERSECT:168,EXCEPT:169,AND:170,OR:171,PATH:172,RETURN:173,ResultColumns:174,REPEAT:175,SearchSelector_repetition8:176,SearchSelectorList_repetition0:177,SearchSelectorList_repetition1:178,PLUS:179,STAR:180,QUESTION:181,SearchFrom:182,FROM:183,SelectModifier:184,DISTINCT:185,TopClause:186,UNIQUE:187,SelectClause_option0:188,SELECT:189,COLUMN:190,MATRIX:191,TEXTSTRING:192,INDEX:193,RECORDSET:194,TOP:195,NumValue:196,TopClause_option0:197,INTO:198,Table:199,FuncValue:200,ParamValue:201,VarValue:202,FromTablesList:203,JoinTablesList:204,ApplyClause:205,CROSS:206,APPLY:207,OUTER:208,FromTable:209,FromTable_option0:210,FromTable_option1:211,INDEXED:212,INSERTED:213,FromString:214,JoinTable:215,JoinMode:216,JoinTableAs:217,OnClause:218,JoinTableAs_option0:219,JoinTableAs_option1:220,JoinModeMode:221,NATURAL:222,JOIN:223,INNER:224,LEFT:225,RIGHT:226,FULL:227,SEMI:228,ANTI:229,ON:230,USING:231,GROUP:232,GroupExpressionsList:233,HavingClause:234,GroupExpression:235,GROUPING:236,ROLLUP:237,CUBE:238,HAVING:239,CORRESPONDING:240,OrderExpression:241,DIRECTION:242,COLLATE:243,NOCASE:244,LIMIT:245,OffsetClause:246,OFFSET:247,LimitClause_option0:248,FETCH:249,LimitClause_option1:250,LimitClause_option2:251,LimitClause_option3:252,ResultColumn:253,Star:254,AggrValue:255,Op:256,LogicValue:257,NullValue:258,ExistsValue:259,CaseValue:260,CastClause:261,ArrayValue:262,NewClause:263,Expression_group0:264,CURRENT_TIMESTAMP:265,JAVASCRIPT:266,CREATE:267,FUNCTION:268,AGGREGATE:269,NEW:270,CAST:271,ColumnType:272,CONVERT:273,PrimitiveValue:274,OverClause:275,OVER:276,OverPartitionClause:277,OverOrderByClause:278,PARTITION:279,SUM:280,COUNT:281,MIN:282,MAX:283,AVG:284,FIRST:285,LAST:286,AGGR:287,ARRAY:288,FuncValue_option0:289,REPLACE:290,DATEADD:291,DATEDIFF:292,INTERVAL:293,TRUE:294,FALSE:295,NSTRING:296,NULL:297,EXISTS:298,ARRAYLBRA:299,RBRA:300,ParamValue_group0:301,BRAQUESTION:302,CASE:303,WhensList:304,ElseClause:305,END:306,When:307,WHEN:308,THEN:309,ELSE:310,REGEXP:311,TILDA:312,GLOB:313,ESCAPE:314,NOT_LIKE:315,BARBAR:316,MINUS:317,AMPERSAND:318,BAR:319,GE:320,LE:321,EQEQ:322,EQEQEQ:323,NE:324,NEEQEQ:325,NEEQEQEQ:326,CondOp:327,AllSome:328,ColFunc:329,BETWEEN:330,NOT_BETWEEN:331,IS:332,DOUBLECOLON:333,SOME:334,UPDATE:335,SetColumn:336,SetColumn_group0:337,DELETE:338,INSERT:339,Into:340,Values:341,ValuesListsList:342,DEFAULT:343,VALUES:344,ValuesList:345,Value:346,DateValue:347,TemporaryClause:348,TableClass:349,IfNotExists:350,CreateTableDefClause:351,CreateTableOptionsClause:352,TABLE:353,CreateTableOptions:354,CreateTableOption:355,IDENTITY:356,TEMP:357,ColumnDefsList:358,ConstraintsList:359,Constraint:360,ConstraintName:361,PrimaryKey:362,ForeignKey:363,UniqueKey:364,IndexKey:365,Check:366,CONSTRAINT:367,CHECK:368,PRIMARY:369,KEY:370,PrimaryKey_option0:371,ColsList:372,FOREIGN:373,REFERENCES:374,ForeignKey_option0:375,OnForeignKeyClause:376,ParColsList:377,OnDeleteClause:378,OnUpdateClause:379,NO:380,ACTION:381,UniqueKey_option0:382,UniqueKey_option1:383,ColumnDef:384,ColumnConstraintsClause:385,ColumnConstraints:386,SingularColumnType:387,NumberMax:388,ENUM:389,MAXNUM:390,ColumnConstraintsList:391,ColumnConstraint:392,ParLiteral:393,ColumnConstraint_option0:394,ColumnConstraint_option1:395,DROP:396,DropTable_group0:397,IfExists:398,TablesList:399,ALTER:400,RENAME:401,ADD:402,MODIFY:403,ATTACH:404,DATABASE:405,DETACH:406,AsClause:407,USE:408,SHOW:409,VIEW:410,CreateView_option0:411,CreateView_option1:412,SubqueryRestriction:413,READ:414,ONLY:415,OPTION:416,SOURCE:417,ASSERT:418,JsonObject:419,ATLBRA:420,JsonArray:421,JsonValue:422,JsonPrimitiveValue:423,LCUR:424,JsonPropertiesList:425,RCUR:426,JsonElementsList:427,JsonProperty:428,OnOff:429,SetPropsList:430,AtDollar:431,SetProp:432,OFF:433,COMMIT:434,TRANSACTION:435,ROLLBACK:436,BEGIN:437,ElseStatement:438,WHILE:439,CONTINUE:440,BREAK:441,PRINT:442,REQUIRE:443,StringValuesList:444,PluginsList:445,Plugin:446,ECHO:447,DECLARE:448,DeclaresList:449,DeclareItem:450,TRUNCATE:451,MERGE:452,MergeInto:453,MergeUsing:454,MergeOn:455,MergeMatchedList:456,OutputClause:457,MergeMatched:458,MergeNotMatched:459,MATCHED:460,MergeMatchedAction:461,MergeNotMatchedAction:462,TARGET:463,OUTPUT:464,CreateVertex_option0:465,CreateVertex_option1:466,CreateVertex_option2:467,CreateVertexSet:468,SharpValue:469,CONTENT:470,CreateEdge_option0:471,GRAPH:472,GraphList:473,GraphVertexEdge:474,GraphElement:475,GraphVertexEdge_option0:476,GraphVertexEdge_option1:477,GraphElementVar:478,GraphVertexEdge_option2:479,GraphVertexEdge_option3:480,GraphVertexEdge_option4:481,GraphVar:482,GraphAsClause:483,GraphAtClause:484,GraphElement2:485,GraphElement2_option0:486,GraphElement2_option1:487,GraphElement2_option2:488,GraphElement2_option3:489,GraphElement_option0:490,GraphElement_option1:491,GraphElement_option2:492,SharpLiteral:493,GraphElement_option3:494,GraphElement_option4:495,GraphElement_option5:496,ColonLiteral:497,DeleteVertex:498,DeleteVertex_option0:499,DeleteEdge:500,DeleteEdge_option0:501,DeleteEdge_option1:502,DeleteEdge_option2:503,Term:504,COLONDASH:505,TermsList:506,QUESTIONDASH:507,CALL:508,TRIGGER:509,BeforeAfter:510,InsertDeleteUpdate:511,CreateTrigger_option0:512,CreateTrigger_option1:513,BEFORE:514,AFTER:515,INSTEAD:516,REINDEX:517,A:518,ABSENT:519,ABSOLUTE:520,ACCORDING:521,ADA:522,ADMIN:523,ALWAYS:524,ASC:525,ASSERTION:526,ASSIGNMENT:527,ATTRIBUTE:528,ATTRIBUTES:529,BASE64:530,BERNOULLI:531,BLOCKED:532,BOM:533,BREADTH:534,C:535,CASCADE:536,CATALOG:537,CATALOG_NAME:538,CHAIN:539,CHARACTERISTICS:540,CHARACTERS:541,CHARACTER_SET_CATALOG:542,CHARACTER_SET_NAME:543,CHARACTER_SET_SCHEMA:544,CLASS_ORIGIN:545,COBOL:546,COLLATION:547,COLLATION_CATALOG:548,COLLATION_NAME:549,COLLATION_SCHEMA:550,COLUMNS:551,COLUMN_NAME:552,COMMAND_FUNCTION:553,COMMAND_FUNCTION_CODE:554,COMMITTED:555,CONDITION_NUMBER:556,CONNECTION:557,CONNECTION_NAME:558,CONSTRAINTS:559,CONSTRAINT_CATALOG:560,CONSTRAINT_NAME:561,CONSTRAINT_SCHEMA:562,CONSTRUCTOR:563,CONTROL:564,CURSOR_NAME:565,DATA:566,DATETIME_INTERVAL_CODE:567,DATETIME_INTERVAL_PRECISION:568,DB:569,DEFAULTS:570,DEFERRABLE:571,DEFERRED:572,DEFINED:573,DEFINER:574,DEGREE:575,DEPTH:576,DERIVED:577,DESC:578,DESCRIPTOR:579,DIAGNOSTICS:580,DISPATCH:581,DOCUMENT:582,DOMAIN:583,DYNAMIC_FUNCTION:584,DYNAMIC_FUNCTION_CODE:585,EMPTY:586,ENCODING:587,ENFORCED:588,EXCLUDE:589,EXCLUDING:590,EXPRESSION:591,FILE:592,FINAL:593,FLAG:594,FOLLOWING:595,FORTRAN:596,FOUND:597,FS:598,G:599,GENERAL:600,GENERATED:601,GO:602,GOTO:603,GRANTED:604,HEX:605,HIERARCHY:606,ID:607,IGNORE:608,IMMEDIATE:609,IMMEDIATELY:610,IMPLEMENTATION:611,INCLUDING:612,INCREMENT:613,INDENT:614,INITIALLY:615,INPUT:616,INSTANCE:617,INSTANTIABLE:618,INTEGRITY:619,INVOKER:620,ISOLATION:621,K:622,KEY_MEMBER:623,KEY_TYPE:624,LENGTH:625,LEVEL:626,LIBRARY:627,LINK:628,LOCATION:629,LOCATOR:630,M:631,MAP:632,MAPPING:633,MAXVALUE:634,MESSAGE_LENGTH:635,MESSAGE_OCTET_LENGTH:636,MESSAGE_TEXT:637,MINVALUE:638,MORE:639,MUMPS:640,NAME:641,NAMES:642,NAMESPACE:643,NESTING:644,NEXT:645,NFC:646,NFD:647,NFKC:648,NFKD:649,NIL:650,NORMALIZED:651,NULLABLE:652,NULLS:653,OBJECT:654,OCTETS:655,OPTIONS:656,ORDERING:657,ORDINALITY:658,OTHERS:659,OVERRIDING:660,P:661,PAD:662,PARAMETER_MODE:663,PARAMETER_NAME:664,PARAMETER_ORDINAL_POSITION:665,PARAMETER_SPECIFIC_CATALOG:666,PARAMETER_SPECIFIC_NAME:667,PARAMETER_SPECIFIC_SCHEMA:668,PARTIAL:669,PASCAL:670,PASSING:671,PASSTHROUGH:672,PERMISSION:673,PLACING:674,PLI:675,PRECEDING:676,PRESERVE:677,PRIOR:678,PRIVILEGES:679,PUBLIC:680,RECOVERY:681,RELATIVE:682,REPEATABLE:683,REQUIRING:684,RESPECT:685,RESTART:686,RESTORE:687,RESTRICT:688,RETURNED_CARDINALITY:689,RETURNED_LENGTH:690,RETURNED_OCTET_LENGTH:691,RETURNED_SQLSTATE:692,RETURNING:693,ROLE:694,ROUTINE:695,ROUTINE_CATALOG:696,ROUTINE_NAME:697,ROUTINE_SCHEMA:698,ROW_COUNT:699,SCALE:700,SCHEMA:701,SCHEMA_NAME:702,SCOPE_CATALOG:703,SCOPE_NAME:704,SCOPE_SCHEMA:705,SECTION:706,SECURITY:707,SELECTIVE:708,SELF:709,SEQUENCE:710,SERIALIZABLE:711,SERVER:712,SERVER_NAME:713,SESSION:714,SETS:715,SIMPLE:716,SIZE:717,SPACE:718,SPECIFIC_NAME:719,STANDALONE:720,STATE:721,STATEMENT:722,STRIP:723,STRUCTURE:724,STYLE:725,SUBCLASS_ORIGIN:726,T:727,TABLE_NAME:728,TEMPORARY:729,TIES:730,TOKEN:731,TOP_LEVEL_COUNT:732,TRANSACTIONS_COMMITTED:733,TRANSACTIONS_ROLLED_BACK:734,TRANSACTION_ACTIVE:735,TRANSFORM:736,TRANSFORMS:737,TRIGGER_CATALOG:738,TRIGGER_NAME:739,TRIGGER_SCHEMA:740,TYPE:741,UNBOUNDED:742,UNCOMMITTED:743,UNDER:744,UNLINK:745,UNNAMED:746,UNTYPED:747,URI:748,USAGE:749,USER_DEFINED_TYPE_CATALOG:750,USER_DEFINED_TYPE_CODE:751,USER_DEFINED_TYPE_NAME:752,USER_DEFINED_TYPE_SCHEMA:753,VALID:754,VERSION:755,WHITESPACE:756,WORK:757,WRAPPER:758,WRITE:759,XMLDECLARATION:760,XMLSCHEMA:761,YES:762,ZONE:763,SEMICOLON:764,PERCENT:765,ROWS:766,FuncValue_option0_group0:767,$accept:0,$end:1},terminals_:{2:"error",4:"LITERAL",5:"BRALITERAL",10:"EOF",14:"EXPLAIN",15:"QUERY",16:"PLAN",53:"EndTransaction",72:"WITH",74:"COMMA",76:"AS",77:"LPAR",78:"RPAR",89:"SEARCH",93:"PIVOT",95:"FOR",98:"UNPIVOT",99:"IN",107:"REMOVE",112:"LIKE",115:"ARROW",116:"DOT",118:"ORDER",119:"BY",122:"DOTDOT",123:"CARET",124:"EQ",128:"WHERE",129:"OF",130:"CLASS",131:"NUMBER",132:"STRING",133:"SLASH",134:"VERTEX",135:"EDGE",136:"EXCLAMATION",137:"SHARP",138:"MODULO",139:"GT",140:"LT",141:"GTGT",142:"LTLT",143:"DOLLAR",145:"AT",146:"SET",148:"TO",149:"VALUE",150:"ROW",152:"COLON",154:"NOT",156:"IF",162:"UNION",164:"ALL",166:"ANY",168:"INTERSECT",169:"EXCEPT",170:"AND",171:"OR",172:"PATH",173:"RETURN",175:"REPEAT",179:"PLUS",180:"STAR",181:"QUESTION",183:"FROM",185:"DISTINCT",187:"UNIQUE",189:"SELECT",190:"COLUMN",191:"MATRIX",192:"TEXTSTRING",193:"INDEX",194:"RECORDSET",195:"TOP",198:"INTO",206:"CROSS",207:"APPLY",208:"OUTER",212:"INDEXED",213:"INSERTED",222:"NATURAL",223:"JOIN",224:"INNER",225:"LEFT",226:"RIGHT",227:"FULL",228:"SEMI",229:"ANTI",230:"ON",231:"USING",232:"GROUP",236:"GROUPING",237:"ROLLUP",238:"CUBE",239:"HAVING",240:"CORRESPONDING",242:"DIRECTION",243:"COLLATE",244:"NOCASE",245:"LIMIT",247:"OFFSET",249:"FETCH",265:"CURRENT_TIMESTAMP",266:"JAVASCRIPT",267:"CREATE",268:"FUNCTION",269:"AGGREGATE",270:"NEW",271:"CAST",273:"CONVERT",276:"OVER",279:"PARTITION",280:"SUM",281:"COUNT",282:"MIN",283:"MAX",284:"AVG",285:"FIRST",286:"LAST",287:"AGGR",288:"ARRAY",290:"REPLACE",291:"DATEADD",292:"DATEDIFF",293:"INTERVAL",294:"TRUE",295:"FALSE",296:"NSTRING",297:"NULL",298:"EXISTS",299:"ARRAYLBRA",300:"RBRA",302:"BRAQUESTION",303:"CASE",306:"END",308:"WHEN",309:"THEN",310:"ELSE",311:"REGEXP",312:"TILDA",313:"GLOB",314:"ESCAPE",315:"NOT_LIKE",316:"BARBAR",317:"MINUS",318:"AMPERSAND",319:"BAR",320:"GE",321:"LE",322:"EQEQ",323:"EQEQEQ",324:"NE",325:"NEEQEQ",326:"NEEQEQEQ",330:"BETWEEN",331:"NOT_BETWEEN",332:"IS",333:"DOUBLECOLON",334:"SOME",335:"UPDATE",338:"DELETE",339:"INSERT",343:"DEFAULT",344:"VALUES",347:"DateValue",353:"TABLE",356:"IDENTITY",357:"TEMP",367:"CONSTRAINT",368:"CHECK",369:"PRIMARY",370:"KEY",373:"FOREIGN",374:"REFERENCES",380:"NO",381:"ACTION",386:"ColumnConstraints",389:"ENUM",390:"MAXNUM",396:"DROP",400:"ALTER",401:"RENAME",402:"ADD",403:"MODIFY",404:"ATTACH",405:"DATABASE",406:"DETACH",408:"USE",409:"SHOW",410:"VIEW",414:"READ",415:"ONLY",416:"OPTION",417:"SOURCE",418:"ASSERT",420:"ATLBRA",424:"LCUR",426:"RCUR",433:"OFF",434:"COMMIT",435:"TRANSACTION",436:"ROLLBACK",437:"BEGIN",439:"WHILE",440:"CONTINUE",441:"BREAK",442:"PRINT",443:"REQUIRE",447:"ECHO",448:"DECLARE",451:"TRUNCATE",452:"MERGE",460:"MATCHED",463:"TARGET",464:"OUTPUT",470:"CONTENT",472:"GRAPH",505:"COLONDASH",507:"QUESTIONDASH",508:"CALL",509:"TRIGGER",514:"BEFORE",515:"AFTER",516:"INSTEAD",517:"REINDEX",518:"A",519:"ABSENT",520:"ABSOLUTE",521:"ACCORDING",522:"ADA",523:"ADMIN",524:"ALWAYS",525:"ASC",526:"ASSERTION",527:"ASSIGNMENT",528:"ATTRIBUTE",529:"ATTRIBUTES",530:"BASE64",531:"BERNOULLI",532:"BLOCKED",533:"BOM",534:"BREADTH",535:"C",536:"CASCADE",537:"CATALOG",538:"CATALOG_NAME",539:"CHAIN",540:"CHARACTERISTICS",541:"CHARACTERS",542:"CHARACTER_SET_CATALOG",543:"CHARACTER_SET_NAME",544:"CHARACTER_SET_SCHEMA",545:"CLASS_ORIGIN",546:"COBOL",547:"COLLATION",548:"COLLATION_CATALOG",549:"COLLATION_NAME",550:"COLLATION_SCHEMA",551:"COLUMNS",552:"COLUMN_NAME", 553:"COMMAND_FUNCTION",554:"COMMAND_FUNCTION_CODE",555:"COMMITTED",556:"CONDITION_NUMBER",557:"CONNECTION",558:"CONNECTION_NAME",559:"CONSTRAINTS",560:"CONSTRAINT_CATALOG",561:"CONSTRAINT_NAME",562:"CONSTRAINT_SCHEMA",563:"CONSTRUCTOR",564:"CONTROL",565:"CURSOR_NAME",566:"DATA",567:"DATETIME_INTERVAL_CODE",568:"DATETIME_INTERVAL_PRECISION",569:"DB",570:"DEFAULTS",571:"DEFERRABLE",572:"DEFERRED",573:"DEFINED",574:"DEFINER",575:"DEGREE",576:"DEPTH",577:"DERIVED",578:"DESC",579:"DESCRIPTOR",580:"DIAGNOSTICS",581:"DISPATCH",582:"DOCUMENT",583:"DOMAIN",584:"DYNAMIC_FUNCTION",585:"DYNAMIC_FUNCTION_CODE",586:"EMPTY",587:"ENCODING",588:"ENFORCED",589:"EXCLUDE",590:"EXCLUDING",591:"EXPRESSION",592:"FILE",593:"FINAL",594:"FLAG",595:"FOLLOWING",596:"FORTRAN",597:"FOUND",598:"FS",599:"G",600:"GENERAL",601:"GENERATED",602:"GO",603:"GOTO",604:"GRANTED",605:"HEX",606:"HIERARCHY",607:"ID",608:"IGNORE",609:"IMMEDIATE",610:"IMMEDIATELY",611:"IMPLEMENTATION",612:"INCLUDING",613:"INCREMENT",614:"INDENT",615:"INITIALLY",616:"INPUT",617:"INSTANCE",618:"INSTANTIABLE",619:"INTEGRITY",620:"INVOKER",621:"ISOLATION",622:"K",623:"KEY_MEMBER",624:"KEY_TYPE",625:"LENGTH",626:"LEVEL",627:"LIBRARY",628:"LINK",629:"LOCATION",630:"LOCATOR",631:"M",632:"MAP",633:"MAPPING",634:"MAXVALUE",635:"MESSAGE_LENGTH",636:"MESSAGE_OCTET_LENGTH",637:"MESSAGE_TEXT",638:"MINVALUE",639:"MORE",640:"MUMPS",641:"NAME",642:"NAMES",643:"NAMESPACE",644:"NESTING",645:"NEXT",646:"NFC",647:"NFD",648:"NFKC",649:"NFKD",650:"NIL",651:"NORMALIZED",652:"NULLABLE",653:"NULLS",654:"OBJECT",655:"OCTETS",656:"OPTIONS",657:"ORDERING",658:"ORDINALITY",659:"OTHERS",660:"OVERRIDING",661:"P",662:"PAD",663:"PARAMETER_MODE",664:"PARAMETER_NAME",665:"PARAMETER_ORDINAL_POSITION",666:"PARAMETER_SPECIFIC_CATALOG",667:"PARAMETER_SPECIFIC_NAME",668:"PARAMETER_SPECIFIC_SCHEMA",669:"PARTIAL",670:"PASCAL",671:"PASSING",672:"PASSTHROUGH",673:"PERMISSION",674:"PLACING",675:"PLI",676:"PRECEDING",677:"PRESERVE",678:"PRIOR",679:"PRIVILEGES",680:"PUBLIC",681:"RECOVERY",682:"RELATIVE",683:"REPEATABLE",684:"REQUIRING",685:"RESPECT",686:"RESTART",687:"RESTORE",688:"RESTRICT",689:"RETURNED_CARDINALITY",690:"RETURNED_LENGTH",691:"RETURNED_OCTET_LENGTH",692:"RETURNED_SQLSTATE",693:"RETURNING",694:"ROLE",695:"ROUTINE",696:"ROUTINE_CATALOG",697:"ROUTINE_NAME",698:"ROUTINE_SCHEMA",699:"ROW_COUNT",700:"SCALE",701:"SCHEMA",702:"SCHEMA_NAME",703:"SCOPE_CATALOG",704:"SCOPE_NAME",705:"SCOPE_SCHEMA",706:"SECTION",707:"SECURITY",708:"SELECTIVE",709:"SELF",710:"SEQUENCE",711:"SERIALIZABLE",712:"SERVER",713:"SERVER_NAME",714:"SESSION",715:"SETS",716:"SIMPLE",717:"SIZE",718:"SPACE",719:"SPECIFIC_NAME",720:"STANDALONE",721:"STATE",722:"STATEMENT",723:"STRIP",724:"STRUCTURE",725:"STYLE",726:"SUBCLASS_ORIGIN",727:"T",728:"TABLE_NAME",729:"TEMPORARY",730:"TIES",731:"TOKEN",732:"TOP_LEVEL_COUNT",733:"TRANSACTIONS_COMMITTED",734:"TRANSACTIONS_ROLLED_BACK",735:"TRANSACTION_ACTIVE",736:"TRANSFORM",737:"TRANSFORMS",738:"TRIGGER_CATALOG",739:"TRIGGER_NAME",740:"TRIGGER_SCHEMA",741:"TYPE",742:"UNBOUNDED",743:"UNCOMMITTED",744:"UNDER",745:"UNLINK",746:"UNNAMED",747:"UNTYPED",748:"URI",749:"USAGE",750:"USER_DEFINED_TYPE_CATALOG",751:"USER_DEFINED_TYPE_CODE",752:"USER_DEFINED_TYPE_NAME",753:"USER_DEFINED_TYPE_SCHEMA",754:"VALID",755:"VERSION",756:"WHITESPACE",757:"WORK",758:"WRAPPER",759:"WRITE",760:"XMLDECLARATION",761:"XMLSCHEMA",762:"YES",763:"ZONE",764:"SEMICOLON",765:"PERCENT",766:"ROWS"},productions_:[0,[3,1],[3,1],[3,2],[7,1],[7,2],[8,2],[9,3],[9,1],[9,1],[13,2],[13,4],[12,1],[17,0],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[47,3],[73,3],[73,1],[75,5],[40,10],[40,4],[92,8],[92,11],[102,4],[104,2],[104,1],[103,3],[103,1],[105,1],[105,3],[106,3],[109,3],[109,1],[110,1],[110,2],[114,1],[114,1],[117,1],[117,5],[117,5],[117,1],[117,2],[117,1],[117,2],[117,2],[117,3],[117,4],[117,4],[117,4],[117,4],[117,4],[117,1],[117,1],[117,1],[117,1],[117,1],[117,1],[117,2],[117,2],[117,2],[117,1],[117,1],[117,1],[117,1],[117,1],[117,1],[117,2],[117,3],[117,4],[117,3],[117,1],[117,4],[117,2],[117,2],[117,4],[117,4],[117,4],[117,4],[117,4],[117,5],[117,4],[117,4],[117,4],[117,4],[117,4],[117,4],[117,4],[117,4],[117,6],[163,3],[163,1],[153,1],[153,1],[153,1],[182,2],[79,4],[79,4],[79,4],[79,3],[184,1],[184,2],[184,2],[184,2],[184,2],[184,2],[184,2],[184,2],[186,3],[186,4],[186,0],[81,0],[81,2],[81,2],[81,2],[81,2],[81,2],[82,2],[82,3],[82,5],[82,0],[205,6],[205,7],[205,6],[205,7],[203,1],[203,3],[209,4],[209,5],[209,3],[209,3],[209,2],[209,3],[209,1],[209,3],[209,2],[209,3],[209,1],[209,1],[209,2],[209,3],[209,1],[209,1],[209,2],[209,3],[209,1],[209,2],[209,3],[214,1],[199,3],[199,1],[204,2],[204,2],[204,1],[204,1],[215,3],[217,1],[217,2],[217,3],[217,3],[217,2],[217,3],[217,4],[217,5],[217,1],[217,2],[217,3],[217,1],[217,2],[217,3],[216,1],[216,2],[221,1],[221,2],[221,2],[221,3],[221,2],[221,3],[221,2],[221,3],[221,2],[221,2],[221,2],[218,2],[218,2],[218,0],[84,0],[84,2],[85,0],[85,4],[233,1],[233,3],[235,5],[235,4],[235,4],[235,1],[234,0],[234,2],[88,0],[88,2],[88,3],[88,2],[88,2],[88,3],[88,4],[88,3],[88,3],[86,0],[86,3],[120,1],[120,3],[241,1],[241,2],[241,3],[241,4],[87,0],[87,3],[87,8],[246,0],[246,2],[174,3],[174,1],[253,3],[253,2],[253,3],[253,2],[253,3],[253,2],[253,1],[254,5],[254,3],[254,1],[111,5],[111,3],[111,3],[111,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,3],[94,3],[94,3],[94,1],[94,1],[56,1],[70,5],[71,5],[263,2],[263,2],[261,6],[261,8],[261,6],[261,8],[274,1],[274,1],[274,1],[274,1],[274,1],[274,1],[274,1],[255,5],[255,6],[255,6],[275,0],[275,4],[275,4],[275,5],[277,3],[278,3],[158,1],[158,1],[158,1],[158,1],[158,1],[158,1],[158,1],[158,1],[158,1],[200,5],[200,3],[200,4],[200,4],[200,8],[200,8],[200,8],[200,8],[200,3],[151,1],[151,3],[196,1],[257,1],[257,1],[113,1],[113,1],[258,1],[202,2],[259,4],[262,3],[201,2],[201,2],[201,1],[201,1],[260,5],[260,4],[304,2],[304,1],[307,4],[305,2],[305,0],[256,3],[256,3],[256,3],[256,3],[256,5],[256,3],[256,5],[256,3],[256,3],[256,3],[256,3],[256,3],[256,3],[256,3],[256,3],[256,3],[256,3],[256,3],[256,3],[256,3],[256,5],[256,3],[256,3],[256,3],[256,5],[256,3],[256,3],[256,3],[256,3],[256,3],[256,3],[256,3],[256,3],[256,3],[256,3],[256,3],[256,6],[256,6],[256,3],[256,3],[256,2],[256,2],[256,2],[256,2],[256,2],[256,3],[256,5],[256,6],[256,5],[256,6],[256,4],[256,5],[256,3],[256,4],[256,3],[256,4],[256,3],[256,3],[256,3],[256,3],[256,3],[329,1],[329,1],[329,4],[327,1],[327,1],[327,1],[327,1],[327,1],[327,1],[328,1],[328,1],[328,1],[55,6],[55,4],[147,1],[147,3],[336,3],[336,4],[29,5],[29,3],[36,5],[36,4],[36,7],[36,6],[36,5],[36,4],[36,5],[36,8],[36,7],[36,4],[36,6],[36,7],[341,1],[341,1],[340,0],[340,1],[342,3],[342,1],[342,1],[342,5],[342,3],[342,3],[345,1],[345,3],[346,1],[346,1],[346,1],[346,1],[346,1],[346,1],[100,1],[100,3],[24,9],[24,5],[349,1],[349,1],[352,0],[352,1],[354,2],[354,1],[355,1],[355,3],[355,3],[355,3],[348,0],[348,1],[350,0],[350,3],[351,3],[351,1],[351,2],[359,1],[359,3],[360,2],[360,2],[360,2],[360,2],[360,2],[361,0],[361,2],[366,4],[362,6],[363,9],[377,3],[376,0],[376,2],[378,4],[379,4],[364,6],[365,5],[365,5],[372,1],[372,1],[372,3],[372,3],[358,1],[358,3],[384,3],[384,2],[384,1],[387,6],[387,4],[387,1],[387,4],[272,2],[272,1],[388,1],[388,1],[385,0],[385,1],[391,2],[391,1],[393,3],[392,2],[392,5],[392,3],[392,6],[392,1],[392,2],[392,4],[392,2],[392,1],[392,2],[392,1],[392,1],[392,3],[392,5],[33,4],[399,3],[399,1],[398,0],[398,2],[18,6],[18,6],[18,6],[18,8],[18,6],[39,5],[19,4],[19,7],[19,6],[19,9],[30,3],[21,4],[21,6],[21,9],[21,6],[407,0],[407,2],[54,3],[54,2],[31,4],[31,5],[31,5],[22,8],[22,9],[32,3],[43,2],[43,4],[43,3],[43,5],[45,2],[45,4],[45,4],[45,6],[42,4],[42,6],[44,4],[44,6],[41,4],[41,6],[25,11],[25,8],[413,3],[413,3],[413,5],[34,4],[66,2],[57,2],[58,2],[58,2],[58,4],[144,4],[144,2],[144,2],[144,2],[144,2],[144,1],[144,2],[144,2],[422,1],[422,1],[423,1],[423,1],[423,1],[423,1],[423,1],[423,1],[423,1],[423,3],[419,3],[419,4],[419,2],[421,2],[421,3],[421,1],[425,3],[425,1],[428,3],[428,3],[428,3],[427,3],[427,1],[65,4],[65,3],[65,4],[65,5],[65,5],[65,6],[431,1],[431,1],[430,3],[430,2],[432,1],[432,1],[432,3],[429,1],[429,1],[51,2],[52,2],[50,2],[35,4],[35,3],[438,2],[59,3],[60,1],[61,1],[62,3],[63,2],[63,2],[64,2],[64,2],[446,1],[446,1],[69,2],[444,3],[444,1],[445,3],[445,1],[28,2],[449,1],[449,3],[450,3],[450,4],[450,5],[450,6],[46,3],[37,6],[453,1],[453,2],[454,2],[455,2],[456,2],[456,2],[456,1],[456,1],[458,4],[458,6],[461,1],[461,3],[459,5],[459,7],[459,7],[459,9],[459,7],[459,9],[462,3],[462,6],[462,3],[462,6],[457,0],[457,2],[457,5],[457,4],[457,7],[27,6],[469,2],[468,0],[468,2],[468,2],[468,1],[26,8],[23,3],[23,4],[473,3],[473,1],[474,3],[474,7],[474,6],[474,3],[474,4],[478,1],[478,1],[482,2],[483,3],[484,2],[485,4],[475,4],[475,3],[475,2],[475,1],[497,2],[493,2],[493,2],[498,4],[500,6],[67,3],[67,2],[506,3],[506,1],[504,1],[504,4],[68,2],[20,2],[48,9],[48,8],[48,9],[510,0],[510,1],[510,1],[510,1],[510,2],[511,1],[511,1],[511,1],[49,3],[38,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[11,1],[11,1],[80,0],[80,1],[83,0],[83,1],[90,0],[90,2],[91,0],[91,1],[96,0],[96,1],[97,0],[97,1],[101,0],[101,1],[108,0],[108,1],[121,0],[121,1],[125,1],[125,2],[126,1],[126,2],[127,0],[127,1],[155,0],[155,2],[157,0],[157,2],[159,0],[159,2],[160,1],[160,1],[161,0],[161,2],[165,0],[165,2],[167,0],[167,2],[176,0],[176,2],[177,0],[177,2],[178,0],[178,2],[188,0],[188,1],[197,0],[197,1],[210,0],[210,1],[211,0],[211,1],[219,0],[219,1],[220,0],[220,1],[248,0],[248,1],[250,0],[250,1],[251,0],[251,1],[252,0],[252,1],[264,1],[264,1],[767,1],[767,1],[289,0],[289,1],[301,1],[301,1],[337,1],[337,1],[371,0],[371,1],[375,0],[375,1],[382,0],[382,1],[383,0],[383,1],[394,0],[394,1],[395,0],[395,1],[397,1],[397,1],[411,0],[411,1],[412,0],[412,1],[465,0],[465,1],[466,0],[466,1],[467,0],[467,1],[471,0],[471,1],[476,0],[476,1],[477,0],[477,1],[479,0],[479,1],[480,0],[480,1],[481,0],[481,1],[486,0],[486,1],[487,0],[487,1],[488,0],[488,1],[489,0],[489,1],[490,0],[490,1],[491,0],[491,1],[492,0],[492,1],[494,0],[494,1],[495,0],[495,1],[496,0],[496,1],[499,0],[499,2],[501,0],[501,2],[502,0],[502,2],[503,0],[503,2],[512,0],[512,1],[513,0],[513,1]],performAction:function(e,t,r,n,a,s,i){var o=s.length-1;switch(a){case 1:n.casesensitive?this.$=s[o]:this.$=s[o].toLowerCase();break;case 2:this.$=w(s[o].substr(1,s[o].length-2));break;case 3:this.$=s[o].toLowerCase();break;case 4:this.$=s[o];break;case 5:this.$=s[o]?s[o-1]+" "+s[o]:s[o-1];break;case 6:return new n.Statements({statements:s[o-1]});case 7:this.$=s[o-2],s[o]&&s[o-2].push(s[o]);break;case 8:case 9:case 70:case 80:case 85:case 143:case 177:case 205:case 206:case 242:case 261:case 273:case 354:case 372:case 451:case 474:case 475:case 479:case 487:case 528:case 529:case 566:case 649:case 659:case 683:case 685:case 687:case 701:case 702:case 732:case 756:this.$=[s[o]];break;case 10:this.$=s[o],s[o].explain=!0;break;case 11:this.$=s[o],s[o].explain=!0;break;case 12:this.$=s[o],n.exists&&(this.$.exists=n.exists),delete n.exists,n.queries&&(this.$.queries=n.queries),delete n.queries;break;case 13:case 162:case 172:case 237:case 238:case 240:case 248:case 250:case 259:case 267:case 270:case 375:case 491:case 501:case 503:case 515:case 521:case 522:case 567:this.$=void 0;break;case 68:this.$=new n.WithSelect({withs:s[o-1],select:s[o]});break;case 69:case 565:s[o-2].push(s[o]),this.$=s[o-2];break;case 71:this.$={name:s[o-4],select:s[o-1]};break;case 72:n.extend(this.$,s[o-9]),n.extend(this.$,s[o-8]),n.extend(this.$,s[o-7]),n.extend(this.$,s[o-6]),n.extend(this.$,s[o-5]),n.extend(this.$,s[o-4]),n.extend(this.$,s[o-3]),n.extend(this.$,s[o-2]),n.extend(this.$,s[o-1]),n.extend(this.$,s[o]),this.$=s[o-9];break;case 73:this.$=new n.Search({selectors:s[o-2],from:s[o]}),n.extend(this.$,s[o-1]);break;case 74:this.$={pivot:{expr:s[o-5],columnid:s[o-3],inlist:s[o-2],as:s[o]}};break;case 75:this.$={unpivot:{tocolumnid:s[o-8],forcolumnid:s[o-6],inlist:s[o-3],as:s[o]}};break;case 76:case 520:case 549:case 585:case 619:case 636:case 637:case 640:case 662:this.$=s[o-1];break;case 77:case 78:case 86:case 147:case 185:case 247:case 280:case 288:case 289:case 290:case 291:case 292:case 293:case 294:case 295:case 296:case 297:case 298:case 299:case 300:case 301:case 304:case 305:case 320:case 321:case 322:case 323:case 324:case 325:case 374:case 440:case 441:case 442:case 443:case 444:case 445:case 516:case 542:case 546:case 548:case 623:case 624:case 625:case 626:case 627:case 628:case 632:case 634:case 635:case 644:case 660:case 661:case 723:case 738:case 739:case 741:case 742:case 748:case 749:this.$=s[o];break;case 79:case 84:case 731:case 755:this.$=s[o-2],this.$.push(s[o]);break;case 81:this.$={expr:s[o]};break;case 82:this.$={expr:s[o-2],as:s[o]};break;case 83:this.$={removecolumns:s[o]};break;case 87:this.$={like:s[o]};break;case 90:case 104:this.$={srchid:"PROP",args:[s[o]]};break;case 91:this.$={srchid:"ORDERBY",args:s[o-1]};break;case 92:var u=s[o-1];u||(u="ASC"),this.$={srchid:"ORDERBY",args:[{expression:new n.Column({columnid:"_"}),direction:u}]};break;case 93:this.$={srchid:"PARENT"};break;case 94:this.$={srchid:"APROP",args:[s[o]]};break;case 95:this.$={selid:"ROOT"};break;case 96:this.$={srchid:"EQ",args:[s[o]]};break;case 97:this.$={srchid:"LIKE",args:[s[o]]};break;case 98:case 99:this.$={selid:"WITH",args:s[o-1]};break;case 100:this.$={srchid:s[o-3].toUpperCase(),args:s[o-1]};break;case 101:this.$={srchid:"WHERE",args:[s[o-1]]};break;case 102:this.$={selid:"OF",args:[s[o-1]]};break;case 103:this.$={srchid:"CLASS",args:[s[o-1]]};break;case 105:this.$={srchid:"NAME",args:[s[o].substr(1,s[o].length-2)]};break;case 106:this.$={srchid:"CHILD"};break;case 107:this.$={srchid:"VERTEX"};break;case 108:this.$={srchid:"EDGE"};break;case 109:this.$={srchid:"REF"};break;case 110:this.$={srchid:"SHARP",args:[s[o]]};break;case 111:this.$={srchid:"ATTR",args:void 0===s[o]?void 0:[s[o]]};break;case 112:this.$={srchid:"ATTR"};break;case 113:this.$={srchid:"OUT"};break;case 114:this.$={srchid:"IN"};break;case 115:this.$={srchid:"OUTOUT"};break;case 116:this.$={srchid:"ININ"};break;case 117:this.$={srchid:"CONTENT"};break;case 118:this.$={srchid:"EX",args:[new n.Json({value:s[o]})]};break;case 119:this.$={srchid:"AT",args:[s[o]]};break;case 120:this.$={srchid:"AS",args:[s[o]]};break;case 121:this.$={srchid:"SET",args:s[o-1]};break;case 122:this.$={selid:"TO",args:[s[o]]};break;case 123:this.$={srchid:"VALUE"};break;case 124:this.$={srchid:"ROW",args:s[o-1]};break;case 125:this.$={srchid:"CLASS",args:[s[o]]};break;case 126:this.$={selid:s[o],args:[s[o-1]]};break;case 127:this.$={selid:"NOT",args:s[o-1]};break;case 128:this.$={selid:"IF",args:s[o-1]};break;case 129:this.$={selid:s[o-3],args:s[o-1]};break;case 130:this.$={selid:"DISTINCT",args:s[o-1]};break;case 131:this.$={selid:"UNION",args:s[o-1]};break;case 132:this.$={selid:"UNIONALL",args:s[o-1]};break;case 133:this.$={selid:"ALL",args:[s[o-1]]};break;case 134:this.$={selid:"ANY",args:[s[o-1]]};break;case 135:this.$={selid:"INTERSECT",args:s[o-1]};break;case 136:this.$={selid:"EXCEPT",args:s[o-1]};break;case 137:this.$={selid:"AND",args:s[o-1]};break;case 138:this.$={selid:"OR",args:s[o-1]};break;case 139:this.$={selid:"PATH",args:[s[o-1]]};break;case 140:this.$={srchid:"RETURN",args:s[o-1]};break;case 141:this.$={selid:"REPEAT",sels:s[o-3],args:s[o-1]};break;case 142:this.$=s[o-2],this.$.push(s[o]);break;case 144:this.$="PLUS";break;case 145:this.$="STAR";break;case 146:this.$="QUESTION";break;case 148:this.$=new n.Select({columns:s[o],distinct:!0}),n.extend(this.$,s[o-3]),n.extend(this.$,s[o-1]);break;case 149:this.$=new n.Select({columns:s[o],distinct:!0}),n.extend(this.$,s[o-3]),n.extend(this.$,s[o-1]);break;case 150:this.$=new n.Select({columns:s[o],all:!0}),n.extend(this.$,s[o-3]),n.extend(this.$,s[o-1]);break;case 151:s[o]?(this.$=new n.Select({columns:s[o]}),n.extend(this.$,s[o-2]),n.extend(this.$,s[o-1])):this.$=new n.Select({columns:[new n.Column({columnid:"_"})],modifier:"COLUMN"});break;case 152:"SELECT"==s[o]?this.$=void 0:this.$={modifier:s[o]};break;case 153:this.$={modifier:"VALUE"};break;case 154:this.$={modifier:"ROW"};break;case 155:this.$={modifier:"COLUMN"};break;case 156:this.$={modifier:"MATRIX"};break;case 157:this.$={modifier:"TEXTSTRING"};break;case 158:this.$={modifier:"INDEX"};break;case 159:this.$={modifier:"RECORDSET"};break;case 160:this.$={top:s[o-1],percent:void 0!==s[o]||void 0};break;case 161:this.$={top:s[o-1]};break;case 163:case 330:case 523:case 524:case 724:this.$=void 0;break;case 164:case 165:case 166:case 167:this.$={into:s[o]};break;case 168:var c=s[o];c=c.substr(1,c.length-2);var l=c.substr(-3).toUpperCase(),h=c.substr(-4).toUpperCase();"#"==c[0]?this.$={into:new n.FuncValue({funcid:"HTML",args:[new n.StringValue({value:c}),new n.Json({value:{headers:!0}})]})}:"XLS"==l||"CSV"==l||"TAB"==l?this.$={into:new n.FuncValue({funcid:l,args:[new n.StringValue({value:c}),new n.Json({value:{headers:!0}})]})}:"XLSX"!=h&&"JSON"!=h||(this.$={into:new n.FuncValue({funcid:h,args:[new n.StringValue({value:c}),new n.Json({value:{headers:!0}})]})});break;case 169:this.$={from:s[o]};break;case 170:this.$={from:s[o-1],joins:s[o]};break;case 171:this.$={from:s[o-2],joins:s[o-1]};break;case 173:this.$=new n.Apply({select:s[o-2],applymode:"CROSS",as:s[o]});break;case 174:this.$=new n.Apply({select:s[o-3],applymode:"CROSS",as:s[o]});break;case 175:this.$=new n.Apply({select:s[o-2],applymode:"OUTER",as:s[o]});break;case 176:this.$=new n.Apply({select:s[o-3],applymode:"OUTER",as:s[o]});break;case 178:case 243:case 452:case 530:case 531:this.$=s[o-2],s[o-2].push(s[o]);break;case 179:this.$=s[o-2],this.$.as=s[o];break;case 180:this.$=s[o-3],this.$.as=s[o];break;case 181:this.$=s[o-1],this.$.as="default";break;case 182:this.$=new n.Json({value:s[o-2]}),s[o-2].as=s[o];break;case 183:this.$=s[o-1],s[o-1].as=s[o];break;case 184:this.$=s[o-2],s[o-2].as=s[o];break;case 186:case 638:case 641:this.$=s[o-2];break;case 187:case 191:case 195:case 198:this.$=s[o-1],s[o-1].as=s[o];break;case 188:case 192:case 196:case 199:this.$=s[o-2],s[o-2].as=s[o];break;case 189:case 190:case 194:case 197:this.$=s[o],s[o].as="default";break;case 193:this.$={inserted:!0},s[o].as="default";break;case 200:var c=s[o];c=c.substr(1,c.length-2);var d,l=c.substr(-3).toUpperCase(),h=c.substr(-4).toUpperCase();if("#"==c[0])d=new n.FuncValue({funcid:"HTML",args:[new n.StringValue({value:c}),new n.Json({value:{headers:!0}})]});else if("XLS"==l||"CSV"==l||"TAB"==l)d=new n.FuncValue({funcid:l,args:[new n.StringValue({value:c}),new n.Json({value:{headers:!0}})]});else{if("XLSX"!=h&&"JSON"!=h)throw new Error("Unknown string in FROM clause");d=new n.FuncValue({funcid:h,args:[new n.StringValue({value:c}),new n.Json({value:{headers:!0}})]})}this.$=d;break;case 201:"INFORMATION_SCHEMA"==s[o-2]?this.$=new n.FuncValue({funcid:s[o-2],args:[new n.StringValue({value:s[o]})]}):this.$=new n.Table({databaseid:s[o-2],tableid:s[o]});break;case 202:this.$=new n.Table({tableid:s[o]});break;case 203:case 204:this.$=s[o-1],s[o-1].push(s[o]);break;case 207:this.$=new n.Join(s[o-2]),n.extend(this.$,s[o-1]),n.extend(this.$,s[o]);break;case 208:this.$={table:s[o]};break;case 209:this.$={table:s[o-1],as:s[o]};break;case 210:this.$={table:s[o-2],as:s[o]};break;case 211:this.$={json:new n.Json({value:s[o-2],as:s[o]})};break;case 212:this.$={param:s[o-1],as:s[o]};break;case 213:this.$={param:s[o-2],as:s[o]};break;case 214:this.$={select:s[o-2],as:s[o]};break;case 215:this.$={select:s[o-3],as:s[o]};break;case 216:this.$={funcid:s[o],as:"default"};break;case 217:this.$={funcid:s[o-1],as:s[o]};break;case 218:this.$={funcid:s[o-2],as:s[o]};break;case 219:this.$={variable:s[o],as:"default"};break;case 220:this.$={variable:s[o-1],as:s[o]};break;case 221:this.$={variable:s[o-2],as:s[o]};break;case 222:this.$={joinmode:s[o]};break;case 223:this.$={joinmode:s[o-1],natural:!0};break;case 224:case 225:this.$="INNER";break;case 226:case 227:this.$="LEFT";break;case 228:case 229:this.$="RIGHT";break;case 230:case 231:this.$="OUTER";break;case 232:this.$="SEMI";break;case 233:this.$="ANTI";break;case 234:this.$="CROSS";break;case 235:this.$={on:s[o]};break;case 236:case 697:this.$={using:s[o]};break;case 239:this.$={where:new n.Expression({expression:s[o]})};break;case 241:this.$={group:s[o-1]},n.extend(this.$,s[o]);break;case 244:this.$=new n.GroupExpression({type:"GROUPING SETS",group:s[o-1]});break;case 245:this.$=new n.GroupExpression({type:"ROLLUP",group:s[o-1]});break;case 246:this.$=new n.GroupExpression({type:"CUBE",group:s[o-1]});break;case 249:this.$={having:s[o]};break;case 251:this.$={union:s[o]};break;case 252:this.$={unionall:s[o]};break;case 253:this.$={except:s[o]};break;case 254:this.$={intersect:s[o]};break;case 255:this.$={union:s[o],corresponding:!0};break;case 256:this.$={unionall:s[o],corresponding:!0};break;case 257:this.$={except:s[o],corresponding:!0};break;case 258:this.$={intersect:s[o],corresponding:!0};break;case 260:this.$={order:s[o]};break;case 262:this.$=s[o-2],s[o-2].push(s[o]);break;case 263:this.$=new n.Expression({expression:s[o],direction:"ASC"});break;case 264:this.$=new n.Expression({expression:s[o-1],direction:s[o].toUpperCase()});break;case 265:this.$=new n.Expression({expression:s[o-2],direction:"ASC",nocase:!0});break;case 266:this.$=new n.Expression({expression:s[o-3],direction:s[o].toUpperCase(),nocase:!0});break;case 268:this.$={limit:s[o-1]},n.extend(this.$,s[o]);break;case 269:this.$={limit:s[o-2],offset:s[o-6]};break;case 271:this.$={offset:s[o]};break;case 272:case 509:case 533:case 648:case 658:case 682:case 684:case 688:s[o-2].push(s[o]),this.$=s[o-2];break;case 274:case 276:case 278:s[o-2].as=s[o],this.$=s[o-2];break;case 275:case 277:case 279:s[o-1].as=s[o],this.$=s[o-1];break;case 281:this.$=new n.Column({columid:s[o],tableid:s[o-2],databaseid:s[o-4]});break;case 282:this.$=new n.Column({columnid:s[o],tableid:s[o-2]});break;case 283:this.$=new n.Column({columnid:s[o]});break;case 284:this.$=new n.Column({columnid:s[o],tableid:s[o-2],databaseid:s[o-4]});break;case 285:case 286:this.$=new n.Column({columnid:s[o],tableid:s[o-2]});break;case 287:this.$=new n.Column({columnid:s[o]});break;case 302:this.$=new n.DomainValueValue;break;case 303:this.$=new n.Json({value:s[o]});break;case 306:case 307:case 308:n.queries||(n.queries=[]),n.queries.push(s[o-1]),s[o-1].queriesidx=n.queries.length,this.$=s[o-1];break;case 309:this.$=s[o];break;case 310:this.$=new n.FuncValue({funcid:"CURRENT_TIMESTAMP"});break;case 311:this.$=new n.JavaScript({value:s[o].substr(2,s[o].length-4)});break;case 312:this.$=new n.JavaScript({value:'alasql.fn["'+s[o-2]+'"] = '+s[o].substr(2,s[o].length-4)});break;case 313:this.$=new n.JavaScript({value:'alasql.aggr["'+s[o-2]+'"] = '+s[o].substr(2,s[o].length-4)});break;case 314:this.$=new n.FuncValue({funcid:s[o],newid:!0});break;case 315:this.$=s[o],n.extend(this.$,{newid:!0});break;case 316:this.$=new n.Convert({expression:s[o-3]}),n.extend(this.$,s[o-1]);break;case 317:this.$=new n.Convert({expression:s[o-5],style:s[o-1]}),n.extend(this.$,s[o-3]);break;case 318:this.$=new n.Convert({expression:s[o-1]}),n.extend(this.$,s[o-3]);break;case 319:this.$=new n.Convert({expression:s[o-3],style:s[o-1]}),n.extend(this.$,s[o-5]);break;case 326:this.$=new n.FuncValue({funcid:"CURRENT_TIMESTAMP"});break;case 327:s[o-2].length>1&&("MAX"==s[o-4].toUpperCase()||"MIN"==s[o-4].toUpperCase())?this.$=new n.FuncValue({funcid:s[o-4],args:s[o-2]}):this.$=new n.AggrValue({aggregatorid:s[o-4].toUpperCase(),expression:s[o-2].pop(),over:s[o]});break;case 328:this.$=new n.AggrValue({aggregatorid:s[o-5].toUpperCase(),expression:s[o-2],distinct:!0,over:s[o]});break;case 329:this.$=new n.AggrValue({aggregatorid:s[o-5].toUpperCase(),expression:s[o-2],over:s[o]});break;case 331:case 332:this.$=new n.Over,n.extend(this.$,s[o-1]);break;case 333:this.$=new n.Over,n.extend(this.$,s[o-2]),n.extend(this.$,s[o-1]);break;case 334:this.$={partition:s[o]};break;case 335:this.$={order:s[o]};break;case 336:this.$="SUM";break;case 337:this.$="COUNT";break;case 338:this.$="MIN";break;case 339:case 544:this.$="MAX";break;case 340:this.$="AVG";break;case 341:this.$="FIRST";break;case 342:this.$="LAST";break;case 343:this.$="AGGR";break;case 344:this.$="ARRAY";break;case 345:var f=s[o-4],p=s[o-1];p.length>1&&("MIN"==f.toUpperCase()||"MAX"==f.toUpperCase())?this.$=new n.FuncValue({funcid:f,args:p}):A.aggr[s[o-4]]?this.$=new n.AggrValue({aggregatorid:"REDUCE",funcid:f,expression:p.pop(),distinct:"DISTINCT"==s[o-2]}):this.$=new n.FuncValue({funcid:f,args:p});break;case 346:this.$=new n.FuncValue({funcid:s[o-2]});break;case 347:this.$=new n.FuncValue({funcid:"IIF",args:s[o-1]});break;case 348:this.$=new n.FuncValue({funcid:"REPLACE",args:s[o-1]});break;case 349:this.$=new n.FuncValue({funcid:"DATEADD",args:[new n.StringValue({value:s[o-5]}),s[o-3],s[o-1]]});break;case 350:this.$=new n.FuncValue({funcid:"DATEADD",args:[s[o-5],s[o-3],s[o-1]]});break;case 351:this.$=new n.FuncValue({funcid:"DATEDIFF",args:[new n.StringValue({value:s[o-5]}),s[o-3],s[o-1]]});break;case 352:this.$=new n.FuncValue({funcid:"DATEDIFF",args:[s[o-5],s[o-3],s[o-1]]});break;case 353:this.$=new n.FuncValue({funcid:"INTERVAL",args:[s[o-1],new n.StringValue({value:s[o].toLowerCase()})]});break;case 355:s[o-2].push(s[o]),this.$=s[o-2];break;case 356:this.$=new n.NumValue({value:+s[o]});break;case 357:this.$=new n.LogicValue({value:!0});break;case 358:this.$=new n.LogicValue({value:!1});break;case 359:this.$=new n.StringValue({value:s[o].substr(1,s[o].length-2).replace(/(\\\')/g,"'").replace(/(\'\')/g,"'")});break;case 360:this.$=new n.StringValue({value:s[o].substr(2,s[o].length-3).replace(/(\\\')/g,"'").replace(/(\'\')/g,"'")});break;case 361:this.$=new n.NullValue({value:void 0});break;case 362:this.$=new n.VarValue({variable:s[o]});break;case 363:n.exists||(n.exists=[]),this.$=new n.ExistsValue({value:s[o-1],existsidx:n.exists.length}),n.exists.push(s[o-1]);break;case 364:this.$=new n.ArrayValue({value:s[o-1]});break;case 365:case 366:this.$=new n.ParamValue({param:s[o]});break;case 367:void 0===n.question&&(n.question=0),this.$=new n.ParamValue({param:n.question++});break;case 368:void 0===n.question&&(n.question=0),this.$=new n.ParamValue({param:n.question++,array:!0});break;case 369:this.$=new n.CaseValue({expression:s[o-3],whens:s[o-2],elses:s[o-1]});break;case 370:this.$=new n.CaseValue({whens:s[o-2],elses:s[o-1]});break;case 371:case 699:case 700:this.$=s[o-1],this.$.push(s[o]);break;case 373:this.$={when:s[o-2],then:s[o]};break;case 376:case 377:this.$=new n.Op({left:s[o-2],op:"REGEXP",right:s[o]});break;case 378:this.$=new n.Op({left:s[o-2],op:"GLOB",right:s[o]});break;case 379:this.$=new n.Op({left:s[o-2],op:"LIKE",right:s[o]});break;case 380:this.$=new n.Op({left:s[o-4],op:"LIKE",right:s[o-2],escape:s[o]});break;case 381:this.$=new n.Op({left:s[o-2],op:"NOT LIKE",right:s[o]});break;case 382:this.$=new n.Op({left:s[o-4],op:"NOT LIKE",right:s[o-2],escape:s[o]});break;case 383:this.$=new n.Op({left:s[o-2],op:"||",right:s[o]});break;case 384:this.$=new n.Op({left:s[o-2],op:"+",right:s[o]});break;case 385:this.$=new n.Op({left:s[o-2],op:"-",right:s[o]});break;case 386:this.$=new n.Op({left:s[o-2],op:"*",right:s[o]});break;case 387:this.$=new n.Op({left:s[o-2],op:"/",right:s[o]});break;case 388:this.$=new n.Op({left:s[o-2],op:"%",right:s[o]});break;case 389:this.$=new n.Op({left:s[o-2],op:"^",right:s[o]});break;case 390:this.$=new n.Op({left:s[o-2],op:">>",right:s[o]});break;case 391:this.$=new n.Op({left:s[o-2],op:"<<",right:s[o]});break;case 392:this.$=new n.Op({left:s[o-2],op:"&",right:s[o]});break;case 393:this.$=new n.Op({left:s[o-2],op:"|",right:s[o]});break;case 394:case 395:case 397:this.$=new n.Op({left:s[o-2],op:"->",right:s[o]});break;case 396:this.$=new n.Op({left:s[o-4],op:"->",right:s[o-1]});break;case 398:case 399:case 401:this.$=new n.Op({left:s[o-2],op:"!",right:s[o]});break;case 400:this.$=new n.Op({left:s[o-4],op:"!",right:s[o-1]});break;case 402:this.$=new n.Op({left:s[o-2],op:">",right:s[o]});break;case 403:this.$=new n.Op({left:s[o-2],op:">=",right:s[o]});break;case 404:this.$=new n.Op({left:s[o-2],op:"<",right:s[o]});break;case 405:this.$=new n.Op({left:s[o-2],op:"<=",right:s[o]});break;case 406:this.$=new n.Op({left:s[o-2],op:"=",right:s[o]});break;case 407:this.$=new n.Op({left:s[o-2],op:"==",right:s[o]});break;case 408:this.$=new n.Op({left:s[o-2],op:"===",right:s[o]});break;case 409:this.$=new n.Op({left:s[o-2],op:"!=",right:s[o]});break;case 410:this.$=new n.Op({left:s[o-2],op:"!==",right:s[o]});break;case 411:this.$=new n.Op({left:s[o-2],op:"!===",right:s[o]});break;case 412:n.queries||(n.queries=[]),this.$=new n.Op({left:s[o-5],op:s[o-4],allsome:s[o-3],right:s[o-1],queriesidx:n.queries.length}),n.queries.push(s[o-1]);break;case 413:this.$=new n.Op({left:s[o-5],op:s[o-4],allsome:s[o-3],right:s[o-1]});break;case 414:"BETWEEN1"==s[o-2].op?"AND"==s[o-2].left.op?this.$=new n.Op({left:s[o-2].left.left,op:"AND",right:new n.Op({left:s[o-2].left.right,op:"BETWEEN",right1:s[o-2].right,right2:s[o]})}):this.$=new n.Op({left:s[o-2].left,op:"BETWEEN",right1:s[o-2].right,right2:s[o]}):"NOT BETWEEN1"==s[o-2].op?"AND"==s[o-2].left.op?this.$=new n.Op({left:s[o-2].left.left,op:"AND",right:new n.Op({left:s[o-2].left.right,op:"NOT BETWEEN",right1:s[o-2].right,right2:s[o]})}):this.$=new n.Op({left:s[o-2].left,op:"NOT BETWEEN",right1:s[o-2].right,right2:s[o]}):this.$=new n.Op({left:s[o-2],op:"AND",right:s[o]});break;case 415:this.$=new n.Op({left:s[o-2],op:"OR",right:s[o]});break;case 416:this.$=new n.UniOp({op:"NOT",right:s[o]});break;case 417:this.$=new n.UniOp({op:"-",right:s[o]});break;case 418:this.$=new n.UniOp({op:"+",right:s[o]});break;case 419:this.$=new n.UniOp({op:"~",right:s[o]});break;case 420:this.$=new n.UniOp({op:"#",right:s[o]});break;case 421:this.$=new n.UniOp({right:s[o-1]});break;case 422:n.queries||(n.queries=[]),this.$=new n.Op({left:s[o-4],op:"IN",right:s[o-1],queriesidx:n.queries.length }),n.queries.push(s[o-1]);break;case 423:n.queries||(n.queries=[]),this.$=new n.Op({left:s[o-5],op:"NOT IN",right:s[o-1],queriesidx:n.queries.length}),n.queries.push(s[o-1]);break;case 424:this.$=new n.Op({left:s[o-4],op:"IN",right:s[o-1]});break;case 425:this.$=new n.Op({left:s[o-5],op:"NOT IN",right:s[o-1]});break;case 426:this.$=new n.Op({left:s[o-3],op:"IN",right:[]});break;case 427:this.$=new n.Op({left:s[o-4],op:"NOT IN",right:[]});break;case 428:case 430:this.$=new n.Op({left:s[o-2],op:"IN",right:s[o]});break;case 429:case 431:this.$=new n.Op({left:s[o-3],op:"NOT IN",right:s[o]});break;case 432:this.$=new n.Op({left:s[o-2],op:"BETWEEN1",right:s[o]});break;case 433:this.$=new n.Op({left:s[o-2],op:"NOT BETWEEN1",right:s[o]});break;case 434:this.$=new n.Op({op:"IS",left:s[o-2],right:s[o]});break;case 435:this.$=new n.Op({op:"IS",left:s[o-2],right:new n.UniOp({op:"NOT",right:new n.NullValue({value:void 0})})});break;case 436:this.$=new n.Convert({expression:s[o-2]}),n.extend(this.$,s[o]);break;case 437:case 438:this.$=s[o];break;case 439:this.$=s[o-1];break;case 446:this.$="ALL";break;case 447:this.$="SOME";break;case 448:this.$="ANY";break;case 449:this.$=new n.Update({table:s[o-4],columns:s[o-2],where:s[o]});break;case 450:this.$=new n.Update({table:s[o-2],columns:s[o]});break;case 453:this.$=new n.SetColumn({column:s[o-2],expression:s[o]});break;case 454:this.$=new n.SetColumn({variable:s[o-2],expression:s[o],method:s[o-3]});break;case 455:this.$=new n.Delete({table:s[o-2],where:s[o]});break;case 456:this.$=new n.Delete({table:s[o]});break;case 457:this.$=new n.Insert({into:s[o-2],values:s[o]});break;case 458:this.$=new n.Insert({into:s[o-1],values:s[o]});break;case 459:case 461:this.$=new n.Insert({into:s[o-2],values:s[o],orreplace:!0});break;case 460:case 462:this.$=new n.Insert({into:s[o-1],values:s[o],orreplace:!0});break;case 463:this.$=new n.Insert({into:s[o-2],default:!0});break;case 464:this.$=new n.Insert({into:s[o-5],columns:s[o-3],values:s[o]});break;case 465:this.$=new n.Insert({into:s[o-4],columns:s[o-2],values:s[o]});break;case 466:this.$=new n.Insert({into:s[o-1],select:s[o]});break;case 467:this.$=new n.Insert({into:s[o-1],select:s[o],orreplace:!0});break;case 468:this.$=new n.Insert({into:s[o-4],columns:s[o-2],select:s[o]});break;case 473:this.$=[s[o-1]];break;case 476:this.$=s[o-4],s[o-4].push(s[o-1]);break;case 477:case 478:case 480:case 488:this.$=s[o-2],s[o-2].push(s[o]);break;case 489:this.$=new n.CreateTable({table:s[o-4]}),n.extend(this.$,s[o-7]),n.extend(this.$,s[o-6]),n.extend(this.$,s[o-5]),n.extend(this.$,s[o-2]),n.extend(this.$,s[o]);break;case 490:this.$=new n.CreateTable({table:s[o]}),n.extend(this.$,s[o-3]),n.extend(this.$,s[o-2]),n.extend(this.$,s[o-1]);break;case 492:this.$={class:!0};break;case 502:this.$={temporary:!0};break;case 504:this.$={ifnotexists:!0};break;case 505:this.$={columns:s[o-2],constraints:s[o]};break;case 506:this.$={columns:s[o]};break;case 507:this.$={as:s[o]};break;case 508:case 532:this.$=[s[o]];break;case 510:case 511:case 512:case 513:case 514:s[o].constraintid=s[o-1],this.$=s[o];break;case 517:this.$={type:"CHECK",expression:s[o-1]};break;case 518:this.$={type:"PRIMARY KEY",columns:s[o-1],clustered:(s[o-3]+"").toUpperCase()};break;case 519:this.$={type:"FOREIGN KEY",columns:s[o-5],fktable:s[o-2],fkcolumns:s[o-1]};break;case 525:this.$={type:"UNIQUE",columns:s[o-1],clustered:(s[o-3]+"").toUpperCase()};break;case 534:this.$=new n.ColumnDef({columnid:s[o-2]}),n.extend(this.$,s[o-1]),n.extend(this.$,s[o]);break;case 535:this.$=new n.ColumnDef({columnid:s[o-1]}),n.extend(this.$,s[o]);break;case 536:this.$=new n.ColumnDef({columnid:s[o],dbtypeid:""});break;case 537:this.$={dbtypeid:s[o-5],dbsize:s[o-3],dbprecision:+s[o-1]};break;case 538:this.$={dbtypeid:s[o-3],dbsize:s[o-1]};break;case 539:this.$={dbtypeid:s[o]};break;case 540:this.$={dbtypeid:"ENUM",enumvalues:s[o-1]};break;case 541:this.$=s[o-1],s[o-1].dbtypeid+="["+s[o]+"]";break;case 543:case 750:this.$=+s[o];break;case 545:this.$=void 0;break;case 547:n.extend(s[o-1],s[o]),this.$=s[o-1];break;case 550:this.$={primarykey:!0};break;case 551:case 552:this.$={foreignkey:{table:s[o-1],columnid:s[o]}};break;case 553:this.$={identity:{value:s[o-3],step:s[o-1]}};break;case 554:this.$={identity:{value:1,step:1}};break;case 555:case 557:this.$={default:s[o]};break;case 556:this.$={default:s[o-1]};break;case 558:this.$={null:!0};break;case 559:this.$={notnull:!0};break;case 560:this.$={check:s[o]};break;case 561:this.$={unique:!0};break;case 562:this.$={onupdate:s[o]};break;case 563:this.$={onupdate:s[o-1]};break;case 564:this.$=new n.DropTable({tables:s[o],type:s[o-2]}),n.extend(this.$,s[o-1]);break;case 568:this.$={ifexists:!0};break;case 569:this.$=new n.AlterTable({table:s[o-3],renameto:s[o]});break;case 570:this.$=new n.AlterTable({table:s[o-3],addcolumn:s[o]});break;case 571:this.$=new n.AlterTable({table:s[o-3],modifycolumn:s[o]});break;case 572:this.$=new n.AlterTable({table:s[o-5],renamecolumn:s[o-2],to:s[o]});break;case 573:this.$=new n.AlterTable({table:s[o-3],dropcolumn:s[o]});break;case 574:this.$=new n.AlterTable({table:s[o-2],renameto:s[o]});break;case 575:this.$=new n.AttachDatabase({databaseid:s[o],engineid:s[o-2].toUpperCase()});break;case 576:this.$=new n.AttachDatabase({databaseid:s[o-3],engineid:s[o-5].toUpperCase(),args:s[o-1]});break;case 577:this.$=new n.AttachDatabase({databaseid:s[o-2],engineid:s[o-4].toUpperCase(),as:s[o]});break;case 578:this.$=new n.AttachDatabase({databaseid:s[o-5],engineid:s[o-7].toUpperCase(),as:s[o],args:s[o-3]});break;case 579:this.$=new n.DetachDatabase({databaseid:s[o]});break;case 580:this.$=new n.CreateDatabase({databaseid:s[o]}),n.extend(this.$,s[o]);break;case 581:this.$=new n.CreateDatabase({engineid:s[o-4].toUpperCase(),databaseid:s[o-1],as:s[o]}),n.extend(this.$,s[o-2]);break;case 582:this.$=new n.CreateDatabase({engineid:s[o-7].toUpperCase(),databaseid:s[o-4],args:s[o-2],as:s[o]}),n.extend(this.$,s[o-5]);break;case 583:this.$=new n.CreateDatabase({engineid:s[o-4].toUpperCase(),as:s[o],args:[s[o-1]]}),n.extend(this.$,s[o-2]);break;case 584:this.$=void 0;break;case 586:case 587:this.$=new n.UseDatabase({databaseid:s[o]});break;case 588:this.$=new n.DropDatabase({databaseid:s[o]}),n.extend(this.$,s[o-1]);break;case 589:case 590:this.$=new n.DropDatabase({databaseid:s[o],engineid:s[o-3].toUpperCase()}),n.extend(this.$,s[o-1]);break;case 591:this.$=new n.CreateIndex({indexid:s[o-5],table:s[o-3],columns:s[o-1]});break;case 592:this.$=new n.CreateIndex({indexid:s[o-5],table:s[o-3],columns:s[o-1],unique:!0});break;case 593:this.$=new n.DropIndex({indexid:s[o]});break;case 594:this.$=new n.ShowDatabases;break;case 595:this.$=new n.ShowDatabases({like:s[o]});break;case 596:this.$=new n.ShowDatabases({engineid:s[o-1].toUpperCase()});break;case 597:this.$=new n.ShowDatabases({engineid:s[o-3].toUpperCase(),like:s[o]});break;case 598:this.$=new n.ShowTables;break;case 599:this.$=new n.ShowTables({like:s[o]});break;case 600:this.$=new n.ShowTables({databaseid:s[o]});break;case 601:this.$=new n.ShowTables({like:s[o],databaseid:s[o-2]});break;case 602:this.$=new n.ShowColumns({table:s[o]});break;case 603:this.$=new n.ShowColumns({table:s[o-2],databaseid:s[o]});break;case 604:this.$=new n.ShowIndex({table:s[o]});break;case 605:this.$=new n.ShowIndex({table:s[o-2],databaseid:s[o]});break;case 606:this.$=new n.ShowCreateTable({table:s[o]});break;case 607:this.$=new n.ShowCreateTable({table:s[o-2],databaseid:s[o]});break;case 608:this.$=new n.CreateTable({table:s[o-6],view:!0,select:s[o-1],viewcolumns:s[o-4]}),n.extend(this.$,s[o-9]),n.extend(this.$,s[o-7]);break;case 609:this.$=new n.CreateTable({table:s[o-3],view:!0,select:s[o-1]}),n.extend(this.$,s[o-6]),n.extend(this.$,s[o-4]);break;case 613:this.$=new n.DropTable({tables:s[o],view:!0}),n.extend(this.$,s[o-1]);break;case 614:case 760:this.$=new n.ExpressionStatement({expression:s[o]});break;case 615:this.$=new n.Source({url:s[o].value});break;case 616:this.$=new n.Assert({value:s[o]});break;case 617:this.$=new n.Assert({value:s[o].value});break;case 618:this.$=new n.Assert({value:s[o],message:s[o-2]});break;case 620:case 631:case 633:this.$=s[o].value;break;case 621:case 629:this.$=+s[o].value;break;case 622:this.$=!!s[o].value;break;case 630:this.$=""+s[o].value;break;case 639:this.$={};break;case 642:this.$=[];break;case 643:n.extend(s[o-2],s[o]),this.$=s[o-2];break;case 645:this.$={},this.$[s[o-2].substr(1,s[o-2].length-2)]=s[o];break;case 646:case 647:this.$={},this.$[s[o-2]]=s[o];break;case 650:this.$=new n.SetVariable({variable:s[o-2].toLowerCase(),value:s[o]});break;case 651:this.$=new n.SetVariable({variable:s[o-1].toLowerCase(),value:s[o]});break;case 652:this.$=new n.SetVariable({variable:s[o-2],expression:s[o]});break;case 653:this.$=new n.SetVariable({variable:s[o-3],props:s[o-2],expression:s[o]});break;case 654:this.$=new n.SetVariable({variable:s[o-2],expression:s[o],method:s[o-3]});break;case 655:this.$=new n.SetVariable({variable:s[o-3],props:s[o-2],expression:s[o],method:s[o-4]});break;case 656:this.$="@";break;case 657:this.$="$";break;case 663:this.$=!0;break;case 664:this.$=!1;break;case 665:this.$=new n.CommitTransaction;break;case 666:this.$=new n.RollbackTransaction;break;case 667:this.$=new n.BeginTransaction;break;case 668:this.$=new n.If({expression:s[o-2],thenstat:s[o-1],elsestat:s[o]}),s[o-1].exists&&(this.$.exists=s[o-1].exists),s[o-1].queries&&(this.$.queries=s[o-1].queries);break;case 669:this.$=new n.If({expression:s[o-1],thenstat:s[o]}),s[o].exists&&(this.$.exists=s[o].exists),s[o].queries&&(this.$.queries=s[o].queries);break;case 670:this.$=s[o];break;case 671:this.$=new n.While({expression:s[o-1],loopstat:s[o]}),s[o].exists&&(this.$.exists=s[o].exists),s[o].queries&&(this.$.queries=s[o].queries);break;case 672:this.$=new n.Continue;break;case 673:this.$=new n.Break;break;case 674:this.$=new n.BeginEnd({statements:s[o-1]});break;case 675:this.$=new n.Print({exprs:s[o]});break;case 676:this.$=new n.Print({select:s[o]});break;case 677:this.$=new n.Require({paths:s[o]});break;case 678:this.$=new n.Require({plugins:s[o]});break;case 679:case 680:this.$=s[o].toUpperCase();break;case 681:this.$=new n.Echo({expr:s[o]});break;case 686:this.$=new n.Declare({declares:s[o]});break;case 689:this.$={variable:s[o-1]},n.extend(this.$,s[o]);break;case 690:this.$={variable:s[o-2]},n.extend(this.$,s[o]);break;case 691:this.$={variable:s[o-3],expression:s[o]},n.extend(this.$,s[o-2]);break;case 692:this.$={variable:s[o-4],expression:s[o]},n.extend(this.$,s[o-2]);break;case 693:this.$=new n.TruncateTable({table:s[o]});break;case 694:this.$=new n.Merge,n.extend(this.$,s[o-4]),n.extend(this.$,s[o-3]),n.extend(this.$,s[o-2]),n.extend(this.$,{matches:s[o-1]}),n.extend(this.$,s[o]);break;case 695:case 696:this.$={into:s[o]};break;case 698:this.$={on:s[o]};break;case 703:this.$={matched:!0,action:s[o]};break;case 704:this.$={matched:!0,expr:s[o-2],action:s[o]};break;case 705:this.$={delete:!0};break;case 706:this.$={update:s[o]};break;case 707:case 708:this.$={matched:!1,bytarget:!0,action:s[o]};break;case 709:case 710:this.$={matched:!1,bytarget:!0,expr:s[o-2],action:s[o]};break;case 711:this.$={matched:!1,bysource:!0,action:s[o]};break;case 712:this.$={matched:!1,bysource:!0,expr:s[o-2],action:s[o]};break;case 713:this.$={insert:!0,values:s[o]};break;case 714:this.$={insert:!0,values:s[o],columns:s[o-3]};break;case 715:this.$={insert:!0,defaultvalues:!0};break;case 716:this.$={insert:!0,defaultvalues:!0,columns:s[o-3]};break;case 718:this.$={output:{columns:s[o]}};break;case 719:this.$={output:{columns:s[o-3],intovar:s[o],method:s[o-1]}};break;case 720:this.$={output:{columns:s[o-2],intotable:s[o]}};break;case 721:this.$={output:{columns:s[o-5],intotable:s[o-3],intocolumns:s[o-1]}};break;case 722:this.$=new n.CreateVertex({class:s[o-3],sharp:s[o-2],name:s[o-1]}),n.extend(this.$,s[o]);break;case 725:this.$={sets:s[o]};break;case 726:this.$={content:s[o]};break;case 727:this.$={select:s[o]};break;case 728:this.$=new n.CreateEdge({from:s[o-3],to:s[o-1],name:s[o-5]}),n.extend(this.$,s[o]);break;case 729:this.$=new n.CreateGraph({graph:s[o]});break;case 730:this.$=new n.CreateGraph({from:s[o]});break;case 733:this.$=s[o-2],s[o-1]&&(this.$.json=new n.Json({value:s[o-1]})),s[o]&&(this.$.as=s[o]);break;case 734:this.$={source:s[o-6],target:s[o]},s[o-3]&&(this.$.json=new n.Json({value:s[o-3]})),s[o-2]&&(this.$.as=s[o-2]),n.extend(this.$,s[o-4]);break;case 735:this.$={source:s[o-5],target:s[o]},s[o-2]&&(this.$.json=new n.Json({value:s[o-3]})),s[o-1]&&(this.$.as=s[o-2]);break;case 736:this.$={source:s[o-2],target:s[o]};break;case 740:this.$={vars:s[o],method:s[o-1]};break;case 743:case 744:var b=s[o-1];this.$={prop:s[o-3],sharp:s[o-2],name:void 0===b?void 0:b.substr(1,b.length-2),class:s[o]};break;case 745:var E=s[o-1];this.$={sharp:s[o-2],name:void 0===E?void 0:E.substr(1,E.length-2),class:s[o]};break;case 746:var g=s[o-1];this.$={name:void 0===g?void 0:g.substr(1,g.length-2),class:s[o]};break;case 747:this.$={class:s[o]};break;case 753:this.$=new n.AddRule({left:s[o-2],right:s[o]});break;case 754:this.$=new n.AddRule({right:s[o]});break;case 757:this.$=new n.Term({termid:s[o]});break;case 758:this.$=new n.Term({termid:s[o-3],args:s[o-1]});break;case 761:this.$=new n.CreateTrigger({trigger:s[o-6],when:s[o-5],action:s[o-4],table:s[o-2],statement:s[o]}),s[o].exists&&(this.$.exists=s[o].exists),s[o].queries&&(this.$.queries=s[o].queries);break;case 762:this.$=new n.CreateTrigger({trigger:s[o-5],when:s[o-4],action:s[o-3],table:s[o-1],funcid:s[o]});break;case 763:this.$=new n.CreateTrigger({trigger:s[o-6],when:s[o-4],action:s[o-3],table:s[o-5],statement:s[o]}),s[o].exists&&(this.$.exists=s[o].exists),s[o].queries&&(this.$.queries=s[o].queries);break;case 764:case 765:case 767:this.$="AFTER";break;case 766:this.$="BEFORE";break;case 768:this.$="INSTEADOF";break;case 769:this.$="INSERT";break;case 770:this.$="DELETE";break;case 771:this.$="UPDATE";break;case 772:this.$=new n.DropTrigger({trigger:s[o]});break;case 773:this.$=new n.Reindex({indexid:s[o]});break;case 1047:case 1067:case 1069:case 1071:case 1075:case 1077:case 1079:case 1081:case 1083:case 1085:this.$=[];break;case 1048:case 1062:case 1064:case 1068:case 1070:case 1072:case 1076:case 1078:case 1080:case 1082:case 1084:case 1086:s[o-1].push(s[o]);break;case 1061:case 1063:this.$=[s[o]]}},table:[t([10,602,764],r,{8:1,9:2,12:3,13:4,17:5,18:7,19:8,20:9,21:10,22:11,23:12,24:13,25:14,26:15,27:16,28:17,29:18,30:19,31:20,32:21,33:22,34:23,35:24,36:25,37:26,38:27,39:28,40:29,41:30,42:31,43:32,44:33,45:34,46:35,47:36,48:37,49:38,50:39,51:40,52:41,54:43,55:44,56:45,57:46,58:47,59:48,60:49,61:50,62:51,63:52,64:53,65:54,66:55,67:56,68:57,69:58,70:59,71:60,79:75,504:95,184:99,3:100,2:n,4:a,5:s,14:i,53:o,72:u,89:c,124:l,146:h,156:d,189:f,266:p,267:b,290:E,335:g,338:m,339:v,396:S,400:T,401:y,404:N,406:C,408:R,409:O,417:I,418:x,434:D,436:k,437:L,439:$,440:M,441:U,442:_,443:F,447:P,448:q,451:G,452:V,505:B,507:j,508:H,517:J}),{1:[3]},{10:[1,105],11:106,602:Y,764:W},t(X,[2,8]),t(X,[2,9]),t(K,[2,12]),t(X,r,{17:5,18:7,19:8,20:9,21:10,22:11,23:12,24:13,25:14,26:15,27:16,28:17,29:18,30:19,31:20,32:21,33:22,34:23,35:24,36:25,37:26,38:27,39:28,40:29,41:30,42:31,43:32,44:33,45:34,46:35,47:36,48:37,49:38,50:39,51:40,52:41,54:43,55:44,56:45,57:46,58:47,59:48,60:49,61:50,62:51,63:52,64:53,65:54,66:55,67:56,68:57,69:58,70:59,71:60,79:75,504:95,184:99,3:100,12:109,2:n,4:a,5:s,15:[1,110],53:o,72:u,89:c,124:l,146:h,156:d,189:f,266:p,267:b,290:E,335:g,338:m,339:v,396:S,400:T,401:y,404:N,406:C,408:R,409:O,417:I,418:x,434:D,436:k,437:L,439:$,440:M,441:U,442:_,443:F,447:P,448:q,451:G,452:V,505:B,507:j,508:H,517:J}),t(K,[2,14]),t(K,[2,15]),t(K,[2,16]),t(K,[2,17]),t(K,[2,18]),t(K,[2,19]),t(K,[2,20]),t(K,[2,21]),t(K,[2,22]),t(K,[2,23]),t(K,[2,24]),t(K,[2,25]),t(K,[2,26]),t(K,[2,27]),t(K,[2,28]),t(K,[2,29]),t(K,[2,30]),t(K,[2,31]),t(K,[2,32]),t(K,[2,33]),t(K,[2,34]),t(K,[2,35]),t(K,[2,36]),t(K,[2,37]),t(K,[2,38]),t(K,[2,39]),t(K,[2,40]),t(K,[2,41]),t(K,[2,42]),t(K,[2,43]),t(K,[2,44]),t(K,[2,45]),t(K,[2,46]),t(K,[2,47]),t(K,[2,48]),t(K,[2,49]),t(K,[2,50]),t(K,[2,51]),t(K,[2,52]),t(K,[2,53]),t(K,[2,54]),t(K,[2,55]),t(K,[2,56]),t(K,[2,57]),t(K,[2,58]),t(K,[2,59]),t(K,[2,60]),t(K,[2,61]),t(K,[2,62]),t(K,[2,63]),t(K,[2,64]),t(K,[2,65]),t(K,[2,66]),t(K,[2,67]),{353:[1,111]},{2:n,3:112,4:a,5:s},{2:n,3:114,4:a,5:s,156:Q,200:113,290:z,291:Z,292:ee,293:te},t(re,[2,501],{3:121,348:125,2:n,4:a,5:s,134:ne,135:ae,187:[1,123],193:[1,122],268:[1,129],269:[1,130],357:[1,131],405:[1,120],472:[1,124],509:[1,128]}),{145:se,449:132,450:133},{183:[1,135]},{405:[1,136]},{2:n,3:138,4:a,5:s,130:[1,144],193:[1,139],353:[1,143],397:140,405:[1,137],410:[1,141],509:[1,142]},{2:n,3:168,4:a,5:s,56:165,77:ie,94:145,111:149,113:153,131:oe,132:ue,137:ce,143:le,144:161,145:he,149:de,152:fe,154:pe,156:Q,158:167,179:be,180:Ee,181:ge,196:151,200:147,201:155,202:156,254:150,255:146,256:148,257:152,258:154,259:157,260:158,261:159,262:162,263:163,265:me,266:p,270:ve,271:Se,273:Te,280:Ae,281:ye,282:Ne,283:Ce,284:Re,285:Oe,286:we,287:Ie,288:xe,290:z,291:Z,292:ee,293:te,294:De,295:ke,296:Le,297:$e,298:Me,299:Ue,302:_e,303:Fe,312:Pe,317:qe,419:190,420:Ge,424:Ve},t(Be,je,{340:204,171:[1,205],198:He}),t(Be,je,{340:207,198:He}),{2:n,3:219,4:a,5:s,77:Je,132:Ye,143:le,144:212,145:he,152:fe,156:Q,181:ge,198:[1,210],199:213,200:215,201:214,202:217,209:209,213:We,214:218,290:z,291:Z,292:ee,293:te,302:_e,419:190,420:Ge,424:Ve,453:208},{2:n,3:221,4:a,5:s},{353:[1,222]},t(Xe,[2,1043],{80:223,106:224,107:[1,225]}),t(Ke,[2,1047],{90:226}),{2:n,3:230,4:a,5:s,190:[1,228],193:[1,231],267:[1,227],353:[1,232],405:[1,229]},{353:[1,233]},{2:n,3:236,4:a,5:s,73:234,75:235},t([306,602,764],r,{12:3,13:4,17:5,18:7,19:8,20:9,21:10,22:11,23:12,24:13,25:14,26:15,27:16,28:17,29:18,30:19,31:20,32:21,33:22,34:23,35:24,36:25,37:26,38:27,39:28,40:29,41:30,42:31,43:32,44:33,45:34,46:35,47:36,48:37,49:38,50:39,51:40,52:41,54:43,55:44,56:45,57:46,58:47,59:48,60:49,61:50,62:51,63:52,64:53,65:54,66:55,67:56,68:57,69:58,70:59,71:60,79:75,504:95,184:99,3:100,9:238,2:n,4:a,5:s,14:i,53:o,72:u,89:c,124:l,146:h,156:d,189:f,266:p,267:b,290:E,335:g,338:m,339:v,396:S,400:T,401:y,404:N,406:C,408:R,409:O,417:I,418:x,434:D,435:[1,237],436:k,437:L,439:$,440:M,441:U,442:_,443:F,447:P,448:q,451:G,452:V,505:B,507:j,508:H,517:J}),{435:[1,239]},{435:[1,240]},{2:n,3:242,4:a,5:s,405:[1,241]},{2:n,3:244,4:a,5:s,199:243},t(Qe,[2,311]),{113:245,132:ue,296:Le},{2:n,3:114,4:a,5:s,113:251,131:oe,132:[1,248],143:le,144:246,145:ze,152:fe,156:Q,181:ge,196:250,200:255,201:254,257:252,258:253,265:Ze,274:247,290:z,291:Z,292:ee,293:te,294:De,295:ke,296:Le,297:$e,302:_e,419:190,420:Ge,424:Ve},{2:n,3:168,4:a,5:s,56:165,77:ie,94:257,111:149,113:153,131:oe,132:ue,137:ce,143:le,144:161,145:he,149:de,152:fe,154:pe,156:Q,158:167,179:be,180:Ee,181:ge,196:151,200:147,201:155,202:156,254:150,255:146,256:148,257:152,258:154,259:157,260:158,261:159,262:162,263:163,265:me,266:p,270:ve,271:Se,273:Te,280:Ae,281:ye,282:Ne,283:Ce,284:Re,285:Oe,286:we,287:Ie,288:xe,290:z,291:Z,292:ee,293:te,294:De,295:ke,296:Le,297:$e,298:Me,299:Ue,302:_e,303:Fe,312:Pe,317:qe,419:190,420:Ge,424:Ve},t(K,[2,672]),t(K,[2,673]),{2:n,3:168,4:a,5:s,40:259,56:165,77:ie,79:75,89:c,94:260,111:149,113:153,131:oe,132:ue,137:ce,143:le,144:161,145:he,149:de,151:258,152:fe,154:pe,156:Q,158:167,179:be,180:Ee,181:ge,184:99,189:f,196:151,200:147,201:155,202:156,254:150,255:146,256:148,257:152,258:154,259:157,260:158,261:159,262:162,263:163,265:me,266:p,270:ve,271:Se,273:Te,280:Ae,281:ye,282:Ne,283:Ce,284:Re,285:Oe,286:we,287:Ie,288:xe,290:z,291:Z,292:ee,293:te,294:De,295:ke,296:Le,297:$e,298:Me,299:Ue,302:_e,303:Fe,312:Pe,317:qe,419:190,420:Ge,424:Ve},{2:n,3:266,4:a,5:s,113:263,132:ue,296:Le,444:261,445:262,446:264,447:et},{2:n,3:267,4:a,5:s,143:tt,145:rt,431:268},{2:n,3:168,4:a,5:s,56:165,77:ie,94:271,111:149,113:153,131:oe,132:ue,137:ce,143:le,144:161,145:he,149:de,152:fe,154:pe,156:Q,158:167,179:be,180:Ee,181:ge,196:151,200:147,201:155,202:156,254:150,255:146,256:148,257:152,258:154,259:157,260:158,261:159,262:162,263:163,265:me,266:p,270:ve,271:Se,273:Te,280:Ae,281:ye,282:Ne,283:Ce,284:Re,285:Oe,286:we,287:Ie,288:xe,290:z,291:Z,292:ee,293:te,294:De,295:ke,296:Le,297:$e,298:Me,299:Ue,302:_e,303:Fe,312:Pe,317:qe,419:190,420:Ge,424:Ve},{505:[1,272]},{2:n,3:100,4:a,5:s,504:274,506:273},{2:n,3:114,4:a,5:s,156:Q,200:275,290:z,291:Z,292:ee,293:te},{2:n,3:168,4:a,5:s,56:165,77:ie,94:276,111:149,113:153,131:oe,132:ue,137:ce,143:le,144:161,145:he,149:de,152:fe,154:pe,156:Q,158:167,179:be,180:Ee,181:ge,196:151,200:147,201:155,202:156,254:150,255:146,256:148,257:152,258:154,259:157,260:158,261:159,262:162,263:163,265:me,266:p,270:ve,271:Se,273:Te,280:Ae,281:ye,282:Ne,283:Ce,284:Re,285:Oe,286:we,287:Ie,288:xe,290:z,291:Z,292:ee,293:te,294:De,295:ke,296:Le,297:$e,298:Me,299:Ue,302:_e,303:Fe,312:Pe,317:qe,419:190,420:Ge,424:Ve},t(nt,at,{186:280,164:[1,279],185:[1,277],187:[1,278],195:st}),t(it,[2,757],{77:[1,282]}),t([2,4,5,10,72,77,78,93,98,107,118,128,131,132,137,143,145,152,154,156,162,164,168,169,179,180,181,183,185,187,195,198,232,245,247,265,266,270,271,273,280,281,282,283,284,285,286,287,288,290,291,292,293,294,295,296,297,298,299,302,303,306,310,312,317,420,424,602,764],[2,152],{149:[1,283],150:[1,284],190:[1,285],191:[1,286],192:[1,287],193:[1,288],194:[1,289]}),t(ot,[2,1]),t(ot,[2,2]),{6:290,131:[1,439],172:[1,462],245:[1,411],285:[1,373],286:[1,407],370:[1,404],381:[1,295],402:[1,297],410:[1,549],414:[1,471],416:[1,443],417:[1,509],433:[1,442],435:[1,525],440:[1,342],460:[1,418],464:[1,448],470:[1,341],514:[1,307],515:[1,299],516:[1,399],518:[1,291],519:[1,292],520:[1,293],521:[1,294],522:[1,296],523:[1,298],524:[1,300],525:[1,301],526:[1,302],527:[1,303],528:[1,304],529:[1,305],530:[1,306],531:[1,308],532:[1,309],533:[1,310],534:[1,311],535:[1,312],536:[1,313],537:[1,314],538:[1,315],539:[1,316],540:[1,317],541:[1,318],542:[1,319],543:[1,320],544:[1,321],545:[1,322],546:[1,323],547:[1,324],548:[1,325],549:[1,326],550:[1,327],551:[1,328],552:[1,329],553:[1,330],554:[1,331],555:[1,332],556:[1,333],557:[1,334],558:[1,335],559:[1,336],560:[1,337],561:[1,338],562:[1,339],563:[1,340],564:[1,343],565:[1,344],566:[1,345],567:[1,346],568:[1,347],569:[1,348],570:[1,349],571:[1,350],572:[1,351],573:[1,352],574:[1,353],575:[1,354],576:[1,355],577:[1,356],578:[1,357],579:[1,358],580:[1,359],581:[1,360],582:[1,361],583:[1,362],584:[1,363],585:[1,364],586:[1,365],587:[1,366],588:[1,367],589:[1,368],590:[1,369],591:[1,370],592:[1,371],593:[1,372],594:[1,374],595:[1,375],596:[1,376],597:[1,377],598:[1,378],599:[1,379],600:[1,380],601:[1,381],602:[1,382],603:[1,383],604:[1,384],605:[1,385],606:[1,386],607:[1,387],608:[1,388],609:[1,389],610:[1,390],611:[1,391],612:[1,392],613:[1,393],614:[1,394],615:[1,395],616:[1,396],617:[1,397],618:[1,398],619:[1,400],620:[1,401],621:[1,402],622:[1,403],623:[1,405],624:[1,406],625:[1,408],626:[1,409],627:[1,410],628:[1,412],629:[1,413],630:[1,414],631:[1,415],632:[1,416],633:[1,417],634:[1,419],635:[1,420],636:[1,421],637:[1,422],638:[1,423],639:[1,424],640:[1,425],641:[1,426],642:[1,427],643:[1,428],644:[1,429],645:[1,430],646:[1,431],647:[1,432],648:[1,433],649:[1,434],650:[1,435],651:[1,436],652:[1,437],653:[1,438],654:[1,440],655:[1,441],656:[1,444],657:[1,445],658:[1,446],659:[1,447],660:[1,449],661:[1,450],662:[1,451],663:[1,452],664:[1,453],665:[1,454],666:[1,455],667:[1,456],668:[1,457],669:[1,458],670:[1,459],671:[1,460],672:[1,461],673:[1,463],674:[1,464],675:[1,465],676:[1,466],677:[1,467],678:[1,468],679:[1,469],680:[1,470],681:[1,472],682:[1,473],683:[1,474],684:[1,475],685:[1,476],686:[1,477],687:[1,478],688:[1,479],689:[1,480],690:[1,481],691:[1,482],692:[1,483],693:[1,484],694:[1,485],695:[1,486],696:[1,487],697:[1,488],698:[1,489],699:[1,490],700:[1,491],701:[1,492],702:[1,493],703:[1,494],704:[1,495],705:[1,496],706:[1,497],707:[1,498],708:[1,499],709:[1,500],710:[1,501],711:[1,502],712:[1,503],713:[1,504],714:[1,505],715:[1,506],716:[1,507],717:[1,508],718:[1,510],719:[1,511],720:[1,512],721:[1,513],722:[1,514],723:[1,515],724:[1,516],725:[1,517],726:[1,518],727:[1,519],728:[1,520],729:[1,521],730:[1,522],731:[1,523],732:[1,524],733:[1,526],734:[1,527],735:[1,528],736:[1,529],737:[1,530],738:[1,531],739:[1,532],740:[1,533],741:[1,534],742:[1,535],743:[1,536],744:[1,537],745:[1,538],746:[1,539],747:[1,540],748:[1,541],749:[1,542],750:[1,543],751:[1,544],752:[1,545],753:[1,546],754:[1,547],755:[1,548],756:[1,550],757:[1,551],758:[1,552],759:[1,553],760:[1,554],761:[1,555],762:[1,556],763:[1,557]},{1:[2,6]},t(X,r,{17:5,18:7,19:8,20:9,21:10,22:11,23:12,24:13,25:14,26:15,27:16,28:17,29:18,30:19,31:20,32:21,33:22,34:23,35:24,36:25,37:26,38:27,39:28,40:29,41:30,42:31,43:32,44:33,45:34,46:35,47:36,48:37,49:38,50:39,51:40,52:41,54:43,55:44,56:45,57:46,58:47,59:48,60:49,61:50,62:51,63:52,64:53,65:54,66:55,67:56,68:57,69:58,70:59,71:60,79:75,504:95,184:99,3:100,12:558,2:n,4:a,5:s,53:o,72:u,89:c,124:l,146:h,156:d,189:f,266:p,267:b,290:E,335:g,338:m,339:v,396:S,400:T,401:y,404:N,406:C,408:R,409:O,417:I,418:x,434:D,436:k,437:L,439:$,440:M,441:U,442:_,443:F,447:P,448:q,451:G,452:V,505:B,507:j,508:H,517:J}),t(ut,[2,1041]),t(ut,[2,1042]),t(X,[2,10]),{16:[1,559]},{2:n,3:244,4:a,5:s,199:560},{405:[1,561]},t(K,[2,760]),{77:ct},{77:[1,563]},{77:lt},{77:[1,565]},{77:[1,566]},{2:n,3:168,4:a,5:s,56:165,77:ie,94:567,111:149,113:153,131:oe,132:ue,137:ce,143:le,144:161,145:he,149:de,152:fe,154:pe,156:Q,158:167,179:be,180:Ee,181:ge,196:151,200:147,201:155,202:156,254:150,255:146,256:148,257:152,258:154,259:157,260:158,261:159,262:162,263:163,265:me,266:p,270:ve,271:Se,273:Te,280:Ae,281:ye,282:Ne,283:Ce,284:Re,285:Oe,286:we,287:Ie,288:xe,290:z,291:Z,292:ee,293:te,294:De,295:ke,296:Le,297:$e,298:Me,299:Ue,302:_e,303:Fe,312:Pe,317:qe,419:190,420:Ge,424:Ve},t(Be,ht,{350:568,156:dt}),{405:[1,570]},{2:n,3:571,4:a,5:s},{193:[1,572]},{2:n,3:578,4:a,5:s,132:ft,137:pt,143:tt,145:rt,152:bt,183:[1,574],431:585,473:573,474:575,475:576,478:577,482:582,493:579,497:581},{130:[1,589],349:586,353:[1,588],410:[1,587]},{113:591,132:ue,183:[2,1141],296:Le,471:590},t(Et,[2,1135],{465:592,3:593,2:n,4:a,5:s}),{2:n,3:594,4:a,5:s},{4:[1,595]},{4:[1,596]},t(re,[2,502]),t(K,[2,686],{74:[1,597]}),t(gt,[2,687]),{2:n,3:598,4:a,5:s},{2:n,3:244,4:a,5:s,199:599},{2:n,3:600,4:a,5:s},t(Be,mt,{398:601,156:vt}),{405:[1,603]},{2:n,3:604,4:a,5:s},t(Be,mt,{398:605,156:vt}),t(Be,mt,{398:606,156:vt}),{2:n,3:607,4:a,5:s},t(St,[2,1129]),t(St,[2,1130]),t(K,r,{17:5,18:7,19:8,20:9,21:10,22:11,23:12,24:13,25:14,26:15,27:16,28:17,29:18,30:19,31:20,32:21,33:22,34:23,35:24,36:25,37:26,38:27,39:28,40:29,41:30,42:31,43:32,44:33,45:34,46:35,47:36,48:37,49:38,50:39,51:40,52:41,54:43,55:44,56:45,57:46,58:47,59:48,60:49,61:50,62:51,63:52,64:53,65:54,66:55,67:56,68:57,69:58,70:59,71:60,79:75,504:95,184:99,3:100,12:608,114:625,327:637,2:n,4:a,5:s,53:o,72:u,89:c,99:Tt,112:At,115:yt,116:Nt,123:Ct,124:Rt,133:Ot,136:wt,138:It,139:xt,140:Dt,141:kt,142:Lt,146:h,154:$t,156:d,170:Mt,171:Ut,179:_t,180:Ft,189:f,266:p,267:b,290:E,311:Pt,312:qt,313:Gt,315:Vt,316:Bt,317:jt,318:Ht,319:Jt,320:Yt,321:Wt,322:Xt,323:Kt,324:Qt,325:zt,326:Zt,330:er,331:tr,332:rr,333:nr,335:g,338:m,339:v,396:S,400:T,401:y,404:N,406:C,408:R,409:O,417:I,418:x,434:D,436:k,437:L,439:$,440:M,441:U,442:_,443:F,447:P,448:q,451:G,452:V,505:B,507:j,508:H,517:J}),t(Qe,[2,288]),t(Qe,[2,289]),t(Qe,[2,290]),t(Qe,[2,291]),t(Qe,[2,292]),t(Qe,[2,293]),t(Qe,[2,294]),t(Qe,[2,295]),t(Qe,[2,296]),t(Qe,[2,297]),t(Qe,[2,298]),t(Qe,[2,299]),t(Qe,[2,300]),t(Qe,[2,301]),t(Qe,[2,302]),t(Qe,[2,303]),t(Qe,[2,304]),t(Qe,[2,305]),{2:n,3:168,4:a,5:s,26:654,27:653,36:649,40:648,56:165,77:ie,79:75,89:c,94:651,111:149,113:153,131:oe,132:ue,137:ce,143:le,144:161,145:he,149:de,152:fe,154:pe,156:Q,158:167,179:be,180:Ee,181:ge,184:99,189:f,196:151,200:147,201:155,202:156,254:150,255:146,256:148,257:152,258:154,259:157,260:158,261:159,262:162,263:163,264:650,265:me,266:p,267:[1,655],270:ve,271:Se,273:Te,280:Ae,281:ye,282:Ne,283:Ce,284:Re,285:Oe,286:we,287:Ie,288:xe,290:[1,652],291:Z,292:ee,293:te,294:De,295:ke,296:Le,297:$e,298:Me,299:Ue,302:_e,303:Fe,312:Pe,317:qe,339:v,419:190,420:Ge,424:Ve},t(Qe,[2,309]),t(Qe,[2,310]),{77:[1,656]},t([2,4,5,10,53,72,74,76,78,89,93,95,98,99,107,112,115,118,122,123,124,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,148,149,150,152,154,156,162,164,166,168,169,170,171,172,173,175,179,180,181,183,185,187,189,198,206,208,222,223,224,225,226,227,228,229,232,239,242,243,245,247,266,267,280,281,282,283,284,285,286,287,288,290,296,300,306,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,330,331,332,333,335,338,339,396,400,401,404,406,408,409,417,418,420,424,434,436,437,439,440,441,442,443,447,448,451,452,464,470,505,507,508,517,602,764],ar,{77:ct,116:[1,657]}),{2:n,3:168,4:a,5:s,56:165,77:ie,94:658,111:149,113:153,131:oe,132:ue,137:ce,143:le,144:161,145:he,149:de,152:fe,154:pe,156:Q,158:167,179:be,180:Ee,181:ge,196:151,200:147,201:155,202:156,254:150,255:146,256:148,257:152,258:154,259:157,260:158,261:159,262:162,263:163,265:me,266:p,270:ve,271:Se,273:Te,280:Ae,281:ye,282:Ne,283:Ce,284:Re,285:Oe,286:we,287:Ie,288:xe,290:z,291:Z,292:ee,293:te,294:De,295:ke,296:Le,297:$e,298:Me,299:Ue,302:_e,303:Fe,312:Pe,317:qe,419:190,420:Ge,424:Ve},{2:n,3:168,4:a,5:s,56:165,77:ie,94:659,111:149,113:153,131:oe,132:ue,137:ce,143:le,144:161,145:he,149:de,152:fe,154:pe,156:Q,158:167,179:be,180:Ee,181:ge,196:151,200:147,201:155,202:156,254:150,255:146,256:148,257:152,258:154,259:157,260:158,261:159,262:162,263:163,265:me,266:p,270:ve,271:Se,273:Te,280:Ae,281:ye,282:Ne,283:Ce,284:Re,285:Oe,286:we,287:Ie,288:xe,290:z,291:Z,292:ee,293:te,294:De,295:ke,296:Le,297:$e,298:Me,299:Ue,302:_e,303:Fe,312:Pe,317:qe,419:190,420:Ge,424:Ve},{2:n,3:168,4:a,5:s,56:165,77:ie,94:660,111:149,113:153,131:oe,132:ue,137:ce,143:le,144:161,145:he,149:de,152:fe,154:pe,156:Q,158:167,179:be,180:Ee,181:ge,196:151,200:147,201:155,202:156,254:150,255:146,256:148,257:152,258:154,259:157,260:158,261:159,262:162,263:163,265:me,266:p,270:ve,271:Se,273:Te,280:Ae,281:ye,282:Ne,283:Ce,284:Re,285:Oe,286:we,287:Ie,288:xe,290:z,291:Z,292:ee,293:te,294:De,295:ke,296:Le,297:$e,298:Me,299:Ue,302:_e,303:Fe,312:Pe,317:qe,419:190,420:Ge,424:Ve},{2:n,3:168,4:a,5:s,56:165,77:ie,94:661,111:149,113:153,131:oe,132:ue,137:ce,143:le,144:161,145:he,149:de,152:fe,154:pe,156:Q,158:167,179:be,180:Ee,181:ge,196:151,200:147,201:155,202:156,254:150,255:146,256:148,257:152,258:154,259:157,260:158,261:159,262:162,263:163,265:me,266:p,270:ve,271:Se,273:Te,280:Ae,281:ye,282:Ne,283:Ce,284:Re,285:Oe,286:we,287:Ie,288:xe,290:z,291:Z,292:ee,293:te,294:De,295:ke,296:Le,297:$e,298:Me,299:Ue,302:_e,303:Fe,312:Pe,317:qe,419:190,420:Ge,424:Ve},{2:n,3:168,4:a,5:s,56:165,77:ie,94:662,111:149,113:153,131:oe,132:ue,137:ce,143:le,144:161,145:he,149:de,152:fe,154:pe,156:Q,158:167,179:be,180:Ee,181:ge,196:151,200:147,201:155,202:156,254:150,255:146,256:148,257:152,258:154,259:157,260:158,261:159,262:162,263:163,265:me,266:p,270:ve,271:Se,273:Te,280:Ae,281:ye,282:Ne,283:Ce,284:Re,285:Oe,286:we,287:Ie,288:xe,290:z,291:Z,292:ee,293:te,294:De,295:ke,296:Le,297:$e,298:Me,299:Ue,302:_e,303:Fe,312:Pe,317:qe,419:190,420:Ge,424:Ve diff --git a/src/38query.js b/src/38query.js index ffec5bf169..f2f50b5308 100755 --- a/src/38query.js +++ b/src/38query.js @@ -424,10 +424,13 @@ function doLimit (query) { // console.log(query.limit, query.offset) if(query.limit) { var offset = 0; - if(query.offset) offset = ((query.offset|0)-1)||0; + if(query.offset){ + offset = (query.offset|0)||0; + offset = offset<0 ? 0 : offset; + } var limit; if(query.percent) { - limit = ((query.data.length*query.limit/100)| 0)+offset; + limit = ((query.data.length*query.limit/100)|0)+offset; } else { limit = (query.limit|0) + offset; } diff --git a/test/test030.js b/test/test030.js index b102bc1678..2ba2aaa38b 100644 --- a/test/test030.js +++ b/test/test030.js @@ -25,7 +25,7 @@ describe('Test 30', function() { var sql = 'SELECT COLUMN a FROM test1 LIMIT 3 OFFSET 2'; var res = db.exec(sql); - assert.deepEqual([ 2,3,4 ], res); + assert.deepEqual([ 3,4,5 ], res); done(); }); diff --git a/test/test035.js b/test/test035.js index eaf4362f34..40b4aae4ed 100644 --- a/test/test035.js +++ b/test/test035.js @@ -25,7 +25,7 @@ describe('Test 35 - LIMIT OFFSET', function() { var sql = 'SELECT COLUMN a FROM test1 LIMIT 3 OFFSET 2'; var res = db.exec(sql); - assert.deepEqual([ 2,3,4 ], res); + assert.deepEqual([ 3,4,5 ], res); done(); }); @@ -49,7 +49,7 @@ describe('Test 35 - LIMIT OFFSET', function() { var sql = 'SELECT COLUMN a FROM test1 LIMIT 5 OFFSET 2'; var res = alasql(sql); - assert.deepEqual([ 2,3,4,5,6 ], res); + assert.deepEqual([ 3,4,5,6,7 ], res); alasql('drop database test35'); done(); diff --git a/test/test368.js b/test/test368.js index 4c9db7a6c6..867a06deb3 100644 --- a/test/test368.js +++ b/test/test368.js @@ -25,16 +25,16 @@ describe('Test 368 OFFSET ... LIMIT', function() { it('OFFSET LIMIT',function(done){ var res = alasql('SELECT * FROM ? LIMIT 2 OFFSET 3',[data]); - assert.deepEqual(res,[ { a: 3 }, { a: 4 } ]); + assert.deepEqual(res,[ { a: 4 }, { a: 5 } ]); done(); }); it('OFFSET FETCH',function(done){ var res = alasql('SELECT * FROM ? OFFSET 3 FETCH 2',[data]); - assert.deepEqual(res,[ { a: 3 }, { a: 4 } ]); + assert.deepEqual(res,[ { a: 4 }, { a: 5 } ]); var res = alasql('SELECT * FROM ? OFFSET 3 ROWS FETCH NEXT 2 ROWS ONLY',[data]); - assert.deepEqual(res,[ { a: 3 }, { a: 4 } ]); + assert.deepEqual(res,[ { a: 4 }, { a: 5 } ]); done(); });