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

sql_mode=oracle: errors "Undefined CURSOR" AND "check ... right syntax to use near '%"

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not a Bug
    • Affects Version/s: 10.3
    • Fix Version/s: N/A
    • Component/s: Parser
    • Labels:
      None

      Description

      set sql_mode=oracle;
      MariaDB [test]> SELECT 5%5 from dual;
      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 '%5 from dual' at line 1
      MariaDB [test]> wait_timeout:=102411111%1023;
      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 '%1023' at line 1
      MariaDB [test]> select 1 from seq_1_to_2 where seq % 5;
      ERROR 1324 (42000): Undefined CURSOR: seq
      

      Without oracle mode it works properly:

      MariaDB [test]> select 1 from seq_1_to_2 where seq % 5;
      +---+
      | 1 |
      +---+
      | 1 |
      | 1 |
      +---+
      2 rows in set (0.00 sec)
       
      MariaDB [test]> SELECT 5%5;
      +------+
      | 5%5  |
      +------+
      |    0 |
      +------+
      1 row in set (0.00 sec)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                anikitin Andrii Nikitin (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: