~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/select_send.h

  • Committer: Monty Taylor
  • Date: 2009-03-20 04:49:49 UTC
  • mto: (950.1.1 mordred)
  • mto: This revision was merged to the branch mainline in revision 958.
  • Revision ID: mordred@inaugust.com-20090320044949-nfx7ygyy89ojl6v5
RemovedĀ unusedĀ code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef DRIZZLED_SELECT_SEND_H
22
22
#define DRIZZLED_SELECT_SEND_H
23
23
 
24
 
#include <drizzled/plugin/client.h>
25
 
#include <drizzled/plugin/query_cache.h>
26
 
#include <drizzled/plugin/transactional_storage_engine.h>
27
 
 
28
 
namespace drizzled
29
 
{
30
 
 
31
24
class select_send :public select_result {
32
25
  /**
33
26
    True if we have sent result set metadata to the client.
44
37
      InnoDB adaptive hash S-latch to avoid thread deadlocks if it was reserved
45
38
      by session
46
39
    */
47
 
    plugin::TransactionalStorageEngine::releaseTemporaryLatches(session);
 
40
    ha_release_temporary_latches(session);
48
41
 
49
42
    /* Unlock tables before sending packet to gain some speed */
50
43
    if (session->lock)
51
44
    {
52
 
      session->unlockTables(session->lock);
 
45
      mysql_unlock_tables(session, session->lock);
53
46
      session->lock= 0;
54
47
    }
55
48
    session->my_eof();
57
50
    return false;
58
51
  }
59
52
 
60
 
  bool send_fields(List<Item> &list)
 
53
  bool send_fields(List<Item> &list, uint32_t flags)
61
54
  {
62
55
    bool res;
63
 
    if (! (res= session->client->sendFields(&list)))
 
56
    if (!(res= session->protocol->send_fields(&list, flags)))
64
57
      is_result_set_started= 1;
65
58
    return res;
66
59
  }
97
90
      InnoDB adaptive hash S-latch to avoid thread deadlocks if it was reserved
98
91
      by session
99
92
    */
100
 
    plugin::TransactionalStorageEngine::releaseTemporaryLatches(session);
 
93
    ha_release_temporary_latches(session);
101
94
 
102
95
    List_iterator_fast<Item> li(items);
 
96
    Protocol *protocol= session->protocol;
103
97
    char buff[MAX_FIELD_WIDTH];
104
98
    String buffer(buff, sizeof(buff), &my_charset_bin);
105
99
 
 
100
    protocol->prepare_for_resend();
106
101
    Item *item;
107
102
    while ((item=li++))
108
103
    {
109
 
      if (item->send(session->client, &buffer))
 
104
      if (item->send(protocol, &buffer))
110
105
      {
 
106
        protocol->free();                               // Free used buffer
111
107
        my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
112
108
        break;
113
109
      }
114
110
    }
115
 
    /* Insert this record to the Resultset into the cache */
116
 
    if (session->query_cache_key != "" && session->getResultsetMessage() != NULL)
117
 
      plugin::QueryCache::insertRecord(session, items);
118
 
 
119
111
    session->sent_row_count++;
120
112
    if (session->is_error())
 
113
    {
 
114
      protocol->remove_last_row();
121
115
      return true;
122
 
    return session->client->flush();
 
116
    }
 
117
    if (session->drizzleclient_vio_ok())
 
118
      return(protocol->write());
 
119
    return false;
123
120
  }
124
121
};
125
122
 
126
 
} /* namespace drizzled */
127
 
 
128
123
#endif /* DRIZZLED_SELECT_SEND_H */