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

"optional" properties for expression.EvalContext #51477

Closed
Tracked by #49090
lcwangchao opened this issue Mar 4, 2024 · 0 comments · Fixed by #51487, #52015 or #52155
Closed
Tracked by #49090

"optional" properties for expression.EvalContext #51477

lcwangchao opened this issue Mar 4, 2024 · 0 comments · Fixed by #51487, #52015 or #52155

Comments

@lcwangchao
Copy link
Collaborator

lcwangchao commented Mar 4, 2024

The EvalContext has many fields to provide but not all of them are required in every scene. So it's better to classify these fields into two categories:

  1. Basic properties such as type.Context, errctx.Context, SQLMode, etc... These properties are used by functions widely. For example, errctx.Context used by most functions to handle some errors. The basic properties are also simple, they should be easy to clone and mock. The EvalContext MUST provide basic properties.
  2. Optional properties, as its name, is "optional". In some scenes such as lightning, it only requires some of the properties, so these properties are provided on demand. Optional properties are not widely used, for example, tidb_is_ddl_owner requires EvalContext to provide the information on whether the current tidb is DDL owner, but this function is forbidden in most other scenes except SQL query, like partition expressions or generated column expressions. Some optional properties are complex, so not all of them can be cloned or migrated.
ti-chi-bot bot pushed a commit that referenced this issue Mar 25, 2024
imalasong pushed a commit to imalasong/tidb that referenced this issue Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment