Below is the list of changes that have just been committed into a local
5.1 repository of knielsen. When knielsen 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.2211 06/06/20 23:17:38 knielsen@stripped +1 -0
BUG#20549: Fix missing memory initialization.
Some values were not initialized:
- NDB binlog thread thd->variables.pseudo_thread_id.
- Table null bytes.
- Field bytes for columns with NULL values.
sql/ha_ndbcluster_binlog.cc
1.66 06/06/20 23:17:30 knielsen@stripped +10 -1
BUG#20549: Fix missing memory initialization.
# 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: knielsen
# Host: rt.int.sifira.dk
# Root: /usr/local/mysql/mysql-5.1tmp
--- 1.65/sql/ha_ndbcluster_binlog.cc 2006-06-14 01:20:29 +02:00
+++ 1.66/sql/ha_ndbcluster_binlog.cc 2006-06-20 23:17:30 +02:00
@@ -313,6 +313,9 @@
// allocate memory on ndb share so it can be reused after online alter table
share->record[0]= (byte*) alloc_root(&share->mem_root, table->s->rec_buff_length);
share->record[1]= (byte*) alloc_root(&share->mem_root, table->s->rec_buff_length);
+ // Initialize to default values.
+ memcpy(share->record[0], table->s->default_values, table->s->reclength);
+ memcpy(share->record[1], table->s->default_values, table->s->reclength);
}
{
my_ptrdiff_t row_offset= share->record[0] - table->record[0];
@@ -3275,6 +3278,13 @@
thd= new THD; /* note that contructor of THD uses DBUG_ */
THD_CHECK_SENTRY(thd);
+ /* We need to set thd->thread_id before thd->store_globals, or it will
+ set an invalid value for thd->variables.pseudo_thread_id.
+ */
+ pthread_mutex_lock(&LOCK_thread_count);
+ thd->thread_id= thread_id++;
+ pthread_mutex_unlock(&LOCK_thread_count);
+
thd->thread_stack= (char*) &thd; /* remember where our stack is */
if (thd->store_globals())
{
@@ -3307,7 +3317,6 @@
pthread_detach_this_thread();
thd->real_id= pthread_self();
pthread_mutex_lock(&LOCK_thread_count);
- thd->thread_id= thread_id++;
threads.append(thd);
pthread_mutex_unlock(&LOCK_thread_count);
thd->lex->start_transaction_opt= 0;
| Thread |
|---|
| • bk commit into 5.1 tree (knielsen:1.2211) BUG#20549 | knielsen | 20 Jun |