From d54a54c7abf2315d937205265ba165c3ae4a4940 Mon Sep 17 00:00:00 2001 From: "jonas@perch.ndb.mysql.com" <> Date: Thu, 27 Oct 2005 16:41:55 +0200 Subject: [PATCH 01/13] bug#13078 - ndb memleak when doing ordered index scan on index with column larger than 32 bytes --- ndb/src/ndbapi/NdbImpl.hpp | 10 ++++++---- ndb/src/ndbapi/NdbRecAttr.cpp | 4 ++++ ndb/src/ndbapi/ndb_cluster_connection.cpp | 13 +++++++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/ndb/src/ndbapi/NdbImpl.hpp b/ndb/src/ndbapi/NdbImpl.hpp index 33aaca8de96..aa918a6f9f8 100644 --- a/ndb/src/ndbapi/NdbImpl.hpp +++ b/ndb/src/ndbapi/NdbImpl.hpp @@ -78,11 +78,9 @@ public: /** * NOTE free lists must be _after_ theNdbObjectIdMap take * assure that destructors are run in correct order + * NOTE these has to be in this specific order to make destructor run in + * correct order */ - Ndb_free_list_t theConIdleList; - Ndb_free_list_t theOpIdleList; - Ndb_free_list_t theScanOpIdleList; - Ndb_free_list_t theIndexOpIdleList; Ndb_free_list_t theRecAttrIdleList; Ndb_free_list_t theSignalIdleList; Ndb_free_list_t theLabelList; @@ -91,6 +89,10 @@ public: Ndb_free_list_t theCallList; Ndb_free_list_t theNdbBlobIdleList; Ndb_free_list_t theScanList; + Ndb_free_list_t theScanOpIdleList; + Ndb_free_list_t theOpIdleList; + Ndb_free_list_t theIndexOpIdleList; + Ndb_free_list_t theConIdleList; }; #ifdef VM_TRACE diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index f993c652bf9..26039fb7867 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -35,6 +35,7 @@ Adjust: 971206 UABRONM First version NdbRecAttr::NdbRecAttr(Ndb*) { + theStorageX = 0; init(); } @@ -64,6 +65,9 @@ NdbRecAttr::setup(const NdbColumnImpl* anAttrInfo, char* aValue) theNULLind = 0; m_nullable = anAttrInfo->m_nullable; + if (theStorageX) + delete[] theStorageX; + // check alignment to signal data // a future version could check alignment per data type as well diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp index 4fcf4d08396..a313a973a42 100644 --- a/ndb/src/ndbapi/ndb_cluster_connection.cpp +++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp @@ -308,6 +308,19 @@ Ndb_cluster_connection_impl::~Ndb_cluster_connection_impl() // fragmentToNodeMap.release(); + if (ndb_global_event_buffer_mutex != NULL) + { + NdbMutex_Destroy(ndb_global_event_buffer_mutex); + ndb_global_event_buffer_mutex= NULL; + } +#ifdef VM_TRACE + if (ndb_print_state_mutex != NULL) + { + NdbMutex_Destroy(ndb_print_state_mutex); + ndb_print_state_mutex= NULL; + } +#endif + DBUG_VOID_RETURN; } From 44012d40f2c5661882ac580b40b5ce06cff9bc1e Mon Sep 17 00:00:00 2001 From: "knielsen@mysql.com" <> Date: Wed, 14 Dec 2005 13:51:11 +0100 Subject: [PATCH 02/13] Remove unused class member as suggested by Guilhem. --- sql/sql_class.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/sql_class.h b/sql/sql_class.h index 81cf4185e7e..c025b4f0774 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -218,7 +218,6 @@ class MYSQL_LOG: public TC_LOG uint file_id; uint open_count; // For replication int readers_count; - bool reset_pending; bool write_error, inited; bool need_start_event; /* From b0500f54c892fb054cceb6773bc2528b3e3358a2 Mon Sep 17 00:00:00 2001 From: "mskold@mysql.com" <> Date: Wed, 14 Dec 2005 14:45:13 +0100 Subject: [PATCH 03/13] Fix to make ndb_multi.test (Bug #15401 NDB lock problems) more predictable --- mysql-test/r/ndb_multi.result | 1 + mysql-test/t/ndb_multi.test | 1 + 2 files changed, 2 insertions(+) diff --git a/mysql-test/r/ndb_multi.result b/mysql-test/r/ndb_multi.result index 2080be241e8..bd3af223a65 100644 --- a/mysql-test/r/ndb_multi.result +++ b/mysql-test/r/ndb_multi.result @@ -30,6 +30,7 @@ create table t1 (a int) engine=ndbcluster; insert into t1 value (2); select * from t1; ERROR HY000: Got error 241 'Invalid schema object version' from ndbcluster +flush table t1; select * from t1; a 2 diff --git a/mysql-test/t/ndb_multi.test b/mysql-test/t/ndb_multi.test index 760150c6f6a..1183f2b283f 100644 --- a/mysql-test/t/ndb_multi.test +++ b/mysql-test/t/ndb_multi.test @@ -40,6 +40,7 @@ connection server1; # Currently a retry is required remotely --error 1296 select * from t1; +flush table t1; select * from t1; # Connect to server2 and use the tables from there From 1ca115d6d08f2b51a047a5913003a1c68167dd27 Mon Sep 17 00:00:00 2001 From: "rparranovo@mysql.com" <> Date: Thu, 15 Dec 2005 00:34:38 -0300 Subject: [PATCH 04/13] Makefile.am: - modified zlib/Makefile.am so we now generate libz.so.1.2.3 instead of libz.so.0.0.0 --- zlib/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zlib/Makefile.am b/zlib/Makefile.am index e94d184a841..679adc0c997 100644 --- a/zlib/Makefile.am +++ b/zlib/Makefile.am @@ -18,6 +18,8 @@ pkglib_LTLIBRARIES=libz.la +libz_la_LDFLAGS= -version-info=3:3:2 + noinst_HEADERS= crc32.h deflate.h inffast.h inffixed.h inflate.h \ inftrees.h trees.h zconf.h zlib.h zutil.h From f6d77ed18c75f5e6fd45c91244b1065b4d0c8d46 Mon Sep 17 00:00:00 2001 From: "rparranovo@mysql.com" <> Date: Thu, 15 Dec 2005 00:54:15 -0300 Subject: [PATCH 05/13] Makefile.am: - Modified zlib/Makefile.am to generate libz.so.1.2.3 instead of libz.so.0.0.0 --- zlib/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zlib/Makefile.am b/zlib/Makefile.am index e94d184a841..679adc0c997 100644 --- a/zlib/Makefile.am +++ b/zlib/Makefile.am @@ -18,6 +18,8 @@ pkglib_LTLIBRARIES=libz.la +libz_la_LDFLAGS= -version-info=3:3:2 + noinst_HEADERS= crc32.h deflate.h inffast.h inffixed.h inflate.h \ inftrees.h trees.h zconf.h zlib.h zutil.h From 5d7345da1311d21e07ba50fd7f06e8df63bbc50e Mon Sep 17 00:00:00 2001 From: "rparranovo@mysql.com" <> Date: Thu, 15 Dec 2005 02:08:52 -0300 Subject: [PATCH 06/13] Makefile.am: - libtool wants spaces on parameters for its command line options --- zlib/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zlib/Makefile.am b/zlib/Makefile.am index 679adc0c997..11b1991fa62 100644 --- a/zlib/Makefile.am +++ b/zlib/Makefile.am @@ -18,7 +18,7 @@ pkglib_LTLIBRARIES=libz.la -libz_la_LDFLAGS= -version-info=3:3:2 +libz_la_LDFLAGS= -version-info 3:3:2 noinst_HEADERS= crc32.h deflate.h inffast.h inffixed.h inflate.h \ inftrees.h trees.h zconf.h zlib.h zutil.h From b21e1d418d1bcc566e6c27cfbad8b1c032aada0c Mon Sep 17 00:00:00 2001 From: "rparranovo@mysql.com" <> Date: Thu, 15 Dec 2005 02:11:21 -0300 Subject: [PATCH 07/13] Makefile.am: - libtool wants spaces on parameters for its command line options --- zlib/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zlib/Makefile.am b/zlib/Makefile.am index 679adc0c997..11b1991fa62 100644 --- a/zlib/Makefile.am +++ b/zlib/Makefile.am @@ -18,7 +18,7 @@ pkglib_LTLIBRARIES=libz.la -libz_la_LDFLAGS= -version-info=3:3:2 +libz_la_LDFLAGS= -version-info 3:3:2 noinst_HEADERS= crc32.h deflate.h inffast.h inffixed.h inflate.h \ inftrees.h trees.h zconf.h zlib.h zutil.h From ea4c3481f2590510eba5ce915dad47f491f67054 Mon Sep 17 00:00:00 2001 From: "aivanov@mysql.com" <> Date: Thu, 15 Dec 2005 18:48:08 +0300 Subject: [PATCH 08/13] Fixed BUG #12440: "Incorrect processing of time values containing long fraction and/or large exponent part". --- mysql-test/r/type_time.result | 24 ++++++++++++++++++++++++ mysql-test/t/type_time.test | 14 ++++++++++++++ sql-common/my_time.c | 28 ++++++++++++++++++++++------ 3 files changed, 60 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index 025cf2a57f1..cb76f699cd9 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -85,3 +85,27 @@ sec_to_time(time_to_sec(t)) 13:00:00 09:00:00 drop table t1; +SELECT CAST(235959.123456 AS TIME); +CAST(235959.123456 AS TIME) +23:59:59.123456 +SELECT CAST(0.235959123456e+6 AS TIME); +CAST(0.235959123456e+6 AS TIME) +23:59:59.123456 +SELECT CAST(235959123456e-6 AS TIME); +CAST(235959123456e-6 AS TIME) +23:59:59.123456 +SELECT CAST(235959.1234567 AS TIME); +CAST(235959.1234567 AS TIME) +23:59:59.123456 +Warnings: +Warning 1292 Truncated incorrect time value: '235959.1234567' +SELECT CAST(0.2359591234567e6 AS TIME); +CAST(0.2359591234567e6 AS TIME) +23:59:59.123456 +Warnings: +Warning 1292 Truncated incorrect time value: '235959.1234567' +SELECT CAST(0.2359591234567e+30 AS TIME); +CAST(0.2359591234567e+30 AS TIME) +NULL +Warnings: +Warning 1292 Truncated incorrect time value: '2.359591234567e+29' diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test index 7ae3f65f7cc..9abfe914335 100644 --- a/mysql-test/t/type_time.test +++ b/mysql-test/t/type_time.test @@ -21,4 +21,18 @@ select t, time_to_sec(t),sec_to_time(time_to_sec(t)) from t1; select sec_to_time(time_to_sec(t)) from t1; drop table t1; +# +# BUG #12440: Incorrect processing of time values containing +# long fraction part and/or large exponent part. +# +# These must return normal result: +SELECT CAST(235959.123456 AS TIME); +SELECT CAST(0.235959123456e+6 AS TIME); +SELECT CAST(235959123456e-6 AS TIME); +# These must cut fraction part and produce warning: +SELECT CAST(235959.1234567 AS TIME); +SELECT CAST(0.2359591234567e6 AS TIME); +# This must return NULL and produce warning: +SELECT CAST(0.2359591234567e+30 AS TIME); + # End of 4.1 tests diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 40d7799e274..3c46a944ba9 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -514,18 +514,34 @@ fractional: /* Get fractional second part */ if ((end-str) >= 2 && *str == '.' && my_isdigit(&my_charset_latin1,str[1])) { - uint field_length=5; + int field_length= 5; str++; value=(uint) (uchar) (*str - '0'); - while (++str != end && - my_isdigit(&my_charset_latin1,str[0]) && - field_length--) - value=value*10 + (uint) (uchar) (*str - '0'); - if (field_length) + while (++str != end && my_isdigit(&my_charset_latin1, *str)) + { + if (field_length-- > 0) + value= value*10 + (uint) (uchar) (*str - '0'); + } + if (field_length > 0) value*= (long) log_10_int[field_length]; + else if (field_length < 0) + *was_cut= 1; date[4]=value; } else date[4]=0; + + /* Check for exponent part: E | E */ + /* (may occur as result of %g formatting of time value) */ + if ((end - str) > 1 && + (*str == 'e' || *str == 'E') && + (my_isdigit(&my_charset_latin1, str[1]) || + ((str[1] == '-' || str[1] == '+') && + (end - str) > 2 && + my_isdigit(&my_charset_latin1, str[2])))) + { + *was_cut= 1; + return 1; + } if (internal_format_positions[7] != 255) { From 5e34b5da01125faec5814e66b14dab957d0be641 Mon Sep 17 00:00:00 2001 From: "ranger@regul.home.lan" <> Date: Fri, 16 Dec 2005 00:23:55 +0200 Subject: [PATCH 09/13] Fixed stress parts in shell and perl versions of mysql-test-run script to limit stress testing with 20 test loops in case when any limit parameter was specified --- mysql-test/lib/mtr_stress.pl | 8 ++++++++ mysql-test/mysql-test-run.pl | 2 +- mysql-test/mysql-test-run.sh | 12 ++++++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/mysql-test/lib/mtr_stress.pl b/mysql-test/lib/mtr_stress.pl index a57d94e8043..d3ed24db545 100644 --- a/mysql-test/lib/mtr_stress.pl +++ b/mysql-test/lib/mtr_stress.pl @@ -145,6 +145,14 @@ sub run_stress_test () mtr_add_arg($args, "--stress-init-file=%", $::opt_stress_init_file); } + if ( !$::opt_stress_loop_count && !$::opt_stress_test_count && + !$::opt_stress_test_duration ) + { + #Limit stress testing with 20 loops in case when any limit parameter + #was specified + $::opt_stress_test_count=20; + } + if ( $::opt_stress_loop_count ) { mtr_add_arg($args, "--loop-count=%s", $::opt_stress_loop_count); diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 8ccd87fc7a8..0513d3d4a1a 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -276,7 +276,7 @@ our $opt_stress= ""; our $opt_stress_suite= "main"; our $opt_stress_mode= "random"; our $opt_stress_threads= 5; -our $opt_stress_test_count= 20; +our $opt_stress_test_count= ""; our $opt_stress_loop_count= ""; our $opt_stress_test_duration= ""; our $opt_stress_init_file= ""; diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index c84763713e1..a115a82a6a4 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -279,7 +279,7 @@ DO_STRESS="" STRESS_SUITE="main" STRESS_MODE="random" STRESS_THREADS=5 -STRESS_TEST_COUNT=20 +STRESS_TEST_COUNT="" STRESS_LOOP_COUNT="" STRESS_TEST_DURATION="" STRESS_INIT_FILE="" @@ -1906,7 +1906,7 @@ run_stress_test() --stress-basedir=$STRESS_BASEDIR \ --server-logs-dir=$STRESS_BASEDIR \ --stress-mode=$STRESS_MODE \ - --mysqltest=$BASEDIR/client/mysqltest \ + --mysqltest=$CLIENT_BINDIR/mysqltest \ --threads=$STRESS_THREADS \ --verbose \ --cleanup \ @@ -1917,6 +1917,14 @@ run_stress_test() STRESS_TEST_ARGS="$STRESS_TEST_ARGS --stress-init-file=$STRESS_INIT_FILE" fi + if [ -z "$STRESS_LOOP_COUNT" -a -z "$STRESS_TEST_COUNT" -a + -z "$STRESS_TEST_DURATION" ] ; then + + #Limit stress testing with 20 loops in case when any limit parameter + #was specified + STRESS_TEST_COUNT=20 + fi + if [ -n "$STRESS_LOOP_COUNT" ] ; then STRESS_TEST_ARGS="$STRESS_TEST_ARGS --loop-count=$STRESS_LOOP_COUNT" fi From fb50e37c5ab9cce4b441eeb41da8412573baedd7 Mon Sep 17 00:00:00 2001 From: "knielsen@mysql.com" <> Date: Fri, 16 Dec 2005 09:38:30 +0100 Subject: [PATCH 10/13] BUG#15805: Disabled test type_time; fails in --ps-protocol mode. --- mysql-test/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 4722fac435c..0e7eabbed6d 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -13,3 +13,4 @@ sp-goto : GOTO is currently is disabled - will be fixed in the future kill : Unstable test case, bug#9712 subselect : Bug#15706 +type_time : Bug#15805 From 29f44a8c7795a5faec07c6ee33cfe07b68dfebf0 Mon Sep 17 00:00:00 2001 From: "ranger@regul.home.lan" <> Date: Fri, 16 Dec 2005 22:53:10 +0200 Subject: [PATCH 11/13] Fixed default values for counters to 0 --- mysql-test/mysql-test-run.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 0513d3d4a1a..6e46a93dce9 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -276,9 +276,9 @@ our $opt_stress= ""; our $opt_stress_suite= "main"; our $opt_stress_mode= "random"; our $opt_stress_threads= 5; -our $opt_stress_test_count= ""; -our $opt_stress_loop_count= ""; -our $opt_stress_test_duration= ""; +our $opt_stress_test_count= 0; +our $opt_stress_loop_count= 0; +our $opt_stress_test_duration= 0; our $opt_stress_init_file= ""; our $opt_stress_test_file= ""; From d3b64781e16367b5b1917fc25d77d19f71a33712 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sun, 18 Dec 2005 14:51:19 +0100 Subject: [PATCH 12/13] Makefile.am: Adjusted listing of files to put into source TAR --- BUILD/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BUILD/Makefile.am b/BUILD/Makefile.am index 2414d4f3a44..859bc0c00c4 100644 --- a/BUILD/Makefile.am +++ b/BUILD/Makefile.am @@ -23,7 +23,9 @@ EXTRA_DIST = FINISH.sh \ compile-alpha-ccc \ compile-alpha-cxx \ compile-alpha-debug \ + compile-dist \ compile-ia64-debug-max \ + compile-irix-mips64-mipspro \ compile-pentium \ compile-pentium-debug \ compile-pentium-debug-max \ @@ -35,9 +37,10 @@ EXTRA_DIST = FINISH.sh \ compile-pentium-myodbc \ compile-pentium-mysqlfs-debug \ compile-pentium-pgcc \ + compile-pentium-valgrind-max \ + compile-pentium64-debug-max \ compile-solaris-sparc \ compile-solaris-sparc-debug \ - compile-irix-mips64-mipspro \ compile-solaris-sparc-forte \ compile-solaris-sparc-purify From 16d66d2a1e4157dad48d509c91316d27c1e6f5a7 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sun, 18 Dec 2005 15:07:58 +0100 Subject: [PATCH 13/13] Makefile.am: Added 5.0 specific build scripts --- BUILD/Makefile.am | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BUILD/Makefile.am b/BUILD/Makefile.am index 2d58486e0ba..a5f3623c25e 100644 --- a/BUILD/Makefile.am +++ b/BUILD/Makefile.am @@ -37,11 +37,15 @@ EXTRA_DIST = FINISH.sh \ compile-pentium-debug \ compile-pentium-debug-max \ compile-pentium-debug-max-no-embedded \ + compile-pentium-debug-max-no-ndb \ compile-pentium-debug-no-bdb \ compile-pentium-debug-openssl \ compile-pentium-debug-yassl \ compile-pentium-gcov \ compile-pentium-gprof \ + compile-pentium-icc \ + compile-pentium-icc-valgrind-max \ + compile-pentium-icc-yassl \ compile-pentium-max \ compile-pentium-myodbc \ compile-pentium-mysqlfs-debug \ @@ -53,6 +57,7 @@ EXTRA_DIST = FINISH.sh \ compile-ppc \ compile-ppc-debug \ compile-ppc-debug-max \ + compile-ppc-debug-max-no-ndb \ compile-ppc-max \ compile-solaris-sparc \ compile-solaris-sparc-debug \