return MR_EXISTS;
}
else if (status == MR_NO_MATCH && tbl == STRINGS_TABLE &&
- (q->type == APPEND || q->type == UPDATE))
+ (q->type == MR_Q_APPEND || q->type == MR_Q_UPDATE))
{
+ if (strlen(name) >= STRINGS_STRING_SIZE)
+ return MR_ARG_TOO_LONG;
id = add_string(name);
- cache_entry(name, STRINGS_TABLE, id);
*(int *)argv[vo->index] = id;
return MR_EXISTS;
}
*c = toupper(*c);
}
}
+ if (!*name)
+ return MR_RESERVED;
sprintf(stmt_buf, "SELECT DISTINCT COUNT(*) FROM %s WHERE %s.%s = '%s'",
table_name[vo->table], table_name[vo->table], namefield, name);
dosql(sqlbuffer);
*c = toupper(*c);
}
}
+ if (!*name)
+ return MR_RESERVED;
namefield = vo->namefield;
idfield = vo->idfield;
id = -1;
* that we're trying to resolve, we should get the value of
* numvalues.[idfield] for the id.
*/
- if (vo->idfield && !strcmp(argv[0], argv[vo->index]))
+ if (vo->idfield && (*(int *)argv[0] == *(int *)argv[vo->index]))
{
set_next_object_id(q->validate->object_id, q->rtable, 0);
name = vo->idfield;
return MR_STRING;
if (status == MR_NO_MATCH)
{
- if (q->type != APPEND && q->type != UPDATE)
+ if (q->type != MR_Q_APPEND && q->type != MR_Q_UPDATE)
return MR_STRING;
+ if (strlen(name) >= STRINGS_STRING_SIZE)
+ return MR_ARG_TOO_LONG;
id = add_string(name);
- cache_entry(name, STRINGS_TABLE, id);
}
else if (status)
return status;
}
- else if (!strcmp(data_type, "none"))
+ else if (!strcmp(data_type, "none") || !strcmp(data_type, "all"))
id = 0;
else
return MR_TYPE;
strcpy(p, "-1");
return MR_EXISTS;
}
- if (!*p)
- return MR_INTEGER;
if (*p == '-')
p++;
+ if (!*p)
+ return MR_INTEGER;
+
for (; *p; p++)
{
if (*p < '0' || *p > '9')