X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ovsdb%2Fmutation.c;h=5fd983a4badfa634707db5017761a9c6eb158710;hb=b0fb94a346e52f36aeef238dd5f9bef9a10c14ef;hp=0dcd16fec9b54b38d04be7439fcdac887f918752;hpb=1e3f34c7693bcabae8e443ac1b246680ef9b60e2;p=sliver-openvswitch.git diff --git a/ovsdb/mutation.c b/ovsdb/mutation.c index 0dcd16fec..5fd983a4b 100644 --- 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. @@ -95,6 +95,12 @@ ovsdb_mutation_from_json(const struct ovsdb_table_schema *ts, "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]);