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

Merge branch 'develop-1.2' into develop-merge-up-20190729

This commit is contained in:
Andrew Hutchings
2019-07-29 12:19:26 +01:00
36 changed files with 366 additions and 175 deletions

View File

@@ -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 ;

View File

@@ -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;
}

View File

@@ -2203,8 +2203,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());

View File

@@ -749,8 +749,7 @@ int fetchNextRow(uchar* buf, cal_table_info& ti, cal_connection_info* ci, bool h
// bug 3485, reserve enough space for the longest float value
// -3.402823466E+38 to -1.175494351E-38, 0, and
// 1.175494351E-38 to 3.402823466E+38.
(*f)->field_length = 40;
(*f)->field_length = 40;
//float float_val = *(float*)(&value);
//f2->store(float_val);
if (f2->decimals() < (uint32_t)row.getScale(s))
@@ -779,8 +778,7 @@ int fetchNextRow(uchar* buf, cal_table_info& ti, cal_connection_info* ci, bool h
// bug 3483, reserve enough space for the longest double value
// -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and
// 2.2250738585072014E-308 to 1.7976931348623157E+308.
(*f)->field_length = 310;
(*f)->field_length = 310;
//double double_val = *(double*)(&value);
//f2->store(double_val);
if ((f2->decimals() == DECIMAL_NOT_SPECIFIED && row.getScale(s) > 0)
@@ -1395,16 +1393,13 @@ uint32_t doUpdateDelete(THD* thd)
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::STRING_ITEM)
@@ -1528,8 +1523,9 @@ uint32_t doUpdateDelete(THD* thd)
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 )
{

View File

@@ -344,6 +344,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) != 0)
{