Closed mxhdev closed 8 years ago
DBFit also contains a bug which is related to parsing time values. The dbfit class dbfit.util.SqlTimeParseDelegate parses time values with the following patterns:
static final SimpleDateFormat FMT_S = new SimpleDateFormat("HH:mm:ss");
static final SimpleDateFormat FMT_MS = new SimpleDateFormat("HH:mm:ss.S");
However, the MySQL 5.7 Reference Manual / ... / 11.3.2 The TIME Type allows the time format to have 3 hour digints.
This is inconsistent and should be changed on the side of dbfit.
Implemented by commit 20eb16f
Introduction
In Version 3.2 of DBFit, there seems to be a bug in which time functions don't work
Bug Description
In order to run a date/time function like time_to_sec if mysql, the time has to be in single quotes, however DBFit throws a parse exception if the date is given in single quotes. Furthermore, DBFit expects Date/Time values to be without quotes. Because MySQL requires quotes, this causes problems.
Code Sample
The following (dbfit code) will pass, however the function call should not return 0 if the call works properly. In the following code it will.
However, mysql expects the call to have single quotes around the date/time
This can be solves by using a different function call syntax inside the dbfit script
Relevant Classes
dbfit.util.SqlTimeParseDelegate
Task
Change the SolutionGenerator in such a way, that function calls will always be written in the (safer) workaround syntax (see above)