Clean up warnings and build problems on Windows. (Bug #11045)
VC++Files/sql/mysqld.dsp: Link debug server against debug yassl sql/examples/ha_archive.cc: Fix type for variables used to store number of rows Add cast when reading current position sql/examples/ha_archive.h: Fix variables used to store rows to ha_rows sql/ha_federated.cc: Remove unused variables, fix type of variable used to store query id sql/item_strfunc.cc: Remove unused variables sql/sql_acl.cc: Remove unused variables sql/sql_lex.cc: Add casts to fix type used for counting number of rows sql/sql_lex.h: Fix size of options to be ulong again sql/sql_insert.cc: Fix type of query id value sql/sql_union.cc: Cast value for number of rows to ha_rows sql/sql_yacc.yy: Remove unused variable sql/table.cc: Add casts for handling key_part lengths
This commit is contained in:
parent
0945dea8d0
commit
94d1d88658
@ -84,7 +84,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=xilink6.exe
|
LINK32=xilink6.exe
|
||||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib ..\extra\yassl\Release\yassl.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld-debug.exe" /pdbtype:sept
|
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib ..\extra\yassl\Debug\yassl.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld-debug.exe" /pdbtype:sept
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "mysqld - Win32 nt"
|
!ELSEIF "$(CFG)" == "mysqld - Win32 nt"
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ error:
|
|||||||
This method reads the header of a meta file and returns whether or not it was successful.
|
This method reads the header of a meta file and returns whether or not it was successful.
|
||||||
*rows will contain the current number of rows in the data file upon success.
|
*rows will contain the current number of rows in the data file upon success.
|
||||||
*/
|
*/
|
||||||
int ha_archive::read_meta_file(File meta_file, ulonglong *rows)
|
int ha_archive::read_meta_file(File meta_file, ha_rows *rows)
|
||||||
{
|
{
|
||||||
uchar meta_buffer[META_BUFFER_SIZE];
|
uchar meta_buffer[META_BUFFER_SIZE];
|
||||||
ulonglong check_point;
|
ulonglong check_point;
|
||||||
@ -273,7 +273,7 @@ int ha_archive::read_meta_file(File meta_file, ulonglong *rows)
|
|||||||
/*
|
/*
|
||||||
Parse out the meta data, we ignore version at the moment
|
Parse out the meta data, we ignore version at the moment
|
||||||
*/
|
*/
|
||||||
*rows= uint8korr(meta_buffer + 2);
|
*rows= (ha_rows)uint8korr(meta_buffer + 2);
|
||||||
check_point= uint8korr(meta_buffer + 10);
|
check_point= uint8korr(meta_buffer + 10);
|
||||||
|
|
||||||
DBUG_PRINT("ha_archive::read_meta_file", ("Check %d", (uint)meta_buffer[0]));
|
DBUG_PRINT("ha_archive::read_meta_file", ("Check %d", (uint)meta_buffer[0]));
|
||||||
@ -296,7 +296,7 @@ int ha_archive::read_meta_file(File meta_file, ulonglong *rows)
|
|||||||
By setting dirty you say whether or not the file represents the actual state of the data file.
|
By setting dirty you say whether or not the file represents the actual state of the data file.
|
||||||
Upon ::open() we set to dirty, and upon ::close() we set to clean.
|
Upon ::open() we set to dirty, and upon ::close() we set to clean.
|
||||||
*/
|
*/
|
||||||
int ha_archive::write_meta_file(File meta_file, ulonglong rows, bool dirty)
|
int ha_archive::write_meta_file(File meta_file, ha_rows rows, bool dirty)
|
||||||
{
|
{
|
||||||
uchar meta_buffer[META_BUFFER_SIZE];
|
uchar meta_buffer[META_BUFFER_SIZE];
|
||||||
ulonglong check_point= 0; //Reserved for the future
|
ulonglong check_point= 0; //Reserved for the future
|
||||||
@ -787,7 +787,7 @@ int ha_archive::rnd_pos(byte * buf, byte *pos)
|
|||||||
DBUG_ENTER("ha_archive::rnd_pos");
|
DBUG_ENTER("ha_archive::rnd_pos");
|
||||||
statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
|
statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
|
||||||
&LOCK_status);
|
&LOCK_status);
|
||||||
current_position= my_get_ptr(pos, ref_length);
|
current_position= (z_off_t)my_get_ptr(pos, ref_length);
|
||||||
(void)gzseek(archive, current_position, SEEK_SET);
|
(void)gzseek(archive, current_position, SEEK_SET);
|
||||||
|
|
||||||
DBUG_RETURN(get_row(archive, buf));
|
DBUG_RETURN(get_row(archive, buf));
|
||||||
@ -801,7 +801,7 @@ int ha_archive::repair(THD* thd, HA_CHECK_OPT* check_opt)
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
byte *buf;
|
byte *buf;
|
||||||
ulonglong rows_recorded= 0;
|
ha_rows rows_recorded= 0;
|
||||||
gzFile rebuild_file; // Archive file we are working with
|
gzFile rebuild_file; // Archive file we are working with
|
||||||
File meta_file; // Meta file we use
|
File meta_file; // Meta file we use
|
||||||
char data_file_name[FN_REFLEN];
|
char data_file_name[FN_REFLEN];
|
||||||
|
@ -36,7 +36,7 @@ typedef struct st_archive_share {
|
|||||||
gzFile archive_write; /* Archive file we are working with */
|
gzFile archive_write; /* Archive file we are working with */
|
||||||
bool dirty; /* Flag for if a flush should occur */
|
bool dirty; /* Flag for if a flush should occur */
|
||||||
bool crashed; /* Meta file is crashed */
|
bool crashed; /* Meta file is crashed */
|
||||||
ulonglong rows_recorded; /* Number of rows in tables */
|
ha_rows rows_recorded; /* Number of rows in tables */
|
||||||
} ARCHIVE_SHARE;
|
} ARCHIVE_SHARE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -88,8 +88,8 @@ public:
|
|||||||
int rnd_next(byte *buf);
|
int rnd_next(byte *buf);
|
||||||
int rnd_pos(byte * buf, byte *pos);
|
int rnd_pos(byte * buf, byte *pos);
|
||||||
int get_row(gzFile file_to_read, byte *buf);
|
int get_row(gzFile file_to_read, byte *buf);
|
||||||
int read_meta_file(File meta_file, ulonglong *rows);
|
int read_meta_file(File meta_file, ha_rows *rows);
|
||||||
int write_meta_file(File meta_file, ulonglong rows, bool dirty);
|
int write_meta_file(File meta_file, ha_rows rows, bool dirty);
|
||||||
ARCHIVE_SHARE *get_share(const char *table_name, TABLE *table);
|
ARCHIVE_SHARE *get_share(const char *table_name, TABLE *table);
|
||||||
int free_share(ARCHIVE_SHARE *share);
|
int free_share(ARCHIVE_SHARE *share);
|
||||||
bool auto_repair() const { return 1; } // For the moment we just do this
|
bool auto_repair() const { return 1; } // For the moment we just do this
|
||||||
|
@ -842,7 +842,7 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table)
|
|||||||
query.length(0);
|
query.length(0);
|
||||||
|
|
||||||
uint table_name_length, table_base_name_length;
|
uint table_name_length, table_base_name_length;
|
||||||
char *tmp_table_name, *tmp_table_base_name, *table_base_name, *select_query;
|
char *tmp_table_name, *table_base_name, *select_query;
|
||||||
|
|
||||||
/* share->table_name has the file location - we want the table's name! */
|
/* share->table_name has the file location - we want the table's name! */
|
||||||
table_base_name= (char*) table->s->table_name;
|
table_base_name= (char*) table->s->table_name;
|
||||||
@ -963,7 +963,6 @@ const char **ha_federated::bas_ext() const
|
|||||||
|
|
||||||
int ha_federated::open(const char *name, int mode, uint test_if_locked)
|
int ha_federated::open(const char *name, int mode, uint test_if_locked)
|
||||||
{
|
{
|
||||||
int rc;
|
|
||||||
DBUG_ENTER("ha_federated::open");
|
DBUG_ENTER("ha_federated::open");
|
||||||
|
|
||||||
if (!(share= get_share(name, table)))
|
if (!(share= get_share(name, table)))
|
||||||
@ -1076,7 +1075,7 @@ int ha_federated::write_row(byte *buf)
|
|||||||
{
|
{
|
||||||
uint x= 0, num_fields= 0;
|
uint x= 0, num_fields= 0;
|
||||||
Field **field;
|
Field **field;
|
||||||
ulong current_query_id= 1;
|
query_id_it current_query_id= 1;
|
||||||
ulong tmp_query_id= 1;
|
ulong tmp_query_id= 1;
|
||||||
uint all_fields_have_same_query_id= 1;
|
uint all_fields_have_same_query_id= 1;
|
||||||
|
|
||||||
@ -1471,8 +1470,6 @@ int ha_federated::index_read_idx(byte *buf, uint index, const byte *key,
|
|||||||
__attribute__ ((unused)))
|
__attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
char index_value[IO_SIZE];
|
char index_value[IO_SIZE];
|
||||||
char key_value[IO_SIZE];
|
|
||||||
char test_value[IO_SIZE];
|
|
||||||
String index_string(index_value, sizeof(index_value), &my_charset_bin);
|
String index_string(index_value, sizeof(index_value), &my_charset_bin);
|
||||||
index_string.length(0);
|
index_string.length(0);
|
||||||
uint keylen;
|
uint keylen;
|
||||||
@ -1538,7 +1535,6 @@ int ha_federated::index_read_idx(byte *buf, uint index, const byte *key,
|
|||||||
/* Initialized at each key walk (called multiple times unlike rnd_init()) */
|
/* Initialized at each key walk (called multiple times unlike rnd_init()) */
|
||||||
int ha_federated::index_init(uint keynr)
|
int ha_federated::index_init(uint keynr)
|
||||||
{
|
{
|
||||||
int error;
|
|
||||||
DBUG_ENTER("ha_federated::index_init");
|
DBUG_ENTER("ha_federated::index_init");
|
||||||
DBUG_PRINT("info",
|
DBUG_PRINT("info",
|
||||||
("table: '%s' key: %d", table->s->table_name, keynr));
|
("table: '%s' key: %d", table->s->table_name, keynr));
|
||||||
@ -1570,7 +1566,6 @@ int ha_federated::index_next(byte *buf)
|
|||||||
int ha_federated::rnd_init(bool scan)
|
int ha_federated::rnd_init(bool scan)
|
||||||
{
|
{
|
||||||
DBUG_ENTER("ha_federated::rnd_init");
|
DBUG_ENTER("ha_federated::rnd_init");
|
||||||
int num_fields, rows;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This 'scan' flag is incredibly important for this handler to work
|
This 'scan' flag is incredibly important for this handler to work
|
||||||
|
@ -446,7 +446,6 @@ String *Item_func_des_decrypt::val_str(String *str)
|
|||||||
{
|
{
|
||||||
DBUG_ASSERT(fixed == 1);
|
DBUG_ASSERT(fixed == 1);
|
||||||
#ifdef HAVE_OPENSSL
|
#ifdef HAVE_OPENSSL
|
||||||
DES_key_schedule ks1, ks2, ks3;
|
|
||||||
DES_cblock ivec;
|
DES_cblock ivec;
|
||||||
struct st_des_keyblock keyblock;
|
struct st_des_keyblock keyblock;
|
||||||
struct st_des_keyschedule keyschedule;
|
struct st_des_keyschedule keyschedule;
|
||||||
|
@ -2476,7 +2476,6 @@ static int replace_routine_table(THD *thd, GRANT_NAME *grant_name,
|
|||||||
int old_row_exists= 1;
|
int old_row_exists= 1;
|
||||||
int error=0;
|
int error=0;
|
||||||
ulong store_proc_rights;
|
ulong store_proc_rights;
|
||||||
byte *key;
|
|
||||||
DBUG_ENTER("replace_routine_table");
|
DBUG_ENTER("replace_routine_table");
|
||||||
|
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
@ -3216,7 +3215,6 @@ my_bool grant_init(THD *org_thd)
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
GRANT_NAME *mem_check;
|
GRANT_NAME *mem_check;
|
||||||
longlong proc_type;
|
|
||||||
HASH *hash;
|
HASH *hash;
|
||||||
if (!(mem_check=new GRANT_NAME(p_table)))
|
if (!(mem_check=new GRANT_NAME(p_table)))
|
||||||
{
|
{
|
||||||
|
@ -192,7 +192,7 @@ static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list,
|
|||||||
List<Item> &update_fields)
|
List<Item> &update_fields)
|
||||||
{
|
{
|
||||||
TABLE *table= insert_table_list->table;
|
TABLE *table= insert_table_list->table;
|
||||||
ulong timestamp_query_id;
|
query_id_it timestamp_query_id;
|
||||||
LINT_INIT(timestamp_query_id);
|
LINT_INIT(timestamp_query_id);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1755,12 +1755,13 @@ bool st_lex::need_correct_ident()
|
|||||||
|
|
||||||
void st_select_lex_unit::set_limit(SELECT_LEX *sl)
|
void st_select_lex_unit::set_limit(SELECT_LEX *sl)
|
||||||
{
|
{
|
||||||
ulonglong select_limit_val;
|
ha_rows select_limit_val;
|
||||||
|
|
||||||
DBUG_ASSERT(! thd->current_arena->is_stmt_prepare());
|
DBUG_ASSERT(! thd->current_arena->is_stmt_prepare());
|
||||||
select_limit_val= sl->select_limit ? sl->select_limit->val_uint() :
|
select_limit_val= (ha_rows)(sl->select_limit ? sl->select_limit->val_uint() :
|
||||||
HA_POS_ERROR;
|
HA_POS_ERROR);
|
||||||
offset_limit_cnt= sl->offset_limit ? sl->offset_limit->val_uint() : ULL(0);
|
offset_limit_cnt= (ha_rows)(sl->offset_limit ? sl->offset_limit->val_uint() :
|
||||||
|
ULL(0));
|
||||||
select_limit_cnt= select_limit_val + offset_limit_cnt;
|
select_limit_cnt= select_limit_val + offset_limit_cnt;
|
||||||
if (select_limit_cnt < select_limit_val)
|
if (select_limit_cnt < select_limit_val)
|
||||||
select_limit_cnt= HA_POS_ERROR; // no limit
|
select_limit_cnt= HA_POS_ERROR; // no limit
|
||||||
|
@ -304,7 +304,7 @@ protected:
|
|||||||
*link_next, **link_prev; /* list of whole SELECT_LEX */
|
*link_next, **link_prev; /* list of whole SELECT_LEX */
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ulonglong options;
|
ulong options;
|
||||||
/*
|
/*
|
||||||
result of this query can't be cached, bit field, can be :
|
result of this query can't be cached, bit field, can be :
|
||||||
UNCACHEABLE_DEPENDENT
|
UNCACHEABLE_DEPENDENT
|
||||||
|
@ -448,7 +448,9 @@ bool st_select_lex_unit::exec()
|
|||||||
table->no_keyread=1;
|
table->no_keyread=1;
|
||||||
}
|
}
|
||||||
res= sl->join->error;
|
res= sl->join->error;
|
||||||
offset_limit_cnt= sl->offset_limit ? sl->offset_limit->val_uint() : 0;
|
offset_limit_cnt= (ha_rows)(sl->offset_limit ?
|
||||||
|
sl->offset_limit->val_uint() :
|
||||||
|
0);
|
||||||
if (!res)
|
if (!res)
|
||||||
{
|
{
|
||||||
examined_rows+= thd->examined_row_count;
|
examined_rows+= thd->examined_row_count;
|
||||||
|
@ -5641,7 +5641,7 @@ delete_limit_clause:
|
|||||||
|
|
||||||
ulong_num:
|
ulong_num:
|
||||||
NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
|
NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
|
||||||
| HEX_NUM { int error; $$= (ulong) strtol($1.str, (char**) 0, 16); }
|
| HEX_NUM { $$= (ulong) strtol($1.str, (char**) 0, 16); }
|
||||||
| LONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
|
| LONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
|
||||||
| ULONGLONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
|
| ULONGLONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
|
||||||
| DECIMAL_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
|
| DECIMAL_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
|
||||||
|
@ -745,8 +745,9 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
|
|||||||
error.
|
error.
|
||||||
*/
|
*/
|
||||||
keyinfo->key_length-= (key_part->length - field->key_length());
|
keyinfo->key_length-= (key_part->length - field->key_length());
|
||||||
key_part->store_length-= (key_part->length - field->key_length());
|
key_part->store_length-= (uint16)(key_part->length -
|
||||||
key_part->length= field->key_length();
|
field->key_length());
|
||||||
|
key_part->length= (uint16)field->key_length();
|
||||||
sql_print_error("Found wrong key definition in %s; Please do \"ALTER TABLE '%s' FORCE \" to fix it!", name, share->table_name);
|
sql_print_error("Found wrong key definition in %s; Please do \"ALTER TABLE '%s' FORCE \" to fix it!", name, share->table_name);
|
||||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
|
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
|
||||||
ER_CRASHED_ON_USAGE,
|
ER_CRASHED_ON_USAGE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user