42 {
"street_name",
DBA_CHAR, PCN_SIZE_OF(
Address, StreetName ), PCN_FALSE},
43 {
"street_no",
DBA_INT, PCN_SIZE_OF(
Address, StreetNo ), PCN_FALSE},
65 static const int Rows = 6;
69 { 1242,
"Joe",
"Dalton" },
70 { 123,
"Lucky",
"Luke" },
71 { 456,
"Averell",
"Dalton" },
72 { 8976,
"Gaston",
"Lagaffe" },
73 { 1122,
"Jolly",
"Jumper" },
74 { 3211,
"Leffe",
"Pagrotsky" }
89 { 1242,
"Lonesome Street", 12,
"Crime Town" },
90 { 123,
"Pistol Road", 13,
"Fort Mount" },
91 { 456,
"Banking Blv.", 43,
"Las Vegas" },
92 { 8976,
"ChancylleZee", 54,
"Paris" },
93 { 1122,
"Lucky", 111,
"Wild West" },
94 { 3211,
"Parlament St.", 11,
"Stockholm" }
107 static const char EMP_TABLE[] =
"employees";
108 static const char ADD_TABLE[] =
"addresses";
110 static const int EmpNbCol = 3;
111 static const int AddNbCol = 4;
117 ndbout <<
"Opening database" << endl;
120 ndbout <<
"Creating tables" << endl;
124 ndbout <<
"Checking for table existance" << endl;
131 CreateBindings(
void){
132 ndbout <<
"Creating bindings" << endl;
150 for(
int i = 0;
i<count;
i++)
151 if(rs[
i].RowFoundIndicator)
166 ndbout <<
"Testing multi operations" << endl;
170 NdbSleep_SecSleep(1);
172 const int R2 = Rows + Rows;
180 for(
int i = 0;
i<Rows;
i++)
181 DataRead[
i].DataPtr = &EMP_TABLE_DATA_READ[
i];
183 for(
int i = 0;
i<Rows;
i++)
184 DataRead[
i+Rows].DataPtr = &ADD_TABLE_DATA_READ[
i];
186 NdbSleep_SecSleep(1);
189 NdbSleep_SecSleep(1);
190 CompareRows(EMP_TABLE_DATA, Rows-2, EMP_TABLE_DATA_READ);
191 CompareRows(ADD_TABLE_DATA, Rows-2, ADD_TABLE_DATA_READ);
193 require(CountRows(DataRead, R2) == (R2-4));
198 NdbSleep_SecSleep(1);
203 ndbout <<
"Testing array of pointer operations" << endl;
207 NdbSleep_SecSleep(1);
210 for(
int i = 0;
i<Rows;
i++){
211 EmpDataRead[
i].
DataPtr = &EMP_TABLE_DATA_READ[
i];
215 NdbSleep_SecSleep(1);
216 CompareRows(EMP_TABLE_DATA, Rows-2, EMP_TABLE_DATA_READ);
217 require(CountRows(EmpDataRead, Rows) == (Rows-2));
221 NdbSleep_SecSleep(1);
225 NDB_COMMAND(newton_br,
"newton_br",
226 "newton_br",
"newton_br", 65535){
245 callbackStatusCheck(
DBA_Error_t status,
const char* operation) {
246 ndbout_c(
"%s: %d", operation, status);
250 callbackStatusCheck(s,
"insert");
253 callbackStatusCheck(s,
"delete");
256 callbackStatusCheck(s,
"update");
259 callbackStatusCheck(s,
"read");
262 callbackStatusCheck(s,
"write");