Comments - Generated (Virtual and Persistent/Stored) Columns

13 years, 5 months ago Thomas B.

Are subqueries supported?

CREATE TABLE `table1` ( `a` int(11) NOT NULL, `b` varchar(32) DEFAULT NULL, `d` varchar(5) AS (SELECT count(*) from table2) PERSISTENT )

 
13 years, 5 months ago Henrik Ingo

According to Andrey Zhakov's description on MySQL Forge, subqueries are not allowed, but this information is missing from this article.

As a general heuristic, you can also consider that the calculation used for virtual columns must be deterministic. A subquery based on some other data is not deterministic, as the underlying data can change.

 
12 years ago Jan Steinman

Do you know of any support for this (and other cool MariaDB features) in third-party tools? Or are we limited to CLI use?

I note that Sequel Pro lets me see the results after entering a CREATE TABLE manually, but there's no way to manipulate the virtual/persistent column definitions.

Any interest in a phpMyAdmin hack to at least partially support this?

 
12 years ago Daniel Bartholomew

It's really up to the tool authors. We would love for them to support our entire feature set. Over time I'm sure they will, especially if their users request it. :)

On Windows I know HeidiSQL, which we ship with the Windows version of MariaDB, does support some MariaDB features such as pluggable authentication (I don't know if they support virtual columns).

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.