mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
- Change DB_NAME option name to DBNAME. Temporarily, "database" is still
accepted in OPTION_LIST for compatibity but DB_NAME is no more recognized. modified: storage/connect/ha_connect.cc
This commit is contained in:
parent
9d7f134186
commit
183698b779
1 changed files with 10 additions and 6 deletions
|
@ -232,7 +232,7 @@ ha_create_table_option connect_table_option_list[]=
|
||||||
//HA_TOPTION_STRING("CONNECT_STRING", connect),
|
//HA_TOPTION_STRING("CONNECT_STRING", connect),
|
||||||
HA_TOPTION_STRING("TABNAME", tabname),
|
HA_TOPTION_STRING("TABNAME", tabname),
|
||||||
HA_TOPTION_STRING("TABLE_LIST", tablist),
|
HA_TOPTION_STRING("TABLE_LIST", tablist),
|
||||||
HA_TOPTION_STRING("DB_NAME", dbname),
|
HA_TOPTION_STRING("DBNAME", dbname),
|
||||||
HA_TOPTION_STRING("SEP_CHAR", separator),
|
HA_TOPTION_STRING("SEP_CHAR", separator),
|
||||||
HA_TOPTION_STRING("QCHAR", qchar),
|
HA_TOPTION_STRING("QCHAR", qchar),
|
||||||
HA_TOPTION_STRING("MODULE", module),
|
HA_TOPTION_STRING("MODULE", module),
|
||||||
|
@ -737,8 +737,8 @@ PTOS ha_connect::GetTableOptionStruct(TABLE *tab)
|
||||||
} else if (!stricmp(pk, "sep") || !stricmp(pk, "separator")
|
} else if (!stricmp(pk, "sep") || !stricmp(pk, "separator")
|
||||||
|| !stricmp(pk, "Sep_Char")) {
|
|| !stricmp(pk, "Sep_Char")) {
|
||||||
top->separator= val;
|
top->separator= val;
|
||||||
} else if (!stricmp(pk, "db") || !stricmp(pk, "database")
|
} else if (!stricmp(pk, "db") || !stricmp(pk, "DBName")
|
||||||
|| !stricmp(pk, "DB_Name")) {
|
|| !stricmp(pk, "Database") {
|
||||||
top->dbname= val;
|
top->dbname= val;
|
||||||
} else if (!stricmp(pk, "qchar")) {
|
} else if (!stricmp(pk, "qchar")) {
|
||||||
top->qchar= val;
|
top->qchar= val;
|
||||||
|
@ -807,7 +807,8 @@ char *ha_connect::GetStringOption(char *opname, char *sdef)
|
||||||
opval= (char*)options->tabname;
|
opval= (char*)options->tabname;
|
||||||
else if (!stricmp(opname, "Tablist"))
|
else if (!stricmp(opname, "Tablist"))
|
||||||
opval= (char*)options->tablist;
|
opval= (char*)options->tablist;
|
||||||
else if (!stricmp(opname, "Database"))
|
else if (!stricmp(opname, "Database") ||
|
||||||
|
!stricmp(opname, "DBname"))
|
||||||
opval= (char*)options->dbname;
|
opval= (char*)options->dbname;
|
||||||
else if (!stricmp(opname, "Separator"))
|
else if (!stricmp(opname, "Separator"))
|
||||||
opval= (char*)options->separator;
|
opval= (char*)options->separator;
|
||||||
|
@ -3345,7 +3346,6 @@ bool ha_connect::pre_create(THD *thd, HA_CREATE_INFO *create_info,
|
||||||
|
|
||||||
fn= dsn= tab= host= pwd= prt= sep= NULL;
|
fn= dsn= tab= host= pwd= prt= sep= NULL;
|
||||||
user= NULL;
|
user= NULL;
|
||||||
db= thd->db; // Default value
|
|
||||||
|
|
||||||
// Get the useful create options
|
// Get the useful create options
|
||||||
for (pov= start; pov; pov= pov->next) {
|
for (pov= start; pov; pov= pov->next) {
|
||||||
|
@ -3356,7 +3356,7 @@ bool ha_connect::pre_create(THD *thd, HA_CREATE_INFO *create_info,
|
||||||
fn= pov->value.str;
|
fn= pov->value.str;
|
||||||
} else if (!stricmp(pov->name.str, "tabname")) {
|
} else if (!stricmp(pov->name.str, "tabname")) {
|
||||||
tab= pov->value.str;
|
tab= pov->value.str;
|
||||||
} else if (!stricmp(pov->name.str, "db_name")) {
|
} else if (!stricmp(pov->name.str, "dbname")) {
|
||||||
db= pov->value.str;
|
db= pov->value.str;
|
||||||
} else if (!stricmp(pov->name.str, "catfunc")) {
|
} else if (!stricmp(pov->name.str, "catfunc")) {
|
||||||
fncn= pov->value.str;
|
fncn= pov->value.str;
|
||||||
|
@ -3375,6 +3375,7 @@ bool ha_connect::pre_create(THD *thd, HA_CREATE_INFO *create_info,
|
||||||
} else if (!stricmp(pov->name.str, "option_list")) {
|
} else if (!stricmp(pov->name.str, "option_list")) {
|
||||||
host= GetListOption("host", pov->value.str, "localhost");
|
host= GetListOption("host", pov->value.str, "localhost");
|
||||||
user= GetListOption("user", pov->value.str, "root");
|
user= GetListOption("user", pov->value.str, "root");
|
||||||
|
db= GetListOption("database", pov->value.str);
|
||||||
pwd= GetListOption("password", pov->value.str);
|
pwd= GetListOption("password", pov->value.str);
|
||||||
prt= GetListOption("port", pov->value.str);
|
prt= GetListOption("port", pov->value.str);
|
||||||
port= (prt) ? atoi(prt) : MYSQL_PORT;
|
port= (prt) ? atoi(prt) : MYSQL_PORT;
|
||||||
|
@ -3388,6 +3389,9 @@ bool ha_connect::pre_create(THD *thd, HA_CREATE_INFO *create_info,
|
||||||
end= pov;
|
end= pov;
|
||||||
} // endfor pov
|
} // endfor pov
|
||||||
|
|
||||||
|
if (!db)
|
||||||
|
db= thd->db; // Default value
|
||||||
|
|
||||||
// Check table type
|
// Check table type
|
||||||
if (ttp == TAB_UNDEF || ttp == TAB_NIY) {
|
if (ttp == TAB_UNDEF || ttp == TAB_NIY) {
|
||||||
sprintf(g->Message, "Unknown Table_type '%s'", typn);
|
sprintf(g->Message, "Unknown Table_type '%s'", typn);
|
||||||
|
|
Loading…
Reference in a new issue