datacamp / antlr-plsql

GNU Affero General Public License v3.0
17 stars 14 forks source link

grammar bug: a INNER JOIN b has incorrect join_type #27

Closed machow closed 6 years ago

machow commented 6 years ago

From the table_ref rule, antlr thinks that INNER is the table alias (e.g. a INNER). I think the simplest way to fix this is to add a new matching rule to table_ref that matches a non-aliased table followed by a join.

https://github.com/datacamp/antlr-plsql/blob/master/antlr_plsql/plsql.g4#L955

filipsch commented 6 years ago

This is an issue in the 'joining data in postgresql course', when non-aliased inner joins are checked. In the past, this failed silently: when the student_ast ended up being none, has_equal_ast would just do repr(None) == repr(None), which passes. Because of this change, however, there is now an explicit fail (and it should be there) and the postgresql course fails with the latest shared sql image that I want to deploy.

I will disable some tests in the postgresql course until this is fixed, because they are currently not doing anything meaningful anyways. cc @ismayc