Commit 1a392bf6 authored by unknown's avatar unknown

After merge fixes

Fixed test for row based replication


mysql-test/mysql-test-run.pl:
  After merge fix
mysql-test/r/maria.result:
  Fixed test for row based replication
mysql-test/t/maria.test:
  Fixed test for row based replication
storage/maria/ha_maria.cc:
  After merge fix
storage/maria/ma_blockrec.c:
  Better to clear whole page, as 'length' may be bigger than what we need.
storage/maria/ma_loghandler.c:
  Fix compiler warning
  Removed access to not initialized memory
storage/maria/ma_open.c:
  Remove wrong (not needed) test
parent 5bef77a3
...@@ -1238,19 +1238,6 @@ sub command_line_setup () { ...@@ -1238,19 +1238,6 @@ sub command_line_setup () {
$path_ndb_testrun_log= "$opt_vardir/log/ndb_testrun.log"; $path_ndb_testrun_log= "$opt_vardir/log/ndb_testrun.log";
$path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/"; $path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/";
if ( $opt_valgrind and $opt_debug )
{
# When both --valgrind and --debug is selected, send
# all output to the trace file, making it possible to
# see the exact location where valgrind complains
foreach my $mysqld (@{$master}, @{$slave})
{
my $sidx= $mysqld->{idx} ? "$mysqld->{idx}" : "";
$mysqld->{path_myerr}=
"$opt_vardir/log/" . $mysqld->{type} . "$sidx.trace";
}
}
} }
# #
......
...@@ -712,7 +712,7 @@ t1 1 a 4 d A 4 NULL NULL YES BTREE ...@@ -712,7 +712,7 @@ t1 1 a 4 d A 4 NULL NULL YES BTREE
delete from t1; delete from t1;
analyze table t1; analyze table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date test.t1 analyze status OK
show index from t1; show index from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A 0 NULL NULL YES BTREE t1 1 a 1 a A 0 NULL NULL YES BTREE
...@@ -1780,4 +1780,3 @@ CHECK TABLE t1; ...@@ -1780,4 +1780,3 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
DROP TABLE t1; DROP TABLE t1;
set global storage_engine=MyISAM;
...@@ -677,6 +677,10 @@ insert into t1 values ('bce','def2', NULL, 'quux'); ...@@ -677,6 +677,10 @@ insert into t1 values ('bce','def2', NULL, 'quux');
analyze table t1; analyze table t1;
show index from t1; show index from t1;
delete from t1; delete from t1;
# This will give you different messages depending on if we are using
# row base or stmt based replication as stmt base replication will use
# truncate and row based will delete things row by row.
--replace_result "Table is already up to date" "OK"
analyze table t1; analyze table t1;
show index from t1; show index from t1;
...@@ -1086,4 +1090,8 @@ DROP TABLE t1; ...@@ -1086,4 +1090,8 @@ DROP TABLE t1;
# End of 5.2 tests # End of 5.2 tests
--disable_result_log
--disable_query_log
eval set global storage_engine=$default; eval set global storage_engine=$default;
--enable_result_log
--enable_query_log
...@@ -1042,7 +1042,7 @@ int ha_maria::repair(THD *thd, HA_CHECK &param, bool do_optimize) ...@@ -1042,7 +1042,7 @@ int ha_maria::repair(THD *thd, HA_CHECK &param, bool do_optimize)
/* QQ: Until we have repair for block format, lie that it succeded */ /* QQ: Until we have repair for block format, lie that it succeded */
if (file->s->data_file_type == BLOCK_RECORD) if (file->s->data_file_type == BLOCK_RECORD)
{ {
if (optimize) if (do_optimize)
DBUG_RETURN(analyze(thd, (HA_CHECK_OPT*) 0)); DBUG_RETURN(analyze(thd, (HA_CHECK_OPT*) 0));
DBUG_RETURN(HA_ADMIN_OK); DBUG_RETURN(HA_ADMIN_OK);
} }
......
...@@ -858,6 +858,7 @@ static my_bool get_head_or_tail_page(MARIA_HA *info, ...@@ -858,6 +858,7 @@ static my_bool get_head_or_tail_page(MARIA_HA *info,
{ {
uint block_size; uint block_size;
DBUG_ENTER("get_head_or_tail_page"); DBUG_ENTER("get_head_or_tail_page");
DBUG_PRINT("enter", ("length: %u", length));
block_size= info->s->block_size; block_size= info->s->block_size;
if (block->org_bitmap_value == 0) /* Empty block */ if (block->org_bitmap_value == 0) /* Empty block */
...@@ -871,9 +872,8 @@ static my_bool get_head_or_tail_page(MARIA_HA *info, ...@@ -871,9 +872,8 @@ static my_bool get_head_or_tail_page(MARIA_HA *info,
The rest of the code does not assume the block is zeroed above The rest of the code does not assume the block is zeroed above
PAGE_OVERHEAD_SIZE PAGE_OVERHEAD_SIZE
*/ */
bzero(buff+ PAGE_HEADER_SIZE + length, bzero(buff+ PAGE_HEADER_SIZE, block_size - PAGE_HEADER_SIZE);
block_size - length - PAGE_HEADER_SIZE - DIR_ENTRY_SIZE -
PAGE_SUFFIX_SIZE);
buff[PAGE_TYPE_OFFSET]= (byte) page_type; buff[PAGE_TYPE_OFFSET]= (byte) page_type;
buff[DIR_ENTRY_OFFSET]= 1; buff[DIR_ENTRY_OFFSET]= 1;
res->buff= buff; res->buff= buff;
......
...@@ -5073,7 +5073,7 @@ translog_size_t translog_read_record(LSN lsn, ...@@ -5073,7 +5073,7 @@ translog_size_t translog_read_record(LSN lsn,
static void translog_force_current_buffer_to_finish() static void translog_force_current_buffer_to_finish()
{ {
TRANSLOG_ADDRESS new_buff_begunning; TRANSLOG_ADDRESS new_buff_beginning;
uint16 old_buffer_no= log_descriptor.bc.buffer_no; uint16 old_buffer_no= log_descriptor.bc.buffer_no;
uint16 new_buffer_no= (old_buffer_no + 1) % TRANSLOG_BUFFERS_NO; uint16 new_buffer_no= (old_buffer_no + 1) % TRANSLOG_BUFFERS_NO;
struct st_translog_buffer *new_buffer= (log_descriptor.buffers + struct st_translog_buffer *new_buffer= (log_descriptor.buffers +
...@@ -5086,7 +5086,6 @@ static void translog_force_current_buffer_to_finish() ...@@ -5086,7 +5086,6 @@ static void translog_force_current_buffer_to_finish()
DBUG_PRINT("enter", ("Buffer #%u 0x%lx " DBUG_PRINT("enter", ("Buffer #%u 0x%lx "
"Buffer addr: (%lu,0x%lx) " "Buffer addr: (%lu,0x%lx) "
"Page addr: (%lu,0x%lx) " "Page addr: (%lu,0x%lx) "
"New Buff: (%lu,0x%lx) "
"size: %lu (%lu) Pg: %u left: %u", "size: %lu (%lu) Pg: %u left: %u",
(uint) log_descriptor.bc.buffer_no, (uint) log_descriptor.bc.buffer_no,
(ulong) log_descriptor.bc.buffer, (ulong) log_descriptor.bc.buffer,
...@@ -5095,16 +5094,15 @@ static void translog_force_current_buffer_to_finish() ...@@ -5095,16 +5094,15 @@ static void translog_force_current_buffer_to_finish()
(ulong) LSN_FILE_NO(log_descriptor.horizon), (ulong) LSN_FILE_NO(log_descriptor.horizon),
(ulong) (LSN_OFFSET(log_descriptor.horizon) - (ulong) (LSN_OFFSET(log_descriptor.horizon) -
log_descriptor.bc.current_page_fill), log_descriptor.bc.current_page_fill),
(ulong) LSN_FILE_NO(new_buff_begunning),
(ulong) LSN_OFFSET(new_buff_begunning),
(ulong) log_descriptor.bc.buffer->size, (ulong) log_descriptor.bc.buffer->size,
(ulong) (log_descriptor.bc.ptr -log_descriptor.bc. (ulong) (log_descriptor.bc.ptr -log_descriptor.bc.
buffer->buffer), buffer->buffer),
(uint) log_descriptor.bc.current_page_fill, (uint) log_descriptor.bc.current_page_fill,
(uint) left)); (uint) left));
new_buff_begunning= log_descriptor.bc.buffer->offset; LINT_INIT(current_page_fill);
new_buff_begunning+= log_descriptor.bc.buffer->size; /* increase offset */ new_buff_beginning= log_descriptor.bc.buffer->offset;
new_buff_beginning+= log_descriptor.bc.buffer->size; /* increase offset */
DBUG_ASSERT(log_descriptor.bc.ptr !=NULL); DBUG_ASSERT(log_descriptor.bc.ptr !=NULL);
DBUG_ASSERT(LSN_FILE_NO(log_descriptor.horizon) == DBUG_ASSERT(LSN_FILE_NO(log_descriptor.horizon) ==
...@@ -5120,7 +5118,7 @@ static void translog_force_current_buffer_to_finish() ...@@ -5120,7 +5118,7 @@ static void translog_force_current_buffer_to_finish()
DBUG_PRINT("info", ("left: %u", (uint) left)); DBUG_PRINT("info", ("left: %u", (uint) left));
/* decrease offset */ /* decrease offset */
new_buff_begunning-= log_descriptor.bc.current_page_fill; new_buff_beginning-= log_descriptor.bc.current_page_fill;
current_page_fill= log_descriptor.bc.current_page_fill; current_page_fill= log_descriptor.bc.current_page_fill;
bzero(log_descriptor.bc.ptr, left); bzero(log_descriptor.bc.ptr, left);
...@@ -5145,7 +5143,7 @@ static void translog_force_current_buffer_to_finish() ...@@ -5145,7 +5143,7 @@ static void translog_force_current_buffer_to_finish()
write_counter= log_descriptor.bc.write_counter; write_counter= log_descriptor.bc.write_counter;
previous_offset= log_descriptor.bc.previous_offset; previous_offset= log_descriptor.bc.previous_offset;
translog_start_buffer(new_buffer, &log_descriptor.bc, new_buffer_no); translog_start_buffer(new_buffer, &log_descriptor.bc, new_buffer_no);
log_descriptor.bc.buffer->offset= new_buff_begunning; log_descriptor.bc.buffer->offset= new_buff_beginning;
log_descriptor.bc.write_counter= write_counter; log_descriptor.bc.write_counter= write_counter;
log_descriptor.bc.previous_offset= previous_offset; log_descriptor.bc.previous_offset= previous_offset;
......
...@@ -309,13 +309,6 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) ...@@ -309,13 +309,6 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
for (j=0 ; j < share->keyinfo[i].keysegs; j++,pos++) for (j=0 ; j < share->keyinfo[i].keysegs; j++,pos++)
{ {
disk_pos=_ma_keyseg_read(disk_pos, pos); disk_pos=_ma_keyseg_read(disk_pos, pos);
if (pos->flag & HA_BLOB_PART &&
! (share->options & (HA_OPTION_COMPRESS_RECORD |
HA_OPTION_PACK_RECORD)))
{
my_errno= HA_ERR_CRASHED;
goto err;
}
if (pos->type == HA_KEYTYPE_TEXT || if (pos->type == HA_KEYTYPE_TEXT ||
pos->type == HA_KEYTYPE_VARTEXT1 || pos->type == HA_KEYTYPE_VARTEXT1 ||
pos->type == HA_KEYTYPE_VARTEXT2) pos->type == HA_KEYTYPE_VARTEXT2)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment