From cd185c1468805a297056e4124ec581eac0bc858e Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Tue, 27 May 2014 12:50:52 +0200 Subject: [PATCH] - Fix a bug causing the tabname option to be ignored when the connection string was not an URL but a server name. Also make the dbname option to be recignized in create (was only seached in option_list) modified: storage/connect/ha_connect.cc storage/connect/tabmysql.cpp --- storage/connect/ha_connect.cc | 6 +----- storage/connect/tabmysql.cpp | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 9425e3a2727..76cb0c5c62a 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -4238,7 +4238,6 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, strncpy(dsn, create_info->connect_string.str, len); dsn[len]= 0; mydef->SetName(create_info->alias); - mydef->SetCat(cat); if (!mydef->ParseURL(g, dsn, false)) { if (mydef->GetHostname()) @@ -4695,21 +4694,18 @@ int ha_connect::create(const char *name, TABLE *table_arg, int port; host= GetListOption(g, "host", options->oplist, NULL); - db= GetListOption(g, "database", options->oplist, NULL); + db= GetStringOption("database", NULL); port= atoi(GetListOption(g, "port", options->oplist, "0")); if (create_info->connect_string.str) { char *dsn; int len= create_info->connect_string.length; PMYDEF mydef= new(g) MYSQLDEF(); - PDBUSER dup= PlgGetUser(g); - PCATLG cat= (dup) ? dup->Catalog : NULL; dsn= (char*)PlugSubAlloc(g, NULL, len + 1); strncpy(dsn, create_info->connect_string.str, len); dsn[len]= 0; mydef->SetName(create_info->alias); - mydef->SetCat(cat); if (!mydef->ParseURL(g, dsn, false)) { if (mydef->GetHostname()) diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp index dea6978f73e..37c72501840 100644 --- a/storage/connect/tabmysql.cpp +++ b/storage/connect/tabmysql.cpp @@ -191,8 +191,7 @@ bool MYSQLDEF::ParseURL(PGLOBAL g, char *url, bool b) } else // Otherwise, straight server name, - // use tablename of federatedx table as remote table name - Tabname= Name; + Tabname = (b) ? GetStringCatInfo(g, "Tabname", Name) : NULL; if (trace) htrc("server: %s Tabname: %s", url, Tabname);