From: Pekka Nousiainen Date: October 17 2012 12:25pm Subject: bzr push into mysql-5.5-cluster-7.2 branch (pekka.nousiainen:4032 to 4037) List-Archive: http://lists.mysql.com/commits/145053 Message-Id: <20121017122537.25388.42086.4037@cuda> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4037 Pekka Nousiainen 2012-10-17 [merge] merge to 7.2 modified: sql/ha_ndbcluster_binlog.cc 4036 magnus.blaudd@stripped 2012-10-17 Turn off build of NDB's Java components in BUILD/compile-dist modified: BUILD/compile-dist 4035 magnus.blaudd@stripped 2012-10-17 [merge] Merge 7.1 -> 7.2 modified: mysql-test/lib/My/Exec.pm mysql-test/suite/ndb/t/ndb_backup_rate.test storage/ndb/clusterj/clusterj-jdbc/src/test/java/jdbctest/JDBCQueryTest.java storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/Utility.java 4034 magnus.blaudd@stripped 2012-10-17 Honour the MTR_BINDIR variable which is set by mtr in out of source builds and points to the build location modified: mysql-test/suite/ndb/include/have_clusterj.inc mysql-test/suite/ndb/include/have_clusterj_jpa.inc mysql-test/suite/ndb/include/have_ndb_rqg.inc mysql-test/suite/ndb/include/have_ndbjtie_junit.inc mysql-test/suite/ndb/include/ndb_info.inc mysql-test/suite/ndb/t/have_ndb_dist_priv.inc mysql-test/suite/ndb/t/have_ndbinfo.inc 4033 magnus.blaudd@stripped 2012-10-16 ndb - make it possible to set the default value to use for WITH_NDB_JAVA true the environment variable WITH_NDB_JAVA_DEFAULT - set WITH_NDB_JAVA default to ON modified: storage/ndb/CMakeLists.txt 4032 Jan Wedvik 2012-10-15 Fix build break on Windows. modified: storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp === modified file 'BUILD/compile-dist' --- a/BUILD/compile-dist 2011-08-31 10:39:08 +0000 +++ b/BUILD/compile-dist 2012-10-17 12:10:00 +0000 @@ -74,6 +74,12 @@ then fi fi +if test -z "$WITH_NDB_JAVA_DEFAULT" ; then + # Turn off build of NDB's Java components + export WITH_NDB_JAVA_DEFAULT + WITH_NDB_JAVA_DEFAULT=0 +fi + # Make sure to enable all features that affect "make dist" # Remember that configure restricts the man pages to the configured features ! ./configure \ === modified file 'mysql-test/lib/My/Exec.pm' --- a/mysql-test/lib/My/Exec.pm 2011-07-05 12:46:07 +0000 +++ b/mysql-test/lib/My/Exec.pm 2012-10-17 11:56:01 +0000 @@ -34,15 +34,23 @@ sub get_logfile_name { return $logfile_name; } -# Save a set of lines to a file -sub save_file { - my $filename = shift; - my $lines = shift; - - my $F = IO::File->new($filename, "w") or die "Can't write to '$filename': $!"; - foreach my $line (@$lines) { - print $F $line +# Show the last "max_lines" from file +sub show_last_lines_from_file { + my ($filename, $max_lines) = @_; + + my $F = IO::File->new($filename, "r") + or print "Failed to open file '$filename' for reading: $!\n" and return; + + my @input = <$F>; + my $lines = scalar(@input); + $lines = $max_lines if $lines > $max_lines; + print "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; + print "Last '$lines' lines of output from command:\n"; + foreach my $line (splice(@input, -$lines)) + { + print $line; } + print "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; $F->close(); } @@ -66,10 +74,14 @@ sub exec_print_on_error { my $logfile_name = get_logfile_name($cmd); - $cmd .= " 2>&1"; - my @output = `$cmd`; - print "Result of '$cmd': $?, logfile: '$logfile_name'\n"; - save_file($logfile_name, \@output); + # Redirect stdout and stderr of command to log file + $cmd .= " > $logfile_name 2>&1"; + + # Execute command + print "Running '$cmd'\n"; + system($cmd); + + print "Result of '$cmd': $?\n"; if ($? == 0) { # Test program suceeded @@ -91,14 +103,8 @@ sub exec_print_on_error { print "Test program killed by signal $sig\n" if $sig; print "Test program failed with error $return\n" if $return; - # Show the last lines of the output - my $lines = scalar(@output); - $lines = $max_lines if $lines > $max_lines; - print "Last '$lines' lines of output from command:\n"; - foreach my $line (splice(@output, -$lines)) - { - print $line; - } + # Show the "max_lines" last lines from the log file + show_last_lines_from_file($logfile_name, $max_lines); } return 0; } === modified file 'mysql-test/suite/ndb/include/have_clusterj.inc' --- a/mysql-test/suite/ndb/include/have_clusterj.inc 2011-10-24 12:45:30 +0000 +++ b/mysql-test/suite/ndb/include/have_clusterj.inc 2012-10-17 11:50:45 +0000 @@ -16,26 +16,27 @@ use My::Find; my $vardir = $ENV{MYSQLTEST_VARDIR} or die "Need MYSQLTEST_VARDIR"; my $mysql_test_dir = $ENV{MYSQL_TEST_DIR} or die "Need MYSQL_TEST_DIR"; my $basedir = dirname($mysql_test_dir); +my $bindir = $ENV{MTR_BINDIR} || $basedir; # Out of source set MTR_BINDIR # # Check if the needed jars and libs are available # -my $clusterj_jar = my_find_file($basedir, +my $clusterj_jar = my_find_file($bindir, [ "storage/ndb/clusterj", "share/java", "share/mysql/java", "lib/java" ], "clusterj-*.jar", NOT_REQUIRED); -my $clusterj_test_jar = my_find_file($basedir, +my $clusterj_test_jar = my_find_file($bindir, [ "storage/ndb/clusterj/clusterj-test", "share/java", "share/mysql/java", "lib/java" ], "clusterj-test-*.jar", NOT_REQUIRED); -my $ndbclient_lib = my_find_file($basedir, +my $ndbclient_lib = my_find_file($bindir, ["storage/ndb/src/.libs", "storage/ndb/src", "lib/mysql", === modified file 'mysql-test/suite/ndb/include/have_clusterj_jpa.inc' --- a/mysql-test/suite/ndb/include/have_clusterj_jpa.inc 2010-03-25 10:06:13 +0000 +++ b/mysql-test/suite/ndb/include/have_clusterj_jpa.inc 2012-10-17 11:50:45 +0000 @@ -16,17 +16,18 @@ use My::Find; my $vardir = $ENV{MYSQLTEST_VARDIR} or die "Need MYSQLTEST_VARDIR"; my $mysql_test_dir = $ENV{MYSQL_TEST_DIR} or die "Need MYSQL_TEST_DIR"; my $basedir = dirname($mysql_test_dir); +my $bindir = $ENV{MTR_BINDIR} || $basedir; # Out of source set MTR_BINDIR # # Check if the needed jars are available # -my $clusterj_jpa_jar = my_find_file($basedir, +my $clusterj_jpa_jar = my_find_file($bindir, ["storage/ndb/clusterj/clusterj-openjpa", "share/mysql/java", # install unix "lib/java"], # install windows "clusterjpa-*.jar", NOT_REQUIRED); -my $clusterj_jpa_test_jar = my_find_file($basedir, +my $clusterj_jpa_test_jar = my_find_file($bindir, ["storage/ndb/clusterj/clusterj-jpatest", "share/mysql/java", # install unix "lib/java"], # install windows === modified file 'mysql-test/suite/ndb/include/have_ndb_rqg.inc' --- a/mysql-test/suite/ndb/include/have_ndb_rqg.inc 2011-10-14 13:24:01 +0000 +++ b/mysql-test/suite/ndb/include/have_ndb_rqg.inc 2012-10-17 11:50:45 +0000 @@ -18,6 +18,7 @@ use My::Find; my $vardir = $ENV{MYSQLTEST_VARDIR} or die "Need MYSQLTEST_VARDIR"; my $mysql_test_dir = $ENV{MYSQL_TEST_DIR} or die "Need MYSQL_TEST_DIR"; my $basedir = dirname($mysql_test_dir); +my $bindir = $ENV{MTR_BINDIR} || $basedir; # Out of source set MTR_BINDIR # # Check if the needed jars and libs are available @@ -35,7 +36,7 @@ my $runrqg = my_find_file($basedir, ["storage/ndb/test/rqg" ], "run_rqg.sh", NOT_REQUIRED); -my $exe_mysqltest = my_find_bin($basedir, +my $exe_mysqltest = my_find_bin($bindir, ["client", "bin"], "mysqltest", NOT_REQUIRED); === modified file 'mysql-test/suite/ndb/include/have_ndbjtie_junit.inc' --- a/mysql-test/suite/ndb/include/have_ndbjtie_junit.inc 2010-02-25 13:37:50 +0000 +++ b/mysql-test/suite/ndb/include/have_ndbjtie_junit.inc 2012-10-17 11:50:45 +0000 @@ -16,15 +16,16 @@ use My::Find; my $vardir = $ENV{MYSQLTEST_VARDIR} or die "Need MYSQLTEST_VARDIR"; my $mysql_test_dir = $ENV{MYSQL_TEST_DIR} or die "Need MYSQL_TEST_DIR"; my $basedir = dirname($mysql_test_dir); +my $bindir = $ENV{MTR_BINDIR} || $basedir; # Out of source set MTR_BINDIR # # Check if the needed tests are available # -my $jtie_junit = my_find_file($basedir, +my $jtie_junit = my_find_file($bindir, ["storage/ndb/src/ndbjtie/test", "share/mysql/java"], "ndbjtie-test-*.jar", NOT_REQUIRED); -my $jtie_unload_junit = my_find_file($basedir, +my $jtie_unload_junit = my_find_file($bindir, ["storage/ndb/src/ndbjtie/jtie/test/unload", "share/mysql/java"], "jtie-test-unload-*.jar", NOT_REQUIRED); === modified file 'mysql-test/suite/ndb/include/ndb_info.inc' --- a/mysql-test/suite/ndb/include/ndb_info.inc 2010-08-02 11:49:11 +0000 +++ b/mysql-test/suite/ndb/include/ndb_info.inc 2012-10-17 11:50:45 +0000 @@ -24,12 +24,13 @@ use My::Find; my $vardir = $ENV{MYSQLTEST_VARDIR} or die "Need MYSQLTEST_VARDIR"; my $mysql_test_dir = $ENV{MYSQL_TEST_DIR} or die "Need MYSQL_TEST_DIR"; my $basedir = dirname($mysql_test_dir); +my $bindir = $ENV{MTR_BINDIR} || $basedir; # Out of source set MTR_BINDIR my $ndb_connectstring = $ENV{NDB_CONNECTSTRING} or die "Need NDB_CONNECTSTRING"; # -# Check if the needed jars are available +# Find ndb_config # -my $ndb_config = my_find_file($basedir, +my $ndb_config = my_find_file($bindir, ["storage/ndb/tools", "bin"], ["ndb_config", "ndb_config.exe"], NOT_REQUIRED); === modified file 'mysql-test/suite/ndb/t/have_ndb_dist_priv.inc' --- a/mysql-test/suite/ndb/t/have_ndb_dist_priv.inc 2011-10-24 10:06:44 +0000 +++ b/mysql-test/suite/ndb/t/have_ndb_dist_priv.inc 2012-10-17 11:50:45 +0000 @@ -16,9 +16,10 @@ use My::Find; my $vardir = $ENV{MYSQLTEST_VARDIR} or die "Need MYSQLTEST_VARDIR"; my $mysql_test_dir = $ENV{MYSQL_TEST_DIR} or die "Need MYSQL_TEST_DIR"; my $basedir = dirname($mysql_test_dir); +my $bindir = $ENV{MTR_BINDIR} || $basedir; # Out of source set MTR_BINDIR # -# Check if the needed tests are available +# Check if the necessary files are available # my $sql_file = my_find_file($basedir, ["storage/ndb/tools", "share/mysql/", "share" ], === modified file 'mysql-test/suite/ndb/t/have_ndbinfo.inc' --- a/mysql-test/suite/ndb/t/have_ndbinfo.inc 2010-03-18 10:22:52 +0000 +++ b/mysql-test/suite/ndb/t/have_ndbinfo.inc 2012-10-17 11:50:45 +0000 @@ -16,11 +16,12 @@ use My::Find; my $vardir = $ENV{MYSQLTEST_VARDIR} or die "Need MYSQLTEST_VARDIR"; my $mysql_test_dir = $ENV{MYSQL_TEST_DIR} or die "Need MYSQL_TEST_DIR"; my $basedir = dirname($mysql_test_dir); +my $bindir = $ENV{MTR_BINDIR} || $basedir; # Out of source set MTR_BINDIR # # Check if the needed tests are available # -my $sql_file = my_find_file($basedir, +my $sql_file = my_find_file($bindir, ["storage/ndb/tools", "share/mysql/"], "ndbinfo.sql", NOT_REQUIRED); === modified file 'mysql-test/suite/ndb/t/ndb_backup_rate.test' --- a/mysql-test/suite/ndb/t/ndb_backup_rate.test 2012-09-13 20:18:47 +0000 +++ b/mysql-test/suite/ndb/t/ndb_backup_rate.test 2012-10-16 11:07:51 +0000 @@ -1,5 +1,9 @@ -- source include/have_ndb.inc +# Valgrinding slows the mysqld down and thus making it +# impossible to fill the redo log of ndbd(s) -> skip test +--source include/not_valgrind.inc + use test; create table t1 (a varchar(1024)) engine=ndb max_rows=100000000; insert into t1 values (repeat('I', 1024)); === modified file 'sql/ha_ndbcluster_binlog.cc' --- a/sql/ha_ndbcluster_binlog.cc 2012-09-24 14:57:07 +0000 +++ b/sql/ha_ndbcluster_binlog.cc 2012-10-17 12:23:49 +0000 @@ -6569,7 +6569,17 @@ injectApplyStatusWriteRow(injector::tran /* Intialize apply_status_table->record[0] + + When iterating past the end of the last epoch, the first event of + the new epoch may be on ndb_apply_status. Its event data saved + in record[0] would be overwritten here by a subsequent event on a + normal table. So save and restore its record[0]. */ + static const ulong sav_max= 512; // current is 284 + const ulong sav_len= apply_status_table->s->reclength; + DBUG_ASSERT(sav_len <= sav_max); + uchar sav_buf[sav_max]; + memcpy(sav_buf, apply_status_table->record[0], sav_len); empty_record(apply_status_table); apply_status_table->field[0]->store((longlong)::server_id, true); @@ -6595,6 +6605,7 @@ injectApplyStatusWriteRow(injector::tran assert(ret == 0); + memcpy(apply_status_table->record[0], sav_buf, sav_len); DBUG_RETURN(true); } === modified file 'storage/ndb/CMakeLists.txt' --- a/storage/ndb/CMakeLists.txt 2012-10-12 16:21:51 +0000 +++ b/storage/ndb/CMakeLists.txt 2012-10-16 07:51:23 +0000 @@ -125,12 +125,6 @@ IF (NOT WITH_NDBCLUSTER) RETURN() ENDIF() -OPTION(WITH_NDB_JAVA - "Include NDB Cluster Java components" OFF) -IF(WITH_NDB_JAVA) - MESSAGE(STATUS "Include NDB Java components") -ENDIF() - IF(CMAKE_SIZEOF_VOID_P EQUAL 4) MESSAGE(STATUS "Building NDB 32-bit") ELSE() @@ -201,6 +195,15 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} SET(HAVE_JAVA FALSE) SET(HAVE_JDK FALSE) +SET(WITH_NDB_JAVA_DEFAULT ON) +# Check if the default for WITH_NDB_JAVA should be overriden +# by environment variable +IF (DEFINED ENV{WITH_NDB_JAVA_DEFAULT}) + SET(WITH_NDB_JAVA_DEFAULT $ENV{WITH_NDB_JAVA_DEFAULT}) + MESSAGE(STATUS "Default value for WITH_NDB_JAVA set to ${WITH_NDB_JAVA_DEFAULT}") +ENDIF() +OPTION(WITH_NDB_JAVA + "Include NDB Cluster Java components" ${WITH_NDB_JAVA_DEFAULT}) IF(WITH_NDB_JAVA) # Check for Java and JDK needed by ndbjtie and clusterj INCLUDE(FindJava) === modified file 'storage/ndb/clusterj/clusterj-jdbc/src/test/java/jdbctest/JDBCQueryTest.java' --- a/storage/ndb/clusterj/clusterj-jdbc/src/test/java/jdbctest/JDBCQueryTest.java 2011-07-05 12:46:07 +0000 +++ b/storage/ndb/clusterj/clusterj-jdbc/src/test/java/jdbctest/JDBCQueryTest.java 2012-10-17 11:56:01 +0000 @@ -5,6 +5,7 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import com.mysql.clusterj.Session; @@ -96,6 +97,8 @@ public abstract class JDBCQueryTest exte PreparedStatement statement = prepareStatement(connection, sql); int[] actual = executeQuery(statement, low, high); commit(connection); + Arrays.sort(actual); + Arrays.sort(expected); errorIfNotEqual("betweenQuery: Mismatch on betweenQuery", expected, actual); } === modified file 'storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/Utility.java' --- a/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/Utility.java 2012-04-05 06:37:40 +0000 +++ b/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/Utility.java 2012-10-16 19:21:14 +0000 @@ -116,12 +116,15 @@ public class Utility { // TODO: this is intended to investigate a class loader issue with Sparc java // The idea is to force loading the CharsetMap native class prior to calling the static create method + // First, make sure that the native library is loaded because CharsetMap depends on it + static { + ClusterConnectionServiceImpl.loadSystemLibrary("ndbclient"); + } static Class charsetMapClass = loadClass("com.mysql.ndbjtie.mysql.CharsetMap"); static Class loadClass(String className) { try { return Class.forName(className); } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block throw new ClusterJUserException(local.message("ERR_Loading_Native_Class", className), e); } } No bundle (reason: useless for push emails).