From 3506d3db966f35815595f3700219297bab4dbbcb Mon Sep 17 00:00:00 2001 From: "jonas@perch.ndb.mysql.com" <> Date: Mon, 3 Oct 2005 16:06:07 +0200 Subject: [PATCH 1/2] ndb - fix solaris problem (dont print null) --- ndb/src/mgmsrv/Services.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 8c087c2a3ca..9f7e34f93ef 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -940,7 +940,7 @@ printNodeStatus(OutputStream *output, output->println("node.%d.dynamic_id: %d", nodeId, dynamicId); output->println("node.%d.node_group: %d", nodeId, nodeGroup); output->println("node.%d.connect_count: %d", nodeId, connectCount); - output->println("node.%d.address: %s", nodeId, address); + output->println("node.%d.address: %s", nodeId, address ? address : ""); } } From 062f145bf8f54a4c19e0a5203e148e937bfffdc3 Mon Sep 17 00:00:00 2001 From: "serg@mysql.com" <> Date: Tue, 4 Oct 2005 17:04:20 +0200 Subject: [PATCH 2/2] sql_table.cc, table.cc, table.h: fixed CHECKSUM TABLE to be independent from last - undefined in InnoDB - bits in the null bitmask bug#13710 --- sql/sql_table.cc | 14 +++++++++----- sql/table.cc | 1 + sql/table.h | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index dba4168343a..3f0dffea110 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4100,6 +4100,7 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt) { /* calculating table's checksum */ ha_checksum crc= 0; + uchar null_mask=256 - (1 << t->s->last_null_bit_pos); /* InnoDB must be told explicitly to retrieve all columns, because this function does not set field->query_id in the columns to the @@ -4120,9 +4121,12 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt) continue; break; } - if (t->record[0] != (byte*) t->field[0]->ptr) - row_crc= my_checksum(row_crc, t->record[0], - ((byte*) t->field[0]->ptr) - t->record[0]); + if (t->s->null_bytes) + { + /* fix undefined null bits */ + t->record[0][t->s->null_bytes-1] |= null_mask; + row_crc= my_checksum(row_crc, t->record[0], t->s->null_bytes); + } for (uint i= 0; i < t->s->fields; i++ ) { @@ -4166,9 +4170,9 @@ static bool check_engine(THD *thd, const char *table_name, enum db_type *new_engine) { enum db_type req_engine= *new_engine; - bool no_substitution= + bool no_substitution= test(thd->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION); - if ((*new_engine= + if ((*new_engine= ha_checktype(thd, req_engine, no_substitution, 1)) == DB_TYPE_UNKNOWN) return TRUE; diff --git a/sql/table.cc b/sql/table.cc index 982d5e7ddc9..b605333e011 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -874,6 +874,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, /* the correct null_bytes can now be set, since bitfields have been taken into account */ share->null_bytes= null_pos - (uchar*) outparam->null_flags + (null_bit_pos + 7) / 8; + share->last_null_bit_pos= null_bit_pos; /* The table struct is now initialized; Open the table */ error=2; diff --git a/sql/table.h b/sql/table.h index b01d774bf10..44fe69e9397 100644 --- a/sql/table.h +++ b/sql/table.h @@ -141,7 +141,7 @@ typedef struct st_table_share enum tmp_table_type tmp_table; uint blob_ptr_size; /* 4 or 8 */ - uint null_bytes; + uint null_bytes, last_null_bit_pos; uint key_length; /* Length of table_cache_key */ uint fields; /* Number of fields */ uint rec_buff_length; /* Size of table->record[] buffer */