diff options
-rw-r--r-- | mysys/checksum.c | 6 | ||||
-rw-r--r-- | mysys/my_static.h | 1 | ||||
-rw-r--r-- | sql/item_strfunc.cc | 15 | ||||
-rw-r--r-- | sql/lock.cc | 2 | ||||
-rw-r--r-- | sql/log.cc | 1 | ||||
-rw-r--r-- | sql/mysql_priv.h | 18 | ||||
-rw-r--r-- | sql/net_serv.cc | 7 | ||||
-rw-r--r-- | sql/repl_failsafe.cc | 1 | ||||
-rw-r--r-- | sql/set_var.cc | 2 | ||||
-rw-r--r-- | sql/sql_derived.cc | 2 | ||||
-rw-r--r-- | sql/sql_insert.cc | 2 | ||||
-rw-r--r-- | sql/sql_parse.cc | 2 | ||||
-rw-r--r-- | sql/sql_prepare.cc | 1 | ||||
-rw-r--r-- | sql/sql_repl.cc | 2 | ||||
-rw-r--r-- | sql/sql_string.cc | 5 | ||||
-rw-r--r-- | sql/sql_table.cc | 1 | ||||
-rw-r--r-- | sql/sql_test.cc | 2 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 1 | ||||
-rw-r--r-- | sql/table.cc | 1 |
19 files changed, 38 insertions, 34 deletions
diff --git a/mysys/checksum.c b/mysys/checksum.c index 664e768ef4e..92ec3d550f1 100644 --- a/mysys/checksum.c +++ b/mysys/checksum.c @@ -30,11 +30,13 @@ ha_checksum my_checksum(ha_checksum crc, const byte *pos, uint length) { -/* const byte *end=pos+length; +#ifdef NOT_USED + const byte *end=pos+length; for ( ; pos != end ; pos++) crc=((crc << 8) + *((uchar*) pos)) + (crc >> (8*sizeof(ha_checksum)-8)); return crc; -*/ +#else return (ha_checksum)crc32((uint)crc, (const uchar *)pos, length); +#endif } diff --git a/mysys/my_static.h b/mysys/my_static.h index 1a33bcf21f3..08d1a93692f 100644 --- a/mysys/my_static.h +++ b/mysys/my_static.h @@ -19,7 +19,6 @@ a shared library */ -#include "mysys_priv.h" #include <signal.h> #define MAX_SIGNALS 10 /* Max signals under a dont-allow */ diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index c4ad7f1e1e2..a9c1c931c7d 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -33,6 +33,7 @@ #include "md5.h" #include "sha1.h" #include "my_aes.h" +#include "../mysys/my_static.h" // For soundex_map String empty_string("",default_charset_info); @@ -1496,15 +1497,11 @@ void Item_func_soundex::fix_length_and_dec() } - /* - If alpha, map input letter to soundex code. - If not alpha and remove_garbage is set then skip to next char - else return 0 - */ - -extern "C" { -extern const char *soundex_map; // In mysys/static.c -} +/* + If alpha, map input letter to soundex code. + If not alpha and remove_garbage is set then skip to next char + else return 0 +*/ static char get_scode(CHARSET_INFO *cs,char *ptr) { diff --git a/sql/lock.cc b/sql/lock.cc index 82004298453..fd56d1e85b2 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -75,8 +75,6 @@ TODO: #include "../myisammrg/myrg_def.h" #endif -extern HASH open_cache; - static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table,uint count, bool unlock, TABLE **write_locked); static int lock_external(THD *thd, TABLE **table,uint count); diff --git a/sql/log.cc b/sql/log.cc index f279d6d679c..38aa9cb4d43 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -31,7 +31,6 @@ #include <m_ctype.h> // For test_if_number MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log; -extern I_List<i_string> binlog_do_db, binlog_ignore_db; static bool test_if_number(const char *str, long *res, bool allow_wildcards); diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index e546243dec9..853fc844531 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -705,6 +705,9 @@ bool open_log(MYSQL_LOG *log, const char *hostname, enum_log_type type, bool read_append, bool no_auto_events, ulong max_size); +/* mysqld.cc */ +extern void yyerror(const char*); + /* External variables */ @@ -785,7 +788,7 @@ extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open, LOCK_error_log, LOCK_delayed_insert, LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone, LOCK_slave_list, LOCK_active_mi, LOCK_manager, - LOCK_global_system_variables; + LOCK_global_system_variables, LOCK_user_conn; extern rw_lock_t LOCK_grant; extern pthread_cond_t COND_refresh, COND_thread_count, COND_manager; extern pthread_attr_t connection_attrib; @@ -802,6 +805,11 @@ extern SHOW_COMP_OPTION have_berkeley_db; extern struct system_variables global_system_variables; extern struct system_variables max_system_variables; extern struct rand_struct sql_rand; +extern HASH open_cache; +extern TABLE *unused_tables; +extern I_List<i_string> binlog_do_db, binlog_ignore_db; +extern const char* any_db; +extern struct my_option my_long_options[]; /* optional things, have_* variables */ @@ -936,6 +944,14 @@ bool flush_error_log(void); void free_list(I_List <i_string_pair> *list); void free_list(I_List <i_string> *list); +/* sql_yacc.cc */ +extern int yyparse(void *thd); + +/* frm_crypt.cc */ +#ifdef HAVE_CRYPTED_FRM +SQL_CRYPT *get_crypt_for_frm(void); +#endif + /* Some inline functions for more speed */ inline bool add_item_to_list(THD *thd, Item *item) diff --git a/sql/net_serv.cc b/sql/net_serv.cc index d39fca595ac..bc9f6140065 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -88,10 +88,15 @@ void sql_print_error(const char *format,...); #ifdef MYSQL_SERVER #define USE_QUERY_CACHE +/* + The following variables/functions should really not be declared + extern, but as it's hard to include mysql_priv.h here, we have to + live with this for a while. +*/ extern uint test_flags; -extern void query_cache_insert(NET *net, const char *packet, ulong length); extern ulong bytes_sent, bytes_received, net_big_packet_count; extern pthread_mutex_t LOCK_bytes_sent , LOCK_bytes_received; +extern void query_cache_insert(NET *net, const char *packet, ulong length); #else #undef statistic_add #undef statistic_increment diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 8f0e18999b3..814b5ed957c 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -34,7 +34,6 @@ RPL_STATUS rpl_status=RPL_NULL; pthread_mutex_t LOCK_rpl_status; pthread_cond_t COND_rpl_status; HASH slave_list; -extern const char* any_db; const char *rpl_role_type[] = {"MASTER","SLAVE",NullS}; TYPELIB rpl_role_typelib = {array_elements(rpl_role_type)-1,"", diff --git a/sql/set_var.cc b/sql/set_var.cc index 194d91d2c4f..dd188738a4d 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1836,8 +1836,6 @@ static byte *get_sys_var_length(const sys_var *var, uint *length, void set_var_init() { - extern struct my_option my_long_options[]; // From mysqld - hash_init(&system_variable_hash, system_charset_info, array_elements(sys_variables),0,0, (hash_get_key) get_sys_var_length,0,0); diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 5d05fea4fe3..121e0321eb0 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -25,8 +25,6 @@ #include "sql_select.h" #include "sql_acl.h" -extern const char *any_db; // Special symbol for check_access - /* Resolve derived tables in all queries diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 6028e291edd..2e229d2b04d 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1569,8 +1569,6 @@ bool select_create::send_data(List<Item> &values) return 0; } -extern HASH open_cache; - bool select_create::send_eof() { diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 9e7532c447d..c284efc4e6d 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -44,7 +44,6 @@ #define MIN_HANDSHAKE_SIZE 6 #endif /* HAVE_OPENSSL */ -extern int yyparse(void *thd); extern "C" pthread_mutex_t THR_LOCK_keycache; #ifdef SOLARIS extern "C" int gethostname(char *name, int namelen); @@ -120,7 +119,6 @@ static bool end_active_trans(THD *thd) static HASH hash_user_connections; -extern pthread_mutex_t LOCK_user_conn; static int get_or_create_user_conn(THD *thd, const char *user, const char *host, diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 4abbbcaff1f..e6202afe4d7 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -76,7 +76,6 @@ Long data handling: #define STMT_QUERY_LOG_LENGTH 8192 -extern int yyparse(void *thd); static String null_string("NULL", 4, default_charset_info); /* diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 2489bc8df68..f5629a0d701 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -24,8 +24,6 @@ #include "log_event.h" #include <my_dir.h> -extern const char* any_db; - int max_binlog_dump_events = 0; // unlimited my_bool opt_sporadic_binlog_dump_fail = 0; static int binlog_dump_count = 0; diff --git a/sql/sql_string.cc b/sql/sql_string.cc index e7d7b08c93c..be9404ce0b8 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -28,6 +28,11 @@ #include <floatingpoint.h> #endif +/* + The following extern declarations are ok as these are interface functions + required by the string function +*/ + extern gptr sql_alloc(unsigned size); extern void sql_element_free(void *ptr); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 5f16377d20a..6a26ff7862d 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -29,7 +29,6 @@ #include <io.h> #endif -extern HASH open_cache; static const char *primary_key_name="PRIMARY"; static bool check_if_keyname_exists(const char *name,KEY *start, KEY *end); diff --git a/sql/sql_test.cc b/sql/sql_test.cc index d2f97640010..f991a09398b 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -41,7 +41,6 @@ static const char *lock_descriptions[] = "High priority write lock", "Highest priority write lock" }; -extern HASH open_cache; #ifndef DBUG_OFF @@ -65,7 +64,6 @@ print_where(COND *cond,const char *info) } /* This is for debugging purposes */ -extern TABLE *unused_tables; void print_cached_tables(void) { diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index b84a21b1440..a1b14efdbbf 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -38,7 +38,6 @@ #include <myisam.h> #include <myisammrg.h> -extern void yyerror(const char*); int yylex(void *yylval, void *yythd); #define yyoverflow(A,B,C,D,E,F) if (my_yyoverflow((B),(D),(int*) (F))) { yyerror((char*) (A)); return 2; } diff --git a/sql/table.cc b/sql/table.cc index a980e086d60..622bf5ecb57 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -236,7 +236,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, #ifdef HAVE_CRYPTED_FRM else if (*(head+26) == 2) { - extern SQL_CRYPT *get_crypt_for_frm(void); my_pthread_setspecific_ptr(THR_MALLOC,old_root); crypted=get_crypt_for_frm(); my_pthread_setspecific_ptr(THR_MALLOC,&outparam->mem_root); |