Commit cd185c14 authored by Olivier Bertrand's avatar Olivier Bertrand

- 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
parent 8b7c7b92
......@@ -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())
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment