~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/query_rewrite.cc

  • Committer: Brian Aker
  • Date: 2011-02-22 06:12:02 UTC
  • mfrom: (2190.1.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110222061202-k03czxykqy4x9hjs
List update, header fixes, multiple symbols, and David deletes some code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22
22
 */
23
23
 
24
 
#include "config.h"
25
 
#include "drizzled/plugin/query_rewrite.h"
26
 
#include "drizzled/gettext.h"
 
24
#include <config.h>
 
25
#include <drizzled/plugin/query_rewrite.h>
 
26
#include <drizzled/gettext.h>
27
27
 
28
28
#include <algorithm>
29
29
#include <vector>
30
30
 
31
 
using namespace std;
32
 
 
33
31
namespace drizzled
34
32
{
35
33
 
36
34
namespace plugin
37
35
{
38
36
 
39
 
vector<plugin::QueryRewriter *> all_rewriters;
 
37
std::vector<plugin::QueryRewriter *> all_rewriters;
40
38
 
41
39
 
42
40
bool QueryRewriter::addPlugin(QueryRewriter *in_rewriter)
53
51
{
54
52
  if (in_rewriter != NULL)
55
53
  {
56
 
    all_rewriters.erase(find(all_rewriters.begin(),
57
 
                             all_rewriters.end(),
58
 
                             in_rewriter));
 
54
    all_rewriters.erase(std::find(all_rewriters.begin(),
 
55
                                  all_rewriters.end(),
 
56
                                  in_rewriter));
59
57
  }
60
58
}
61
59
 
64
62
 * This is the QueryRewriter::rewrite entry point.
65
63
 * This gets called from within the Drizzle kernel.
66
64
 */
67
 
void QueryRewriter::rewriteQuery(const string &schema, string &to_rewrite)
 
65
void QueryRewriter::rewriteQuery(const std::string &schema, std::string &to_rewrite)
68
66
{
69
 
  for (vector<plugin::QueryRewriter *>::iterator iter= all_rewriters.begin();
 
67
  for (std::vector<plugin::QueryRewriter *>::iterator iter= all_rewriters.begin();
70
68
       iter != all_rewriters.end();
71
69
       ++iter)
72
70
  {