summaryrefslogtreecommitdiff
path: root/storage/connect/connect.cc
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2015-01-06 10:18:04 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2015-01-06 10:18:04 +0100
commitafd373c11951f48f7f9dde9990e7be2c76456559 (patch)
tree9744ecf79636c1ffd9e59e1bf05d22b2f3649edf /storage/connect/connect.cc
parent8761f22a11e3ebe9563b93bb79cb65260b177873 (diff)
downloadmariadb-git-afd373c11951f48f7f9dde9990e7be2c76456559.tar.gz
- Set connection charset before calling mysql_real_connect for MYSQL
tables. This should fix bug MDEV-7343. modified: storage/connect/ha_connect.cc storage/connect/myconn.cpp storage/connect/myconn.h storage/connect/reldef.cpp storage/connect/reldef.h storage/connect/table.cpp storage/connect/tabmysql.cpp storage/connect/xtable.h - Prevent double column evaluation when CONNECT does filtering modified: storage/connect/connect.cc - Export CreateFileMap and CloseMemMap (for OEM tables) modified: storage/connect/maputil.h - Add the compute function to be used on VALUE types. Preserve precision for DOUBLE values. modified: storage/connect/value.cpp storage/connect/value.h - Typo (in preparation to the future JSON table type) modified: storage/connect/ha_connect.cc storage/connect/mycat.cc storage/connect/plgdbsem.h
Diffstat (limited to 'storage/connect/connect.cc')
-rw-r--r--storage/connect/connect.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc
index 87c782ba953..a54d8ebcc44 100644
--- a/storage/connect/connect.cc
+++ b/storage/connect/connect.cc
@@ -52,7 +52,7 @@
/* Routines called internally by semantic routines. */
/***********************************************************************/
void CntEndDB(PGLOBAL);
-RCODE EvalColumns(PGLOBAL g, PTDB tdbp, bool mrr= false);
+RCODE EvalColumns(PGLOBAL g, PTDB tdbp, bool reset, bool mrr= false);
/***********************************************************************/
/* MySQL routines called externally by semantic routines. */
@@ -388,7 +388,7 @@ bool CntRewindTable(PGLOBAL g, PTDB tdbp)
/***********************************************************************/
/* Evaluate all columns after a record is read. */
/***********************************************************************/
-RCODE EvalColumns(PGLOBAL g, PTDB tdbp, bool mrr)
+RCODE EvalColumns(PGLOBAL g, PTDB tdbp, bool reset, bool mrr)
{
RCODE rc= RC_OK;
PCOL colp;
@@ -413,7 +413,8 @@ RCODE EvalColumns(PGLOBAL g, PTDB tdbp, bool mrr)
for (colp= tdbp->GetColumns(); rc == RC_OK && colp;
colp= colp->GetNext()) {
- colp->Reset();
+ if (reset)
+ colp->Reset();
// Virtual columns are computed by MariaDB
if (!colp->GetColUse(U_VIRTUAL) && (!mrr || colp->GetKcol()))
@@ -457,6 +458,10 @@ RCODE CntReadNext(PGLOBAL g, PTDB tdbp)
goto err;
} // endif rc
+ // Do it now to avoid double eval when filtering
+ for (PCOL colp= tdbp->GetColumns(); colp; colp= colp->GetNext())
+ colp->Reset();
+
do {
if ((rc= (RCODE)tdbp->ReadDB(g)) == RC_OK)
if (!ApplyFilter(g, tdbp->GetFilter()))
@@ -466,7 +471,7 @@ RCODE CntReadNext(PGLOBAL g, PTDB tdbp)
err:
g->jump_level--;
- return (rc != RC_OK) ? rc : EvalColumns(g, tdbp);
+ return (rc != RC_OK) ? rc : EvalColumns(g, tdbp, false);
} // end of CntReadNext
/***********************************************************************/
@@ -812,7 +817,7 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
rnd:
if ((rc= (RCODE)ptdb->ReadDB(g)) == RC_OK)
- rc= EvalColumns(g, ptdb, mrr);
+ rc= EvalColumns(g, ptdb, true, mrr);
return rc;
} // end of CntIndexRead