Uploaded image for project: 'Hibernate ORM'
  1. Hibernate ORM
  2. HHH-9711

Wrong SQL generated for delete with where crossing tables (derby, although hsqldb ALSO broken :()

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.3.8, 5.0.1, 5.0.6
    • Fix Version/s: None
    • Component/s: hibernate-core
    • Environment:
      derby 10.11.1.1 and 10.7.1.1 both
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true

      Description

      I'm trying to run this query:

      delete StoredMessagePendingClient m where m.clientId = :clientid and m.message.messageId = :messageid

      This generates the following SQL, which fails under derby because derby doesn't accept two tables seperated by a comma (I'm anyway not trying to delete from both tables, only from the first one, so that SQL is wrong).

      Hibernate: delete from MESSAGES_PENDINGCLIENT, MESSAGES storedmess1_ where CLIENT_ID=? and ID=?

      WARN: SQL Error: 20000, SQLState: 42X01
      Apr 05, 2015 5:32:05 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
      ERROR: Syntax error: Encountered "," at line 1, column 35.

      Also note the same query also fails under hsqldb for different reasons (going to create another issue for it) so it's REALLY annoying

        Attachments

          Issue links

            Activity

              People

              • Votes:
                4 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated: