maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #08059
Re: Dynamic columns support in libmaria client library?
Compare "generated columns" in MySQL 5.7.5 labs (refer
http://mysqlserverteam.com/generated-columns-in-mysql-5-7-5/). It has
instrumentation in SHOW and I_S. Please admit that this is a bug and an
oversight from MariaDB to forget about this!
Field Type Null Key
select version(); -- 5.7.5-labs-preview
create table comments(
userid int AS (ExtractValue(comment,'/comment/userid')) STORED,
comment TEXT,
KEY(userid));
show columns from comments;
/*Default Extra
------- ------- ------ ------ ------- ---------
userid int(11) YES MUL (NULL) VIRTUAL
comment text YES (NULL)
*/
describe comments;
/*
Field Type Null Key Default Extra
------- ------- ------ ------ ------- ---------
userid int(11) YES MUL (NULL) VIRTUAL
comment text YES (NULL)
*/
show full fields from comments;
/*
Field Type Collation Null Key Default Extra
Privileges Comment
------- ------- ----------------- ------ ------ ------- -------
------------------------------- ---------
userid int(11) (NULL) YES MUL (NULL) VIRTUAL
select,insert,update,references
comment text latin1_swedish_ci YES (NULL)
select,insert,update,references
*/
select * from information_schema.`COLUMNS` where TABLE_NAME = 'comments';
/*
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION
COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH
CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE
DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
GENERATION_EXPRESSION
------------- ------------ ---------- ----------- ----------------
-------------- ----------- --------- ------------------------
---------------------- ----------------- -------------
------------------ ------------------ ----------------- -----------
---------- ------- ------------------------------- --------------
-----------------------------------------
def test comments userid 1
(NULL) YES int (NULL)
(NULL) 10 0 (NULL) (NULL)
(NULL) int(11) MUL VIRTUAL
select,insert,update,references
ExtractValue(comment,'/comment/userid')
def test comments comment 2
(NULL) YES text 65535
65535 (NULL) (NULL) (NULL) latin1
latin1_swedish_ci text
select,insert,update,references
*/
On Fri, Dec 26, 2014 at 1:28 PM, Peter Laursen <peter_laursen@xxxxxxxxxx>
wrote:
> This page
> https://mariadb.com/kb/en/mariadb/documentation/nosql/dynamic-columns-api/
> does not mention anything about it. it just says
>
> *The API is a part of libmysql C client library. In order to use it, one
> needs to include this header file*
> *#include <mysql/ma_dyncol.h>*
> *and link against libmysql.*
>
> Now can ma_dyncol.h be linked against libmaria as well?
>
> There are 2 questions actually
> 1) technical: will it work with libmaria?
> 2) legal: can a client program using libmaria under LGPL license include
> ma_dyncol.h?
>
>
> -- Peter
> -- Webyog
>
Follow ups
References