diff options
author | unknown <tnurnberg@salvation.intern.azundris.com> | 2006-08-07 07:35:28 +0200 |
---|---|---|
committer | unknown <tnurnberg@salvation.intern.azundris.com> | 2006-08-07 07:35:28 +0200 |
commit | a7088b3c82e0b8b144c14d438e6da37af4be4587 (patch) | |
tree | f2262aff5e7905aeb523509dbc7a16d1313c71c0 /sql/item_timefunc.cc | |
parent | d2aa274ac96c8fb98611c9bdd0469e3e8fb32a9f (diff) | |
download | mariadb-git-a7088b3c82e0b8b144c14d438e6da37af4be4587.tar.gz |
Bug #20987: str_to_date doesn't accept user variable for specification
str_to_date() would sometimes render NULL if %D was used as rule other than last.
since this was due to two pointers getting mixed up in the server, this behaviour
seemed somewhat non-deterministic at SQL level.
mysql-test/r/func_time.result:
Bug #20987: str_to_date doesn't accept user variable for specification
show we can do the usual str_to_date() conversions without triggering the bug.
mysql-test/t/func_time.test:
Bug #20987: str_to_date doesn't accept user variable for specification
show we can do the usual str_to_date() conversions without triggering the bug.
sql/item_timefunc.cc:
Bug #20987: str_to_date doesn't accept user variable for specification
str_to_date() used a wrong pointer in %D conversions which could lead to the
input being cut off after the token matching %D; if the rule required further
tokens, the conversion would fail and render NULL.
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 44d9b422263..e3b71851824 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -223,7 +223,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, tmp= (char*) val + min(2, val_len); l_time->day= (int) my_strtoll10(val, &tmp, &error); /* Skip 'st, 'nd, 'th .. */ - val= tmp + min((int) (end-tmp), 2); + val= tmp + min((int) (val_end-tmp), 2); break; /* Hour */ |