Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

实现会话变量的能力 #344

Open
hnwyllmm opened this issue Feb 26, 2024 · 1 comment
Open

实现会话变量的能力 #344

hnwyllmm opened this issue Feb 26, 2024 · 1 comment
Labels
feature help wanted Needs help from a contributor

Comments

@hnwyllmm
Copy link
Collaborator

hnwyllmm commented Feb 26, 2024

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

当我们在使用一个数据库时,需要一些手段来调整当前会话或整个系统的行为。比如事务隔离级别、超时时间、show trace等。

Describe the solution you'd like
A clear and concise description of what you want to happen.

使用会话变量来做这个控制。
会话变量,session variables,是MySQL中一个非常基础的功能,当前MiniOB中有非常简单的实现,但是没有到能够正常使用的程度。

由于MiniOB是一个学习使用的数据库,对各个功能要求尽量简介、够用,保持代码结构清晰,所以不用实现与MySQL完全相同的功能。
在初步阶段,需要实现一个会话变量的框架,后续能够在此基础上做扩展。

功能列表:

  • 全局变量(当前可以不要求支持持久化)。重连才会生效
  • 会话变量(仅当前会话/连接生效)
  • 变量的读取和设置
  • 支持 sql_debug 变量(参考 session.h:sql_debug_)
  • 支持变量的类型:整数、字符串、浮点数和boolean(参考 value.h中的定义)

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

OceanBase 数据库的实现可以参考 https://github.com/oceanbase/oceanbase/tree/develop/src/share/system_variable

由于OceanBase 是一个生产级数据库,实现较复杂,可以浏览代码做参考。

如果对这个feature感兴趣,可以联系我,随时交流。

@hnwyllmm hnwyllmm added help wanted Needs help from a contributor feature labels Feb 26, 2024
@DylanGuo916
Copy link
Contributor

Already sent you an email 🙋‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature help wanted Needs help from a contributor
Projects
None yet
Development

No branches or pull requests

2 participants