summaryrefslogtreecommitdiff
path: root/storage/connect/mycat.cc
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2013-05-24 00:19:26 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2013-05-24 00:19:26 +0200
commit33b95315680e42754d41f63f72a003f0d69959d3 (patch)
tree3d44c9739a99883376492b047ca97a4276744561 /storage/connect/mycat.cc
parent7ef4c5df470e2c1ee0d5e7b57e05deebdcad753e (diff)
downloadmariadb-git-33b95315680e42754d41f63f72a003f0d69959d3.tar.gz
- Fix setting default type to MYSQL->PROXY->DOS in some places where it
was not done correctly. - Fix a bug causing add_field to generate a syntax error on DOUBLE columns with a 0 decimal value. - Column can be undefined when Srcdef is specified. modified: storage/connect/ha_connect.cc storage/connect/mycat.cc storage/connect/tabmysql.cpp storage/connect/tabutil.cpp storage/connect/tabutil.h
Diffstat (limited to 'storage/connect/mycat.cc')
-rw-r--r--storage/connect/mycat.cc33
1 files changed, 18 insertions, 15 deletions
diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc
index b5767b02180..e243a706f01 100644
--- a/storage/connect/mycat.cc
+++ b/storage/connect/mycat.cc
@@ -390,20 +390,23 @@ char *MYCAT::GetStringCatInfo(PGLOBAL g, PSZ what, PSZ sdef)
strcpy(sval, s);
} else if (!stricmp(what, "filename")) {
// Return default file name
- char *ftype= Hc->GetStringOption("Type", "dos");
+ char *ftype= Hc->GetStringOption("Type", "*");
int i, n;
- sval= (char*)PlugSubAlloc(g, NULL, strlen(Hc->GetTableName()) + 12);
- strcat(strcpy(sval, Hc->GetTableName()), ".");
- n= strlen(sval);
-
- // Fold ftype to lower case
- for (i= 0; i < 12; i++)
- if (!ftype[i]) {
- sval[n+i]= 0;
- break;
- } else
- sval[n+i]= tolower(ftype[i]);
+ if (IsFileType(GetTypeID(ftype))) {
+ sval= (char*)PlugSubAlloc(g, NULL, strlen(Hc->GetTableName()) + 12);
+ strcat(strcpy(sval, Hc->GetTableName()), ".");
+ n= strlen(sval);
+
+ // Fold ftype to lower case
+ for (i= 0; i < 12; i++)
+ if (!ftype[i]) {
+ sval[n+i]= 0;
+ break;
+ } else
+ sval[n+i]= tolower(ftype[i]);
+
+ } // endif FileType
} else
sval = NULL;
@@ -416,7 +419,7 @@ char *MYCAT::GetStringCatInfo(PGLOBAL g, PSZ what, PSZ sdef)
/***********************************************************************/
int MYCAT::GetColCatInfo(PGLOBAL g, PTABDEF defp)
{
- char *type= GetStringCatInfo(g, "Type", "DOS");
+ char *type= GetStringCatInfo(g, "Type", "*");
int i, loff, poff, nof, nlg;
void *field= NULL;
TABTYPE tc;
@@ -598,8 +601,8 @@ PRELDEF MYCAT::GetTableDesc(PGLOBAL g, LPCSTR name,
printf("GetTableDesc: name=%s am=%s\n", name, SVP(type));
// If not specified get the type of this table
- if (!type && !(type= Hc->GetStringOption("Type")))
- type= (Hc->GetStringOption("Tabname")) ? "PROXY" : "DOS";
+ if (!type)
+ type= Hc->GetStringOption("Type","*");
return MakeTableDesc(g, name, type);
} // end of GetTableDesc