~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_redel.cc

  • Committer: Jay Pipes
  • Date: 2009-01-30 04:01:12 UTC
  • mto: This revision was merged to the branch mainline in revision 830.
  • Revision ID: jpipes@serialcoder-20090130040112-svbn774guj98pwi4
To remain in compatibility with MySQL, added ability to interpret
decimal arguments as datetime strings for temporal functions.

Fixed YEAR(), MONTH(), DAYOFMONTH(), DAYOFYEAR(), HOUR(), MINUTE(), SECOND(), and MICROSECOND()
to accept decimal parameters and interpret them the same way as MySQL.

Fixed an issue with the TemporalFormat::matches() method which was 
incorrectly assuming all microsecond arguments were specified as 6 digits.
Added power of 10 multiplier to usecond calculation. This fixes issues with
failures in type_date and func_sapdb test cases.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
 
 
16
 
#include "config.h"
17
 
 
18
 
#include "drizzled/internal/my_sys.h"
19
 
#include "drizzled/internal/m_string.h"
20
 
#include "drizzled/error.h"
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#include "mysys_priv.h"
 
17
#include <mystrings/m_string.h>
 
18
#include "mysys_err.h"
21
19
#if defined(HAVE_UTIME_H)
22
20
#include <utime.h>
23
21
#elif defined(HAVE_SYS_UTIME_H)
28
26
  time_t modtime;
29
27
};
30
28
#endif
31
 
#ifdef HAVE_SYS_STAT_H
32
 
# include <sys/stat.h>
33
 
#endif
34
 
 
35
 
namespace drizzled
36
 
{
37
 
namespace internal
38
 
{
39
29
 
40
30
        /*
41
31
          Rename with copy stat form old file
85
75
 
86
76
  if (stat((char*) from, &statbuf))
87
77
  {
88
 
    errno=errno;
 
78
    my_errno=errno;
89
79
    if (MyFlags & (MY_FAE+MY_WME))
90
80
      my_error(EE_STAT, MYF(ME_BELL+ME_WAITTANG),from,errno);
91
81
    return -1;                          /* Can't get stat on input file */
121
111
#endif
122
112
  return 0;
123
113
} /* my_copystat */
124
 
 
125
 
} /* namespace internal */
126
 
} /* namespace drizzled */