Skip to content
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

mysql/json: split compare,serde,binary into independent files #1936

Merged
merged 14 commits into from
Jun 23, 2017

Conversation

AndreMouche
Copy link
Member

Hi,
This PR split compare, serde,binary from json.rs into independent files.

@hhkbp2 @hicqu @lishihai9017 @andelf PTAL

Copy link
Contributor

@andelf andelf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space and reorder imports. Eof

use super::super::Result;
use std::cmp::Ordering;
use std::{self, str, f64};
use super::{Json, ERR_CONVERT_FAILED};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reorder imports

assert_eq!(Json::I64(2), Json::Boolean(false));
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eof

fn from_str(s: &str) -> Result<Self, Self::Err> {
match serde_json::from_str(s) {
Ok(value) => Ok(value),
Err(e) => Err(invalid_type!("Illegal Json text:{:?}", e)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after :

@AndreMouche
Copy link
Member Author

@andelf @hhkbp2 PTAL

assert!(left < right);
}

assert_eq!(Json::I64(2), Json::Boolean(false));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Json::Boolean(false) would be converted to Json::Double(2.0) when compare with an Integer. @andelf

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it's a natural defect of TiDB, because we treat bool as int. so if we compare bool and int, there are some incompatible cases with MySQL.

@AndreMouche
Copy link
Member Author

@hhkbp2 @andelf @lishihai9017 @hicqu PTAL

@hhkbp2
Copy link
Contributor

hhkbp2 commented Jun 21, 2017

LGTM

@siddontang
Copy link
Contributor

any update?

@AndreMouche
Copy link
Member Author

Conflicts fixed @siddontang

@AndreMouche
Copy link
Member Author

@lishihai9017 @andelf @hicqu PTAL

@AndreMouche
Copy link
Member Author

@hhkbp2 @lishihai9017 @andelf @hicqu PTAL

@hicqu
Copy link
Contributor

hicqu commented Jun 23, 2017

LGTM.

@AndreMouche AndreMouche merged commit 8a9279c into master Jun 23, 2017
@AndreMouche AndreMouche deleted the shirly/json branch June 23, 2017 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants