~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/select_send.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-08-08 04:22:33 UTC
  • mto: (1115.3.4 captain)
  • mto: This revision was merged to the branch mainline in revision 1117.
  • Revision ID: osullivan.padraig@gmail.com-20090808042233-q0z88zc490z3f3r7
Renamed the Command class to be Statement. Renamed the command directory to
statement and also the command header file to statement. Updated various
source files to reflect this renaming.

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)
56
50
    return false;
57
51
  }
58
52
 
59
 
  bool send_fields(List<Item> &list)
 
53
  bool send_fields(List<Item> &list, uint32_t flags)
60
54
  {
61
55
    bool res;
62
 
    if (! (res= session->client->sendFields(&list)))
 
56
    if (!(res= session->protocol->sendFields(&list, flags)))
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);
 
96
    Protocol *protocol= session->protocol;
102
97
    char buff[MAX_FIELD_WIDTH];
103
98
    String buffer(buff, sizeof(buff), &my_charset_bin);
104
99
 
 
100
    protocol->prepareForResend();
105
101
    Item *item;
106
102
    while ((item=li++))
107
103
    {
108
 
      if (item->send(session->client, &buffer))
 
104
      if (item->send(protocol, &buffer))
109
105
      {
 
106
        protocol->free();                               // Free used buffer
110
107
        my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
111
108
        break;
112
109
      }
114
111
    session->sent_row_count++;
115
112
    if (session->is_error())
116
113
      return true;
117
 
    return session->client->flush();
 
114
    if (protocol->isConnected())
 
115
      return(protocol->write());
 
116
    return false;
118
117
  }
119
118
};
120
119
 
121
 
} /* namespace drizzled */
122
 
 
123
120
#endif /* DRIZZLED_SELECT_SEND_H */