summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorgluh@eagle.(none) <>2007-11-14 17:30:16 +0400
committergluh@eagle.(none) <>2007-11-14 17:30:16 +0400
commit58336411c9d624f0e99cf95aa5db22ec70dd0c6c (patch)
tree4676d6947f9f56056b0b29957c90cba5cdad5eba /sql-common
parent6223deb694946e5a2c3e46eaf4f2ce5624b5e78a (diff)
parent95e7cccfee7f1b1df3e455fb5e6bc10ef49c2a3a (diff)
downloadmariadb-git-58336411c9d624f0e99cf95aa5db22ec70dd0c6c.tar.gz
Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/my_time.c34
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,