getRow gets the row which from `insert into select from` or `load data`. The input values from these two statements are datums instead of expressions which are used in `insert into set x=y`. copied from InsertValues
(vals []types.Datum, hasValue []bool, rowID int64)
| 164 | // expressions which are used in `insert into set x=y`. |
| 165 | // copied from InsertValues |
| 166 | func (en *TableKVEncoder) getRow(vals []types.Datum, hasValue []bool, rowID int64) ([]types.Datum, error) { |
| 167 | row := make([]types.Datum, len(en.Columns)) |
| 168 | for i := range en.insertColumns { |
| 169 | casted, err := table.CastColumnValue(en.SessionCtx.GetExprCtx(), vals[i], en.insertColumns[i].ToInfo(), false, false) |
| 170 | if err != nil { |
| 171 | return nil, err |
| 172 | } |
| 173 | |
| 174 | offset := en.insertColumns[i].Offset |
| 175 | row[offset] = casted |
| 176 | } |
| 177 | |
| 178 | return en.fillRow(row, hasValue, rowID) |
| 179 | } |
| 180 | |
| 181 | func (en *TableKVEncoder) fillRow(row []types.Datum, hasValue []bool, rowID int64) ([]types.Datum, error) { |
| 182 | var value types.Datum |
no test coverage detected