From ba9b9f8993ac8d0fa8fc5abdaa670f9eaa548824 Mon Sep 17 00:00:00 2001 From: "brian@zim.(none)" <> Date: Wed, 1 Jun 2005 17:34:10 -0700 Subject: [PATCH 1/2] Mainly cleanups for gcc 4.0. Some small pieces from looking at -Wall. Removed a number of dumb things in ha_tina. --- client/mysqladmin.cc | 2 +- sql/examples/ha_archive.cc | 7 +++---- sql/examples/ha_example.cc | 4 +--- sql/examples/ha_tina.cc | 37 ++++++++++++------------------------- sql/ha_heap.cc | 1 - sql/item_subselect.cc | 3 --- sql/mysqld.cc | 8 +------- sql/opt_range.h | 2 +- sql/repl_failsafe.cc | 2 +- sql/slave.cc | 2 +- sql/sql_acl.cc | 10 +++++----- sql/sql_insert.cc | 2 +- sql/sql_parse.cc | 2 -- sql/sql_repl.cc | 1 - sql/sql_select.cc | 4 ++-- 15 files changed, 29 insertions(+), 58 deletions(-) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 0da7d5b3acf..5a4690ea30e 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -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 */ diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index bc4af0c7dc7..918d85d705d 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -575,7 +575,7 @@ int ha_archive::write_row(byte * buf) written= gzwrite(share->archive_write, buf, table->reclength); DBUG_PRINT("ha_archive::get_row", ("Wrote %d bytes expected %d", written, table->reclength)); share->dirty= TRUE; - if (written != table->reclength) + if (written != (z_off_t)table->reclength) goto error; /* We should probably mark the table as damagaged if the record is written @@ -590,7 +590,7 @@ int ha_archive::write_row(byte * buf) { (*field)->get_ptr(&ptr); written= gzwrite(share->archive_write, ptr, (unsigned)size); - if (written != size) + if (written != (z_off_t)size) goto error; } } @@ -613,7 +613,6 @@ error: int ha_archive::rnd_init(bool scan) { DBUG_ENTER("ha_archive::rnd_init"); - int read; // gzread() returns int, and we use this to check the header /* We rewind the file so that we can read from the beginning if scan */ if (scan) @@ -747,7 +746,7 @@ int ha_archive::rnd_pos(byte * buf, byte *pos) DBUG_ENTER("ha_archive::rnd_pos"); statistic_increment(ha_read_rnd_count,&LOCK_status); current_position= ha_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)); } diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index cb0780ea74d..35034fc7b28 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -150,10 +150,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)); diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc index 0345a170c3c..637ecde8f81 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -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: @@ -89,12 +89,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 +144,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 +341,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++) @@ -735,29 +734,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))) @@ -840,7 +827,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)); diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 033fe86720e..d8e4b3d5a9f 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -484,7 +484,6 @@ int ha_heap::create(const char *name, TABLE *table_arg, for (; key_part != key_part_end; key_part++, seg++) { - uint flag= key_part->key_type; Field *field= key_part->field; if (pos->algorithm == HA_KEY_ALG_BTREE) seg->type= field->key_type(); diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 301740c50ef..23477481472 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -379,9 +379,6 @@ Item_singlerow_subselect::select_transformer(JOIN *join) return RES_REDUCE; } return RES_OK; - -err: - return RES_ERROR; } void Item_singlerow_subselect::store(uint i, Item *item) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 8ade81401aa..5e3142ccf0e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3355,7 +3355,7 @@ static int 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++; @@ -5574,12 +5574,6 @@ static void print_version(void) server_version,SYSTEM_TYPE,MACHINE_TYPE, MYSQL_COMPILATION_COMMENT); } -static void use_help(void) -{ - print_version(); - printf("Use '--help' or '--no-defaults --help' for a list of available options\n"); -} - static void usage(void) { if (!(default_charset_info= get_charset_by_csname(default_character_set_name, diff --git a/sql/opt_range.h b/sql/opt_range.h index edecdcc6282..b55bb4708bf 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -143,7 +143,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); diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 85a51ba9b51..2d8e8a5bf81 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -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++; diff --git a/sql/slave.cc b/sql/slave.cc index 605f8289946..5a2d3af3845 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2577,7 +2577,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->priv_user = 0; thd->slave_thread = 1; /* diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 02da05d195f..84259b146ad 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1002,7 +1002,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; @@ -3673,7 +3673,7 @@ int mysql_revoke_all(THD *thd, List &list) } if (replace_user_table(thd, tables[0].table, - *lex_user, ~0, 1, 0)) + *lex_user, ~(ulong)0, 1, 0)) { result= -1; continue; @@ -3700,7 +3700,7 @@ int mysql_revoke_all(THD *thd, List &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 @@ -3734,7 +3734,7 @@ int mysql_revoke_all(THD *thd, List &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; } @@ -3750,7 +3750,7 @@ int mysql_revoke_all(THD *thd, List &list) columns, grant_table->db, grant_table->tname, - ~0, 1)) + ~(ulong)0, 1)) { revoked= 1; continue; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 0258f2c3e07..1d7914c9c76 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1431,7 +1431,7 @@ bool delayed_insert::handle_inserts(void) if (thd.killed || table->version != refresh_version) { thd.killed=1; - max_rows= ~0; // Do as much as possible + max_rows= ~(uint)0; // Do as much as possible } /* diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 80c68dad247..0d67c25cee5 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -561,7 +561,6 @@ bool is_update_query(enum enum_sql_command command) static void time_out_user_resource_limits(THD *thd, USER_CONN *uc) { - bool error= 0; time_t check_time = thd->start_time ? thd->start_time : time(NULL); DBUG_ENTER("time_out_user_resource_limits"); @@ -587,7 +586,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); diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 24b78bc9a3d..310c2ea03cd 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1341,7 +1341,6 @@ int show_binlogs(THD* thd) IO_CACHE log; File file; const char *errmsg= 0; - MY_STAT stat_area; char fname[FN_REFLEN]; List field_list; uint length; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index fb7f10abb52..d53609ceaa5 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -34,7 +34,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 *tables,COND *conds, @@ -3450,7 +3450,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=0; join_tab->ref.key = -1; From bd48eed988f80005ea0f857e7b048cfade98f1c1 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Thu, 2 Jun 2005 02:43:32 +0200 Subject: [PATCH 2/2] tztime.cc: Set #pragma implementation" earlier Many files: Need to include before #ifdef USE_PRAGMA_IMPLEMENTATION --- client/sql_string.cc | 3 ++- mysys/raid.cc | 2 ++ sql/examples/ha_archive.cc | 4 +++- sql/examples/ha_example.cc | 4 +++- sql/examples/ha_tina.cc | 4 +++- sql/field.cc | 2 ++ sql/ha_berkeley.cc | 2 ++ sql/ha_blackhole.cc | 2 ++ sql/ha_heap.cc | 2 ++ sql/ha_innodb.cc | 2 ++ sql/ha_isam.cc | 2 ++ sql/ha_isammrg.cc | 2 ++ sql/ha_myisam.cc | 2 ++ sql/ha_myisammrg.cc | 2 ++ sql/ha_ndbcluster.cc | 2 ++ sql/handler.cc | 2 ++ sql/hash_filo.cc | 2 ++ sql/item.cc | 2 ++ sql/item_cmpfunc.cc | 2 ++ sql/item_func.cc | 2 ++ sql/item_geofunc.cc | 2 ++ sql/item_strfunc.cc | 2 ++ sql/item_subselect.cc | 2 ++ sql/item_sum.cc | 2 ++ sql/item_timefunc.cc | 2 ++ sql/item_uniq.cc | 3 +++ sql/log_event.cc | 3 +++ sql/opt_range.cc | 2 ++ sql/procedure.cc | 2 ++ sql/protocol.cc | 2 ++ sql/protocol_cursor.cc | 2 ++ sql/set_var.cc | 2 ++ sql/sql_analyse.cc | 2 ++ sql/sql_class.cc | 2 ++ sql/sql_crypt.cc | 2 ++ sql/sql_list.cc | 2 ++ sql/sql_map.cc | 2 ++ sql/sql_olap.cc | 2 ++ sql/sql_select.cc | 2 ++ sql/sql_string.cc | 3 ++- sql/sql_udf.cc | 2 ++ sql/tztime.cc | 12 +++++++----- 42 files changed, 94 insertions(+), 10 deletions(-) diff --git a/client/sql_string.cc b/client/sql_string.cc index 690997152f1..8f0e46c5eea 100644 --- a/client/sql_string.cc +++ b/client/sql_string.cc @@ -16,11 +16,12 @@ /* This file is originally from the mysql distribution. Coded by monty */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include #include #include #include diff --git a/mysys/raid.cc b/mysys/raid.cc index 62587c438ca..20e70d2d102 100644 --- a/mysys/raid.cc +++ b/mysys/raid.cc @@ -70,6 +70,8 @@ tonu@mysql.com & monty@mysql.com */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index bc4af0c7dc7..51268fd60b3 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -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 + +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index cb0780ea74d..b122c4dc83f 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -63,7 +63,9 @@ -Brian */ -#ifdef __GNUC__ +#include + +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc index 0345a170c3c..44040ad3b61 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -38,7 +38,9 @@ TODO: -Brian */ -#ifdef __GNUC__ +#include + +#ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/field.cc b/sql/field.cc index adb0368384e..60287d4003b 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -19,6 +19,8 @@ ** This file implements classes defined in field.h *****************************************************************************/ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 05cad23b176..d4adea4a7b4 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -47,6 +47,8 @@ */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc index 59b3f7102b5..a5456d54c1b 100644 --- a/sql/ha_blackhole.cc +++ b/sql/ha_blackhole.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index d584c33f061..83f5203324f 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 3f2e11e8bd1..b3b82df5469 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -28,6 +28,8 @@ have disables the InnoDB inlining in this file. */ in Windows? */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc index 31e9236460f..b755c63698f 100644 --- a/sql/ha_isam.cc +++ b/sql/ha_isam.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_isammrg.cc b/sql/ha_isammrg.cc index c0e6f665f08..7e14ccb43bf 100644 --- a/sql/ha_isammrg.cc +++ b/sql/ha_isammrg.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index d8608c6a599..b4ac8cc777f 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index edb3521470f..3374ee1271a 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index eaa0473df1b..516703112dd 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -20,6 +20,8 @@ NDB Cluster */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/handler.cc b/sql/handler.cc index f14564b6629..d47bb02a58c 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -17,6 +17,8 @@ /* Handler-calling-functions */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/hash_filo.cc b/sql/hash_filo.cc index ec200768222..34f3cd6b035 100644 --- a/sql/hash_filo.cc +++ b/sql/hash_filo.cc @@ -20,6 +20,8 @@ ** to usage. */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item.cc b/sql/item.cc index bff8c1cace6..d32a6581049 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 337ac949d35..f53dcb43e5c 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -17,6 +17,8 @@ /* This file defines all compare functions */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_func.cc b/sql/item_func.cc index 3c50e750b41..e9339877ab7 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -17,6 +17,8 @@ /* This file defines all numerical functions */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index c58a9e434c7..e907c5a0d45 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -17,6 +17,8 @@ /* This file defines all spatial functions */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 5ca5caf6bdf..725712f4e85 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -20,6 +20,8 @@ ** (This shouldn't be needed) */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 2e4c70ecd5f..553b309cfde 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -22,6 +22,8 @@ SUBSELECT TODO: (sql_select.h/sql_select.cc) */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 0e252259f53..9c35fb1d427 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -17,6 +17,8 @@ /* Sum functions (COUNT, MIN...) */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index a3cf69035f3..9f5cd61f95a 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -17,6 +17,8 @@ /* This file defines all time functions */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/item_uniq.cc b/sql/item_uniq.cc index 0c757c0e3a3..c83373bd8b0 100644 --- a/sql/item_uniq.cc +++ b/sql/item_uniq.cc @@ -15,6 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Compability file */ + +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation #endif diff --git a/sql/log_event.cc b/sql/log_event.cc index f2287857d37..9701ef2ff00 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -16,6 +16,9 @@ #ifndef MYSQL_CLIENT + +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/opt_range.cc b/sql/opt_range.cc index bd1befb436f..7b37f0ce4f7 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -23,6 +23,8 @@ */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/procedure.cc b/sql/procedure.cc index a0042dd879e..10689dd36f6 100644 --- a/sql/procedure.cc +++ b/sql/procedure.cc @@ -17,6 +17,8 @@ /* Procedures (functions with changes output of select) */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/protocol.cc b/sql/protocol.cc index 6a17ae2f95b..835bd986fb8 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -19,6 +19,8 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/protocol_cursor.cc b/sql/protocol_cursor.cc index b225e06ed32..53a03001544 100644 --- a/sql/protocol_cursor.cc +++ b/sql/protocol_cursor.cc @@ -19,6 +19,8 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/set_var.cc b/sql/set_var.cc index 3d3ba6d6ab7..b006dde2b4b 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -48,6 +48,8 @@ new attribute. */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index fb5d0eb0a3f..678bdbb4588 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -23,6 +23,8 @@ ** - type set is out of optimization yet */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 805db107370..ff45b164893 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -22,6 +22,8 @@ ** *****************************************************************************/ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_crypt.cc b/sql/sql_crypt.cc index f21a109e95d..eda7f0f6bbb 100644 --- a/sql/sql_crypt.cc +++ b/sql/sql_crypt.cc @@ -23,6 +23,8 @@ needs something like 'ssh'. */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_list.cc b/sql/sql_list.cc index d57a7dfe4e3..485c569f49c 100644 --- a/sql/sql_list.cc +++ b/sql/sql_list.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_map.cc b/sql/sql_map.cc index aac44949d89..9baacd1bc4b 100644 --- a/sql/sql_map.cc +++ b/sql/sql_map.cc @@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_olap.cc b/sql/sql_olap.cc index 024abb6c74b..a365cbb0614 100644 --- a/sql/sql_olap.cc +++ b/sql/sql_olap.cc @@ -28,6 +28,8 @@ #ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1 +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 0362f097cba..1d42fe49283 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -17,6 +17,8 @@ /* mysql_select and join optimization */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/sql_string.cc b/sql/sql_string.cc index ab2db4aaf53..e5339782f02 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -16,11 +16,12 @@ /* This file is originally from the mysql distribution. Coded by monty */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include #include #include #include diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index f5b4775ee0b..deed806db2a 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -28,6 +28,8 @@ ** dynamic functions, so this shouldn't be a real problem. */ +#include + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: implement sql_udf.h #endif diff --git a/sql/tztime.cc b/sql/tztime.cc index 8fac054c49c..30ff25f080f 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -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 + +#ifdef USE_PRAGMA_IMPLEMENTATION +#pragma implementation // gcc: Class implementation +#endif + #if !defined(TZINFO2SQL) && !defined(TESTTIME) #include "mysql_priv.h" #else -#include #include #include "tztime.h" #include