Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run demo #14

Open
wehowski opened this issue Sep 30, 2016 · 1 comment
Open

Cannot run demo #14

wehowski opened this issue Sep 30, 2016 · 1 comment

Comments

@wehowski
Copy link

The demo sql cannot be parsed at my test:
webfan.de/cdn/application/test/nquery.html

"id" in the query throws an error:

module.exports.result.SyntaxError
column
:
29
expected
:
Array[10]
0
:
"",""
1
:
""GROUP""
2
:
""INNER""
3
:
""JOIN""
4
:
""LEFT""
5
:
""LIMIT""
6
:
""ORDER""
7
:
""UNION""
8
:
""WHERE""
9
:
"[ \t\n\r]"
length
:
10
proto
:
Array[0]
found
:
"i"
line
:
1
message
:
"Expected ",", "GROUP", "INNER", "JOIN", "LEFT", "LIMIT", "ORDER", "UNION", "WHERE" or [ \t\n\r] but "i" found."
name
:
"SyntaxError"
offset
:
28

@wehowski
Copy link
Author

I got my own examples running by commenting out throwing the error if pos!=input.length.

However, still lot todo depending on the storage/loader.

Joins still producing wrong results?

    function doSelectFilter(dc, ar) {

  var ast = ar.getAst();
  var DB = ar.getDB();   
  var type = ar.getType();



  var tbName  = ar.getTableOrig();
  var tbAlias = ar.getTableAlias();
  var tbl = new Table(dc[DB][tbName]);
  tbl = tbl.get(tbName, tbAlias);   
  if(1<ast.from.length){
      frdl.each(ast.from, function(i, t){
              if(t.join){
                   var db2 = t.db;
                   var tbName2  = t.table;
                   var tbAlias2 = t.as;
                   var tbl2 = new Table(dc[db2][tbName2]);
                   tbl2 = tbl2.get(tbName2, tbAlias2); 
                   tbl = doJoin(tbl, tbl2, t.join, t.on );
              }
      });       
  }   

  return select(tbl, ar);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant