diff options
author | unknown <knielsen@knielsen-hq.org> | 2009-11-16 21:49:51 +0100 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2009-11-16 21:49:51 +0100 |
commit | a962160eec233c265900e2754ed2a63ef5e27c5a (patch) | |
tree | f1b33a7aed53016189b17cd3f50243b3c8a022de /sql/time.cc | |
parent | 166e0683c0d45a79716d8913ec9ecaf3177343fa (diff) | |
parent | 9b7a7f06c1a56f49a4528f019ec821d3a01934b6 (diff) | |
download | mariadb-git-a962160eec233c265900e2754ed2a63ef5e27c5a.tar.gz |
Merge with MySQL 5.1, with following additions:
- Moved some code from innodb_plugin to xtradb, to ensure that all tests runs
- Did changes in pbxt and maria storage engines becasue of changes in thd->query
- Reverted wrong code in sql_table.cc for how ROW_FORMAT is used.
This is a re-commit of Monty's merge to eliminate an extra commit from
MySQL-5.1.42 that was accidentally included in the merge.
This is a merge of the MySQL 5.1.41 clone-off (clone-5.1.41-build). In
case there are any extra changes done before final MySQL 5.1.41
release, these will need to be merged later before MariaDB 5.1.41
release.
Diffstat (limited to 'sql/time.cc')
-rw-r--r-- | sql/time.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sql/time.cc b/sql/time.cc index 44672eb4278..c4f6c3c9539 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -965,20 +965,22 @@ calc_time_diff(MYSQL_TIME *l_time1, MYSQL_TIME *l_time2, int l_sign, longlong *s 0 - a == b 1 - a > b - NOTES - TIME.second_part is not considered during comparison */ -int -my_time_compare(MYSQL_TIME *a, MYSQL_TIME *b) +int my_time_compare(MYSQL_TIME *a, MYSQL_TIME *b) { - my_ulonglong a_t= TIME_to_ulonglong_datetime(a); - my_ulonglong b_t= TIME_to_ulonglong_datetime(b); + ulonglong a_t= TIME_to_ulonglong_datetime(a); + ulonglong b_t= TIME_to_ulonglong_datetime(b); + if (a_t < b_t) + return -1; if (a_t > b_t) return 1; - else if (a_t < b_t) + + if (a->second_part < b->second_part) return -1; + if (a->second_part > b->second_part) + return 1; return 0; } |