~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin_errmsg.h

  • 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:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
1
/*
 
2
 -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
3
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
 
4
 
4
5
 *  Definitions required for Error Message plugin
5
 
 *
6
 
 *  Copyright (C) 2008 Sun Microsystems
 
6
 
 
7
 *  Copyright (C) 2008 Mark Atwood
7
8
 *
8
9
 *  This program is free software; you can redistribute it and/or modify
9
10
 *  it under the terms of the GNU General Public License as published by
19
20
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
21
 */
21
22
 
22
 
#ifndef DRIZZLED_PLUGIN_ERROR_MESSAGE_H
23
 
#define DRIZZLED_PLUGIN_ERROR_MESSAGE_H
24
 
 
25
 
#include "drizzled/plugin/plugin.h"
 
23
#ifndef DRIZZLED_PLUGIN_ERRMSG_H
 
24
#define DRIZZLED_PLUGIN_ERRMSG_H
26
25
 
27
26
#include <stdarg.h>
28
27
 
29
 
#include <string>
30
 
 
31
 
namespace drizzled
32
 
{
33
 
class Session;
34
 
 
35
 
namespace plugin
36
 
{
37
 
 
38
 
class ErrorMessage : public Plugin
39
 
{
40
 
  ErrorMessage();
41
 
  ErrorMessage(const ErrorMessage &);
42
 
  ErrorMessage& operator=(const ErrorMessage &);
43
 
public:
44
 
  explicit ErrorMessage(std::string name_arg)
45
 
   : Plugin(name_arg, "ErrorMessage")
46
 
  {}
47
 
  virtual ~ErrorMessage() {}
48
 
 
49
 
  virtual bool errmsg(Session *session, int priority,
50
 
                      const char *format, va_list ap)=0;
51
 
 
52
 
  static bool addPlugin(plugin::ErrorMessage *handler);
53
 
  static void removePlugin(plugin::ErrorMessage *handler);
54
 
 
55
 
  static bool vprintf(Session *session, int priority, char const *format,
56
 
                      va_list ap);
57
 
};
58
 
 
59
 
} /* namespace plugin */
60
 
} /* namespace drizzled */
61
 
 
62
 
#endif /* DRIZZLED_PLUGIN_ERROR_MESSAGE_H */
 
28
typedef struct errmsg_st
 
29
{
 
30
  bool (*errmsg_func)(Session *session, int priority, const char *format, va_list ap);
 
31
} errmsg_t;
 
32
 
 
33
#endif /* DRIZZLED_PLUGIN_ERRMSG_H */