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

FR: In PREPARED STATEMENTS impossible to use multiple statements

    Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: Prepared Statements
    • Labels:
      None

      Description

      Example:

      DELIMITER $$
      
      CREATE PROCEDURE `test_dsql`()
      BEGIN
      	PREPARE sql_fn FROM 'select 1; select 2';
      	EXECUTE sql_fn;
      	DEALLOCATE PREPARE sql_fn;
      END$$
      
      DELIMITER ;
      
      Query: call test_dsql()
      
      Error Code: 1064
      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 'select 2' at line 1
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            It's explicitly documented in both MySQL manual and MariaDB KB.

            https://mariadb.com/kb/en/mariadb/prepare-statement/

            The text must represent a single SQL statement, not multiple statements.

            Should we treat it as a feature request?

            Show
            elenst Elena Stepanova added a comment - It's explicitly documented in both MySQL manual and MariaDB KB. https://mariadb.com/kb/en/mariadb/prepare-statement/ The text must represent a single SQL statement, not multiple statements. Should we treat it as a feature request?
            Hide
            mikhail Mikhail Gavrilov added a comment -

            Yes, possible treat it as a feature request?

            Show
            mikhail Mikhail Gavrilov added a comment - Yes, possible treat it as a feature request?
            Hide
            serg Sergei Golubchik added a comment -

            In 10.1 you can prepare compound statement with many statements inside.

            https://mariadb.com/kb/en/mariadb/using-compound-statements-outside-of-stored-programs/

            Show
            serg Sergei Golubchik added a comment - In 10.1 you can prepare compound statement with many statements inside. https://mariadb.com/kb/en/mariadb/using-compound-statements-outside-of-stored-programs/

              People

              • Assignee:
                Unassigned
                Reporter:
                mikhail Mikhail Gavrilov
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: