You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +03:00
Merge pull request #808 from mariadb-corporation/develop-merge-up-20190729
Merge develop-1.2 into develop
This commit is contained in:
@@ -101,7 +101,7 @@ END //
|
||||
create procedure columnstore_upgrade()
|
||||
`columnstore_upgrade`: BEGIN
|
||||
DECLARE done INTEGER DEFAULT 0;
|
||||
DECLARE schema_table VARCHAR(100) DEFAULT "";
|
||||
DECLARE schema_table VARCHAR(100) CHARACTER SET utf8 DEFAULT "";
|
||||
DECLARE table_list CURSOR FOR select concat('`', table_schema,'`.`',table_name,'`') from information_schema.tables where engine='columnstore';
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
|
||||
OPEN table_list;
|
||||
@@ -115,6 +115,5 @@ create procedure columnstore_upgrade()
|
||||
DEALLOCATE PREPARE stmt;
|
||||
END LOOP;
|
||||
END //
|
||||
delimiter ;
|
||||
|
||||
DELIMITER ;
|
||||
|
@@ -1043,7 +1043,6 @@ int ha_calpont_impl_write_batch_row_(uchar* buf, TABLE* table, cal_impl_if::cal_
|
||||
dataLength = *(uint16_t*) buf;
|
||||
buf = buf + 2 ;
|
||||
}
|
||||
|
||||
escape.assign((char*)buf, dataLength);
|
||||
boost::replace_all(escape, "\\", "\\\\");
|
||||
fprintf(ci.filePtr, "%c%.*s%c%c", ci.enclosed_by, (int)escape.length(), escape.c_str(), ci.enclosed_by, ci.delimiter);
|
||||
@@ -1061,22 +1060,16 @@ int ha_calpont_impl_write_batch_row_(uchar* buf, TABLE* table, cal_impl_if::cal_
|
||||
buf = buf + 2 ;
|
||||
}
|
||||
|
||||
if ( dataLength > ci.columnTypes[colpos].colWidth)
|
||||
dataLength = ci.columnTypes[colpos].colWidth;
|
||||
|
||||
escape.assign((char*)buf, dataLength);
|
||||
boost::replace_all(escape, "\\", "\\\\");
|
||||
|
||||
fprintf(ci.filePtr, "%c%.*s%c%c", ci.enclosed_by, (int)escape.length(), escape.c_str(), ci.enclosed_by, ci.delimiter);
|
||||
}
|
||||
}
|
||||
|
||||
//buf += ci.columnTypes[colpos].colWidth;
|
||||
if (ci.utf8)
|
||||
buf += (ci.columnTypes[colpos].colWidth * 3);
|
||||
else
|
||||
buf += ci.columnTypes[colpos].colWidth;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -2363,8 +2363,15 @@ SimpleColumn* buildSimpleColFromDerivedTable(gp_walk_info& gwi, Item_field* ifp)
|
||||
sc->colPosition(j);
|
||||
string tableAlias(csep->derivedTbAlias());
|
||||
sc->tableAlias(lower(tableAlias));
|
||||
sc->viewName(lower(viewName));
|
||||
sc->timeZone(gwi.thd->variables.time_zone->get_name()->ptr());
|
||||
if (!viewName.empty())
|
||||
{
|
||||
sc->viewName(viewName);
|
||||
}
|
||||
else
|
||||
{
|
||||
sc->viewName(csep->derivedTbView());
|
||||
}
|
||||
sc->resultType(cols[j]->resultType());
|
||||
sc->hasAggregate(cols[j]->hasAggregate());
|
||||
|
||||
|
@@ -1340,16 +1340,13 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi)
|
||||
else
|
||||
schemaName = string(item->db_name);
|
||||
|
||||
columnAssignmentPtr = new ColumnAssignment(item->name.str, "=", "");
|
||||
if (item->field_type() == MYSQL_TYPE_TIMESTAMP ||
|
||||
item->field_type() == MYSQL_TYPE_TIMESTAMP2)
|
||||
{
|
||||
timeStampColumnNames.insert(string(item->name.str));
|
||||
}
|
||||
|
||||
columnAssignmentPtr = new ColumnAssignment();
|
||||
columnAssignmentPtr->fColumn = string(item->name.str);
|
||||
columnAssignmentPtr->fOperator = "=";
|
||||
columnAssignmentPtr->fFuncScale = 0;
|
||||
Item* value = value_it++;
|
||||
|
||||
if (value->type() == Item::CONST_ITEM)
|
||||
@@ -1468,8 +1465,9 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi)
|
||||
else if ( value->type() == Item::NULL_ITEM )
|
||||
{
|
||||
// dmlStmt += "NULL";
|
||||
columnAssignmentPtr->fScalarExpression = "NULL";
|
||||
columnAssignmentPtr->fScalarExpression = "";
|
||||
columnAssignmentPtr->fFromCol = false;
|
||||
columnAssignmentPtr->fIsNull = true;
|
||||
}
|
||||
else if ( value->type() == Item::SUBSELECT_ITEM )
|
||||
{
|
||||
@@ -1535,11 +1533,7 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi)
|
||||
{
|
||||
if (timeStampColumnNames.find(onUpdateTimeStampColumns[i]) == timeStampColumnNames.end())
|
||||
{
|
||||
columnAssignmentPtr = new ColumnAssignment();
|
||||
columnAssignmentPtr->fColumn = string(onUpdateTimeStampColumns[i]);
|
||||
columnAssignmentPtr->fOperator = "=";
|
||||
columnAssignmentPtr->fFuncScale = 0;
|
||||
columnAssignmentPtr->fFromCol = false;
|
||||
columnAssignmentPtr = new ColumnAssignment(string(onUpdateTimeStampColumns[i]), "=", "");
|
||||
struct timeval tv;
|
||||
char buf[64];
|
||||
gettimeofday(&tv, 0);
|
||||
|
@@ -347,6 +347,7 @@ SCSEP FromSubQuery::transform()
|
||||
gwi.subQuery = this;
|
||||
gwi.viewName = fGwip.viewName;
|
||||
csep->derivedTbAlias(fAlias); // always lower case
|
||||
csep->derivedTbView(fGwip.viewName.alias);
|
||||
|
||||
if (getSelectPlan(gwi, *fFromSub, csep, fPushdownHand) != 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user