git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Setting tag sliver-openvswitch-2.2.90-1
[sliver-openvswitch.git]
/
ovsdb
/
mutation.c
diff --git
a/ovsdb/mutation.c
b/ovsdb/mutation.c
index
0dcd16f
..
967ad15
100644
(file)
--- a/
ovsdb/mutation.c
+++ b/
ovsdb/mutation.c
@@
-1,4
+1,4
@@
-/* Copyright (c) 2009, 2010, 2011 Nicira, Inc.
+/* Copyright (c) 2009, 2010, 2011
, 2012
Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-95,6
+95,12
@@
ovsdb_mutation_from_json(const struct ovsdb_table_schema *ts,
"No column %s in table %s.",
column_name, ts->name);
}
"No column %s in table %s.",
column_name, ts->name);
}
+ if (!m->column->mutable) {
+ return ovsdb_syntax_error(json, "constraint violation",
+ "Cannot mutate immutable column %s in "
+ "table %s.", column_name, ts->name);
+ }
+
ovsdb_type_clone(&m->type, &m->column->type);
mutator_name = json_string(array->elems[1]);
ovsdb_type_clone(&m->type, &m->column->type);
mutator_name = json_string(array->elems[1]);
@@
-144,7
+150,7
@@
ovsdb_mutation_from_json(const struct ovsdb_table_schema *ts,
break;
default:
break;
default:
- NOT_REACHED();
+
OVS_
NOT_REACHED();
}
exit:
}
exit:
@@
-300,7
+306,7
@@
mutate_scalar(const struct ovsdb_type *dst_type, struct ovsdb_datum *dst,
}
}
} else {
}
}
} else {
- NOT_REACHED();
+
OVS_
NOT_REACHED();
}
for (i = 0; i < dst->n; i++) {
}
for (i = 0; i < dst->n; i++) {
@@
-381,7
+387,7
@@
ovsdb_mutation_set_execute(struct ovsdb_row *row,
break;
default:
break;
default:
- NOT_REACHED();
+
OVS_
NOT_REACHED();
}
if (error) {
return error;
}
if (error) {
return error;