From ef448b7fb19b3f4e78e2f131d8c52369cab86a29 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Tue, 25 Jan 2005 14:00:35 +0200 Subject: [PATCH 1/4] Add flags for Intel 64 bit --- BUILD/SETUP.sh | 3 +++ BUILD/compile-pentium64-debug | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100755 BUILD/compile-pentium64-debug diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 5f4233b8371..d378276a0a3 100644 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -1,3 +1,5 @@ +#!/bin/sh + if ! test -f sql/mysqld.cc then echo "You must run this script from the MySQL top-level directory" @@ -43,6 +45,7 @@ cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wcto alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet pentium_cflags="-mcpu=pentiumpro" +pentium64_cflags="-mcpu=nocona -m64" ppc_cflags="-mpowerpc -mcpu=powerpc" sparc_cflags="" diff --git a/BUILD/compile-pentium64-debug b/BUILD/compile-pentium64-debug new file mode 100755 index 00000000000..1bbca36d851 --- /dev/null +++ b/BUILD/compile-pentium64-debug @@ -0,0 +1,13 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium64_cflags $debug_cflags" +c_warnings="$c_warnings $debug_extra_warnings" +cxx_warnings="$cxx_warnings $debug_extra_warnings" +extra_configs="$pentium_configs $debug_configs $static_link" + +extra_configs="$extra_configs " + +. "$path/FINISH.sh" From da658b9f11bc3b2bf3dc4f1b2b2356d54324e989 Mon Sep 17 00:00:00 2001 From: "mskold@mysql.com" <> Date: Tue, 25 Jan 2005 15:08:51 +0100 Subject: [PATCH 2/4] Fix for failing INSERT IGNORE in test ndb_insert --- sql/sql_insert.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 92c429bcfde..844e5e7dac2 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -241,7 +241,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, error=0; id=0; thd->proc_info="update"; - if (duplic != DUP_ERROR) + if (duplic != DUP_ERROR || ignore) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); /* let's *try* to start bulk inserts. It won't necessary @@ -380,7 +380,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, table->next_number_field=0; thd->count_cuted_fields= CHECK_FIELD_IGNORE; thd->next_insert_id=0; // Reset this if wrongly used - if (duplic != DUP_ERROR) + if (duplic != DUP_ERROR || ignore) table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); /* Reset value of LAST_INSERT_ID if no rows where inserted */ @@ -1345,7 +1345,7 @@ bool delayed_insert::handle_inserts(void) info.ignore= row->ignore; info.handle_duplicates= row->dup; if (info.ignore || - info.handle_duplicates == DUP_REPLACE) + info.handle_duplicates != DUP_ERROR) { table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); using_ignore=1; @@ -1463,7 +1463,7 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) table->next_number_field=table->found_next_number_field; thd->cuted_fields=0; if (info.ignore || - info.handle_duplicates == DUP_REPLACE) + info.handle_duplicates != DUP_ERROR) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->start_bulk_insert((ha_rows) 0); DBUG_RETURN(0); @@ -1649,7 +1649,7 @@ select_create::prepare(List &values, SELECT_LEX_UNIT *u) restore_record(table,default_values); // Get empty record thd->cuted_fields=0; if (info.ignore || - info.handle_duplicates == DUP_REPLACE) + info.handle_duplicates != DUP_ERROR) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->start_bulk_insert((ha_rows) 0); DBUG_RETURN(0); From 37168015cd4a2135cfcfcd71478c066759fffd6a Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Tue, 25 Jan 2005 21:27:51 +0200 Subject: [PATCH 3/4] Cleanups during review --- .bzrignore | 3 +++ client/mysqlbinlog.cc | 17 +++++++++++++---- innobase/include/eval0eval.ic | 2 -- sql/mysqld.cc | 9 ++++----- sql/sql_select.cc | 7 ------- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.bzrignore b/.bzrignore index 40b7668cb64..199da0dd558 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1004,3 +1004,6 @@ vio/test-sslserver vio/viotest-ssl tests/mysql_client_test tests/mysql_client_test +libmysqld/examples/mysql_client_test.c +libmysqld/examples/mysql_client_test_embedded +libmysqld/examples/mysqltest_embedded diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 7ddb01d9ec8..0b15ad893e2 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -687,7 +687,7 @@ static int parse_args(int *argc, char*** argv) static MYSQL* safe_connect() { - MYSQL *local_mysql = mysql_init(NULL); + MYSQL *local_mysql= mysql_init(NULL); if (!local_mysql) die("Failed on mysql_init"); @@ -695,8 +695,12 @@ static MYSQL* safe_connect() if (opt_protocol) mysql_options(local_mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol); if (!mysql_real_connect(local_mysql, host, user, pass, 0, port, sock, 0)) - die("failed on connect: %s", mysql_error(local_mysql)); - + { + char errmsg[256]; + strmake(errmsg, mysql_error(local_mysql), sizeof(errmsg)-1); + mysql_close(local_mysql); + die("failed on connect: %s", errmsg); + } return local_mysql; } @@ -717,7 +721,12 @@ static int check_master_version(MYSQL* mysql) if (mysql_query(mysql, "SELECT VERSION()") || !(res = mysql_store_result(mysql))) - die("Error checking master version: %s", mysql_error(mysql)); + { + char errmsg[256]; + strmake(errmsg, mysql_error(mysql), sizeof(errmsg)-1); + mysql_close(mysql); + die("Error checking master version: %s", errmsg); + } if (!(row = mysql_fetch_row(res))) { mysql_free_result(res); diff --git a/innobase/include/eval0eval.ic b/innobase/include/eval0eval.ic index 2530c869206..069cbfe5f37 100644 --- a/innobase/include/eval0eval.ic +++ b/innobase/include/eval0eval.ic @@ -205,8 +205,6 @@ eval_node_copy_and_alloc_val( { byte* data; - ut_ad(UNIV_SQL_NULL > ULINT_MAX); - if (len == UNIV_SQL_NULL) { dfield_set_len(que_node_get_val(node), len); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 6d647b6edf0..c5ed516570a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2915,12 +2915,11 @@ You should consider changing lower_case_table_names to 1 or 2", (test_if_case_insensitive(mysql_real_data_home) == 1))) { if (global_system_variables.log_warnings) - sql_print_warning("\ -You have forced lower_case_table_names to 2 through a command-line \ -option, even though your file system '%s' is case sensitive. This means \ -that you can create a table that you can then no longer access. \ -You should consider changing lower_case_table_names to 0.", + sql_print_warning("lower_case_table_names was set to 2, even though your " + "the file system '%s' is case sensitive. Now setting " + "lower_case_table_names to 0 to avoid future problems.", mysql_real_data_home); + lower_case_table_names= 0; } select_thread=pthread_self(); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index a53b878cf6c..e956d71a4be 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2828,16 +2828,9 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count, x = used key parts (1 <= x <= c) */ double rec_per_key; -#if 0 - if (!(rec_per_key=(double) - keyinfo->rec_per_key[keyinfo->key_parts-1])) - rec_per_key=(double) s->records/rec+1; -#else rec_per_key= keyinfo->rec_per_key[keyinfo->key_parts-1] ? (double) keyinfo->rec_per_key[keyinfo->key_parts-1] : (double) s->records/rec+1; -#endif - if (!s->records) tmp=0; else if (rec_per_key/(double) s->records >= 0.01) From 7084b494c44eb2d815652640381c8930981dc435 Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Wed, 26 Jan 2005 08:57:43 +0100 Subject: [PATCH 4/4] innobase/include/univ.i remove a change that broke the test --- innobase/include/univ.i | 6 ++---- sql/item_create.cc | 5 +++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/innobase/include/univ.i b/innobase/include/univ.i index c6ab258d3b7..625978ffc38 100644 --- a/innobase/include/univ.i +++ b/innobase/include/univ.i @@ -80,10 +80,8 @@ memory is read outside the allocated blocks. */ /* Make a non-inline debug version */ -#ifdef DBUG_ON -# define UNIV_DEBUG -#endif /* DBUG_ON */ /* +#define UNIV_DEBUG #define UNIV_MEM_DEBUG #define UNIV_IBUF_DEBUG #define UNIV_SYNC_DEBUG @@ -121,7 +119,7 @@ by one. */ /* Definition for inline version */ #ifdef __WIN__ -#define UNIV_INLINE __inline +#define UNIV_INLINE __inline #else /* config.h contains the right def for 'inline' for the current compiler */ #if (__GNUC__ == 2) diff --git a/sql/item_create.cc b/sql/item_create.cc index 99db184e71f..d959a6f393a 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -377,13 +377,14 @@ Item *create_func_space(Item *a) { uint dummy_errors; sp= new Item_string("",0,cs); - sp->str_value.copy(" ", 1, &my_charset_latin1, cs, &dummy_errors); + if (sp) + sp->str_value.copy(" ", 1, &my_charset_latin1, cs, &dummy_errors); } else { sp= new Item_string(" ",1,cs); } - return new Item_func_repeat(sp, a); + return sp ? new Item_func_repeat(sp, a) : 0; } Item *create_func_soundex(Item* a)