[Commits] Rev 3522: - Update testcases in file:///data0/psergey/dev2/5.5-cassandra-r01/

Sergey Petrunya psergey at askmonty.org
Wed Sep 26 18:02:14 EEST 2012


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

------------------------------------------------------------
revno: 3522
revision-id: psergey at askmonty.org-20120926150212-6v3iffny5o0exffu
parent: psergey at askmonty.org-20120926105745-al08m06369s9bjx2
committer: Sergey Petrunya <psergey at askmonty.org>
branch nick: 5.5-cassandra-r01
timestamp: Wed 2012-09-26 19:02:12 +0400
message:
  - Update testcases
  - Better error messages.
=== modified file 'mysql-test/r/cassandra.result'
--- a/mysql-test/r/cassandra.result	2012-09-25 12:20:19 +0000
+++ b/mysql-test/r/cassandra.result	2012-09-26 15:02:12 +0000
@@ -369,3 +369,15 @@
 1	1346189025000
 10	1346189026000
 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;

=== modified file 'mysql-test/t/cassandra.test'
--- a/mysql-test/t/cassandra.test	2012-09-26 10:57:45 +0000
+++ b/mysql-test/t/cassandra.test	2012-09-26 15:02:12 +0000
@@ -472,8 +472,8 @@
 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';
+#--error ER_INTERNAL_ERROR
+#alter table t2 column_family='cf9';
 
 drop table t2;
 
@@ -490,6 +490,8 @@
 eval select ($c2 - $c1) as 'Writes made during ALTER TABLE';
 --enable_query_log
 
+drop table t2;
+
 ############################################################################
 ## Cassandra cleanup
 ############################################################################

=== modified file 'storage/cassandra/ha_cassandra.cc'
--- a/storage/cassandra/ha_cassandra.cc	2012-09-26 10:57:45 +0000
+++ b/storage/cassandra/ha_cassandra.cc	2012-09-26 15:02:12 +0000
@@ -992,7 +992,20 @@
 
   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());
     return true;
   }



More information about the commits mailing list