Commit 0362968b authored by Sergey Petrunya's avatar Sergey Petrunya

Cassandra SE:

- Add a test for ALTER TABLE
parent 344c0ea4
...@@ -78,6 +78,8 @@ insert into cf11 (rowkey, decimal_col) values ('val_0.5', 0.5); ...@@ -78,6 +78,8 @@ insert into cf11 (rowkey, decimal_col) values ('val_0.5', 0.5);
insert into cf11 (rowkey, decimal_col) values ('val_1.5', 1.5); insert into cf11 (rowkey, decimal_col) values ('val_1.5', 1.5);
insert into cf11 (rowkey, decimal_col) values ('val_1234', 1234); insert into cf11 (rowkey, decimal_col) values ('val_1234', 1234);
create columnfamily cf12 (rowkey varchar primary key, decimal_col decimal);
EOF EOF
--error 0,1,2 --error 0,1,2
--system cqlsh -3 -f $MYSQLTEST_VARDIR/cassandra_test_init.cql --system cqlsh -3 -f $MYSQLTEST_VARDIR/cassandra_test_init.cql
...@@ -464,6 +466,30 @@ select * from t2; ...@@ -464,6 +466,30 @@ select * from t2;
drop table t2; 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 ## Cassandra cleanup
############################################################################ ############################################################################
......
...@@ -594,8 +594,8 @@ bool Cassandra_se_impl::retryable_remove_row() ...@@ -594,8 +594,8 @@ bool Cassandra_se_impl::retryable_remove_row()
} }
/* /*
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) bool Cassandra_se_impl::try_operation(retryable_func_t func_to_call)
{ {
......
...@@ -1676,9 +1676,8 @@ int ha_cassandra::delete_table(const char *name) ...@@ -1676,9 +1676,8 @@ int ha_cassandra::delete_table(const char *name)
bool ha_cassandra::check_if_incompatible_data(HA_CREATE_INFO *info, bool ha_cassandra::check_if_incompatible_data(HA_CREATE_INFO *info,
uint table_changes) uint table_changes)
{ {
//ha_table_option_struct *param_old, *param_new;
DBUG_ENTER("ha_cassandra::check_if_incompatible_data"); DBUG_ENTER("ha_cassandra::check_if_incompatible_data");
/* Checked, we intend to have this empty for Cassandra SE. */
DBUG_RETURN(COMPATIBLE_DATA_YES); DBUG_RETURN(COMPATIBLE_DATA_YES);
} }
......
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