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

ALTER VIEW not replicated in some cases

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.0.20-galera
    • Fix Version/s: 10.0.21-galera, 5.5.45-galera
    • Component/s: Galera, Views
    • Labels:
      None
    • Environment:
      3 MariaDB Galera nodes v10.0.20 on Gentoo Linux

      Description

      I've tried to change the DEFINER of a VIEW and therefore executed the following statement on the first node, which has a correct syntax:

      ALTER DEFINER=`someuser`@`localhost` VIEW someview AS <select_statement>
      

      The statement has been replicated to the other nodes as follows:

      ALTER ALGORITHM=DEFINER=`someuser`@`localhost` SQL SECURITY DEFINER VIEW `someview` AS <select_statement>
      

      Which is a incorrect syntax and therefore could not be commited on the other nodes:

      150714 13:06:38 [ERROR] Slave SQL: Error '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 'DEFINER=`someuser`@`localhost` SQL SECURITY DEFINER VIEW `someview' at line 1' on query. Default database: 'somedb'. Query: 'ALTER ALGORITHM=DEFINER=`someuser`@`localhost` SQL SECURITY DEFINER VIEW someview` AS <selectstatement>
      150714 13:06:38 [Warning] WSREP: RBR event 1 Query apply warning: 1, 2546
      150714 13:06:38 [Warning] WSREP: Ignoring error for TO isolated action: source: c7ba1dcd-26e4-11e5-b1d1-c72d7419d838 version: 3 local: 0 state: APPLYING flags: 65 conn_id: 105519 trx_id: -1 seqnos (l: 3740, g:
       2546, s: 2545, d: 2545, ts: 1358234290006683)
      

      A workaround is to explicitly set the algorithm like:

      ALTER ALGORITHM=UNDEFINED DEFINER=`someuser`@`localhost` VIEW someview AS <select_statement>
      

        Gliffy Diagrams

          Attachments

            Activity

            Show
            nirbhay_c Nirbhay Choubey added a comment - https://github.com/MariaDB/server/commit/af2f7ce3f915c4686ef04294b00c6f4885503f5e

              People

              • Assignee:
                nirbhay_c Nirbhay Choubey
                Reporter:
                paescuj Pascal Jufer
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: