mariadb/sql-common
unknown b41b0fd62b Bug#18997: DATE_ADD and DATE_SUB perform year2K autoconversion magic on 4-digit year value
if input year for date_add() / date_sub() with INTERVAL is low enough for
calc_daynr() to possibly return incorrect results (calc_daynr() has no information
on whether the year is low because it was a two-digit year ('77) or because it
was a really low four-digit year (0077) and will indiscriminately try to turn the
value into a four-digit year by adding 1900 or 2000 respectively), the functions
will now throw NULL.


include/my_time.h:
  new define YY_MAGIC_BELOW: if year is below this threshold, magic kicks in in
  calc_daynr(). the idea is to convert two-digit years to four-digit ones, adding
  1900 to values >= YY_PART_YEAR or adding 2000 otherwise.
  current value of YY_MAGIC_BELOW derived from original code in calc_daynr()
mysql-test/r/func_time.result:
  test where 2 digit -> 4 digit year magic kicks in, and whether we throw NULL when
  it happens
mysql-test/t/func_time.test:
  test where 2 digit -> 4 digit year magic kicks in, and whether we throw NULL when
  it happens
sql-common/my_time.c:
  use new const YY_MAGIC_BELOW, apply 2-digit -> 4-digit magic only to years
  below this threshold.
sql/item_timefunc.cc:
  throw NULL when year in date_add() / date_sub() would be affected by
  2 digit -> 4 digit magic.
2006-05-16 03:32:24 +02:00
..
client.c Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0 2006-05-09 20:50:29 +03:00
Makefile.am Fix for BUG#15110: mysqldump --triggers: does not include DEFINER clause 2006-01-11 02:07:40 +03:00
my_time.c Bug#18997: DATE_ADD and DATE_SUB perform year2K autoconversion magic on 4-digit year value 2006-05-16 03:32:24 +02:00
my_user.c Fix for BUG#15110: mysqldump --triggers: does not include DEFINER clause 2006-01-11 02:07:40 +03:00
pack.c Added missing SSL library (Should be in source distribution) 2003-11-28 12:18:13 +02:00