From ab0fa111fef1afbd04156624cdb29781f08adcac Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 31 Jan 2008 03:06:04 +0200 Subject: Fixed bug in restoring auto-increment value in case of duplicate key with insert or update Fixed bug when calculating max_key_length that caused some ALTER TABLE to fail if MAX_ROWS was used. Use maria_block_size instead of MARIA_MIN_KEY_BLOCK_LENGTH Fixed bug when scanning table with BLOCK format for repair; If table was > bitmap coverage one page block was read twice which caused a lot of duplicate key errors Could not repeat Bug#34106 "auto_increment is reset to 1 when table is recovered from crash" after this patch. NOTE: This is an incompatible change, so one must do maria_chk -r on ones old Maria tables! Sorry, but this was needed to fix the bug with max_key_length and to be able to handle bigger key files with smaller key references cmd-line-utils/readline/readline.c: Fixed compiler warnings mysql-test/r/maria.result: Added more test of auto-increment handling mysql-test/t/maria.test: Added more test of auto-increment handling mysys/my_pread.c: Fixed wrong test Removed not needed tests (error is always 1 if readbytes != Count) mysys/my_read.c: Fixed wrong test storage/maria/ha_maria.cc: Disable LOAD INDEX until I got Sanja's extension to pagecache interface storage/maria/ma_blockrec.c: Ensure that info->last_auto_increment is reset properly storage/maria/ma_check.c: Fixed wrong printing of row number in case of duplicate key for --safe-repair Safety fix in recreate table so that Column numbers are given to maria_create() in original order Added missing HA_OPEN_FOR_REPAIR to maria_open() Fixed bug when scanning table with BLOCK format for repair; If table was > bitmap coverage one page block was read twice which caused a lot of duplicate key errors storage/maria/ma_create.c: Use correct value for how much free space there is on a key page Remember some missing table option when doing re-create. Removed optimization where last packed fields is unpacked; Caused problems for re-create. storage/maria/ma_delete.c: Ensure that info->last_auto_increment is reset properly Fix for update to restore autoincrement value on duplicate key storage/maria/ma_key_recover.c: Moved handling of restoring value of auto-increment in case of duplicate key from clr to undo This ensures the restoring works both for insert and update and also that this is symetrical to how the auto_increment value is stored storage/maria/ma_key_recover.h: Added new prototype storage/maria/ma_loghandler.c: Added hook to write_hook_for_undo_key_delete() storage/maria/ma_open.c: Fixed wrong calculation of max_key_file_length storage/maria/ma_page.c: Use maria_block_size instead of MARIA_MIN_KEY_BLOCK_LENGTH Increase internal buffer (safety fix) storage/maria/ma_search.c: Use maria_block_size instead of MARIA_MIN_KEY_BLOCK_LENGTH Note that this is an incompatible change, so one must do maria_chk -r on ones old Maria tables (sorry) storage/maria/ma_update.c: Ensure that info->last_auto_increment is reset properly storage/maria/ma_write.c: Ensure that info->last_auto_increment is reset properly Fix for update to restore autoincrement value on duplicate key storage/maria/maria_chk.c: Allow small page_buffer_size Fixed printing for --describe to better fit into 80 characters storage/maria/maria_def.h: Added comments --- cmd-line-utils/readline/readline.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'cmd-line-utils') diff --git a/cmd-line-utils/readline/readline.c b/cmd-line-utils/readline/readline.c index c2b74006b05..d363c922fb5 100644 --- a/cmd-line-utils/readline/readline.c +++ b/cmd-line-utils/readline/readline.c @@ -90,7 +90,6 @@ static void bind_arrow_keys_internal PARAMS((Keymap)); static void bind_arrow_keys PARAMS((void)); static void readline_default_bindings PARAMS((void)); -static void reset_default_bindings PARAMS((void)); static int _rl_subseq_result PARAMS((int, Keymap, int, int)); static int _rl_subseq_getchar PARAMS((int)); @@ -287,7 +286,7 @@ rl_set_prompt (prompt) { FREE (rl_prompt); rl_prompt = prompt ? savestring (prompt) : (char *)NULL; - rl_display_prompt = rl_prompt ? rl_prompt : ""; + rl_display_prompt = rl_prompt ? rl_prompt : (char*) ""; rl_visible_prompt_length = rl_expand_prompt (rl_prompt); return 0; @@ -1072,18 +1071,6 @@ readline_default_bindings () rl_tty_set_default_bindings (_rl_keymap); } -/* Reset the default bindings for the terminal special characters we're - interested in back to rl_insert and read the new ones. */ -static void -reset_default_bindings () -{ - if (_rl_bind_stty_chars) - { - rl_tty_unset_default_bindings (_rl_keymap); - rl_tty_set_default_bindings (_rl_keymap); - } -} - /* Bind some common arrow key sequences in MAP. */ static void bind_arrow_keys_internal (map) -- cgit v1.2.1 From 8170b22b5ca69386fb2fcab479e989d084ca8774 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 13 Feb 2008 21:27:12 +0200 Subject: Fixed compiler warnings in a lot of files Added IMPOSSIBLE_RESULT to avoid compiler warnings when using (Item_result) -1 as a dummy value Changed PAGE_SIZE to TEST_PAGE_SIZE to avoid compiler errors on systems where PAGE_SIZE is defined client/get_password.c: Fixed compiler warning cmd-line-utils/readline/bind.c: Fixed compiler warning cmd-line-utils/readline/chardefs.h: Fixed compiler warning by adding marco to be used when largest_char is 255 cmd-line-utils/readline/display.c: Fixed compiler warnings by removing not accessed variables cmd-line-utils/readline/histexpand.c: Fixed compiler warnings by removing not accessed variables cmd-line-utils/readline/history.c: Fixed compiler warnings by adding cast cmd-line-utils/readline/text.c: Fixed compiler warnings by removing not accessed variables and adding casts dbug/dbug.c: Fixed compiler warnings by changing types include/mysql_com.h: Added IMPOSSIBLE_RESULT to avoid compiler warnings when using (Item_result) -1 as a dummy value libmysql/libmysql.c: Fixed compiler warning mysql-test/t/query_cache_debug.test: Mark test as BIG as it uses a lot of memory mysys/mf_iocache2.c: Fixed compiler warnings by adding cast sql/event_data_objects.cc: Fixed compiler warnings by removing not used code sql/events.cc: Fixed compiler warnings by removing not used code sql/field.cc: Fixed compiler warnings by adding cast and removed not accessed variables sql/ha_partition.cc: Fixed compiler warnings by removing not used code sql/item.cc: Fixed compiler warnings by removing not accessed variables Use IMPOSSIBLE_RESULT instead of (Item_result)-1 sql/item_cmpfunc.cc: Fixed compiler warnings by removing not accessed variables sql/item_func.cc: Fixed compiler warnings by removing not used code and not accessed variables Added IMPOSSIBLE_RESULT sql/item_subselect.cc: Fixed compiler warnings by removing not accessed variables sql/item_xmlfunc.cc: Fixed forgotten setting of xpath->error sql/log.cc: Fixed compiler warnings by removing not accessed variables sql/log_event.cc: Added IMPOSSIBLE_RESULT into switch Fixed wrong usage of DBUG_ASSERT(1) Removed always true DBUG_ASSERT() sql/mysqld.cc: Fixed compiler warnings by adding casts for ULONG_MAX sql/opt_sum.cc: Fixed compiler warnings by removing not used code Removed wrong DBUG_ASSERT() sql/partition_info.cc: Fixed compiler warnings by removing not accessed variables sql/rpl_injector.h: Removed always true part from DBUG_ASSERT() to remove compiler warning sql/spatial.cc: Fixed compiler warnings by removing not accessed variables sql/sql_acl.cc: Fixed compiler warnings by removing not accessed variables sql/sql_base.cc: Fixed compiler warnings by removing not accessed variables sql/sql_cache.cc: Fixed compiler warnings by removing not accessed variables sql/sql_class.cc: Fixed compiler warnings by: - Removing always true part from DBUG_ASSERT() - Removing not used code - Added IMPOSSIBLE_RESULT into switch sql/sql_load.cc: Fixed compiler warnings by removing not accessed variables sql/sql_parse.cc: Fixed compiler warnings by: - Removing not accessed variables - Removing always true part from DBUG_ASSERT() - Removing not used code sql/sql_plugin.cc: Added comment sql/sql_prepare.cc: Fixed compiler warnings by removing not accessed variables sql/sql_show.cc: Fixed compiler warnings by using correct cast sql/sql_table.cc: Fixed compiler warnings by removing not used code and removing not accessed variables sql/table.cc: Fixed compiler warnings by removing not accessed variables sql/time.cc: Fixed wrong DBUG_ASSERT(1) storage/maria/unittest/Makefile.am: Changed PAGE_SIZE to TEST_PAGE_SIZE to avoid compiler errors on systems where PAGE_SIZE is defined storage/maria/unittest/ma_pagecache_consist.c: Changed PAGE_SIZE to TEST_PAGE_SIZE to avoid compiler errors on systems where PAGE_SIZE is defined storage/maria/unittest/ma_pagecache_single.c: Changed PAGE_SIZE to TEST_PAGE_SIZE to avoid compiler errors on systems where PAGE_SIZE is defined tests/mysql_client_test.c: Fixed compiler warnings by removing not accessed variables and changing types --- cmd-line-utils/readline/bind.c | 2 +- cmd-line-utils/readline/chardefs.h | 1 + cmd-line-utils/readline/display.c | 12 ++++-------- cmd-line-utils/readline/histexpand.c | 3 +-- cmd-line-utils/readline/history.c | 2 +- cmd-line-utils/readline/text.c | 7 +++++-- 6 files changed, 13 insertions(+), 14 deletions(-) (limited to 'cmd-line-utils') diff --git a/cmd-line-utils/readline/bind.c b/cmd-line-utils/readline/bind.c index 08c906bfcc3..3e4c45467b1 100644 --- a/cmd-line-utils/readline/bind.c +++ b/cmd-line-utils/readline/bind.c @@ -701,7 +701,7 @@ rl_function_of_keyseq (keyseq, map, type) { unsigned char ic = keyseq[i]; - if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii) + if (META_CHAR_FOR_UCHAR(ic) && _rl_convert_meta_chars_to_ascii) { if (map[ESC].type == ISKMAP) { diff --git a/cmd-line-utils/readline/chardefs.h b/cmd-line-utils/readline/chardefs.h index def3a111bd3..a184ab30acb 100644 --- a/cmd-line-utils/readline/chardefs.h +++ b/cmd-line-utils/readline/chardefs.h @@ -60,6 +60,7 @@ #define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0)) #define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char) +#define META_CHAR_FOR_UCHAR(c) ((c) > meta_character_threshold) #define CTRL(c) ((c) & control_character_mask) #define META(c) ((c) | meta_character_bit) diff --git a/cmd-line-utils/readline/display.c b/cmd-line-utils/readline/display.c index 47ff0615974..90676b7ef7b 100644 --- a/cmd-line-utils/readline/display.c +++ b/cmd-line-utils/readline/display.c @@ -191,8 +191,6 @@ static int visible_first_line_len; (or is equal to) _rl_screenwidth. */ static int prompt_invis_chars_first_line; -static int prompt_last_screen_line; - static int prompt_physical_chars; /* Variables to save and restore prompt and display information. */ @@ -458,7 +456,7 @@ rl_redisplay () { register int in, out, c, linenum, cursor_linenum; register char *line; - int inv_botlin, lb_botlin, lb_linenum, o_cpos; + int inv_botlin, lb_linenum, o_cpos; int newlines, lpos, temp, modmark, n0, num; char *prompt_this_line; #if defined (HANDLE_MULTIBYTE) @@ -671,11 +669,9 @@ rl_redisplay () lpos -= _rl_screenwidth; } - prompt_last_screen_line = newlines; - /* Draw the rest of the line (after the prompt) into invisible_line, keeping track of where the cursor is (cpos_buffer_position), the number of the line containing - the cursor (lb_linenum), the last line number (lb_botlin and inv_botlin). + the cursor (lb_linenum), the last line number (inv_botlin). It maintains an array of line breaks for display (inv_lbreaks). This handles expanding tabs for display and displaying meta characters. */ lb_linenum = 0; @@ -858,7 +854,7 @@ rl_redisplay () lb_linenum = newlines; } - inv_botlin = lb_botlin = newlines; + inv_botlin = newlines; CHECK_INV_LBREAKS (); inv_lbreaks[newlines+1] = out; cursor_linenum = lb_linenum; @@ -1888,7 +1884,7 @@ rl_character_len (c, pos) uc = (unsigned char)c; - if (META_CHAR (uc)) + if (META_CHAR_FOR_UCHAR(uc)) return ((_rl_output_meta_chars == 0) ? 4 : 1); if (uc == '\t') diff --git a/cmd-line-utils/readline/histexpand.c b/cmd-line-utils/readline/histexpand.c index f46c0b2a45d..b7ebe7be9ba 100644 --- a/cmd-line-utils/readline/histexpand.c +++ b/cmd-line-utils/readline/histexpand.c @@ -693,7 +693,7 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line) case 's': { char *new_event; - int delimiter, failed, si, l_temp, ws, we; + int delimiter, failed, si, l_temp, we; if (c == 's') { @@ -792,7 +792,6 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line) { for (; temp[si] && whitespace (temp[si]); si++) ; - ws = si; we = history_tokenize_word (temp, si); } diff --git a/cmd-line-utils/readline/history.c b/cmd-line-utils/readline/history.c index 1ccf4db786c..47f49b523be 100644 --- a/cmd-line-utils/readline/history.c +++ b/cmd-line-utils/readline/history.c @@ -306,7 +306,7 @@ add_history (string) } } - temp = alloc_history_entry (string, hist_inittime ()); + temp = alloc_history_entry ((char*) string, hist_inittime ()); the_history[history_length] = (HIST_ENTRY *)NULL; the_history[history_length - 1] = temp; diff --git a/cmd-line-utils/readline/text.c b/cmd-line-utils/readline/text.c index 399a48c5f1e..5c7241abb1c 100644 --- a/cmd-line-utils/readline/text.c +++ b/cmd-line-utils/readline/text.c @@ -1169,7 +1169,7 @@ rl_insert_comment (count, key) int rl_comment_len; rl_beg_of_line (1, key); - rl_comment_text = _rl_comment_begin ? _rl_comment_begin : RL_COMMENT_BEGIN_DEFAULT; + rl_comment_text = _rl_comment_begin ? _rl_comment_begin : (char*) RL_COMMENT_BEGIN_DEFAULT; if (rl_explicit_arg == 0) rl_insert_text (rl_comment_text); @@ -1386,10 +1386,11 @@ rl_transpose_chars (count, key) #if defined (HANDLE_MULTIBYTE) char *dummy; int i; + int prev_point; #else char dummy[2]; #endif - int char_length, prev_point; + int char_length; if (count == 0) return 0; @@ -1408,7 +1409,9 @@ rl_transpose_chars (count, key) count = 1; } +#if defined (HANDLE_MULTIBYTE) prev_point = rl_point; +#endif rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO); #if defined (HANDLE_MULTIBYTE) -- cgit v1.2.1 From d13c54351dd7ec5c538ff746704c6a8096b25776 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Mon, 30 Nov 2009 01:08:56 +0200 Subject: Remove compiler warnings (Including some warnings from -Wstrict-aliasing) Don't use static link by default (in compile-pentium) as some new systems doesn't have all static libraries available Change type for functions in plugin.h:str_mysql_ftparser_param() to const unsigned char and string lengths to size_t. One effect of the above change is that one needs to include mysql_global.h or define size_t before including plugin.h This fixes a case where mysql_client_test failed with newer gcc that enables strict-aliasing by default BUILD/compile-pentium: Don't use static link by default as some new systems doesn't have all static libraries available client/mysql_upgrade.c: Remove not used variable cmd-line-utils/readline/config_readline.h: Define some constants to get rid of compiler warnings on Linux cmd-line-utils/readline/display.c: Get rid of compiler warnings cmd-line-utils/readline/history.c: Got rid of compiler warnings: - Defining some strings as const - Added cast cmd-line-utils/readline/rlmbutil.h: Added cast to get rid of compiler warnings cmd-line-utils/readline/text.c: Remove not needed initialization to get rid of compiler warnings cmd-line-utils/readline/xmalloc.c: Changed types to 'const char* to get rid of compiler warnings configure.in: Ensure that we use MariaDB as suffix include/mysql/plugin.h: Changed types to 'const unsigned char* to get rid of compiler warnings (in other parts of the code) Change length for not \0 terminated string to size_t include/mysql/plugin.h.pp: Update related to plugin.h libmysql/libmysql.c: Fixed bug that caused core dump with newer gcc when strict aliasing is not turned off mysql-test/t/information_schema.test: Test is depending on innodb mysql-test/t/not_partition.test: Fixed wrong directory name (Not noticed before as we don't ususally run this test) mysys/lf_hash.c: Got rid of compiler warnings from -Wstrict-aliasing mysys/my_redel.c: Removed not used variable regex/engine.c: Changed types to 'const char* to get rid of compiler warnings regex/engine.ih: Changed types to 'const char* to get rid of compiler warnings sql/sp_head.cc: Got rid of compiler warning from -Wstrict-aliasing sql/sql_base.cc: Got rid of compiler warnings from -Wstrict-aliasing (The original code was probably wrong as nj_col->table_field was sql/sql_builtin.cc.in: plugin.h needs to have size_t defined sql/sql_parse.cc: Remove used variable sql/sql_select.cc: Got rid of compiler warnings from -Wstrict-aliasing sql/sql_show.cc: Added #ifdef to get rid of compiler warning when not using partition engine sql/table.cc: Got rid of compiler warning from -Wstrict-aliasing storage/maria/ha_maria.cc: Got rid of compiler warnings from -Wstrict-aliasing: - Use the thd_killed() API function storage/maria/lockman.c: Got rid of compiler warnings from -Wstrict-aliasing storage/maria/ma_check.c: Got rid of compiler warnings from -Wstrict-aliasing Change to use new version of _ma_killed_ptr; Don't call it as often as before storage/maria/ma_check_standalone.h: Update to compatible _ma_killed_ptr() from ha_maria.cc storage/maria/ma_ft_boolean_search.c: Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts) storage/maria/ma_ft_nlq_search.c: Got rid of compiler warnings from -Wstrict-aliasing Ensure that 'subkeys' is 32 bit storage/maria/ma_ft_parser.c: Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts) storage/maria/ma_ftdefs.h: Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts) storage/maria/ma_sort.c: Change to use new version of _ma_killed_ptr; Don't call it as often as before storage/maria/ma_state.c: Got rid of compiler warnings from -Wstrict-aliasing storage/maria/maria_def.h: Redefine ma_killed_ptr() storage/maria/maria_ftdump.c: Got rid of compiler warnings from -Wstrict-aliasing storage/maria/trnman.c: Got rid of compiler warnings from -Wstrict-aliasing storage/myisam/ft_boolean_search.c: Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts) storage/myisam/ft_nlq_search.c: Got rid of compiler warnings from -Wstrict-aliasing storage/myisam/ft_parser.c: Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts) storage/myisam/ft_stopwords.c: Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts) storage/myisam/ftdefs.h: Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts) storage/myisam/ha_myisam.cc: Got rid of compiler warnings from -Wstrict-aliasing: - Use the thd_killed() API function storage/myisam/mi_check.c: Use new killed_ptr() function storage/myisam/myisam_ftdump.c: Got rid of compiler warnings from -Wstrict-aliasing storage/myisam/myisamchk.c: Update to compatible killed_ptr() from ha_myisam.cc storage/myisam/myisamdef.h: Redefine killed_ptr() storage/myisam/myisamlog.c: Got rid of compiler warnings from -Wstrict-aliasing storage/myisam/sort.c: Change to use new version of killed_ptr; Don't call it as often as before storage/xtradb/fil/fil0fil.c: Fixedc ompiler warning storage/xtradb/trx/trx0i_s.c: Include mysql_plugin.h later to ensure that size_t is defined --- cmd-line-utils/readline/config_readline.h | 5 +++++ cmd-line-utils/readline/display.c | 8 ++++---- cmd-line-utils/readline/history.c | 4 ++-- cmd-line-utils/readline/rlmbutil.h | 4 ++-- cmd-line-utils/readline/text.c | 2 +- cmd-line-utils/readline/xmalloc.c | 2 +- 6 files changed, 15 insertions(+), 10 deletions(-) (limited to 'cmd-line-utils') diff --git a/cmd-line-utils/readline/config_readline.h b/cmd-line-utils/readline/config_readline.h index 141989ec3c9..69bf18efc1f 100644 --- a/cmd-line-utils/readline/config_readline.h +++ b/cmd-line-utils/readline/config_readline.h @@ -7,6 +7,11 @@ # include #endif +/* to get wcwidth() defined */ +#define _XOPEN_SOURCE 600 +#define _XOPEN_SOURCE_EXTENDED +#define _XOPEN_ + /* Ultrix botches type-ahead when switching from canonical to non-canonical mode, at least through version 4.3 diff --git a/cmd-line-utils/readline/display.c b/cmd-line-utils/readline/display.c index 720ef3a82e4..fa710fc28b1 100644 --- a/cmd-line-utils/readline/display.c +++ b/cmd-line-utils/readline/display.c @@ -461,12 +461,12 @@ rl_redisplay () register char *line; int inv_botlin, lb_linenum, o_cpos; int newlines, lpos, temp, modmark; - char *prompt_this_line; + const char *prompt_this_line; #if defined (HANDLE_MULTIBYTE) - int num, n0; + int num, n0= 0; wchar_t wc; size_t wc_bytes; - int wc_width; + int wc_width= 0; mbstate_t ps; int _rl_wrapped_multicolumn = 0; #endif @@ -824,7 +824,7 @@ rl_redisplay () cpos_buffer_position = out; lb_linenum = newlines; } - for (i = in; i < in+wc_bytes; i++) + for (i = in; (size_t) i < in+wc_bytes; i++) line[out++] = rl_line_buffer[i]; for (i = 0; i < wc_width; i++) CHECK_LPOS(); diff --git a/cmd-line-utils/readline/history.c b/cmd-line-utils/readline/history.c index c81101fc555..c6c46482f50 100644 --- a/cmd-line-utils/readline/history.c +++ b/cmd-line-utils/readline/history.c @@ -211,14 +211,14 @@ history_get (offset) HIST_ENTRY * alloc_history_entry (string, ts) - char *string; + const char *string; char *ts; { HIST_ENTRY *temp; temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY)); - temp->line = string ? savestring (string) : string; + temp->line = string ? savestring ((char*) string) : (char*) string; temp->data = (char *)NULL; temp->timestamp = ts; diff --git a/cmd-line-utils/readline/rlmbutil.h b/cmd-line-utils/readline/rlmbutil.h index dd317e2a090..1ed402e0dba 100644 --- a/cmd-line-utils/readline/rlmbutil.h +++ b/cmd-line-utils/readline/rlmbutil.h @@ -109,8 +109,8 @@ extern int _rl_is_mbchar_matched PARAMS((char *, int, int, char *, int)); extern wchar_t _rl_char_value PARAMS((char *, int)); extern int _rl_walphabetic PARAMS((wchar_t)); -#define _rl_to_wupper(wc) (iswlower (wc) ? towupper (wc) : (wc)) -#define _rl_to_wlower(wc) (iswupper (wc) ? towlower (wc) : (wc)) +#define _rl_to_wupper(wc) (iswlower (wc) ? (wchar_t) towupper (wc) : (wc)) +#define _rl_to_wlower(wc) (iswupper (wc) ? (wchar_t) towlower (wc) : (wc)) #define MB_NEXTCHAR(b,s,c,f) \ ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) \ diff --git a/cmd-line-utils/readline/text.c b/cmd-line-utils/readline/text.c index 9c21e784e1f..774ba1eb2c0 100644 --- a/cmd-line-utils/readline/text.c +++ b/cmd-line-utils/readline/text.c @@ -614,7 +614,7 @@ rl_arrow_keys (count, c) #ifdef HANDLE_MULTIBYTE static char pending_bytes[MB_LEN_MAX]; static int pending_bytes_length = 0; -static mbstate_t ps = {0}; +static mbstate_t ps; #endif /* Insert the character C at the current location, moving point forward. diff --git a/cmd-line-utils/readline/xmalloc.c b/cmd-line-utils/readline/xmalloc.c index cf52da351a8..1a086852552 100644 --- a/cmd-line-utils/readline/xmalloc.c +++ b/cmd-line-utils/readline/xmalloc.c @@ -42,7 +42,7 @@ static void memory_error_and_abort (fname) - char *fname; + const char *fname; { fprintf (stderr, "%s: out of virtual memory\n", fname); exit (2); -- cgit v1.2.1 From 27f4f67bd2f35bf710f1a4e4ddde0e42738a195d Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Tue, 1 Dec 2009 18:09:02 +0200 Subject: Fixed link problem when compiling without uca cmd-line-utils/readline/config_readline.h: Add back defines needed for linux to get rid of compiler warnings, but hide them for now until we have a solution for compile failure on MacOSX strings/ctype-uca.c: Always define UCA contraction functions used by ctype-mb.c --- cmd-line-utils/readline/config_readline.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cmd-line-utils') diff --git a/cmd-line-utils/readline/config_readline.h b/cmd-line-utils/readline/config_readline.h index 141989ec3c9..9aa464958bb 100644 --- a/cmd-line-utils/readline/config_readline.h +++ b/cmd-line-utils/readline/config_readline.h @@ -7,6 +7,13 @@ # include #endif +#ifdef NOT_YET /* causes problem on MacOSX */ +/* to get wcwidth() defined */ +#define _XOPEN_SOURCE 600 +#define _XOPEN_SOURCE_EXTENDED +#define _XOPEN_ +#endif + /* Ultrix botches type-ahead when switching from canonical to non-canonical mode, at least through version 4.3 -- cgit v1.2.1 From cebec393cf0a5558a2800fb193ba098bda4eabe1 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Wed, 31 Mar 2010 22:12:21 +0300 Subject: Fixed compiler warnings Fixed random failure in test system BUILD/compile-solaris-sparc: Addex EXTRA_FLAGS to configure line (to get rid of warnings for not initialzed variables on buildbot) cmd-line-utils/libedit/filecomplete.c: Remove not used variables mysql-test/suite/rpl/r/rpl_optimize.result: Updated result mysql-test/suite/rpl/t/rpl_optimize.test: Use sync_salve_with_master to ensure cleanup on slave support-files/compiler_warnings.supp: Added suppression of libedit files --- cmd-line-utils/libedit/filecomplete.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cmd-line-utils') diff --git a/cmd-line-utils/libedit/filecomplete.c b/cmd-line-utils/libedit/filecomplete.c index 4c63f57bc45..05bd10e9f9e 100644 --- a/cmd-line-utils/libedit/filecomplete.c +++ b/cmd-line-utils/libedit/filecomplete.c @@ -95,10 +95,9 @@ static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', '@', '$', char * fn_tilde_expand(const char *txt) { - struct passwd pwres, *pass; + struct passwd *pass; char *temp; size_t len = 0; - char pwbuf[1024]; if (txt[0] != '~') return (strdup(txt)); -- cgit v1.2.1