Commit e3ef15ea authored by unknown's avatar unknown

Fix compilation failures on Windows caused by the patch for Bug#17199.

Fix a minor issue with Bug#16206 (bdb.test failed if the tree is compiled 
without blackhole).


include/my_sys.h:
  Change declaration of my_strdup_with_length to accept const char *,
  not const byte *: in 5 places out of 6 where this function is used,
  it's being passed char *, not byte *
mysql-test/r/bdb.result:
  Remove dependency on an optional engine (updated test results).
mysql-test/t/bdb.test:
  Remove dependency on an optional engine.
mysys/my_malloc.c:
  my_strdup_with_length: const byte * -> const char *
mysys/safemalloc.c:
  my_strdup_with_length: const byte * -> const char *
sql/ha_federated.cc:
  my_strdup_with_length: const byte * -> const char *
sql/log_event.cc:
  my_strdup_with_length: const byte * -> const char *
sql/set_var.cc:
  my_strdup_with_length: const byte * -> const char *
sql/sql_class.h:
  Change db_length type to uint from uint32 (see also table.h)
sql/table.h:
  Change the type of db_length to uint from uint32: LEX_STRING uses uint for 
  length, we need a small and consistent set of types to store length to 
  minimize cast and compile failures.
parent 25652349
...@@ -157,7 +157,7 @@ extern gptr my_realloc(gptr oldpoint,uint Size,myf MyFlags); ...@@ -157,7 +157,7 @@ extern gptr my_realloc(gptr oldpoint,uint Size,myf MyFlags);
extern void my_no_flags_free(gptr ptr); extern void my_no_flags_free(gptr ptr);
extern gptr my_memdup(const byte *from,uint length,myf MyFlags); extern gptr my_memdup(const byte *from,uint length,myf MyFlags);
extern char *my_strdup(const char *from,myf MyFlags); extern char *my_strdup(const char *from,myf MyFlags);
extern char *my_strdup_with_length(const byte *from, uint length, extern char *my_strdup_with_length(const char *from, uint length,
myf MyFlags); myf MyFlags);
/* we do use FG (as a no-op) in below so that a typo on FG is caught */ /* we do use FG (as a no-op) in below so that a typo on FG is caught */
#define my_free(PTR,FG) ((void)FG,my_no_flags_free(PTR)) #define my_free(PTR,FG) ((void)FG,my_no_flags_free(PTR))
......
...@@ -1930,7 +1930,7 @@ alter table t1 add primary key(a); ...@@ -1930,7 +1930,7 @@ alter table t1 add primary key(a);
drop table t1; drop table t1;
set autocommit=1; set autocommit=1;
reset master; reset master;
create table bug16206 (a int) engine= blackhole; create table bug16206 (a int);
insert into bug16206 values(1); insert into bug16206 values(1);
start transaction; start transaction;
insert into bug16206 values(2); insert into bug16206 values(2);
...@@ -1938,7 +1938,7 @@ commit; ...@@ -1938,7 +1938,7 @@ commit;
show binlog events; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
f n Query 1 n use `test`; create table bug16206 (a int) engine= blackhole f n Query 1 n use `test`; create table bug16206 (a int)
f n Query 1 n use `test`; insert into bug16206 values(1) f n Query 1 n use `test`; insert into bug16206 values(1)
f n Query 1 n use `test`; insert into bug16206 values(2) f n Query 1 n use `test`; insert into bug16206 values(2)
drop table bug16206; drop table bug16206;
......
...@@ -1028,7 +1028,7 @@ set autocommit=1; ...@@ -1028,7 +1028,7 @@ set autocommit=1;
let $VERSION=`select version()`; let $VERSION=`select version()`;
reset master; reset master;
create table bug16206 (a int) engine= blackhole; create table bug16206 (a int);
insert into bug16206 values(1); insert into bug16206 values(1);
start transaction; start transaction;
insert into bug16206 values(2); insert into bug16206 values(2);
......
...@@ -83,7 +83,7 @@ char *my_strdup(const char *from, myf my_flags) ...@@ -83,7 +83,7 @@ char *my_strdup(const char *from, myf my_flags)
} }
char *my_strdup_with_length(const byte *from, uint length, myf my_flags) char *my_strdup_with_length(const char *from, uint length, myf my_flags)
{ {
gptr ptr; gptr ptr;
if ((ptr=my_malloc(length+1,my_flags)) != 0) if ((ptr=my_malloc(length+1,my_flags)) != 0)
......
...@@ -525,7 +525,7 @@ char *_my_strdup(const char *from, const char *filename, uint lineno, ...@@ -525,7 +525,7 @@ char *_my_strdup(const char *from, const char *filename, uint lineno,
} /* _my_strdup */ } /* _my_strdup */
char *_my_strdup_with_length(const byte *from, uint length, char *_my_strdup_with_length(const char *from, uint length,
const char *filename, uint lineno, const char *filename, uint lineno,
myf MyFlags) myf MyFlags)
{ {
......
...@@ -632,8 +632,7 @@ static int parse_url(FEDERATED_SHARE *share, TABLE *table, ...@@ -632,8 +632,7 @@ static int parse_url(FEDERATED_SHARE *share, TABLE *table,
DBUG_PRINT("info", ("Length %d \n", table->s->connect_string.length)); DBUG_PRINT("info", ("Length %d \n", table->s->connect_string.length));
DBUG_PRINT("info", ("String %.*s \n", table->s->connect_string.length, DBUG_PRINT("info", ("String %.*s \n", table->s->connect_string.length,
table->s->connect_string.str)); table->s->connect_string.str));
share->scheme= my_strdup_with_length((const byte*)table->s-> share->scheme= my_strdup_with_length(table->s->connect_string.str,
connect_string.str,
table->s->connect_string.length, table->s->connect_string.length,
MYF(0)); MYF(0));
......
...@@ -3123,7 +3123,7 @@ Rotate_log_event::Rotate_log_event(THD* thd_arg, ...@@ -3123,7 +3123,7 @@ Rotate_log_event::Rotate_log_event(THD* thd_arg,
llstr(pos_arg, buff), flags)); llstr(pos_arg, buff), flags));
#endif #endif
if (flags & DUP_NAME) if (flags & DUP_NAME)
new_log_ident= my_strdup_with_length((const byte*) new_log_ident_arg, new_log_ident= my_strdup_with_length(new_log_ident_arg,
ident_len, MYF(MY_WME)); ident_len, MYF(MY_WME));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
...@@ -3147,7 +3147,7 @@ Rotate_log_event::Rotate_log_event(const char* buf, uint event_len, ...@@ -3147,7 +3147,7 @@ Rotate_log_event::Rotate_log_event(const char* buf, uint event_len,
(header_size+post_header_len)); (header_size+post_header_len));
ident_offset = post_header_len; ident_offset = post_header_len;
set_if_smaller(ident_len,FN_REFLEN-1); set_if_smaller(ident_len,FN_REFLEN-1);
new_log_ident= my_strdup_with_length((byte*) buf + ident_offset, new_log_ident= my_strdup_with_length(buf + ident_offset,
(uint) ident_len, (uint) ident_len,
MYF(MY_WME)); MYF(MY_WME));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
......
...@@ -1133,7 +1133,7 @@ bool update_sys_var_str(sys_var_str *var_str, rw_lock_t *var_mutex, ...@@ -1133,7 +1133,7 @@ bool update_sys_var_str(sys_var_str *var_str, rw_lock_t *var_mutex,
uint new_length= (var ? var->value->str_value.length() : 0); uint new_length= (var ? var->value->str_value.length() : 0);
if (!old_value) if (!old_value)
old_value= (char*) ""; old_value= (char*) "";
if (!(res= my_strdup_with_length((byte*)old_value, new_length, MYF(0)))) if (!(res= my_strdup_with_length(old_value, new_length, MYF(0))))
return 1; return 1;
/* /*
Replace the old value in such a way that the any thread using Replace the old value in such a way that the any thread using
......
...@@ -1300,7 +1300,7 @@ public: ...@@ -1300,7 +1300,7 @@ public:
pthread_t real_id; pthread_t real_id;
uint tmp_table, global_read_lock; uint tmp_table, global_read_lock;
uint server_status,open_options,system_thread; uint server_status,open_options,system_thread;
uint32 db_length; uint db_length;
uint select_number; //number of select (used for EXPLAIN) uint select_number; //number of select (used for EXPLAIN)
/* variables.transaction_isolation is reset to this after each commit */ /* variables.transaction_isolation is reset to this after each commit */
enum_tx_isolation session_tx_isolation; enum_tx_isolation session_tx_isolation;
......
...@@ -599,7 +599,8 @@ typedef struct st_table_list ...@@ -599,7 +599,8 @@ typedef struct st_table_list
thr_lock_type lock_type; thr_lock_type lock_type;
uint outer_join; /* Which join type */ uint outer_join; /* Which join type */
uint shared; /* Used in multi-upd */ uint shared; /* Used in multi-upd */
uint32 db_length, table_name_length; uint db_length;
uint32 table_name_length;
bool updatable; /* VIEW/TABLE can be updated now */ bool updatable; /* VIEW/TABLE can be updated now */
bool straight; /* optimize with prev table */ bool straight; /* optimize with prev table */
bool updating; /* for replicate-do/ignore table */ bool updating; /* for replicate-do/ignore table */
......
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