[Commits] Rev 3521: Cassandra SE: in file:///data0/psergey/dev2/5.5-cassandra-r01/

Sergey Petrunya psergey at askmonty.org
Wed Sep 26 13:57:45 EEST 2012


At file:///data0/psergey/dev2/5.5-cassandra-r01/

------------------------------------------------------------
revno: 3521
revision-id: psergey at askmonty.org-20120926105745-al08m06369s9bjx2
parent: psergey at askmonty.org-20120926101303-7jtpgv0wmnp7b3lb
committer: Sergey Petrunya <psergey at askmonty.org>
branch nick: 5.5-cassandra-r01
timestamp: Wed 2012-09-26 14:57:45 +0400
message:
  Cassandra SE:
  - Add a test for ALTER TABLE
=== modified file 'mysql-test/t/cassandra.test'
--- a/mysql-test/t/cassandra.test	2012-09-25 12:20:19 +0000
+++ b/mysql-test/t/cassandra.test	2012-09-26 10:57:45 +0000
@@ -78,6 +78,8 @@
 insert into cf11 (rowkey, decimal_col) values ('val_1.5', 1.5);
 insert into cf11 (rowkey, decimal_col) values ('val_1234', 1234);
 
+create columnfamily cf12 (rowkey varchar primary key, decimal_col decimal);
+
 EOF
 --error 0,1,2
 --system cqlsh -3 -f $MYSQLTEST_VARDIR/cassandra_test_init.cql
@@ -464,6 +466,30 @@
 
 drop table t2;
 
+--echo #
+--echo # Check whether changing parameters with ALTER TABLE works.
+--echo #
+CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, decimal_col varbinary(32)) ENGINE=CASSANDRA
+  thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf11';
+
+--error ER_INTERNAL_ERROR
+alter table t2 column_family='cf9';
+
+drop table t2;
+
+CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, decimal_col varbinary(32)) ENGINE=CASSANDRA
+  thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf11';
+
+let $c1= `select variable_value from information_schema.global_status 
+          where variable_name like 'cassandra_row_inserts'`;
+alter table t2 column_family='cf12';
+let $c2= `select variable_value from information_schema.global_status 
+          where variable_name like 'cassandra_row_inserts'`;
+
+--disable_query_log
+eval select ($c2 - $c1) as 'Writes made during ALTER TABLE';
+--enable_query_log
+
 ############################################################################
 ## Cassandra cleanup
 ############################################################################

=== modified file 'storage/cassandra/cassandra_se.cc'
--- a/storage/cassandra/cassandra_se.cc	2012-09-26 10:13:03 +0000
+++ b/storage/cassandra/cassandra_se.cc	2012-09-26 10:57:45 +0000
@@ -594,8 +594,8 @@
 }
 
 /*
-  This function will try a Cassandra operation, and handle errors.
-
+  Try calling a function, catching possible Cassandra errors, and re-trying
+   for "transient" errors.
 */
 bool Cassandra_se_impl::try_operation(retryable_func_t func_to_call)
 {

=== modified file 'storage/cassandra/ha_cassandra.cc'
--- a/storage/cassandra/ha_cassandra.cc	2012-09-26 10:13:03 +0000
+++ b/storage/cassandra/ha_cassandra.cc	2012-09-26 10:57:45 +0000
@@ -1676,9 +1676,8 @@
 bool ha_cassandra::check_if_incompatible_data(HA_CREATE_INFO *info,
                                             uint table_changes)
 {
-  //ha_table_option_struct *param_old, *param_new;
   DBUG_ENTER("ha_cassandra::check_if_incompatible_data");
-
+  /* Checked, we intend to have this empty for Cassandra SE. */
   DBUG_RETURN(COMPATIBLE_DATA_YES);
 }
 



More information about the commits mailing list