15
15
package expression
16
16
17
17
import (
18
+ << << << < HEAD :expression / chunk_executor.go
18
19
"github.com/pingcap/tidb/parser/ast"
19
20
"github.com/pingcap/tidb/parser/mysql"
20
21
"github.com/pingcap/tidb/sessionctx"
21
22
"github.com/pingcap/tidb/types"
22
23
"github.com/pingcap/tidb/util/chunk"
24
+ == == == =
25
+ "github.com/pingcap/tidb/pkg/parser/ast"
26
+ "github.com/pingcap/tidb/pkg/parser/mysql"
27
+ "github.com/pingcap/tidb/pkg/types"
28
+ "github.com/pingcap/tidb/pkg/util/chunk"
29
+ "github.com/pingcap/tidb/pkg/util/logutil"
30
+ "go.uber.org/zap"
31
+ >> >> >> > fb9d2203b99 (expression : enum / set could be invalid during evaluation (#49543 )):pkg / expression / chunk_executor .go
23
32
)
24
33
25
34
// Vectorizable checks whether a list of expressions can employ vectorized execution.
@@ -179,7 +188,19 @@ func evalOneVec(ctx sessionctx.Context, expr Expression, input *chunk.Chunk, out
179
188
if result .IsNull (i ) {
180
189
buf .AppendNull ()
181
190
} else {
191
+ << << << < HEAD:expression / chunk_executor .go
182
192
buf .AppendEnum (types.Enum {Value : 0 , Name : result .GetString (i )})
193
+ == == == =
194
+ enum , err := types .ParseEnumName (ft .GetElems (), result .GetString (i ), ft .GetCollate ())
195
+ if err != nil {
196
+ logutil .BgLogger ().Debug ("Wrong enum name parsed during evaluation" ,
197
+ zap .String ("The name to be parsed in the ENUM" , result .GetString (i )),
198
+ zap .Strings ("The valid names in the ENUM" , ft .GetElems ()),
199
+ zap .Error (err ),
200
+ )
201
+ }
202
+ buf .AppendEnum (enum )
203
+ >> >> >> > fb9d2203b99 (expression : enum / set could be invalid during evaluation (#49543 )):pkg / expression / chunk_executor .go
183
204
}
184
205
}
185
206
output .SetCol (colIdx , buf )
@@ -191,7 +212,19 @@ func evalOneVec(ctx sessionctx.Context, expr Expression, input *chunk.Chunk, out
191
212
if result .IsNull (i ) {
192
213
buf .AppendNull ()
193
214
} else {
215
+ << << << < HEAD:expression / chunk_executor .go
194
216
buf .AppendSet (types.Set {Value : 0 , Name : result .GetString (i )})
217
+ == == == =
218
+ set , err := types .ParseSetName (ft .GetElems (), result .GetString (i ), ft .GetCollate ())
219
+ if err != nil {
220
+ logutil .BgLogger ().Debug ("Wrong set name parsed during evaluation" ,
221
+ zap .String ("The name to be parsed in the SET" , result .GetString (i )),
222
+ zap .Strings ("The valid names in the SET" , ft .GetElems ()),
223
+ zap .Error (err ),
224
+ )
225
+ }
226
+ buf .AppendSet (set )
227
+ >> >> >> > fb9d2203b99 (expression : enum / set could be invalid during evaluation (#49543 )):pkg / expression / chunk_executor .go
195
228
}
196
229
}
197
230
output .SetCol (colIdx , buf )
0 commit comments