- 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
This commit is contained in:
Olivier Bertrand 2014-05-27 12:50:52 +02:00
parent 8b7c7b9280
commit cd185c1468
2 changed files with 2 additions and 7 deletions

View File

@ -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())

View File

@ -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);