~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/select_send.h

  • Committer: Brian Aker
  • Date: 2010-08-09 18:04:12 UTC
  • mfrom: (1689.3.7 staging)
  • Revision ID: brian@gaz-20100809180412-olurwh51ojllev6p
Merge in heap conversion, and case insensitive patch, and remove need for
M_HASH in session.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
22
22
#define DRIZZLED_SELECT_SEND_H
23
23
 
24
24
#include <drizzled/plugin/client.h>
25
 
#include <drizzled/plugin/query_cache.h>
26
25
#include <drizzled/plugin/transactional_storage_engine.h>
27
 
#include <drizzled/select_result.h>
28
26
 
29
27
namespace drizzled
30
28
{
50
48
    /* Unlock tables before sending packet to gain some speed */
51
49
    if (session->lock)
52
50
    {
53
 
      session->unlockTables(session->lock);
 
51
      mysql_unlock_tables(session, session->lock);
54
52
      session->lock= 0;
55
53
    }
56
54
    session->my_eof();
61
59
  bool send_fields(List<Item> &list)
62
60
  {
63
61
    bool res;
64
 
    if (! (res= session->getClient()->sendFields(&list)))
 
62
    if (! (res= session->client->sendFields(&list)))
65
63
      is_result_set_started= 1;
66
64
    return res;
67
65
  }
100
98
    */
101
99
    plugin::TransactionalStorageEngine::releaseTemporaryLatches(session);
102
100
 
103
 
    List<Item>::iterator li(items.begin());
 
101
    List_iterator_fast<Item> li(items);
104
102
    char buff[MAX_FIELD_WIDTH];
105
103
    String buffer(buff, sizeof(buff), &my_charset_bin);
106
104
 
107
105
    Item *item;
108
106
    while ((item=li++))
109
107
    {
110
 
      if (item->send(session->getClient(), &buffer))
 
108
      if (item->send(session->client, &buffer))
111
109
      {
112
110
        my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
113
111
        break;
114
112
      }
115
113
    }
116
 
    /* Insert this record to the Resultset into the cache */
117
 
    if (session->query_cache_key != "" && session->getResultsetMessage() != NULL)
118
 
      plugin::QueryCache::insertRecord(session, items);
119
 
 
120
114
    session->sent_row_count++;
121
115
    if (session->is_error())
122
116
      return true;
123
 
    return session->getClient()->flush();
 
117
    return session->client->flush();
124
118
  }
125
119
};
126
120