This repository has been archived by the owner on Sep 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 623
[15721] Implement Sequence in peloton #1292
Closed
Closed
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
30d48ac
finish part of parser; need to add handler function in create_executo…
HenryZhou0333 086b493
finish part of parser; need to add handler function in create_executo…
HenryZhou0333 59b85f6
Merge branch 'master' of https://github.com/HenryZhou0333/peloton
HenryZhou0333 282afb3
Merge remote-tracking branch 'upstream/master'
HenryZhou0333 28b702e
add postgresql parser test for sequences
HenryZhou0333 ddb3dd7
remove AS in sequencce
HenryZhou0333 26230e3
add exception for redefined parser
HenryZhou0333 b273056
finish compiling create sequence
HenryZhou0333 d90a649
Merge remote-tracking branch 'upstream/master'
HenryZhou0333 c1a4e1d
having issue with GetSequence()
HenryZhou0333 f8ec42a
add new GetSequence impl; fix BasicTest in sequence
HenryZhou0333 0d3521c
add tests for sequence
HenryZhou0333 8fe7d6c
fix merge conflict
HenryZhou0333 87680be
one step before submitting pr
HenryZhou0333 7d7955c
change way of update pg_sequence table in nextval
HenryZhou0333 503c89f
style fix
7762354
rename sequence test
HenryZhou0333 b340c86
Merge remote-tracking branch 'upstream/master'
HenryZhou0333 6897566
remove unnecessary file
HenryZhou0333 b8c7317
adding nextval & currval functions; comment out lock and nextval not …
danae-s d665c94
update pg_sequence after calling nextval; have seg fault in txn;
HenryZhou0333 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,10 +25,12 @@ | |
#include "catalog/table_catalog.h" | ||
#include "catalog/table_metrics_catalog.h" | ||
#include "catalog/trigger_catalog.h" | ||
#include "catalog/sequence_catalog.h" | ||
#include "concurrency/transaction_manager_factory.h" | ||
#include "function/date_functions.h" | ||
#include "function/decimal_functions.h" | ||
#include "function/old_engine_string_functions.h" | ||
#include "function/string_functions.h" | ||
#include "function/timestamp_functions.h" | ||
#include "index/index_factory.h" | ||
#include "settings/settings_manager.h" | ||
|
@@ -148,12 +150,13 @@ void Catalog::Bootstrap() { | |
DatabaseMetricsCatalog::GetInstance(txn); | ||
TableMetricsCatalog::GetInstance(txn); | ||
IndexMetricsCatalog::GetInstance(txn); | ||
QueryMetricsCatalog::GetInstance(txn); | ||
QueryMetricsCatalog::GetInstance(txn); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be better to keep spaces and lines to be consistent as before. |
||
SettingsCatalog::GetInstance(txn); | ||
TriggerCatalog::GetInstance(txn); | ||
LanguageCatalog::GetInstance(txn); | ||
ProcCatalog::GetInstance(txn); | ||
|
||
SequenceCatalog::GetInstance(txn); | ||
|
||
if (settings::SettingsManager::GetBool(settings::SettingId::brain)) { | ||
QueryHistoryCatalog::GetInstance(txn); | ||
} | ||
|
@@ -1060,6 +1063,20 @@ void Catalog::InitializeFunctions() { | |
function::BuiltInFuncType{OperatorId::Like, | ||
function::OldEngineStringFunctions::Like}, | ||
txn); | ||
// Sequence | ||
AddBuiltinFunction( | ||
"nextval", {type::TypeId::VARCHAR}, type::TypeId::INTEGER, | ||
internal_lang, "Nextval", | ||
function::BuiltInFuncType{OperatorId::Nextval, | ||
function::OldEngineStringFunctions::Nextval}, | ||
txn); | ||
AddBuiltinFunction( | ||
"currval", {type::TypeId::VARCHAR}, type::TypeId::INTEGER, | ||
internal_lang, "Currval", | ||
function::BuiltInFuncType{OperatorId::Currval, | ||
function::OldEngineStringFunctions::Currval}, | ||
txn); | ||
|
||
|
||
/** | ||
* decimal functions | ||
|
@@ -1106,28 +1123,28 @@ void Catalog::InitializeFunctions() { | |
* integer functions | ||
*/ | ||
AddBuiltinFunction( | ||
"abs", {type::TypeId::TINYINT}, type::TypeId::TINYINT, | ||
"abs", {type::TypeId::TINYINT}, type::TypeId::TINYINT, | ||
internal_lang, "Abs", | ||
function::BuiltInFuncType{OperatorId::Abs, | ||
function::DecimalFunctions::_Abs}, | ||
txn); | ||
|
||
AddBuiltinFunction( | ||
"abs", {type::TypeId::SMALLINT}, type::TypeId::SMALLINT, | ||
"abs", {type::TypeId::SMALLINT}, type::TypeId::SMALLINT, | ||
internal_lang, "Abs", | ||
function::BuiltInFuncType{OperatorId::Abs, | ||
function::DecimalFunctions::_Abs}, | ||
txn); | ||
|
||
AddBuiltinFunction( | ||
"abs", {type::TypeId::INTEGER}, type::TypeId::INTEGER, | ||
"abs", {type::TypeId::INTEGER}, type::TypeId::INTEGER, | ||
internal_lang, "Abs", | ||
function::BuiltInFuncType{OperatorId::Abs, | ||
function::DecimalFunctions::_Abs}, | ||
txn); | ||
|
||
AddBuiltinFunction( | ||
"abs", {type::TypeId::BIGINT}, type::TypeId::BIGINT, | ||
"abs", {type::TypeId::BIGINT}, type::TypeId::BIGINT, | ||
internal_lang, "Abs", | ||
function::BuiltInFuncType{OperatorId::Abs, | ||
function::DecimalFunctions::_Abs}, | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/*(space)brief
is probably better