-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
meta: introduce metabuild.Context
to build meta
#56176
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @lcwangchao. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
ddfbd74
to
9a72c6a
Compare
@@ -182,15 +183,6 @@ func (d *SchemaTracker) CreateTable(ctx sessionctx.Context, s *ast.CreateTableSt | |||
if schema == nil { | |||
return infoschema.ErrDatabaseNotExists.GenWithStackByArgs(ident.Schema) | |||
} | |||
// suppress ErrTooLongKey | |||
ctx.SetValue(ddl.SuppressErrorTooLongKeyKey, true) |
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.
SuppressErrorTooLongKeyKey
is not needed now. We can specify some extra options when constructing metabuild.Context
9a72c6a
to
6b2441a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #56176 +/- ##
=================================================
- Coverage 72.9122% 57.0354% -15.8769%
=================================================
Files 1631 1760 +129
Lines 448528 635228 +186700
=================================================
+ Hits 327032 362305 +35273
- Misses 101356 248019 +146663
- Partials 20140 24904 +4764
Flags with carried forward coverage won't be shown. Click here to find out more.
|
func checkTooBigFieldLengthAndTryAutoConvert(tp *types.FieldType, colName string, sessVars *variable.SessionVars) error { | ||
if sessVars != nil && !sessVars.SQLMode.HasStrictMode() && tp.GetType() == mysql.TypeVarchar { | ||
func checkTooBigFieldLengthAndTryAutoConvert(ctx *metabuild.Context, tp *types.FieldType, colName string) error { | ||
if !ctx.GetSQLMode().HasStrictMode() && tp.GetType() == mysql.TypeVarchar { |
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.
Seems ctx
here is always not nil. So I removed sessVars != nil
8474a0b
to
c734008
Compare
/retest |
@lcwangchao: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
if ctx == nil || (ctx.GetSessionVars().SQLMode.HasStrictMode() && !suppressErrorTooLongKeyForSchemaTracker(ctx)) { | ||
// return error in strict sql mode | ||
if !suppressTooLongKeyErr { |
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.
c734008
to
8181ee9
Compare
8181ee9
to
bf1051f
Compare
What problem does this PR solve?
Issue Number: close #56175
What changed and how does it work?
A new package
pkg/meta/metabuild
is introduced. Andmetabuild.Context
is proposed to build metas likemeta.TableInfo
,meta.ColumnInfo
,meta.IndexInfo
, etc ...Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.