41 parent(parentarg), rightchild(NULL), leftchild(NULL), isoperator(true),
42 operatortype(operatortypearg)
56 Ast::Ast(
class Ast *parentarg,
string &operandarg) : parent(parentarg),
57 rightchild(NULL), leftchild(NULL),
129 memcpy(¶mnum, &
operand[1],
sizeof(paramnum));
157 printf(
"%s %i paramnum %li\n", __FILE__, __LINE__, paramnum);
191 printf(
"%s %i bad operand %c\n", __FILE__, __LINE__,
operand[0]);
220 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
225 operand.resize(1+
sizeof(int64_t), (
char)0);
229 memcpy(&
operand[1], &val,
sizeof(val));
238 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
243 operand.resize(1+
sizeof(
long double), (
char)0);
247 memcpy(&
operand[1], &val,
sizeof(val));
253 printf(
"%s %i not an arithmetic type %c\n", __FILE__, __LINE__,
278 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
283 operand.resize(1+
sizeof(int64_t), (
char)0);
287 memcpy(&
operand[1], &val,
sizeof(val));
296 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
301 operand.resize(1+
sizeof(
long double), (
char)0);
305 memcpy(&
operand[1], &val,
sizeof(val));
311 printf(
"%s %i not an arithmetic type %c\n", __FILE__, __LINE__,
336 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
341 operand.resize(1+
sizeof(int64_t), (
char)0);
345 memcpy(&
operand[1], &val,
sizeof(val));
354 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
359 operand.resize(1+
sizeof(
long double), (
char)0);
363 memcpy(&
operand[1], &val,
sizeof(val));
369 printf(
"%s %i not an arithmetic type %c\n", __FILE__, __LINE__,
394 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
399 operand.resize(1+
sizeof(int64_t), (
char)0);
403 memcpy(&
operand[1], &val,
sizeof(val));
412 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
417 operand.resize(1+
sizeof(
long double), (
char)0);
421 memcpy(&
operand[1], &val,
sizeof(val));
427 printf(
"%s %i not an arithmetic type %c\n", __FILE__, __LINE__,
451 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
456 operand.resize(1+
sizeof(int64_t), (
char)0);
459 memcpy(&
operand[1], &val,
sizeof(val));
468 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
473 operand.resize(1+
sizeof(
long double), (
char)0);
476 memcpy(&
operand[1], &val,
sizeof(val));
482 printf(
"%s %i not an arithmetic type %c\n", __FILE__, __LINE__,
493 boost::unordered_map< int64_t, vector<int64_t> > enginerowids;
495 boost::unordered_map<uuRecord_s, returnRow_s>::iterator it;
509 enginerowids[it->first.engineid].push_back(it->first.rowid);
515 boost::unordered_map< int64_t, vector<int64_t> >::iterator it2;
517 rowOrField.
isrow=
true;
520 for (it2 = enginerowids.begin(); it2 != enginerowids.end(); it2++)
524 for (
size_t n=0; n < it2->second.size(); n++)
526 rowOrField.
rowid=it2->second[n];
527 msg->
rofs.push_back(rowOrField);
536 printf(
"%s %i this %p deleting leftchild %p rightchild %p\n", __FILE__,
559 printf(
"%s %i operator %i not implemented.\n", __FILE__, __LINE__,
569 printf(
"%s %i operator %i not implemented.\n", __FILE__, __LINE__,
580 printf(
"%s %i operator %i not implemented.\n", __FILE__, __LINE__,
590 printf(
"%s %i operator %i not implemented.\n", __FILE__, __LINE__,
1020 *nextAstNode = NULL;
1063 *nextAstNode = NULL;
1124 memcpy(&torf, &astRef.
operand[1],
sizeof(torf));
1142 fieldValue.
str = astRef.
operand.substr(1, string::npos);
1146 fieldValue.
str = astRef.
operand.substr(1, string::npos);
1150 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__,
1187 *nextAstNode = NULL;
1249 memcpy(&torf, &astRef.
operand[1],
sizeof(torf));
1263 fieldValue.
str = astRef.
operand.substr(1, string::npos);
1267 fieldValue.
str = astRef.
operand.substr(1, string::npos);
1271 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__,
1304 *nextAstNode = NULL;
1348 *nextAstNode = NULL;
1396 *nextAstNode = NULL;
1447 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
1452 operand.resize(1+2*
sizeof(int64_t), (
char)0);
1465 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
1470 operand.resize(1+2*
sizeof(
long double), (
char)0);
1474 sizeof(
long double));
1483 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
1492 memcpy(&
operand[1], &len,
sizeof(len));
1501 printf(
"%s %i bad type %c\n", __FILE__, __LINE__,
1513 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__,
operatortype);
1544 printf(
"%s %i bad operand %c\n", __FILE__, __LINE__,
operand[0]);
1573 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
1578 operand.resize(1+
sizeof(int64_t), (
char)0);
1582 memcpy(&
operand[1], &val,
sizeof(val));
1591 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
1596 operand.resize(1+
sizeof(
long double), (
char)0);
1600 memcpy(&
operand[1], &val,
sizeof(val));
1606 printf(
"%s %i not an arithmetic type %c\n", __FILE__, __LINE__,
1631 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
1636 operand.resize(1+
sizeof(int64_t), (
char)0);
1640 memcpy(&
operand[1], &val,
sizeof(val));
1649 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
1654 operand.resize(1+
sizeof(
long double), (
char)0);
1658 memcpy(&
operand[1], &val,
sizeof(val));
1664 printf(
"%s %i not an arithmetic type %c\n", __FILE__, __LINE__,
1689 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
1694 operand.resize(1+
sizeof(int64_t), (
char)0);
1698 memcpy(&
operand[1], &val,
sizeof(val));
1707 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
1712 operand.resize(1+
sizeof(
long double), (
char)0);
1716 memcpy(&
operand[1], &val,
sizeof(val));
1722 printf(
"%s %i not an arithmetic type %c\n", __FILE__, __LINE__,
1747 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
1752 operand.resize(1+
sizeof(int64_t), (
char)0);
1756 memcpy(&
operand[1], &val,
sizeof(val));
1765 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
1770 operand.resize(1+
sizeof(
long double), (
char)0);
1774 memcpy(&
operand[1], &val,
sizeof(val));
1780 printf(
"%s %i not an arithmetic type %c\n", __FILE__, __LINE__,
1803 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
1808 operand.resize(1+
sizeof(int64_t), (
char)0);
1812 memcpy(&
operand[1], &val,
sizeof(val));
1821 printf(
"%s %i operand mismatch %c %i\n", __FILE__, __LINE__,
1826 operand.resize(1+
sizeof(
long double), (
char)0);
1830 memcpy(&
operand[1], &val,
sizeof(val));
1836 printf(
"%s %i not an arithmetic type '%c'\n", __FILE__, __LINE__,
1846 printf(
"%s %i can't evaluate %i in set assignment\n", __FILE__, __LINE__,
1859 memcpy(&fieldid, &
operand[1],
sizeof(fieldid));
1864 operand.resize(1+
sizeof(int64_t), (
char)0);
1866 memcpy(&
operand[1], &fieldValues[fieldid].value.integer,
1871 operand.resize(1+
sizeof(int64_t), (
char)0);
1873 memcpy(&
operand[1], &fieldValues[fieldid].value.uinteger,
1878 operand.resize(1+
sizeof(int64_t), (
char)0);
1882 if (fieldValues[fieldid].value.boolean==
true)
1891 memcpy(&
operand[1], &val,
sizeof(int64_t));
1895 operand.resize(1+
sizeof(
long double), (
char)0);
1897 memcpy(&
operand[1], &fieldValues[fieldid].value.floating,
1902 operand.resize(1+
sizeof(
char), (
char)0);
1904 operand[1] = fieldValues[fieldid].value.character;
1909 operand.append(fieldValues[fieldid].str);
1914 operand.append(fieldValues[fieldid].str);
1918 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__,
1931 memcpy(¶mnum, &
operand[1],
sizeof(paramnum));
1943 switch (inoperand[0])
1948 memcpy(&val, &inoperand[1],
sizeof(val));
1954 memcpy(&outField.
value.
floating, &inoperand[1],
sizeof(
long double));
1964 string instr=inoperand;
1972 memcpy(&val, &instr[1],
sizeof(val));
1973 memcpy(&outoperand[1], &val,
sizeof(val));
1984 memcpy(&val, &instr[1],
sizeof(val));
1985 memcpy(&outoperand[1], &val,
sizeof(val));
1994 class Schema *schemaPtrarg) :
1995 taPtr(taPtrarg), schemaPtr(schemaPtrarg), transactionPtr(NULL),
2021 for (
size_t n=0; n < orig.
queries.size(); n++)
2055 for (
size_t n=0; n < siz; n++)
2075 boost::unordered_map<int64_t, class Ast *>::const_iterator it;
2099 for (
size_t n=0; n <
queries.size(); n++)
2113 boost::unordered_map<int64_t, class Ast *>::iterator it;
2130 for (
size_t n=0; n <
queries.size(); n++)
2183 switch (fromColumnRef[0])
2188 n < tableRef.
fields.size();
2192 (int64_t)n, tableRef.
fields[n].name
2200 string fname = fromColumnRef.substr(1, string::npos);
2205 printf(
"%s %i tableid field not found %li %s\n", __FILE__,
2212 tableRef.
fields[fid].name
2220 string fname = fromColumnRef.substr(2, string::npos);
2225 printf(
"%s %i tableid field not found %li %s\n", __FILE__,
2232 tableRef.
fields[fid].name
2239 printf(
"%s %i anomaly %c\n", __FILE__, __LINE__,
2247 boost::unordered_map<string, class Ast *>::iterator it;
2256 printf(
"%s %i tableid field not found %li %s\n", __FILE__,
2286 bool isbreakout=
false;
2294 string fname = myPosition->
operand.substr(1, string::npos);
2299 printf(
"%s %i tableid field not found %li %s\n", __FILE__,
2305 myPosition->
operand.assign(1 +
sizeof(fid),
char(0));
2307 memcpy(&myPosition->
operand[1], &fid,
sizeof(fid));
2342 if (myPosition->
parent==NULL)
2357 myPosition=myPosition->
parent;
2363 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__, direction);
2367 if (isbreakout==
true)
2382 boost::unordered_map<string, int64_t> &ref =
2384 boost::unordered_map<string, int64_t>::iterator it;
2385 it = ref.find(fieldName);
2392 return ref[fieldName];
2396 string &leftoperand,
string &rightoperand,
2397 vector<fieldValue_s> &inValues,
2398 const boost::unordered_map<uuRecord_s, stagedRow_s> &stagedRows,
2399 boost::unordered_map<uuRecord_s, returnRow_s> &results)
2401 bool equalhit=
false;
2408 printf(
"%s %i left operand is not fieldid, it is '%c'\n",
2409 __FILE__, __LINE__, leftoperand[0]);
2415 memcpy(&fieldid, &leftoperand[1],
sizeof(fieldid));
2418 vector<fieldValue_s> fieldValues;
2420 boost::unordered_map<uuRecord_s, stagedRow_s>::const_iterator it;
2422 for (it = stagedRows.begin(); it != stagedRows.end(); it++)
2426 if (uurRef.
tableid != tableid)
2435 tableRef.
unmakerow((
string *)&returnRow.
row, &fieldValues);
2438 switch (tableRef.
fields[fieldid].type)
2448 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2452 results[uurRef] = returnRow;
2461 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2465 results[uurRef] = returnRow;
2473 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2477 results[uurRef] = returnRow;
2485 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2489 results[uurRef] = returnRow;
2497 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2501 results[uurRef] = returnRow;
2509 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2513 results[uurRef] = returnRow;
2521 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2523 memcpy(&rhsval2, &rightoperand[1+
sizeof(rhsval)],
2528 results[uurRef] = returnRow;
2536 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2538 memcpy(&rhsval2, &rightoperand[1+
sizeof(rhsval)],
2543 results[uurRef] = returnRow;
2551 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
2552 vector<fieldValue_s> fieldValues;
2555 boost::unordered_map<uuRecord_s, stagedRow_s>::const_iterator it;
2557 for (it = stagedRows.begin(); it != stagedRows.end(); it++)
2565 for (
size_t n=0; inValues.size(); n++)
2570 results[uurRef] = rRow;
2580 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
2581 vector<fieldValue_s> fieldValues;
2584 boost::unordered_map<uuRecord_s, stagedRow_s>::const_iterator it;
2586 for (it = stagedRows.begin(); it != stagedRows.end(); it++)
2595 for (
size_t n=0; inValues.size(); n++)
2607 results[uurRef] = rRow;
2617 results[uurRef] = returnRow;
2626 results[uurRef] = returnRow;
2632 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__, op);
2646 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2650 results[uurRef] = returnRow;
2658 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2662 results[uurRef] = returnRow;
2670 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2674 results[uurRef] = returnRow;
2682 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2686 results[uurRef] = returnRow;
2694 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2698 results[uurRef] = returnRow;
2706 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2710 results[uurRef] = returnRow;
2718 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2720 memcpy(&rhsval2, &rightoperand[1+
sizeof(rhsval)],
2725 results[uurRef] = returnRow;
2733 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2735 memcpy(&rhsval2, &rightoperand[1+
sizeof(rhsval)],
2740 results[uurRef] = returnRow;
2748 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
2749 vector<fieldValue_s> fieldValues;
2752 boost::unordered_map<uuRecord_s, stagedRow_s>::const_iterator it;
2754 for (it = stagedRows.begin(); it != stagedRows.end(); it++)
2762 for (
size_t n=0; inValues.size(); n++)
2767 results[uurRef] = rRow;
2777 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
2778 vector<fieldValue_s> fieldValues;
2781 boost::unordered_map<uuRecord_s, stagedRow_s>::const_iterator it;
2783 for (it = stagedRows.begin(); it != stagedRows.end(); it++)
2792 for (
size_t n=0; inValues.size(); n++)
2804 results[uurRef] = rRow;
2814 results[uurRef] = returnRow;
2823 results[uurRef] = returnRow;
2829 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__, op);
2844 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2848 results[uurRef] = returnRow;
2857 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2861 results[uurRef] = returnRow;
2870 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2874 results[uurRef] = returnRow;
2883 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2887 results[uurRef] = returnRow;
2896 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2900 results[uurRef] = returnRow;
2909 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2913 results[uurRef] = returnRow;
2921 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2922 long double rhsval2;
2923 memcpy(&rhsval2, &rightoperand[1+
sizeof(rhsval)],
2929 results[uurRef] = returnRow;
2937 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
2938 long double rhsval2;
2939 memcpy(&rhsval2, &rightoperand[1+
sizeof(rhsval)],
2944 results[uurRef] = returnRow;
2952 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
2953 vector<fieldValue_s> fieldValues;
2956 boost::unordered_map<uuRecord_s, stagedRow_s>::const_iterator it;
2958 for (it = stagedRows.begin(); it != stagedRows.end(); it++)
2966 for (
size_t n=0; inValues.size(); n++)
2971 results[uurRef] = rRow;
2981 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
2982 vector<fieldValue_s> fieldValues;
2985 boost::unordered_map<uuRecord_s, stagedRow_s>::const_iterator it;
2987 for (it = stagedRows.begin(); it != stagedRows.end(); it++)
2996 for (
size_t n=0; inValues.size(); n++)
3008 results[uurRef] = rRow;
3018 results[uurRef] = returnRow;
3027 results[uurRef] = returnRow;
3033 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__, op);
3046 char rhsval=rightoperand[1];
3050 results[uurRef] = returnRow;
3057 char rhsval=rightoperand[1];
3061 results[uurRef] = returnRow;
3068 char rhsval=rightoperand[1];
3072 results[uurRef] = returnRow;
3079 char rhsval=rightoperand[1];
3083 results[uurRef] = returnRow;
3090 char rhsval=rightoperand[1];
3094 results[uurRef] = returnRow;
3101 char rhsval=rightoperand[1];
3105 results[uurRef] = returnRow;
3112 char rhsval=rightoperand[1+
sizeof(int64_t)];
3113 char rhsval2=rightoperand[1+
sizeof(int64_t)+1];
3118 results[uurRef] = returnRow;
3125 char rhsval=rightoperand[1+
sizeof(int64_t)];
3126 char rhsval2=rightoperand[1+
sizeof(int64_t)+1];
3131 results[uurRef] = returnRow;
3139 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
3140 vector<fieldValue_s> fieldValues;
3143 boost::unordered_map<uuRecord_s, stagedRow_s>::const_iterator it;
3145 for (it = stagedRows.begin(); it != stagedRows.end(); it++)
3153 for (
size_t n=0; inValues.size(); n++)
3158 results[uurRef] = rRow;
3168 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
3169 vector<fieldValue_s> fieldValues;
3172 boost::unordered_map<uuRecord_s, stagedRow_s>::const_iterator it;
3174 for (it = stagedRows.begin(); it != stagedRows.end(); it++)
3183 for (
size_t n=0; inValues.size(); n++)
3195 results[uurRef] = rRow;
3205 results[uurRef] = returnRow;
3214 results[uurRef] = returnRow;
3220 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__, op);
3233 string rhsval=rightoperand.substr(1, string::npos);
3235 if (!lhs.
str.compare(rhsval))
3237 results[uurRef] = returnRow;
3244 string rhsval=rightoperand.substr(1, string::npos);
3246 if (lhs.
str.compare(rhsval))
3248 results[uurRef] = returnRow;
3256 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
3257 vector<fieldValue_s> fieldValues;
3260 boost::unordered_map<uuRecord_s, stagedRow_s>::const_iterator it;
3262 for (it = stagedRows.begin(); it != stagedRows.end(); it++)
3270 for (
size_t n=0; inValues.size(); n++)
3275 results[uurRef] = rRow;
3285 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
3286 vector<fieldValue_s> fieldValues;
3289 boost::unordered_map<uuRecord_s, stagedRow_s>::const_iterator it;
3291 for (it = stagedRows.begin(); it != stagedRows.end(); it++)
3300 for (
size_t n=0; inValues.size(); n++)
3312 results[uurRef] = rRow;
3322 results[uurRef] = returnRow;
3331 results[uurRef] = returnRow;
3337 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__, op);
3350 string rhsval=rightoperand.substr(1, string::npos);
3352 if (!lhs.
str.compare(rhsval))
3354 results[uurRef] = returnRow;
3361 string rhsval=rightoperand.substr(1, string::npos);
3363 if (lhs.
str.compare(rhsval))
3365 results[uurRef] = returnRow;
3373 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
3374 vector<fieldValue_s> fieldValues;
3377 boost::unordered_map<uuRecord_s, stagedRow_s>::const_iterator it;
3379 for (it = stagedRows.begin(); it != stagedRows.end(); it++)
3387 for (
size_t n=0; inValues.size(); n++)
3392 results[uurRef] = rRow;
3402 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
3403 vector<fieldValue_s> fieldValues;
3406 boost::unordered_map<uuRecord_s, stagedRow_s>::const_iterator it;
3408 for (it = stagedRows.begin(); it != stagedRows.end(); it++)
3417 for (
size_t n=0; inValues.size(); n++)
3429 results[uurRef] = rRow;
3439 results[uurRef] = returnRow;
3448 results[uurRef] = returnRow;
3454 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__, op);
3461 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__,
3462 tableRef.
fields[fieldid].type);
3473 string &leftoperand,
string &rightoperand,
3474 vector<fieldValue_s> &inValues,
3482 printf(
"%s %i left operand is not fieldid, it is %c\n", __FILE__,
3483 __LINE__, leftoperand[0]);
3488 memcpy(&fieldid, &leftoperand[1],
sizeof(fieldid));
3491 vector<fieldValue_s> fieldValues;
3493 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
3495 for (it = andResults.begin(); it != andResults.end(); it++)
3499 tableRef.
unmakerow((
string *)&returnRowRef.
row, &fieldValues);
3502 switch (tableRef.
fields[fieldid].type)
3511 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3515 results[uurRef] = returnRowRef;
3523 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3527 results[uurRef] = returnRowRef;
3535 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3539 results[uurRef] = returnRowRef;
3547 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3551 results[uurRef] = returnRowRef;
3559 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3563 results[uurRef] = returnRowRef;
3571 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3575 results[uurRef] = returnRowRef;
3583 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3585 memcpy(&rhsval2, &rightoperand[1+
sizeof(rhsval)],
3590 results[uurRef] = returnRowRef;
3598 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3600 memcpy(&rhsval2, &rightoperand[1+
sizeof(rhsval)],
3605 results[uurRef] = returnRowRef;
3615 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
3616 vector<fieldValue_s> fieldValues;
3619 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
3621 for (it = andResults.begin(); it != andResults.end(); it++)
3628 for (
size_t n=0; inValues.size(); n++)
3633 results[uurRef] = returnRowRef;
3644 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
3645 vector<fieldValue_s> fieldValues;
3648 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
3650 for (it = andResults.begin(); it != andResults.end(); it++)
3658 for (
size_t n=0; inValues.size(); n++)
3670 results[uurRef] = returnRowRef;
3680 results[uurRef] = returnRowRef;
3689 results[uurRef] = returnRowRef;
3695 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__, op);
3707 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3711 results[uurRef] = returnRowRef;
3719 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3723 results[uurRef] = returnRowRef;
3731 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3735 results[uurRef] = returnRowRef;
3743 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3747 results[uurRef] = returnRowRef;
3755 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3759 results[uurRef] = returnRowRef;
3767 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3771 results[uurRef] = returnRowRef;
3779 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3781 memcpy(&rhsval2, &rightoperand[1+
sizeof(rhsval)],
3787 results[uurRef] = returnRowRef;
3795 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3797 memcpy(&rhsval2, &rightoperand[1+
sizeof(rhsval)],
3802 results[uurRef] = returnRowRef;
3812 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
3813 vector<fieldValue_s> fieldValues;
3816 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
3818 for (it = andResults.begin(); it != andResults.end(); it++)
3825 for (
size_t n=0; inValues.size(); n++)
3830 results[uurRef] = returnRowRef;
3841 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
3842 vector<fieldValue_s> fieldValues;
3845 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
3847 for (it = andResults.begin(); it != andResults.end(); it++)
3855 for (
size_t n=0; inValues.size(); n++)
3867 results[uurRef] = returnRowRef;
3877 results[uurRef] = returnRowRef;
3886 results[uurRef] = returnRowRef;
3892 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__, op);
3904 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3908 results[uurRef] = returnRowRef;
3916 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3920 results[uurRef] = returnRowRef;
3928 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3932 results[uurRef] = returnRowRef;
3940 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3944 results[uurRef] = returnRowRef;
3952 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3956 results[uurRef] = returnRowRef;
3964 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3968 results[uurRef] = returnRowRef;
3976 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3978 memcpy(&rhsval2, &rightoperand[1+
sizeof(rhsval)],
3983 results[uurRef] = returnRowRef;
3991 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
3993 memcpy(&rhsval2, &rightoperand[1+
sizeof(rhsval)],
3998 results[uurRef] = returnRowRef;
4007 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
4008 vector<fieldValue_s> fieldValues;
4011 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
4013 for (it = andResults.begin(); it != andResults.end(); it++)
4020 for (
size_t n=0; inValues.size(); n++)
4025 results[uurRef] = returnRowRef;
4036 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
4037 vector<fieldValue_s> fieldValues;
4040 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
4042 for (it = andResults.begin(); it != andResults.end(); it++)
4050 for (
size_t n=0; inValues.size(); n++)
4062 results[uurRef] = returnRowRef;
4072 results[uurRef] = returnRowRef;
4081 results[uurRef] = returnRowRef;
4087 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__, op);
4100 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
4104 results[uurRef] = returnRowRef;
4113 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
4117 results[uurRef] = returnRowRef;
4126 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
4130 results[uurRef] = returnRowRef;
4139 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
4143 results[uurRef] = returnRowRef;
4152 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
4156 results[uurRef] = returnRowRef;
4165 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
4169 results[uurRef] = returnRowRef;
4177 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
4178 long double rhsval2;
4179 memcpy(&rhsval2, &rightoperand[1+
sizeof(rhsval)],
4185 results[uurRef] = returnRowRef;
4193 memcpy(&rhsval, &rightoperand[1],
sizeof(rhsval));
4194 long double rhsval2;
4195 memcpy(&rhsval2, &rightoperand[1+
sizeof(rhsval)],
4200 results[uurRef] = returnRowRef;
4210 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
4211 vector<fieldValue_s> fieldValues;
4214 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
4216 for (it = andResults.begin(); it != andResults.end(); it++)
4223 for (
size_t n=0; inValues.size(); n++)
4228 results[uurRef] = returnRowRef;
4240 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
4241 vector<fieldValue_s> fieldValues;
4244 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
4246 for (it = andResults.begin(); it != andResults.end(); it++)
4254 for (
size_t n=0; inValues.size(); n++)
4266 results[uurRef] = returnRowRef;
4276 results[uurRef] = returnRowRef;
4285 results[uurRef] = returnRowRef;
4291 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__, op);
4302 char rhsval=rightoperand[1];
4306 results[uurRef] = returnRowRef;
4313 char rhsval=rightoperand[1];
4317 results[uurRef] = returnRowRef;
4324 char rhsval=rightoperand[1];
4328 results[uurRef] = returnRowRef;
4335 char rhsval=rightoperand[1];
4339 results[uurRef] = returnRowRef;
4346 char rhsval=rightoperand[1];
4350 results[uurRef] = returnRowRef;
4357 char rhsval=rightoperand[1];
4361 results[uurRef] = returnRowRef;
4368 char rhsval=rightoperand[1+
sizeof(int64_t)];
4369 char rhsval2=rightoperand[1+
sizeof(int64_t)+1];
4374 results[uurRef] = returnRowRef;
4381 char rhsval=rightoperand[1+
sizeof(int64_t)];
4382 char rhsval2=rightoperand[1+
sizeof(int64_t)+1];
4387 results[uurRef] = returnRowRef;
4397 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
4398 vector<fieldValue_s> fieldValues;
4401 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
4403 for (it = andResults.begin(); it != andResults.end(); it++)
4410 for (
size_t n=0; inValues.size(); n++)
4415 results[uurRef] = returnRowRef;
4427 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
4428 vector<fieldValue_s> fieldValues;
4431 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
4433 for (it = andResults.begin(); it != andResults.end(); it++)
4441 for (
size_t n=0; inValues.size(); n++)
4453 results[uurRef] = returnRowRef;
4463 results[uurRef] = returnRowRef;
4472 results[uurRef] = returnRowRef;
4478 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__, op);
4489 string rhsval=rightoperand.substr(1, string::npos);
4491 if (!lhs.
str.compare(rhsval))
4493 results[uurRef] = returnRowRef;
4500 string rhsval=rightoperand.substr(1, string::npos);
4502 if (lhs.
str.compare(rhsval))
4504 results[uurRef] = returnRowRef;
4514 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
4515 vector<fieldValue_s> fieldValues;
4518 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
4520 for (it = andResults.begin(); it != andResults.end(); it++)
4527 for (
size_t n=0; inValues.size(); n++)
4532 results[uurRef] = returnRowRef;
4544 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
4545 vector<fieldValue_s> fieldValues;
4548 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
4550 for (it = andResults.begin(); it != andResults.end(); it++)
4558 for (
size_t n=0; inValues.size(); n++)
4570 results[uurRef] = returnRowRef;
4580 results[uurRef] = returnRowRef;
4589 results[uurRef] = returnRowRef;
4596 string rhsval=rightoperand.substr(1, string::npos);
4598 pcrecpp::RE re(rhsval);
4600 if (re.FullMatch(lhs.
str)==
true)
4602 results[uurRef] = returnRowRef;
4609 string rhsval=rightoperand.substr(1, string::npos);
4611 pcrecpp::RE re(rhsval);
4612 rhsval.insert(0,
"^((?!");
4613 rhsval.append(
").)*$");
4615 if (re.FullMatch(lhs.
str)==
true)
4617 results[uurRef] = returnRowRef;
4623 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__, op);
4634 string rhsval=rightoperand.substr(1, string::npos);
4636 if (!lhs.
str.compare(rhsval))
4638 results[uurRef] = returnRowRef;
4645 string rhsval=rightoperand.substr(1, string::npos);
4647 if (lhs.
str.compare(rhsval))
4649 results[uurRef] = returnRowRef;
4659 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
4660 vector<fieldValue_s> fieldValues;
4663 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
4665 for (it = andResults.begin(); it != andResults.end(); it++)
4672 for (
size_t n=0; inValues.size(); n++)
4677 results[uurRef] = returnRowRef;
4689 memcpy(&fieldid, &rightoperand[1],
sizeof(fieldid));
4690 vector<fieldValue_s> fieldValues;
4693 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
4695 for (it = andResults.begin(); it != andResults.end(); it++)
4703 for (
size_t n=0; inValues.size(); n++)
4715 results[uurRef] = returnRowRef;
4725 results[uurRef] = returnRowRef;
4734 results[uurRef] = returnRowRef;
4741 string rhsval=rightoperand.substr(1, string::npos);
4743 pcrecpp::RE re(rhsval);
4745 if (re.FullMatch(lhs.
str)==
true)
4747 results[uurRef] = returnRowRef;
4754 string rhsval=rightoperand.substr(1, string::npos);
4756 pcrecpp::RE re(rhsval);
4757 rhsval.insert(0,
"^((?!");
4758 rhsval.append(
").)*$");
4760 if (re.FullMatch(lhs.
str)==
true)
4762 results[uurRef] = returnRowRef;
4768 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__, op);
4774 fprintf(
logfile,
"anomaly: %i %s %i\n",
4775 tableRef.
fields[fieldid].type, __FILE__, __LINE__);
4784 int64_t reentrypoint,
void *reentrydata,
4786 const vector<string> ¶metersarg)
4795 switch (reentryObject->
results.cmdtype)
4798 if (transactionPtrarg==NULL)
4810 if (transactionPtrarg==NULL)
4822 if (transactionPtrarg==NULL)
4834 if (transactionPtrarg==NULL)
4859 class Ast *nextAstNode=NULL;
4863 if (astNode->
evaluate(&nextAstNode,
this)==
true)
4866 if (nextAstNode==NULL)
4891 astNode=nextAstNode;
4896 if (nextAstNode==NULL)
4903 astNode=nextAstNode;
4917 boost::unordered_map<uuRecord_s, stagedRow_s>::const_iterator it;
4948 for (
size_t n=0; n < numfields; n++)
4956 class Field &fieldRef =
4972 switch (tableRef.
fields[n].type)
5010 fieldValue.
str=astRef.
operand.substr(1, string::npos);
5015 fieldValue.
str=astRef.
operand.substr(1, string::npos);
5020 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__,
5021 tableRef.
fields[n].type);
5065 boost::unordered_map<uuRecord_s, stagedRow_s>::const_iterator it;
5093 boost::unordered_map<uuRecord_s, stagedRow_s>::const_iterator it;
5163 printf(
"%s %i unhandled statement type %i\n", __FILE__, __LINE__,
5185 reentryObject->
results.statementStatus=status;
5187 (*reentryObject.*reentryfptr)(reentrypoint, reentrydata);
5197 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
5204 vector<fieldValue_s> foundFields;
5205 tableRef.
unmakerow((
string *)&returnRowRef.
row, &foundFields);
5206 vector<fieldValue_s> returnFields;
5244 boost::unordered_map<uuRecord_s, returnRow_s>::const_iterator it;
5274 printf(
"%s %i anomaly %li\n", __FILE__, __LINE__, entrypoint);
5319 vector<fieldValue_s> fieldValues;
5322 tableRef.
unmakerow((
string *)&returnRowRef.
row, &fieldValues);
5326 boost::unordered_map<int64_t, class Ast *>::iterator it;
5331 it->second->evaluateAssignment(fieldValues,
this);
5333 class Field &fieldRef = tableRef.
fields[it->first];
5342 switch (fieldRef.
type)
5346 &it->second->operand[1],
5352 &it->second->operand[1],
5359 memcpy(&boolval, &it->second->operand[1],
5374 fieldValue.
str=it->second->operand.substr(1,
5379 fieldValue.
str=it->second->operand.substr(1,
5384 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__,
5385 tableRef.
fields[it->first].type);
5401 vector<fieldValue_s> fieldValues;
5402 tableRef.
unmakerow((
string *)&returnRowRef.
row, &fieldValues);
5404 for (
size_t n=0; n < fieldValues.size(); n++)
5421 lockFieldValue.
fieldVal = fieldValues[n];
5477 vector<fieldValue_s> fieldValues;
5478 tableRef.
unmakerow((
string *)&returnRowRef.
row, &fieldValues);
5480 for (
size_t n=0; n < fieldValues.size(); n++)
5513 printf(
"%s %i anomaly %li\n", __FILE__, __LINE__, entrypoint);
5620 int64_t queryinstance;
5621 memcpy(&queryinstance, &astnode->
operand[1],
sizeof(queryinstance));
5624 boost::unordered_map< uuRecord_s, vector<fieldValue_s> > &selectResultsRef =
5627 switch (selectResultsRef.size())
5636 vector<fieldValue_s> >::const_iterator it;
5637 it = selectResultsRef.begin();
5638 const vector<fieldValue_s> &fieldValuesRef = it->second;
5640 if (fieldValuesRef.size()==1)
5646 astnode->
operand.resize(1+
sizeof(int64_t), (
char)0);
5648 memcpy(&astnode->
operand[1], &fieldValuesRef[0].value.integer,
5653 astnode->
operand.resize(1+
sizeof(int64_t), (
char)0);
5655 memcpy(&astnode->
operand[1], &fieldValuesRef[0].value.uinteger,
5662 if (fieldValuesRef[0].value.boolean==
true)
5674 astnode->
operand.resize(1+
sizeof(
long double), (
char)0);
5676 memcpy(&astnode->
operand[1], &fieldValuesRef[0].value.floating,
5681 astnode->
operand.resize(1+
sizeof(
char), (
char)0);
5683 astnode->
operand[1] = fieldValuesRef[0].value.character;
5688 astnode->
operand.append(fieldValuesRef[0].str);
5693 astnode->
operand.append(fieldValuesRef[0].str);
5697 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__,
5705 printf(
"%s %i too many columns in scalar subquery %lu\n", __FILE__,
5706 __LINE__, fieldValuesRef.size());
5712 printf(
"%s %i too many returned rows in scalar subquery %lu\n", __FILE__,
5713 __LINE__, selectResultsRef.size());
5719 int64_t queryinstance;
5720 memcpy(&queryinstance, &astnode->
operand[1],
sizeof(queryinstance));
5725 boost::unordered_map< uuRecord_s, vector<fieldValue_s> >::iterator it;
5726 boost::unordered_map< uuRecord_s, vector<fieldValue_s> >::iterator it2;
5732 const vector<fieldValue_s> &fieldValues = it->second;
5738 const vector<fieldValue_s> &fieldValues2 = it->second;
5740 if (uurRef1==uurRef2)
5747 for (
size_t n=0; n < numfields; n++)
5751 fieldValues[n], fieldValues2[n])==
false)
5773 int64_t queryinstance;
5774 memcpy(&queryinstance, &astnode->
operand[1],
sizeof(queryinstance));
5778 if (
queries[queryinstance].results.selectResults.size())
5790 int64_t queryinstance;
5791 memcpy(&queryinstance, &astnode->
operand[1],
sizeof(queryinstance));
5794 boost::unordered_map< uuRecord_s, vector<fieldValue_s> >::iterator it;