[MDEV-4855] No servid special column in ConnectSE Created: 2013-08-08  Updated: 2013-08-09  Resolved: 2013-08-09

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.3
Fix Version/s: 10.0.5

Type: Bug Priority: Major
Reporter: erkan yanar Assignee: Olivier Bertrand
Resolution: Fixed Votes: 0
Labels: connect-engine
Environment:

Ubuntu/Presice/LXContainer



 Description   

ConnectSE ships with special columns. I.e. tabid and servid.
Given:

CREATE TABLE `federatedconnect` (
  `id` int(11) NOT NULL,
  `id2` int(11) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='mysql' `TABNAME`='aha' `DBNAME`='test' `OPTION_LIST`='user=me,host=10.0.3.191'

We build a table_type=tbl table with the special column tabid

 CREATE TABLE `federatedconnect_s` (
  `server` char(20) NOT NULL DEFAULT 'nix' `special`=tabid,
  `id` int(11) NOT NULL,
  `id2` int(11) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='tbl' `table_list`='federatedconnect' 

MariaDB [test]> select * from federatedconnect_s limit 1;
+------------------+----+------+
| server           | id | id2  |
+------------------+----+------+
| federatedconnect |  5 | NULL |
+------------------+----+------+
1 row in set (0.00 sec)

Ok that works as expected. Now use the special column servid.

CREATE TABLE `federatedconnect_s` (
  `server` char(20) NOT NULL DEFAULT 'nix' `special`=servid,
  `id` int(11) NOT NULL,
  `id2` int(11) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='tbl' `table_list`='federatedconnect' 

MariaDB [test]> select * from federatedconnect_s limit 1;
ERROR 1296 (HY000): Got error 174 'Column *SERVID not found in federatedconnect_s' from CONNECT

So servid is not there to be used.
Regards
Erkan



 Comments   
Comment by Elena Stepanova [ 2013-08-08 ]

SERVID is documented here: https://kb.askmonty.org/en/using-connect-virtual-and-special-columns/ , and also mentioned here: https://kb.askmonty.org/en/connect-table-types-using-the-tbl-and-mysql-types-together/

If it's not supported, it should be removed from documentation.

Comment by Olivier Bertrand [ 2013-08-09 ]

Sure enough. The documentation is optimistic as SERVID is not yet fully implemented.
It will be, I am working on it.

Comment by Olivier Bertrand [ 2013-08-09 ]

SERVID is now implemented. For most table types it returns "Current". For ODBC tables it returns "ODBC".
It is mainly useful for MYSQL tables. If they are created using a federated server, it returns the federated server name. Otherwise, it returns the host name of the used server.
Note that for PROXY and PROXY based table, it returns the SERVID of the source table(s).

Generated at Thu Feb 08 06:59:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.