提交 ef43cea5 编写于 作者: 羽飞's avatar 羽飞

add file headers; remove unused files

上级 eca82312
/* 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();
}
}
/* 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;
}
/* 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__
/* 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;
};
/* 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
{
}
/* 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;
};
/* 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 "sql/operator/index_scan_operator.h"
#include "storage/index/index.h" #include "storage/index/index.h"
......
/* 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 #pragma once
#include "sql/operator/operator.h" #include "sql/operator/operator.h"
......
/* 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;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册