e288b3563f
types/util: use statement context to handle truncate error. ( #2147 )
...
use statement context to handle truncate error in ConvertTo MyDecimal.
2016-12-01 19:11:07 +08:00
3a721da8fc
*: fix cast decimal allocates large memory. ( #2146 )
...
If precision is too large, encode decimal allocates large amount of memory.
This commit set cast decimal unspecified length to default decimal length (10),
also add check on precision and frac on `MyDecimal.ToBin`.
2016-12-01 17:37:10 +08:00
296f4a6cf3
util/types: refact Time introduce a TimeInternal interface ( #2098 )
...
Go time representation is not compatible with mysql, this
commit is a prepare before the code refact.
timeInternal is a interface for time representation, and it
would make the refact more smooth.
2016-11-29 21:04:59 +08:00
5230f5eabd
variable: define StatementContext. ( #2121 )
...
StatementContext is used to hold statement execution mode and state.
As every computation need this, there are many API changes.
2016-11-29 14:25:38 +08:00
9cca7b0b02
types: move Bit, Enum, Set, Hex to types package ( #2085 )
...
Consistent with Time and MyDecimal.
2016-11-24 12:28:55 +08:00
b19cc75a94
mysql, types: move MyDecimal and Time from 'mysql' to 'types' package. ( #2082 )
...
So we don't need to handle sql mode in 'mysql' package, avoid potential dependency cycle.
2016-11-24 10:50:31 +08:00
91050ff1f8
parser: parse decimal literal instead of float literal ( #2044 )
...
Improves MySQL compatibility.
2016-11-21 19:29:25 +08:00
5d3bb33afd
util/types: fix decimal conversion. ( #1979 )
...
When datum converts to decimal, we should check the Flen and Decimal of
the given field type, return max value for overflow and round the value
for truncation.
2016-11-09 16:53:30 +08:00
0b43f77e40
util/types: fix convert Double ( #1955 )
...
When converting a string to double, the returned value should be parsed from valid part to the string
2016-11-05 16:27:21 +08:00
035666f231
plan: add cast function for PatternInExpr. ( #1932 )
2016-11-03 15:40:58 +08:00
d38cc3f534
support pushing bitwise operators and LogicXor down to kv ( #1846 )
2016-10-27 15:09:30 +08:00
f93029c458
util/types: truncate string when flen is 0 ( #1880 )
...
unspecified length is -1, we should 0 length too.
2016-10-26 21:52:25 +08:00
3738794502
util/types, table: truncate string by rune count, remove UTF8 validation ( #1877 )
...
Column length defined in create table should limits the rune count rather than bytes.
And MySQL doesn't return error for inserting invalid UTF8 string, we should not do it.
2016-10-26 20:34:35 +08:00
f4c5511640
*: Update the owner timeout of background job and pass golint ( #1840 )
2016-10-19 14:54:13 +08:00
2df4a4f29b
types: returns data too long error ( #1837 )
...
* types: returns data too long error when inserting a string longer than field type length.
2016-10-18 14:12:06 +08:00
6dec14119a
Fix typos ( #1714 )
2016-09-09 22:58:47 +08:00
6de67d3695
*: do not coerce int and uint to uint ( #1671 )
...
partially revert previous PR
2016-09-01 14:14:07 +08:00
e508a23234
util/types: fix CoerceDatum function behavior ( #1667 )
...
* util/types: fix CoerceDatum function behavior
2016-08-31 20:15:54 +08:00
79a044312d
*: cleanup Makefile ( #1625 )
...
remove travis 1.5.3,
makes check run faster.
gofmt writes file.
2016-08-23 15:54:51 +08:00
e31b281ee7
*: use new MyDecimal implementation. ( #1611 )
2016-08-22 20:24:39 +08:00
1f9da091b8
util/types: change FieldType of exprNode to value instead of pointer ( #1564 )
2016-08-09 12:45:59 +08:00
6abc5d88b7
types: Fix bug for CalculateSum ( #1497 )
2016-07-25 12:04:53 +08:00
f5a6c962b5
*: Change ctx.Value from interface{} to Datum ( #1494 )
2016-07-25 10:42:54 +08:00
8749945b0c
*: add builtin function greatest ( #1463 )
2016-07-20 11:32:14 +08:00
0450ba0b47
*: unify "See url" format ( #1391 )
...
* *: unify "See url" format
2016-07-05 11:21:10 +08:00
1a706853ed
Rename err2 to err1 where possible ( #1331 )
2016-06-19 08:33:33 +08:00
004500171e
*: Refactor datum arithmetic codes and support Add/Div in xeval. ( #1311 )
...
Prepare for aggregate function sum/avg.
2016-06-13 11:24:07 +08:00
e3597b6548
Add Datum.IsNull() fucntion ( #1298 )
...
Add IsNull function for Datum to simplify null check.
2016-06-07 23:35:25 +08:00
75f089d056
util/types: clean up, removed unused code. ( #1281 )
2016-06-02 10:42:36 +08:00
ced939df5d
types: Tiny cleanup ( #1270 )
...
Fix typo
2016-05-31 12:49:43 +08:00
4c339c567d
util/types: parse float with best effort. ( #1264 )
...
For example, "1.1a" should parsed to 1.1 rather than 0.
2016-05-30 14:26:41 +08:00
e22d8d06da
*: xapi push down mysql.Duration and mysql.Decimal. ( #1243 )
2016-05-20 18:30:30 +08:00
f6e7a331d0
codec: fix datum convert to float32. ( #1217 )
2016-05-10 16:07:18 +08:00
0841dbef9b
*: Support builtin function round(X), round(X, D) ( #1208 )
...
Support builtin function round(X), round(X, D)
2016-05-07 13:38:02 +08:00
3671f3958f
xapi: support IN expression push down. ( #1147 )
...
* xapi: support IN expression push down.
2016-04-25 19:50:33 +08:00
d78e4044cc
*: fix misspells ( #1143 )
2016-04-22 11:30:37 +08:00
895e9a0d86
*: fix issue#1089 and add tests ( #1106 )
2016-04-18 17:31:49 +08:00
bfa3ed7a2d
*: Fix issue #1071 ( #1088 )
...
* *: fix issue#1071 and add tests
* util: use RoundFloat in the ToBool and add tests.
2016-04-14 16:56:24 +08:00
a236ab94f3
xapi/xeval: implement tipb.Expr evaluator. ( #1063 )
...
* xapi/xeval: implement tipb.Expr evaluator.
* *: address comment
* xapi/xeval: update import
2016-04-08 14:25:17 +08:00
08034540f0
*: Add leak test
...
* *: add leak test and tiny clean up
* *: unify test format and add leak test
Conflicts:
store/localstore/compactor_test.go
mysql/error_test.go
*: add leak test
2016-04-07 20:53:45 +08:00
e697aa3e7e
*: Unify import check format and unify test format
2016-04-06 10:47:44 +08:00
86f4459543
util: Reserve mysql.Time change.
2016-03-31 18:49:17 +08:00
beb76cde02
Util: a optimization of mysql.* in Datum
...
We can use the space of Datum to save mysql.* to save the cost of interface.
2016-03-30 19:50:14 +08:00
8552e1fe43
Address comment.
2016-03-30 13:52:03 +08:00
136e405c04
Util: a optimization of mysql.Bit in Datum
...
We can use the space of Datum to save mysql.Bit to save the cost of interface.
2016-03-30 13:13:50 +08:00
afdf9a4ef6
Change mysql.Time to ptr in datum.
...
In this way, we can save the cost of the alloc of mysql.Time in interface.
In the future, we will change all mysql.Time to ptr to save the cost of copy mysql.Time struct.
2016-03-29 18:42:16 +08:00
c3461363bf
Merge pull request #1014 from pingcap/shenli/issue-1012
...
executor: Fix replace statement conflict with multiple row bug.
2016-03-25 16:49:55 +08:00
08bf548700
*: Fix replace statement conflict with multiple row bug.
...
Fix: https://github.com/pingcap/tidb/issues/1012
2016-03-25 16:40:12 +08:00
419f244031
evaluator: change interface to datum in evaluator package.
...
Change the remaining string functions.
2016-03-25 12:01:58 +08:00
c960c81d86
evaluator: Change the interfaces of builtinConcat to datums.
...
Change the interfaces of builtinConcat to datums.
2016-03-21 16:31:03 +08:00