WL#1150: Add support for database links

Affects: Server-7.1   —   Status: Un-Assigned

At some point we shall allow to query remote tables from the server, by using so
called database links:
That would be good first step to distributed databases.

Syntax from Oracle:

create database link  for . connect as 
identified by ;

We shall probably allow linking single tables as well as whole databases.

At some point it would be good to allow connecting to tables located on other
tables (ie by using ODBC) but that is lower priority.

Things to take into account:
  - locking semantics (that is reasonably easy with MyISAM table locks concept, 
    but harder in case of more complex locking strategies) 
  - Transactions - we'll need to have 2 phase commit to have it safe
  - Replication - as some tables can be mapped from Master we need a way
    to skip them. Complete solution requires row level logging.


It could be very convenient to use this together with replication, using table
which you really need to be actual, linked from Master, while the rest from slave.

P.S Based on Feature request BUG#1057