Merge of 4.1->5.0. This contained the fixes for GCC 4.0

This commit is contained in:
brian@zim.(none) 2005-06-01 21:56:30 -07:00
commit 113a99626d
47 changed files with 117 additions and 59 deletions

View file

@ -271,7 +271,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
option_wait=1;
}
else
option_wait= ~0;
option_wait= ~(uint)0;
break;
case '?':
case 'I': /* Info */

View file

@ -16,11 +16,12 @@
/* This file is originally from the mysql distribution. Coded by monty */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
#include <my_global.h>
#include <my_sys.h>
#include <m_string.h>
#include <m_ctype.h>

View file

@ -70,6 +70,8 @@
tonu@mysql.com & monty@mysql.com
*/
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -14,7 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifdef __GNUC__
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
@ -600,7 +602,7 @@ int ha_archive::write_row(byte * buf)
if (!delayed_insert || !bulk_insert)
share->dirty= TRUE;
if (written != table->s->reclength)
if (written != (z_off_t)table->s->reclength)
goto error;
/*
We should probably mark the table as damagaged if the record is written
@ -617,7 +619,7 @@ int ha_archive::write_row(byte * buf)
{
((Field_blob*) table->field[*ptr])->get_ptr(&data_ptr);
written= gzwrite(share->archive_write, data_ptr, (unsigned)size);
if (written != size)
if (written != (z_off_t)size)
goto error;
}
}
@ -788,7 +790,7 @@ int ha_archive::rnd_pos(byte * buf, byte *pos)
statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
&LOCK_status);
current_position= my_get_ptr(pos, ref_length);
z_off_t seek= gzseek(archive, current_position, SEEK_SET);
(void)gzseek(archive, current_position, SEEK_SET);
DBUG_RETURN(get_row(archive, buf));
}

View file

@ -63,7 +63,9 @@
-Brian
*/
#ifdef __GNUC__
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
@ -150,10 +152,8 @@ static EXAMPLE_SHARE *get_share(const char *table_name, TABLE *table)
return share;
error2:
thr_lock_delete(&share->lock);
pthread_mutex_destroy(&share->mutex);
error:
pthread_mutex_destroy(&share->mutex);
pthread_mutex_unlock(&example_mutex);
my_free((gptr) share, MYF(0));

View file

@ -20,10 +20,10 @@
First off, this is a play thing for me, there are a number of things wrong with it:
*) It was designed for csv and therefor its performance is highly questionable.
*) Indexes have not been implemented. This is because the files can be traded in
and out of the table directory without having to worry about rebuilding anything.
and out of the table directory without having to worry about rebuilding anything.
*) NULLs and "" are treated equally (like a spreadsheet).
*) There was in the beginning no point to anyone seeing this other then me, so there
is a good chance that I haven't quite documented it well.
is a good chance that I haven't quite documented it well.
*) Less design, more "make it work"
Now there are a few cool things with it:
@ -38,7 +38,9 @@ TODO:
-Brian
*/
#ifdef __GNUC__
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
@ -89,12 +91,12 @@ int get_mmap(TINA_SHARE *share, int write)
{
if (write)
share->mapped_file= (byte *)mmap(NULL, share->file_stat.st_size,
PROT_READ|PROT_WRITE, MAP_SHARED,
share->data_file, 0);
PROT_READ|PROT_WRITE, MAP_SHARED,
share->data_file, 0);
else
share->mapped_file= (byte *)mmap(NULL, share->file_stat.st_size,
PROT_READ, MAP_PRIVATE,
share->data_file, 0);
PROT_READ, MAP_PRIVATE,
share->data_file, 0);
if ((share->mapped_file ==(caddr_t)-1))
{
/*
@ -144,9 +146,9 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table)
{
char data_file_name[FN_REFLEN];
if (!my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
&share, sizeof(*share),
&tmp_name, length+1,
NullS))
&share, sizeof(*share),
&tmp_name, length+1,
NullS))
{
pthread_mutex_unlock(&tina_mutex);
return NULL;
@ -341,7 +343,6 @@ int ha_tina::find_current_row(byte *buf)
for (Field **field=table->field ; *field ; field++)
{
int x;
buffer.length(0);
mapped_ptr++; // Increment past the first quote
for(;mapped_ptr != end_ptr; mapped_ptr++)
@ -745,29 +746,17 @@ int ha_tina::rnd_end()
beginning so that we move the smallest amount of data possible.
*/
qsort(chain, (size_t)(chain_ptr - chain), sizeof(tina_set), (qsort_cmp)sort_set);
for (ptr= chain; ptr < chain_ptr; ptr++)
printf("Chain %d, %d\n", (int)ptr->begin, (int)ptr->end);
for (ptr= chain; ptr < chain_ptr; ptr++)
{
//memmove(share->mapped_file + ptr->begin, share->mapped_file
//+ ptr->end, length - (size_t)ptr->end);
/* We peek a head to see if this is the last chain */
printf("Delete %d, %d, %d\n", (int)ptr->begin, (int)ptr->end, (int)length);
if (ptr+1 == chain_ptr)
{
printf("Shiftina(end) %d(%d) to %d\n", (int)ptr->end, (int)(length - (size_t)ptr->end), (int)ptr->begin);
memmove(share->mapped_file + ptr->begin, share->mapped_file + ptr->end,
length - (size_t)ptr->end);
}
else
{
printf("Shifting %d(%d) to %d\n", (int)ptr->end, (int)((ptr++)->begin - (size_t)ptr->end), (int)ptr->begin);
memmove(share->mapped_file + ptr->begin, share->mapped_file + ptr->end,
(size_t)(ptr++)->begin - (size_t)ptr->end);
}
memmove((caddr_t)share->mapped_file + ptr->begin, (caddr_t)share->mapped_file + ptr->end,
(size_t)((ptr++)->begin - ptr->end));
length= length - (size_t)(ptr->end - ptr->begin);
}
printf("Buffer %s\n",share->mapped_file);
/* Truncate the file to the new size */
if (my_chsize(share->data_file, length, 0, MYF(MY_WME)))
@ -850,7 +839,7 @@ int ha_tina::create(const char *name, TABLE *table_arg, HA_CREATE_INFO *create_i
DBUG_ENTER("ha_tina::create");
if ((create_file= my_create(fn_format(name_buff,name,"",".CSV",MY_REPLACE_EXT|MY_UNPACK_FILENAME),0,
O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
DBUG_RETURN(-1);
my_close(create_file,MYF(0));

View file

@ -19,6 +19,8 @@
** This file implements classes defined in field.h
*****************************************************************************/
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -47,6 +47,8 @@
*/
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -15,6 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -15,6 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -27,6 +27,8 @@ have disables the InnoDB inlining in this file. */
in Windows?
*/
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -15,6 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -15,6 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -20,6 +20,8 @@
NDB Cluster
*/
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -17,6 +17,8 @@
/* Handler-calling-functions */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -20,6 +20,8 @@
** to usage.
*/
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -15,6 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -17,6 +17,8 @@
/* This file defines all compare functions */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -17,6 +17,8 @@
/* This file defines all numerical functions */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -17,6 +17,8 @@
/* This file defines all spatial functions */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -20,6 +20,8 @@
** (This shouldn't be needed)
*/
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -22,6 +22,8 @@ SUBSELECT TODO:
(sql_select.h/sql_select.cc)
*/
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
@ -384,9 +386,6 @@ Item_singlerow_subselect::select_transformer(JOIN *join)
return RES_REDUCE;
}
return RES_OK;
err:
return RES_ERROR;
}

View file

@ -17,6 +17,8 @@
/* Sum functions (COUNT, MIN...) */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -17,6 +17,8 @@
/* This file defines all time functions */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -15,6 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Compability file */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation
#endif

View file

@ -16,6 +16,9 @@
#ifndef MYSQL_CLIENT
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -3478,7 +3478,7 @@ static void bootstrap(FILE *file)
thd->client_capabilities=0;
my_net_init(&thd->net,(st_vio*) 0);
thd->max_client_packet_length= thd->net.max_packet;
thd->master_access= ~0;
thd->master_access= ~(ulong)0;
thd->thread_id=thread_id++;
thread_count++;
@ -5830,7 +5830,6 @@ static void print_version(void)
server_version,SYSTEM_TYPE,MACHINE_TYPE, MYSQL_COMPILATION_COMMENT);
}
static void usage(void)
{
if (!(default_charset_info= get_charset_by_csname(default_character_set_name,

View file

@ -691,7 +691,7 @@ class SQL_SELECT :public Sql_alloc {
~SQL_SELECT();
void cleanup();
bool check_quick(THD *thd, bool force_quick_range, ha_rows limit)
{ return test_quick_select(thd, key_map(~0), 0, limit, force_quick_range) < 0; }
{ return test_quick_select(thd, key_map(~(uint)0), 0, limit, force_quick_range) < 0; }
inline bool skip_record() { return cond ? cond->val_int() == 0 : 0; }
int test_quick_select(THD *thd, key_map keys, table_map prev_tables,
ha_rows limit, bool force_quick_range=0);

View file

@ -17,6 +17,8 @@
/* Procedures (functions with changes output of select) */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -19,6 +19,8 @@
The actual communction is handled by the net_xxx functions in net_serv.cc
*/
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -19,6 +19,8 @@
The actual communction is handled by the net_xxx functions in net_serv.cc
*/
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -71,7 +71,7 @@ static int init_failsafe_rpl_thread(THD* thd)
my_net_init(&thd->net, 0);
thd->net.read_timeout = slave_net_timeout;
thd->max_client_packet_length=thd->net.max_packet;
thd->master_access= ~0;
thd->master_access= ~(ulong)0;
thd->priv_user = 0;
pthread_mutex_lock(&LOCK_thread_count);
thd->thread_id = thread_id++;

View file

@ -48,6 +48,8 @@
new attribute.
*/
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -2818,7 +2818,7 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
thd->client_capabilities = 0;
my_net_init(&thd->net, 0);
thd->net.read_timeout = slave_net_timeout;
thd->master_access= ~0;
thd->master_access= ~(ulong)0;
thd->slave_thread = 1;
set_slave_thread_options(thd);
/*

View file

@ -1104,7 +1104,7 @@ static void acl_insert_db(const char *user, const char *host, const char *db,
ulong acl_get(const char *host, const char *ip,
const char *user, const char *db, my_bool db_is_pattern)
{
ulong host_access= ~0, db_access= 0;
ulong host_access= ~(ulong)0, db_access= 0;
uint i,key_length;
char key[ACL_KEY_LENGTH],*tmp_db,*end;
acl_entry *entry;
@ -5064,7 +5064,7 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list)
}
if (replace_user_table(thd, tables[0].table,
*lex_user, ~0, 1, 0, 0))
*lex_user, ~(ulong)0, 1, 0, 0))
{
result= -1;
continue;
@ -5091,7 +5091,7 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list)
if (!strcmp(lex_user->user.str,user) &&
!my_strcasecmp(system_charset_info, lex_user->host.str, host))
{
if (!replace_db_table(tables[1].table, acl_db->db, *lex_user, ~0, 1))
if (!replace_db_table(tables[1].table, acl_db->db, *lex_user, ~(ulong)0, 1))
{
/*
Don't increment counter as replace_db_table deleted the
@ -5125,7 +5125,7 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list)
if (replace_table_table(thd,grant_table,tables[2].table,*lex_user,
grant_table->db,
grant_table->tname,
~0, 0, 1))
~(ulong)0, 0, 1))
{
result= -1;
}
@ -5141,7 +5141,7 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list)
columns,
grant_table->db,
grant_table->tname,
~0, 1))
~(ulong)0, 1))
{
revoked= 1;
continue;

View file

@ -23,6 +23,8 @@
** - type set is out of optimization yet
*/
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -22,6 +22,8 @@
**
*****************************************************************************/
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -23,6 +23,8 @@
needs something like 'ssh'.
*/
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -1776,7 +1776,7 @@ bool delayed_insert::handle_inserts(void)
if (thd.killed || table->s->version != refresh_version)
{
thd.killed= THD::KILL_CONNECTION;
max_rows= ~0; // Do as much as possible
max_rows= ~(uint)0; // Do as much as possible
}
/*

View file

@ -15,6 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -15,6 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -28,6 +28,8 @@
#ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

View file

@ -651,7 +651,6 @@ static bool check_mqh(THD *thd, uint check_command)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
bool error= 0;
time_t check_time = thd->start_time ? thd->start_time : time(NULL);
USER_CONN *uc=thd->user_connect;
DBUG_ENTER("check_mqh");
DBUG_ASSERT(uc != 0);

View file

@ -17,6 +17,8 @@
/* mysql_select and join optimization */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
@ -35,7 +37,7 @@ const char *join_type_str[]={ "UNKNOWN","system","const","eq_ref","ref",
};
const key_map key_map_empty(0);
const key_map key_map_full(~0);
const key_map key_map_full(~(uint)0);
static void optimize_keyuse(JOIN *join, DYNAMIC_ARRAY *keyuse_array);
static bool make_join_statistics(JOIN *join, TABLE_LIST *leaves, COND *conds,
@ -5086,7 +5088,7 @@ make_simple_join(JOIN *join,TABLE *tmp_table)
join_tab->select_cond=0;
join_tab->quick=0;
join_tab->type= JT_ALL; /* Map through all records */
join_tab->keys.init(~0); /* test everything in quick */
join_tab->keys.init(~(uint)0); /* test everything in quick */
join_tab->info=0;
join_tab->on_expr_ref=0;
join_tab->last_inner= 0;

View file

@ -16,11 +16,12 @@
/* This file is originally from the mysql distribution. Coded by monty */
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
#include <my_global.h>
#include <my_sys.h>
#include <m_string.h>
#include <m_ctype.h>

View file

@ -28,6 +28,8 @@
dynamic functions, so this shouldn't be a real problem.
*/
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: implement sql_udf.h
#endif

View file

@ -20,18 +20,20 @@
(We will refer to this code as to elsie-code further.)
*/
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
/*
We should not include mysql_priv.h in mysql_tzinfo_to_sql utility since
it creates unsolved link dependencies on some platforms.
*/
#include <my_global.h>
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
#if !defined(TZINFO2SQL) && !defined(TESTTIME)
#include "mysql_priv.h"
#else
#include <my_global.h>
#include <my_time.h>
#include "tztime.h"
#include <my_sys.h>