~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/select_send.h

  • Committer: Stewart Smith
  • Date: 2009-08-20 17:15:54 UTC
  • mto: (1119.2.2 merge)
  • mto: This revision was merged to the branch mainline in revision 1124.
  • Revision ID: stewart@flamingspork.com-20090820171554-72eo1tqlc4n64rak
Valgrind 3.5 requires --alignment to be a power of 2 between 16 and 4096. The specifying --alignment is not important for us, so remove it.

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/transactional_storage_engine.h>
26
 
 
27
 
namespace drizzled
28
 
{
29
 
 
30
24
class select_send :public select_result {
31
25
  /**
32
26
    True if we have sent result set metadata to the client.
43
37
      InnoDB adaptive hash S-latch to avoid thread deadlocks if it was reserved
44
38
      by session
45
39
    */
46
 
    plugin::TransactionalStorageEngine::releaseTemporaryLatches(session);
 
40
    ha_release_temporary_latches(session);
47
41
 
48
42
    /* Unlock tables before sending packet to gain some speed */
49
43
    if (session->lock)
59
53
  bool send_fields(List<Item> &list)
60
54
  {
61
55
    bool res;
62
 
    if (! (res= session->client->sendFields(&list)))
 
56
    if (! (res= session->protocol->sendFields(&list)))
63
57
      is_result_set_started= 1;
64
58
    return res;
65
59
  }
96
90
      InnoDB adaptive hash S-latch to avoid thread deadlocks if it was reserved
97
91
      by session
98
92
    */
99
 
    plugin::TransactionalStorageEngine::releaseTemporaryLatches(session);
 
93
    ha_release_temporary_latches(session);
100
94
 
101
95
    List_iterator_fast<Item> li(items);
102
96
    char buff[MAX_FIELD_WIDTH];
103
97
    String buffer(buff, sizeof(buff), &my_charset_bin);
104
98
 
 
99
    session->protocol->prepareForResend();
105
100
    Item *item;
106
101
    while ((item=li++))
107
102
    {
108
 
      if (item->send(session->client, &buffer))
 
103
      if (item->send(session->protocol, &buffer))
109
104
      {
 
105
        session->protocol->free();
110
106
        my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
111
107
        break;
112
108
      }
114
110
    session->sent_row_count++;
115
111
    if (session->is_error())
116
112
      return true;
117
 
    return session->client->flush();
 
113
    if (session->protocol->isConnected())
 
114
      return(session->protocol->write());
 
115
    return false;
118
116
  }
119
117
};
120
118
 
121
 
} /* namespace drizzled */
122
 
 
123
119
#endif /* DRIZZLED_SELECT_SEND_H */