You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MariaDB 10.5 Compatibility
Several changes have happened in MariaDB 10.5, most notably: * Information Schema table definitions have changed * More things use LEX_CSTRING This fixes all the compile issues
This commit is contained in:
@ -149,7 +149,6 @@ static int columnstore_init_func(void* p)
|
|||||||
(void) my_hash_init(&calpont_open_tables, system_charset_info, 32, 0, 0,
|
(void) my_hash_init(&calpont_open_tables, system_charset_info, 32, 0, 0,
|
||||||
(my_hash_get_key) calpont_get_key, 0, 0);
|
(my_hash_get_key) calpont_get_key, 0, 0);
|
||||||
|
|
||||||
mcs_hton->state = SHOW_OPTION_YES;
|
|
||||||
mcs_hton->create = calpont_create_handler;
|
mcs_hton->create = calpont_create_handler;
|
||||||
mcs_hton->flags = HTON_CAN_RECREATE;
|
mcs_hton->flags = HTON_CAN_RECREATE;
|
||||||
// mcs_hton->discover_table= calpont_discover;
|
// mcs_hton->discover_table= calpont_discover;
|
||||||
|
@ -215,13 +215,13 @@ void getColNameFromItem(std::ostringstream& ostream, Item* item)
|
|||||||
{
|
{
|
||||||
Item_ident* iip = reinterpret_cast<Item_ident*>(item);
|
Item_ident* iip = reinterpret_cast<Item_ident*>(item);
|
||||||
|
|
||||||
if (iip->db_name)
|
if (iip->db_name.str)
|
||||||
ostream << iip->db_name << '.';
|
ostream << iip->db_name.str << '.';
|
||||||
else
|
else
|
||||||
ostream << "unknown db" << '.';
|
ostream << "unknown db" << '.';
|
||||||
|
|
||||||
if (iip->table_name)
|
if (iip->table_name.str)
|
||||||
ostream << iip->table_name << '.';
|
ostream << iip->table_name.str << '.';
|
||||||
else
|
else
|
||||||
ostream << "unknown table" << '.';
|
ostream << "unknown table" << '.';
|
||||||
|
|
||||||
@ -502,7 +502,7 @@ void debug_walk(const Item* item, void* arg)
|
|||||||
case Item::FIELD_ITEM:
|
case Item::FIELD_ITEM:
|
||||||
{
|
{
|
||||||
Item_field* ifp = (Item_field*)item;
|
Item_field* ifp = (Item_field*)item;
|
||||||
cerr << "FIELD_ITEM: " << (ifp->db_name ? ifp->db_name : "") << '.' << bestTableName(ifp) <<
|
cerr << "FIELD_ITEM: " << (ifp->db_name.str ? ifp->db_name.str : "") << '.' << bestTableName(ifp) <<
|
||||||
'.' << ifp->field_name.str << endl;
|
'.' << ifp->field_name.str << endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -912,7 +912,7 @@ void debug_walk(const Item* item, void* arg)
|
|||||||
//ifp->cached_table->select_lex->select_number gives the select level.
|
//ifp->cached_table->select_lex->select_number gives the select level.
|
||||||
// could be used on alias.
|
// could be used on alias.
|
||||||
// could also be used to tell correlated join (equal level).
|
// could also be used to tell correlated join (equal level).
|
||||||
cerr << "CACHED REF FIELD_ITEM: " << ifp->db_name << '.' << bestTableName(ifp) <<
|
cerr << "CACHED REF FIELD_ITEM: " << ifp->db_name.str << '.' << bestTableName(ifp) <<
|
||||||
'.' << ifp->field_name.str << endl;
|
'.' << ifp->field_name.str << endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -960,7 +960,7 @@ void debug_walk(const Item* item, void* arg)
|
|||||||
{
|
{
|
||||||
Item_field* ifp = (Item_field*)(*(ifr->ref));
|
Item_field* ifp = (Item_field*)(*(ifr->ref));
|
||||||
realType = "FIELD_ITEM ";
|
realType = "FIELD_ITEM ";
|
||||||
realType += ifp->db_name;
|
realType += ifp->db_name.str;
|
||||||
realType += '.';
|
realType += '.';
|
||||||
realType += bestTableName(ifp);
|
realType += bestTableName(ifp);
|
||||||
realType += '.';
|
realType += '.';
|
||||||
@ -1019,7 +1019,7 @@ void debug_walk(const Item* item, void* arg)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cerr << "REF FIELD_ITEM: " << ifp->db_name << '.' << bestTableName(ifp) << '.' <<
|
cerr << "REF FIELD_ITEM: " << ifp->db_name.str << '.' << bestTableName(ifp) << '.' <<
|
||||||
ifp->field_name.str << endl;
|
ifp->field_name.str << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1104,7 +1104,7 @@ void debug_walk(const Item* item, void* arg)
|
|||||||
//ifp->cached_table->select_lex->select_number gives the select level.
|
//ifp->cached_table->select_lex->select_number gives the select level.
|
||||||
// could be used on alias.
|
// could be used on alias.
|
||||||
// could also be used to tell correlated join (equal level).
|
// could also be used to tell correlated join (equal level).
|
||||||
cerr << "CACHED FIELD_ITEM: " << ifp->db_name << '.' << bestTableName(ifp) <<
|
cerr << "CACHED FIELD_ITEM: " << ifp->db_name.str << '.' << bestTableName(ifp) <<
|
||||||
'.' << ifp->field_name.str << endl;
|
'.' << ifp->field_name.str << endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1147,7 +1147,7 @@ void debug_walk(const Item* item, void* arg)
|
|||||||
{
|
{
|
||||||
Item_field* ifp = (Item_field*)(*(ifr->ref));
|
Item_field* ifp = (Item_field*)(*(ifr->ref));
|
||||||
realType = "FIELD_ITEM ";
|
realType = "FIELD_ITEM ";
|
||||||
realType += ifp->db_name;
|
realType += ifp->db_name.str;
|
||||||
realType += '.';
|
realType += '.';
|
||||||
realType += bestTableName(ifp);
|
realType += bestTableName(ifp);
|
||||||
realType += '.';
|
realType += '.';
|
||||||
@ -2350,7 +2350,7 @@ SimpleColumn* buildSimpleColFromDerivedTable(gp_walk_info& gwi, Item_field* ifp)
|
|||||||
if (sc) break;
|
if (sc) break;
|
||||||
|
|
||||||
if (!gwi.tbList[i].schema.empty() && !gwi.tbList[i].table.empty() &&
|
if (!gwi.tbList[i].schema.empty() && !gwi.tbList[i].table.empty() &&
|
||||||
(!ifp->table_name || strcasecmp(ifp->table_name, gwi.tbList[i].alias.c_str()) == 0))
|
(!ifp->table_name.str || strcasecmp(ifp->table_name.str, gwi.tbList[i].alias.c_str()) == 0))
|
||||||
{
|
{
|
||||||
CalpontSystemCatalog::TableName tn(gwi.tbList[i].schema, gwi.tbList[i].table);
|
CalpontSystemCatalog::TableName tn(gwi.tbList[i].schema, gwi.tbList[i].table);
|
||||||
CalpontSystemCatalog::RIDList oidlist = gwi.csc->columnRIDs(tn, true);
|
CalpontSystemCatalog::RIDList oidlist = gwi.csc->columnRIDs(tn, true);
|
||||||
@ -2405,7 +2405,7 @@ SimpleColumn* buildSimpleColFromDerivedTable(gp_walk_info& gwi, Item_field* ifp)
|
|||||||
CalpontSelectExecutionPlan* csep = dynamic_cast<CalpontSelectExecutionPlan*>(gwi.derivedTbList[i].get());
|
CalpontSelectExecutionPlan* csep = dynamic_cast<CalpontSelectExecutionPlan*>(gwi.derivedTbList[i].get());
|
||||||
string derivedName = csep->derivedTbAlias();
|
string derivedName = csep->derivedTbAlias();
|
||||||
|
|
||||||
if (!ifp->table_name || strcasecmp(ifp->table_name, derivedName.c_str()) == 0)
|
if (!ifp->table_name.str || strcasecmp(ifp->table_name.str, derivedName.c_str()) == 0)
|
||||||
{
|
{
|
||||||
CalpontSelectExecutionPlan::ReturnedColumnList cols = csep->returnedCols();
|
CalpontSelectExecutionPlan::ReturnedColumnList cols = csep->returnedCols();
|
||||||
|
|
||||||
@ -2468,7 +2468,7 @@ SimpleColumn* buildSimpleColFromDerivedTable(gp_walk_info& gwi, Item_field* ifp)
|
|||||||
|
|
||||||
while (tblList)
|
while (tblList)
|
||||||
{
|
{
|
||||||
if (strcasecmp(tblList->alias.str, ifp->table_name) == 0)
|
if (strcasecmp(tblList->alias.str, ifp->table_name.str) == 0)
|
||||||
{
|
{
|
||||||
if (!tblList->outer_join)
|
if (!tblList->outer_join)
|
||||||
{
|
{
|
||||||
@ -2495,11 +2495,11 @@ SimpleColumn* buildSimpleColFromDerivedTable(gp_walk_info& gwi, Item_field* ifp)
|
|||||||
Message::Args args;
|
Message::Args args;
|
||||||
string name;
|
string name;
|
||||||
|
|
||||||
if (ifp->db_name)
|
if (ifp->db_name.str)
|
||||||
name += string(ifp->db_name) + ".";
|
name += string(ifp->db_name.str) + ".";
|
||||||
|
|
||||||
if (ifp->table_name)
|
if (ifp->table_name.str)
|
||||||
name += string(ifp->table_name) + ".";
|
name += string(ifp->table_name.str) + ".";
|
||||||
|
|
||||||
if (ifp->name.length)
|
if (ifp->name.length)
|
||||||
name += ifp->name.str;
|
name += ifp->name.str;
|
||||||
@ -2543,7 +2543,7 @@ void collectAllCols(gp_walk_info& gwi, Item_field* ifp)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string tableName = (ifp->table_name ? string(ifp->table_name) : "");
|
string tableName = (ifp->table_name.str ? string(ifp->table_name.str) : "");
|
||||||
CalpontSelectExecutionPlan::SelectList::const_iterator it = gwi.derivedTbList.begin();
|
CalpontSelectExecutionPlan::SelectList::const_iterator it = gwi.derivedTbList.begin();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < gwi.tbList.size(); i++)
|
for (uint32_t i = 0; i < gwi.tbList.size(); i++)
|
||||||
@ -2753,13 +2753,13 @@ const string bestTableName(const Item_field* ifp)
|
|||||||
{
|
{
|
||||||
idbassert(ifp);
|
idbassert(ifp);
|
||||||
|
|
||||||
if (!ifp->table_name)
|
if (!ifp->table_name.str)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
if (!ifp->field)
|
if (!ifp->field)
|
||||||
return ifp->table_name;
|
return ifp->table_name.str;
|
||||||
|
|
||||||
string table_name(ifp->table_name);
|
string table_name(ifp->table_name.str);
|
||||||
string field_table_table_name;
|
string field_table_table_name;
|
||||||
|
|
||||||
if (ifp->cached_table)
|
if (ifp->cached_table)
|
||||||
@ -4362,7 +4362,7 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi)
|
|||||||
isInformationSchema = true;
|
isInformationSchema = true;
|
||||||
|
|
||||||
// support FRPM subquery. columns from the derived table has no definition
|
// support FRPM subquery. columns from the derived table has no definition
|
||||||
if ((!ifp->field || !ifp->db_name || strlen(ifp->db_name) == 0) && !isInformationSchema)
|
if ((!ifp->field || !ifp->db_name.str || strlen(ifp->db_name.str) == 0) && !isInformationSchema)
|
||||||
return buildSimpleColFromDerivedTable(gwi, ifp);
|
return buildSimpleColFromDerivedTable(gwi, ifp);
|
||||||
|
|
||||||
CalpontSystemCatalog::ColType ct;
|
CalpontSystemCatalog::ColType ct;
|
||||||
@ -4380,7 +4380,7 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi)
|
|||||||
if (columnStore)
|
if (columnStore)
|
||||||
{
|
{
|
||||||
ct = gwi.csc->colType(
|
ct = gwi.csc->colType(
|
||||||
gwi.csc->lookupOID(make_tcn(ifp->db_name, bestTableName(ifp), ifp->field_name.str)));
|
gwi.csc->lookupOID(make_tcn(ifp->db_name.str, bestTableName(ifp), ifp->field_name.str)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -4400,10 +4400,10 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi)
|
|||||||
{
|
{
|
||||||
case CalpontSystemCatalog::TINYINT:
|
case CalpontSystemCatalog::TINYINT:
|
||||||
if (ct.scale == 0)
|
if (ct.scale == 0)
|
||||||
sc = new SimpleColumn_INT<1>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
sc = new SimpleColumn_INT<1>(ifp->db_name.str, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sc = new SimpleColumn_Decimal<1>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
sc = new SimpleColumn_Decimal<1>(ifp->db_name.str, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||||
ct.colDataType = CalpontSystemCatalog::DECIMAL;
|
ct.colDataType = CalpontSystemCatalog::DECIMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4411,10 +4411,10 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi)
|
|||||||
|
|
||||||
case CalpontSystemCatalog::SMALLINT:
|
case CalpontSystemCatalog::SMALLINT:
|
||||||
if (ct.scale == 0)
|
if (ct.scale == 0)
|
||||||
sc = new SimpleColumn_INT<2>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
sc = new SimpleColumn_INT<2>(ifp->db_name.str, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sc = new SimpleColumn_Decimal<2>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
sc = new SimpleColumn_Decimal<2>(ifp->db_name.str, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||||
ct.colDataType = CalpontSystemCatalog::DECIMAL;
|
ct.colDataType = CalpontSystemCatalog::DECIMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4423,10 +4423,10 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi)
|
|||||||
case CalpontSystemCatalog::INT:
|
case CalpontSystemCatalog::INT:
|
||||||
case CalpontSystemCatalog::MEDINT:
|
case CalpontSystemCatalog::MEDINT:
|
||||||
if (ct.scale == 0)
|
if (ct.scale == 0)
|
||||||
sc = new SimpleColumn_INT<4>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
sc = new SimpleColumn_INT<4>(ifp->db_name.str, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sc = new SimpleColumn_Decimal<4>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
sc = new SimpleColumn_Decimal<4>(ifp->db_name.str, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||||
ct.colDataType = CalpontSystemCatalog::DECIMAL;
|
ct.colDataType = CalpontSystemCatalog::DECIMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4434,38 +4434,38 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi)
|
|||||||
|
|
||||||
case CalpontSystemCatalog::BIGINT:
|
case CalpontSystemCatalog::BIGINT:
|
||||||
if (ct.scale == 0)
|
if (ct.scale == 0)
|
||||||
sc = new SimpleColumn_INT<8>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
sc = new SimpleColumn_INT<8>(ifp->db_name.str, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sc = new SimpleColumn_Decimal<8>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
sc = new SimpleColumn_Decimal<8>(ifp->db_name.str, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||||
ct.colDataType = CalpontSystemCatalog::DECIMAL;
|
ct.colDataType = CalpontSystemCatalog::DECIMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CalpontSystemCatalog::UTINYINT:
|
case CalpontSystemCatalog::UTINYINT:
|
||||||
sc = new SimpleColumn_UINT<1>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
sc = new SimpleColumn_UINT<1>(ifp->db_name.str, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CalpontSystemCatalog::USMALLINT:
|
case CalpontSystemCatalog::USMALLINT:
|
||||||
sc = new SimpleColumn_UINT<2>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
sc = new SimpleColumn_UINT<2>(ifp->db_name.str, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CalpontSystemCatalog::UINT:
|
case CalpontSystemCatalog::UINT:
|
||||||
case CalpontSystemCatalog::UMEDINT:
|
case CalpontSystemCatalog::UMEDINT:
|
||||||
sc = new SimpleColumn_UINT<4>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
sc = new SimpleColumn_UINT<4>(ifp->db_name.str, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CalpontSystemCatalog::UBIGINT:
|
case CalpontSystemCatalog::UBIGINT:
|
||||||
sc = new SimpleColumn_UINT<8>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
sc = new SimpleColumn_UINT<8>(ifp->db_name.str, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
sc = new SimpleColumn(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
sc = new SimpleColumn(ifp->db_name.str, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||||
}
|
}
|
||||||
|
|
||||||
sc->resultType(ct);
|
sc->resultType(ct);
|
||||||
string tbname(ifp->table_name);
|
string tbname(ifp->table_name.str);
|
||||||
|
|
||||||
if (isInformationSchema)
|
if (isInformationSchema)
|
||||||
{
|
{
|
||||||
@ -5391,8 +5391,8 @@ void gp_walk(const Item* item, void* arg)
|
|||||||
|
|
||||||
for (uint32_t i = 0; i < tmpVec.size(); i++)
|
for (uint32_t i = 0; i < tmpVec.size(); i++)
|
||||||
{
|
{
|
||||||
if (tmpVec[i]->table_name)
|
if (tmpVec[i]->table_name.str)
|
||||||
tableSet.insert(tmpVec[i]->table_name);
|
tableSet.insert(tmpVec[i]->table_name.str);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tableSet.size() > 1)
|
if (tableSet.size() > 1)
|
||||||
@ -7944,8 +7944,8 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex,
|
|||||||
}
|
}
|
||||||
else if (join->unit)
|
else if (join->unit)
|
||||||
{
|
{
|
||||||
limitOffset = join->unit->offset_limit_cnt;
|
limitOffset = join->unit->lim.get_offset_limit();
|
||||||
limitNum = join->unit->select_limit_cnt - limitOffset;
|
limitNum = join->unit->lim.get_select_limit() - limitOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@ -9818,11 +9818,11 @@ int getGroupPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, cal_gro
|
|||||||
Item_field* field = reinterpret_cast<Item_field*>(ord_item);
|
Item_field* field = reinterpret_cast<Item_field*>(ord_item);
|
||||||
string fullname;
|
string fullname;
|
||||||
|
|
||||||
if (field->db_name)
|
if (field->db_name.str)
|
||||||
fullname += string(field->db_name) + ".";
|
fullname += string(field->db_name.str) + ".";
|
||||||
|
|
||||||
if (field->table_name)
|
if (field->table_name.str)
|
||||||
fullname += string(field->table_name) + ".";
|
fullname += string(field->table_name.str) + ".";
|
||||||
|
|
||||||
if (field->field_name.length)
|
if (field->field_name.length)
|
||||||
fullname += string(field->field_name.str);
|
fullname += string(field->field_name.str);
|
||||||
|
@ -1336,10 +1336,10 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi)
|
|||||||
string tmpTableName = bestTableName(item);
|
string tmpTableName = bestTableName(item);
|
||||||
|
|
||||||
//@Bug 5312 populate aliasname with tablename if it is empty
|
//@Bug 5312 populate aliasname with tablename if it is empty
|
||||||
if (!item->table_name)
|
if (!item->table_name.str)
|
||||||
aliasName = tmpTableName;
|
aliasName = tmpTableName;
|
||||||
else
|
else
|
||||||
aliasName = item->table_name;
|
aliasName = item->table_name.str;
|
||||||
|
|
||||||
if (strcasecmp(tableName.c_str(), "") == 0)
|
if (strcasecmp(tableName.c_str(), "") == 0)
|
||||||
{
|
{
|
||||||
@ -1355,7 +1355,7 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!item->db_name)
|
if (!item->db_name.str)
|
||||||
{
|
{
|
||||||
//@Bug 5312. if subselect, wait until the schema info is available.
|
//@Bug 5312. if subselect, wait until the schema info is available.
|
||||||
if (thd->derived_tables_processing)
|
if (thd->derived_tables_processing)
|
||||||
@ -1369,7 +1369,7 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
schemaName = string(item->db_name);
|
schemaName = string(item->db_name.str);
|
||||||
|
|
||||||
columnAssignmentPtr = new ColumnAssignment(item->name.str, "=", "");
|
columnAssignmentPtr = new ColumnAssignment(item->name.str, "=", "");
|
||||||
if (item->field_type() == MYSQL_TYPE_TIMESTAMP ||
|
if (item->field_type() == MYSQL_TYPE_TIMESTAMP ||
|
||||||
@ -1460,9 +1460,9 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi)
|
|||||||
{
|
{
|
||||||
sectableName = bestTableName(tmpVec[i]);
|
sectableName = bestTableName(tmpVec[i]);
|
||||||
|
|
||||||
if ( tmpVec[i]->db_name )
|
if ( tmpVec[i]->db_name.str )
|
||||||
{
|
{
|
||||||
secschemaName = string(tmpVec[i]->db_name);
|
secschemaName = string(tmpVec[i]->db_name.str);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (strcasecmp(tableName.c_str(), sectableName.c_str()) != 0) ||
|
if ( (strcasecmp(tableName.c_str(), sectableName.c_str()) != 0) ||
|
||||||
@ -1479,11 +1479,11 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi)
|
|||||||
isFromCol = true;
|
isFromCol = true;
|
||||||
columnAssignmentPtr->fFromCol = true;
|
columnAssignmentPtr->fFromCol = true;
|
||||||
Item_field* setIt = reinterpret_cast<Item_field*> (value);
|
Item_field* setIt = reinterpret_cast<Item_field*> (value);
|
||||||
string sectableName = string(setIt->table_name);
|
string sectableName = string(setIt->table_name.str);
|
||||||
|
|
||||||
if ( setIt->db_name ) //derived table
|
if ( setIt->db_name.str ) //derived table
|
||||||
{
|
{
|
||||||
string secschemaName = string(setIt->db_name);
|
string secschemaName = string(setIt->db_name.str);
|
||||||
|
|
||||||
if ( (strcasecmp(tableName.c_str(), sectableName.c_str()) != 0) || (strcasecmp(schemaName.c_str(), secschemaName.c_str()) != 0))
|
if ( (strcasecmp(tableName.c_str(), sectableName.c_str()) != 0) || (strcasecmp(schemaName.c_str(), secschemaName.c_str()) != 0))
|
||||||
{
|
{
|
||||||
|
@ -521,7 +521,7 @@ execplan::ReturnedColumn* buildPseudoColumn(Item* item,
|
|||||||
Item_field* field = (Item_field*)(ifp->arguments()[0]);
|
Item_field* field = (Item_field*)(ifp->arguments()[0]);
|
||||||
|
|
||||||
// @todo rule out derive table
|
// @todo rule out derive table
|
||||||
if (!field->field || !field->db_name || strlen(field->db_name) == 0)
|
if (!field->field || !field->db_name.str || strlen(field->db_name.str) == 0)
|
||||||
return nullOnError(gwi, funcName);
|
return nullOnError(gwi, funcName);
|
||||||
|
|
||||||
SimpleColumn* sc = buildSimpleColumn(field, gwi);
|
SimpleColumn* sc = buildSimpleColumn(field, gwi);
|
||||||
|
@ -37,24 +37,23 @@ bool schema_table_store_record(THD* thd, TABLE* table);
|
|||||||
|
|
||||||
ST_FIELD_INFO is_columnstore_columns_fields[] =
|
ST_FIELD_INFO is_columnstore_columns_fields[] =
|
||||||
{
|
{
|
||||||
{"TABLE_SCHEMA", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0},
|
Show::Column("TABLE_SCHEMA", Show::Varchar(64), NOT_NULL),
|
||||||
{"TABLE_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0},
|
Show::Column("TABLE_NAME", Show::Varchar(64), NOT_NULL),
|
||||||
{"COLUMN_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0},
|
Show::Column("COLUMN_NAME", Show::Varchar(64), NOT_NULL),
|
||||||
{"OBJECT_ID", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
Show::Column("OBJECT_ID", Show::ULong(0), NOT_NULL),
|
||||||
{"DICTIONARY_OBJECT_ID", 11, MYSQL_TYPE_LONG, 0, MY_I_S_MAYBE_NULL, 0, 0},
|
Show::Column("DICTIONARY_OBJECT_ID", Show::ULong(0), NULLABLE),
|
||||||
{"LIST_OBJECT_ID", 11, MYSQL_TYPE_LONG, 0, MY_I_S_MAYBE_NULL, 0, 0},
|
Show::Column("LIST_OBJECT_ID", Show::ULong(0), NULLABLE),
|
||||||
{"TREE_OBJECT_ID", 11, MYSQL_TYPE_LONG, 0, MY_I_S_MAYBE_NULL, 0, 0},
|
Show::Column("TREE_OBJECT_ID", Show::ULong(0), NULLABLE),
|
||||||
{"DATA_TYPE", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0},
|
Show::Column("DATA_TYPE", Show::Varchar(64), NOT_NULL),
|
||||||
{"COLUMN_LENGTH", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
Show::Column("COLUMN_LENGTH", Show::ULong(0), NOT_NULL),
|
||||||
{"COLUMN_POSITION", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
Show::Column("COLUMN_POSITION", Show::ULong(0), NOT_NULL),
|
||||||
{"COLUMN_DEFAULT", 0, MYSQL_TYPE_LONG_BLOB, 0, MY_I_S_MAYBE_NULL, 0, 0},
|
Show::Column("COLUMN_DEFAULT", Show::Blob(255), NULLABLE),
|
||||||
{"IS_NULLABLE", 1, MYSQL_TYPE_TINY, 0, 0, 0, 0},
|
Show::Column("IS_NULLABLE", Show::STiny(0), NOT_NULL),
|
||||||
{"NUMERIC_PRECISION", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
Show::Column("NUMERIC_PRECISION", Show::ULong(0), NOT_NULL),
|
||||||
{"NUMERIC_SCALE", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
Show::Column("NUMERIC_SCALE", Show::ULong(0), NOT_NULL),
|
||||||
{"IS_AUTOINCREMENT", 1, MYSQL_TYPE_TINY, 0, 0, 0, 0},
|
Show::Column("IS_AUTOINCREMENT", Show::STiny(0), NOT_NULL),
|
||||||
{"COMPRESSION_TYPE", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0},
|
Show::Column("COMPRESSION_TYPE", Show::Varchar(64), NOT_NULL),
|
||||||
{0, 0, MYSQL_TYPE_NULL, 0, 0, 0, 0}
|
Show::CEnd()
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void get_cond_item(Item_func* item, String** table, String** db)
|
static void get_cond_item(Item_func* item, String** table, String** db)
|
||||||
|
@ -33,23 +33,23 @@ bool schema_table_store_record(THD* thd, TABLE* table);
|
|||||||
|
|
||||||
ST_FIELD_INFO is_columnstore_extents_fields[] =
|
ST_FIELD_INFO is_columnstore_extents_fields[] =
|
||||||
{
|
{
|
||||||
{"OBJECT_ID", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0}, // 0
|
Show::Column("OBJECT_ID", Show::ULong(0), NOT_NULL), // 0
|
||||||
{"OBJECT_TYPE", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0}, // 1
|
Show::Column("OBJECT_TYPE", Show::Varchar(64), NOT_NULL), // 1
|
||||||
{"LOGICAL_BLOCK_START", 19, MYSQL_TYPE_LONGLONG, 0, 0, 0, 0}, // 2
|
Show::Column("LOGICAL_BLOCK_START", Show::SLonglong(0), NOT_NULL), // 2
|
||||||
{"LOGICAL_BLOCK_END", 19, MYSQL_TYPE_LONGLONG, 0, 0, 0, 0}, // 3
|
Show::Column("LOGICAL_BLOCK_END", Show::SLonglong(0), NOT_NULL), // 3
|
||||||
{"MIN_VALUE", 19, MYSQL_TYPE_LONGLONG, 0, MY_I_S_MAYBE_NULL, 0, 0}, // 4
|
Show::Column("MIN_VALUE", Show::SLonglong(0), NULLABLE), // 4
|
||||||
{"MAX_VALUE", 19, MYSQL_TYPE_LONGLONG, 0, MY_I_S_MAYBE_NULL, 0, 0}, // 5
|
Show::Column("MAX_VALUE", Show::SLonglong(0), NULLABLE), // 5
|
||||||
{"WIDTH", 1, MYSQL_TYPE_TINY, 0, 0, 0, 0}, // 6
|
Show::Column("WIDTH", Show::ULong(0), NOT_NULL), // 6
|
||||||
{"DBROOT", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0}, // 7
|
Show::Column("DBROOT", Show::ULong(0), NOT_NULL), // 7
|
||||||
{"PARTITION_ID", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0}, // 8
|
Show::Column("PARTITION_ID", Show::ULong(0), NOT_NULL), // 8
|
||||||
{"SEGMENT_ID", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0}, // 9
|
Show::Column("SEGMENT_ID", Show::ULong(0), NOT_NULL), // 9
|
||||||
{"BLOCK_OFFSET", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0}, // 10
|
Show::Column("BLOCK_OFFSET", Show::ULong(0), NOT_NULL), // 10
|
||||||
{"MAX_BLOCKS", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0}, // 11
|
Show::Column("MAX_BLOCKS", Show::ULong(0), NOT_NULL), // 11
|
||||||
{"HIGH_WATER_MARK", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0}, // 12
|
Show::Column("HIGH_WATER_MARK", Show::ULong(0), NOT_NULL), // 12
|
||||||
{"STATE", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0}, // 13
|
Show::Column("STATE", Show::Varchar(64), NOT_NULL), // 13
|
||||||
{"STATUS", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0}, // 14
|
Show::Column("STATUS", Show::Varchar(64), NOT_NULL), // 14
|
||||||
{"DATA_SIZE", 19, MYSQL_TYPE_LONGLONG, 0, 0, 0, 0}, // 15
|
Show::Column("DATA_SIZE", Show::ULonglong(0), NOT_NULL), // 15
|
||||||
{0, 0, MYSQL_TYPE_NULL, 0, 0, 0, 0}
|
Show::CEnd()
|
||||||
};
|
};
|
||||||
|
|
||||||
static int generate_result(BRM::OID_t oid, BRM::DBRM* emp, TABLE* table, THD* thd)
|
static int generate_result(BRM::OID_t oid, BRM::DBRM* emp, TABLE* table, THD* thd)
|
||||||
|
@ -42,13 +42,13 @@ bool schema_table_store_record(THD* thd, TABLE* table);
|
|||||||
|
|
||||||
ST_FIELD_INFO is_columnstore_files_fields[] =
|
ST_FIELD_INFO is_columnstore_files_fields[] =
|
||||||
{
|
{
|
||||||
{"OBJECT_ID", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
Show::Column("OBJECT_ID", Show::ULong(0), NOT_NULL),
|
||||||
{"SEGMENT_ID", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
Show::Column("SEGMENT_ID", Show::ULong(0), NOT_NULL),
|
||||||
{"PARTITION_ID", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
Show::Column("PARTITION_ID", Show::ULong(0), NOT_NULL),
|
||||||
{"FILENAME", 1024, MYSQL_TYPE_STRING, 0, 0, 0, 0},
|
Show::Column("FILENAME", Show::Varchar(1024), NOT_NULL),
|
||||||
{"FILE_SIZE", 19, MYSQL_TYPE_LONGLONG, 0, MY_I_S_MAYBE_NULL, 0, 0},
|
Show::Column("FILE_SIZE", Show::ULonglong(0), NULLABLE),
|
||||||
{"COMPRESSED_DATA_SIZE", 19, MYSQL_TYPE_LONGLONG, 0, MY_I_S_MAYBE_NULL, 0, 0},
|
Show::Column("COMPRESSED_DATA_SIZE", Show::ULonglong(0), NULLABLE),
|
||||||
{0, 0, MYSQL_TYPE_NULL, 0, 0, 0, 0}
|
Show::CEnd()
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool get_file_sizes(messageqcpp::MessageQueueClient* msgQueueClient, const char* fileName, off_t* fileSize, off_t* compressedFileSize)
|
static bool get_file_sizes(messageqcpp::MessageQueueClient* msgQueueClient, const char* fileName, off_t* fileSize, off_t* compressedFileSize)
|
||||||
|
@ -33,13 +33,13 @@ bool schema_table_store_record(THD* thd, TABLE* table);
|
|||||||
|
|
||||||
ST_FIELD_INFO is_columnstore_tables_fields[] =
|
ST_FIELD_INFO is_columnstore_tables_fields[] =
|
||||||
{
|
{
|
||||||
{"TABLE_SCHEMA", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0},
|
Show::Column("TABLE_SCHEMA", Show::Varchar(64), NOT_NULL),
|
||||||
{"TABLE_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0},
|
Show::Column("TABLE_NAME", Show::Varchar(64), NOT_NULL),
|
||||||
{"OBJECT_ID", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
Show::Column("OBJECT_ID", Show::SLong(0), NOT_NULL),
|
||||||
{"CREATION_DATE", 0, MYSQL_TYPE_DATE, 0, 0, 0, 0},
|
Show::Column("CREATION_DATE", Show::Datetime(0), NOT_NULL), // TODO: Make a date if possible
|
||||||
{"COLUMN_COUNT", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
Show::Column("COLUMN_COUNT", Show::SLong(0), NOT_NULL),
|
||||||
{"AUTOINCREMENT", 11, MYSQL_TYPE_LONG, 0, MY_I_S_MAYBE_NULL, 0, 0},
|
Show::Column("AUTOINCREMENT", Show::SLong(0), NULLABLE),
|
||||||
{0, 0, MYSQL_TYPE_NULL, 0, 0, 0, 0}
|
Show::CEnd()
|
||||||
};
|
};
|
||||||
|
|
||||||
static void get_cond_item(Item_func* item, String** table, String** db)
|
static void get_cond_item(Item_func* item, String** table, String** db)
|
||||||
|
Reference in New Issue
Block a user