19 #include "Interpreter.hpp"
20 #include <signaldata/AttrInfo.hpp>
24 #define INT_DEBUG(x) \
25 { const char* tmp = NdbEnv_GetEnv("INT_DEBUG", (char*)0, 0); \
26 if (tmp != 0 && strlen(tmp) != 0) { ndbout << "INT:"; ndbout_c x; } }
32 NdbOperation::initInterpreter(){
35 theFirstBranch = NULL;
40 theFirstSubroutine = NULL;
41 theLastSubroutine = NULL;
44 theNoOfSubroutines = 0;
46 theSubroutineSize = 0;
47 theInitialReadSize = 0;
48 theInterpretedSize = 0;
49 theFinalUpdateSize = 0;
51 theInterpretIndicator = 1;
53 theTotalCurrAI_Len = AttrInfo::SectionSizeInfoLength;
57 NdbOperation::isNdbRecordOperation()
64 (m_attribute_record == NULL));
70 if (isNdbRecordOperation()) {
72 setErrorCodeAbort(4537);
76 if ((theInterpretIndicator == 1)) {
77 if (tNdbColumnImpl == NULL)
78 goto inc_check_error1;
79 if ((tNdbColumnImpl->getInterpretableType() !=
true) ||
80 (tNdbColumnImpl->m_pk !=
false) ||
81 (tNdbColumnImpl->m_nullable))
82 goto inc_check_error2;
83 if (theStatus == ExecInterpretedValue) {
85 }
else if (theStatus == GetValue) {
86 theInitialReadSize = theTotalCurrAI_Len - AttrInfo::SectionSizeInfoLength;
87 theStatus = ExecInterpretedValue;
88 }
else if (theStatus == SubroutineExec) {
91 setErrorCodeAbort(4231);
94 if (tNdbColumnImpl->m_storageType == NDB_STORAGETYPE_DISK)
96 m_flags &= ~(Uint8)OF_NO_DISK;
98 return tNdbColumnImpl->m_attrId;
101 setErrorCodeAbort(4200);
106 setErrorCodeAbort(4004);
110 if (tNdbColumnImpl->m_pk){
111 setErrorCodeAbort(4202);
114 if (!tNdbColumnImpl->getInterpretableType()){
115 setErrorCodeAbort(4217);
118 if (tNdbColumnImpl->m_nullable){
119 setErrorCodeAbort(4218);
122 setErrorCodeAbort(4219);
127 NdbOperation::write_attrCheck(
const NdbColumnImpl* tNdbColumnImpl)
129 if (isNdbRecordOperation()) {
131 setErrorCodeAbort(4537);
135 if ((theInterpretIndicator == 1)) {
136 if (tNdbColumnImpl == NULL)
137 goto write_attr_check_error1;
138 if ((tNdbColumnImpl->getInterpretableType() ==
false) ||
139 (tNdbColumnImpl->m_pk))
140 goto write_attr_check_error2;
141 if (theStatus == ExecInterpretedValue) {
143 }
else if (theStatus == SubroutineExec) {
146 setErrorCodeAbort(4231);
149 if (tNdbColumnImpl->m_storageType == NDB_STORAGETYPE_DISK)
151 m_flags &= ~(Uint8)OF_NO_DISK;
153 return tNdbColumnImpl->m_attrId;
156 setErrorCodeAbort(4200);
160 write_attr_check_error1:
161 setErrorCodeAbort(4004);
164 write_attr_check_error2:
165 if (tNdbColumnImpl->m_pk) {
166 setErrorCodeAbort(4202);
169 if (tNdbColumnImpl->getInterpretableType() ==
false){
170 setErrorCodeAbort(4217);
173 setErrorCodeAbort(4219);
178 NdbOperation::read_attrCheck(
const NdbColumnImpl* tNdbColumnImpl)
180 if (isNdbRecordOperation()) {
182 setErrorCodeAbort(4537);
186 if ((theInterpretIndicator == 1)) {
187 if (tNdbColumnImpl == NULL)
188 goto read_attr_check_error1;
189 if (tNdbColumnImpl->getInterpretableType() ==
false)
190 goto read_attr_check_error2;
191 if (theStatus == ExecInterpretedValue) {
193 }
else if (theStatus == GetValue) {
194 theInitialReadSize = theTotalCurrAI_Len - AttrInfo::SectionSizeInfoLength;
195 theStatus = ExecInterpretedValue;
196 }
else if (theStatus == SubroutineExec) {
199 setErrorCodeAbort(4231);
202 if (tNdbColumnImpl->m_storageType == NDB_STORAGETYPE_DISK)
204 m_flags &= ~(Uint8)OF_NO_DISK;
206 return tNdbColumnImpl->m_attrId;
209 setErrorCodeAbort(4200);
213 read_attr_check_error1:
214 setErrorCodeAbort(4004);
217 read_attr_check_error2:
218 if (tNdbColumnImpl->getInterpretableType() ==
false)
219 setErrorCodeAbort(4217);
221 setErrorCodeAbort(4219);
227 NdbOperation::initial_interpreterCheck()
229 if (isNdbRecordOperation()) {
231 setErrorCodeAbort(4537);
235 if ((theInterpretIndicator == 1)) {
236 if (theStatus == ExecInterpretedValue) {
238 }
else if (theStatus == GetValue) {
239 theInitialReadSize = theTotalCurrAI_Len - AttrInfo::SectionSizeInfoLength;
240 theStatus = ExecInterpretedValue;
242 }
else if (theStatus == SubroutineExec) {
245 setErrorCodeAbort(4231);
251 setErrorCodeAbort(4200);
257 NdbOperation::labelCheck()
259 if (isNdbRecordOperation()) {
261 setErrorCodeAbort(4537);
265 if ((theInterpretIndicator == 1)) {
266 if (theStatus == ExecInterpretedValue) {
268 }
else if (theStatus == GetValue) {
269 theInitialReadSize = theTotalCurrAI_Len - AttrInfo::SectionSizeInfoLength;
270 theStatus = ExecInterpretedValue;
272 }
else if (theStatus == SubroutineExec) {
274 }
else if (theStatus == SubroutineEnd) {
275 theStatus = SubroutineExec;
277 setErrorCodeAbort(4231);
283 setErrorCodeAbort(4200);
289 NdbOperation::intermediate_interpreterCheck()
291 if (isNdbRecordOperation()) {
293 setErrorCodeAbort(4537);
297 if ((theInterpretIndicator == 1)) {
298 if (theStatus == ExecInterpretedValue) {
300 }
else if (theStatus == SubroutineExec) {
303 setErrorCodeAbort(4231);
309 setErrorCodeAbort(4200);
326 INT_DEBUG((
"incValue32 %d %u", tNdbColumnImpl->m_attrId, aValue));
329 tAttrId = incCheck(tNdbColumnImpl);
331 goto incValue_error1;
336 goto incValue_error1;
340 if (insertATTRINFO(Interpreter::LoadConst16(7, aValue)) == -1)
341 goto incValue_error1;
343 if (insertATTRINFO(Interpreter::LoadConst32(7)) == -1)
344 goto incValue_error1;
345 if (insertATTRINFO(aValue) == -1)
346 goto incValue_error1;
350 if (insertATTRINFO( Interpreter::Add(7, 6, 7)) == -1)
351 goto incValue_error1;
352 if (insertATTRINFO( Interpreter::Write(tAttrId, 7)) == -1)
353 goto incValue_error1;
374 INT_DEBUG((
"subValue32 %d %u", tNdbColumnImpl->m_attrId, aValue));
377 tAttrId = incCheck(tNdbColumnImpl);
379 goto subValue_error1;
384 goto subValue_error1;
388 if (insertATTRINFO( Interpreter::LoadConst16(7, aValue)) == -1)
389 goto subValue_error1;
391 if (insertATTRINFO( Interpreter::LoadConst32(7)) == -1)
392 goto subValue_error1;
393 if (insertATTRINFO(aValue) == -1)
394 goto subValue_error1;
398 if (insertATTRINFO( Interpreter::Sub(7, 6, 7)) == -1)
399 goto subValue_error1;
400 if (insertATTRINFO( Interpreter::Write(tAttrId, 7)) == -1)
401 goto subValue_error1;
422 INT_DEBUG((
"incValue64 %d %llu", tNdbColumnImpl->m_attrId, aValue));
425 tAttrId = incCheck(tNdbColumnImpl);
427 goto incValue_error1;
432 goto incValue_error1;
434 if (insertATTRINFO( Interpreter::LoadConst64(7)) == -1)
435 goto incValue_error1;
436 if (insertATTRINFOloop((Uint32*)&aValue, 2) == -1)
437 goto incValue_error1;
439 if (insertATTRINFO( Interpreter::Add(7, 6, 7)) == -1)
440 goto incValue_error1;
441 if (insertATTRINFO( Interpreter::Write(tAttrId, 7)) == -1)
442 goto incValue_error1;
463 INT_DEBUG((
"subValue64 %d %llu", tNdbColumnImpl->m_attrId, aValue));
466 tAttrId = incCheck(tNdbColumnImpl);
468 goto subValue_error1;
473 goto subValue_error1;
475 if (insertATTRINFO( Interpreter::LoadConst64(7)) == -1)
476 goto subValue_error1;
477 if (insertATTRINFOloop((Uint32*)&aValue, 2) == -1)
478 goto subValue_error1;
480 if (insertATTRINFO( Interpreter::Sub(7, 6, 7)) == -1)
481 goto subValue_error1;
482 if (insertATTRINFO( Interpreter::Write(tAttrId, 7)) == -1)
483 goto subValue_error1;
498 INT_DEBUG((
"def_label %d", tLabelNo));
500 if (labelCheck() == -1)
503 tLabelIndex = theNoOfLabels - ((theNoOfLabels >> 4) << 4);
504 if (tLabelIndex == 0)
506 NdbLabel* tNdbLabel = theNdb->getNdbLabel();
507 if (tNdbLabel == NULL)
509 setErrorCodeAbort(4000);
512 if (theFirstLabel == NULL)
513 theFirstLabel = tNdbLabel;
515 theLastLabel->theNext = tNdbLabel;
517 theLastLabel = tNdbLabel;
518 tNdbLabel->theNext = NULL;
531 Uint32 initialOffset= theInitialReadSize + AttrInfo::SectionSizeInfoLength;
533 if (theNoOfSubroutines > 0)
538 initialOffset+= (theInterpretedSize + theFinalUpdateSize + theFinalReadSize);
542 theLastLabel->theLabelNo[tLabelIndex] = tLabelNo;
543 theLastLabel->theLabelAddress[tLabelIndex] = (theTotalCurrAI_Len + 1) - initialOffset;
544 theLastLabel->theSubroutine[tLabelIndex] = theNoOfSubroutines;
548 return (theNoOfLabels - 1);
558 INT_DEBUG((
"def_subroutine %d", tSubNo));
559 Uint32 tSubroutineIndex;
561 if (theInterpretIndicator != 1)
563 setErrorCodeAbort(4200);
567 if (
int(theNoOfSubroutines) != tSubNo)
569 setErrorCodeAbort(4227);
572 if (theStatus == FinalGetValue)
574 theFinalReadSize = theTotalCurrAI_Len -
575 (theInitialReadSize + theInterpretedSize +
576 theFinalUpdateSize + AttrInfo::SectionSizeInfoLength);
578 }
else if (theStatus == SubroutineEnd)
581 }
else if (theStatus == ExecInterpretedValue)
583 if (insertATTRINFO(Interpreter::EXIT_OK) == -1)
585 theInterpretedSize = theTotalCurrAI_Len -
586 (theInitialReadSize + AttrInfo::SectionSizeInfoLength);
587 }
else if (theStatus == SetValueInterpreted)
589 theFinalUpdateSize = theTotalCurrAI_Len -
590 (theInitialReadSize + theInterpretedSize +
591 AttrInfo::SectionSizeInfoLength);
593 }
else if (theStatus == GetValue)
596 theInitialReadSize = theTotalCurrAI_Len -
597 AttrInfo::SectionSizeInfoLength;
601 setErrorCodeAbort(4200);
604 theStatus = SubroutineExec;
605 tSubroutineIndex = theNoOfSubroutines - ((theNoOfSubroutines >> 4) << 4);
606 if (tSubroutineIndex == 0)
609 if (tNdbSubroutine == NULL)
611 setErrorCodeAbort(4000);
614 if (theFirstSubroutine == NULL)
615 theFirstSubroutine = tNdbSubroutine;
617 theLastSubroutine->theNext = tNdbSubroutine;
619 theLastSubroutine = tNdbSubroutine;
620 tNdbSubroutine->theNext = NULL;
622 theLastSubroutine->theSubroutineAddress[tSubroutineIndex] = theTotalCurrAI_Len -
623 (AttrInfo::SectionSizeInfoLength + theInitialReadSize + theInterpretedSize +
624 theFinalUpdateSize + theFinalReadSize);
626 theNoOfSubroutines++;
628 return (theNoOfSubroutines - 1);
638 INT_DEBUG((
"add_reg %u %u %u", RegSource1, RegSource2, RegDest));
639 if (intermediate_interpreterCheck() == -1)
644 setErrorCodeAbort(4229);
649 setErrorCodeAbort(4229);
654 setErrorCodeAbort(4229);
657 if (insertATTRINFO( Interpreter::Add(RegDest, RegSource1, RegSource2)) == -1)
670 INT_DEBUG((
"sub_reg %u %u %u", RegSource1, RegSource2, RegDest));
671 if (intermediate_interpreterCheck() == -1)
676 setErrorCodeAbort(4229);
681 setErrorCodeAbort(4229);
686 setErrorCodeAbort(4229);
689 if (insertATTRINFO( Interpreter::Sub(RegDest, RegSource1, RegSource2)) == -1)
702 INT_DEBUG((
"load_const_u32 %u %u", RegDest, Constant));
703 if (initial_interpreterCheck() == -1)
707 if (insertATTRINFO( Interpreter::LoadConst32(RegDest)) == -1)
709 if (insertATTRINFO(Constant) == -1)
718 setErrorCodeAbort(4229);
727 NdbOperation::load_const_u64(Uint32 RegDest, Uint64 Constant)
729 INT_DEBUG((
"load_const_u64 %u %llu", RegDest, Constant));
730 if (initial_interpreterCheck() == -1)
734 setErrorCodeAbort(4229);
739 if (insertATTRINFO( Interpreter::LoadConst64(RegDest)) == -1)
741 if (insertATTRINFOloop((Uint32*)&Constant, 2) == -1)
754 INT_DEBUG((
"load_const_null %u", RegDest));
755 if (initial_interpreterCheck() == -1)
759 setErrorCodeAbort(4229);
762 if (insertATTRINFO( Interpreter::LOAD_CONST_NULL) == -1)
775 INT_DEBUG((
"read_attr %d %u", anAttrObject->m_attrId, RegDest));
776 if (initial_interpreterCheck() == -1)
779 int tAttrId = read_attrCheck(anAttrObject);
781 goto read_attr_error1;
783 goto read_attr_error2;
794 setErrorCodeAbort(4229);
805 INT_DEBUG((
"write_attr %d %u", anAttrObject->m_attrId, RegSource));
806 int tAttrId = write_attrCheck(anAttrObject);
809 if (insertATTRINFO( Interpreter::Write(tAttrId, RegSource)) == -1)
816 NdbOperation::branch_reg_reg(Uint32
type,
817 Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
819 if (intermediate_interpreterCheck() == -1)
821 if (insertATTRINFO(Interpreter::Branch(type, RegLvalue, RegRvalue)) == -1)
823 if (insertBranch(Label) == -1)
832 INT_DEBUG((
"branch_ge %u %u %u", RegLvalue, RegRvalue, Label));
833 return branch_reg_reg(Interpreter::BRANCH_GE_REG_REG,
834 RegLvalue, RegRvalue, Label);
838 NdbOperation::branch_gt(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
840 INT_DEBUG((
"branch_gt %u %u %u", RegLvalue, RegRvalue, Label));
841 return branch_reg_reg(Interpreter::BRANCH_GT_REG_REG,
842 RegLvalue, RegRvalue, Label);
846 NdbOperation::branch_le(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
848 INT_DEBUG((
"branch_le %u %u %u", RegLvalue, RegRvalue, Label));
849 return branch_reg_reg(Interpreter::BRANCH_LE_REG_REG,
850 RegLvalue, RegRvalue, Label);
854 NdbOperation::branch_lt(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
856 INT_DEBUG((
"branch_lt %u %u %u", RegLvalue, RegRvalue, Label));
857 return branch_reg_reg(Interpreter::BRANCH_LT_REG_REG,
858 RegLvalue, RegRvalue, Label);
862 NdbOperation::branch_eq(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
864 INT_DEBUG((
"branch_eq %u %u %u", RegLvalue, RegRvalue, Label));
865 return branch_reg_reg(Interpreter::BRANCH_EQ_REG_REG,
866 RegLvalue, RegRvalue, Label);
870 NdbOperation::branch_ne(Uint32 RegLvalue, Uint32 RegRvalue, Uint32 Label)
872 INT_DEBUG((
"branch_ne %u %u %u", RegLvalue, RegRvalue, Label));
873 return branch_reg_reg(Interpreter::BRANCH_NE_REG_REG,
874 RegLvalue, RegRvalue, Label);
880 INT_DEBUG((
"branch_ne_null %u %u", RegLvalue, Label));
881 if (intermediate_interpreterCheck() == -1)
883 if (insertATTRINFO((RegLvalue << 6) + Interpreter::BRANCH_REG_NE_NULL) == -1)
885 if (insertBranch(Label) == -1)
894 INT_DEBUG((
"branch_eq_null %u %u", RegLvalue, Label));
895 if (intermediate_interpreterCheck() == -1)
897 if (insertATTRINFO((RegLvalue << 6) + Interpreter::BRANCH_REG_EQ_NULL) == -1)
899 if (insertBranch(Label) == -1)
908 INT_DEBUG((
"branch_label %u", Label));
909 if (initial_interpreterCheck() == -1)
911 if (insertATTRINFO(Interpreter::BRANCH) == -1)
913 if (insertBranch(Label) == -1)
926 INT_DEBUG((
"interpret_exit_ok"));
927 if (initial_interpreterCheck() == -1)
929 if (insertATTRINFO(Interpreter::EXIT_OK) == -1)
938 INT_DEBUG((
"interpret_exit_last_row"));
939 if (initial_interpreterCheck() == -1)
941 if (insertATTRINFO(Interpreter::EXIT_OK_LAST) == -1)
954 INT_DEBUG((
"interpret_exit_nok %u", ErrorCode));
955 if (initial_interpreterCheck() == -1)
957 if (insertATTRINFO( (ErrorCode << 16) + Interpreter::EXIT_REFUSE) == -1)
964 NdbOperation::interpret_exit_nok()
966 INT_DEBUG((
"interpret_exit_nok"));
967 Uint32 ErrorCode = 899;
969 if (initial_interpreterCheck() == -1)
971 if (insertATTRINFO( (ErrorCode << 16) + Interpreter::EXIT_REFUSE) == -1)
980 INT_DEBUG((
"call_sub %u", Subroutine));
981 if (initial_interpreterCheck() == -1)
983 if (insertATTRINFO( (Subroutine << 16) + Interpreter::CALL) == -1)
985 if (insertCall(Subroutine) == -1)
994 INT_DEBUG((
"ret_sub"));
995 if (theInterpretIndicator != 1)
997 setErrorCodeAbort(4200);
1000 if (theStatus == SubroutineExec)
1005 setErrorCodeAbort(4200);
1008 if (insertATTRINFO(Interpreter::RETURN) == -1)
1010 theStatus = SubroutineEnd;
1016 NdbOperation::insertBranch(Uint32 aLabel)
1019 NdbBranch* tBranch = theNdb->getNdbBranch();
1020 if (tBranch == NULL)
1021 goto insertBranch_error1;
1022 if (theFirstBranch == NULL)
1023 theFirstBranch = tBranch;
1025 theLastBranch->theNext = tBranch;
1026 theLastBranch = tBranch;
1027 if (theNoOfSubroutines == 0)
1028 tAddress = theTotalCurrAI_Len -
1029 (theInitialReadSize + AttrInfo::SectionSizeInfoLength);
1031 tAddress = theTotalCurrAI_Len -
1032 (theInitialReadSize + theInterpretedSize +
1033 theFinalUpdateSize + theFinalReadSize + AttrInfo::SectionSizeInfoLength);
1035 tBranch->theBranchAddress = tAddress;
1036 tBranch->theSignal = theCurrentATTRINFO;
1037 tBranch->theSignalAddress = theAI_LenInCurrAI;
1038 tBranch->theSubroutine = theNoOfSubroutines;
1039 tBranch->theBranchLabel = aLabel;
1042 insertBranch_error1:
1043 setErrorCodeAbort(4000);
1048 NdbOperation::insertCall(Uint32 aCall)
1050 NdbCall* tCall = theNdb->getNdbCall();
1053 setErrorCodeAbort(4000);
1056 if (theFirstCall == NULL)
1057 theFirstCall = tCall;
1059 theLastCall->theNext = tCall;
1060 theLastCall = tCall;
1062 tCall->theSignal = theCurrentATTRINFO;
1063 tCall->theSignalAddress = theAI_LenInCurrAI;
1064 tCall->theSubroutine = aCall;
1069 NdbOperation::branch_col(Uint32 type,
1070 Uint32 ColId,
const void * val, Uint32 len,
1073 DBUG_ENTER(
"NdbOperation::branch_col");
1074 DBUG_PRINT(
"enter", (
"type: %u col:%u val: 0x%lx len: %u label: %u",
1075 type, ColId, (
long) val, len, Label));
1077 DBUG_DUMP(
"value", (uchar*)val, len);
1079 if (initial_interpreterCheck() == -1)
1082 Interpreter::BinaryCondition c = (Interpreter::BinaryCondition)type;
1085 m_currentTable->getColumn(ColId);
1091 Uint32 lastWordMask= ~0;
1095 if (! col->getStringType())
1098 if (col->
getType() == NDB_TYPE_BIT)
1104 Uint32 lastWordBits= bitLen & 0x1F;
1106 lastWordMask= (1 << lastWordBits) -1;
1108 len= col->m_attrSize * col->m_arraySize;
1116 if ((type != Interpreter::LIKE) &&
1117 (type != Interpreter::NOT_LIKE))
1119 if (! col->get_var_length(val, len))
1121 setErrorCodeAbort(4209);
1128 if (col->m_storageType == NDB_STORAGETYPE_DISK)
1130 m_flags &= ~(Uint8)OF_NO_DISK;
1133 Uint32 tempData[ NDB_MAX_TUPLE_SIZE_IN_WORDS ];
1134 if (((UintPtr)val & 3) != 0) {
1135 memcpy(tempData, val, len);
1139 if (insertATTRINFO(Interpreter::BranchCol(c, 0, 0)) == -1)
1142 if (insertBranch(Label) == -1)
1145 if (insertATTRINFO(Interpreter::BranchCol_2(col->m_attrId, len)))
1148 Uint32 len2 = Interpreter::mod4(len);
1150 (lastWordMask == (Uint32)~0)){
1151 insertATTRINFOloop((Uint32*)val, len2 >> 2);
1154 insertATTRINFOloop((Uint32*)val, len2 >> 2);
1156 for (Uint32
i = 0;
i < len-len2;
i++) {
1157 char* p = (
char*)&tmp;
1158 p[
i] = ((
char*)val)[len2+
i];
1160 insertATTRINFO(tmp & lastWordMask);
1169 bool nopad, Uint32 Label){
1170 INT_DEBUG((
"branch_col_eq %u %.*s(%u,%d) -> %u", ColId, len, (
char*) val, len,
1172 return branch_col(Interpreter::EQ, ColId, val, len, Label);
1176 NdbOperation::branch_col_ne(Uint32 ColId,
const void * val, Uint32 len,
1177 bool nopad, Uint32 Label){
1178 INT_DEBUG((
"branch_col_ne %u %.*s(%u,%d) -> %u", ColId, len, (
char*) val, len,
1180 return branch_col(Interpreter::NE, ColId, val, len, Label);
1183 NdbOperation::branch_col_lt(Uint32 ColId,
const void * val, Uint32 len,
1184 bool nopad, Uint32 Label){
1185 INT_DEBUG((
"branch_col_lt %u %.*s(%u,%d) -> %u", ColId, len, (
char*) val, len,
1187 return branch_col(Interpreter::LT, ColId, val, len, Label);
1190 NdbOperation::branch_col_le(Uint32 ColId,
const void * val, Uint32 len,
1191 bool nopad, Uint32 Label){
1192 INT_DEBUG((
"branch_col_le %u %.*s(%u,%d) -> %u", ColId, len, (
char*) val, len,
1194 return branch_col(Interpreter::LE, ColId, val, len, Label);
1197 NdbOperation::branch_col_gt(Uint32 ColId,
const void * val, Uint32 len,
1198 bool nopad, Uint32 Label){
1199 INT_DEBUG((
"branch_col_gt %u %.*s(%u,%d) -> %u", ColId, len, (
char*) val, len,
1201 return branch_col(Interpreter::GT, ColId, val, len, Label);
1205 NdbOperation::branch_col_ge(Uint32 ColId,
const void * val, Uint32 len,
1206 bool nopad, Uint32 Label){
1207 INT_DEBUG((
"branch_col_ge %u %.*s(%u,%d) -> %u", ColId, len, (
char*) val, len,
1209 return branch_col(Interpreter::GE, ColId, val, len, Label);
1214 bool nopad, Uint32 Label){
1215 INT_DEBUG((
"branch_col_like %u %.*s(%u,%d) -> %u", ColId, len, (
char*) val, len,
1217 return branch_col(Interpreter::LIKE, ColId, val, len, Label);
1221 NdbOperation::branch_col_notlike(Uint32 ColId,
const void * val, Uint32 len,
1222 bool nopad, Uint32 Label){
1223 INT_DEBUG((
"branch_col_notlike %u %.*s(%u,%d) -> %u", ColId, len, (
char*) val, len,
1225 return branch_col(Interpreter::NOT_LIKE, ColId, val, len, Label);
1230 Uint32 len,
bool nopad, Uint32 Label){
1231 INT_DEBUG((
"branch_col_and_mask_eq_mask %u %.*s(%u,%d) -> %u", ColId, len, (
char*) mask, len,
1233 return branch_col(Interpreter::AND_EQ_MASK, ColId, mask, len, Label);
1237 NdbOperation::branch_col_and_mask_ne_mask(Uint32 ColId,
const void * mask,
1238 Uint32 len,
bool nopad, Uint32 Label){
1239 INT_DEBUG((
"branch_col_and_mask_ne_mask %u %.*s(%u,%d) -> %u", ColId, len, (
char*) mask, len,
1241 return branch_col(Interpreter::AND_NE_MASK, ColId, mask, len, Label);
1245 NdbOperation::branch_col_and_mask_eq_zero(Uint32 ColId,
const void * mask,
1246 Uint32 len,
bool nopad, Uint32 Label){
1247 INT_DEBUG((
"branch_col_and_mask_eq_zero %u %.*s(%u,%d) -> %u", ColId, len, (
char*) mask, len,
1249 return branch_col(Interpreter::AND_EQ_ZERO, ColId, mask, len, Label);
1253 NdbOperation::branch_col_and_mask_ne_zero(Uint32 ColId,
const void * mask,
1254 Uint32 len,
bool nopad, Uint32 Label){
1255 INT_DEBUG((
"branch_col_and_mask_ne_zero %u %.*s(%u,%d) -> %u", ColId, len, (
char*) mask, len,
1257 return branch_col(Interpreter::AND_NE_ZERO, ColId, mask, len, Label);
1261 NdbOperation::branch_col_null(Uint32 type, Uint32 ColId, Uint32 Label){
1263 if (initial_interpreterCheck() == -1)
1266 if (insertATTRINFO(type) == -1)
1269 if (insertBranch(Label) == -1)
1273 NdbColumnImpl::getImpl(* m_currentTable->getColumn(ColId)).m_attrId;
1275 if (insertATTRINFO(Interpreter::BranchCol_2(attrId)))
1285 INT_DEBUG((
"branch_col_eq_null %u -> %u", ColId, Label));
1286 return branch_col_null(Interpreter::BRANCH_ATTR_EQ_NULL, ColId, Label);
1290 NdbOperation::branch_col_ne_null(Uint32 ColId, Uint32 Label){
1292 INT_DEBUG((
"branch_col_ne_null %u -> %u", ColId, Label));
1293 return branch_col_null(Interpreter::BRANCH_ATTR_NE_NULL, ColId, Label);