← Back to team overview

maria-developers team mailing list archive

Re: [Maria-discuss] Reqeust for SHOW FULL FIELDS FROM and virtual tables in MariaDB

 

Hi Peter, all

> From: "Peter Laursen" <peter_laursen@xxxxxxxxxx>
> 
> Refer http://kb.askmonty.org/v/virtual-columns - the example
> 
> CREATE TABLE table1 (
> a INT NOT NULL,
> b VARCHAR(32),
> c INT AS (a MOD 10) virtual,
> d VARCHAR(5) AS (LEFT(b,5)) persistent);
> 
> now
> 
> SHOW FULL FIELDS FROM table1;
> 
> Field Type Collation Null Key Default Extra Privileges Comment
> ------ ----------- ----------------- ------ ------ ------- -------
> ------------------------------- -------
> a int(11) (NULL) NO (NULL) select,insert,update,references
> b varchar(32) latin1_swedish_ci YES (NULL)
> select,insert,update,references
> c int(11) (NULL) YES (NULL) VIRTUAL select,insert,update,references
> d varchar(5) latin1_swedish_ci YES (NULL) VIRTUAL
> select,insert,update,references
> 
> I request that 'extra' column should return either "PERSISTENT" or "
> VIRTUAL, PERSISTENT" for column `d`. The reason is that the output
> from SHOW FULL FIELDS returns an *array* (that will not need to be
> parsed) as opposite to SHOW CREATE TABLE. Accordingly SHOW FULL
> FIELDS is much easier to use for an 'unintelligent client' as
> opposed to an 'intelligent (or ignorant for that sake :-) ) human
> user to decide on special properties for a column.

I'm for this.
Perhaps use BASE rather than PERSISTENT, in line with views & base tables - since it's similar stuff.
And of course SHOW FULL TABLES will show "BASE TABLE" and "VIEW" already.

Cheers,
Arjen.


Follow ups

References