summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-10-03 17:02:14 +0300
committerunknown <monty@hundin.mysql.fi>2001-10-03 17:02:14 +0300
commit664647d1f7c190f1cc54fb817b10c86f994c1fdc (patch)
treebbfafc773031daba5da578013d4bbd52be39e770 /sql
parent2e0dc69895280f3b407e56dace32ad9cf25ce356 (diff)
downloadmariadb-git-664647d1f7c190f1cc54fb817b10c86f994c1fdc.tar.gz
Portability fixes.
Build-tools/Do-compile: Don't delete distribution if not using --delete Docs/manual.texi: Added information about default values mysql-test/t/rpl000017.test: Fixed replication test to be more portable mysys/mf_iocache2.c: More comments sql/item_sum.cc: Cleanup sql/log_event.cc: Cleanup sql/mysqld.cc: Fixed typos in output sql/sql_base.cc: Cleanup sql/sql_delete.cc: Cleanup sql/sql_select.cc: Cleanup sql/uniques.cc: Portability fix
Diffstat (limited to 'sql')
-rw-r--r--sql/item_sum.cc2
-rw-r--r--sql/log_event.cc4
-rw-r--r--sql/mysqld.cc14
-rw-r--r--sql/sql_base.cc1
-rw-r--r--sql/sql_delete.cc2
-rw-r--r--sql/sql_select.cc34
-rw-r--r--sql/uniques.cc27
7 files changed, 23 insertions, 61 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 712c0fa308e..431d8b56e6a 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -745,7 +745,7 @@ Item_sum_hybrid::min_max_update_int_field(int offset)
(ulonglong) old_nr > (ulonglong) nr :
old_nr > nr);
/* (cmp_sign > 0 && res) || (!(cmp_sign > 0) && !res) */
- if (cmp_sign > 0 ^ !res)
+ if ((cmp_sign > 0) ^ (!res))
old_nr=nr;
}
result_field->set_notnull();
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 2627e9a3997..057feee1304 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1493,10 +1493,10 @@ int Query_log_event::exec_event(struct st_master_info* mi)
(actual_error = thd->net.last_errno) && expected_error)
{
const char* errmsg = "Slave: did not get the expected error\
- running query from master - expected: '%s'(%d), got '%s'(%d)";
+ running query from master - expected: '%s' (%d), got '%s' (%d)";
sql_print_error(errmsg, ER_SAFE(expected_error),
expected_error,
- actual_error ? thd->net.last_error:"no error",
+ actual_error ? thd->net.last_error: "no error",
actual_error);
thd->query_error = 1;
}
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index bd5769c3237..b8e8c80d100 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1202,13 +1202,13 @@ static sig_handler handle_segfault(int sig)
fprintf(stderr,"\
mysqld got signal %d;\n\
This could be because you hit a bug. It is also possible that this binary\n\
-or one of the libraries it was linked agaist is corrupt, improperly built,\n\
+or one of the libraries it was linked against is corrupt, improperly built,\n\
or misconfigured. This error can also be caused by malfunctioning hardware.\n",
sig);
fprintf(stderr, "\
We will try our best to scrape up some info that will hopefully help diagnose\n\
the problem, but since we have already crashed, something is definitely wrong\n\
-and this may fail\n\n");
+and this may fail.\n\n");
fprintf(stderr, "key_buffer_size=%ld\n", keybuff_size);
fprintf(stderr, "record_buffer=%ld\n", my_default_record_cache_size);
fprintf(stderr, "sort_buffer=%ld\n", sortbuff_size);
@@ -1219,15 +1219,15 @@ and this may fail\n\n");
key_buffer_size + (record_buffer + sort_buffer)*max_connections = %ld K\n\
bytes of memory\n", (keybuff_size + (my_default_record_cache_size +
sortbuff_size) * max_connections)/ 1024);
- fprintf(stderr, "Hope that's ok, if not, decrease some variables in the equation\n\n");
+ fprintf(stderr, "Hope that's ok; if not, decrease some variables in the equation.\n\n");
#if defined(HAVE_LINUXTHREADS)
if (sizeof(char*) == 4 && thread_count > UNSAFE_DEFAULT_LINUX_THREADS)
{
fprintf(stderr, "\
You seem to be running 32-bit Linux and have %d concurrent connections.\n\
-If you have not changed STACK_SIZE in LinuxThreads and build the binary \n\
-yourself, LinuxThreads is quite likely to steal a part of global heap for\n\
+If you have not changed STACK_SIZE in LinuxThreads and built the binary \n\
+yourself, LinuxThreads is quite likely to steal a part of the global heap for\n\
the thread stack. Please read http://www.mysql.com/doc/L/i/Linux.html\n\n",
thread_count);
}
@@ -1251,12 +1251,12 @@ Some pointers may be invalid and cause the dump to abort...\n");
fprintf(stderr, "\n
Successfully dumped variables, if you ran with --log, take a look at the\n\
details of what thread %ld did to cause the crash. In some cases of really\n\
-bad corruption, the values shown above may be invalid\n\n",
+bad corruption, the values shown above may be invalid.\n\n",
thd->thread_id);
}
fprintf(stderr, "\
The manual page at http://www.mysql.com/doc/C/r/Crashing.html contains\n\
-information that should help you find out what is causing the crash\n");
+information that should help you find out what is causing the crash.\n");
fflush(stderr);
#endif /* HAVE_STACKTRACE */
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 4c012804c3e..595bee99908 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1944,7 +1944,6 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
// TODO: This could be optimized to use hashed names if t2 had a hash
for (j=0 ; j < t2->fields ; j++)
{
- key_map tmp_map;
if (!my_strcasecmp(t1->field[i]->field_name,
t2->field[j]->field_name))
{
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 00ebef89fa5..1103e5590d8 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -309,7 +309,6 @@ bool multi_delete::send_data(List<Item> &values)
continue;
table->file->position(table->record[0]);
- int rl = table->file->ref_length;
if (secure_counter < 0)
{
@@ -397,7 +396,6 @@ int multi_delete::do_deletes (bool from_send_error)
table_being_deleted=table_being_deleted->next, counter++)
{
TABLE *table = table_being_deleted->table;
- int rl = table->file->ref_length;
if (tempfiles[counter]->get(table))
{
error=1;
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 893c99efce1..c2bb282a624 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -107,7 +107,6 @@ static uint find_shortest_key(TABLE *table, key_map usable_keys);
static bool test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,
ha_rows select_limit, bool no_changes);
static int create_sort_index(JOIN_TAB *tab,ORDER *order,ha_rows select_limit);
-static bool fix_having(JOIN *join, Item **having);
static int remove_duplicates(JOIN *join,TABLE *entry,List<Item> &fields,
Item *having);
static int remove_dup_with_compare(THD *thd, TABLE *entry, Field **field,
@@ -5443,39 +5442,6 @@ err:
DBUG_RETURN(-1);
}
-
-/*
-** Add the HAVING criteria to table->select
-*/
-
-static bool fix_having(JOIN *join, Item **having)
-{
- (*having)->update_used_tables(); // Some tables may have been const
- JOIN_TAB *table=&join->join_tab[join->const_tables];
- table_map used_tables= join->const_table_map | table->table->map;
-
- Item* sort_table_cond=make_cond_for_table(*having,used_tables,used_tables);
- if (sort_table_cond)
- {
- if (!table->select)
- if (!(table->select=new SQL_SELECT))
- return 1;
- if (!table->select->cond)
- table->select->cond=sort_table_cond;
- else // This should never happen
- if (!(table->select->cond=new Item_cond_and(table->select->cond,
- sort_table_cond)))
- return 1;
- table->select_cond=table->select->cond;
- DBUG_EXECUTE("where",print_where(table->select_cond,
- "select and having"););
- *having=make_cond_for_table(*having,~ (table_map) 0,~used_tables);
- DBUG_EXECUTE("where",print_where(*having,"having after make_cond"););
- }
- return 0;
-}
-
-
/*****************************************************************************
** Remove duplicates from tmp table
** This should be recoded to add a uniuqe index to the table and remove
diff --git a/sql/uniques.cc b/sql/uniques.cc
index bd3ca6db0d0..fcee97dbb1a 100644
--- a/sql/uniques.cc
+++ b/sql/uniques.cc
@@ -35,6 +35,19 @@
#include "sql_sort.h"
+int unique_write_to_file(gptr key, element_count count, Unique *unique)
+{
+ return my_b_write(&unique->file, (byte*) key,
+ unique->tree.size_of_element) ? 1 : 0;
+}
+
+int unique_write_to_ptrs(gptr key, element_count count, Unique *unique)
+{
+ memcpy(unique->record_pointers, key, unique->tree.size_of_element);
+ unique->record_pointers+=unique->tree.size_of_element;
+ return 0;
+}
+
Unique::Unique(qsort_cmp2 comp_func, void * comp_func_fixed_arg,
uint size, ulong max_in_memory_size_arg)
:max_in_memory_size(max_in_memory_size_arg),elements(0)
@@ -73,20 +86,6 @@ bool Unique::flush()
}
-int unique_write_to_file(gptr key, element_count count, Unique *unique)
-{
- return my_b_write(&unique->file, (byte*) key,
- unique->tree.size_of_element) ? 1 : 0;
-}
-
-int unique_write_to_ptrs(gptr key, element_count count, Unique *unique)
-{
- memcpy(unique->record_pointers, key, unique->tree.size_of_element);
- unique->record_pointers+=unique->tree.size_of_element;
- return 0;
-}
-
-
/*
Modify the TABLE element so that when one calls init_records()
the rows will be read in priority order.