Commit Graph

60 Commits

Author SHA1 Message Date
353b216b7a planner, executor: check col.OrigColName instead of col.ColName in isCoveringIndex (#9637) 2019-03-12 10:19:26 +08:00
6e8cd3c7dd executor: support window function nth_value (#9596) 2019-03-12 00:42:37 +08:00
612dd14fd4 planner/core: fix unexpected error of window function (#9567) 2019-03-11 21:10:23 +08:00
ec208f5484 planner: the expression field name disappears when there's window function (#9644) 2019-03-11 19:01:41 +08:00
45c9458236 planner: fix select denied message (#9627) 2019-03-11 18:38:08 +08:00
85c4553c4e planner: chose outer table based on cost when both tables are specified in TIDB_INLJ (#9579) 2019-03-08 13:25:44 +08:00
e6b1c4cfae planner: fix window func support (#9605) 2019-03-07 23:28:56 +08:00
2b646cb58b planner, executor: handle default frame for window functions (#9544) 2019-03-06 19:37:30 +08:00
d81f65f577 planner: fix false negative "full group by" check for agg in subquery (#9542) 2019-03-04 18:52:44 +08:00
a59a5f41e1 planner, executor: support range framed window functions (#9450) 2019-02-27 10:07:28 +08:00
H
f80e401b80 planner/core: fix wrong behavior of prepare && execute (#9204) 2019-02-25 16:44:15 +08:00
5a283a98dd plan/executor: make semi joins null and empty aware (#9051) 2019-02-25 15:42:38 +08:00
ed7bb00417 planner, expression: support builtin function NAME_CONST (#9261) 2019-02-19 10:02:46 +08:00
4ad4684da1 privilege,planner: handle View's security privilege check (#9194) 2019-02-12 10:35:18 +08:00
3d614e0965 planner: enable function any_value in aggregation if ONLY_FULL_GROUP_BY is set (#9255) 2019-02-10 10:03:40 +08:00
09a5c8028e plan: derive col is not null from col op col conditions (#8603)
Check whether the `op` condition is null rejected, if yes, derive
`col is not null` for both sides of inner join, and for inner side
of outer join.

Also, remove duplicate conditions before pushing them down. Check
if the condition is mutable before removing duplicates.

For AntiSemiJoin, AntiLeftOuterSemiJoin and LeftOuterSemiJoin, do
not generate new `is not null` conditions.
2019-01-30 10:53:46 +08:00
0fdc526b42 planner: support window function frame clause (#9004) 2019-01-18 16:46:54 +08:00
ec833bc4d2 *: fix some lints produced by golangci-lint (#8999) 2019-01-16 16:44:49 +08:00
3835bef7ae executor: support window func for aggregate without frame clause (#8899) 2019-01-15 15:23:17 +08:00
dca815c1c5 expression: return error when doing ResolveIndices (#8929) 2019-01-15 14:34:06 +08:00
3c98f69266 *: support select partition for partition table (#8990) 2019-01-14 20:55:52 +08:00
9f346a3add planner, executor: return err when INSERT/UPDATE/ANALYZE/DELETE a view (#8848) 2019-01-14 15:47:48 +08:00
d6d97259ec planner/core: fix a bug that check update privilege use wrong AsName and DBName (#9003)
* Fix issue 8911
* Check privilege should use table OrigName, instead of AsName
2019-01-10 17:49:25 +08:00
23c1946d21 planner/core: support named window (#8937) 2019-01-07 15:35:57 +08:00
78a51a4626 executor: support "show columns from" for view (#8863) 2019-01-05 21:32:32 +08:00
7ee6811d97 planner: added support for error in visitInfo (#8855) 2019-01-04 15:15:18 +08:00
91cdbf2f54 planner: support window function (#8630) 2019-01-03 16:56:06 +08:00
235d04c5e9 docs: add comments about why update statement using writable columns. (#8913) 2019-01-03 14:55:14 +08:00
386f8e3b7a planner: update generated column inside a transaction should return error (#8909) 2019-01-03 11:01:02 +08:00
599b9ebfcd planner/core,binloginfo: add a projection to fix 'delete from join' schema (#8805)
'delete from t where a in (select ...) or b in (select ...)'
The correct schema should be the schema of t, rather than the schema of
the join. Add a projection in this case.
2018-12-29 15:41:12 +08:00
123aba282c planner: support building data source from View (#8757) 2018-12-26 14:22:26 +08:00
90b619a452 planner/core: add support for nested virtual generated columns (#8659) 2018-12-25 21:59:04 +08:00
a7907ede7a *: remove fail field from TxnState (#8712)
Originally, `fail` is added to simplify error handling, avoiding large changes on
the Txn() interface API. But it turns out that `fail` becomes the root of many bugs.
So this commit remove the `fail` and make an API refactory.
2018-12-20 16:36:12 +08:00
29c17a1eb9 planner/core: correct column name with unary plus sign (#8702) 2018-12-19 23:35:43 +08:00
6bd8bddb12 planner/core: simple greedy join reorder based on CBO (#8394) 2018-12-07 16:34:19 +08:00
c677187728 plan: support ? in Order By / Group By / Limit Offset clauses (#8206) 2018-12-03 21:48:54 +08:00
3b68ee59a6 planner: for UNION statements, ORDER BY cannot use column references including a table name (#8389) 2018-11-29 12:40:08 +08:00
487bb50390 planner, executor: fix tp.Flen size when union with castIntAsString (#8442) 2018-11-27 11:35:52 +08:00
89cd59d217 planner/core,session: fix privilege check for update (#8376)
In the statement: "update t1,t2 set t1.id = t2.id"
TiDB should check update privilege for t1 and select privilege for t2,
Fix a bug that it checks update privilege for both t1 and t2
2018-11-21 18:15:13 +08:00
0c3e9c1652 session,executor: run statement without transaction (#8260)
`set @@autocommit = 0`
`select 1` // This statement should not make the session enter a transaction,
because it never need Txn().
Make txn lazy initialize
2018-11-14 20:10:58 +08:00
aa979705df planner, executor: eliminate extra columns introduced by OrderBy upon Union (#8290) 2018-11-13 17:03:34 +08:00
679d2e559c planner/core: make TIDB_INLJ to specify the inner table (#8243) 2018-11-13 11:55:30 +08:00
cd5ffb3b32 planner: support join elimination rule (#8021) 2018-11-09 21:31:29 +08:00
4a3080a1c1 plan: use original field name when Column is extracted from IfNull (#8225) 2018-11-08 15:13:45 +08:00
deec48d629 planner: fix union statements order (#8214) 2018-11-07 17:50:34 +08:00
761365b31c *: avoid using columnEvaluator for the Projectin build by buildProjtion4Union (#8142) 2018-11-02 17:28:09 +08:00
60d05bd759 planner: eliminate ifnull in expression rewriting process (#7996) 2018-11-02 12:50:27 +08:00
32b1dbd8d5 *: rename "github.com/pkg/errors" to "github.com/pingcap/errors" (#8136)
We import "github.com/pkg/errors" in the code, and actually put
the "github.com/pingcap/errors" there in the vendor path.
That's a dirty hack, and prevent the introduce of Go module.
2018-11-01 16:09:07 +08:00
696ef7bae2 plan: convert in subquery to agg and inner join (#7531) 2018-10-30 19:19:32 +08:00
f370da0b43 planner: export init() to Init() (#8060) 2018-10-26 10:44:30 +08:00