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

Silence -Werror=implicit-fallthrough compiler errors - Patch from Monty.

The patch also fixes some potential bugs due to missing break
statements.
This commit is contained in:
Gagan Goel
2020-06-26 12:28:39 -04:00
parent 31df46168d
commit 2ba9263df4
15 changed files with 25 additions and 6 deletions

View File

@ -85,8 +85,8 @@ void getColumnValue(ConstantColumn** cc, uint64_t i, const Row& row, const strin
*cc = new ConstantColumn(oss.str(), row.getIntField(i)); *cc = new ConstantColumn(oss.str(), row.getIntField(i));
break; break;
} }
/* fall through */
// else > 0; fall through /* else > 0 */
case CalpontSystemCatalog::DECIMAL: case CalpontSystemCatalog::DECIMAL:
case CalpontSystemCatalog::UDECIMAL: case CalpontSystemCatalog::UDECIMAL:

View File

@ -1307,7 +1307,7 @@ void TupleAggregateStep::prep1PhaseAggregate(
case ROWAGG_AVG: case ROWAGG_AVG:
avgFuncMap.insert(make_pair(key, funct)); avgFuncMap.insert(make_pair(key, funct));
/* fall through */
case ROWAGG_SUM: case ROWAGG_SUM:
{ {
if (typeProj[colProj] == CalpontSystemCatalog::CHAR || if (typeProj[colProj] == CalpontSystemCatalog::CHAR ||
@ -1890,6 +1890,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
else else
break; break;
} }
/* fall through */
case ROWAGG_COUNT_ASTERISK: case ROWAGG_COUNT_ASTERISK:
case ROWAGG_COUNT_COL_NAME: case ROWAGG_COUNT_COL_NAME:
@ -3166,6 +3167,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
// let fall through to add a count column for average function // let fall through to add a count column for average function
if (aggOp != ROWAGG_AVG) if (aggOp != ROWAGG_AVG)
break; break;
/* fall through */
case ROWAGG_COUNT_ASTERISK: case ROWAGG_COUNT_ASTERISK:
case ROWAGG_COUNT_COL_NAME: case ROWAGG_COUNT_COL_NAME:
@ -4048,6 +4050,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
funct->fAuxColumnIndex = colAggPm; funct->fAuxColumnIndex = colAggPm;
else else
break; break;
/* fall through */
case ROWAGG_COUNT_ASTERISK: case ROWAGG_COUNT_ASTERISK:
case ROWAGG_COUNT_COL_NAME: case ROWAGG_COUNT_COL_NAME:

View File

@ -3323,6 +3323,7 @@ ReturnedColumn* buildReturnedColumn(
break; break;
} }
} }
/* fall through */
case Item::NULL_ITEM: case Item::NULL_ITEM:
{ {
@ -4828,6 +4829,7 @@ ReturnedColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi)
break; break;
} }
} }
/* fall through */
default: default:
{ {

View File

@ -263,6 +263,7 @@ const string format(int64_t v, CalpontSystemCatalog::ColType& ct)
case CalpontSystemCatalog::TIME: case CalpontSystemCatalog::TIME:
oss << DataConvert::timeToString(v); oss << DataConvert::timeToString(v);
break;
case CalpontSystemCatalog::CHAR: case CalpontSystemCatalog::CHAR:
case CalpontSystemCatalog::VARCHAR: case CalpontSystemCatalog::VARCHAR:

View File

@ -114,10 +114,10 @@ public:
{ {
case 3: case 3:
k1 ^= tail[2] << 16; k1 ^= tail[2] << 16;
/* fall through */
case 2: case 2:
k1 ^= tail[1] << 8; k1 ^= tail[1] << 8;
/* fall through */
case 1: case 1:
k1 ^= tail[0]; k1 ^= tail[0];
k1 *= c1; k1 *= c1;

View File

@ -84,6 +84,7 @@ int64_t Func_hour::getIntVal(rowgroup::Row& row,
{ {
isNull = true; isNull = true;
} }
/* fall through */
case execplan::CalpontSystemCatalog::VARCHAR: case execplan::CalpontSystemCatalog::VARCHAR:
case execplan::CalpontSystemCatalog::CHAR: case execplan::CalpontSystemCatalog::CHAR:

View File

@ -83,6 +83,7 @@ int64_t Func_minute::getIntVal(rowgroup::Row& row,
{ {
isNull = true; isNull = true;
} }
/* fall through */
case execplan::CalpontSystemCatalog::VARCHAR: case execplan::CalpontSystemCatalog::VARCHAR:
case execplan::CalpontSystemCatalog::CHAR: case execplan::CalpontSystemCatalog::CHAR:

View File

@ -912,6 +912,7 @@ execplan::IDB_Decimal Func_nullif::getDecimalVal(rowgroup::Row& row,
exp2.value = value; exp2.value = value;
exp2.scale = 0; exp2.scale = 0;
} }
/* fall through */
case execplan::CalpontSystemCatalog::DOUBLE: case execplan::CalpontSystemCatalog::DOUBLE:
case execplan::CalpontSystemCatalog::UDOUBLE: case execplan::CalpontSystemCatalog::UDOUBLE:

View File

@ -130,6 +130,7 @@ int64_t Func_quarter::getIntVal(rowgroup::Row& row,
else else
{ {
isNull = true; isNull = true;
break;
} }
} }

View File

@ -81,8 +81,9 @@ int64_t Func_second::getIntVal(rowgroup::Row& row,
case execplan::CalpontSystemCatalog::DOUBLE: case execplan::CalpontSystemCatalog::DOUBLE:
case execplan::CalpontSystemCatalog::FLOAT: case execplan::CalpontSystemCatalog::FLOAT:
{ {
isNull = true; isNull = true;
} }
/* fall through */
case execplan::CalpontSystemCatalog::VARCHAR: case execplan::CalpontSystemCatalog::VARCHAR:
case execplan::CalpontSystemCatalog::CHAR: case execplan::CalpontSystemCatalog::CHAR:

View File

@ -129,6 +129,7 @@ string Func_timediff::getStrVal(rowgroup::Row& row,
case execplan::CalpontSystemCatalog::TIME: case execplan::CalpontSystemCatalog::TIME:
isTime1 = true; isTime1 = true;
/* fall through */
case execplan::CalpontSystemCatalog::DATETIME: case execplan::CalpontSystemCatalog::DATETIME:
// Diff between time and datetime returns NULL in MariaDB // Diff between time and datetime returns NULL in MariaDB
if ((type2 == execplan::CalpontSystemCatalog::TIME || if ((type2 == execplan::CalpontSystemCatalog::TIME ||
@ -229,6 +230,7 @@ string Func_timediff::getStrVal(rowgroup::Row& row,
case execplan::CalpontSystemCatalog::TIME: case execplan::CalpontSystemCatalog::TIME:
isTime2 = true; isTime2 = true;
/* fall through */
case execplan::CalpontSystemCatalog::DATETIME: case execplan::CalpontSystemCatalog::DATETIME:
val2 = parm[1]->data()->getDatetimeIntVal(row, isNull); val2 = parm[1]->data()->getDatetimeIntVal(row, isNull);
break; break;

View File

@ -1709,6 +1709,7 @@ void RowAggregation::updateEntry(const Row& rowIn)
// if NOT null, let execution fall through. // if NOT null, let execution fall through.
if (isNull(&fRowGroupIn, rowIn, colIn) == true) break; if (isNull(&fRowGroupIn, rowIn, colIn) == true) break;
/* fall through */
case ROWAGG_COUNT_ASTERISK: case ROWAGG_COUNT_ASTERISK:
fRow.setUintField<8>(fRow.getUintField<8>(colOut) + 1, colOut); fRow.setUintField<8>(fRow.getUintField<8>(colOut) + 1, colOut);
@ -2467,6 +2468,7 @@ void RowAggregationUM::updateEntry(const Row& rowIn)
// if NOT null, let execution fall through. // if NOT null, let execution fall through.
if (isNull(&fRowGroupIn, rowIn, colIn) == true) break; if (isNull(&fRowGroupIn, rowIn, colIn) == true) break;
/* fall through */
case ROWAGG_COUNT_ASTERISK: case ROWAGG_COUNT_ASTERISK:
fRow.setUintField<8>(fRow.getUintField<8>(colOut) + 1, colOut); fRow.setUintField<8>(fRow.getUintField<8>(colOut) + 1, colOut);

View File

@ -744,6 +744,7 @@ void Row::initToNull()
case CalpontSystemCatalog::LONGDOUBLE: case CalpontSystemCatalog::LONGDOUBLE:
*((long double*) &data[offsets[i]]) = joblist::LONGDOUBLENULL; *((long double*) &data[offsets[i]]) = joblist::LONGDOUBLENULL;
break;
case CalpontSystemCatalog::DATETIME: case CalpontSystemCatalog::DATETIME:
*((uint64_t*) &data[offsets[i]]) = joblist::DATETIMENULL; *((uint64_t*) &data[offsets[i]]) = joblist::DATETIMENULL;

View File

@ -418,6 +418,7 @@ void parseCmdLineArgs(
case 'h': // -h: help case 'h': // -h: help
{ {
printUsage(); printUsage();
break;
} }
case 'i': // -i: log info to console case 'i': // -i: log info to console

View File

@ -3033,6 +3033,7 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs,
// else // else
// fall through to integer cases // fall through to integer cases
} }
/* fall through */
case CalpontSystemCatalog::BIGINT: case CalpontSystemCatalog::BIGINT:
case CalpontSystemCatalog::UBIGINT: case CalpontSystemCatalog::UBIGINT:
@ -3377,6 +3378,7 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs,
// else // else
// fall through to integer cases // fall through to integer cases
} }
/* fall through */
case CalpontSystemCatalog::BIGINT: case CalpontSystemCatalog::BIGINT:
case CalpontSystemCatalog::UBIGINT: case CalpontSystemCatalog::UBIGINT: