Issue title: panic in cascades planner when read from partitioned table
 Issue body: # Bug Report

Please answer these questions before submitting your issue. Thanks!

## 1. What did you do?

```sql
drop table if exists pt;
create table pt(a bigint, b bigint) partition by hash(a) partitions 4;

-- enable cascades planner
set @@tidb_enable_cascades_planner = 1;
desc select * from pt;
```

## 2. What did you expect to see?

executed successfully, no panic.

## 3. What did you see instead?

panic log:

```
[2020/01/05 15:15:42.647 +08:00] [ERROR] [conn.go:622] ["connection running loop panic"] [conn=1] [lastSQL="desc select * from pt"] [err="runtime error: invalid memory address or nil pointer dereference"] [stack="goroutine 227 [running]:
github.com/pingcap/tidb/server.(*clientConn).Run.func1(0x5c0b920, 0xc00091aff0, 0xc0000c0680)
    /Users/zhangjian/Code/tidb/server/conn.go:620 +0xee
panic(0x5621540, 0x6f9d1e0)
    /opt/goroot/src/runtime/panic.go:679 +0x1b2
github.com/pingcap/tidb/planner/core.(*DataSource).initStats(0xc0074ce000)
    /Users/zhangjian/Code/tidb/planner/core/stats.go:148 +0x6c
github.com/pingcap/tidb/planner/core.(*DataSource).deriveStatsByFilter(0xc0074ce000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0074c4220)
    /Users/zhangjian/Code/tidb/planner/core/stats.go:162 +0x43
github.com/pingcap/tidb/planner/core.(*LogicalTableScan).DeriveStats(0xc0008ac750, 0x7023800, 0x0, 0x0, 0xc0008116b0, 0x7023800, 0x0, 0x0, 0x83858b8, 0x0, ...)
    /Users/zhangjian/Code/tidb/planner/core/stats.go:271 +0x137
github.com/pingcap/tidb/planner/cascades.(*Optimizer).fillGroupStats(0xc00031be30, 0xc000814c30, 0x1, 0xc00733c230)
    /Users/zhangjian/Code/tidb/planner/cascades/optimize.go:240 +0x24c
github.com/pingcap/tidb/planner/cascades.(*Optimizer).fillGroupStats(0xc00031be30, 0xc000814b40, 0xc000832680, 0x18)
    /Users/zhangjian/Code/tidb/planner/cascades/optimize.go:232 +0x14a
github.com/pingcap/tidb/planner/cascades.(*Optimizer).implGroup(0xc00031be30, 0xc000814b40, 0xc000814c80, 0x7fefffffffffffff, 0x1, 0xc0074c4160, 0x4016687, 0xc0008ac708)
    /Users/zhangjian/Code/tidb/planner/cascades/optimize.go:279 +0x12e
github.com/pingcap/tidb/planner/cascades.(*Optimizer).onPhaseImplementation(0xc00031be30, 0x5c5f620, 0xc00700a400, 0xc000814b40, 0x0, 0x0, 0xc00082cb00, 0x0, 0x0)
    /Users/zhangjian/Code/tidb/planner/cascades/optimize.go:251 +0x109
github.com/pingcap/tidb/planner/cascades.(*Optimizer).FindBestPlan(0xc00031be30, 0x5c5f620, 0xc00700a400, 0x5c3d540, 0xc00082cb00, 0x1, 0x1, 0x0, 0x0, 0x0)
    /Users/zhangjian/Code/tidb/planner/cascades/optimize.go:115 +0x10a
github.com/pingcap/tidb/planner.optimize(0x5c0b920, 0xc00091aff0, 0x5c5f620, 0xc00700a400, 0x5c0d420, 0xc00083e300, 0x5c342c0, 0xc0070438f0, 0x0, 0x203000, ...)
    /Users/zhangjian/Code/tidb/planner/optimize.go:151 +0x45e
github.com/pingcap/tidb/planner.Optimize(0x5c0b920, 0xc00091aff0, 0x5c5f620, 0xc00700a400, 0x5c0d420, 0xc00083e300, 0x5c342c0, 0xc0070438f0, 0xc000811110, 0x0, ...)
    /Users/zhangjian/Code/tidb/planner/optimize.go:50 +0x254
github.com/pingcap/tidb/planner/core.(*PlanBuilder).buildExplain(0xc0008dc500, 0x5c0b920, 0xc00091aff0, 0xc00082a900, 0x20, 0x56c7e60, 0x57de401, 0xc000830a80)
    /Users/zhangjian/Code/tidb/planner/core/planbuilder.go:2682 +0x10b
github.com/pingcap/tidb/planner/core.(*PlanBuilder).Build(0xc0008dc500, 0x5c0b920, 0xc00091aff0, 0x5c0c760, 0xc00082a900, 0xc0008dc500, 0xc007340400, 0x83858b8, 0x0)
    /Users/zhangjian/Code/tidb/planner/core/planbuilder.go:387 +0xe8b
github.com/pingcap/tidb/planner.optimize(0x5c0b920, 0xc00091aff0, 0x5c5f620, 0xc00700a400, 0x5c0c760, 0xc00082a900, 0x5c342c0, 0xc0070438f0, 0x83858b8, 0x0, ...)
    /Users/zhangjian/Code/tidb/planner/optimize.go:115 +0x17f
github.com/pingcap/tidb/planner.Optimize(0x5c0b920, 0xc00091aff0, 0x5c5f620, 0xc00700a400, 0x5c0c760, 0xc00082a900, 0x5c342c0, 0xc0070438f0, 0x0, 0x0, ...)
    /Users/zhangjian/Code/tidb/planner/optimize.go:50 +0x254
github.com/pingcap/tidb/executor.(*Compiler).Compile(0xc0074c4ea8, 0x5c0b920, 0xc00091aff0, 0x5c11ea0, 0xc00082a900, 0x0, 0x0, 0x0)
    /Users/zhangjian/Code/tidb/executor/compiler.go:61 +0x253
github.com/pingcap/tidb/session.(*session).execute(0xc00700a400, 0x5c0b920, 0xc00091aff0, 0xc000832621, 0x15, 0x407aa46, 0xc0074c51c0, 0x4030a81, 0x596e9e8, 0xc0074c51d0)
    /Users/zhangjian/Code/tidb/session/session.go:1110 +0x5cf
github.com/pingcap/tidb/session.(*session).Execute(0xc00700a400, 0x5c0b920, 0xc00091aff0, 0xc000832621, 0x15, 0x0, 0x0, 0x0, 0x0, 0x0)
    /Users/zhangjian/Code/tidb/session/session.go:1064 +0xdb
github.com/pingcap/tidb/server.(*TiDBContext).Execute(0xc00091b2c0, 0x5c0b920, 0xc00091aff0, 0xc000832621, 0x15, 0xc0074c5348, 0xc0074c5338, 0x40cf3e2, 0xc0004f4900, 0x1)
    /Users/zhangjian/Code/tidb/server/driver_tidb.go:248 +0x7c
github.com/pingcap/tidb/server.(*clientConn).handleQuery(0xc"]
```

## 4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?

```sql
TiDB(heather89@example.net:test) > select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-alpha-1304-g2b7b657f4
Git Commit Hash: 2b7b657f42880df9771cb82c75c19f16aa5d7952
Git Branch: master
UTC Build Time: 2020-01-05 07:21:17
GoVersion: go1.13.5
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
```
 Comments: 
 Comment 0: the directly panic reason: `ds.statisticTable` is nil.
{'source': 'GithubIssues', 'repo_name_with_owner': 'pingcap/tidb', 'issue_id': 545383849, 'repo_stars': 33833.0}