mariadb/sql/sql_servers.h
unknown 99c5c28c3c BUG#26257 New Federated Server Functionality Doesn't support differently named tables
* Modified Federated memory allocation to use MEM_ROOT
* Modified sql_servers and federated to allocate share connection
  parameters to use MEM_ROOT
* Modified Federated to allow tablename in addition to server name
* Implicit flushing of tables using altered/dropped server name
* Added tests to prove new functionality works

Contributors to this patch: Patrick Galbraith, Antony Curtis


mysql-test/r/federated_server.result:
  BUG #26257 New Federated Server Functionality Doesn't support differently named tables
  
    New test results
mysql-test/t/federated_server.test:
  BUG #26257 New Federated Server Functionality Doesn't support differently named tables
  
  New test which ensures that one can use the new 'create server'
  functionality and have tables point to the correct table, using CONNECTION='server',
  CONNECTION="server/tablename" and CONNECTION="mysql://...url"
sql/mysql_priv.h:
  BUG #26257 New Federated Server Functionality Doesn't support differently named tables
  
  new function: close_cached_connection_tables()
sql/sql_base.cc:
  BUG #26257 New Federated Server Functionality Doesn't support differently named tables
  
  new function: close_cached_connection_tables()
    closes all open tables which match connection string
    provides functionality to allow flushing of altered/dropped server names.
sql/sql_servers.cc:
  BUG #26257 New Federated Server Functionality Doesn't support differently named tables
  
  * Added function clone_server() to allocate a new server for use by
    get_server_by_name() when creating a federated table
  
  * Now using MEM_ROOT allocation (mark and sweep) to account for meta
    data parameters being allocated properly, particularly with regards to
    to SERVER object. Also cleans up code allocating share.
  
  * Tables using the old definition of server name are now flushed on successful
    execution of ALTER/DROP SERVER.
  
  style: fixed some line-wrapping
sql/sql_servers.h:
  BUG #26257 New Federated Server Functionality Doesn't support differently named tables
  
  * change in prototype to get_server_by_name()
    caller can now provide mem_root which strings will be copied in to.
storage/federated/ha_federated.cc:
  BUG #26257 New Federated Server Functionality Doesn't support differently named tables
  
  * Simplified share and share member memory allocaton to use MEM_ROOT
  * Modified parse_url to parse table names along with server names
storage/federated/ha_federated.h:
  BUG #26257 New Federated Server Functionality Doesn't support differently named tables
  
  * Added MEM_ROOT share member
2007-03-24 01:18:19 -07:00

43 lines
1.5 KiB
C

/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "slave.h" // for tables_ok(), rpl_filter
/* structs */
typedef struct st_federated_server
{
char *server_name;
long port;
uint server_name_length;
char *db, *scheme, *username, *password, *socket, *owner, *host, *sport;
} FOREIGN_SERVER;
/* cache handlers */
bool servers_init(bool dont_read_server_table);
bool servers_reload(THD *thd);
void servers_free(bool end=0);
/* insert functions */
int create_server(THD *thd, LEX_SERVER_OPTIONS *server_options);
/* drop functions */
int drop_server(THD *thd, LEX_SERVER_OPTIONS *server_options);
/* update functions */
int alter_server(THD *thd, LEX_SERVER_OPTIONS *server_options);
/* lookup functions */
FOREIGN_SERVER *get_server_by_name(MEM_ROOT *mem, const char *server_name,
FOREIGN_SERVER *server_buffer);