1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

Merge pull request #1258 from dhall-MariaDB/MCOL-3536

Mcol 3536
This commit is contained in:
Patrick LeBlanc
2020-06-08 18:46:58 -05:00
committed by GitHub
105 changed files with 2207 additions and 2531 deletions

View File

@@ -17,7 +17,8 @@
MA 02110-1301, USA. */
//#define DEBUG_WALK_COND
#include <my_config.h>
#include <strings.h>
#include <string>
#include <iostream>
#include <stack>
@@ -85,6 +86,8 @@ using namespace execplan;
#include "functor.h"
using namespace funcexp;
#include "collation.h"
const uint64_t AGG_BIT = 0x01;
const uint64_t SUB_BIT = 0x02;
const uint64_t AF_BIT = 0x04;
@@ -2950,6 +2953,7 @@ SimpleColumn* getSmallestColumn(boost::shared_ptr<CalpontSystemCatalog> csc,
sc->viewName(lower(tan.view));
sc->timeZone(gwi.thd->variables.time_zone->get_name()->ptr());
sc->resultType(csc->colType(oidlist[minWidthColOffset].objnum));
sc->charsetNumber(3000);
return sc;
}
@@ -3113,7 +3117,7 @@ CalpontSystemCatalog::ColType colType_MysqlToIDB (const Item* item)
<< item->result_type() << endl );
break;
}
ct.charsetNumber = item->collation.collation->number;
return ct;
}
@@ -3406,6 +3410,9 @@ ReturnedColumn* buildReturnedColumn(
if (rc && item->name.length)
rc->alias(item->name.str);
if (rc)
rc->charsetNumber(item->collation.collation->number);
return rc;
}
@@ -4080,6 +4087,7 @@ ReturnedColumn* buildFunctionColumn(
fc->operationType(functor->operationType(funcParms, fc->resultType()));
fc->expressionId(ci->expressionId++);
fc->charsetNumber(ifp->collation.collation->number);
}
else if (ifp->type() == Item::COND_ITEM ||
ifp->functype() == Item_func::EQ_FUNC ||
@@ -4348,6 +4356,7 @@ ConstantColumn* buildDecimalColumn(Item* item, gp_walk_info& gwi)
columnstore_decimal.precision = idp->max_length - idp->decimals;
ConstantColumn* cc = new ConstantColumn(valStr, columnstore_decimal);
cc->timeZone(gwi.thd->variables.time_zone->get_name()->ptr());
cc->charsetNumber(idp->collation.collation->number);
return cc;
}
@@ -4467,8 +4476,8 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi)
default:
sc = new SimpleColumn(ifp->db_name.str, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
}
sc->resultType(ct);
sc->charsetNumber(ifp->collation.collation->number);
string tbname(ifp->table_name.str);
if (isInformationSchema)
@@ -5004,6 +5013,7 @@ ReturnedColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi)
colType.dataType = resultType.colDataType;
colType.precision = resultType.precision;
colType.scale = resultType.scale;
colType.charsetNumber = resultType.charsetNumber;
colTypes[i] = colType;
}
@@ -5079,6 +5089,7 @@ ReturnedColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi)
return NULL;
}
ac->charsetNumber(item->collation.collation->number);
return ac;
}
@@ -6706,7 +6717,8 @@ int processLimitAndOffset(
}
// We don't currently support limit with correlated subquery
if (gwi.subQuery && !gwi.correlatedTbNameVec.empty() && csep->hasOrderBy())
if (csep->limitNum() != (uint64_t) - 1 &&
gwi.subQuery && !gwi.correlatedTbNameVec.empty())
{
gwi.fatalParseError = true;
gwi.parseErrorText = IDBErrorInfo::instance()->errorMsg(ERR_NON_SUPPORT_LIMIT_SUB);

View File

@@ -405,6 +405,7 @@ ReturnedColumn* buildWindowFunctionColumn(Item* item, gp_walk_info& gwi, bool& n
colType.dataType = resultType.colDataType;
colType.precision = resultType.precision;
colType.scale = resultType.scale;
colType.charsetNumber = resultType.charsetNumber;
colTypes[i] = colType;
}
@@ -938,6 +939,8 @@ ReturnedColumn* buildWindowFunctionColumn(Item* item, gp_walk_info& gwi, bool& n
if (item->full_name())
ac->alias(item->full_name());
ac->charsetNumber(item->collation.collation->number);
// put ac on windowFuncList
gwi.windowFuncList.push_back(ac);
return ac;

View File

@@ -20,7 +20,8 @@
*
***********************************************************************/
#include <my_global.h>
#include <mariadb.h>
#include <mysql.h>
#include <my_sys.h>
#include <errmsg.h>