MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:pekka Date:March 9 2006 4:16pm
Subject:bk commit into 5.1 tree (pekka:1.2159) BUG#18075
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of pekka. When pekka does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2159 06/03/09 17:16:04 pekka@stripped +4 -0
  ndb - bug#18067 bug#18075 closes these bugs

  storage/ndb/src/ndbapi/NdbBlob.cpp
    1.39 06/03/09 17:07:08 pekka@stripped +12 -0
    table PK in blob part key is fixed-sized so keep extra bytes zero if varsize PK

  storage/ndb/include/ndbapi/NdbBlob.hpp
    1.21 06/03/09 17:07:08 pekka@stripped +1 -0
    table PK in blob part key is fixed-sized so keep extra bytes zero if varsize PK

  mysql-test/t/rpl_ndb_blob.test
    1.2 06/03/09 17:05:09 pekka@stripped +54 -5
    test case for varsize PK + blob

  mysql-test/r/rpl_ndb_blob.result
    1.3 06/03/09 17:05:09 pekka@stripped +55 -46
    test case for varsize PK + blob

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	pekka
# Host:	orca.ndb.mysql.com
# Root:	/space/pekka/ndb/version/my51

--- 1.2/mysql-test/r/rpl_ndb_blob.result	2006-03-01 13:31:13 +01:00
+++ 1.3/mysql-test/r/rpl_ndb_blob.result	2006-03-09 17:05:09 +01:00
@@ -78,49 +78,58 @@
 S	8	e139adcb7b2974ee7ff227fd405709e5cb7c896c	108	ba8073b0e1a281d4111bd2d82c7722b01574c00b	NULL
 S	9	1fc5168fe4be566b17b658d94e7813f0b5032cdb	NULL	NULL	NULL
 drop table t1;
-show binlog events;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	4	Format_desc	1	102	Server ver: VERSION, Binlog ver: 4
-master-bin.000001	102	Query	1	239	use `test`; create table t1 (
-a int not null primary key,
-b text not null
-) engine=ndb
-master-bin.000001	239	Query	1	303	BEGIN
-master-bin.000001	303	Table_map	1	53	cluster.apply_status
-master-bin.000001	356	Write_rows	1	95	
-master-bin.000001	398	Table_map	1	135	test.t1
-master-bin.000001	438	Write_rows	1	806	
-master-bin.000001	1109	Write_rows	1	9841	
-master-bin.000001	10144	Query	1	10209	COMMIT
-master-bin.000001	10209	Query	1	10273	BEGIN
-master-bin.000001	10273	Table_map	1	53	cluster.apply_status
-master-bin.000001	10326	Write_rows	1	95	
-master-bin.000001	10368	Query	1	10433	COMMIT
-master-bin.000001	10433	Query	1	10509	use `test`; drop table t1
-master-bin.000001	10509	Query	1	10684	use `test`; create table t1 (
-a int not null primary key,
-b text not null,
-c int,
-d longblob,
-e tinyblob
-) engine=ndbcluster
-master-bin.000001	10684	Query	1	10748	BEGIN
-master-bin.000001	10748	Table_map	1	53	cluster.apply_status
-master-bin.000001	10801	Write_rows	1	95	
-master-bin.000001	10843	Table_map	1	138	test.t1
-master-bin.000001	10886	Write_rows	1	48922	
-master-bin.000001	59670	Write_rows	1	124424	
-master-bin.000001	135172	Write_rows	1	124530	
-master-bin.000001	135278	Write_rows	1	205949	
-master-bin.000001	216697	Write_rows	1	224233	
-master-bin.000001	234981	Write_rows	1	227511	
-master-bin.000001	238259	Write_rows	1	242379	
-master-bin.000001	253127	Write_rows	1	254075	
-master-bin.000001	264823	Write_rows	1	304323	
-master-bin.000001	315071	Write_rows	1	330415	
-master-bin.000001	341163	Query	1	341228	COMMIT
-master-bin.000001	341228	Query	1	341292	BEGIN
-master-bin.000001	341292	Table_map	1	53	cluster.apply_status
-master-bin.000001	341345	Write_rows	1	95	
-master-bin.000001	341387	Query	1	341452	COMMIT
-master-bin.000001	341452	Query	1	341528	use `test`; drop table t1
+CREATE TABLE IF NOT EXISTS t1 (
+db VARBINARY(63) NOT NULL,
+name VARBINARY(63) NOT NULL,
+slock BINARY(32) NOT NULL,
+query BLOB NOT NULL,
+node_id INT UNSIGNED NOT NULL,
+epoch BIGINT UNSIGNED NOT NULL,
+id INT UNSIGNED NOT NULL,
+version INT UNSIGNED NOT NULL,
+type INT UNSIGNED NOT NULL,
+PRIMARY KEY USING HASH (db,name))
+ENGINE=NDB;
+insert into t1 values ('test','t1',
+'abc',repeat(@s0,10),  11,12,13,14,15);
+insert into t1 values ('test','t2',
+'def',repeat(@s1,100), 21,22,23,24,25);
+insert into t1 values ('test','t3',
+'ghi',repeat(@s2,1000),31,32,33,34,35);
+insert into t1 values ('testtttttttttt','t1',
+'abc',repeat(@s0,10),  11,12,13,14,15);
+insert into t1 values ('testttttttttttt','t1',
+'def',repeat(@s1,100), 21,22,23,24,25);
+insert into t1 values ('testtttttttttttt','t1',
+'ghi',repeat(@s2,1000),31,32,33,34,35);
+insert into t1 values ('t','t11111111111',
+'abc',repeat(@s0,10),  11,12,13,14,15);
+insert into t1 values ('t','t111111111111',
+'def',repeat(@s1,100), 21,22,23,24,25);
+insert into t1 values ('t','t1111111111111',
+'ghi',repeat(@s2,1000),31,32,33,34,35);
+select 'M', db, name, sha1(query), node_id, epoch, id, version, type
+from t1 order by db, name;
+M	db	name	sha1(query)	node_id	epoch	id	version	type
+M	t	t11111111111	8fc937d303ee7e4795c0b964d4066cedd6d74cfd	11	12	13	14	15
+M	t	t111111111111	a5229e9f8977bc99afc3b3627c56f083e97e01bd	21	22	23	24	25
+M	t	t1111111111111	0820e6ad3eeb06ea60e5e04d0bfe36f286b91098	31	32	33	34	35
+M	test	t1	8fc937d303ee7e4795c0b964d4066cedd6d74cfd	11	12	13	14	15
+M	test	t2	a5229e9f8977bc99afc3b3627c56f083e97e01bd	21	22	23	24	25
+M	test	t3	0820e6ad3eeb06ea60e5e04d0bfe36f286b91098	31	32	33	34	35
+M	testtttttttttt	t1	8fc937d303ee7e4795c0b964d4066cedd6d74cfd	11	12	13	14	15
+M	testttttttttttt	t1	a5229e9f8977bc99afc3b3627c56f083e97e01bd	21	22	23	24	25
+M	testtttttttttttt	t1	0820e6ad3eeb06ea60e5e04d0bfe36f286b91098	31	32	33	34	35
+select 'S', db, name, sha1(query), node_id, epoch, id, version, type
+from t1 order by db, name;
+S	db	name	sha1(query)	node_id	epoch	id	version	type
+S	t	t11111111111	8fc937d303ee7e4795c0b964d4066cedd6d74cfd	11	12	13	14	15
+S	t	t111111111111	a5229e9f8977bc99afc3b3627c56f083e97e01bd	21	22	23	24	25
+S	t	t1111111111111	0820e6ad3eeb06ea60e5e04d0bfe36f286b91098	31	32	33	34	35
+S	test	t1	8fc937d303ee7e4795c0b964d4066cedd6d74cfd	11	12	13	14	15
+S	test	t2	a5229e9f8977bc99afc3b3627c56f083e97e01bd	21	22	23	24	25
+S	test	t3	0820e6ad3eeb06ea60e5e04d0bfe36f286b91098	31	32	33	34	35
+S	testtttttttttt	t1	8fc937d303ee7e4795c0b964d4066cedd6d74cfd	11	12	13	14	15
+S	testttttttttttt	t1	a5229e9f8977bc99afc3b3627c56f083e97e01bd	21	22	23	24	25
+S	testtttttttttttt	t1	0820e6ad3eeb06ea60e5e04d0bfe36f286b91098	31	32	33	34	35
+drop table t1;

--- 1.1/mysql-test/t/rpl_ndb_blob.test	2006-02-05 18:53:46 +01:00
+++ 1.2/mysql-test/t/rpl_ndb_blob.test	2006-03-09 17:05:09 +01:00
@@ -83,11 +83,60 @@
 drop table t1;
 --sync_slave_with_master
 
+# table with varsize key (future cluster/schema)
+
+# sql/ha_ndbcluster_binlog.cc
+--connection master
+CREATE TABLE IF NOT EXISTS t1 (
+  db VARBINARY(63) NOT NULL,
+  name VARBINARY(63) NOT NULL,
+  slock BINARY(32) NOT NULL,
+  query BLOB NOT NULL,
+  node_id INT UNSIGNED NOT NULL,
+  epoch BIGINT UNSIGNED NOT NULL,
+  id INT UNSIGNED NOT NULL,
+  version INT UNSIGNED NOT NULL,
+  type INT UNSIGNED NOT NULL,
+  PRIMARY KEY USING HASH (db,name))
+ENGINE=NDB;
+
+insert into t1 values ('test','t1',
+  'abc',repeat(@s0,10),  11,12,13,14,15);
+insert into t1 values ('test','t2',
+  'def',repeat(@s1,100), 21,22,23,24,25);
+insert into t1 values ('test','t3',
+  'ghi',repeat(@s2,1000),31,32,33,34,35);
+insert into t1 values ('testtttttttttt','t1',
+  'abc',repeat(@s0,10),  11,12,13,14,15);
+insert into t1 values ('testttttttttttt','t1',
+  'def',repeat(@s1,100), 21,22,23,24,25);
+insert into t1 values ('testtttttttttttt','t1',
+  'ghi',repeat(@s2,1000),31,32,33,34,35);
+insert into t1 values ('t','t11111111111',
+  'abc',repeat(@s0,10),  11,12,13,14,15);
+insert into t1 values ('t','t111111111111',
+  'def',repeat(@s1,100), 21,22,23,24,25);
+insert into t1 values ('t','t1111111111111',
+  'ghi',repeat(@s2,1000),31,32,33,34,35);
+
+select 'M', db, name, sha1(query), node_id, epoch, id, version, type
+from t1 order by db, name;
+
+--sync_slave_with_master
+--sleep 5
+--connection slave
+select 'S', db, name, sha1(query), node_id, epoch, id, version, type
+from t1 order by db, name;
+
+--connection master
+drop table t1;
+--sync_slave_with_master
+
 #
-# view the binlog
+# view the binlog - not deterministic (mats)
 #
 
---connection master
-let $VERSION=`select version()`;
---replace_result $VERSION VERSION
-show binlog events;
+#--connection master
+#let $VERSION=`select version()`;
+#--replace_result $VERSION VERSION
+#show binlog events;

--- 1.20/storage/ndb/include/ndbapi/NdbBlob.hpp	2006-03-09 13:26:48 +01:00
+++ 1.21/storage/ndb/include/ndbapi/NdbBlob.hpp	2006-03-09 17:07:08 +01:00
@@ -288,6 +288,7 @@
     Buf();
     ~Buf();
     void alloc(unsigned n);
+    void zerorest();
     void copyfrom(const Buf& src);
   };
   Buf theKeyBuf;

--- 1.38/storage/ndb/src/ndbapi/NdbBlob.cpp	2006-03-09 13:26:48 +01:00
+++ 1.39/storage/ndb/src/ndbapi/NdbBlob.cpp	2006-03-09 17:07:08 +01:00
@@ -308,6 +308,13 @@
 }
 
 void
+NdbBlob::Buf::zerorest()
+{
+  assert(size <= maxsize);
+  memset(data + size, 0, maxsize - size);
+}
+
+void
 NdbBlob::Buf::copyfrom(const NdbBlob::Buf& src)
 {
   size = src.size;
@@ -441,6 +448,7 @@
   assert(4 * pos == srcBuf.size);
   assert(4 * pack_pos <= thePackKeyBuf.maxsize);
   thePackKeyBuf.size = 4 * pack_pos;
+  thePackKeyBuf.zerorest();
   DBUG_RETURN(0);
 }
 
@@ -1316,6 +1324,7 @@
         DBUG_RETURN(-1);
       }
       thePackKeyBuf.size = 4 * size;
+      thePackKeyBuf.zerorest();
       if (unpackKeyValue(theTable, theKeyBuf) == -1)
         DBUG_RETURN(-1);
     }
@@ -1328,6 +1337,7 @@
         DBUG_RETURN(-1);
       }
       thePackKeyBuf.size = 4 * size;
+      thePackKeyBuf.zerorest();
       if (unpackKeyValue(theAccessTable, theAccessKeyBuf) == -1)
         DBUG_RETURN(-1);
     }
@@ -1634,6 +1644,7 @@
       // copy key from first blob
       theKeyBuf.copyfrom(tFirstBlob->theKeyBuf);
       thePackKeyBuf.copyfrom(tFirstBlob->thePackKeyBuf);
+      thePackKeyBuf.zerorest();
     }
   }
   if (isReadOp()) {
@@ -1795,6 +1806,7 @@
       DBUG_RETURN(-1);
     }
     thePackKeyBuf.size = 4 * size;
+    thePackKeyBuf.zerorest();
     if (unpackKeyValue(theTable, theKeyBuf) == -1)
       DBUG_RETURN(-1);
   }
Thread
bk commit into 5.1 tree (pekka:1.2159) BUG#18075pekka9 Mar