Permalink
Browse files

Fix bug in system_manager.alter_column_family where default_validatio…

…n_class is ignored
  • Loading branch information...
1 parent 4f8433b commit 8a223f8a21ea41d27a093228b466612ab5a34ac8 @canadianveggie canadianveggie committed May 23, 2012
Showing with 11 additions and 0 deletions.
  1. +1 −0 pycassa/system_manager.py
  2. +10 −0 tests/test_system_manager.py
@@ -467,6 +467,7 @@ def alter_column_family(self, keyspace, column_family,
self._cfdef_assign(merge_shards_chance, cfdef, 'merge_shards_chance')
self._cfdef_assign(comment, cfdef, 'comment')
+ cfdef.default_validation_class = self._qualify_type_class(default_validation_class)
cfdef.replicate_on_write = replicate_on_write
cfdef.key_alias = key_alias
if row_cache_provider:
@@ -63,6 +63,16 @@ def test_alter_column_non_bytes_type(self):
cf = ColumnFamily(pool, 'LongCF')
cf.insert('key', {2: 2})
assert_equal(cf.get('key')[2], 2)
+
+ def test_alter_column_family_default_validation_class(self):
+ sys.create_column_family(TEST_KS, 'AlteredCF', default_validation_class=LONG_TYPE)
+ pool = ConnectionPool(TEST_KS)
+ cf = ColumnFamily(pool, 'AlteredCF')
+ assert_equal(cf.default_validation_class, "LongType")
+
+ sys.alter_column_family(TEST_KS, 'AlteredCF', default_validation_class=UTF8_TYPE)
+ cf = ColumnFamily(pool, 'AlteredCF')
+ assert_equal(cf.default_validation_class, "UTF8Type")
def test_alter_column_super_cf(self):
sys.create_column_family(TEST_KS, 'SuperCF', super=True,

0 comments on commit 8a223f8

Please sign in to comment.