diff options
author | unknown <tnurnberg@white.intern.koehntopp.de> | 2007-11-10 13:34:12 +0100 |
---|---|---|
committer | unknown <tnurnberg@white.intern.koehntopp.de> | 2007-11-10 13:34:12 +0100 |
commit | 91ceabf3b4d9a1156d5bfa0f57e90288e7423063 (patch) | |
tree | 5269d322e46119e7be5d5af09057a72ab4b28f61 /sql-common | |
parent | f97b8e48b8f6ec290f7cc7ca3fe59c33f7cb0d9e (diff) | |
parent | ac3ef6c75925c7e543c8ee1cbd5d0cd78a004d78 (diff) | |
download | mariadb-git-91ceabf3b4d9a1156d5bfa0f57e90288e7423063.tar.gz |
Merge mysql.com:/misc/mysql/31800/50-31800
into mysql.com:/misc/mysql/31800/51-31800
mysql-test/r/select.result:
Auto merged
mysql-test/t/select.test:
Auto merged
sql-common/my_time.c:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
Diffstat (limited to 'sql-common')
-rw-r--r-- | sql-common/my_time.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/sql-common/my_time.c b/sql-common/my_time.c index a1a3e0b6c77..48d1b198dfc 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -54,24 +54,24 @@ uint calc_days_in_year(uint year) 366 : 365); } -/* - Check datetime value for validity according to flags. - - SYNOPSIS - check_date() - ltime Date to check. - not_zero_date ltime is not the zero date - flags flags to check - was_cut set to 2 if value was truncated. - NOTE: This is not touched if value was not truncated - NOTES - Here we assume that year and month is ok ! +/** + @brief Check datetime value for validity according to flags. + + @param[in] ltime Date to check. + @param[in] not_zero_date ltime is not the zero date + @param[in] flags flags to check + (see str_to_datetime() flags in my_time.h) + @param[out] was_cut set to 2 if value was invalid according to flags. + (Feb 29 in non-leap etc.) This remains unchanged + if value is not invalid. + + @details Here we assume that year and month is ok! If month is 0 we allow any date. (This only happens if we allow zero date parts in str_to_datetime()) Disallow dates with zero year and non-zero month and/or day. - RETURN - 0 ok + @return + 0 OK 1 error */ @@ -117,9 +117,9 @@ my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, TIME_NO_ZERO_IN_DATE Don't allow partial dates TIME_NO_ZERO_DATE Don't allow 0000-00-00 date TIME_INVALID_DATES Allow 2000-02-31 - was_cut 0 Value ok + was_cut 0 Value OK 1 If value was cut during conversion - 2 Date part was within ranges but date was wrong + 2 check_date(date,flags) considers date invalid DESCRIPTION At least the following formats are recogniced (based on number of digits) @@ -1084,7 +1084,7 @@ int my_TIME_to_str(const MYSQL_TIME *l_time, char *to) flags - flags to use in validating date, as in str_to_datetime() was_cut 0 Value ok 1 If value was cut during conversion - 2 Date part was within ranges but date was wrong + 2 check_date(date,flags) considers date invalid DESCRIPTION Convert a datetime value of formats YYMMDD, YYYYMMDD, YYMMDDHHMSS, |