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

different behaviour with "INTO @var1" for MySQL and MariaDB

Details

    • New Feature
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None

    Description

      MySQL 5.7
       
      mysql> (SELECT 1 INTO @var1);
      Query OK, 1 row affected (0.00 sec)
      

      MariaDB (tested with 10.4 and 10.8)
       
      MariaDB [d1]> (SELECT 1 INTO @var1);
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'into @var1)' at line 1
      

      Attachments

        Activity

          what kind of behavior do you expect from

          select 1+(select 1 into @var1);
          

          ?

          serg Sergei Golubchik added a comment - what kind of behavior do you expect from select 1+( select 1 into @var1); ?

          This is not a bug. The correct standard syntax is

          <select statement: single row> ::=
            SELECT [ <set quantifier> ] <select list>
                INTO <select target list>
                <table expression>
          

          and that's what MariaDB implements. Extending the syntax to support optional parentheses around the whole statement could be possible, but it'd be a feature, not a bug fix.

          I'll change the issue to a "task" as it's a valid feature request

          serg Sergei Golubchik added a comment - This is not a bug. The correct standard syntax is <select statement: single row> ::= SELECT [ <set quantifier> ] <select list> INTO <select target list> <table expression> and that's what MariaDB implements. Extending the syntax to support optional parentheses around the whole statement could be possible, but it'd be a feature, not a bug fix. I'll change the issue to a "task" as it's a valid feature request

          People

            ralf.gebhardt Ralf Gebhardt
            Richard Richard Stracke
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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