9313558fea
util/filesort: sort rows using file sort. ( #2377 )
2017-01-15 01:16:41 +08:00
3bfac81a4e
*: add builtin function FROM_DAYS ( #2434 )
2017-01-15 01:10:47 +08:00
849071221c
Wrong behavior when executing alter table t add index c (c(3)); ( #2432 ) ( #2441 )
2017-01-11 18:25:57 +08:00
0eaef417e8
type/util: add functions mixDateAndTime and getDateFromDaynr ( #2407 )
2017-01-11 11:00:35 +08:00
293988b436
*: Fix a bug when binary literal has a charset prefix ( #2438 )
2017-01-11 10:16:51 +08:00
5969e9ecad
*: add builtin function TIMESTAMPDIFF ( #2386 )
2017-01-11 00:12:48 +08:00
1b72b11ffa
util/types: fix truncate float ( #2405 )
2017-01-06 17:14:04 +08:00
cd98c551b4
util/types: handle ParseDatetime overflow properly ( #2401 )
2017-01-06 14:36:08 +08:00
ac06325a1d
*: add builtin function DATEDIFF ( #2374 )
2017-01-06 10:01:20 +08:00
39a7b90e7f
types: optimize floatStrToIntStr ( #2396 )
2017-01-05 16:06:47 +08:00
36e9570051
*: concurrently begin a transaction and compile ( #2393 )
2017-01-05 15:00:43 +08:00
a44d9c3891
*: add builtin function UNIX_TIMESTAMP ( #2369 )
2017-01-05 14:09:21 +08:00
c8cc389fdc
ddl: bug in columnDefToCol, Length shouldn't be set for unspecified fields. ( #2381 ) ( #2382 )
2017-01-05 12:04:21 +08:00
27f5f287f7
expression: move types.helper to expression pkg. ( #2371 )
2017-01-02 10:50:41 +08:00
ebbbf8993b
ddl: speed up create table without the need to change lease. ( #2332 )
...
DDLs that doesn't modify rows like create/drop/truncate table, create/drop database
do not need to wait 2 lease on ddl worker, we can safely remove those wait to
speed up DDL.
But user may create a table, then insert data on that table on another TiDB server,
So we need to wait in session.
User can set a session variable to skip DDL wait if needed, and there is no risk of
data inconsistency.
This solution remove the need for user to set lease to zero when loading data,
It's much more safe and easy to use.
2016-12-28 22:08:19 +08:00
b5e9cc5a7b
util/types: fix get valid float ( #2337 )
...
The valid float prefix of "11e1.3" should be "11e1".
2016-12-28 16:40:35 +08:00
5e60397887
util/types: log timestamp error ( #2336 )
2016-12-28 16:01:10 +08:00
305bb6c643
util/types: StrToDate support more format control ( #2310 )
2016-12-26 22:56:13 +08:00
64484a4257
*: refactor context.Context ( #2298 )
...
Make transaction life cycle under control, prepare for correctly handle schema out of date error.
The old `GetTxn(forceNew boll)` is replaced by `Txn` and `NewTxn`,
`CommitTxn` and `RollbackTxn` is removed.
2016-12-23 13:02:41 +08:00
cfb100541a
evaluator,util/types: clean up builtinDateFormat ( #2292 )
...
rename Time method Format to DateFormat
clean up builtinDateFormat in evaluator
clean up ToNumber use DateFormat method
2016-12-22 14:20:37 +08:00
d508b6d2da
util/types: workaround for time roundFrac ( #2289 )
2016-12-21 19:45:27 +08:00
c8ffa17c62
util/types: add calcTimeDiff and update compareTime function ( #2280 )
2016-12-21 11:10:04 +08:00
15e38d6d82
evaluator, util/types: fix mysql week and yearweek function, support mode ( #2284 )
2016-12-20 17:51:01 +08:00
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