Commit 662002fc authored by unknown's avatar unknown

post-merge fixes, and fixes for some of the 16 compiler warnings

found in pushbuild on sapsrv1. Some not fixed as not repeatable
on my machine (32/64 bit issue?).
Fixes for some test failures:
- "maria-connect" now passes;
- "maria": after fixing the obvious reasons for failures, the test
went further and hit a more complex issues: difference in the output
of EXPLAIN output; not fixed;
- "ps_maria" still crashes in assertion
mysqld: ha_maria.cc:1627: virtual int ha_maria::index_read(uchar*, const uchar*, uint, ha_rkey_function): Ass
ertion `inited == INDEX' failed, as already observable in pushbuild.
All this might just be due to an incomplete merge of MyISAM changes
into Maria when 5.1 was last merged to mysql-maria.


include/my_global.h:
  temporary fix until next merge of 5.1; without this it does not build
mysql-test/r/maria-connect.result:
  position changed
mysql-test/t/maria-connect.test:
  If one wants to use the binlog it has to ask for it.
  1582 is not used for dup entry error anymore (it was in older 5.1).
  Size of first event in binlog was increased by 4 (when the new type
  of event "gap" was added).
mysql-test/t/maria.test:
  1582 not used anymore in this case
storage/maria/ha_maria.cc:
  engine now has to say what binlogging it supports
storage/maria/ma_blockrec.c:
  fix for compiler warnings ("comparison is always true" or "always
  false")
storage/maria/ma_loghandler.c:
  fix for compiler warnings (comparing char* to uchar*)
storage/maria/ma_packrec.c:
  fix for compiler warning (fix simply merged from MyISAM)
storage/maria/ma_pagecache.c:
  info_check_pin() was not used so gave a compiler warning.
storage/maria/ma_pagecache.h:
  fixing typo from the last 5.1->maria merge.
storage/maria/ma_recovery.c:
  my_free() has a void* argument, so why cast. byte->uchar.
storage/maria/ma_search.c:
  fix for compiler warning (fix simply merged from MyISAM)
storage/maria/maria_read_log.c:
  gptr->uchar*
storage/maria/trnman.c:
  probable fix for warning found in pushbuild (but not on my machine):
  storage/maria/trnman.c: 142
   passing argument 6 of \u2018lf_hash_init\u2019 from incompatible pointer type
  on sapsrv1.
parent 79f7cb4e
...@@ -77,6 +77,13 @@ ...@@ -77,6 +77,13 @@
#endif #endif
#endif /* _WIN32... */ #endif /* _WIN32... */
/*
STACK_DIRECTION was removed from 5.1 and then that was merged into Maria;
then it was added back into 5.1 but not yet merged into Maria.
When merge done, remove this.
*/
#define STACK_DIRECTION -1
/* Make it easier to add conditionl code for windows */ /* Make it easier to add conditionl code for windows */
#ifdef __WIN__ #ifdef __WIN__
#define IF_WIN(A,B) (A) #define IF_WIN(A,B) (A)
......
...@@ -14,10 +14,10 @@ a ...@@ -14,10 +14,10 @@ a
2 2
3 3
4 4
SHOW BINLOG EVENTS FROM 102; SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 102 Query 1 200 use `test`; CREATE TABLE t1 (a int primary key) master-bin.000001 106 Query 1 204 use `test`; CREATE TABLE t1 (a int primary key)
master-bin.000001 200 Query 1 291 use `test`; insert t1 values (1),(2),(3) master-bin.000001 204 Query 1 295 use `test`; insert t1 values (1),(2),(3)
master-bin.000001 291 Query 1 382 use `test`; insert t1 values (4),(2),(5) master-bin.000001 295 Query 1 386 use `test`; insert t1 values (4),(2),(5)
drop table t1; drop table t1;
set binlog_format=default; set binlog_format=default;
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# #
-- source include/have_maria.inc -- source include/have_maria.inc
-- source include/have_log_bin.inc
let $default=`select @@global.storage_engine`; let $default=`select @@global.storage_engine`;
set global storage_engine=maria; set global storage_engine=maria;
...@@ -23,10 +24,10 @@ RESET MASTER; ...@@ -23,10 +24,10 @@ RESET MASTER;
set binlog_format=statement; set binlog_format=statement;
CREATE TABLE t1 (a int primary key); CREATE TABLE t1 (a int primary key);
insert t1 values (1),(2),(3); insert t1 values (1),(2),(3);
--error 1582 --error ER_DUP_ENTRY
insert t1 values (4),(2),(5); insert t1 values (4),(2),(5);
select * from t1; select * from t1;
SHOW BINLOG EVENTS FROM 102; SHOW BINLOG EVENTS FROM 106;
drop table t1; drop table t1;
set binlog_format=default; set binlog_format=default;
......
...@@ -470,9 +470,9 @@ create table t1 (a int not null auto_increment primary key, b text not null, uni ...@@ -470,9 +470,9 @@ create table t1 (a int not null auto_increment primary key, b text not null, uni
insert into t1 (b) values ('a'),('b'),('c'); insert into t1 (b) values ('a'),('b'),('c');
select concat(b,'.') from t1; select concat(b,'.') from t1;
update t1 set b='b ' where a=2; update t1 set b='b ' where a=2;
--error 1582 --error ER_DUP_ENTRY
update t1 set b='b ' where a > 1; update t1 set b='b ' where a > 1;
--error 1582 --error ER_DUP_ENTRY
insert into t1 (b) values ('b'); insert into t1 (b) values ('b');
select * from t1; select * from t1;
delete from t1 where b='b'; delete from t1 where b='b';
......
...@@ -486,6 +486,7 @@ void _ma_check_print_warning(HA_CHECK *param, const char *fmt, ...) ...@@ -486,6 +486,7 @@ void _ma_check_print_warning(HA_CHECK *param, const char *fmt, ...)
ha_maria::ha_maria(handlerton *hton, TABLE_SHARE *table_arg): ha_maria::ha_maria(handlerton *hton, TABLE_SHARE *table_arg):
handler(hton, table_arg), file(0), handler(hton, table_arg), file(0),
int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE |
HA_DUPLICATE_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | HA_DUPLICATE_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY |
HA_FILE_BASED | HA_CAN_GEOMETRY | MARIA_CANNOT_ROLLBACK | HA_FILE_BASED | HA_CAN_GEOMETRY | MARIA_CANNOT_ROLLBACK |
HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS | HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS |
......
...@@ -1742,7 +1742,7 @@ static my_bool write_block_record(MARIA_HA *info, ...@@ -1742,7 +1742,7 @@ static my_bool write_block_record(MARIA_HA *info,
int2store(page_buff + EMPTY_SPACE_OFFSET, row_pos->empty_space); int2store(page_buff + EMPTY_SPACE_OFFSET, row_pos->empty_space);
/* Mark in bitmaps how the current page was actually used */ /* Mark in bitmaps how the current page was actually used */
head_block->empty_space= row_pos->empty_space; head_block->empty_space= row_pos->empty_space;
if (page_buff[DIR_COUNT_OFFSET] == (char) MAX_ROWS_PER_PAGE) if (page_buff[DIR_COUNT_OFFSET] == MAX_ROWS_PER_PAGE)
head_block->empty_space= 0; /* Page is full */ head_block->empty_space= 0; /* Page is full */
head_block->used= BLOCKUSED_USED; head_block->used= BLOCKUSED_USED;
} }
...@@ -4394,13 +4394,13 @@ uint _ma_apply_redo_purge_row_head_or_tail(MARIA_HA *info, LSN lsn, ...@@ -4394,13 +4394,13 @@ uint _ma_apply_redo_purge_row_head_or_tail(MARIA_HA *info, LSN lsn,
*/ */
uint _ma_apply_redo_purge_blocks(MARIA_HA *info, uint _ma_apply_redo_purge_blocks(MARIA_HA *info,
LSN lsn, const byte *header) LSN lsn, const uchar *header)
{ {
MARIA_SHARE *share= info->s; MARIA_SHARE *share= info->s;
ulonglong page; ulonglong page;
uint page_range; uint page_range;
uint res; uint res;
byte *buff= info->keyread_buff; uchar *buff= info->keyread_buff;
uint block_size= share->block_size; uint block_size= share->block_size;
DBUG_ENTER("_ma_apply_redo_purge_blocks"); DBUG_ENTER("_ma_apply_redo_purge_blocks");
...@@ -4441,7 +4441,7 @@ uint _ma_apply_redo_purge_blocks(MARIA_HA *info, ...@@ -4441,7 +4441,7 @@ uint _ma_apply_redo_purge_blocks(MARIA_HA *info,
*/ */
{ {
uint rownr= ((uint) ((uchar *) buff)[DIR_COUNT_OFFSET]) - 1; uint rownr= ((uint) ((uchar *) buff)[DIR_COUNT_OFFSET]) - 1;
byte *dir= (buff + block_size - DIR_ENTRY_SIZE * rownr - uchar *dir= (buff + block_size - DIR_ENTRY_SIZE * rownr -
DIR_ENTRY_SIZE - PAGE_SUFFIX_SIZE); DIR_ENTRY_SIZE - PAGE_SUFFIX_SIZE);
dir[0]= dir[1]= 0; /* Delete entry */ dir[0]= dir[1]= 0; /* Delete entry */
} }
......
...@@ -3541,7 +3541,7 @@ static my_bool translog_relative_LSN_encode(struct st_translog_parts *parts, ...@@ -3541,7 +3541,7 @@ static my_bool translog_relative_LSN_encode(struct st_translog_parts *parts,
uchar *dst_ptr= compressed_LSNs + (MAX_NUMBER_OF_LSNS_PER_RECORD * uchar *dst_ptr= compressed_LSNs + (MAX_NUMBER_OF_LSNS_PER_RECORD *
COMPRESSED_LSN_MAX_STORE_SIZE); COMPRESSED_LSN_MAX_STORE_SIZE);
for (src_ptr= buffer + lsns_len - LSN_STORE_SIZE; for (src_ptr= buffer + lsns_len - LSN_STORE_SIZE;
src_ptr >= buffer; src_ptr >= (uchar *)buffer;
src_ptr-= LSN_STORE_SIZE) src_ptr-= LSN_STORE_SIZE)
{ {
ref= lsn_korr(src_ptr); ref= lsn_korr(src_ptr);
......
...@@ -170,7 +170,8 @@ static my_bool _ma_read_pack_info(MARIA_SHARE *share, File file, ...@@ -170,7 +170,8 @@ static my_bool _ma_read_pack_info(MARIA_SHARE *share, File file,
uint i,trees,huff_tree_bits,rec_reflength,length; uint i,trees,huff_tree_bits,rec_reflength,length;
uint16 *decode_table,*tmp_buff; uint16 *decode_table,*tmp_buff;
ulong elements,intervall_length; ulong elements,intervall_length;
char *disk_cache,*intervall_buff; char *disk_cache;
uchar *intervall_buff;
uchar header[HEAD_LENGTH]; uchar header[HEAD_LENGTH];
MARIA_BIT_BUFF bit_buff; MARIA_BIT_BUFF bit_buff;
DBUG_ENTER("_ma_read_pack_info"); DBUG_ENTER("_ma_read_pack_info");
......
...@@ -320,6 +320,8 @@ struct st_pagecache_block_link ...@@ -320,6 +320,8 @@ struct st_pagecache_block_link
#ifndef DBUG_OFF #ifndef DBUG_OFF
/* debug checks */ /* debug checks */
#ifdef NOT_USED
static my_bool info_check_pin(PAGECACHE_BLOCK_LINK *block, static my_bool info_check_pin(PAGECACHE_BLOCK_LINK *block,
enum pagecache_page_pin mode enum pagecache_page_pin mode
__attribute__((unused))) __attribute__((unused)))
...@@ -380,7 +382,6 @@ static my_bool info_check_pin(PAGECACHE_BLOCK_LINK *block, ...@@ -380,7 +382,6 @@ static my_bool info_check_pin(PAGECACHE_BLOCK_LINK *block,
1 - Error 1 - Error
*/ */
#ifdef NOT_USED
static my_bool info_check_lock(PAGECACHE_BLOCK_LINK *block, static my_bool info_check_lock(PAGECACHE_BLOCK_LINK *block,
enum pagecache_page_lock lock, enum pagecache_page_lock lock,
enum pagecache_page_pin pin) enum pagecache_page_pin pin)
......
...@@ -95,7 +95,7 @@ typedef struct st_pagecache_hash_link PAGECACHE_HASH_LINK; ...@@ -95,7 +95,7 @@ typedef struct st_pagecache_hash_link PAGECACHE_HASH_LINK;
#include <wqueue.h> #include <wqueue.h>
typedef my_bool (*pagecache_disk_read_validator)(uchar *page, uchar** data); typedef my_bool (*pagecache_disk_read_validator)(uchar *page, uchar *data);
#define PAGECACHE_CHANGED_BLOCKS_HASH 128 /* must be power of 2 */ #define PAGECACHE_CHANGED_BLOCKS_HASH 128 /* must be power of 2 */
......
...@@ -321,8 +321,8 @@ int maria_apply_log(LSN lsn, my_bool apply, FILE *trace_file) ...@@ -321,8 +321,8 @@ int maria_apply_log(LSN lsn, my_bool apply, FILE *trace_file)
error= 1; error= 1;
fprintf(tracef, "Recovery of tables with transaction logs FAILED\n"); fprintf(tracef, "Recovery of tables with transaction logs FAILED\n");
end: end:
my_free((gptr)all_tables, MYF(MY_ALLOW_ZERO_PTR)); my_free(all_tables, MYF(MY_ALLOW_ZERO_PTR));
my_free((gptr)all_active_trans, MYF(MY_ALLOW_ZERO_PTR)); my_free(all_active_trans, MYF(MY_ALLOW_ZERO_PTR));
my_free(log_record_buffer.str, MYF(MY_ALLOW_ZERO_PTR)); my_free(log_record_buffer.str, MYF(MY_ALLOW_ZERO_PTR));
log_record_buffer.str= NULL; log_record_buffer.str= NULL;
log_record_buffer.length= 0; log_record_buffer.length= 0;
...@@ -701,7 +701,7 @@ prototype_exec_hook(FILE_ID) ...@@ -701,7 +701,7 @@ prototype_exec_hook(FILE_ID)
prototype_exec_hook(REDO_INSERT_ROW_HEAD) prototype_exec_hook(REDO_INSERT_ROW_HEAD)
{ {
int error= 1; int error= 1;
byte *buff= NULL; uchar *buff= NULL;
MARIA_HA *info= get_MARIA_HA_from_REDO_record(rec); MARIA_HA *info= get_MARIA_HA_from_REDO_record(rec);
if (info == NULL) if (info == NULL)
goto end; goto end;
...@@ -746,7 +746,7 @@ prototype_exec_hook(REDO_INSERT_ROW_HEAD) ...@@ -746,7 +746,7 @@ prototype_exec_hook(REDO_INSERT_ROW_HEAD)
prototype_exec_hook(REDO_INSERT_ROW_TAIL) prototype_exec_hook(REDO_INSERT_ROW_TAIL)
{ {
int error= 1; int error= 1;
byte *buff= NULL; uchar *buff= NULL;
MARIA_HA *info= get_MARIA_HA_from_REDO_record(rec); MARIA_HA *info= get_MARIA_HA_from_REDO_record(rec);
if (info == NULL) if (info == NULL)
goto end; goto end;
......
...@@ -834,7 +834,7 @@ uint _ma_get_pack_key(register MARIA_KEYDEF *keyinfo, uint nod_flag, ...@@ -834,7 +834,7 @@ uint _ma_get_pack_key(register MARIA_KEYDEF *keyinfo, uint nod_flag,
tot_length=rest_length+length; tot_length=rest_length+length;
/* If the stored length has changed, we must move the key */ /* If the stored length has changed, we must move the key */
if (tot_length >= 255 && *start != (char) 255) if (tot_length >= 255 && *start != 255)
{ {
/* length prefix changed from a length of one to a length of 3 */ /* length prefix changed from a length of one to a length of 3 */
bmove_upp((char*) key+length+3,(char*) key+length+1,length); bmove_upp((char*) key+length+3,(char*) key+length+1,length);
...@@ -842,7 +842,7 @@ uint _ma_get_pack_key(register MARIA_KEYDEF *keyinfo, uint nod_flag, ...@@ -842,7 +842,7 @@ uint _ma_get_pack_key(register MARIA_KEYDEF *keyinfo, uint nod_flag,
mi_int2store(key+1,tot_length); mi_int2store(key+1,tot_length);
key+=3+length; key+=3+length;
} }
else if (tot_length < 255 && *start == (char) 255) else if (tot_length < 255 && *start == 255)
{ {
bmove(key+1,key+3,length); bmove(key+1,key+3,length);
*key=tot_length; *key=tot_length;
......
...@@ -108,11 +108,11 @@ int main(int argc, char **argv) ...@@ -108,11 +108,11 @@ int main(int argc, char **argv)
static struct my_option my_long_options[] = static struct my_option my_long_options[] =
{ {
{"only-display", 'o', "display brief info about records's header", {"only-display", 'o', "display brief info about records's header",
(gptr*) &opt_only_display, (gptr*) &opt_only_display, 0, GET_BOOL, NO_ARG, (uchar **) &opt_only_display, (uchar **) &opt_only_display, 0, GET_BOOL,
0, 0, 0, 0, 0, 0}, NO_ARG,0, 0, 0, 0, 0, 0},
{"display-and-apply", 'a', {"display-and-apply", 'a',
"like --only-display but displays more info and modifies tables", "like --only-display but displays more info and modifies tables",
(gptr*) &opt_display_and_apply, (gptr*) &opt_display_and_apply, 0, (uchar **) &opt_display_and_apply, (uchar **) &opt_display_and_apply, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DBUG_OFF #ifndef DBUG_OFF
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
......
...@@ -94,7 +94,7 @@ static TRN *short_trid_to_TRN(uint16 short_trid) ...@@ -94,7 +94,7 @@ static TRN *short_trid_to_TRN(uint16 short_trid)
} }
#endif #endif
static uchar *trn_get_hash_key(const uchar *trn, uint* len, static uchar *trn_get_hash_key(const uchar *trn, size_t *len,
my_bool unused __attribute__ ((unused))) my_bool unused __attribute__ ((unused)))
{ {
*len= sizeof(TrID); *len= sizeof(TrID);
......
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