Uploaded image for project: 'Runtime'
  1. Runtime
  2. RUNTIME-3492

Error on Groups requests because Groups can be MySQL reserved keyword

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 4.4.0
    • 4.3.6
    • None
    • None
    • Ubuntu 20.04
      MySQL Server version: 8.0.21-0ubuntu0.20.04.4 (Ubuntu)
    • 4.4 RC3

      In some MySQL versions, Groups can be a reserved keyword. But Groups is also the default Groups directory name when creating a new Group directory base on MySQL Database.

      In MySQL syntax if a reserved keyword is used as a table name it has to be between `` (Select * from  `my_table`).

      But currently in Ametys some Requests are done on Groups directory table without using ```and it raises an error when tring to display List of Groups for example :

      Emplacement : org.ametys.plugins.core.impl.group.directory.jdbc.JdbcGroupDirectory.getGroups(JdbcGroupDirectory.java:330)
      
      Pile d'appels :
      com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Groups ORDER BY Label' at line 1
      at jdk.internal.reflect.GeneratedConstructorAccessor245.newInstance(Unknown Source)
      at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
      at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
      at com.mysql.jdbc.Util.getInstance(Util.java:408)
      

       

       

            raphael Raphaël Franchet
            dcartier David Cartier-Michaud
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: