diff --git a/BUILD/check-cpu b/BUILD/check-cpu index 3ceb9c269fe..b970a4b9a5b 100755 --- a/BUILD/check-cpu +++ b/BUILD/check-cpu @@ -28,7 +28,7 @@ if test -r /proc/cpuinfo ; then fi # parse CPU flags - for flag in `$cpuinfo | grep 'flags' | sed -e 's/^flags.*: //'`; do + for flag in `$cpuinfo | grep '^flags' | sed -e 's/^flags.*: //'`; do eval cpu_flag_$flag=yes done else @@ -52,7 +52,6 @@ fi # detect CPU shortname as used by gcc options # this list is not complete, feel free to add further entries cpu_arg="" - case "$cpu_family--$model_name" in # DEC Alpha Alpha*EV6*) @@ -98,9 +97,13 @@ case "$cpu_family--$model_name" in cpu_arg=""; ;; - # + # + *ppc*) + cpu_arg='powerpc' + ;; + *powerpc*) - cpu_arg=`echo $model_name | sed -e"s/ppc//g"` + cpu_arg='powerpc' ;; # unknown @@ -111,7 +114,7 @@ esac if test -z "$cpu_arg"; then - echo "BUILD/check-cpu: Oops, could not findout what kind of cpu this machine is using." + echo "BUILD/check-cpu: Oops, could not find out what kind of cpu this machine is using." check_cpu_cflags="" return fi diff --git a/client/sql_string.cc b/client/sql_string.cc index 8f0e46c5eea..690997152f1 100644 --- a/client/sql_string.cc +++ b/client/sql_string.cc @@ -16,12 +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/configure.in b/configure.in index a5c2e7044fe..e685e811c2f 100644 --- a/configure.in +++ b/configure.in @@ -1837,12 +1837,23 @@ if test "$ac_cv_sizeof_off_t" -eq 0 then AC_MSG_ERROR("MySQL needs a off_t type.") fi + +# do we need #pragma interface/#pragma implementation ? +# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin +AC_MSG_CHECKING(the need for @%:@pragma interface/implementation) +# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't +# follow any standard), we'll use well-defined preprocessor macros: +AC_TRY_CPP([ +#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3) +#error USE_PRAGMA_IMPLEMENTATION +#endif +],AC_MSG_RESULT(no) ,AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS -DUSE_PRAGMA_IMPLEMENTATION") + # This always gives a warning. Ignore it unless you are cross compiling AC_C_BIGENDIAN #---START: Used in for client configure # Check base type of last arg to accept MYSQL_TYPE_ACCEPT - #---END: # Figure out what type of struct rlimit to use with setrlimit MYSQL_TYPE_STRUCT_RLIMIT diff --git a/include/my_global.h b/include/my_global.h index c978bf82b3a..523ecfba74d 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -43,16 +43,11 @@ #define HAVE_ERRNO_AS_DEFINE #endif /* __CYGWIN__ */ -/* Determine when to use "#pragma interface" */ -#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3) +/* to make command line shorter we'll define USE_PRAGMA_INTERFACE here */ +#ifdef USE_PRAGMA_IMPLEMENTATION #define USE_PRAGMA_INTERFACE #endif -/* Determine when to use "#pragma implementation" */ -#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3) -#define USE_PRAGMA_IMPLEMENTATION -#endif - #if defined(i386) && !defined(__i386__) #define __i386__ #endif diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl index 5f80864d1f7..efa1b3bec21 100644 --- a/mysql-test/lib/mtr_misc.pl +++ b/mysql-test/lib/mtr_misc.pl @@ -25,7 +25,7 @@ sub mtr_full_hostname () { if ( $hostname !~ /\./ ) { my $address= gethostbyname($hostname) - or die "Couldn't resolve $hostname : $!"; + or mtr_error("Couldn't resolve $hostname : $!"); my $fullname= gethostbyaddr($address, AF_INET); $hostname= $fullname if $fullname; } diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index 78758e54aa4..7bca422773c 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -17,6 +17,7 @@ sub mtr_spawn ($$$$$$); sub mtr_stop_mysqld_servers ($); sub mtr_kill_leftovers (); sub mtr_record_dead_children (); +sub mtr_exit ($); sub sleep_until_file_created ($$$); # static in C @@ -784,4 +785,17 @@ sub sleep_until_file_created ($$$) { } +############################################################################## +# +# When we exit, we kill off all children +# +############################################################################## + +sub mtr_exit ($) { + my $code= shift; + local $SIG{HUP} = 'IGNORE'; + kill('HUP', -$$); + exit($code); +} + 1; diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index cb41549422f..a258d139bb1 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -268,7 +268,8 @@ sub mtr_warning (@) { } sub mtr_error (@) { - die "mysql-test-run: *** ERROR: ",join(" ", @_),"\n"; + print STDERR "mysql-test-run: *** ERROR: ",join(" ", @_),"\n"; + mtr_exit(1); } sub mtr_debug (@) { diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 9d809593ea7..d4fb37c2f96 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -398,7 +398,7 @@ sub main () { } } - exit(0); + mtr_exit(0); } ############################################################################## @@ -568,7 +568,9 @@ sub command_line_setup () { $opt_vardir= "$glob_mysql_test_dir/var"; } - if ( $opt_vardir !~ m,^/, ) + # We make the path absolute, as the server will do a chdir() before usage + unless ( $opt_vardir =~ m,^/, or + ($glob_win32 and $opt_vardir =~ m,^[a-z]:/,i) ) { # Make absolute path, relative test dir $opt_vardir= "$glob_mysql_test_dir/$opt_vardir"; @@ -1295,9 +1297,9 @@ sub install_db ($$) { mtr_report("Installing \u$type Databases"); open(IN, $init_db_sql) - or error("Can't open $init_db_sql: $!"); + or mtr_error("Can't open $init_db_sql: $!"); open(OUT, ">", $init_db_sql_tmp) - or error("Can't write to $init_db_sql_tmp: $!"); + or mtr_error("Can't write to $init_db_sql_tmp: $!"); while () { chomp; @@ -1571,7 +1573,7 @@ sub report_failure_and_restart ($) { { stop_masters_slaves(); } - exit(1); + mtr_exit(1); } # FIXME always terminate on failure?! @@ -2270,5 +2272,5 @@ Options not yet described, or that I want to look into more with-openssl HERE - exit(1); + mtr_exit(1); } diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index d1d96afa153..e97b309547a 100644 --- a/mysql-test/r/warnings.result +++ b/mysql-test/r/warnings.result @@ -179,3 +179,56 @@ drop table t1; set table_type=MYISAM; Warnings: Warning 1287 'table_type' is deprecated; use 'storage_engine' instead +create table t1 (a int); +insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +update t1 set a='abc'; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'a' at row 2 +Warning 1265 Data truncated for column 'a' at row 3 +Warning 1265 Data truncated for column 'a' at row 4 +Warning 1265 Data truncated for column 'a' at row 5 +Warning 1265 Data truncated for column 'a' at row 6 +Warning 1265 Data truncated for column 'a' at row 7 +Warning 1265 Data truncated for column 'a' at row 8 +Warning 1265 Data truncated for column 'a' at row 9 +Warning 1265 Data truncated for column 'a' at row 10 +show warnings limit 2, 1; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 3 +show warnings limit 0, 10; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'a' at row 2 +Warning 1265 Data truncated for column 'a' at row 3 +Warning 1265 Data truncated for column 'a' at row 4 +Warning 1265 Data truncated for column 'a' at row 5 +Warning 1265 Data truncated for column 'a' at row 6 +Warning 1265 Data truncated for column 'a' at row 7 +Warning 1265 Data truncated for column 'a' at row 8 +Warning 1265 Data truncated for column 'a' at row 9 +Warning 1265 Data truncated for column 'a' at row 10 +show warnings limit 9, 1; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 10 +show warnings limit 10, 1; +Level Code Message +show warnings limit 9, 2; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 10 +show warnings limit 0, 0; +Level Code Message +show warnings limit 1; +Level Code Message +Warning 1265 Data truncated for column 'a' at row 1 +show warnings limit 0; +Level Code Message +show warnings limit 1, 0; +Level Code Message +select * from t1 limit 0; +a +select * from t1 limit 1, 0; +a +select * from t1 limit 0, 0; +a +drop table t1; diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test index 2a90f5f637d..6a6d533ad61 100644 --- a/mysql-test/t/warnings.test +++ b/mysql-test/t/warnings.test @@ -133,3 +133,25 @@ drop table t1; # Test for deprecated table_type variable # set table_type=MYISAM; + +# +# Tests for show warnings limit a, b +# +create table t1 (a int); +insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +# should generate 10 warnings +update t1 set a='abc'; +show warnings limit 2, 1; +show warnings limit 0, 10; +show warnings limit 9, 1; +show warnings limit 10, 1; +show warnings limit 9, 2; +show warnings limit 0, 0; +show warnings limit 1; +show warnings limit 0; +show warnings limit 1, 0; +# make sure behaviour is consistent with select ... limit +select * from t1 limit 0; +select * from t1 limit 1, 0; +select * from t1 limit 0, 0; +drop table t1; diff --git a/mysys/raid.cc b/mysys/raid.cc index 20e70d2d102..62587c438ca 100644 --- a/mysys/raid.cc +++ b/mysys/raid.cc @@ -70,8 +70,6 @@ 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 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_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); 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