ALTER VIEW

Overview

Modifies view characteristics, including the view algorithm, name, and definer.

USAGE

Common Syntax:

ALTER VIEW
  [DEFINER = { user | CURRENT_USER }]
  [SQL SECURITY { DEFINER | INVOKER }]

DETAILS

MariaDB Xpand's ALTER VIEW statement has some differences from MariaDB Enterprise Server:

  • The DEFINER = user clause is ignored

  • The SQL SECURITY { DEFINER | INVOKER } clause is ignored

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

ALTER VIEW

To change the definition for a view in the currently selected database:

ALTER
   VIEW 2022_01_invoices AS
      SELECT invoice_id FROM invoices
      WHERE MONTH(invoice_date) = 1 AND YEAR(invoice_date) = 2022;

Change the Algorithm

To change the algorithm used to process the view:

ALTER
   ALGORITHM = MERGE
   VIEW 2022_01_invoices AS
      SELECT * FROM invoices
      WHERE MONTH(invoice_date) = 1 AND YEAR(invoice_date) = 2022;

Change the Security Context

MariaDB Xpand supports the SQL SECURITY clause for compatibility, but the specified security context is ignored:

ALTER
   SQL SECURITY INVOKER
   VIEW 2022_01_invoices AS
      SELECT * FROM invoices
      WHERE MONTH(invoice_date) = 1 AND YEAR(invoice_date) = 2022;

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES