Dont allow ORIGID and DESTID columns to be the same as each other

This commit is contained in:
Andrew McDonnell 2013-06-29 21:27:27 +09:30
commit 8e9c8747f6

View file

@ -633,6 +633,14 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked)
return -1;
}
// Make sure origid column != destid column
if (strcmp( origid->field_name, destid->field_name)==0) {
fprint_error("Invalid OQGRAPH backing store ('%s'.destid attribute set to same column as origid attribute)", p, options->table_name);
closefrm(edges, 0);
free_table_share(share);
return -1;
}
for (Field **field= edges->field; options->weight && *field; ++field)
{
if (strcmp(options->weight, (*field)->field_name))