summaryrefslogtreecommitdiff
path: root/storage/connect/tabfmt.cpp
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2014-08-23 19:17:15 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2014-08-23 19:17:15 +0200
commit74a46726227b5f34dedb28ff6d7a4d81b157d764 (patch)
tree9c2d6fdebca4cf11ccb3b65c02a27633c1010212 /storage/connect/tabfmt.cpp
parentf930f4eda9dd849b48e67eaecc8c130bb9310107 (diff)
downloadmariadb-git-74a46726227b5f34dedb28ff6d7a4d81b157d764.tar.gz
- Move DataPath from the MYCAT catalog to the ha_connect handler. Indeed
it belongs to each tables and the catalog being share between several instances of CONNECT, when a query implied several tables belonging to different databases, some where pointing on the wrong database. This fix bugs occuring in queries such as: INSERT into db1.t1 select * from db2.t2; Where the t1 data file was made in db2. modified: storage/connect/catalog.h storage/connect/connect.cc storage/connect/filamdbf.cpp storage/connect/filamdbf.h storage/connect/ha_connect.cc storage/connect/ha_connect.h storage/connect/mycat.cc storage/connect/mycat.h storage/connect/plgdbsem.h storage/connect/plgdbutl.cpp storage/connect/reldef.cpp storage/connect/reldef.h storage/connect/tabfix.h storage/connect/tabfmt.cpp storage/connect/tabfmt.h storage/connect/tabmul.cpp
Diffstat (limited to 'storage/connect/tabfmt.cpp')
-rw-r--r--storage/connect/tabfmt.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/storage/connect/tabfmt.cpp b/storage/connect/tabfmt.cpp
index a011b62dc7c..c1119c57065 100644
--- a/storage/connect/tabfmt.cpp
+++ b/storage/connect/tabfmt.cpp
@@ -76,8 +76,8 @@ extern "C" USETEMP Use_Temp;
/* of types (TYPE_STRING < TYPE_DOUBLE < TYPE_INT) (1 < 2 < 7). */
/* If these values are changed, this will have to be revisited. */
/***********************************************************************/
-PQRYRES CSVColumns(PGLOBAL g, const char *fn, char sep, char q,
- int hdr, int mxr, bool info)
+PQRYRES CSVColumns(PGLOBAL g, char *dp, const char *fn, char sep,
+ char q, int hdr, int mxr, bool info)
{
static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
TYPE_INT, TYPE_INT, TYPE_SHORT};
@@ -131,7 +131,7 @@ PQRYRES CSVColumns(PGLOBAL g, const char *fn, char sep, char q,
/*********************************************************************/
/* Open the input file. */
/*********************************************************************/
- PlugSetPath(filename, fn, PlgGetDataPath(g));
+ PlugSetPath(filename, fn, dp);
if (!(infile= global_fopen(g, MSGID_CANNOT_OPEN, filename, "r")))
return NULL;
@@ -1471,7 +1471,8 @@ TDBCCL::TDBCCL(PCSVDEF tdp) : TDBCAT(tdp)
/***********************************************************************/
PQRYRES TDBCCL::GetResult(PGLOBAL g)
{
- return CSVColumns(g, Fn, Sep, Qtd, Hdr, Mxr, false);
+ return CSVColumns(g, ((PTABDEF)To_Def)->GetPath(),
+ Fn, Sep, Qtd, Hdr, Mxr, false);
} // end of GetResult
/* ------------------------ End of TabFmt ---------------------------- */