From ee2b4ec959b5813eb2105ea068ae3f725b106a3b Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Fri, 18 Mar 2005 16:12:25 -0800 Subject: [PATCH 1/8] Eliminate warnings noticed by VC7. This includes fixing my_mmap() on Windows to call CreateFileMapping() with correct arguments, and propogating the introduction of query_id_t to everywhere query ids are passed around. (Bug #8826) --- libmysql/libmysql.c | 2 +- myisam/mi_open.c | 4 ++-- myisam/mi_packrec.c | 2 +- mysys/my_mmap.c | 7 +++++-- sql/field.cc | 7 ++++--- sql/field.h | 2 +- sql/ha_berkeley.cc | 4 ++-- sql/ha_innodb.h | 2 +- sql/handler.cc | 7 ++++++- sql/handler.h | 2 +- sql/item.cc | 6 +++--- sql/item_cmpfunc.cc | 2 +- sql/item_func.cc | 2 +- sql/item_strfunc.cc | 2 +- sql/item_subselect.cc | 2 +- sql/log.cc | 10 +++++----- sql/mysql_priv.h | 15 +++++++-------- sql/opt_range.cc | 1 + sql/set_var.cc | 2 +- sql/sql_cache.cc | 1 - sql/sql_class.h | 7 ++++--- sql/sql_db.cc | 3 ++- sql/sql_help.cc | 1 - sql/sql_insert.cc | 6 +++--- sql/sql_lex.h | 2 ++ sql/sql_select.cc | 3 +-- sql/sql_select.h | 2 +- sql/sql_table.cc | 2 +- sql/sql_update.cc | 4 ++-- sql/table.h | 2 +- strings/ctype-simple.c | 2 +- strings/ctype-ucs2.c | 2 +- strings/ctype-utf8.c | 4 ++-- 33 files changed, 66 insertions(+), 56 deletions(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 9746cb222fa..f3809c9257e 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -3608,7 +3608,7 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, if (is_unsigned) data= ulonglong2double(value); else - data= value; + data= (double)value; doublestore(buffer, data); *param->error= is_unsigned ? ((ulonglong) value) != ((ulonglong) (*(double*) buffer)) : diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 504bc33ecc1..d65a46a92fb 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -1090,10 +1090,10 @@ char *mi_keyseg_read(char *ptr, HA_KEYSEG *keyseg) keyseg->null_pos = mi_uint4korr(ptr); ptr +=4; keyseg->charset=0; /* Will be filled in later */ if (keyseg->null_bit) - keyseg->bit_pos= keyseg->null_pos + (keyseg->null_bit == 7); + keyseg->bit_pos= (uint16)(keyseg->null_pos + (keyseg->null_bit == 7)); else { - keyseg->bit_pos= keyseg->null_pos; + keyseg->bit_pos= (uint16)keyseg->null_pos; keyseg->null_pos= 0; } return ptr; diff --git a/myisam/mi_packrec.c b/myisam/mi_packrec.c index cc62614cb07..4b512dd89dd 100644 --- a/myisam/mi_packrec.c +++ b/myisam/mi_packrec.c @@ -1212,7 +1212,7 @@ my_bool _mi_memmap_file(MI_INFO *info) DBUG_RETURN(0); } file_map=(byte*) - my_mmap(0,share->state.state.data_file_length+MEMMAP_EXTRA_MARGIN,PROT_READ, + my_mmap(0,(size_t)(share->state.state.data_file_length+MEMMAP_EXTRA_MARGIN),PROT_READ, MAP_SHARED | MAP_NORESERVE,info->dfile,0L); if (file_map == (byte*) MAP_FAILED) { diff --git a/mysys/my_mmap.c b/mysys/my_mmap.c index a111c3dc571..cd84630a761 100644 --- a/mysys/my_mmap.c +++ b/mysys/my_mmap.c @@ -46,11 +46,14 @@ void *my_mmap(void *addr, size_t len, int prot, DWORD flProtect=0; HANDLE hFileMap; LPVOID ptr; + HANDLE hFile= (HANDLE)_get_osfhandle(fd); + if (hFile == INVALID_HANDLE_VALUE) + return MAP_FAILED; flProtect|=SEC_COMMIT; - hFileMap=CreateFileMapping(fd, NULL, &mmap_security_attributes, - PAGE_READWRITE, 0, len, 0); + hFileMap=CreateFileMapping(hFile, &mmap_security_attributes, + PAGE_READWRITE, 0, len, NULL); if (hFileMap == 0) return MAP_FAILED; diff --git a/sql/field.cc b/sql/field.cc index b6dd00d62a7..84024a63266 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2451,14 +2451,15 @@ static bool test_if_minus(CHARSET_INFO *cs, int Field_long::store(const char *from,uint len,CHARSET_INFO *cs) { + ulong tmp_scan; longlong tmp; long store_tmp; int error; char *end; - tmp= cs->cset->scan(cs, from, from+len, MY_SEQ_SPACES); - len-= tmp; - from+= tmp; + tmp_scan= cs->cset->scan(cs, from, from+len, MY_SEQ_SPACES); + len-= tmp_scan; + from+= tmp_scan; end= (char*) from+len; tmp= cs->cset->my_strtoll10(cs, from, &end, &error); diff --git a/sql/field.h b/sql/field.h index 5b13ba1042a..16fa4a58d0c 100644 --- a/sql/field.h +++ b/sql/field.h @@ -49,7 +49,7 @@ public: struct st_table *orig_table; // Pointer to original table const char **table_name, *field_name; LEX_STRING comment; - ulong query_id; // For quick test of used fields + query_id_t query_id; // For quick test of used fields /* Field is part of the following keys */ key_map key_start,part_of_key,part_of_sortkey; /* diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index a6cc05e1fdb..da4d34e6060 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -1548,7 +1548,7 @@ int ha_berkeley::index_read(byte * buf, const byte * key, do_prev= 1; } if (key_len == key_info->key_length && - !table->key_info[active_index].flags & HA_END_SPACE_KEY) + !(table->key_info[active_index].flags & HA_END_SPACE_KEY)) { if (find_flag == HA_READ_AFTER_KEY) key_info->handler.bdb_return_if_eq= 1; @@ -1646,7 +1646,7 @@ int ha_berkeley::index_next_same(byte * buf, const byte *key, uint keylen) &LOCK_status); bzero((char*) &row,sizeof(row)); if (keylen == table->key_info[active_index].key_length && - !table->key_info[active_index].flags & HA_END_SPACE_KEY) + !(table->key_info[active_index].flags & HA_END_SPACE_KEY)) error=read_row(cursor->c_get(cursor, &last_key, &row, DB_NEXT_DUP), (char*) buf, active_index, &row, &last_key, 1); else diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index e1ed3a486cf..6ad385ae848 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -47,7 +47,7 @@ class ha_innobase: public handler THD* user_thd; /* the thread handle of the user currently using the handle; this is set in external_lock function */ - ulong last_query_id; /* the latest query id where the + query_id_t last_query_id; /* the latest query id where the handle was used */ THR_LOCK_DATA lock; INNOBASE_SHARE *share; diff --git a/sql/handler.cc b/sql/handler.cc index df0d7704163..36c14660a95 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -416,7 +416,12 @@ int ha_init() } #endif DBUG_ASSERT(total_ha < MAX_HA); - opt_using_transactions= total_ha>opt_bin_log; + /* + Check if there is a transaction-capable storage engine besides the + binary log (which is considered a transaction-capable storage engine in + counting total_ha) + */ + opt_using_transactions= total_ha>(ulong)opt_bin_log; savepoint_alloc_size+= sizeof(SAVEPOINT); return error; } diff --git a/sql/handler.h b/sql/handler.h index c8e1d75f2f7..f6d876fe0ad 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -379,7 +379,7 @@ typedef struct st_savepoint SAVEPOINT; extern ulong savepoint_alloc_size; /* Forward declaration for condition pushdown to storage engine */ -typedef struct Item COND; +typedef class Item COND; typedef struct st_ha_check_opt { diff --git a/sql/item.cc b/sql/item.cc index 64fc2696f1f..e5793e349ff 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -178,7 +178,7 @@ bool Item::val_bool() { switch(result_type()) { case INT_RESULT: - return val_int(); + return val_int() != 0; case DECIMAL_RESULT: { my_decimal decimal_value; @@ -1217,7 +1217,7 @@ bool Item_field::val_bool_result() return FALSE; switch (result_field->result_type()) { case INT_RESULT: - return result_field->val_int(); + return result_field->val_int() != 0; case DECIMAL_RESULT: { my_decimal decimal_value; @@ -3946,7 +3946,7 @@ bool Item_ref::val_bool_result() return 0; switch (result_field->result_type()) { case INT_RESULT: - return result_field->val_int(); + return result_field->val_int() != 0; case DECIMAL_RESULT: { my_decimal decimal_value; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index c0cb0704852..9850b01561e 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1720,7 +1720,7 @@ void Item_func_coalesce::fix_length_and_dec() decimals= 0; break; case ROW_RESULT: - defaullt: + default: DBUG_ASSERT(0); } } diff --git a/sql/item_func.cc b/sql/item_func.cc index 5eb87c2e92b..53c0cf4c05a 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -882,7 +882,7 @@ my_decimal *Item_func_numhybrid::val_decimal(my_decimal *decimal_value) } case REAL_RESULT: { - double result= int_op(); + double result= (double)int_op(); double2my_decimal(E_DEC_FATAL_ERROR, result, decimal_value); break; } diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 81120bbe3f7..3fe1b819f36 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2888,7 +2888,7 @@ String *Item_func_uuid::val_str(String *str) with a clock_seq value (initialized random below), we use a separate randominit() here */ - randominit(&uuid_rand, tmp + (ulong) thd, tmp + query_id); + randominit(&uuid_rand, tmp + (ulong) thd, tmp + (ulong)query_id); for (i=0; i < (int)sizeof(mac); i++) mac[i]=(uchar)(my_rnd(&uuid_rand)*255); } diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 46b2770a12a..378144c707c 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -675,7 +675,7 @@ bool Item_exists_subselect::val_bool() reset(); return 0; } - return value; + return value != 0; } diff --git a/sql/log.cc b/sql/log.cc index 43786990797..af1e59df255 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2505,7 +2505,7 @@ int TC_LOG_MMAP::open(const char *opt_name) goto err; } - data= (uchar *)my_mmap(0, file_length, PROT_READ|PROT_WRITE, + data= (uchar *)my_mmap(0, (size_t)file_length, PROT_READ|PROT_WRITE, MAP_NOSYNC|MAP_SHARED, fd, 0); if (data == MAP_FAILED) { @@ -2514,7 +2514,7 @@ int TC_LOG_MMAP::open(const char *opt_name) } inited=2; - npages=file_length/tc_log_page_size; + npages=(uint)file_length/tc_log_page_size; DBUG_ASSERT(npages >= 3); // to guarantee non-empty pool if (!(pages=(PAGE *)my_malloc(npages*sizeof(PAGE), MYF(MY_WME|MY_ZEROFILL)))) goto err; @@ -2540,7 +2540,7 @@ int TC_LOG_MMAP::open(const char *opt_name) goto err; memcpy(data, tc_log_magic, sizeof(tc_log_magic)); - data[sizeof(tc_log_magic)]= total_ha_2pc; + data[sizeof(tc_log_magic)]= (uchar)total_ha_2pc; my_msync(fd, data, tc_log_page_size, MS_SYNC); inited=5; @@ -2794,7 +2794,7 @@ void TC_LOG_MMAP::close() case 3: my_free((gptr)pages, MYF(0)); case 2: - my_munmap(data, file_length); + my_munmap(data, (size_t)file_length); case 1: my_close(fd, MYF(0)); } @@ -2842,7 +2842,7 @@ int TC_LOG_MMAP::recover() goto err2; hash_free(&xids); - bzero(data, file_length); + bzero(data, (size_t)file_length); return 0; err2: diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index ba9f382fc33..dfa945c3fd3 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -44,6 +44,13 @@ typedef ulonglong table_map; /* Used for table bits in join */ typedef Bitmap<64> key_map; /* Used for finding keys */ typedef ulong key_part_map; /* Used for finding key parts */ +/* query_id */ +typedef ulonglong query_id_t; +extern query_id_t query_id; + +/* increment query_id and return it. */ +inline query_id_t next_query_id() { return query_id++; } + /* useful constants */ extern const key_map key_map_empty; extern const key_map key_map_full; @@ -1300,14 +1307,6 @@ SQL_CRYPT *get_crypt_for_frm(void); #include "sql_view.h" -/* query_id */ - -typedef ulonglong query_id_t; -extern query_id_t query_id; - -/* increment query_id and return it. */ -inline query_id_t next_query_id() { return query_id++; } - /* Some inline functions for more speed */ inline bool add_item_to_list(THD *thd, Item *item) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index fe1780b92a7..85cd35a5673 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1407,6 +1407,7 @@ public: static void *operator new(size_t size, MEM_ROOT *mem_root) { return (void*) alloc_root(mem_root, (uint) size); } static void operator delete(void *ptr,size_t size) { TRASH(ptr, size); } + static void operator delete(void *ptr, MEM_ROOT *mem_root) { /* Never called */ } }; class TRP_ROR_INTERSECT; diff --git a/sql/set_var.cc b/sql/set_var.cc index 23dbb22399b..0c9483b2783 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2652,7 +2652,7 @@ bool sys_var_max_user_conn::update(THD *thd, set_var *var) { DBUG_ASSERT(var->type == OPT_GLOBAL); pthread_mutex_lock(&LOCK_global_system_variables); - max_user_connections= var->save_result.ulonglong_value; + max_user_connections= (uint)var->save_result.ulonglong_value; pthread_mutex_unlock(&LOCK_global_system_variables); return 0; } diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 5fa161257c7..4a4f61f985c 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -2225,7 +2225,6 @@ my_bool Query_cache::register_all_tables(Query_cache_block *block, n= register_tables_from_list(tables_used, 0, block_table); -err: if (n) { DBUG_PRINT("qcache", ("failed at table %d", (int) n)); diff --git a/sql/sql_class.h b/sql/sql_class.h index ffb7a9ab12d..6d6ac810fbf 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1168,8 +1168,8 @@ public: from table are necessary for this select, to check if it's necessary to update auto-updatable fields (like auto_increment and timestamp). */ - ulong query_id; - ulong warn_id, version, options, thread_id, col_access; + query_id_t query_id, warn_id; + ulong version, options, thread_id, col_access; /* Statement id is thread-wide. This counter is used to generate ids */ ulong statement_id_counter; @@ -1797,7 +1797,8 @@ class user_var_entry public: LEX_STRING name; char *value; - ulong length, update_query_id, used_query_id; + ulong length; + query_id_t update_query_id, used_query_id; Item_result type; double val_real(my_bool *null_value); diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 8a0ed1d5b87..1f345a28d2c 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -875,12 +875,13 @@ err: static my_bool rm_dir_w_symlink(const char *org_path, my_bool send_error) { - char tmp_path[FN_REFLEN], tmp2_path[FN_REFLEN], *pos; + char tmp_path[FN_REFLEN], *pos; char *path= tmp_path; DBUG_ENTER("rm_dir_w_symlink"); unpack_filename(tmp_path, org_path); #ifdef HAVE_READLINK int error; + char tmp2_path[FN_REFLEN]; /* Remove end FN_LIBCHAR as this causes problem on Linux in readlink */ pos= strend(path); diff --git a/sql/sql_help.cc b/sql/sql_help.cc index fa3e2070a28..3c8e8e55c1f 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -763,7 +763,6 @@ bool mysqld_help(THD *thd, const char *mask) } send_eof(thd); -end: DBUG_RETURN(FALSE); error: DBUG_RETURN(TRUE); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index e2ab7ea12c5..691c7c1a98b 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -31,7 +31,7 @@ static void end_delayed_insert(THD *thd); extern "C" pthread_handler_decl(handle_delayed_insert,arg); static void unlink_blobs(register TABLE *table); #endif -static bool check_view_insertability(TABLE_LIST *view, ulong query_id); +static bool check_view_insertability(TABLE_LIST *view, query_id_t query_id); /* Define to force use of my_malloc() if the allocated memory block is big */ @@ -538,7 +538,7 @@ abort: TRUE - can't be used for insert */ -static bool check_view_insertability(TABLE_LIST *view, ulong query_id) +static bool check_view_insertability(TABLE_LIST *view, query_id_t query_id) { uint num= view->view->select_lex.item_list.elements; TABLE *table= view->table; @@ -546,7 +546,7 @@ static bool check_view_insertability(TABLE_LIST *view, ulong query_id) *trans_end= trans_start + num; Field_translator *trans; Field **field_ptr= table->field; - ulong other_query_id= query_id - 1; + query_id_t other_query_id= query_id - 1; DBUG_ENTER("check_key_in_view"); DBUG_ASSERT(view->table != 0 && view->field_translation != 0); diff --git a/sql/sql_lex.h b/sql/sql_lex.h index afd48943439..00e30bd320b 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -892,6 +892,8 @@ struct st_lex_local: public st_lex } static void operator delete(void *ptr,size_t size) { TRASH(ptr, size); } + static void operator delete(void *ptr, MEM_ROOT *mem_root) + { /* Never called */ } }; void lex_init(void); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2bb4cef1247..90d088183b5 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -6646,7 +6646,6 @@ static COND *build_equal_items(THD *thd, COND *cond, { if (table->on_expr) { - Item *expr; List *join_list= table->nested_join ? &table->nested_join->join_list : NULL; /* @@ -8545,7 +8544,7 @@ static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param, seg->type= ((keyinfo->key_part[i].key_type & FIELDFLAG_BINARY) ? HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2); - seg->bit_start= field->pack_length() - table->s->blob_ptr_size; + seg->bit_start= (uint8)(field->pack_length() - table->s->blob_ptr_size); seg->flag= HA_BLOB_PART; seg->length=0; // Whole blob in unique constraint } diff --git a/sql/sql_select.h b/sql/sql_select.h index 02e1dde8a7f..353f1fc5157 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -351,7 +351,7 @@ class Cursor: public Sql_alloc, public Item_arena MYSQL_LOCK *lock; TABLE *derived_tables; /* List of items created during execution */ - ulong query_id; + query_id_t query_id; public: select_send result; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 8295e2f07ab..82d887891cf 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2052,7 +2052,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, thd->no_warnings_for_error= 0; table->next_global= next_global_table; /* if view are unsupported */ - if (table->view && !view_operator_func) + if (table->view && view_operator_func == NULL) { result_code= HA_ADMIN_NOT_IMPLEMENTED; goto send_result; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 3ee656b00ce..bb0ac31bdc7 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -29,7 +29,7 @@ static bool safe_update_on_fly(JOIN_TAB *join_tab, List *fields); /* Return 0 if row hasn't changed */ -static bool compare_record(TABLE *table, ulong query_id) +static bool compare_record(TABLE *table, query_id_t query_id) { if (table->s->blob_fields + table->s->varchar_fields == 0) return cmp_record(table,record[1]); @@ -125,7 +125,7 @@ int mysql_update(THD *thd, uint want_privilege; #endif uint table_count= 0; - ulong query_id=thd->query_id, timestamp_query_id; + query_id_t query_id=thd->query_id, timestamp_query_id; ha_rows updated, found; key_map old_used_keys; TABLE *table; diff --git a/sql/table.h b/sql/table.h index 49ead2cb0b7..4312e09cfe3 100644 --- a/sql/table.h +++ b/sql/table.h @@ -188,7 +188,7 @@ struct st_table { ORDER *group; const char *alias; /* alias or table name */ uchar *null_flags; - ulong query_id; + query_id_t query_id; ha_rows quick_rows[MAX_KEY]; key_part_map const_key_parts[MAX_KEY]; diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 61e7cf1571b..91888771c80 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -894,7 +894,7 @@ int my_longlong10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)), while (long_val != 0) { long quo= long_val/10; - *--p = '0' + (long_val - quo*10); + *--p = '0' + (char)(long_val - quo*10); long_val= quo; } diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 797bc9f9047..72483ce5c4c 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1049,7 +1049,7 @@ int my_ll10tostr_ucs2(CHARSET_INFO *cs __attribute__((unused)), while (long_val != 0) { long quo= long_val/10; - *--p = '0' + (long_val - quo*10); + *--p = '0' + (char)(long_val - quo*10); long_val= quo; } diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 187e5cb9e4a..3b52577c358 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -2264,8 +2264,8 @@ static int my_strnxfrm_utf8(CHARSET_INFO *cs, plane=(wc>>8) & 0xFF; wc = uni_plane[plane] ? uni_plane[plane][wc & 0xFF].sort : wc; - *dst++= wc >> 8; - *dst++= wc & 0xFF; + *dst++= (uchar)(wc >> 8); + *dst++= (uchar)(wc & 0xFF); } From 954ef465bc3af1ee9f82e15994925e752cb3df90 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Fri, 18 Mar 2005 16:14:49 -0800 Subject: [PATCH 2/8] Removed MyISAM RAID from the Linux "Max" RPMs (patch from lenz, reapplied by jimw) --- support-files/mysql.spec.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index b062930041a..bad340e9de1 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -214,7 +214,6 @@ Optional MySQL server binary that supports additional features like: - CSV Storage Engine - Example Storage Engine - Federated Storage Engine - - MyISAM RAID - User Defined Functions (UDFs). To activate this binary, just install this package in addition to @@ -328,7 +327,6 @@ BuildMySQL "--enable-shared \ --with-berkeley-db \ --with-innodb \ --with-ndbcluster \ - --with-raid \ --with-archive \ --with-csv-storage-engine \ --with-example-storage-engine \ @@ -694,9 +692,14 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Fri Mar 18 2005 Lenz Grimmer + +- Disabled RAID in the Max binaries once and for all (it has finally been + removed from the source tree) + * Sun Feb 20 2005 Petr Chardin -- Install MySQL Instance Manager together with mysqld, toch mysqlmanager +- Install MySQL Instance Manager together with mysqld, touch mysqlmanager password file * Mon Feb 14 2005 Lenz Grimmer From 7de90716b0ebd78bf53dbb5d1327efe329139006 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Fri, 18 Mar 2005 16:15:33 -0800 Subject: [PATCH 3/8] Fix Windows compile errors. --- sql/item_sum.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index b18653ed5a4..dd95a83a921 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -2128,7 +2128,7 @@ my_decimal *Item_variance_field::val_decimal(my_decimal *dec_buf) int simple_str_key_cmp(void* arg, byte* key1, byte* key2) { Field *f= (Field*) arg; - return f->cmp(key1, key2); + return f->cmp((const char*)key1, (const char*)key2); } /* @@ -2158,16 +2158,12 @@ int composite_key_cmp(void* arg, byte* key1, byte* key2) } -C_MODE_START - static int count_distinct_walk(void *elem, unsigned int count, void *arg) { (*((ulonglong*)arg))++; return 0; } -C_MODE_END - void Item_sum_count_distinct::cleanup() { From 146994ed4c41f761ea34ff72fd2b21ca44a27ef6 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Fri, 18 Mar 2005 16:17:10 -0800 Subject: [PATCH 4/8] Fix 'kill' test to actually test that the connection has been killed. --- mysql-test/r/kill.result | 6 ++++++ mysql-test/t/kill.test | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result index f57c134b6d0..2413834be4f 100644 --- a/mysql-test/r/kill.result +++ b/mysql-test/r/kill.result @@ -5,6 +5,12 @@ select ((@id := kill_id) - kill_id) from t1; ((@id := kill_id) - kill_id) 0 kill @id; +select ((@id := kill_id) - kill_id) from t1; +((@id := kill_id) - kill_id) +0 +select @id != connection_id(); +@id != connection_id() +1 select 4; 4 4 diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test index 8a9d96d4946..8492a2a2f8e 100644 --- a/mysql-test/t/kill.test +++ b/mysql-test/t/kill.test @@ -27,8 +27,9 @@ kill @id; --sleep 5 # verify that con1 is doning a reconnect connection con1; -ping -ping +--ping +--ping +select ((@id := kill_id) - kill_id) from t1; select @id != connection_id(); #make sure the server is still alive From 31ecea8a0fadaf817dce3177efc287d6ffbbeeba Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Fri, 18 Mar 2005 16:18:06 -0800 Subject: [PATCH 5/8] Manually import InnoDB fix into build tree. --- innobase/include/data0type.ic | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/innobase/include/data0type.ic b/innobase/include/data0type.ic index bf04e1c9b27..a87a08ca582 100644 --- a/innobase/include/data0type.ic +++ b/innobase/include/data0type.ic @@ -195,10 +195,12 @@ dtype_get_pad_char( || type->mtype == DATA_BINARY || type->mtype == DATA_FIXBINARY || type->mtype == DATA_MYSQL - || type->mtype == DATA_VARMYSQL) { + || type->mtype == DATA_VARMYSQL + || (type->mtype == DATA_BLOB + && (type->prtype & DATA_BINARY_TYPE) == 0)) { /* Space is the padding character for all char and binary - strings */ + strings, and starting from 5.0.3, also for TEXT strings. */ return((ulint)' '); } From eeb42a8d3853e08ef9d60005f7fb2b45edb11506 Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Sun, 20 Mar 2005 14:38:51 +0100 Subject: [PATCH 6/8] Import Heikki's patch which was applied to the main tree only. --- mysql-test/r/endspace.result | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/r/endspace.result b/mysql-test/r/endspace.result index e9396c9a6ed..0e68418a80f 100644 --- a/mysql-test/r/endspace.result +++ b/mysql-test/r/endspace.result @@ -201,10 +201,12 @@ teststring select text1, length(text1) from t1 where text1='teststring' or text1 like 'teststring_%'; text1 length(text1) teststring 11 +teststring 10 teststring 11 select text1, length(text1) from t1 where text1='teststring' or text1 >= 'teststring\t'; text1 length(text1) teststring 11 +teststring 10 teststring 11 select concat('|', text1, '|') from t1 order by text1; concat('|', text1, '|') From c87912c8da17ee9734b1b37cbc59c76bc68f41d2 Mon Sep 17 00:00:00 2001 From: "dlenev@brandersnatch.localdomain" <> Date: Sun, 20 Mar 2005 20:29:03 +0300 Subject: [PATCH 7/8] Fix for spurious failures of sp.test on many platforms (aka Bug #9161 "Warnings on 'drop procedure' platform-specific"). In mysqltest we should not issue "SHOW WARNINGS" until we have not read results from all statements in multi-statement. Otherwise such "SHOW WARNINGS" will either cause "Packets out of order" error and thus will ruin current connection (but we may not notice this as it happened in sp.test because we ignore errors from such auxilary SHOW WARNINGS and use auto-reconnecting connections) or will succeed but consume first packet from next statement in multi-statement sequence (this happens if "SHOW WARNINGS" is issued when this packet is already received by client. Packet is thrown away by net_clear() call which is issued when "SHOW WARNINGS" is sent to server). In our case sp.test failed because usually we had first situation but sometimes second situation occured causing warning to pop-up. --- client/mysqltest.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index f6f6f469e8c..c1ff16e5d88 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -2746,8 +2746,13 @@ static int run_query_normal(MYSQL* mysql, struct st_query* q, int flags) append_result(ds, res); } - /* Add all warnings to the result */ - if (!disable_warnings && mysql_warning_count(mysql)) + /* + Add all warnings to the result. We can't do this if we are in + the middle of processing results from multi-statement, because + this will break protocol. + */ + if (!disable_warnings && !mysql_more_results(mysql) && + mysql_warning_count(mysql)) { MYSQL_RES *warn_res=0; uint count= mysql_warning_count(mysql); @@ -3363,6 +3368,13 @@ static void run_query_stmt_handle_warnings(MYSQL *mysql, DYNAMIC_STRING *ds) if (!disable_warnings && (count= mysql_warning_count(mysql))) { + /* + If one day we will support execution of multi-statements + through PS API we should not issue SHOW WARNINGS until + we have not read all results... + */ + DBUG_ASSERT(!mysql_more_results(mysql)); + if (mysql_real_query(mysql, "SHOW WARNINGS", 13) == 0) { MYSQL_RES *warn_res= mysql_store_result(mysql); From 0ae33dfd36cf8b6ec4d74e144fb4761a581afca2 Mon Sep 17 00:00:00 2001 From: "patg@krsna." <> Date: Sun, 20 Mar 2005 23:17:35 -0800 Subject: [PATCH 8/8] Federated Storage Handler - test and result fix. --- mysql-test/r/federated.result | 2 +- mysql-test/t/federated.test | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index a012550ef5f..6c815e94b7c 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -106,7 +106,7 @@ CREATE TABLE federated.`t1%` ( `name` varchar(32) NOT NULL default '' ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 -COMMENT='mysql://root@127.0.0.1:9308/federated/t1%'; +COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1%'; INSERT INTO federated.`t1%` (id, name) VALUES (1, 'foo'); INSERT INTO federated.`t1%` (id, name) VALUES (2, 'fee'); SELECT * FROM federated.`t1%`; diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index db7e712bd5f..6a0e0bdac79 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -125,6 +125,7 @@ SELECT * FROM federated.t1; DELETE FROM federated.t1; DROP TABLE IF EXISTS federated.t1; +--replace_result $SLAVE_MYPORT SLAVE_PORT eval CREATE TABLE federated.`t1%` ( `id` int(20) NOT NULL, `name` varchar(32) NOT NULL default ''