mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
b41b0fd62b
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. |
||
---|---|---|
.. | ||
mysql | ||
.cvsignore | ||
base64.h | ||
config-netware.h | ||
config-win.h | ||
decimal.h | ||
errmsg.h | ||
ft_global.h | ||
hash.h | ||
heap.h | ||
help_end.h | ||
help_start.h | ||
keycache.h | ||
m_ctype.h | ||
m_string.h | ||
Makefile.am | ||
md5.h | ||
my_aes.h | ||
my_alarm.h | ||
my_alloc.h | ||
my_base.h | ||
my_bitmap.h | ||
my_dbug.h | ||
my_dir.h | ||
my_getopt.h | ||
my_global.h | ||
my_handler.h | ||
my_list.h | ||
my_net.h | ||
my_no_pthread.h | ||
my_nosys.h | ||
my_pthread.h | ||
my_semaphore.h | ||
my_sys.h | ||
my_time.h | ||
my_tree.h | ||
my_trie.h | ||
my_uctype.h | ||
my_user.h | ||
my_vle.h | ||
my_xml.h | ||
myisam.h | ||
myisammrg.h | ||
myisampack.h | ||
mysql.h | ||
mysql_com.h | ||
mysql_embed.h | ||
mysql_time.h | ||
mysql_version.h.in | ||
mysys_err.h | ||
queues.h | ||
rijndael.h | ||
sha1.h | ||
sql_common.h | ||
sslopt-case.h | ||
sslopt-longopts.h | ||
sslopt-vars.h | ||
t_ctype.h | ||
thr_alarm.h | ||
thr_lock.h | ||
typelib.h | ||
violite.h |