dbis-uibk / relax

RelaX - a relational algebra calculator
http://dbis-uibk.github.io/relax/
MIT License
280 stars 96 forks source link

Fix undefined i18n in grammar_sql.pegjs #138

Closed danielSbastos closed 2 years ago

danielSbastos commented 3 years ago

Hello,

This PR fixes the bug that caused the i18n to be undefined in some scenarios. i18n is not defined in grammar_sql.pegjs without a namespace, but instead as options.i18n or through the t function defined at the beginning.

https://github.com/dbis-uibk/relax/blob/f1805b6ae5c3f39c9eae92d6e2dc1dabca04d595/src/db/parser/grammar_sql.pegjs#L7-L17

The file changed was grammar_sql.pegjs, I don't know if this file was generated and if I should fix this bug somewhere else, so please let me know if this is the case.

Reproducing the error

image

The open issue #134 can be used to reproduce the error. Another way to reproduce it is with the following steps:

1) Select the IMDB database 2) Select the SQL option 3) Paste the SQL Query

SELECT
  genre,
  COUNT(movie_id) as ct_movies
FROM
  movies_genres

4) The error message shown is I18n is not defined, and not the correct one, group by is missing

danielSbastos commented 3 years ago

Hey, @michaelrampl, mind taking a look at this PR? Thanks