From 1b99948246e35c8d2b25591dcdd8277bb2db3d07 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 01:15:56 +0300 Subject: Removed duplicated and wrong merged code sql/sql_base.cc: Fixed wrong comment --- sql/sql_base.cc | 2 +- sql/sql_parse.cc | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) (limited to 'sql') diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 98ea4e0adf3..e3c0efb83b8 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1714,7 +1714,7 @@ int open_and_lock_tables(THD *thd, TABLE_LIST *tables) SYNOPSIS open_normal_and_derived_tables thd - thread handler - tables - list of tables for open&locking + tables - list of tables for open RETURN FALSE - ok diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e01ec3d483b..1ee80eea4a9 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2517,11 +2517,6 @@ mysql_execute_command(THD *thd) */ start_waiting_global_read_lock(thd); - // put tables back for PS rexecuting - tables= lex->link_first_table_back(tables, create_table, - create_table_local); - break; - unsent_create_error: // put tables back for PS rexecuting tables= lex->link_first_table_back(tables, create_table, @@ -3694,14 +3689,6 @@ error: thd->lock= 0; } DBUG_VOID_RETURN; - - error1: - /* - Release the protection against the global read lock and wake - everyone, who might want to set a global read lock. - */ - start_waiting_global_read_lock(thd); - DBUG_VOID_RETURN; } -- cgit v1.2.1 From 74dd6421777f2046b8e5067f8c918d1f29e9f339 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 11:16:37 +0200 Subject: sql_repl.cc: Bug #11064 some read error not detected in replication on 64-bit platform sql/sql_repl.cc: Bug #11064 some read error not detected in replication on 64-bit platform BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- sql/sql_repl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 9485031c144..ed2d477fc5d 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -84,7 +84,7 @@ static int send_file(THD *thd) char fname[FN_REFLEN+1]; const char *errmsg = 0; int old_timeout; - uint packet_len; + unsigned long packet_len; char buf[IO_SIZE]; // It's safe to alloc this DBUG_ENTER("send_file"); -- cgit v1.2.1 From 72dd44b9dede604b0ffc9acb2458ffde405212af Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 23:46:03 +0300 Subject: Move USE_PRAGMA_IMPLEMENTATION to proper place Ensure that 'null_value' is not accessed before val() is called in FIELD() functions Fixed initialization of key maps. This fixes some problems with keys when you have more than 64 keys Fixed that ROLLUP don't always create a temporary table. This fix ensures that func_gconcat.test results are now predictable mysql-test/r/func_gconcat.result: Move innodb specific test to innodb.test Changed table name r2 -> t2 More test to see how ROLLUP was optimized mysql-test/r/innodb.result: Moved test here form func_gconcat mysql-test/r/olap.result: New test results after optimization mysql-test/t/func_gconcat.test: Move innodb specific test to innodb.test Changed table name r2 -> t2 More test to see how ROLLUP was optimized mysql-test/t/innodb.test: Moved test here form func_gconcat sql/field.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_berkeley.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_blackhole.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_heap.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_innodb.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_isam.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_isammrg.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_myisam.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_myisammrg.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/ha_ndbcluster.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/handler.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/hash_filo.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_cmpfunc.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_func.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place Ensure that 'null_value' is not accessed before val() is called sql/item_geofunc.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_strfunc.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_subselect.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_sum.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_timefunc.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/item_uniq.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/log_event.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/mysql_priv.h: Change key_map_full to not be const as we are giving it a proper value on startup sql/mysqld.cc: Move key_map variables here and initialize key_map_full properly sql/opt_range.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/opt_range.h: Fix that test_quick_select() works with any ammount of keys sql/procedure.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/protocol.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/protocol_cursor.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/set_var.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_analyse.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_class.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_crypt.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_insert.cc: Fixed that max_rows is ulong sql/sql_list.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_map.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_olap.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_select.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place Fixed that ROLLUP don't have to always create a temporary table Added new argument to remove_const() to make above possible Fixed some errors that creapt up when we don't always do a temporary table for ROLLUP sql/sql_string.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_table.cc: Simple optimizations Fixed wrong checking of build_table_path() in undef-ed code sql/sql_udf.cc: Move USE_PRAGMA_IMPLEMENTATION to proper place sql/sql_yacc.yy: removed extra {} --- sql/field.cc | 5 +-- sql/ha_berkeley.cc | 5 +-- sql/ha_blackhole.cc | 7 ++-- sql/ha_heap.cc | 5 +-- sql/ha_innodb.cc | 5 +-- sql/ha_isam.cc | 8 ++--- sql/ha_isammrg.cc | 5 +-- sql/ha_myisam.cc | 5 +-- sql/ha_myisammrg.cc | 5 +-- sql/ha_ndbcluster.cc | 7 ++-- sql/handler.cc | 5 +-- sql/hash_filo.cc | 5 +-- sql/item.cc | 5 +-- sql/item_cmpfunc.cc | 5 +-- sql/item_func.cc | 16 ++++----- sql/item_geofunc.cc | 5 +-- sql/item_strfunc.cc | 5 +-- sql/item_subselect.cc | 5 +-- sql/item_sum.cc | 5 +-- sql/item_timefunc.cc | 5 +-- sql/item_uniq.cc | 7 ++-- sql/log_event.cc | 4 +-- sql/mysql_priv.h | 2 +- sql/mysqld.cc | 4 +++ sql/opt_range.cc | 5 +-- sql/opt_range.h | 8 +++-- sql/procedure.cc | 5 +-- sql/protocol.cc | 5 +-- sql/protocol_cursor.cc | 5 +-- sql/set_var.cc | 5 +-- sql/sql_analyse.cc | 5 +-- sql/sql_class.cc | 5 +-- sql/sql_crypt.cc | 5 +-- sql/sql_insert.cc | 8 ++--- sql/sql_list.cc | 5 +-- sql/sql_map.cc | 5 +-- sql/sql_olap.cc | 5 +-- sql/sql_select.cc | 90 ++++++++++++++++++++++++++++++++------------------ sql/sql_string.cc | 2 -- sql/sql_table.cc | 8 ++--- sql/sql_udf.cc | 7 ++-- sql/sql_yacc.yy | 1 - 42 files changed, 121 insertions(+), 193 deletions(-) (limited to 'sql') diff --git a/sql/field.cc b/sql/field.cc index 21c3fe12bb2..292bbe80362 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -19,13 +19,10 @@ ** This file implements classes defined in field.h *****************************************************************************/ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "sql_select.h" #include #include diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index d4adea4a7b4..35a137df97b 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -47,13 +47,10 @@ */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #ifdef HAVE_BERKELEY_DB #include #include diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc index a5456d54c1b..109098948ac 100644 --- a/sql/ha_blackhole.cc +++ b/sql/ha_blackhole.cc @@ -15,14 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation +#pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" - #ifdef HAVE_BLACKHOLE_DB #include "ha_blackhole.h" diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index ef0d0022860..ad0e8819842 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include "ha_heap.h" diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index b3b82df5469..2016f58083a 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -28,13 +28,10 @@ have disables the InnoDB inlining in this file. */ in Windows? */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "slave.h" #ifdef HAVE_INNOBASE_DB diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc index b755c63698f..b074edf719d 100644 --- a/sql/ha_isam.cc +++ b/sql/ha_isam.cc @@ -14,14 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation +#pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #ifdef HAVE_ISAM #include #include diff --git a/sql/ha_isammrg.cc b/sql/ha_isammrg.cc index 7e14ccb43bf..f6fe1a49e9e 100644 --- a/sql/ha_isammrg.cc +++ b/sql/ha_isammrg.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #ifdef HAVE_ISAM #include #ifndef MASTER diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index b4ac8cc777f..34e6c429a8f 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include #include "ha_myisam.h" diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index 3374ee1271a..1f9e6a71d16 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include "ha_myisammrg.h" #ifndef MASTER diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 516703112dd..d361bec8fcc 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -20,14 +20,11 @@ NDB Cluster */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation +#pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" - #ifdef HAVE_NDBCLUSTER_DB #include #include "ha_ndbcluster.h" diff --git a/sql/handler.cc b/sql/handler.cc index d47bb02a58c..d9db1afff7a 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -17,13 +17,10 @@ /* Handler-calling-functions */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "ha_heap.h" #include "ha_myisam.h" #include "ha_myisammrg.h" diff --git a/sql/hash_filo.cc b/sql/hash_filo.cc index 34f3cd6b035..a16ff6ac7be 100644 --- a/sql/hash_filo.cc +++ b/sql/hash_filo.cc @@ -20,11 +20,8 @@ ** to usage. */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "hash_filo.h" diff --git a/sql/item.cc b/sql/item.cc index d32a6581049..96fa1a8fac4 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include "my_dir.h" diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index f53dcb43e5c..b17c4a9fbf7 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -17,13 +17,10 @@ /* This file defines all compare functions */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include "sql_select.h" diff --git a/sql/item_func.cc b/sql/item_func.cc index ad8479c7b0b..2d16ef5e183 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -17,13 +17,10 @@ /* This file defines all numerical functions */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "slave.h" // for wait_for_master_pos #include #include @@ -1491,9 +1488,6 @@ longlong Item_func_field::val_int() { DBUG_ASSERT(fixed == 1); - if (args[0]->null_value) - return 0; - if (cmp_type == STRING_RESULT) { String *field; @@ -1509,18 +1503,22 @@ longlong Item_func_field::val_int() else if (cmp_type == INT_RESULT) { longlong val= args[0]->val_int(); + if (args[0]->null_value) + return 0; for (uint i=1; i < arg_count ; i++) { - if (!args[i]->null_value && val == args[i]->val_int()) + if (val == args[i]->val_int() && !args[i]->null_value) return (longlong) (i); } } else { double val= args[0]->val(); + if (args[0]->null_value) + return 0; for (uint i=1; i < arg_count ; i++) { - if (!args[i]->null_value && val == args[i]->val()) + if (val == args[i]->val() && !args[i]->null_value) return (longlong) (i); } } diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index e907c5a0d45..9dbc1724824 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -17,14 +17,11 @@ /* This file defines all spatial functions */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" - #ifdef HAVE_SPATIAL #include diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 725712f4e85..56b06cb02c4 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -20,13 +20,10 @@ ** (This shouldn't be needed) */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #ifdef HAVE_OPENSSL #include diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index f7defd96b04..9bd9eff5ef7 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -22,13 +22,10 @@ SUBSELECT TODO: (sql_select.h/sql_select.cc) */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "sql_select.h" inline Item * and_items(Item* cond, Item *item) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 9c35fb1d427..5c34dc6a603 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -17,14 +17,11 @@ /* Sum functions (COUNT, MIN...) */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" - Item_sum::Item_sum(List &list) :arg_count(list.elements) { diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 9f5cd61f95a..b7f9236ce46 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -17,13 +17,10 @@ /* This file defines all time functions */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include diff --git a/sql/item_uniq.cc b/sql/item_uniq.cc index c83373bd8b0..8e9653aba88 100644 --- a/sql/item_uniq.cc +++ b/sql/item_uniq.cc @@ -16,10 +16,7 @@ /* Compability file */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation +#pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" diff --git a/sql/log_event.cc b/sql/log_event.cc index 9701ef2ff00..866a7c21bb4 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -17,12 +17,10 @@ #ifndef MYSQL_CLIENT -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" #include "slave.h" #include #endif /* MYSQL_CLIENT */ diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 5b9e81620ce..0d058190a46 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -37,7 +37,7 @@ typedef ulong key_part_map; /* Used for finding key parts */ /* useful constants */ extern const key_map key_map_empty; -extern const key_map key_map_full; +extern key_map key_map_full; /* Should be threaded as const */ extern const char *primary_key_name; #include "mysql_com.h" diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5e3142ccf0e..44b91fd3530 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -351,6 +351,9 @@ char mysql_real_data_home[FN_REFLEN], *opt_init_connect, *opt_init_slave, def_ft_boolean_syntax[sizeof(ft_boolean_syntax)]; +const key_map key_map_empty(0); +key_map key_map_full(0); // Will be initialized later + const char *opt_date_time_formats[3]; char *language_ptr, *default_collation_name, *default_character_set_name; @@ -5677,6 +5680,7 @@ static void mysql_init_variables(void) mysqld_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS; bzero((gptr) &mysql_tmpdir_list, sizeof(mysql_tmpdir_list)); bzero((gptr) &com_stat, sizeof(com_stat)); + key_map_full.set_all(); /* Character sets */ system_charset_info= &my_charset_utf8_general_ci; diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 7b37f0ce4f7..4b6e56468d2 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -23,13 +23,10 @@ */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include #include "sql_select.h" diff --git a/sql/opt_range.h b/sql/opt_range.h index b55bb4708bf..87e0315a09e 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -143,10 +143,14 @@ 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(~(uint)0), 0, limit, force_quick_range) < 0; } + { + key_map tmp; + tmp.set_all(); + return test_quick_select(thd, tmp, 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); + ha_rows limit, bool force_quick_range); }; diff --git a/sql/procedure.cc b/sql/procedure.cc index 10689dd36f6..bd742f645d2 100644 --- a/sql/procedure.cc +++ b/sql/procedure.cc @@ -17,13 +17,10 @@ /* Procedures (functions with changes output of select) */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "procedure.h" #include "sql_analyse.h" // Includes procedure #ifdef USE_PROC_RANGE diff --git a/sql/protocol.cc b/sql/protocol.cc index 835bd986fb8..9a1a05591dd 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -19,13 +19,10 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include static const unsigned int PACKET_BUFFER_EXTRA_ALLOC= 1024; diff --git a/sql/protocol_cursor.cc b/sql/protocol_cursor.cc index 53a03001544..bb6a0eab2ee 100644 --- a/sql/protocol_cursor.cc +++ b/sql/protocol_cursor.cc @@ -19,13 +19,10 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include bool Protocol_cursor::send_fields(List *list, uint flag) diff --git a/sql/set_var.cc b/sql/set_var.cc index 5564ba096ac..b89cdffd4cb 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -48,13 +48,10 @@ new attribute. */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include "slave.h" #include diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 678bdbb4588..df66b3c4228 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -23,13 +23,10 @@ ** - type set is out of optimization yet */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "procedure.h" #include "sql_analyse.h" #include diff --git a/sql/sql_class.cc b/sql/sql_class.cc index ff45b164893..fff1e3a3b54 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -22,13 +22,10 @@ ** *****************************************************************************/ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #include #include diff --git a/sql/sql_crypt.cc b/sql/sql_crypt.cc index eda7f0f6bbb..1cfa0eb8570 100644 --- a/sql/sql_crypt.cc +++ b/sql/sql_crypt.cc @@ -23,14 +23,11 @@ needs something like 'ssh'. */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" - SQL_CRYPT::SQL_CRYPT(const char *password) { ulong rand_nr[2]; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index b4021943967..718e6b00ddc 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -752,7 +752,7 @@ public: volatile bool status,dead; COPY_INFO info; I_List rows; - uint group_count; + ulong group_count; TABLE_LIST table_list; // Argument delayed_insert() @@ -1420,7 +1420,7 @@ static void free_delayed_insert_blobs(register TABLE *table) bool delayed_insert::handle_inserts(void) { int error; - uint max_rows; + ulong max_rows; bool using_ignore=0, using_bin_log=mysql_bin_log.is_open(); delayed_row *row; DBUG_ENTER("handle_inserts"); @@ -1439,11 +1439,11 @@ bool delayed_insert::handle_inserts(void) } thd.proc_info="insert"; - max_rows=delayed_insert_limit; + max_rows= delayed_insert_limit; if (thd.killed || table->version != refresh_version) { thd.killed=1; - max_rows= ~(uint)0; // Do as much as possible + max_rows= ~(ulong)0; // Do as much as possible } /* diff --git a/sql/sql_list.cc b/sql/sql_list.cc index 485c569f49c..219ff85946e 100644 --- a/sql/sql_list.cc +++ b/sql/sql_list.cc @@ -15,14 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" - list_node end_of_list; void free_list(I_List *list) diff --git a/sql/sql_map.cc b/sql/sql_map.cc index 9baacd1bc4b..408938e7639 100644 --- a/sql/sql_map.cc +++ b/sql/sql_map.cc @@ -15,13 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #ifdef HAVE_MMAP #include #include diff --git a/sql/sql_olap.cc b/sql/sql_olap.cc index a365cbb0614..5631cf9dcef 100644 --- a/sql/sql_olap.cc +++ b/sql/sql_olap.cc @@ -28,13 +28,10 @@ #ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1 -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "sql_select.h" diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 9661c0c13c9..38e54ed7104 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -17,13 +17,10 @@ /* mysql_select and join optimization */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include "sql_select.h" #include @@ -35,9 +32,6 @@ const char *join_type_str[]={ "UNKNOWN","system","const","eq_ref","ref", "ref_or_null","unique_subquery","index_subquery" }; -const key_map key_map_empty(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, DYNAMIC_ARRAY *keyuse); @@ -66,7 +60,7 @@ static bool only_eq_ref_tables(JOIN *join, ORDER *order, table_map tables); static void update_depend_map(JOIN *join); static void update_depend_map(JOIN *join, ORDER *order); static ORDER *remove_const(JOIN *join,ORDER *first_order,COND *cond, - bool *simple_order); + bool change_list, bool *simple_order); static int return_zero_rows(JOIN *join, select_result *res,TABLE_LIST *tables, List &fields, bool send_row, uint select_options, const char *info, @@ -613,7 +607,7 @@ JOIN::optimize() /* Optimize distinct away if possible */ { ORDER *org_order= order; - order=remove_const(this, order,conds,&simple_order); + order=remove_const(this, order,conds,1, &simple_order); /* If we are using ORDER BY NULL or ORDER BY const_expression, return result in any order (even if we are using a GROUP BY) @@ -681,8 +675,9 @@ JOIN::optimize() DBUG_RETURN(1); } simple_group= 0; - if (rollup.state == ROLLUP::STATE_NONE) - group_list= remove_const(this, group_list, conds, &simple_group); + group_list= remove_const(this, group_list, conds, + rollup.state == ROLLUP::STATE_NONE, + &simple_group); if (!group_list && group) { order=0; // The output has only one row @@ -694,7 +689,7 @@ JOIN::optimize() if (procedure && procedure->group) { group_list= procedure->group= remove_const(this, procedure->group, conds, - &simple_group); + 1, &simple_group); calc_group_buffer(this, group_list); } @@ -1638,8 +1633,8 @@ static ha_rows get_quick_record_count(THD *thd, SQL_SELECT *select, { select->head=table; table->reginfo.impossible_range=0; - if ((error=select->test_quick_select(thd, *(key_map *)keys,(table_map) 0, - limit)) == 1) + if ((error= select->test_quick_select(thd, *(key_map *)keys,(table_map) 0, + limit, 0)) == 1) DBUG_RETURN(select->quick->records); if (error == -1) { @@ -3452,7 +3447,8 @@ 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(~(uint)0); /* test everything in quick */ + join_tab->keys.init(); + join_tab->keys.set_all(); /* test everything in quick */ join_tab->info=0; join_tab->on_expr=0; join_tab->ref.key = -1; @@ -3684,7 +3680,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) (join->select_options & OPTION_FOUND_ROWS ? HA_POS_ERROR : - join->unit->select_limit_cnt)) < 0) + join->unit->select_limit_cnt), 0) < 0) { /* Before reporting "Impossible WHERE" for the whole query @@ -3697,7 +3693,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) (join->select_options & OPTION_FOUND_ROWS ? HA_POS_ERROR : - join->unit->select_limit_cnt)) < 0) + join->unit->select_limit_cnt),0) < 0) DBUG_RETURN(1); // Impossible WHERE } else @@ -4200,20 +4196,39 @@ static void update_depend_map(JOIN *join, ORDER *order) /* - simple_order is set to 1 if sort_order only uses fields from head table - and the head table is not a LEFT JOIN table + Remove all constants and check if ORDER only contains simple expressions + + SYNOPSIS + remove_const() + join Join handler + first_order List of SORT or GROUP order + cond WHERE statement + change_list Set to 1 if we should remove things from list + If this is not set, then only simple_order is + calculated + simple_order Set to 1 if we are only using simple expressions + + RETURN + Returns new sort order + + simple_order is set to 1 if sort_order only uses fields from head table + and the head table is not a LEFT JOIN table + */ static ORDER * -remove_const(JOIN *join,ORDER *first_order, COND *cond, bool *simple_order) +remove_const(JOIN *join,ORDER *first_order, COND *cond, + bool change_list, bool *simple_order) { if (join->tables == join->const_tables) - return 0; // No need to sort - DBUG_ENTER("remove_const"); + return change_list ? 0 : first_order; // No need to sort + ORDER *order,**prev_ptr; table_map first_table= join->join_tab[join->const_tables].table->map; table_map not_const_tables= ~join->const_table_map; table_map ref; + DBUG_ENTER("remove_const"); + prev_ptr= &first_order; *simple_order= join->join_tab[join->const_tables].on_expr ? 0 : 1; @@ -4244,7 +4259,8 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond, bool *simple_order) } if ((ref=order_tables & (not_const_tables ^ first_table))) { - if (!(order_tables & first_table) && only_eq_ref_tables(join,first_order,ref)) + if (!(order_tables & first_table) && + only_eq_ref_tables(join,first_order, ref)) { DBUG_PRINT("info",("removing: %s", order->item[0]->full_name())); continue; @@ -4253,11 +4269,13 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond, bool *simple_order) } } } - *prev_ptr= order; // use this entry + if (change_list) + *prev_ptr= order; // use this entry prev_ptr= &order->next; } - *prev_ptr=0; - if (!first_order) // Nothing to sort/group + if (change_list) + *prev_ptr=0; + if (prev_ptr == &first_order) // Nothing to sort/group *simple_order=1; DBUG_PRINT("exit",("simple_order: %d",(int) *simple_order)); DBUG_RETURN(first_order); @@ -6357,7 +6375,7 @@ test_if_quick_select(JOIN_TAB *tab) delete tab->select->quick; tab->select->quick=0; return tab->select->test_quick_select(tab->join->thd, tab->keys, - (table_map) 0, HA_POS_ERROR); + (table_map) 0, HA_POS_ERROR, 0); } @@ -7352,12 +7370,15 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, parameres are set correctly by the range optimizer. */ key_map new_ref_key_map; - new_ref_key_map.clear_all(); /* Force the creation of quick select */ - new_ref_key_map.set_bit(new_ref_key); /* only for new_ref_key. */ + new_ref_key_map.clear_all(); // Force the creation of quick select + new_ref_key_map.set_bit(new_ref_key); // only for new_ref_key. if (select->test_quick_select(tab->join->thd, new_ref_key_map, 0, - (tab->join->select_options & OPTION_FOUND_ROWS) ? - HA_POS_ERROR : tab->join->unit->select_limit_cnt) <= 0) + (tab->join->select_options & + OPTION_FOUND_ROWS) ? + HA_POS_ERROR : + tab->join->unit->select_limit_cnt,0) <= + 0) DBUG_RETURN(0); } ref_key= new_ref_key; @@ -8902,6 +8923,8 @@ bool JOIN::make_sum_func_list(List &field_list, List &send_fields, for (uint i=0 ; i <= send_group_parts ;i++) sum_funcs_end[i]= func; } + else if (rollup.state == ROLLUP::STATE_READY) + DBUG_RETURN(FALSE); // Don't put end marker *func=0; // End marker DBUG_RETURN(FALSE); } @@ -9415,9 +9438,10 @@ bool JOIN::rollup_make_fields(List &fields_arg, List &sel_fields, This is an element that is used by the GROUP BY and should be set to NULL in this level */ + Item_null_result *null_item; item->maybe_null= 1; // Value will be null sometimes - Item_null_result *null_item= rollup.null_items[i]; - null_item->result_field= ((Item_field *) item)->result_field; + null_item= rollup.null_items[i]; + null_item->result_field= item->get_tmp_table_field(); item= null_item; break; } diff --git a/sql/sql_string.cc b/sql/sql_string.cc index e5339782f02..983c2d90a1d 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -17,11 +17,9 @@ /* 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 diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7e80a71beb0..3aa6da7ad0c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -325,7 +325,7 @@ int quick_rm_table(enum db_type base,const char *db, build_table_path(path, sizeof(path), db, table_name, reg_ext); if (my_delete(path,MYF(0))) error=1; /* purecov: inspected */ - build_table_path(path, sizeof(path), db, table_name, ""); + *fn_ext(path)= 0; // Remove reg_ext return ha_delete_table(base,path) || error; } @@ -1339,7 +1339,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, /* Check if table exists */ if (create_info->options & HA_LEX_CREATE_TMP_TABLE) { - char tmp_table_name[NAME_LEN+1]; + char tmp_table_name[tmp_file_prefix_length+22+22+22+3]; my_snprintf(tmp_table_name, sizeof(tmp_table_name), "%s%lx_%lx_%x", tmp_file_prefix, current_pid, thd->thread_id, thd->tmp_table++); @@ -2622,7 +2622,7 @@ int mysql_create_indexes(THD *thd, TABLE_LIST *table_list, List &keys) build_table_path(path, sizeof(path), table_list->db, (lower_case_table_names == 2) ? table_list->alias : table_list->real_name, - reg_ext) != 0 || + reg_ext) == 0 || mysql_create_frm(thd, path, &create_info, fields, key_count, key_info_buffer, table->file)) /* don't need to free((gptr) key_info_buffer);*/ @@ -2723,7 +2723,7 @@ int mysql_drop_indexes(THD *thd, TABLE_LIST *table_list, build_table_path(path, sizeof(path), table_list->db, (lower_case_table_names == 2) ? table_list->alias : table_list->real_name, - reg_ext) != 0 || + reg_ext) == 0 || mysql_create_frm(thd, path, &create_info, fields, key_count, key_info_buffer, table->file)) /*don't need to free((gptr) key_numbers);*/ diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index deed806db2a..72c92a5c53a 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -28,13 +28,10 @@ ** dynamic functions, so this shouldn't be a real problem. */ -#include - +#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: implement sql_udf.h +#pragma implementation // gcc: Class implementation #endif - -#include "mysql_priv.h" #include #ifdef HAVE_DLOPEN diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 7585f0b10a0..bc21649fe54 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4064,7 +4064,6 @@ replace: } insert_field_spec {} - {} ; insert_lock_option: -- cgit v1.2.1 From d6e0883b070cbb66a3dc94384816835964025aba Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Jun 2005 14:58:32 +0400 Subject: Fix show warnings limit 0 and show warnings limit 0, 0. Add test coverage for SHOW WARNINGS LIMIT a, b; mysql-test/r/warnings.result: Add test coverage for SHOW WARNINGS LIMIT a,b mysql-test/t/warnings.test: Add test coverage for SHOW WARNINGS LIMIT a,b sql/sql_error.cc: Fix show warnings limit 0 and show warnings limit 0, 0 --- sql/sql_error.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql') diff --git a/sql/sql_error.cc b/sql/sql_error.cc index d19e9fbdb09..a31e15d0745 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -203,6 +203,8 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show) offset--; continue; } + if (limit-- == 0) + break; protocol->prepare_for_resend(); protocol->store(warning_level_names[err->level], warning_level_length[err->level], system_charset_info); @@ -210,8 +212,6 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show) protocol->store(err->msg, strlen(err->msg), system_charset_info); if (protocol->write()) DBUG_RETURN(1); - if (!--limit) - break; } send_eof(thd); DBUG_RETURN(0); -- cgit v1.2.1 From 062a1b8b4e09c6de8ab592d37567d40d13798875 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 5 Jun 2005 19:38:52 +0200 Subject: a compiler must see '#pragma implementation' *before* '#pragma interface' (that comes with the #include'd header file) --- sql/examples/ha_archive.cc | 2 -- sql/examples/ha_example.cc | 2 -- sql/examples/ha_tina.cc | 2 -- sql/field.cc | 3 ++- sql/ha_berkeley.cc | 4 +++- sql/ha_blackhole.cc | 2 +- sql/ha_heap.cc | 3 ++- sql/ha_innodb.cc | 3 ++- sql/ha_isam.cc | 3 ++- sql/ha_isammrg.cc | 3 ++- sql/ha_myisam.cc | 3 ++- sql/ha_myisammrg.cc | 3 ++- sql/ha_ndbcluster.cc | 3 ++- sql/handler.cc | 3 ++- sql/hash_filo.cc | 3 ++- sql/item.cc | 2 +- sql/item_cmpfunc.cc | 3 ++- sql/item_func.cc | 3 ++- sql/item_geofunc.cc | 2 +- sql/item_strfunc.cc | 3 ++- sql/item_subselect.cc | 3 ++- sql/item_sum.cc | 3 ++- sql/item_timefunc.cc | 3 ++- sql/item_uniq.cc | 3 ++- sql/log_event.cc | 3 ++- sql/opt_range.cc | 3 ++- sql/procedure.cc | 3 ++- sql/protocol.cc | 3 ++- sql/protocol_cursor.cc | 3 ++- sql/set_var.cc | 3 ++- sql/sql_analyse.cc | 3 ++- sql/sql_class.cc | 3 ++- sql/sql_crypt.cc | 3 ++- sql/sql_list.cc | 3 ++- sql/sql_map.cc | 3 ++- sql/sql_olap.cc | 3 ++- sql/sql_select.cc | 3 ++- sql/sql_string.cc | 3 ++- sql/sql_udf.cc | 3 ++- sql/tztime.cc | 3 +-- 40 files changed, 71 insertions(+), 44 deletions(-) (limited to 'sql') diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index e58996d3c01..10712c2e3be 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -14,8 +14,6 @@ along with this program; if not, write to the Free Software 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/examples/ha_example.cc b/sql/examples/ha_example.cc index 2592d307e37..31e4e97c5c7 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -63,8 +63,6 @@ -Brian */ -#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 16e28e5ae85..07e69bfac80 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -38,8 +38,6 @@ TODO: -Brian */ -#include - #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif diff --git a/sql/field.cc b/sql/field.cc index 292bbe80362..692f123097a 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -19,10 +19,11 @@ ** This file implements classes defined in field.h *****************************************************************************/ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "sql_select.h" #include #include diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 35a137df97b..33f7b6238b0 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -47,10 +47,12 @@ */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" + #ifdef HAVE_BERKELEY_DB #include #include diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc index 109098948ac..5b1527aa210 100644 --- a/sql/ha_blackhole.cc +++ b/sql/ha_blackhole.cc @@ -15,11 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" #ifdef HAVE_BLACKHOLE_DB #include "ha_blackhole.h" diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index ad0e8819842..4fc0116a26a 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include "ha_heap.h" diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 2016f58083a..3f2e11e8bd1 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -28,10 +28,11 @@ have disables the InnoDB inlining in this file. */ in Windows? */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "slave.h" #ifdef HAVE_INNOBASE_DB diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc index b074edf719d..afa7dffa5f4 100644 --- a/sql/ha_isam.cc +++ b/sql/ha_isam.cc @@ -14,10 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #ifdef HAVE_ISAM #include #include diff --git a/sql/ha_isammrg.cc b/sql/ha_isammrg.cc index f6fe1a49e9e..c0e6f665f08 100644 --- a/sql/ha_isammrg.cc +++ b/sql/ha_isammrg.cc @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #ifdef HAVE_ISAM #include #ifndef MASTER diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 34e6c429a8f..d8608c6a599 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include #include "ha_myisam.h" diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index 1f9e6a71d16..edb3521470f 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include "ha_myisammrg.h" #ifndef MASTER diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index d361bec8fcc..a0080af1dfb 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -20,11 +20,12 @@ NDB Cluster */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" + #ifdef HAVE_NDBCLUSTER_DB #include #include "ha_ndbcluster.h" diff --git a/sql/handler.cc b/sql/handler.cc index d9db1afff7a..f14564b6629 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -17,10 +17,11 @@ /* Handler-calling-functions */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "ha_heap.h" #include "ha_myisam.h" #include "ha_myisammrg.h" diff --git a/sql/hash_filo.cc b/sql/hash_filo.cc index a16ff6ac7be..ec200768222 100644 --- a/sql/hash_filo.cc +++ b/sql/hash_filo.cc @@ -20,8 +20,9 @@ ** to usage. */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "hash_filo.h" diff --git a/sql/item.cc b/sql/item.cc index 96fa1a8fac4..c96794ff482 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -15,10 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" #include #include "my_dir.h" diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index b17c4a9fbf7..337ac949d35 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -17,10 +17,11 @@ /* This file defines all compare functions */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include "sql_select.h" diff --git a/sql/item_func.cc b/sql/item_func.cc index 2d16ef5e183..442ef15bba8 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -17,10 +17,11 @@ /* This file defines all numerical functions */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "slave.h" // for wait_for_master_pos #include #include diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 9dbc1724824..8b856d809d6 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -17,11 +17,11 @@ /* This file defines all spatial functions */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" #ifdef HAVE_SPATIAL #include diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 56b06cb02c4..5ca5caf6bdf 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -20,10 +20,11 @@ ** (This shouldn't be needed) */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #ifdef HAVE_OPENSSL #include diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 9bd9eff5ef7..ebc08545566 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -22,10 +22,11 @@ SUBSELECT TODO: (sql_select.h/sql_select.cc) */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "sql_select.h" inline Item * and_items(Item* cond, Item *item) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 5c34dc6a603..0e252259f53 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -17,11 +17,12 @@ /* Sum functions (COUNT, MIN...) */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" + Item_sum::Item_sum(List &list) :arg_count(list.elements) { diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index b7f9236ce46..a3cf69035f3 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -17,10 +17,11 @@ /* This file defines all time functions */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include diff --git a/sql/item_uniq.cc b/sql/item_uniq.cc index 8e9653aba88..7701bbbb63e 100644 --- a/sql/item_uniq.cc +++ b/sql/item_uniq.cc @@ -16,7 +16,8 @@ /* Compability file */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" diff --git a/sql/log_event.cc b/sql/log_event.cc index 866a7c21bb4..a4319f63b83 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -17,10 +17,11 @@ #ifndef MYSQL_CLIENT -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "slave.h" #include #endif /* MYSQL_CLIENT */ diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 4b6e56468d2..bd1befb436f 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -23,10 +23,11 @@ */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include #include "sql_select.h" diff --git a/sql/procedure.cc b/sql/procedure.cc index bd742f645d2..a0042dd879e 100644 --- a/sql/procedure.cc +++ b/sql/procedure.cc @@ -17,10 +17,11 @@ /* Procedures (functions with changes output of select) */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "procedure.h" #include "sql_analyse.h" // Includes procedure #ifdef USE_PROC_RANGE diff --git a/sql/protocol.cc b/sql/protocol.cc index 9a1a05591dd..6a17ae2f95b 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -19,10 +19,11 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include static const unsigned int PACKET_BUFFER_EXTRA_ALLOC= 1024; diff --git a/sql/protocol_cursor.cc b/sql/protocol_cursor.cc index bb6a0eab2ee..b225e06ed32 100644 --- a/sql/protocol_cursor.cc +++ b/sql/protocol_cursor.cc @@ -19,10 +19,11 @@ The actual communction is handled by the net_xxx functions in net_serv.cc */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include bool Protocol_cursor::send_fields(List *list, uint flag) diff --git a/sql/set_var.cc b/sql/set_var.cc index b89cdffd4cb..0fa9932dbbc 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -48,10 +48,11 @@ new attribute. */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include "slave.h" #include diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index df66b3c4228..fb5d0eb0a3f 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -23,10 +23,11 @@ ** - type set is out of optimization yet */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "procedure.h" #include "sql_analyse.h" #include diff --git a/sql/sql_class.cc b/sql/sql_class.cc index fff1e3a3b54..805db107370 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -22,10 +22,11 @@ ** *****************************************************************************/ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #include #include diff --git a/sql/sql_crypt.cc b/sql/sql_crypt.cc index 1cfa0eb8570..f21a109e95d 100644 --- a/sql/sql_crypt.cc +++ b/sql/sql_crypt.cc @@ -23,11 +23,12 @@ needs something like 'ssh'. */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" + SQL_CRYPT::SQL_CRYPT(const char *password) { ulong rand_nr[2]; diff --git a/sql/sql_list.cc b/sql/sql_list.cc index 219ff85946e..d57a7dfe4e3 100644 --- a/sql/sql_list.cc +++ b/sql/sql_list.cc @@ -15,11 +15,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include "mysql_priv.h" + list_node end_of_list; void free_list(I_List *list) diff --git a/sql/sql_map.cc b/sql/sql_map.cc index 408938e7639..aac44949d89 100644 --- a/sql/sql_map.cc +++ b/sql/sql_map.cc @@ -15,10 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #ifdef HAVE_MMAP #include #include diff --git a/sql/sql_olap.cc b/sql/sql_olap.cc index 5631cf9dcef..024abb6c74b 100644 --- a/sql/sql_olap.cc +++ b/sql/sql_olap.cc @@ -28,10 +28,11 @@ #ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1 -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "sql_select.h" diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 38e54ed7104..0424cd8fdbb 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -17,10 +17,11 @@ /* mysql_select and join optimization */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include "sql_select.h" #include diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 983c2d90a1d..ab2db4aaf53 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -16,10 +16,11 @@ /* 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 72c92a5c53a..0b84d1b5fb3 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -28,10 +28,11 @@ ** dynamic functions, so this shouldn't be a real problem. */ -#include "mysql_priv.h" #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif + +#include "mysql_priv.h" #include #ifdef HAVE_DLOPEN diff --git a/sql/tztime.cc b/sql/tztime.cc index 30ff25f080f..b5ebc9f350a 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -25,12 +25,11 @@ it creates unsolved link dependencies on some platforms. */ -#include - #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif +#include #if !defined(TZINFO2SQL) && !defined(TESTTIME) #include "mysql_priv.h" #else -- cgit v1.2.1