~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_identifier.h

  • Committer: Brian Aker
  • Date: 2010-03-25 18:47:05 UTC
  • mto: This revision was merged to the branch mainline in revision 1411.
  • Revision ID: brian@gaz-20100325184705-kr04fbxzfb4ydnqv
Modified TableIdentifier output for errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
  std::string lower_table_name;
61
61
  std::string sql_path;
62
62
 
 
63
  void primeLower();
 
64
 
63
65
public:
64
66
  TableIdentifier( const std::string &db_arg,
65
67
                   const std::string &table_name_arg,
68
70
    db(db_arg),
69
71
    table_name(table_name_arg),
70
72
    lower_db(db_arg),
71
 
    lower_table_name(table_name_arg),
72
 
    sql_path(db_arg)
 
73
    lower_table_name(table_name_arg)
73
74
  { 
74
 
    std::transform(lower_table_name.begin(), lower_table_name.end(),
75
 
                   lower_table_name.begin(), ::tolower);
76
 
 
77
 
    std::transform(lower_db.begin(), lower_db.end(),
78
 
                   lower_db.begin(), ::tolower);
79
 
 
80
 
    sql_path.append(".");
81
 
    sql_path.append(table_name);
82
75
  }
83
76
 
84
77
  /**
90
83
    db(path_arg),
91
84
    table_name(path_arg)
92
85
  { 
93
 
    sql_path.append("temporary");
94
 
    sql_path.append(".");
95
 
    sql_path.append(table_name);
96
86
  }
97
87
 
98
88
  TableIdentifier(const char *schema_name_arg, const char *table_name_arg, const char *path_arg ) :
101
91
    db(schema_name_arg),
102
92
    table_name(table_name_arg)
103
93
  { 
104
 
    sql_path.append("temporary");
105
 
    sql_path.append(".");
106
 
    sql_path.append(table_name);
107
94
  }
108
95
 
109
96
  bool isTmp() const
111
98
    return type == STANDARD_TABLE ? false  : true;
112
99
  }
113
100
 
114
 
  const std::string &getSQLPath()
115
 
  {
116
 
    return sql_path;
117
 
  }
 
101
  const std::string &getSQLPath();
118
102
 
119
103
  const std::string &getPath();
120
104
 
163
147
    return output;  // for multiple << operators.
164
148
  }
165
149
 
166
 
  friend bool operator==(const TableIdentifier &left, const TableIdentifier &right)
 
150
  friend bool operator==(TableIdentifier &left, TableIdentifier &right)
167
151
  {
 
152
    left.primeLower();
 
153
    right.primeLower();
 
154
 
168
155
    if (left.type == right.type)
169
156
    {
170
 
      if (left.db == right.db)
 
157
      if (left.lower_db == right.lower_db)
171
158
      {
172
 
        if (left.table_name == right.table_name)
 
159
        if (left.lower_table_name == right.lower_table_name)
173
160
        {
174
161
          return true;
175
162
        }