1 /* Copyright (c) 2003-2007 MySQL AB
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
18 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL // Not part of public interface
20 #include <ndb_types.h>
28 friend class NdbOperation
;
29 friend class NdbScanOperation
;
30 friend class NdbIndexOperation
;
31 friend class NdbIndexScanOperation
;
32 friend class NdbTransaction
;
34 enum ReceiverType
{ NDB_UNINITIALIZED
,
37 NDB_INDEX_OPERATION
= 3
40 NdbReceiver(Ndb
*aNdb
);
41 int init(ReceiverType type
, void* owner
);
49 ReceiverType
getType(){
53 inline NdbTransaction
* getTransaction();
58 bool checkMagicNumber() const;
60 inline void next(NdbReceiver
* next_arg
) { m_next
= next_arg
;}
61 inline NdbReceiver
* next() { return m_next
; }
63 void setErrorCode(int);
65 Uint32 theMagicNumber
;
69 Uint32 m_hidden_count
;
77 class NdbRecAttr
* getValue(const class NdbColumnImpl
*, char * user_dst_ptr
);
78 int do_get_value(NdbReceiver
*, Uint32 rows
, Uint32 key_size
, Uint32 range
);
80 void calculate_batch_size(Uint32
, Uint32
, Uint32
&, Uint32
&, Uint32
&);
82 int execKEYINFO20(Uint32 info
, const Uint32
* ptr
, Uint32 len
);
83 int execTRANSID_AI(const Uint32
* ptr
, Uint32 len
);
84 int execTCOPCONF(Uint32 len
);
85 int execSCANOPCONF(Uint32 tcPtrI
, Uint32 len
, Uint32 rows
);
86 class NdbRecAttr
* theFirstRecAttr
;
87 class NdbRecAttr
* theCurrentRecAttr
;
88 class NdbRecAttr
** m_rows
;
90 Uint32 m_list_index
; // When using multiple
93 Uint32 m_defined_rows
;
95 Uint32 m_expected_result_length
;
96 Uint32 m_received_result_length
;
98 bool nextResult() const { return m_current_row
< m_result_rows
; }
99 NdbRecAttr
* copyout(NdbReceiver
&);
102 #ifdef NDB_NO_DROPPED_SIGNAL
108 NdbReceiver::checkMagicNumber() const {
109 bool retVal
= (theMagicNumber
== 0x11223344);
110 #ifdef NDB_NO_DROPPED_SIGNAL
120 NdbReceiver::prepareSend(){
122 m_received_result_length
= 0;
123 m_expected_result_length
= 0;
124 theCurrentRecAttr
= theFirstRecAttr
;
129 NdbReceiver::execTCOPCONF(Uint32 len
){
130 Uint32 tmp
= m_received_result_length
;
131 m_expected_result_length
= len
;
133 assert(!(tmp
&& !len
));
135 return ((bool)len
^ (bool)tmp
? 0 : 1);
140 NdbReceiver::execSCANOPCONF(Uint32 tcPtrI
, Uint32 len
, Uint32 rows
){
142 m_result_rows
= rows
;
143 Uint32 tmp
= m_received_result_length
;
144 m_expected_result_length
= len
;
145 return (tmp
== len
? 1 : 0);
148 #endif // DOXYGEN_SHOULD_SKIP_INTERNAL