~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session/state.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; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2011 Brian Aker
5
 
 *
6
 
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License as published by
8
 
 *  the Free Software Foundation; either version 2 of the License, or
9
 
 *  (at your option) any later version.
10
 
 *
11
 
 *  This program is distributed in the hope that it will be useful,
12
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 *  GNU General Public License for more details.
15
 
 *
16
 
 *  You should have received a copy of the GNU General Public License
17
 
 *  along with this program; if not, write to the Free Software
18
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 
 */
20
 
 
21
 
#ifndef DRIZZLED_SESSION_STATE_H
22
 
#define DRIZZLED_SESSION_STATE_H
23
 
 
24
 
#include <drizzled/util/string.h>
25
 
#include <boost/unordered_map.hpp>
26
 
 
27
 
namespace drizzled
28
 
{
29
 
 
30
 
class Session;
31
 
 
32
 
namespace session
33
 
{
34
 
 
35
 
class State {
36
 
  std::vector <char> _query;
37
 
 
38
 
public:
39
 
  typedef boost::shared_ptr<State> shared_ptr;
40
 
  typedef boost::shared_ptr<State> const_shared_ptr;
41
 
 
42
 
  State(const char *in_packet, size_t in_packet_length);
43
 
 
44
 
  const char *query() const;
45
 
 
46
 
  const char *query(size_t &size) const;
47
 
 
48
 
protected:
49
 
  friend class Session;
50
 
};
51
 
 
52
 
} /* namespace session */
53
 
} /* namespace drizzled */
54
 
 
55
 
#endif /* DRIZZLED_SESSION_STATE_H */