Commit ccd2ca68 authored by Andrew McDonnell's avatar Andrew McDonnell

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

parent 5fa61317
...@@ -633,6 +633,14 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked) ...@@ -633,6 +633,14 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked)
return -1; 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) for (Field **field= edges->field; options->weight && *field; ++field)
{ {
if (strcmp(options->weight, (*field)->field_name)) if (strcmp(options->weight, (*field)->field_name))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment