(t *testing.T)
| 1286 | } |
| 1287 | |
| 1288 | func TestBuiltinFuncFlen(t *testing.T) { |
| 1289 | // same as TestIssue45378 and TestIssue45253 |
| 1290 | store := testkit.CreateMockStore(t) |
| 1291 | tk := testkit.NewTestKit(t, store) |
| 1292 | tk.MustExec("use test") |
| 1293 | tk.MustExec(`CREATE TABLE t1(c1 INT)`) |
| 1294 | tk.MustExec(`INSERT INTO t1 VALUES (1)`) |
| 1295 | |
| 1296 | funcs := []string{ast.Abs, ast.Acos, ast.Asin, ast.Atan, ast.Ceil, ast.Ceiling, ast.Cos, |
| 1297 | ast.CRC32, ast.Degrees, ast.Floor, ast.Ln, ast.Log, ast.Log2, ast.Log10, ast.Unhex, |
| 1298 | ast.Radians, ast.Rand, ast.Round, ast.Sign, ast.Sin, ast.Sqrt, ast.Tan, ast.SM3, |
| 1299 | ast.Quote, ast.RTrim, ast.ToBase64, ast.Trim, ast.Upper, ast.Ucase, ast.Hex, |
| 1300 | ast.BitLength, ast.CharLength, ast.Compress, ast.MD5, ast.SHA1, ast.SHA} |
| 1301 | args := []string{"2038330881", "'2038330881'", "'牵'", "-1", "''", "0"} |
| 1302 | |
| 1303 | for _, f := range funcs { |
| 1304 | for _, a := range args { |
| 1305 | q := fmt.Sprintf("SELECT c1 from t1 where %s(%s)", f, a) |
| 1306 | tk.MustExec(`set tidb_enable_non_prepared_plan_cache=1`) |
| 1307 | r1 := tk.MustQuery(q) |
| 1308 | tk.MustExec(`set tidb_enable_non_prepared_plan_cache=0`) |
| 1309 | r2 := tk.MustQuery(q) |
| 1310 | r1.Sort().Check(r2.Sort().Rows()) |
| 1311 | } |
| 1312 | } |
| 1313 | } |
| 1314 | |
| 1315 | func TestWarningWithDisablePlanCacheStmt(t *testing.T) { |
| 1316 | store := testkit.CreateMockStore(t) |
nothing calls this directly
no test coverage detected