-
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
*: Fix #254 #334
*: Fix #254 #334
Conversation
@@ -489,9 +490,9 @@ func (d *ddl) addColumn(schema model.CIStr, tbl table.Table, spec *AlterSpecific | |||
tb := tbl.(*tables.Table) | |||
tb.Columns = newCols | |||
// TODO: update index | |||
// TODO: update default value | |||
// update infomation schema | |||
updateDefaultValue(ctx, tb, col) |
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.
Need error check.
_, err = tb.AddRecord(ctx, []interface{}{1}) | ||
_, err = tb.AddRecord(ctx, []interface{}{2}) | ||
c.Assert(err, IsNil) | ||
alterStmt := statement(`alter table t2 add b enum("bbb") first`).(*stmts.AlterTableStmt) |
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.
Should add a test that after u add a new column, u can select the updated value.
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.
tb.Row()
will get the updated values.
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.
Yes, but need a value equal check.
return errors.Trace(err0) | ||
} | ||
k := t.RecordKey(handle, col) | ||
colID, err0 := tables.ColumnID(k) |
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 that in addColumn there will be no new column, so here colID == col.ID
will always be 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.
yep.
here colID == col.ID
is always true. Because the key is produced by RecordKey(handle, col)
。
LGTM |
* optimize parse csv and local backend write tikv * fix * remove IndexAnyUtf8 because the implement buggy for csv parser * update pebble and options
Signed-off-by: Shuaipeng Yu <[email protected]>
Signed-off-by: Shuaipeng Yu <[email protected]>
Signed-off-by: Shuaipeng Yu <[email protected]>
Signed-off-by: Wish <[email protected]>
Fix #254