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

WITH statement throws 'no database selected' error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.2, 10.3, 10.3.7
    • Fix Version/s: 10.2.17
    • Component/s: Optimizer - CTE
    • Labels:
      None
    • Environment:
      Windows

      Description

      • Create a table `user`.`users` with a couple of columns.
      • Execute, without having selected a database (through USE statement) the following query:
        WITH
        abc AS (SELECT * FROM user.users)
        SELECT * FROM abc
      • Now you will get the error '1046 No database selected'.

      On MySQL you don't get this error so I guess it only happens on MariaDB.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              igor Igor Babaev
              Reporter:
              user2180613 Remy Fox
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: