21 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL // Not part of public interface
23 #include <ndb_types.h>
50 friend int spjTest(
int argc,
char** argv);
53 enum ReceiverType { NDB_UNINITIALIZED,
56 NDB_INDEX_OPERATION = 3,
57 NDB_QUERY_OPERATION = 4
61 int init(ReceiverType
type,
bool useRec,
void* owner);
69 ReceiverType getType()
const {
74 void* getOwner()
const {
78 bool checkMagicNumber()
const;
80 inline void next(
NdbReceiver* next_arg) { m_next = next_arg;}
83 void setErrorCode(
int);
86 void prepareReceive(
char *
buf);
89 void prepareRead(
char *
buf, Uint32 rows);
92 Uint32 theMagicNumber;
108 void calculate_batch_size(
const NdbImpl&,
111 Uint32, Uint32, Uint32&, Uint32&, Uint32&);
113 void calculate_batch_size(Uint32 key_size,
116 Uint32& batch_byte_size,
117 Uint32& first_batch_size,
124 void do_setup_ndbrecord(
const NdbRecord *ndb_record, Uint32 batch_size,
125 Uint32 key_size, Uint32 read_range_no,
126 Uint32 rowsize,
char *
buf);
129 Uint32 ndbrecord_rowsize(
const NdbRecord *ndb_record,
135 int execKEYINFO20(Uint32 info,
const Uint32* ptr, Uint32 len);
136 int execTRANSID_AI(
const Uint32* ptr, Uint32 len);
137 int execTCOPCONF(Uint32 len);
138 int execSCANOPCONF(Uint32 tcPtrI, Uint32 len, Uint32 rows);
144 bool m_using_ndb_record;
164 bool m_read_range_no;
199 Uint32 m_current_row;
201 Uint32 m_result_rows;
210 Uint32 m_expected_result_length;
211 Uint32 m_received_result_length;
213 bool hasResults()
const {
return m_result_rows > 0; }
214 bool nextResult()
const {
return m_current_row < m_result_rows; }
215 Uint32 receive_packed_recattr(
NdbRecAttr**, Uint32 bmlen,
216 const Uint32* aDataPtr, Uint32 aLength);
217 Uint32 receive_packed_ndbrecord(Uint32 bmlen,
218 const Uint32* aDataPtr,
221 const char *get_row();
228 const char *peek_row()
const;
230 int get_range_no()
const;
232 int get_keyinfo20(Uint32 & scaninfo, Uint32 & length,
233 const char * & data_ptr)
const;
234 int getScanAttrData(
const char * & data, Uint32 &
size, Uint32 & pos)
const;
236 void setCurrentRow(
char* buffer, Uint32 row);
238 Uint32 getCurrentRow()
const {
return m_current_row; }
241 #ifdef NDB_NO_DROPPED_SIGNAL
247 NdbReceiver::checkMagicNumber()
const {
248 bool retVal = (theMagicNumber == 0x11223344);
249 #ifdef NDB_NO_DROPPED_SIGNAL
259 NdbReceiver::prepareSend(){
261 theMagicNumber = 0x11223344;
264 m_received_result_length = 0;
265 m_expected_result_length = 0;
266 if (m_using_ndb_record)
268 if (m_type==NDB_SCANRECEIVER || m_type==NDB_QUERY_OPERATION)
269 m_record.m_row_recv= m_record.m_row_buffer;
271 theCurrentRecAttr = theFirstRecAttr;
276 NdbReceiver::execTCOPCONF(Uint32 len){
277 Uint32 tmp = m_received_result_length;
278 m_expected_result_length = len;
280 assert(!(tmp && !len));
282 return ((
bool)len ^ (
bool)tmp ? 0 : 1);
287 NdbReceiver::execSCANOPCONF(Uint32 tcPtrI, Uint32 len, Uint32 rows){
289 m_result_rows = rows;
290 Uint32 tmp = m_received_result_length;
291 m_expected_result_length = len;
292 return (tmp == len ? 1 : 0);
297 NdbReceiver::setCurrentRow(
char* buffer, Uint32 row)
299 m_record.m_row_buffer = buffer;
302 assert(m_current_row < m_result_rows);
308 NdbReceiver::get_row()
311 assert(m_current_row < m_result_rows);
313 return m_record.m_row_buffer + (m_current_row++ * m_record.m_row_offset);
318 NdbReceiver::peek_row()
const
320 return m_record.m_row_buffer + m_current_row * m_record.m_row_offset;
324 #endif // DOXYGEN_SHOULD_SKIP_INTERNAL