[Commits] Rev 3531: Fix of MDEV-565: Server crashes in ha_cassandra::write_row on inserting NULL into a dynamic column in file:///home/bell/maria/bzr/work-maria-5.5-cassandra/

sanja at montyprogram.com sanja at montyprogram.com
Sat Sep 29 16:01:26 EEST 2012


At file:///home/bell/maria/bzr/work-maria-5.5-cassandra/

------------------------------------------------------------
revno: 3531
revision-id: sanja at montyprogram.com-20120929130124-3ogzmjv0eekfjoml
parent: psergey at askmonty.org-20120928112959-jdbhsquwl15dmlab
committer: sanja at montyprogram.com
branch nick: work-maria-5.5-cassandra
timestamp: Sat 2012-09-29 16:01:24 +0300
message:
  Fix of MDEV-565: Server crashes in ha_cassandra::write_row on inserting NULL into a dynamic column
  
  Fixed incorrect initialization of variable which caused freeing memory by random address in case of error.
-------------- next part --------------
=== modified file 'mysql-test/r/cassandra.result'
--- a/mysql-test/r/cassandra.result	2012-09-28 12:27:16 +0000
+++ b/mysql-test/r/cassandra.result	2012-09-29 13:01:24 +0000
@@ -546,3 +546,12 @@ insert into t1 values (1,'9b5658dc-f32f-
 ERROR HY000: Encountered illegal format of dynamic column string
 delete from t1;
 DROP TABLE t1;
+#
+# MDEV-565: Server crashes in ha_cassandra::write_row on
+# inserting NULL into a dynamic column
+#
+CREATE TABLE t1 (rowkey int PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes) 
+ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cfd2';
+insert into t1 values (1, NULL);
+delete from t1;
+DROP TABLE t1;

=== modified file 'mysql-test/t/cassandra.test'
--- a/mysql-test/t/cassandra.test	2012-09-28 12:27:16 +0000
+++ b/mysql-test/t/cassandra.test	2012-09-29 13:01:24 +0000
@@ -634,6 +634,16 @@ insert into t1 values (1,'9b5658dc-f32f-
 delete from t1;
 DROP TABLE t1;
 
+--echo #
+--echo # MDEV-565: Server crashes in ha_cassandra::write_row on
+--echo # inserting NULL into a dynamic column
+--echo #
+CREATE TABLE t1 (rowkey int PRIMARY KEY, dyn blob DYNAMIC_COLUMN_STORAGE=yes) 
+ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cfd2';
+insert into t1 values (1, NULL);
+delete from t1;
+DROP TABLE t1;
+
 
 ############################################################################
 ## Cassandra cleanup

=== modified file 'storage/cassandra/CMakeLists.txt'
--- a/storage/cassandra/CMakeLists.txt	2012-09-28 10:02:59 +0000
+++ b/storage/cassandra/CMakeLists.txt	2012-09-29 13:01:24 +0000
@@ -12,6 +12,8 @@ SET(cassandra_sources
      gen-cpp/Cassandra.h)
 
 #INCLUDE_DIRECTORIES(BEFORE ${Boost_INCLUDE_DIRS})
+
+#INCLUDE_DIRECTORIES(AFTER /usr/local/include/thrift)
 INCLUDE_DIRECTORIES(AFTER /home/buildbot/build/thrift-inst/include/thrift/) 
 
 # 

=== modified file 'storage/cassandra/ha_cassandra.cc'
--- a/storage/cassandra/ha_cassandra.cc	2012-09-28 10:01:52 +0000
+++ b/storage/cassandra/ha_cassandra.cc	2012-09-29 13:01:24 +0000
@@ -1978,7 +1978,7 @@ int ha_cassandra::write_row(uchar *buf)
     {
       String valcol;
       DYNAMIC_ARRAY vals, names;
-      char *free_names;
+      char *free_names= NULL;
       int rc;
       DBUG_ASSERT(field_converters[i] == NULL);
       if (!(rc= read_dyncol(&vals, &names, &valcol, &free_names)))



More information about the commits mailing list