|
35 | 35 | #include "settings/settings_manager.h"
|
36 | 36 | #include "storage/storage_manager.h"
|
37 | 37 | #include "storage/table_factory.h"
|
| 38 | +#include "storage/tile.h" |
38 | 39 | #include "type/ephemeral_pool.h"
|
39 | 40 |
|
40 | 41 | namespace peloton {
|
@@ -149,12 +150,12 @@ void Catalog::Bootstrap() {
|
149 | 150 | DatabaseMetricsCatalog::GetInstance(txn);
|
150 | 151 | TableMetricsCatalog::GetInstance(txn);
|
151 | 152 | IndexMetricsCatalog::GetInstance(txn);
|
152 |
| - QueryMetricsCatalog::GetInstance(txn); |
| 153 | + QueryMetricsCatalog::GetInstance(txn); |
153 | 154 | SettingsCatalog::GetInstance(txn);
|
154 | 155 | TriggerCatalog::GetInstance(txn);
|
155 | 156 | LanguageCatalog::GetInstance(txn);
|
156 | 157 | ProcCatalog::GetInstance(txn);
|
157 |
| - |
| 158 | + |
158 | 159 | if (settings::SettingsManager::GetBool(settings::SettingId::brain)) {
|
159 | 160 | QueryHistoryCatalog::GetInstance(txn);
|
160 | 161 | }
|
@@ -615,18 +616,18 @@ ResultType Catalog::DropIndex(oid_t index_oid,
|
615 | 616 |
|
616 | 617 | ResultType Catalog::DropIndex(const std::string &index_name,
|
617 | 618 | concurrency::TransactionContext *txn) {
|
618 |
| - if(txn == nullptr) { |
619 |
| - throw CatalogException("Do not have transaction to drop index " + |
620 |
| - index_name); |
621 |
| - } |
622 |
| - auto index_object = catalog::IndexCatalog::GetInstance()->GetIndexObject( |
623 |
| - index_name, txn); |
624 |
| - if(index_object == nullptr) { |
625 |
| - throw CatalogException("Index name " + index_name + " cannot be found"); |
626 |
| - } |
627 |
| - ResultType result = DropIndex(index_object->GetIndexOid(), txn); |
| 619 | + if (txn == nullptr) { |
| 620 | + throw CatalogException("Do not have transaction to drop index " + |
| 621 | + index_name); |
| 622 | + } |
| 623 | + auto index_object = |
| 624 | + catalog::IndexCatalog::GetInstance()->GetIndexObject(index_name, txn); |
| 625 | + if (index_object == nullptr) { |
| 626 | + throw CatalogException("Index name " + index_name + " cannot be found"); |
| 627 | + } |
| 628 | + ResultType result = DropIndex(index_object->GetIndexOid(), txn); |
628 | 629 |
|
629 |
| - return result; |
| 630 | + return result; |
630 | 631 | }
|
631 | 632 |
|
632 | 633 | //===--------------------------------------------------------------------===//
|
@@ -1164,11 +1165,11 @@ void Catalog::InitializeFunctions() {
|
1164 | 1165 | /**
|
1165 | 1166 | * decimal functions
|
1166 | 1167 | */
|
1167 |
| - AddBuiltinFunction( |
1168 |
| - "abs", {type::TypeId::DECIMAL}, type::TypeId::DECIMAL, internal_lang, |
1169 |
| - "Abs", function::BuiltInFuncType{OperatorId::Abs, |
1170 |
| - function::DecimalFunctions::_Abs}, |
1171 |
| - txn); |
| 1168 | + AddBuiltinFunction("abs", {type::TypeId::DECIMAL}, type::TypeId::DECIMAL, |
| 1169 | + internal_lang, "Abs", |
| 1170 | + function::BuiltInFuncType{ |
| 1171 | + OperatorId::Abs, function::DecimalFunctions::_Abs}, |
| 1172 | + txn); |
1172 | 1173 | AddBuiltinFunction(
|
1173 | 1174 | "sqrt", {type::TypeId::TINYINT}, type::TypeId::DECIMAL, internal_lang,
|
1174 | 1175 | "Sqrt", function::BuiltInFuncType{OperatorId::Sqrt,
|
@@ -1205,33 +1206,29 @@ void Catalog::InitializeFunctions() {
|
1205 | 1206 | /**
|
1206 | 1207 | * integer functions
|
1207 | 1208 | */
|
1208 |
| - AddBuiltinFunction( |
1209 |
| - "abs", {type::TypeId::TINYINT}, type::TypeId::TINYINT, |
1210 |
| - internal_lang, "Abs", |
1211 |
| - function::BuiltInFuncType{OperatorId::Abs, |
1212 |
| - function::DecimalFunctions::_Abs}, |
1213 |
| - txn); |
| 1209 | + AddBuiltinFunction("abs", {type::TypeId::TINYINT}, type::TypeId::TINYINT, |
| 1210 | + internal_lang, "Abs", |
| 1211 | + function::BuiltInFuncType{ |
| 1212 | + OperatorId::Abs, function::DecimalFunctions::_Abs}, |
| 1213 | + txn); |
1214 | 1214 |
|
1215 |
| - AddBuiltinFunction( |
1216 |
| - "abs", {type::TypeId::SMALLINT}, type::TypeId::SMALLINT, |
1217 |
| - internal_lang, "Abs", |
1218 |
| - function::BuiltInFuncType{OperatorId::Abs, |
1219 |
| - function::DecimalFunctions::_Abs}, |
1220 |
| - txn); |
| 1215 | + AddBuiltinFunction("abs", {type::TypeId::SMALLINT}, |
| 1216 | + type::TypeId::SMALLINT, internal_lang, "Abs", |
| 1217 | + function::BuiltInFuncType{ |
| 1218 | + OperatorId::Abs, function::DecimalFunctions::_Abs}, |
| 1219 | + txn); |
1221 | 1220 |
|
1222 |
| - AddBuiltinFunction( |
1223 |
| - "abs", {type::TypeId::INTEGER}, type::TypeId::INTEGER, |
1224 |
| - internal_lang, "Abs", |
1225 |
| - function::BuiltInFuncType{OperatorId::Abs, |
1226 |
| - function::DecimalFunctions::_Abs}, |
1227 |
| - txn); |
| 1221 | + AddBuiltinFunction("abs", {type::TypeId::INTEGER}, type::TypeId::INTEGER, |
| 1222 | + internal_lang, "Abs", |
| 1223 | + function::BuiltInFuncType{ |
| 1224 | + OperatorId::Abs, function::DecimalFunctions::_Abs}, |
| 1225 | + txn); |
1228 | 1226 |
|
1229 |
| - AddBuiltinFunction( |
1230 |
| - "abs", {type::TypeId::BIGINT}, type::TypeId::BIGINT, |
1231 |
| - internal_lang, "Abs", |
1232 |
| - function::BuiltInFuncType{OperatorId::Abs, |
1233 |
| - function::DecimalFunctions::_Abs}, |
1234 |
| - txn); |
| 1227 | + AddBuiltinFunction("abs", {type::TypeId::BIGINT}, type::TypeId::BIGINT, |
| 1228 | + internal_lang, "Abs", |
| 1229 | + function::BuiltInFuncType{ |
| 1230 | + OperatorId::Abs, function::DecimalFunctions::_Abs}, |
| 1231 | + txn); |
1235 | 1232 |
|
1236 | 1233 | AddBuiltinFunction(
|
1237 | 1234 | "floor", {type::TypeId::INTEGER}, type::TypeId::DECIMAL,
|
|
0 commit comments