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

PREPARE doesn't work as expected & throws errors but MySQL is working fine

Details

    Description

      In some cases (see attached files for two simple examples) an SQL query with PREPARE gives me an error message instead of a result set. I think this queries should work and if I execute the exact same queries on MySQL 5.7.18 (subselect example) or MySQL 8.0.2 (subselect and CTE examples) it is working fine and as excepted. So I think there may be an Bug with MariaDB?

      This occurs only with PREPARE. If I'm running this directly (without PREPARE) it is working fine too with MariaDB.
      If I change the "max(1)" to "ceil(1)" in my subselect example it is working fine altogether (PREPARE and MariaDB).

      The error messages are included in the examples.
      It would be nice if you can double check my examples and maybe fix it in a future version?

      Attachments

        Issue Links

          Activity

            ralfnie Ralf Niedermayer created issue -
            serg Sergei Golubchik made changes -
            Field Original Value New Value
            Summary PREPARE doesn't work as aspected & throws errors but MySQL is working fine PREPARE doesn't work as expected & throws errors but MySQL is working fine
            serg Sergei Golubchik made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            elenst Elena Stepanova made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            elenst Elena Stepanova made changes -
            Component/s Data Manipulation - Subquery [ 10107 ]
            Component/s Optimizer - CTE [ 13513 ]
            Component/s Views [ 10111 ]
            Fix Version/s 10.2 [ 14601 ]
            Affects Version/s 10.2 [ 14601 ]
            Affects Version/s 10.1.25 [ 22542 ]
            Assignee Oleksandr Byelkin [ sanja ]
            Labels 10.2-ga Compatibility optimizer optimizer
            sanja Oleksandr Byelkin made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            sanja Oleksandr Byelkin made changes -
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Igor Babaev [ igor ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            igor Igor Babaev (Inactive) made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            igor Igor Babaev (Inactive) made changes -
            Assignee Igor Babaev [ igor ] Oleksandr Byelkin [ sanja ]
            sanja Oleksandr Byelkin made changes -
            Fix Version/s 10.2.9 [ 22611 ]
            Fix Version/s 10.3.2 [ 22533 ]
            Fix Version/s 10.2 [ 14601 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            sanja Oleksandr Byelkin made changes -
            Component/s Optimizer - CTE [ 13513 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 81894 ] MariaDB v4 [ 152558 ]

            People

              sanja Oleksandr Byelkin
              ralfnie Ralf Niedermayer
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.