Queries which use the 'in' keyword to match array entries doesn't work with strings, it only finds the first string. I'll attach a file which demos the problem. I'm using FastDB 3.67.
Demo Code
I think I found the fix. In database.cpp, change 'base' to 'p' in the strcmp of searchArrayOfString():
inline void searchArrayOfString(dbSynthesizedAttribute& sattr, dbSynthesizedAttribute& sattr2) { dbVarying *p = (dbVarying*)sattr2.array.base; int n = sattr2.array.size; char* str = sattr.array.base; char* base = (char*)sattr2.base; while (--n >= 0) { if (strcmp(base + p->offs, str) == 0) { sattr.bvalue = true; return; } p += 1; } sattr.bvalue = false; }
inline void searchArrayOfString(dbSynthesizedAttribute& sattr, dbSynthesizedAttribute& sattr2) { dbVarying *p = (dbVarying*)sattr2.array.base; int n = sattr2.array.size; char* str = sattr.array.base; char* base = (char*)sattr2.base; while (--n >= 0) { if (strcmp(p+ p->offs, str) == 0) { sattr.bvalue = true; return; } p += 1; } sattr.bvalue = false; }
Fixed in SVN 48.
Log in to post a comment.
Demo Code
I think I found the fix. In database.cpp, change 'base' to 'p' in the strcmp of searchArrayOfString():
inline void searchArrayOfString(dbSynthesizedAttribute& sattr,
dbSynthesizedAttribute& sattr2)
{
dbVarying *p = (dbVarying*)sattr2.array.base;
int n = sattr2.array.size;
char* str = sattr.array.base;
char* base = (char*)sattr2.base;
while (--n >= 0) {
if (strcmp(base + p->offs, str) == 0) {
sattr.bvalue = true;
return;
}
p += 1;
}
sattr.bvalue = false;
}
inline void searchArrayOfString(dbSynthesizedAttribute& sattr,
dbSynthesizedAttribute& sattr2)
{
dbVarying *p = (dbVarying*)sattr2.array.base;
int n = sattr2.array.size;
char* str = sattr.array.base;
char* base = (char*)sattr2.base;
while (--n >= 0) {
if (strcmp(p+ p->offs, str) == 0) {
sattr.bvalue = true;
return;
}
p += 1;
}
sattr.bvalue = false;
}
Fixed in SVN 48.