diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2015-01-17 12:19:06 +0100 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2015-01-17 12:19:06 +0100 |
commit | fb3f46967cfe4f3f28d13f5083a76b7c939e2724 (patch) | |
tree | 2c4cc4a929cc3dce61ce7203340a79814c47392a | |
parent | 70b4e6d368671773cb75830b672c871b2c47b887 (diff) | |
download | mariadb-git-fb3f46967cfe4f3f28d13f5083a76b7c939e2724.tar.gz |
- Fix two bugs concerning Discovery of CSV tables:
Sep_char default is now ',' like when discovery is not used
If data_charset is UTF8, column names retrieved from the header
are no longer converted to UTF8 considering they already are (MDEV-7421)
modified:
storage/connect/ha_connect.cc
-rw-r--r-- | storage/connect/ha_connect.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 1eab61f9115..eee0c334bb1 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -4867,7 +4867,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, fncn= topt->catfunc; fnc= GetFuncID(fncn); sep= topt->separator; - spc= (!sep || !strcmp(sep, "\\t")) ? '\t' : *sep; + spc= (!sep) ? ',' : (!strcmp(sep, "\\t")) ? '\t' : *sep; qch= topt->qchar ? *topt->qchar : (signed)topt->quoted >= 0 ? '"' : 0; hdr= (int)topt->header; tbl= topt->tablist; @@ -5237,7 +5237,13 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, for (crp= qrp->Colresp; crp; crp= crp->Next) switch (crp->Fld) { case FLD_NAME: - cnm= encode(g, crp->Kdata->GetCharValue(i)); + if (ttp == TAB_CSV && topt->data_charset && + (!stricmp(topt->data_charset, "UTF8") || + !stricmp(topt->data_charset, "UTF-8"))) + cnm= crp->Kdata->GetCharValue(i); + else + cnm= encode(g, crp->Kdata->GetCharValue(i)); + break; case FLD_TYPE: typ= crp->Kdata->GetIntValue(i); |