Skip to content

Commit 2bbf896

Browse files
author
linxiaotao
committed
fix(ai): handle nil ValueExpr in getValueFromExpr function
1 parent 56fa073 commit 2bbf896

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sqle/driver/mysql/rule/ai/rule_00112.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ func init() {
143143

144144
// getValueFromExpr 从ValueExpr中提取实际的数值
145145
func getValueFromExpr(expr *parserdriver.ValueExpr) (int64, bool) {
146+
if expr == nil {
147+
return 0, false
148+
}
146149
switch expr.Datum.Kind() {
147150
case tidbTypes.KindInt64:
148151
return expr.GetInt64(), true

0 commit comments

Comments
 (0)