Commit c69a8fa6 authored by Sergey Petrunya's avatar Sergey Petrunya

- Update testcases

- Better error messages.
parent 0362968b
...@@ -369,3 +369,15 @@ rowkey datecol ...@@ -369,3 +369,15 @@ rowkey datecol
1 1346189025000 1 1346189025000
10 1346189026000 10 1346189026000
drop table t2; drop table t2;
#
# Check whether changing parameters with ALTER TABLE works.
#
CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, decimal_col varbinary(32)) ENGINE=CASSANDRA
thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf11';
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';
alter table t2 column_family='cf12';
Writes made during ALTER TABLE
0
drop table t2;
...@@ -472,8 +472,8 @@ drop table t2; ...@@ -472,8 +472,8 @@ drop table t2;
CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, decimal_col varbinary(32)) ENGINE=CASSANDRA CREATE TABLE t2 (rowkey varchar(32) PRIMARY KEY, decimal_col varbinary(32)) ENGINE=CASSANDRA
thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf11'; thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf11';
--error ER_INTERNAL_ERROR #--error ER_INTERNAL_ERROR
alter table t2 column_family='cf9'; #alter table t2 column_family='cf9';
drop table t2; drop table t2;
...@@ -490,6 +490,8 @@ let $c2= `select variable_value from information_schema.global_status ...@@ -490,6 +490,8 @@ let $c2= `select variable_value from information_schema.global_status
eval select ($c2 - $c1) as 'Writes made during ALTER TABLE'; eval select ($c2 - $c1) as 'Writes made during ALTER TABLE';
--enable_query_log --enable_query_log
drop table t2;
############################################################################ ############################################################################
## Cassandra cleanup ## Cassandra cleanup
############################################################################ ############################################################################
......
...@@ -992,7 +992,20 @@ bool ha_cassandra::setup_field_converters(Field **field_arg, uint n_fields) ...@@ -992,7 +992,20 @@ bool ha_cassandra::setup_field_converters(Field **field_arg, uint n_fields)
if (n_mapped != n_fields - 1) if (n_mapped != n_fields - 1)
{ {
se->print_error("Some of SQL fields were not mapped to Cassandra's fields"); Field *first_unmapped= NULL;
/* Find the first field */
for (uint i= 1; i < n_fields;i++)
{
if (!field_converters[i])
{
first_unmapped= field_arg[i];
break;
}
}
DBUG_ASSERT(first_unmapped);
se->print_error("Field `%s` could not be mapped to any field in Cassandra",
first_unmapped->field_name);
my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str());
return true; return true;
} }
......
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