From 3eebfde64480a66b3c8503f337102b9e63f3722a Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Fri, 13 May 2005 11:59:17 +0200 Subject: [PATCH 1/3] readline.h: Include for CodeWarrior and CTRL define --- cmd-line-utils/libedit/readline/readline.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd-line-utils/libedit/readline/readline.h b/cmd-line-utils/libedit/readline/readline.h index 902179c208a..c43f71fb51d 100644 --- a/cmd-line-utils/libedit/readline/readline.h +++ b/cmd-line-utils/libedit/readline/readline.h @@ -73,7 +73,7 @@ typedef KEYMAP_ENTRY *Keymap; #ifndef CTRL #include -#ifdef __GLIBC__ +#if defined(__GLIBC__) || defined(__MWERKS__) #include #endif #ifndef CTRL From 47ad6a6daa3d5df5919d19006a61af6393e59752 Mon Sep 17 00:00:00 2001 From: "sergefp@mysql.com" <> Date: Mon, 16 May 2005 14:06:52 +0000 Subject: [PATCH 2/3] Some improvement in Item_int_with_ref class comment. --- sql/item.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sql/item.h b/sql/item.h index 8fed871e623..2edbeef400c 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1027,12 +1027,14 @@ public: void print(String *str); }; + /* The following class is used to optimize comparing of date and bigint columns - We need to save the original item, to be able to set the field to the - original value in 'opt_range'. - An instance of Item_int_with_ref may refer to a signed or an unsigned - integer. + We need to save the original item ('ref') to be able to call + ref->save_in_field(). This is used to create index search keys. + + An instance of Item_int_with_ref may have signed or unsigned integer value. + */ class Item_int_with_ref :public Item_int From 8b1673f18e7611c71083f966c3672c02606dc276 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Mon, 16 May 2005 20:16:46 +0300 Subject: [PATCH 3/3] Fix memory leak --- client/mysql.cc | 7 ++++--- sql/sql_base.cc | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 6a76a1fbd1b..a3262c818f3 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2051,7 +2051,8 @@ print_table_data(MYSQL_RES *result) separator.fill(separator.length()+length+2,'-'); separator.append('+'); } - tee_puts(separator.c_ptr_safe(), PAGER); + separator.append('\0'); // End marker for \0 + tee_puts((char*) separator.ptr(), PAGER); if (column_names) { mysql_field_seek(result,0); @@ -2064,7 +2065,7 @@ print_table_data(MYSQL_RES *result) num_flag[off]= IS_NUM(field->type); } (void) tee_fputs("\n", PAGER); - tee_puts(separator.c_ptr(), PAGER); + tee_puts((char*) separator.ptr(), PAGER); } while ((cur= mysql_fetch_row(result))) @@ -2093,7 +2094,7 @@ print_table_data(MYSQL_RES *result) } (void) tee_fputs("\n", PAGER); } - tee_puts(separator.c_ptr(), PAGER); + tee_puts((char*) separator.ptr(), PAGER); my_afree((gptr) num_flag); } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e86362c857b..c580842ce06 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2522,7 +2522,7 @@ bool get_key_map_from_key_list(key_map *map, TABLE *table, if ((pos= find_type(&table->keynames, name->ptr(), name->length(), 1)) <= 0) { - my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), name->c_ptr_safe(), + my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), name->c_ptr(), table->real_name); map->set_all(); return 1;