diff --git a/src/observer/event/#sql_event.cpp# b/src/observer/event/#sql_event.cpp# deleted file mode 100644 index 3b0835d45c05374dbc39059850248f24f5c06c39..0000000000000000000000000000000000000000 --- a/src/observer/event/#sql_event.cpp# +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. -miniob is licensed under Mulan PSL v2. -You can use this software according to the terms and conditions of the Mulan PSL v2. -You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PSL v2 for more details. */ - -// -// Created by Longda on 2021/4/14. -// - -#include "event/sql_event.h" -#include "event/session_event.h" - -SQLStageEvent::SQLStageEvent(SessionEvent *event, const std::string &sql) : session_event_(event), sql_(sql) -{} - -SQLStageEvent::~SQLStageEvent() noexcept -{ - if (session_event_ != nullptr) { - session_event_ = nullptr; - // SessionEvent *session_event = session_event_; - // session_event_ = nullptr; - // session_event->doneImmediate(); - } -} diff --git a/src/observer/event/execute_plan_event.cpp.bak b/src/observer/event/execute_plan_event.cpp.bak deleted file mode 100644 index e0c8a7d2040351082d625a4d6ce8c47011960c2b..0000000000000000000000000000000000000000 --- a/src/observer/event/execute_plan_event.cpp.bak +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. -miniob is licensed under Mulan PSL v2. -You can use this software according to the terms and conditions of the Mulan PSL v2. -You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PSL v2 for more details. */ - -// -// Created by Wangyunlai on 2021/5/11. -// - -#include "event/execution_plan_event.h" -#include "event/sql_event.h" - -ExecutionPlanEvent::ExecutionPlanEvent(SQLStageEvent *sql_event, Query *sqls) : sql_event_(sql_event), sqls_(sqls) -{} -ExecutionPlanEvent::~ExecutionPlanEvent() -{ - sql_event_ = nullptr; - // if (sql_event_) { - // sql_event_->doneImmediate(); - // } - - query_destroy(sqls_); - sqls_ = nullptr; -} diff --git a/src/observer/event/execute_plan_event.h.bak b/src/observer/event/execute_plan_event.h.bak deleted file mode 100644 index 24f8aa5ce998f0c03f8a4404f88556c8bdd7c2ed..0000000000000000000000000000000000000000 --- a/src/observer/event/execute_plan_event.h.bak +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. -miniob is licensed under Mulan PSL v2. -You can use this software according to the terms and conditions of the Mulan PSL v2. -You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PSL v2 for more details. */ - -// -// Created by Wangyunlai on 2021/5/11. -// - -#pragma once - -#include "common/seda/stage_event.h" - -class SQLStageEvent; - -class ExecutePlanEvent : public common::StageEvent { -public: - ExecutePlanEvent(SQLStageEvent *sql_event, common::StageEvent *parent_event) - : sql_event_(sql_event), parent_event_(parent_event) - {} - - virtual ~ExecutePlanEvent() = default; - - SQLStageEvent *sql_event() const - { - return sql_event_; - } - - common::StageEvent *parent_event() const { - return parent_event_; - } - -private: - SQLStageEvent *sql_event_ = nullptr; - common::StageEvent *parent_event_ = nullptr; -}; - -#endif // __OBSERVER_EVENT_EXECUTION_PLAN_EVENT_H__ diff --git a/src/observer/event/query_cache_event.h.bak b/src/observer/event/query_cache_event.h.bak deleted file mode 100644 index d2773dd35afcffdaea1ed6df50adcc9026d9bd39..0000000000000000000000000000000000000000 --- a/src/observer/event/query_cache_event.h.bak +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. -miniob is licensed under Mulan PSL v2. -You can use this software according to the terms and conditions of the Mulan PSL v2. -You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PSL v2 for more details. */ - -// -// Created by Wangyunlai on 2022/5/23. -// - -#pragma once - -#include "common/seda/stage_event.h" - -class SQLStageEvent; -class Stmt; - -class QueryCacheEvent : public common::StageEvent { -public: - QueryCacheEvent(SQLStageEvent *sql_event, common::StageEvent *parent_event) - : sql_event_(sql_event), parent_event_(parent_event) - {} - - virtual ~QueryCacheEvent() noexcept = default; - - SQLStageEvent *sql_event() const { - return sql_event_; - } - - common::StageEvent *parent_event() const { - return parent_event_; - } - -private: - SQLStageEvent *sql_event_ = nullptr; - common::StageEvent *parent_event_ = nullptr; -}; - diff --git a/src/observer/event/resolve_event.cpp.bak b/src/observer/event/resolve_event.cpp.bak deleted file mode 100644 index 78f8680a64b86b2fa3de0b53cda08667dd48791a..0000000000000000000000000000000000000000 --- a/src/observer/event/resolve_event.cpp.bak +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. -miniob is licensed under Mulan PSL v2. -You can use this software according to the terms and conditions of the Mulan PSL v2. -You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PSL v2 for more details. */ - -// -// Created by Wangyunlai on 2022/5/23. -// - -#include "event/resolve_event.h" -#include "event/session_event.h" - -ResolveStageEvent(SessionEvent *event) : session_event_(event) -{} - -ResolveStageEvent::~ResolveStageEvent() noexcept -{ -} diff --git a/src/observer/event/resolve_event.h.bak b/src/observer/event/resolve_event.h.bak deleted file mode 100644 index 05e2de053723cd51673f768f4b82f4547968e05b..0000000000000000000000000000000000000000 --- a/src/observer/event/resolve_event.h.bak +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. -miniob is licensed under Mulan PSL v2. -You can use this software according to the terms and conditions of the Mulan PSL v2. -You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PSL v2 for more details. */ - -// -// Created by Wangyunlai on 2022/5/23. -// - -#pragma once - -#include "common/seda/stage_event.h" - -class SessionEvent; -class Stmt; - -class ResolveStageEvent : public BaseEvent { -public: - ResolveStageEvent(SessionEvent *event); - virtual ~ResolveStageEvent() noexcept; - - SessionEvent *session_event() const - { - return session_event_; - } - -private: - SessionEvent *session_event_ = nullptr; -}; - diff --git a/src/observer/sql/operator/index_scan_operator.cpp b/src/observer/sql/operator/index_scan_operator.cpp index acd074739f64d05a66be2dd9e152be5ea6512e36..1be1a3723a8cc48d6f7765022d7994fb7c038e9d 100644 --- a/src/observer/sql/operator/index_scan_operator.cpp +++ b/src/observer/sql/operator/index_scan_operator.cpp @@ -1,3 +1,17 @@ +/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. +miniob is licensed under Mulan PSL v2. +You can use this software according to the terms and conditions of the Mulan PSL v2. +You may obtain a copy of Mulan PSL v2 at: + http://license.coscl.org.cn/MulanPSL2 +THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +See the Mulan PSL v2 for more details. */ + +// +// Created by Wangyunlai on 2022/07/08. +// + #include "sql/operator/index_scan_operator.h" #include "storage/index/index.h" diff --git a/src/observer/sql/operator/index_scan_operator.h b/src/observer/sql/operator/index_scan_operator.h index 9394006ecbb9acb8b52eb598456cd3898a4e435a..eedd71f712aa8f8580207adb87e2f907f1e32806 100644 --- a/src/observer/sql/operator/index_scan_operator.h +++ b/src/observer/sql/operator/index_scan_operator.h @@ -1,3 +1,17 @@ +/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. +miniob is licensed under Mulan PSL v2. +You can use this software according to the terms and conditions of the Mulan PSL v2. +You may obtain a copy of Mulan PSL v2 at: + http://license.coscl.org.cn/MulanPSL2 +THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +See the Mulan PSL v2 for more details. */ + +// +// Created by Wangyunlai on 2022/07/08. +// + #pragma once #include "sql/operator/operator.h" diff --git a/src/observer/sql/operator/join_operator.cpp.bak b/src/observer/sql/operator/join_operator.cpp.bak deleted file mode 100644 index f0f8e6315c7e1726482fceaf042127e96e80f5d6..0000000000000000000000000000000000000000 --- a/src/observer/sql/operator/join_operator.cpp.bak +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. -miniob is licensed under Mulan PSL v2. -You can use this software according to the terms and conditions of the Mulan PSL v2. -You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PSL v2 for more details. */ - -// -// Created by WangYunlai on 2021/6/10. -// - -#include "sql/operator/join_operator.h" - -RC JoinOperator::open() -{ - RC rc = left_->open(); - if (rc != RC::SUCCESS) { - LOG_WARN("failed to open left operator. rc=%d:%s", rc, strrc(rc)); - return rc; - } - - rc = right_->open(); - if (rc != RC::SUCCESS) { - LOG_WARN("failed to open right operator. rc=%d:%s", rc, strrc(rc)); - return rc; - } - return rc; -} - -RC JoinOperator::step_right() -{ - rc = right_->next(); - while (rc == RC::SUCCESS) { - if (predicate_->filter()) { - return rc; - } - - rc = right_->next(); - } - return rc; -} - -RC JoinOperator::next() -{ - RC rc = RC::SUCCESS; - while (true) { - if (round_done_) { - rc = left_->next(); - if (rc != RC::SUCCESS) { - return rc; - } - - round_done_ = false; - - right_->close(); - right_->open(); // TODO - } - - rc = step_right(); - if (rc == RC::SUCCESS) { - return rc; - } - - if (rc == RC::RECORD_EOF) { - round_done_ = true; - } else { - return rc; - } - } - - return RC::RECORD_EOF; -} - -RC JoinOperator::close() -{ - left_->close(); - right_->close(); - return RC::SUCCESS; -}