[Maria-developers] Dynamic columns support in libmaria client library?
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
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@webyog.com> 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
Hi, Peter! On Dec 30, Peter Laursen wrote:
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!
Agree, these could be useful. On the other hand, virtual columns were implemented in MariaDB-5.2, in 2010. And in these almost five years nobody ever requested these features for SHOW and I_S, as far as I remember. So, I don't believe I can be a judge of what is useful and what is not, I got it wrong oh so many times. Do you need these SHOW/I_S extensions? Please, create an issue in Jira for them, if you do. Regards, Sergei
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
*/
Is it not possible to have a reply here? --Peter On Fri, Dec 26, 2014 at 1:28 PM, Peter Laursen <peter_laursen@webyog.com> 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
Hi! On 27.01.15 21:09, Peter Laursen wrote: [skip]
Now can ma_dyncol.h be linked against libmaria as well?
There are 2 questions actually 1) technical: will it work with libmaria?
yes it should
2) legal: can a client program using libmaria under LGPL license include ma_dyncol.h?
ma_dyncol.h & ma_dyncol.c are not GPL (see files) so I'd say yes (but I have to admit that I am not lawyer so I am sure only 99%). [skip]
Can't we then have LGPL *clones* bundled with libmariadb? -- Peter On Tue, Jan 27, 2015 at 11:51 PM, Oleksandr Byelkin <sanja@montyprogram.com> wrote:
Hi!
On 27.01.15 21:09, Peter Laursen wrote: [skip]
Now can ma_dyncol.h be linked against libmaria as well?
There are 2 questions actually 1) technical: will it work with libmaria?
yes it should
2) legal: can a client program using libmaria under LGPL license include ma_dyncol.h?
ma_dyncol.h & ma_dyncol.c are not GPL (see files) so I'd say yes (but I
have to admit that I am not lawyer so I am sure only 99%).
[skip]
participants (3)
-
Oleksandr Byelkin
-
Peter Laursen
-
Sergei Golubchik