mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
- 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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user