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

dag/expr: builtin_cast-II #2172

Merged
merged 63 commits into from Aug 21, 2017

Conversation

Projects
None yet
5 participants
@AndreMouche
Member

AndreMouche commented Aug 14, 2017

Hi,
This PR implement the following cast functions:

  1. cast_time_as_int
  2. cast_duration_as_int
  3. cast_json_as_int
  4. cast_real_as_real
  5. cast_decimal_as_real
  6. cast_str_as_real
  7. cast_time_as_real
  8. cast_duration_as_real
  9. cast_json_as_real

And it's based on PR #2144
You'd better reviewer after the base PR been merged.

@BusyJay @andelf @hicqu @XuHuaiyu PTAL

AndreMouche added some commits Aug 9, 2017

AndreMouche added some commits Aug 17, 2017

pub fn round_frac(&mut self, fsp: i8) -> Result<()> {
let fsp = try!(check_fsp(fsp));
if fsp >= self.fsp {

This comment has been minimized.

@disksing

disksing Aug 18, 2017

Collaborator

This comment has been minimized.

@AndreMouche

AndreMouche Aug 18, 2017

Member

address comments

@AndreMouche

AndreMouche Aug 18, 2017

Member

address comments

Show outdated Hide outdated src/coprocessor/codec/mysql/json/json_cast.rs
Show outdated Hide outdated src/coprocessor/codec/mysql/json/json_cast.rs
Show outdated Hide outdated src/coprocessor/codec/convert.rs
/// allowed, returns the max/min float allowed.
pub fn truncate_f64(mut f: f64, flen: u8, decimal: u8) -> Res<f64> {
if f.is_nan() {
return Res::Overflow(0f64);

This comment has been minimized.

@BusyJay

BusyJay Aug 20, 2017

Contributor

Any test to cover this?

@BusyJay

BusyJay Aug 20, 2017

Contributor

Any test to cover this?

Show outdated Hide outdated src/coprocessor/codec/convert.rs
Show outdated Hide outdated src/coprocessor/dag/expr/builtin_cast.rs

AndreMouche added some commits Aug 20, 2017

@disksing

This comment has been minimized.

Show comment
Hide comment
@disksing

disksing Aug 21, 2017

Collaborator

LGTM

Collaborator

disksing commented Aug 21, 2017

LGTM

@disksing disksing merged commit 7f201e7 into master Aug 21, 2017

2 checks passed

ci/circleci Your tests passed on CircleCI!
Details
license/cla Contributor License Agreement is signed.
Details

@disksing disksing deleted the shirly/eval_cast_2 branch Aug 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment