[MDEV-8464] ALTER VIEW not replicated in some cases Created: 2015-07-14  Updated: 2015-08-14  Resolved: 2015-07-20

Status: Closed
Project: MariaDB Server
Component/s: Galera, Views
Affects Version/s: 10.0.20-galera
Fix Version/s: 10.0.21-galera, 5.5.45-galera

Type: Bug Priority: Critical
Reporter: Pascal Jufer Assignee: Nirbhay Choubey (Inactive)
Resolution: Fixed Votes: 0
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>



 Comments   
Comment by Nirbhay Choubey (Inactive) [ 2015-07-20 ]

https://github.com/MariaDB/server/commit/af2f7ce3f915c4686ef04294b00c6f4885503f5e

Generated at Thu Feb 08 07:27:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.