Skip to content

Hole matching in parser is too greedy #4

@mahills

Description

@mahills

If I run the following in the SCAM2017Demo module:

rascal>showQueriesForNumberedCall(1,15);

I see the following results:

$2017-06-22T01:54:40.861+00:00$ :: Loading binary: |home:///PHPAnalysis/serialized/parsed/AddressBook-8.2.5.2.pt|
Now parsing select * from ?0 AND group_name = '?1'

rel[SQLYield yield,str queryWithHoles,SQLQuery parsed]: {<[
    staticPiece("select * from "),
    namePiece("groups_from_where"),
    staticPiece(" AND group_name = \'"),
    namePiece("to_group"),
    staticPiece("\'")
  ],"select * from ?0 AND group_name = \'?1\'",selectQuery(
    [star()],
    [hole(1)],
    noWhere(),
    noGroupBy(),
    noHaving(),
    noOrderBy(),
    noLimit(),
    [])>}
rascal>

Note that the AND group_name ... part should be in the WHERE clause. This is obviously going to be hard to parse, there is no WHERE keyword, but it may be worth putting the following text somewhere, even if it is just in a "we don't know what part of the query this is" bin.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions