Below is the list of changes that have just been committed into a local
5.1 repository of patg. When patg does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1892 05/08/27 03:17:01 patg@stripped +6 -0
This is just for a savepoint on adding federated connection cache, not anywhere near final!
mysql-test/t/federated_connection.test
1.1 05/08/27 03:16:45 patg@stripped +240 -0
new test for testing federated connection cache, preliminary
mysql-test/t/federated_connection.test
1.0 05/08/27 03:16:45 patg@stripped +0 -0
BitKeeper file /Users/patg/mysql-build/mysql-5.1/mysql-test/t/federated_connection.test
mysql-test/r/federated_connection.result
1.1 05/08/27 03:16:43 patg@stripped +327 -0
new test to test federated connection cache, preliminary
mysql-test/r/federated_connection.result
1.0 05/08/27 03:16:43 patg@stripped +0 -0
BitKeeper file /Users/patg/mysql-build/mysql-5.1/mysql-test/r/federated_connection.result
sql/ha_federated.h
1.21 05/08/27 03:16:39 patg@stripped +9 -3
preliminary code for connection cache
sql/set_var.cc
1.130 05/08/27 03:16:38 patg@stripped +5 -0
added federated_max|min_connections to be shown in show variables
sql/ha_federated.cc
1.37 05/08/27 03:16:38 patg@stripped +211 -66
preliminary code for connection cache
sql/mysqld.cc
1.474 05/08/27 03:16:37 patg@stripped +15 -1
Added federated-max/min-connections and ha_federated.h
sql/ha_federated.cc
1.36 05/08/17 06:15:37 patg@stripped +22 -11
another savepoint for cached connections
sql/ha_federated.h
1.20 05/08/16 03:02:42 patg@stripped +19 -0
save point
sql/ha_federated.cc
1.35 05/08/16 03:02:42 patg@stripped +169 -35
savepoint
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: patg
# Host: radha.local
# Root: /Users/patg/mysql-build/mysql-5.1
--- 1.473/sql/mysqld.cc 2005-08-17 06:57:02 +02:00
+++ 1.474/sql/mysqld.cc 2005-08-27 03:16:37 +02:00
@@ -34,6 +34,9 @@
#ifdef HAVE_NDBCLUSTER_DB
#include "ha_ndbcluster.h"
#endif
+#ifdef HAVE_FEDERATED_DB
+#include "ha_federated.h"
+#endif
#ifdef HAVE_INNOBASE_DB
#define OPT_INNODB_DEFAULT 1
@@ -328,6 +331,7 @@
static struct passwd *user_info;
static I_List<THD> thread_cache;
+
static pthread_cond_t COND_thread_cache, COND_flush_thread_cache;
#ifdef HAVE_BERKELEY_DB
@@ -438,6 +442,7 @@
/* name of additional condition */
const char *in_additional_cond= "<IN COND>";
my_decimal decimal_zero;
+
/* classes for comparation parsing/processing */
Eq_creator eq_creator;
Ne_creator ne_creator;
@@ -4431,7 +4436,8 @@
OPT_TIMED_MUTEXES,
OPT_OLD_STYLE_USER_LIMITS,
OPT_LOG_SLOW_ADMIN_STATEMENTS,
- OPT_TABLE_LOCK_WAIT_TIMEOUT
+ OPT_TABLE_LOCK_WAIT_TIMEOUT,
+ OPT_FEDERATED_MAX_CONNECTIONS, OPT_FEDERATED_MIN_CONNECTIONS
};
@@ -4602,6 +4608,14 @@
{"external-locking", OPT_USE_LOCKING, "Use system (external) locking. With this option enabled you can run myisamchk to test (not repair) tables while the MySQL server is running.",
(gptr*) &opt_external_locking, (gptr*) &opt_external_locking,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"federated-max-connections", OPT_FEDERATED_MAX_CONNECTIONS,
+ "Syntax: federated-max-connections=NUM, where NUM is the number of maximum connections allowed to a host .",
+ (gptr*) &federated_max_connections, (gptr*) &federated_max_connections, 0,
+ GET_UINT, REQUIRED_ARG, FEDERATED_MAX_CONNECTIONS, 0, 0, 0, 0, 0},
+ {"federated-min-connections", OPT_FEDERATED_MIN_CONNECTIONS,
+ "Syntax: federated-min-connections=NUM, where NUM is the mimimum number of cached connections kept to a host .",
+ (gptr*) &federated_min_connections, (gptr*) &federated_min_connections, 0,
+ GET_UINT, REQUIRED_ARG, FEDERATED_MIN_CONNECTIONS, 0, 0, 0, 0, 0},
{"flush", OPT_FLUSH, "Flush tables to disk between SQL commands.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
/* We must always support the next option to make scripts like mysqltest
--- 1.129/sql/set_var.cc 2005-08-17 06:57:04 +02:00
+++ 1.130/sql/set_var.cc 2005-08-27 03:16:38 +02:00
@@ -67,6 +67,9 @@
#ifdef HAVE_NDBCLUSTER_DB
#include "ha_ndbcluster.h"
#endif
+#ifdef HAVE_FEDERATED_DB
+#include "ha_federated.h"
+#endif
static HASH system_variable_hash;
const char *bool_type_names[]= { "OFF", "ON", NullS };
@@ -774,6 +777,8 @@
{sys_delayed_insert_timeout.name, (char*) &sys_delayed_insert_timeout, SHOW_SYS},
{sys_delayed_queue_size.name,(char*) &sys_delayed_queue_size, SHOW_SYS},
{sys_expire_logs_days.name, (char*) &sys_expire_logs_days, SHOW_SYS},
+ {"federated_max_connections", (char*) &federated_max_connections, SHOW_INT},
+ {"federated_min_connections", (char*) &federated_min_connections, SHOW_INT},
{sys_flush.name, (char*) &sys_flush, SHOW_SYS},
{sys_flush_time.name, (char*) &sys_flush_time, SHOW_SYS},
{sys_ft_boolean_syntax.name,(char*) &ft_boolean_syntax, SHOW_CHAR},
--- 1.34/sql/ha_federated.cc 2005-08-05 23:50:35 +02:00
+++ 1.37/sql/ha_federated.cc 2005-08-27 03:16:38 +02:00
@@ -355,21 +355,51 @@
#include "ha_federated.h"
#include "m_string.h"
+
+uint federated_max_connections= FEDERATED_MAX_CONNECTIONS;
+uint federated_min_connections= FEDERATED_MIN_CONNECTIONS;
+
/* Variables for federated share methods */
static HASH federated_open_tables; // Hash used to track open
// tables
+static HASH federated_open_connections; // Hash used to track connection
pthread_mutex_t federated_mutex; // This is the mutex we use to
// init the hash
+pthread_mutex_t federated_connection_mutex; // This is the mutex we use to
+ // init the connections
static int federated_init= FALSE; // Variable for checking the
// init state of hash
-/* Function we use in the creation of our hash to get key. */
-
+/*
+ Function we use in the creation of our hash to get key for
+ federated_open_tables HASH.
+*/
static byte *federated_get_key(FEDERATED_SHARE *share, uint *length,
my_bool not_used __attribute__ ((unused)))
{
+ DBUG_ENTER("federated_get_key");
+ DBUG_PRINT("info", ("federated_get_key table_name_length %d table_name %s",
+ share->table_name_length, share->table_name));
*length= share->table_name_length;
- return (byte*) share->table_name;
+ DBUG_RETURN((byte*) share->table_name);
+}
+
+/*
+ Function we use in the creation of our hash to get key
+ for federated_open_connections HASH.
+*/
+static byte *federated_get_key_connection(
+ FEDERATED_CONNECTION_CACHE *federated_connection_cache,
+ uint *length,
+ my_bool not_used __attribute__ ((unused)))
+{
+ DBUG_ENTER("federated_get_key_connection");
+ *length= federated_connection_cache->key_length;
+ DBUG_PRINT("info", ("federated_connection_cache->key_length %d \
+ federated_connection_cache->key %s",
+ federated_connection_cache->key_length,
+ federated_connection_cache->key));
+ DBUG_RETURN((byte*) federated_connection_cache->key);
}
/*
@@ -386,10 +416,21 @@
bool federated_db_init()
{
+ DBUG_ENTER("federated_db_init");
federated_init= 1;
VOID(pthread_mutex_init(&federated_mutex, MY_MUTEX_INIT_FAST));
- return (hash_init(&federated_open_tables, system_charset_info, 32, 0, 0,
- (hash_get_key) federated_get_key, 0, 0));
+ VOID(pthread_mutex_init(&federated_connection_mutex, MY_MUTEX_INIT_FAST));
+ hash_init(&federated_open_tables, system_charset_info, 32, 0, 0,
+ (hash_get_key) federated_get_key, 0, 0);
+ DBUG_PRINT("info", ("returned hash_init federated_open_tables %lx", &federated_open_tables));
+ DBUG_PRINT("info", ("calling hash_init federated_open_connections"));
+ hash_init(&federated_open_connections, system_charset_info, 32, 0, 0,
+ (hash_get_key) federated_get_key_connection, 0, 0);
+ // sql_table.cc
+ hash_init(&federated_open_connections, system_charset_info, 32, 0, 0,
+ (hash_get_key) federated_get_key_connection, 0, 0);
+ DBUG_PRINT("info", ("returned hash_init federated_open_connections %lx", &federated_open_connections));
+ DBUG_RETURN(0);
}
@@ -406,13 +447,33 @@
bool federated_db_end()
{
+ DBUG_ENTER("federated_db_end");
if (federated_init)
{
+ int x;
+ for (x= 0; x < federated_open_connections.records; x++)
+ {
+ char *key_name= (char *) hash_element(&federated_open_connections, x);
+ DBUG_PRINT("info", ("federated_db_end key_name %s", key_name));
+ FEDERATED_CONNECTION *cache_ptr;
+ FEDERATED_CONNECTION_CACHE *cache= (FEDERATED_CONNECTION_CACHE *)
+ hash_search(&federated_open_connections,
+ (byte*) key_name,
+ strlen(key_name));
+ for (cache_ptr= cache->cache; cache_ptr; cache_ptr= cache_ptr->next)
+ {
+ if (cache_ptr->mysql)
+ mysql_close(cache_ptr->mysql);
+ }
+ }
+
hash_free(&federated_open_tables);
+ hash_free(&federated_open_connections);
VOID(pthread_mutex_destroy(&federated_mutex));
+ VOID(pthread_mutex_destroy(&federated_connection_mutex));
}
federated_init= 0;
- return FALSE;
+ DBUG_RETURN(FALSE);
}
/*
@@ -443,7 +504,6 @@
DBUG_ENTER("ha_federated::check_foreign_data_source");
/* Zero the length, otherwise the string will have misc chars */
query.length(0);
-
/* error out if we can't alloc memory for mysql_init(NULL) (per Georg) */
if (!(mysql= mysql_init(NULL)))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
@@ -563,6 +623,13 @@
DBUG_ENTER("ha_federated::parse_url");
share->port= 0;
+ if (! table_create_flag)
+ {
+ share->connection_id_length= strlen(table->s->comment);
+ share->connection_id= my_strdup(table->s->comment, MYF(0));
+ DBUG_PRINT("info",("parse_url share->connection_id %s connection_id_length %d",
+ share->connection_id, share->connection_id_length));
+ }
share->scheme= my_strdup(table->s->comment, MYF(0));
DBUG_PRINT("info",("parse_url alloced share->scheme %lx", share->scheme));
@@ -673,6 +740,14 @@
my_free((gptr) share->scheme, MYF(0));
share->scheme= 0;
}
+ if (share->connection_id)
+ {
+ DBUG_PRINT("info",
+ ("error: parse_url. Returning error code %d \
+ freeing share->scheme %lx", error_num, share->scheme));
+ my_free((gptr) share->connection_id, MYF(0));
+ share->scheme= 0;
+ }
my_error(error_num, MYF(0), table->s->comment);
DBUG_RETURN(error_num);
@@ -1040,7 +1115,7 @@
Summary:
-* If the start key flag is 0 the max key flag shouldn't even be set,
+* If the start key flag is 0 the max key flag shouldn't even be set,
and if it is, the query produced would be invalid.
* Multipart keys, even if containing some or all numeric columns,
are treated the same as non-numeric keys
@@ -1090,7 +1165,7 @@
const key_range *end_key,
bool records_in_range)
{
- bool both_not_null=
+ bool both_not_null=
(start_key != NULL && end_key != NULL) ? TRUE : FALSE;
const byte *ptr;
uint remainder, length;
@@ -1099,9 +1174,11 @@
const key_range *ranges[2]= { start_key, end_key };
DBUG_ENTER("ha_federated::create_where_from_key");
- tmp.length(0);
+ tmp.length(0);
if (start_key == NULL && end_key == NULL)
+ {
DBUG_RETURN(1);
+ }
for (int i= 0; i <= 1; i++)
{
@@ -1280,6 +1357,7 @@
Field **field;
String query(query_buffer, sizeof(query_buffer), &my_charset_bin);
FEDERATED_SHARE *share;
+ DBUG_ENTER("ha_federated::get_share");
/*
In order to use this string, we must first zero it's length,
or it will contain garbage
@@ -1307,9 +1385,8 @@
query.append(FEDERATED_FROM);
query.append(FEDERATED_BTICK);
-
if (!(share= (FEDERATED_SHARE *)
- my_multi_malloc(MYF(MY_WME),
+ my_multi_malloc(MYF(MY_WME|MY_ZEROFILL),
&share, sizeof(*share),
&tmp_table_name, tmp_table_name_length+ 1,
&select_query,
@@ -1317,12 +1394,14 @@
NullS)))
{
pthread_mutex_unlock(&federated_mutex);
- return NULL;
+ DBUG_RETURN(NULL);
}
if (parse_url(share, table, 0))
goto error;
+ DBUG_PRINT("info", ("share->connection_id %s", share->connection_id));
+
query.append(share->table_name, share->table_name_length);
query.append(FEDERATED_BTICK);
share->select_query= select_query;
@@ -1340,7 +1419,7 @@
share->use_count++;
pthread_mutex_unlock(&federated_mutex);
- return share;
+ DBUG_RETURN(share);
error:
pthread_mutex_unlock(&federated_mutex);
@@ -1349,7 +1428,7 @@
my_free((gptr) share->scheme, MYF(0));
share->scheme= 0;
}
- return NULL;
+ DBUG_RETURN(NULL);
}
@@ -1412,7 +1491,231 @@
return ext;
}
+int ha_federated::get_connection()
+{
+ int x;
+ char *tmp_connection_id= share->connection_id;
+ FEDERATED_CONNECTION_CACHE *federated_connection_cache;
+ FEDERATED_CONNECTION *cache_ptr;
+ DBUG_ENTER("ha_federated::get_connection");
+
+ DBUG_PRINT("info", ("assigned tmp_connection_id %s at %lx",
+ tmp_connection_id, &tmp_connection_id));
+ /* Connect to foreign database mysql_real_connect() */
+ DBUG_PRINT("info", ("trying to get mutex lock on federated_connection_mutex at %lx",
+ federated_connection_mutex));
+ pthread_mutex_lock(&federated_connection_mutex);
+
+ DBUG_PRINT("info", ("trying to get connection cache with share->connection_id %.*s length %d",
+ share->connection_id_length, tmp_connection_id, share->connection_id_length));
+
+ /*
+ First of all, we check to see if there is a cache already for this connection_id.
+ If not, then we procede through the steps of allocating one and then insert it
+ into the hash, keyed with connection_id. Note, see federated_get_key_connection
+ to see the function that will return the key
+ */
+ if (!(federated_connection_cache= (FEDERATED_CONNECTION_CACHE *)
+ hash_search(&federated_open_connections,
+ (byte*) share->connection_id,
+ share->connection_id_length)))
+ {
+ DBUG_PRINT("info", ("creating connection cache with key connection_id %.*s length %d",
+ share->connection_id_length, tmp_connection_id, share->connection_id_length));
+ /*
+ my_multi_malloc federated_connection_cache. We must use tmp_connection_id
+ because we can't use share->connection_id
+ */
+ if (!(federated_connection_cache= (FEDERATED_CONNECTION_CACHE *)
+ my_multi_malloc(MYF(MY_WME|MY_ZEROFILL),
+ &federated_connection_cache, sizeof(FEDERATED_CONNECTION_CACHE),
+ &tmp_connection_id, share->connection_id_length + 1,
+ NullS)))
+ {
+ DBUG_PRINT("error",
+ ("my_multi_malloc failed"));
+ pthread_mutex_unlock(&federated_mutex);
+ DBUG_RETURN(1);
+ }
+ federated_connection_cache->key= share->connection_id;
+ federated_connection_cache->key_length= share->connection_id_length;
+ federated_connection_cache->count++;
+
+ federated_connection_cache->cache= (FEDERATED_CONNECTION *)
+ (my_malloc(sizeof(FEDERATED_CONNECTION), MYF(MY_ZEROFILL)));
+
+ if (my_hash_insert(&federated_open_connections,
+ (byte *) federated_connection_cache))
+ goto error;
+ DBUG_PRINT("info",
+ ("created federated_connection_cache %lx \
+ incremented federated_connection_cache->count %d \
+ federated_max_connections %d federated_open_connections size %d",
+ federated_connection_cache,
+ federated_connection_cache->count,
+ federated_max_connections,
+ sizeof(federated_open_connections)));
+ }
+ else
+ {
+ DBUG_PRINT("info", ("keyed connection federated_connection_cache %lx \
+ federated_connection_cache->count %d \
+ federated_max_connections %d",
+ federated_connection_cache,
+ federated_connection_cache->count,
+ federated_max_connections));
+ }
+ /*
+ At this point, we either have a new cache or one that was keyed
+ from federated_open_connections. Either way, we must make sure there's
+ a connection to the database for the mysql member of the cache
+ */
+
+ mysql= NULL;
+ for (cache_ptr= federated_connection_cache->cache;
+ cache_ptr, federated_connection_cache->count < federated_max_connections;
+ cache_ptr= cache_ptr->next)
+ {
+ /*
+ if we exceed our number of max connections, don't add a new one
+ */
+ if (federated_connection_cache->count > federated_max_connections )
+ {
+ DBUG_PRINT("info", ("max federated_connection_cache connections %d (max allowed %d) exceeded",
+ federated_connection_cache->count, federated_max_connections));
+ goto error;
+ }
+ DBUG_PRINT("info", ("for loop cache_ptr %lx cache_ptr->locked %d cache_ptr->mysql %lx",
+ cache_ptr, cache_ptr->locked, cache_ptr->mysql ));
+ /*
+ if not locked, then we can procede to create a connection and then lock it
+ */
+ if (! cache_ptr->locked)
+ {
+ /* connection exists, use this one */
+ if (cache_ptr->mysql)
+ {
+ DBUG_PRINT("info", ("cache_ptr->locked unlocked, cache_ptr->mysql %lx",
+ cache_ptr->mysql));
+ mysql= cache_ptr->mysql;
+ }
+ else
+ {
+ /* create a new one */
+ mysql= mysql_init(0);
+ DBUG_PRINT("info", ("federated_connection_cache->count %d",
+ federated_connection_cache->count));
+ if (!mysql_real_connect(mysql,
+ share->hostname,
+ share->username,
+ share->password,
+ share->database,
+ share->port,
+ share->socket, 0))
+ {
+ int error_code;
+ char error_buffer[FEDERATED_QUERY_BUFFER_SIZE];
+ error_code= ER_CONNECT_TO_FOREIGN_DATA_SOURCE;
+ my_sprintf(error_buffer, (error_buffer, ": %d : %s",
+ mysql_errno(mysql), mysql_error(mysql)));
+ my_error(error_code, MYF(0), error_buffer);
+ DBUG_RETURN(error_code);
+ }
+ /*
+ Since we do not support transactions at this version, we can let the client
+ API silently reconnect. For future versions, we will need more logic to deal
+ with transactions
+ */
+ mysql->reconnect= 1;
+ cache_ptr->mysql= mysql;
+ DBUG_PRINT("info", ("connected, cache_ptr->mysql %lx",
+ cache_ptr->mysql));
+ }
+ cache_ptr->locked= TRUE;
+ goto unlock;
+ }
+
+ /* is there another connection? */
+ if (cache_ptr->next == NULL)
+ {
+ /*
+ next doesn't exist and we haven't exceeded our count, then add another
+ */
+ if (! (cache_ptr->next= (FEDERATED_CONNECTION *)
+ my_malloc(sizeof(FEDERATED_CONNECTION), MYF(MY_ZEROFILL))) )
+ {
+ DBUG_PRINT("error", ("unable to my_malloc cache_ptr->next"));
+ goto error;
+ }
+ DBUG_PRINT("info", ("malloced cache_ptr->next %lx", cache_ptr->next));
+ federated_connection_cache->count++;
+ /* obviously, increment since we're adding another */
+ DBUG_PRINT("info", ("connected, locked , incremented \
+ federated_connection_cache %lx federated_connection_cache->count %d cache_ptr->mysql %lx",
+ federated_connection_cache, federated_connection_cache->count, cache_ptr->mysql));
+ }
+ }
+
+unlock:
+ pthread_mutex_unlock(&federated_connection_mutex);
+ DBUG_PRINT("info", ("pthread_mutex_lock %lx unlocked",
+ &pthread_mutex_lock));
+ DBUG_RETURN(0);
+error:
+ DBUG_PRINT("info", ("error block, deleting federated_connection_cache at %lx",
+ federated_connection_cache));
+ delete federated_connection_cache;
+ pthread_mutex_unlock(&federated_connection_mutex);
+ DBUG_RETURN(1);
+}
+
+int ha_federated::drop_connection()
+{
+ int x;
+ FEDERATED_CONNECTION_CACHE *cache;
+ FEDERATED_CONNECTION *cache_ptr, *last_ptr;
+ DBUG_ENTER("ha_federated::drop_connection");
+
+ DBUG_PRINT("info",("getting connection cache connection_id key %s connection_id_length %d",
+ share->connection_id, share->connection_id_length));
+
+ if (!(cache= (FEDERATED_CONNECTION_CACHE *) hash_search(&federated_open_connections,
+ (byte*) share->connection_id,
+ share->connection_id_length)))
+ {
+ for (last_ptr= NULL, cache_ptr= cache->cache;
+ cache_ptr->next;
+ last_ptr= cache_ptr,cache_ptr= cache_ptr->next)
+ {
+ if (cache_ptr->mysql == mysql)
+ {
+ if (cache->count > federated_min_connections)
+ {
+ DBUG_PRINT("info",("cache->count %d federated_min_connections %d",
+ cache->count, federated_min_connections));
+ // We never remove all cached connections
+ if (!last_ptr)
+ {
+ last_ptr= cache_ptr->next;
+ if (cache_ptr->mysql)
+ mysql_close(cache_ptr->mysql);
+ my_free((gptr) cache_ptr, MYF(0));
+ cache->count--;
+ DBUG_PRINT("info",("cache %lx cache->count %d decremented federated_min_connections %d",
+ cache, cache->count, federated_min_connections));
+ }
+ }
+ else
+ {
+ cache_ptr->locked= FALSE;
+ }
+ break;
+ }
+ }
+ }
+ DBUG_RETURN(0);
+}
/*
Used for opening tables. The name will be the name of the file.
A table is opened when it needs to be opened. For instance
@@ -1426,41 +1729,19 @@
int ha_federated::open(const char *name, int mode, uint test_if_locked)
{
- int rc;
+ int rc, retval;
DBUG_ENTER("ha_federated::open");
if (!(share= get_share(name, table)))
DBUG_RETURN(1);
+ retval= get_connection();
+ if (retval)
+ DBUG_RETURN(1);
thr_lock_data_init(&share->lock, &lock, NULL);
- /* Connect to foreign database mysql_real_connect() */
- mysql= mysql_init(0);
- if (!mysql_real_connect(mysql,
- share->hostname,
- share->username,
- share->password,
- share->database,
- share->port,
- share->socket, 0))
- {
- int error_code;
- char error_buffer[FEDERATED_QUERY_BUFFER_SIZE];
- error_code= ER_CONNECT_TO_FOREIGN_DATA_SOURCE;
- my_sprintf(error_buffer, (error_buffer, ": %d : %s",
- mysql_errno(mysql), mysql_error(mysql)));
- my_error(error_code, MYF(0), error_buffer);
- DBUG_RETURN(error_code);
- }
- /*
- Since we do not support transactions at this version, we can let the client
- API silently reconnect. For future versions, we will need more logic to deal
- with transactions
- */
- mysql->reconnect= 1;
DBUG_RETURN(0);
}
-
/*
Closes a table. We call the free_share() function to free any resources
that we have allocated in the "shared" structure.
@@ -1546,6 +1827,9 @@
int ha_federated::write_row(byte *buf)
{
bool has_fields= FALSE;
+ uint all_fields_have_same_query_id= 1;
+ ulong current_query_id= 1;
+ ulong tmp_query_id= 1;
char insert_buffer[FEDERATED_QUERY_BUFFER_SIZE];
char values_buffer[FEDERATED_QUERY_BUFFER_SIZE];
char insert_field_value_buffer[STRING_BUFFER_USUAL_SIZE];
@@ -1595,8 +1879,13 @@
for (field= table->field; *field; field++)
{
/* if there is a query id and if it's equal to the current query id */
+#if MIKAEL_FIX
if (ha_get_bit_in_write_set((*field)->fieldnr))
{
+#endif
+ if (((*field)->query_id && (*field)->query_id == current_query_id)
+ || all_fields_have_same_query_id)
+ {
/*
There are some fields. This will be used later to determine
whether to chop off commas and parens.
@@ -1698,7 +1987,7 @@
{
char query_buffer[STRING_BUFFER_USUAL_SIZE];
String query(query_buffer, sizeof(query_buffer), &my_charset_bin);
-
+
DBUG_ENTER("ha_federated::repair");
query.length(0);
@@ -1714,7 +2003,7 @@
query.append(FEDERATED_EXTENDED);
if (check_opt->sql_flags & TT_USEFRM)
query.append(FEDERATED_USE_FRM);
-
+
if (mysql_real_query(mysql, query.ptr(), query.length()))
{
my_error(-1, MYF(0), mysql_error(mysql));
@@ -2406,6 +2695,7 @@
char status_buf[FEDERATED_QUERY_BUFFER_SIZE];
char escaped_table_name[FEDERATED_QUERY_BUFFER_SIZE];
int error;
+ int retval;
uint error_code;
MYSQL_RES *result= 0;
MYSQL_ROW row;
--- 1.19/sql/ha_federated.h 2005-07-19 20:43:23 +02:00
+++ 1.21/sql/ha_federated.h 2005-08-27 03:16:39 +02:00
@@ -27,6 +27,9 @@
#include <mysql.h>
+#define FEDERATED_MAX_CONNECTIONS 15
+#define FEDERATED_MIN_CONNECTIONS 5
+#define FEDERATED_DEFAULT_CACHE_SIZE 10
#define FEDERATED_QUERY_BUFFER_SIZE STRING_BUFFER_USUAL_SIZE * 5
#define FEDERATED_RECORDS_IN_RANGE 2
@@ -110,6 +113,21 @@
#define FEDERATED_FALSE_LEN sizeof(FEDERATED_FALSE)
/*
+ */
+typedef struct st_federated_connection {
+ bool locked;
+ MYSQL *mysql; /* MySQL connection */
+ st_federated_connection *next;
+} FEDERATED_CONNECTION;
+
+/*
+ */
+typedef struct st_federated_connection_cache {
+ uint key_length, count;
+ char *key;
+ FEDERATED_CONNECTION *cache; /* MySQL connection */
+} FEDERATED_CONNECTION_CACHE;
+/*
FEDERATED_SHARE is a structure that will be shared amoung all open handlers
The example implements the minimum of what you will probably need.
*/
@@ -130,12 +148,17 @@
char *table;
char *socket;
char *sport;
+ char *connection_id;
ushort port;
- uint table_name_length, use_count;
+ uint table_name_length, use_count, connection_id_length;
pthread_mutex_t mutex;
THR_LOCK lock;
+ MYSQL *mysql; /* MySQL connection */
} FEDERATED_SHARE;
+extern uint federated_max_connections;
+extern uint federated_min_connections;
+
/*
Class definition for the storage engine
*/
@@ -285,6 +308,8 @@
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
enum thr_lock_type lock_type); //required
+ int get_connection();
+ int drop_connection();
};
bool federated_db_init(void);
--- New file ---
+++ mysql-test/r/federated_connection.result 05/08/27 03:16:43
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
show variables like '%feder%';
Variable_name Value
federated_max_connections 15
federated_min_connections 5
have_federated_engine YES
DROP TABLE IF EXISTS federated.t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
key (country_id));
DROP TABLE IF EXISTS federated.t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:SLAVE_PORT/federated/t1';
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Kumar', 1, 11111);
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Lenz', 2, 22222);
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Marizio', 3, 33333);
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Monty', 4, 33333);
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Sanja', 5, 33333);
CREATE TABLE federated.t2 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id));
CREATE TABLE federated.t2 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:9308/federated/t2';
INSERT INTO federated.t2 SELECT * FROM federated.t1;
SELECT * FROM federated.t2;
id country_id name other
1 1 Kumar 11111
2 2 Lenz 22222
3 3 Marizio 33333
4 4 Monty 33333
5 5 Sanja 33333
CREATE TABLE federated.t3 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:9308/federated/t2';
SELECT * FROM federated.t3;
id country_id name other
1 1 Kumar 11111
2 2 Lenz 22222
3 3 Marizio 33333
4 4 Monty 33333
5 5 Sanja 33333
CREATE TABLE federated.t4 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:9308/federated/t2';
SELECT * FROM federated.t4;
id country_id name other
1 1 Kumar 11111
2 2 Lenz 22222
3 3 Marizio 33333
4 4 Monty 33333
5 5 Sanja 33333
CREATE TABLE federated.t5 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:9308/federated/t2';
SELECT * FROM federated.t5;
id country_id name other
1 1 Kumar 11111
2 2 Lenz 22222
3 3 Marizio 33333
4 4 Monty 33333
5 5 Sanja 33333
CREATE TABLE federated.t6 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:9308/federated/t2';
SELECT * FROM federated.t6;
id country_id name other
1 1 Kumar 11111
2 2 Lenz 22222
3 3 Marizio 33333
4 4 Monty 33333
5 5 Sanja 33333
CREATE TABLE federated.t7 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:9308/federated/t2';
SELECT * FROM federated.t7;
id country_id name other
1 1 Kumar 11111
2 2 Lenz 22222
3 3 Marizio 33333
4 4 Monty 33333
5 5 Sanja 33333
CREATE TABLE federated.t8 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:9308/federated/t2';
SELECT * FROM federated.t8;
id country_id name other
1 1 Kumar 11111
2 2 Lenz 22222
3 3 Marizio 33333
4 4 Monty 33333
5 5 Sanja 33333
CREATE TABLE federated.t9 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:9308/federated/t2';
SELECT * FROM federated.t9;
id country_id name other
1 1 Kumar 11111
2 2 Lenz 22222
3 3 Marizio 33333
4 4 Monty 33333
5 5 Sanja 33333
CREATE TABLE federated.t10 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:9308/federated/t2';
SELECT * FROM federated.t10;
id country_id name other
1 1 Kumar 11111
2 2 Lenz 22222
3 3 Marizio 33333
4 4 Monty 33333
5 5 Sanja 33333
CREATE TABLE federated.t11 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:9308/federated/t2';
SELECT * FROM federated.t11;
id country_id name other
1 1 Kumar 11111
2 2 Lenz 22222
3 3 Marizio 33333
4 4 Monty 33333
5 5 Sanja 33333
CREATE TABLE federated.t12 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:9308/federated/t2';
SELECT * FROM federated.t12;
id country_id name other
1 1 Kumar 11111
2 2 Lenz 22222
3 3 Marizio 33333
4 4 Monty 33333
5 5 Sanja 33333
CREATE TABLE federated.t13 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:9308/federated/t2';
SELECT * FROM federated.t13;
id country_id name other
1 1 Kumar 11111
2 2 Lenz 22222
3 3 Marizio 33333
4 4 Monty 33333
5 5 Sanja 33333
CREATE TABLE federated.t14 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:9308/federated/t2';
SELECT * FROM federated.t14;
id country_id name other
1 1 Kumar 11111
2 2 Lenz 22222
3 3 Marizio 33333
4 4 Monty 33333
5 5 Sanja 33333
CREATE TABLE federated.t15 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:9308/federated/t2';
SELECT * FROM federated.t15;
id country_id name other
1 1 Kumar 11111
2 2 Lenz 22222
3 3 Marizio 33333
4 4 Monty 33333
5 5 Sanja 33333
CREATE TABLE federated.t16 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:9308/federated/t2';
SELECT * FROM federated.t16;
id country_id name other
1 1 Kumar 11111
2 2 Lenz 22222
3 3 Marizio 33333
4 4 Monty 33333
5 5 Sanja 33333
CREATE TABLE federated.t17 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:9308/federated/t2';
SELECT * FROM federated.t17;
id country_id name other
1 1 Kumar 11111
2 2 Lenz 22222
3 3 Marizio 33333
4 4 Monty 33333
5 5 Sanja 33333
DROP TABLE federated.t2;
DROP TABLE federated.t3;
DROP TABLE federated.t4;
DROP TABLE federated.t5;
DROP TABLE federated.t6;
DROP TABLE federated.t7;
DROP TABLE federated.t8;
DROP TABLE federated.t9;
DROP TABLE federated.t10;
DROP TABLE federated.t11;
DROP TABLE federated.t12;
DROP TABLE federated.t13;
DROP TABLE federated.t14;
DROP TABLE federated.t15;
DROP TABLE federated.t16;
DROP TABLE federated.t17;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
--- New file ---
+++ mysql-test/t/federated_connection.test 05/08/27 03:16:45
source include/federated.inc;
show variables like '%feder%';
# test joins with non-federated table
connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
key (country_id));
connection master;
DROP TABLE IF EXISTS federated.t1;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE federated.t1 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t1';
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Kumar', 1, 11111);
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Lenz', 2, 22222);
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Marizio', 3, 33333);
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Monty', 4, 33333);
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Sanja', 5, 33333);
connection slave;
eval CREATE TABLE federated.t2 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id));
connection master;
eval CREATE TABLE federated.t2 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t2';
INSERT INTO federated.t2 SELECT * FROM federated.t1;
SELECT * FROM federated.t2;
# Connection test, try to open too many connections
eval CREATE TABLE federated.t3 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t2';
SELECT * FROM federated.t3;
eval CREATE TABLE federated.t4 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t2';
SELECT * FROM federated.t4;
eval CREATE TABLE federated.t5 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t2';
SELECT * FROM federated.t5;
eval CREATE TABLE federated.t6 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t2';
SELECT * FROM federated.t6;
eval CREATE TABLE federated.t7 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t2';
SELECT * FROM federated.t7;
eval CREATE TABLE federated.t8 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t2';
SELECT * FROM federated.t8;
eval CREATE TABLE federated.t9 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t2';
SELECT * FROM federated.t9;
eval CREATE TABLE federated.t10 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t2';
SELECT * FROM federated.t10;
eval CREATE TABLE federated.t11 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t2';
SELECT * FROM federated.t11;
eval CREATE TABLE federated.t12 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t2';
SELECT * FROM federated.t12;
eval CREATE TABLE federated.t13 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t2';
SELECT * FROM federated.t13;
eval CREATE TABLE federated.t14 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t2';
SELECT * FROM federated.t14;
eval CREATE TABLE federated.t15 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t2';
SELECT * FROM federated.t15;
eval CREATE TABLE federated.t16 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t2';
SELECT * FROM federated.t16;
eval CREATE TABLE federated.t17 (
`id` int(20) NOT NULL auto_increment,
`country_id` int(20) NOT NULL DEFAULT 0,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`),
KEY (country_id) )
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@stripped:$SLAVE_MYPORT/federated/t2';
SELECT * FROM federated.t17;
DROP TABLE federated.t2;
DROP TABLE federated.t3;
DROP TABLE federated.t4;
DROP TABLE federated.t5;
DROP TABLE federated.t6;
DROP TABLE federated.t7;
DROP TABLE federated.t8;
DROP TABLE federated.t9;
DROP TABLE federated.t10;
DROP TABLE federated.t11;
DROP TABLE federated.t12;
DROP TABLE federated.t13;
DROP TABLE federated.t14;
DROP TABLE federated.t15;
DROP TABLE federated.t16;
DROP TABLE federated.t17;
source include/federated_cleanup.inc;
| Thread |
|---|
| • bk commit into 5.1 tree (patg:1.1892) | Patrick Galbraith | 27 Aug |