1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-4144 Enable lower_case_table_names

Create tables and schemas with lower case name only if the flag is set.
During operations, convert to lowercase in plugin. Byt the time a query gets to ExeMgr, DDLProc etc., everything must be lower case if the flag is set, and undisturbed if not.
This commit is contained in:
David Hall
2020-09-21 11:31:44 -05:00
parent 1c94e310ff
commit 35c4b66a67
32 changed files with 468 additions and 412 deletions

View File

@ -421,10 +421,14 @@ bool anyRowInTable(string& schema, string& tableName, int sessionID)
boost::shared_ptr<CalpontSystemCatalog> csc = CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID);
csc->identity(execplan::CalpontSystemCatalog::FE);
CalpontSystemCatalog::TableName aTableName;
algorithm::to_lower(schema);
algorithm::to_lower(tableName);
if (lower_case_table_names)
{
algorithm::to_lower(schema);
algorithm::to_lower(tableName);
}
aTableName.schema = schema;
aTableName.table = tableName;
CalpontSystemCatalog::RIDList ridList = csc->columnRIDs(aTableName, true);
CalpontSystemCatalog::TableColName tableColName = csc->colName(ridList[0].objnum);
@ -558,8 +562,11 @@ bool anyTimestampColumn(string& schema, string& tableName, int sessionID)
boost::shared_ptr<CalpontSystemCatalog> csc = CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID);
csc->identity(execplan::CalpontSystemCatalog::FE);
CalpontSystemCatalog::TableName aTableName;
algorithm::to_lower(schema);
algorithm::to_lower(tableName);
if (lower_case_table_names)
{
algorithm::to_lower(schema);
algorithm::to_lower(tableName);
}
// select columnname from calpontsys.syscolumn
// where schema = schema and tablename = tableName
@ -729,8 +736,11 @@ bool anyNullInTheColumn (THD* thd, string& schema, string& table, string& column
CalpontSelectExecutionPlan::ReturnedColumnList returnedColumnList;
CalpontSelectExecutionPlan::FilterTokenList filterTokenList;
CalpontSelectExecutionPlan::ColumnMap colMap;
algorithm::to_lower(schema);
algorithm::to_lower(table);
if (lower_case_table_names)
{
algorithm::to_lower(schema);
algorithm::to_lower(table);
}
algorithm::to_lower(columnName);
SessionManager sm;
@ -912,6 +922,11 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl
if ( typeid ( stmt ) == typeid ( CreateTableStatement ) )
{
CreateTableStatement* createTable = dynamic_cast <CreateTableStatement*> ( &stmt );
if (lower_case_table_names)
{
algorithm::to_lower(createTable->fTableDef->fQualifiedName->fSchema);
algorithm::to_lower(createTable->fTableDef->fQualifiedName->fName);
}
bool matchedCol = false;
bool isFirstTimestamp = true;
@ -1215,6 +1230,11 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl
else if ( typeid ( stmt ) == typeid ( AlterTableStatement ) )
{
AlterTableStatement* alterTable = dynamic_cast <AlterTableStatement*> ( &stmt );
if (lower_case_table_names)
{
algorithm::to_lower(alterTable->fTableName->fSchema);
algorithm::to_lower(alterTable->fTableName->fName);
}
alterTable->fTimeZone.assign(thd->variables.time_zone->get_name()->ptr());