Skip to content

Commit

Permalink
Merge branch 'master' into lightning-extstorage
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Mar 25, 2022
2 parents 8d215c6 + 5a14cc3 commit b926161
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 33 deletions.
15 changes: 0 additions & 15 deletions expression/expr_to_pb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1241,11 +1241,6 @@ func TestExprPushDownToTiKV(t *testing.T) {
retType: types.NewFieldType(mysql.TypeString),
args: []Expression{stringColumn},
},
{
functionName: ast.Right,
retType: types.NewFieldType(mysql.TypeString),
args: []Expression{stringColumn, intColumn},
},
{
functionName: ast.Sin,
retType: types.NewFieldType(mysql.TypeDouble),
Expand All @@ -1266,11 +1261,6 @@ func TestExprPushDownToTiKV(t *testing.T) {
retType: types.NewFieldType(mysql.TypeDouble),
args: []Expression{intColumn},
},
{
functionName: ast.Tan,
retType: types.NewFieldType(mysql.TypeDouble),
args: []Expression{intColumn},
},
{
functionName: ast.Atan,
retType: types.NewFieldType(mysql.TypeDouble),
Expand Down Expand Up @@ -1341,11 +1331,6 @@ func TestExprPushDownToTiKV(t *testing.T) {
retType: types.NewFieldType(mysql.TypeDate),
args: []Expression{dateColumn},
},
{
functionName: ast.YearWeek,
retType: types.NewFieldType(mysql.TypeDate),
args: []Expression{dateColumn},
},
{
functionName: ast.ToSeconds,
retType: types.NewFieldType(mysql.TypeDate),
Expand Down
4 changes: 2 additions & 2 deletions expression/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ func scalarExprSupportedByTiKV(sf *ScalarFunction) bool {

// Rust use the llvm math functions, which have different precision with Golang/MySQL(cmath)
// open the following switchers if we implement them in coprocessor via `cmath`
ast.Sin, ast.Asin, ast.Cos, ast.Acos, ast.Tan, ast.Atan, ast.Atan2, ast.Cot,
ast.Sin, ast.Asin, ast.Cos, ast.Acos /* ast.Tan */, ast.Atan, ast.Atan2, ast.Cot,
ast.Radians, ast.Degrees, ast.Conv, ast.CRC32,

// control flow functions.
Expand All @@ -984,7 +984,7 @@ func scalarExprSupportedByTiKV(sf *ScalarFunction) bool {
ast.JSONUnquote,

// date functions.
ast.Date, ast.Week, ast.YearWeek, ast.ToSeconds, ast.DateDiff,
ast.Date, ast.Week /* ast.YearWeek */, ast.ToSeconds, ast.DateDiff,
/* ast.TimeDiff, ast.AddTime, ast.SubTime, */
ast.MonthName, ast.MakeDate, ast.TimeToSec, ast.MakeTime,
ast.DateFormat,
Expand Down
16 changes: 0 additions & 16 deletions planner/core/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2835,10 +2835,6 @@ func TestTimeScalarFunctionPushDownResult(t *testing.T) {
function: "Week",
sql: "select col1, Week(col1) from t where Week(col1)=Week('2022-03-24 01:02:03.040506');",
},
{
function: "YearWeek",
sql: "select col1, YearWeek(col1) from t where YearWeek(col1)=YearWeek('2022-03-24 01:02:03.040506');",
},
{
function: "to_seconds",
sql: "select col1, to_seconds(col1) from t where to_seconds(col1)=to_seconds('2022-03-24 01:02:03.040506');",
Expand Down Expand Up @@ -2920,10 +2916,6 @@ func TestNumberFunctionPushDown(t *testing.T) {
sql: "select c, acos(c) from t where acos(4.4) = acos(c)",
function: "acos",
},
{
sql: "select b,tan(b) from t where tan(61)=tan(b)",
function: "tan",
},
{
sql: "select b,atan(b) from t where atan(61)=atan(b)",
function: "atan",
Expand Down Expand Up @@ -2996,10 +2988,6 @@ func TestScalarFunctionPushDown(t *testing.T) {
tk.MustQuery("explain analyze select /*+read_from_storage(tikv[t])*/ * from t where acos(id);").
CheckAt([]int{0, 3, 6}, rows)

rows[1][2] = "tan(cast(test.t.id, double BINARY))"
tk.MustQuery("explain analyze select /*+read_from_storage(tikv[t])*/ * from t where tan(id);").
CheckAt([]int{0, 3, 6}, rows)

rows[1][2] = "atan(cast(test.t.id, double BINARY))"
tk.MustQuery("explain analyze select /*+read_from_storage(tikv[t])*/ * from t where atan(id);").
CheckAt([]int{0, 3, 6}, rows)
Expand Down Expand Up @@ -3076,10 +3064,6 @@ func TestScalarFunctionPushDown(t *testing.T) {
tk.MustQuery("explain analyze select /*+read_from_storage(tikv[t])*/ * from t where week(d)").
CheckAt([]int{0, 3, 6}, rows)

rows[1][2] = "yearweek(test.t.d)"
tk.MustQuery("explain analyze select /*+read_from_storage(tikv[t])*/ * from t where yearweek(d)").
CheckAt([]int{0, 3, 6}, rows)

rows[1][2] = "to_seconds(test.t.d)"
tk.MustQuery("explain analyze select /*+read_from_storage(tikv[t])*/ * from t where to_seconds(d)").
CheckAt([]int{0, 3, 6}, rows)
Expand Down

0 comments on commit b926161

Please sign in to comment.