32
32
#include " function/old_engine_string_functions.h"
33
33
#include " function/timestamp_functions.h"
34
34
#include " index/index_factory.h"
35
- #include " planner/seq_scan_plan.h"
36
- #include " planner/insert_plan.h"
37
35
#include " settings/settings_manager.h"
38
36
#include " storage/storage_manager.h"
39
37
#include " storage/table_factory.h"
40
- #include " storage/tile.h"
41
38
#include " type/ephemeral_pool.h"
42
39
43
40
namespace peloton {
@@ -618,18 +615,18 @@ ResultType Catalog::DropIndex(oid_t index_oid,
618
615
619
616
ResultType Catalog::DropIndex (const std::string &index_name,
620
617
concurrency::TransactionContext *txn) {
621
- if (txn == nullptr ) {
622
- throw CatalogException (" Do not have transaction to drop index " +
623
- index_name);
624
- }
625
- auto index_object =
626
- catalog::IndexCatalog::GetInstance ()-> GetIndexObject ( index_name, txn);
627
- if (index_object == nullptr ) {
628
- throw CatalogException (" Index name " + index_name + " cannot be found" );
629
- }
630
- ResultType result = DropIndex (index_object->GetIndexOid (), 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);
631
628
632
- return result;
629
+ return result;
633
630
}
634
631
635
632
// ===--------------------------------------------------------------------===//
@@ -814,7 +811,6 @@ ResultType Catalog::AddColumn(
814
811
return ResultType::SUCCESS;
815
812
}
816
813
817
- <<<<<<< bc9252fda7aeecaeb325a11f30bc23a27569f932
818
814
ResultType Catalog::DropColumn (
819
815
UNUSED_ATTRIBUTE const std::string &database_name,
820
816
UNUSED_ATTRIBUTE const std::string &table_name,
@@ -828,13 +824,6 @@ ResultType Catalog::ChangeColumnName(const std::string &database_name,
828
824
const std::vector<std::string> &old_names,
829
825
const std::vector<std::string> &names,
830
826
concurrency::TransactionContext *txn) {
831
- =======
832
- ResultType ChangeColumnName (const std::string &database_name,
833
- const std::string &table_name,
834
- const std::vector<std::string> &old_names,
835
- const std::vector<std::string> &names,
836
- concurrency::TransactionContext *txn) {
837
- >>>>>>> add change column catalog
838
827
if (txn == nullptr ) {
839
828
throw CatalogException (" Change Column requires transaction." );
840
829
}
@@ -843,12 +832,8 @@ ResultType ChangeColumnName(const std::string &database_name,
843
832
throw CatalogException (" No names are given." );
844
833
}
845
834
846
- <<<<<<< bc9252fda7aeecaeb325a11f30bc23a27569f932
847
835
LOG_TRACE (" Change Column Name %s to %s" , old_names[0 ].c_str (),
848
836
names[0 ].c_str ());
849
- =======
850
- LOG_TRACE (" Change Column Name %s to %s" , old_names[0 ], names[0 ]);
851
- >>>>>>> add change column catalog
852
837
853
838
try {
854
839
// Get table from the name
@@ -1166,11 +1151,11 @@ void Catalog::InitializeFunctions() {
1166
1151
/* *
1167
1152
* decimal functions
1168
1153
*/
1169
- AddBuiltinFunction (" abs " , {type::TypeId::DECIMAL}, type::TypeId::DECIMAL,
1170
- internal_lang, " Abs " ,
1171
- function::BuiltInFuncType{
1172
- OperatorId::Abs, function::DecimalFunctions::_Abs},
1173
- txn);
1154
+ AddBuiltinFunction (
1155
+ " abs " , {type::TypeId::DECIMAL}, type::TypeId::DECIMAL, internal_lang ,
1156
+ " Abs " , function::BuiltInFuncType{OperatorId::Abs,
1157
+ function::DecimalFunctions::_Abs},
1158
+ txn);
1174
1159
AddBuiltinFunction (
1175
1160
" sqrt" , {type::TypeId::TINYINT}, type::TypeId::DECIMAL, internal_lang,
1176
1161
" Sqrt" , function::BuiltInFuncType{OperatorId::Sqrt,
@@ -1207,29 +1192,33 @@ void Catalog::InitializeFunctions() {
1207
1192
/* *
1208
1193
* integer functions
1209
1194
*/
1210
- AddBuiltinFunction (" abs" , {type::TypeId::TINYINT}, type::TypeId::TINYINT,
1211
- internal_lang, " Abs" ,
1212
- function::BuiltInFuncType{
1213
- OperatorId::Abs, function::DecimalFunctions::_Abs},
1214
- txn);
1195
+ AddBuiltinFunction (
1196
+ " abs" , {type::TypeId::TINYINT}, type::TypeId::TINYINT,
1197
+ internal_lang, " Abs" ,
1198
+ function::BuiltInFuncType{OperatorId::Abs,
1199
+ function::DecimalFunctions::_Abs},
1200
+ txn);
1215
1201
1216
- AddBuiltinFunction (" abs" , {type::TypeId::SMALLINT},
1217
- type::TypeId::SMALLINT, internal_lang, " Abs" ,
1218
- function::BuiltInFuncType{
1219
- OperatorId::Abs, function::DecimalFunctions::_Abs},
1220
- txn);
1202
+ AddBuiltinFunction (
1203
+ " abs" , {type::TypeId::SMALLINT}, type::TypeId::SMALLINT,
1204
+ internal_lang, " Abs" ,
1205
+ function::BuiltInFuncType{OperatorId::Abs,
1206
+ function::DecimalFunctions::_Abs},
1207
+ txn);
1221
1208
1222
- AddBuiltinFunction (" abs" , {type::TypeId::INTEGER}, type::TypeId::INTEGER,
1223
- internal_lang, " Abs" ,
1224
- function::BuiltInFuncType{
1225
- OperatorId::Abs, function::DecimalFunctions::_Abs},
1226
- txn);
1209
+ AddBuiltinFunction (
1210
+ " abs" , {type::TypeId::INTEGER}, type::TypeId::INTEGER,
1211
+ internal_lang, " Abs" ,
1212
+ function::BuiltInFuncType{OperatorId::Abs,
1213
+ function::DecimalFunctions::_Abs},
1214
+ txn);
1227
1215
1228
- AddBuiltinFunction (" abs" , {type::TypeId::BIGINT}, type::TypeId::BIGINT,
1229
- internal_lang, " Abs" ,
1230
- function::BuiltInFuncType{
1231
- OperatorId::Abs, function::DecimalFunctions::_Abs},
1232
- txn);
1216
+ AddBuiltinFunction (
1217
+ " abs" , {type::TypeId::BIGINT}, type::TypeId::BIGINT,
1218
+ internal_lang, " Abs" ,
1219
+ function::BuiltInFuncType{OperatorId::Abs,
1220
+ function::DecimalFunctions::_Abs},
1221
+ txn);
1233
1222
1234
1223
AddBuiltinFunction (
1235
1224
" floor" , {type::TypeId::INTEGER}, type::TypeId::DECIMAL,
0 commit comments