~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/client/cached.h

mergeĀ lp:~hingo/drizzle/drizzle-execute-result_set-off-by-one

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
      max_column++;
59
59
    }
60
60
    _result_set->setColumnCount(max_column);
61
 
    _result_set->createRow();
 
61
    // Moved to checkRowBegin()
 
62
    //_result_set->createRow();
62
63
  }
63
64
 
64
65
  virtual void sendError(drizzled::error_t error_code, const char *error_message)
66
67
    _result_set->pushException(sql::Exception(error_message, error_code));
67
68
  }
68
69
 
69
 
  virtual void checkRowEnd()
 
70
  virtual void checkRowBegin()
70
71
  {
71
 
    if (++column % max_column == 0)
 
72
    if (currentColumn() == 0)
72
73
    {
73
74
      _result_set->createRow();
74
75
    }
75
76
  }
76
77
 
 
78
virtual void checkRowEnd()
 
79
  {
 
80
    column++;
 
81
  }
 
82
 
77
83
  using Client::store;
78
84
 
79
85
  virtual void store(Field *from)
90
96
 
91
97
  virtual void store()
92
98
  {
 
99
    checkRowBegin();
93
100
    _result_set->setColumnNull(currentColumn());
94
101
    checkRowEnd();
95
102
  }
96
103
 
97
104
  virtual void store(int32_t from)
98
105
  {
 
106
    checkRowBegin();
99
107
    _result_set->setColumn(currentColumn(), boost::lexical_cast<std::string>(from));
100
108
    checkRowEnd();
101
109
  }
102
110
 
103
111
  virtual void store(uint32_t from)
104
112
  {
 
113
    checkRowBegin();
105
114
    _result_set->setColumn(currentColumn(), boost::lexical_cast<std::string>(from));
106
115
    checkRowEnd();
107
116
  }
108
117
 
109
118
  virtual void store(int64_t from)
110
119
  {
 
120
    checkRowBegin();
111
121
    _result_set->setColumn(currentColumn(), boost::lexical_cast<std::string>(from));
112
122
    checkRowEnd();
113
123
  }
114
124
 
115
125
  virtual void store(uint64_t from)
116
126
  {
 
127
    checkRowBegin();
117
128
    _result_set->setColumn(currentColumn(), boost::lexical_cast<std::string>(from));
118
129
    checkRowEnd();
119
130
  }
120
131
 
121
132
  virtual void store(double from, uint32_t decimals, String *buffer)
122
133
  {
 
134
    checkRowBegin();
123
135
    buffer->set_real(from, decimals, &my_charset_bin);
124
136
    return store(buffer->ptr(), buffer->length());
125
137
  }
126
138
 
127
139
  virtual void store(const char *from, size_t length)
128
140
  {
 
141
    checkRowBegin();
129
142
    _result_set->setColumn(currentColumn(), std::string(from, length));
130
143
    checkRowEnd();
131
144
  }