~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/identifier/schema.h

  • Committer: Brian Aker
  • Date: 2010-08-05 20:24:49 UTC
  • mto: (1688.1.1 drizzle)
  • mto: This revision was merged to the branch mainline in revision 1689.
  • Revision ID: brian@gaz-20100805202449-am05zi2zmjhklt8g
This fixes the lower casing of names from Schema even when we should not.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
#include <functional>
46
46
#include <iostream>
47
47
 
 
48
#include <boost/algorithm/string.hpp>
48
49
 
49
50
namespace drizzled {
50
51
 
54
55
{
55
56
  std::string db;
56
57
  std::string db_path;
57
 
  std::string lower_db;
58
58
 
59
59
 
60
60
  // @note this should be changed to protected once Session contains an
61
61
  // identifier for current db.
62
62
public:
63
63
 
64
 
  const std::string &getLower() const
65
 
  {
66
 
    return lower_db;
67
 
  }
68
 
 
69
64
public:
70
65
  SchemaIdentifier(const std::string &db_arg);
71
66
 
90
85
 
91
86
  friend bool operator<(const SchemaIdentifier &left, const SchemaIdentifier &right)
92
87
  {
93
 
    return left.lower_db < right.lower_db;
 
88
    return  boost::algorithm::to_upper_copy(left.getSchemaName()) < boost::algorithm::to_upper_copy(right.getSchemaName());
94
89
  }
95
90
 
96
91
  friend std::ostream& operator<<(std::ostream& output,
108
103
  friend bool operator==(const SchemaIdentifier &left,
109
104
                         const SchemaIdentifier &right)
110
105
  {
111
 
    if (left.lower_db == right.lower_db)
112
 
    {
113
 
      return true;
114
 
    }
115
 
 
116
 
    return false;
 
106
    return boost::iequals(left.getSchemaName(), right.getSchemaName());
117
107
  }
118
108
 
119
109
};