Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-19990

JOIN USING not behaving like 'equals'

    Details

      Description

      Since 10.3 (I believe), the following query returns EMPTY set:

      SELECT k.TABLE_NAME, k.COLUMN_NAME, k.CONSTRAINT_NAME, k.REFERENCED_TABLE_NAME, k.REFERENCED_COLUMN_NAME, r.DELETE_RULE, r.UPDATE_RULE FROM information_schema.REFERENTIAL_CONSTRAINTS r JOIN information_schema.KEY_COLUMN_USAGE k USING (CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME)
      

      But if I expand the USING into 'equals', it returns proper results:

      SELECT k.TABLE_NAME, k.COLUMN_NAME, k.CONSTRAINT_NAME, k.REFERENCED_TABLE_NAME, k.REFERENCED_COLUMN_NAME, r.DELETE_RULE, r.UPDATE_RULE FROM information_schema.REFERENTIAL_CONSTRAINTS r JOIN information_schema.KEY_COLUMN_USAGE k on r.CONSTRAINT_CATALOG = k.CONSTRAINT_CATALOG and r.CONSTRAINT_SCHEMA = k.CONSTRAINT_SCHEMA and r.CONSTRAINT_NAME = k.CONSTRAINT_NAME
      

      Tried with "root" and local user.
      Before, it was always returning results with USING.

      I would expect that USING works exactly the same with 'equals' ?

        Attachments

          Activity

            People

            • Assignee:
              varun Varun Gupta
              Reporter:
              nunop Nuno
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: