Commit 6138410c authored by unknown's avatar unknown
Browse files

Fixed ndbapi-examples, and added tests for mysql-test-run.pl


storage/ndb/ndbapi-examples/ndbapi_simple_dual/Makefile:
  BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/storage/ndb/ndbapi-examples/ndbapi_simple_dual/Makefile
storage/ndb/ndbapi-examples/ndbapi_simple_dual/ndbapi_simple_dual.cpp:
  BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/storage/ndb/ndbapi-examples/ndbapi_simple_dual/ndbapi_simple_dual.cpp
storage/ndb/ndbapi-examples/mgmapi_logevent_dual/Makefile:
  BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/storage/ndb/ndbapi-examples/mgmapi_logevent_dual/Makefile
storage/ndb/ndbapi-examples/mgmapi_logevent_dual/mgmapi_logevent_dual.cpp:
  BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/storage/ndb/ndbapi-examples/mgmapi_logevent_dual/mgmapi_logevent_dual.cpp
mysql-test/include/have_ndbapi_examples.inc:
  BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/mysql-test/include/have_ndbapi_examples.inc
mysql-test/t/ndbapi.test:
  BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/mysql-test/t/ndbapi.test
mysql-test/t/rpl_ndbapi_multi.test:
  BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/mysql-test/t/rpl_ndbapi_multi.test
mysql-test/r/have_ndbapi_examples.require:
  BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/mysql-test/r/have_ndbapi_examples.require
mysql-test/r/ndbapi.result:
  BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/mysql-test/r/ndbapi.result
mysql-test/r/rpl_ndbapi_multi.result:
  BitKeeper file /windows/Linux_space/MySQL/mysql-5.1/mysql-test/r/rpl_ndbapi_multi.result
parent 3dcf8673
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
--require r/have_ndbapi_examples.require
disable_query_log;
eval select LENGTH("$MY_NDB_EXAMPLES_BINARY") > 0 as "have_ndb_example";
enable_query_log;
+24 −0
Original line number Diff line number Diff line
@@ -323,6 +323,8 @@ our $opt_skip_slave_binlog= 0;
our $exe_ndb_mgm;
our $exe_ndb_waiter;
our $path_ndb_tools_dir;
our $path_ndb_examples_dir;
our $exe_ndb_example;
our $file_ndb_testrun_log;

our @data_dir_lst;
@@ -1233,6 +1235,9 @@ sub executable_setup () {
      mtr_script_exists("$glob_basedir/scripts/mysql_fix_privilege_tables",
                        "/usr/bin/false");
    $path_ndb_tools_dir= mtr_path_exists("$glob_basedir/storage/ndb/tools");
    $path_ndb_examples_dir= mtr_path_exists("$glob_basedir/storage/ndb/ndbapi-examples");
    $exe_ndb_example= mtr_exe_exists("$path_ndb_examples_dir/ndbapi_simple/ndbapi_simple",
				    $exe_mysqld);
    $exe_ndb_mgm=        "$glob_basedir/storage/ndb/src/mgmclient/ndb_mgm";
    $exe_ndb_waiter=     "$glob_basedir/storage/ndb/tools/ndb_waiter";
    $exe_ndbd=           "$glob_basedir/storage/ndb/src/kernel/ndbd";
@@ -1297,6 +1302,7 @@ sub executable_setup () {
    }

    $path_ndb_tools_dir=  "$glob_basedir/bin";
    $path_ndb_examples_dir=  "$glob_basedir/ndbapi-examples";
    $exe_ndb_mgm=         "$glob_basedir/bin/ndb_mgm";
    $exe_ndb_waiter=      "$glob_basedir/bin/ndb_waiter";
    $exe_ndbd=            "$glob_basedir/bin/ndbd";
@@ -1344,6 +1350,20 @@ sub environment_setup () {
    ($lib_udf_example ?  dirname($lib_udf_example) : "") .
      ($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : "");

  # --------------------------------------------------------------------------
  # Add the path where libndbclient can be found
  # --------------------------------------------------------------------------
  $ENV{'LD_LIBRARY_PATH'}=
    (mtr_path_exists("$glob_basedir/storage/ndb/src/.libs") ?  "$glob_basedir/storage/ndb/src/.libs" : "") .
      ($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : "");

  # --------------------------------------------------------------------------
  # Add the path where libmysqlclient can be found
  # --------------------------------------------------------------------------
  $ENV{'LD_LIBRARY_PATH'}=
    (mtr_path_exists("$glob_basedir/libmysql_r/.libs") ?  "$glob_basedir/libmysql_r/.libs" : "") .
      ($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : "");


  # --------------------------------------------------------------------------
  # Also command lines in .opt files may contain env vars
@@ -1360,6 +1380,7 @@ sub environment_setup () {
  $ENV{'MASTER_MYSOCK1'}=     $master->[1]->{'path_sock'};
  $ENV{'MASTER_MYPORT'}=      $master->[0]->{'port'};
  $ENV{'MASTER_MYPORT1'}=     $master->[1]->{'port'};
  $ENV{'SLAVE_MYSOCK'}=       $slave->[0]->{'path_sock'};
  $ENV{'SLAVE_MYPORT'}=       $slave->[0]->{'port'};
  $ENV{'SLAVE_MYPORT1'}=      $slave->[1]->{'port'};
  $ENV{'SLAVE_MYPORT2'}=      $slave->[2]->{'port'};
@@ -3802,7 +3823,10 @@ sub run_mysqltest ($) {
  $ENV{'NDB_BACKUP_DIR'}=           $clusters->[0]->{'data_dir'};
  $ENV{'NDB_DATA_DIR'}=             $clusters->[0]->{'data_dir'};
  $ENV{'NDB_TOOLS_DIR'}=            $path_ndb_tools_dir;
  $ENV{'NDB_EXAMPLES_DIR'}=         $path_ndb_examples_dir;
  $ENV{'MY_NDB_EXAMPLES_BINARY'}=   ($exe_ndb_example eq "$path_ndb_examples_dir/ndbapi_simple/ndbapi_simple")?$exe_ndb_example:"";
  $ENV{'NDB_TOOLS_OUTPUT'}=         $file_ndb_testrun_log;
  $ENV{'NDB_EXAMPLES_OUTPUT'}=      $file_ndb_testrun_log;
  $ENV{'NDB_CONNECTSTRING'}=        $opt_ndbconnectstring;

  my $exe= $exe_mysqltest;
+2 −0
Original line number Diff line number Diff line
have_ndb_example
1
+22 −0
Original line number Diff line number Diff line
DROP TABLE IF EXISTS t0;
drop database if exists mysqltest;
Running ndbapi_simple, results in /windows/Linux_space/MySQL/mysql-5.1/mysql-test/var/log/ndb_testrun.log
Running ndbapi_simple_index, results in /windows/Linux_space/MySQL/mysql-5.1/mysql-test/var/log/ndb_testrun.log
Running ndbapi_scan, results in /windows/Linux_space/MySQL/mysql-5.1/mysql-test/var/log/ndb_testrun.log
Running ndbapi_retries, results in /windows/Linux_space/MySQL/mysql-5.1/mysql-test/var/log/ndb_testrun.log
Running ndbapi_async, results in /windows/Linux_space/MySQL/mysql-5.1/mysql-test/var/log/ndb_testrun.log
Running ndbapi_async1, results in /windows/Linux_space/MySQL/mysql-5.1/mysql-test/var/log/ndb_testrun.log
use TEST_DB;
create table t0(c0 int, c1 int, c2 char(4), c3 char(4), c4 text,
primary key(c0, c2)) engine ndb charset latin1;
insert into t0 values (1, 2, 'a', 'b', null);
insert into t0 values (3, 4, 'c', 'd', null);
update t0 set c3 = 'e' where c0 = 1 and c2 = 'a';
update t0 set c3 = 'f';
update t0 set c3 = 'F';
update t0 set c2 = 'g' where c0 = 1;
update t0 set c2 = 'G' where c0 = 1;
update t0 set c0 = 5, c2 = 'H' where c0 = 3;
delete from t0;
drop table t0;
Running mgmapi_logevent, results in /windows/Linux_space/MySQL/mysql-5.1/mysql-test/var/log/ndb_testrun.log
+7 −0
Original line number Diff line number Diff line
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
Running mgmapi_logevent, results in /windows/Linux_space/MySQL/mysql-5.1/mysql-test/var/log/ndb_testrun.log
Loading