Skip to content
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

planner: add collation test for pushing bit column down #32983

Merged
merged 3 commits into from
Mar 11, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions planner/core/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2720,6 +2720,17 @@ func TestBitColumnPushDown(t *testing.T) {
{" └─TableFullScan_5", "cop[tikv]", "keep order:false, stats:pseudo"},
}
tk.MustQuery(fmt.Sprintf("explain analyze %s", sql)).CheckAt([]int{0, 3, 6}, rows)

// test collation
tk.MustExec("update mysql.tidb set VARIABLE_VALUE='True' where VARIABLE_NAME='new_collation_enabled'")
tk.MustQuery("SELECT VARIABLE_VALUE FROM mysql.tidb WHERE VARIABLE_NAME='new_collation_enabled';").Check(
testkit.Rows("True"))
tk.MustExec("create table t3 (a bit(8));")
tk.MustExec("insert into t3 values (65)")
tk.MustExec("SET NAMES utf8mb4 COLLATE utf8mb4_bin")
tk.MustQuery("select a from t3 where cast(a as char) = 'a'").Check(testkit.Rows())
tk.MustExec("SET NAMES utf8mb4 COLLATE utf8mb4_general_ci")
tk.MustQuery("select a from t3 where cast(a as char) = 'a'").Check(testkit.Rows("A"))
}

func TestSysdatePushDown(t *testing.T) {
Expand Down