diff options
author | unknown <gluh@gluh.mysql.r18.ru> | 2003-12-07 15:10:21 +0400 |
---|---|---|
committer | unknown <gluh@gluh.mysql.r18.ru> | 2003-12-07 15:10:21 +0400 |
commit | 468dcb6092bce57a4c7529f40d10fcd7654f5ead (patch) | |
tree | 12065da4c1bf5c1634e8c4f911f6af4e7eccee6c /sql/mysql_priv.h | |
parent | 75392a0d2e4c7f95fa1490fed8203c9f2ffbee48 (diff) | |
download | mariadb-git-468dcb6092bce57a4c7529f40d10fcd7654f5ead.tar.gz |
WL#1175: more default_week_formats for iso compatibility
New formats added for 'week()' function and 'default_week_format' option(4 - 7).
Next formats is supported now:
*Value* *Meaning*
`0' Week starts on Sunday; First Sunday of the year starts week 1.
Week() returns 0-53.
`1' Week starts on Monday; Weeks numbered according to ISO 8601:1988.
Week() returns 0-53.
`2' Week starts on Sunday; First Sunday of the year starts week 1.
Week() returns 1-53.
`3' Week starts on Monday; Weeks numbered according to ISO 8601:1988.
Week() returns 1-53.
`4' Week starts on Sunday; Weeks numbered according to ISO 8601:1988.
Week() returns 0-53.
`5' Week starts on Monday; First Monday of the year starts week 1.
Week() returns 0-53.
`6' Week starts on Sunday; Weeks numbered according to ISO 8601:1988.
Week() returns 1-53.
`7' Week starts on Monday; First Monday of the year starts week 1.
Week() returns 1-53.
mysql-test/r/func_time.result:
Test for 'default_week_format' option and 'week' function
mysql-test/t/func_time.test:
Test for 'default_week_format' option and 'week' function
sql/item_timefunc.cc:
WL#1175 more default_week_formats for iso compatibility
sql/mysql_priv.h:
WL#1175 more default_week_formats for iso compatibility
sql/mysqld.cc:
WL#1175 more default_week_formats for iso compatibility
sql/time.cc:
WL#1175 more default_week_formats for iso compatibility
Diffstat (limited to 'sql/mysql_priv.h')
-rw-r--r-- | sql/mysql_priv.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index adb7831896c..04529919990 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -247,6 +247,11 @@ void debug_sync_point(const char* lock_name, uint lock_timeout); #define tmp_file_prefix "#sql" /* Prefix for tmp tables */ #define tmp_file_prefix_length 4 +/* Flags for calc_week() function. */ +#define WEEK_MONDAY_FIRST 1 +#define WEEK_YEAR 2 +#define WEEK_FIRST_WEEKDAY 4 + struct st_table; class THD; @@ -806,8 +811,7 @@ ha_rows filesort(TABLE *form,struct st_sort_field *sortorder, uint s_length, void change_double_for_sort(double nr,byte *to); int get_quick_record(SQL_SELECT *select); int calc_weekday(long daynr,bool sunday_first_day_of_week); -uint calc_week(TIME *ltime, bool with_year, bool sunday_first_day_of_week, - uint *year); +uint calc_week(TIME *l_time, uint week_behaviour, uint *year); void find_date(char *pos,uint *vek,uint flag); TYPELIB *convert_strings_to_array_type(my_string *typelibs, my_string *end); TYPELIB *typelib(List<String> &strings); |