abc19b08d5
util/types: mysql time's week function ( #2259 )
2016-12-20 11:14:23 +08:00
b6588b81d4
*: clean up, move strToDate to util/types package ( #2261 )
2016-12-16 10:36:38 +08:00
4095299e9c
*: add comparable varint encoding. ( #2236 )
2016-12-14 21:26:59 +08:00
4741960b44
util/types: re-implement check time related ( #2233 )
2016-12-14 10:09:55 +08:00
f1aaeafade
util/segmentmap: Improve the test coverage ( #2235 )
...
* util/segmentmap: improve the test coverage
2016-12-13 14:41:01 +08:00
c30849acc0
util/types: provide time Format method ( #2206 )
...
use Format to implement String(), so 00 month and day can be display
2016-12-12 20:31:42 +08:00
43102df978
util/time: ToPackedUint would return error for invalid timestamp ( #2190 )
...
month=0 or day=0 is invalid in timestamp such as 2016-00-00 00:00:00
so ToPackedUint should return error, for those cases.
2016-12-12 18:50:16 +08:00
24f27a2622
*: types.TimeInternal GoTime method would return error ( #2185 )
2016-12-12 17:22:49 +08:00
654f4f49b3
*: Remove the package of bytes ( #2221 )
...
* util: remove the package of bytes
2016-12-12 12:09:48 +08:00
1b8051d3c5
*: set and use Flags to properly handle truncate error ( #2212 )
2016-12-12 11:45:58 +08:00
b3efd4c235
util/types: fix bug parseFrac overflow ignored during time Parse ( #2197 )
...
"121231113045.9999999" should parse to
"2012-12-31 11:30:46.000000"
but we get
"2012-12-31 11:30:45.100000"
* fix and add more test
* make golint happy
* address comment
* fix bug
* address comment
2016-12-09 23:07:32 +08:00
8a5a19272e
util/types: tiny clean up ( #2204 )
2016-12-08 21:10:42 +08:00
7e61f16bc1
util/types: fix floatStrToIntStr, handle large exponent corner case. ( #2199 )
2016-12-08 20:17:29 +08:00
6ef340fb32
util/types: properly handle truncate error for string to float or int. ( #2186 )
...
When converting from string to float or int, use StatementContext to handle truncate error.
Also directly convert a string to Int instead converting to float first, then convert float to int.
2016-12-07 19:42:46 +08:00
e396fbecf7
util/charset: Let charset name be insensitive. ( #2184 )
2016-12-06 18:00:50 +08:00
d24f64615a
util/types: mysqlTime implements TimeInternal interface ( #2142 )
2016-12-06 10:59:10 +08:00
74a1c9935d
*: add StatementContext argument to functions. ( #2157 )
...
Add StatementContext argument to more functions where it is needed.
2016-12-02 23:28:11 +08:00
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
7e2f769e54
*: remove mockContext in the package of ddl ( #2132 )
2016-11-29 19:44:15 +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
ea894e8b77
*: Add a function GenByArgs for Error ( #2033 )
...
*: Add a function GenByArgs for Error
2016-11-27 13:18:43 +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
0af8520a78
sessionctx/variable: remove dependency on context package. ( #2064 )
...
Makes using session variable easier and faster.
Prepare for use session variable to handle data truncated error.
2016-11-23 14:39:48 +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
1c6c145f94
*: Set custom verbose flag to true ( #1956 )
...
* *: set custom verbose flag to true
* *: update .gitignore
2016-11-05 18:00:13 +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
1f1a60c02a
*: improve log ( #1944 )
...
Add logging for set system variable.
Add connection ID in log.
Adjust some log level.
Improve readability.
2016-11-04 17:11:10 +08:00
035666f231
plan: add cast function for PatternInExpr. ( #1932 )
2016-11-03 15:40:58 +08:00
96a444a562
bin: add flag to print version information ( #1896 )
2016-10-29 08:44:29 +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
aec737e4da
charset: fix typo ( #1859 )
2016-10-23 17:38:18 +08:00
6c3bae93a7
printer: Remove 'the' ( #1848 )
2016-10-19 20:10:39 +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
ade11fe9f4
*: support history read. ( #1734 )
...
* *: support history read.
This commit only handles the case when scheme does not change.
Use history schema will be supported in the following PR.
2016-09-19 15:37:30 +08:00
999fa025c7
server: Add metrics ( #1729 )
...
Add metrics for server package.
Update gitcookie.sh.
2016-09-17 11:45:57 +08:00
b99521846f
*: Make golint work and happy. ( #1721 )
2016-09-13 18:11:47 +08:00
6dec14119a
Fix typos ( #1714 )
2016-09-09 22:58:47 +08:00
42010e61db
fix typo and ineffassign ( #1702 )
...
* fix typo and ineffassign
2016-09-07 01:57:58 -05: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
9923f8cfa9
Reduce slice growth ( #1663 )
2016-08-30 19:52:41 +08:00
d6605468be
tidb: New domain with retry and backoff ( #1640 )
2016-08-29 11:17:25 +08:00
558ba06368
decode with value size ( #1641 )
...
Add size parameter for Decode to reduce slice growth
BenchmarkDecodeWithSize-8 300000 6153 ns/op
BenchmarkDecodeWithOutSize-8 200000 11934 ns/op
2016-08-26 10:44:03 +08:00