New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coprocessor, dag: support decode Time from tipb.Expr #2199

Merged
merged 43 commits into from Aug 28, 2017
Commits
Jump to file or symbol
Failed to load files and symbols.
+1 −7
Diff settings

Always

Just for now

Viewing a subset of changes. View all

address comments.

  • Loading branch information...
hicqu committed Aug 24, 2017
commit 03d0f16357c8d436890fbb51fb163db8adc8856a
@@ -26,7 +26,6 @@ use self::compare::CmpOp;
use std::io;
use std::borrow::Cow;
use std::string::FromUtf8Error;
use chrono::FixedOffset;
use tipb::expression::{Expr, ExprType, FieldType, ScalarFuncSig};
@@ -385,12 +384,7 @@ impl Expression {
.and_then(|i| {
let fsp = expr.get_field_type().get_decimal() as i8;
let tp = expr.get_field_type().get_tp() as u8;
let tz = if tp == types::TIMESTAMP {
ctx.tz
} else {
FixedOffset::east(0)
};
Time::from_packed_u64(i, tp, fsp, &tz)
Time::from_packed_u64(i, tp, fsp, &ctx.tz)
})
.map(|t| Expression::new_const(Datum::Time(t), tp))
.map_err(Error::from),
ProTip! Use n and p to navigate between commits in a pull request.