Commit d6c1a39a authored by unknown's avatar unknown
Browse files

fix for invalidating table if mismatch with frm

    removed debug printout
    new test in alter table for dictionay update test with multiple connections
    added coice of setting MaxNoOfOrderedIndexes
    added option to run "--small-bench"


mysql-test/mysql-test-run.sh:
  added option to run "--small-bench"
mysql-test/ndb/ndb_config_2_node.ini:
  added coice of setting MaxNoOfOrderedIndexes
mysql-test/ndb/ndbcluster.sh:
  added coice of setting MaxNoOfOrderedIndexes
mysql-test/r/ndb_alter_table.result:
  new test in alter table for dictionay update test with multiple connections
mysql-test/t/ndb_alter_table.test:
  new test in alter table for dictionay update test with multiple connections
ndb/src/ndbapi/DictCache.cpp:
  removed debug printout
sql/ha_ndbcluster.cc:
  fix for invalidating table if mismatch with frm
parent 5ef32b58
Loading
Loading
Loading
Loading
+19 −3
Original line number Diff line number Diff line
@@ -295,6 +295,11 @@ while test $# -gt 0; do
    --record)
      RECORD=1;
      EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;;
    --small-bench)
      DO_SMALL_BENCH=1
      DO_BENCH=1
      NO_SLAVE=1
      ;;
    --bench)
      DO_BENCH=1
      NO_SLAVE=1
@@ -1451,7 +1456,13 @@ then
  if [ -z "$USE_RUNNING_NDBCLUSTER" ]
  then
    echo "Starting ndbcluster"
    ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT --small --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1
    if [ "$DO_BENCH" = 1 ]
    then
      NDBCLUSTER_OPTS=""
    else
      NDBCLUSTER_OPTS="--small"
    fi
    ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT $NDBCLUSTER_OPTS --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1
    USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"host=localhost:$NDBCLUSTER_PORT\""
  else
    USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"$USE_RUNNING_NDBCLUSTER\""
@@ -1485,9 +1496,14 @@ if [ "$DO_BENCH" = 1 ]
then
  start_master

  if [ "$DO_SMALL_BENCH" = 1 ]
  then
    EXTRA_BENCH_ARGS="--small-test --small-tables"
  fi

  if [ ! -z "$USE_NDBCLUSTER" ]
  then
    EXTRA_BENCH_ARGS="--create-options=TYPE=ndb"
    EXTRA_BENCH_ARGS="--create-options=TYPE=ndb $EXTRA_BENCH_ARGS"
  fi 

  BENCHDIR=$BASEDIR/sql-bench/
@@ -1495,7 +1511,7 @@ then
  cd $BENCHDIR
  if [ -z "$1" ]
  then
    ./run-all-tests --socket=$MASTER_MYSOCK --user=root $EXTRA_BENCH_ARGS
    ./run-all-tests --socket=$MASTER_MYSOCK --user=root $EXTRA_BENCH_ARGS --log
  else
    if [ -x "./$1" ]
    then
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ IndexMemory= CHOOSE_IndexMemory
Diskless= CHOOSE_Diskless
TimeBetweenWatchDogCheck= 30000
DataDir= CHOOSE_FILESYSTEM
MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes

[ndbd]
HostName= CHOOSE_HOSTNAME_1
+4 −1
Original line number Diff line number Diff line
@@ -44,7 +44,8 @@ initial_ndb=
status_ndb=
ndb_diskless=0

ndb_con_op=100000
ndb_no_ord=512
ndb_con_op=10000
ndb_dmem=80M
ndb_imem=24M

@@ -65,6 +66,7 @@ while test $# -gt 0; do
     status_ndb=1
     ;;
    --small)
     ndb_no_ord=128
     ndb_con_op=10000
     ndb_dmem=40M
     ndb_imem=12M
@@ -128,6 +130,7 @@ port_transporter=`expr $ndb_mgmd_port + 2`

if [ $initial_ndb ] ; then
sed \
    -e s,"CHOOSE_MaxNoOfOrderedIndexes","$ndb_no_ord",g \
    -e s,"CHOOSE_MaxNoOfConcurrentOperations","$ndb_con_op",g \
    -e s,"CHOOSE_DataMemory","$ndb_dmem",g \
    -e s,"CHOOSE_IndexMemory","$ndb_imem",g \
+19 −0
Original line number Diff line number Diff line
@@ -73,3 +73,22 @@ col6 col1 col3 fourth col4 col4_5 col5 col7 col8
1	101	3	4	5		PENDING		0000-00-00 00:00:00
2	102	4	3	5	99	PENDING	EXTRA	2004-01-01 00:00:00
drop table t1;
CREATE TABLE t1 (
a INT NOT NULL,
b INT NOT NULL
) ENGINE=ndbcluster;
INSERT INTO t1 VALUES (9410,9412);
ALTER TABLE t1 ADD COLUMN c int not null;
select * from t1;
a	b	c
9410	9412	0
select * from t1;
a	b	c
9410	9412	0
alter table t1 drop c;
select * from t1;
a	b
9410	9412
drop table t1;
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
+31 −0
Original line number Diff line number Diff line
@@ -49,6 +49,37 @@ show table status;
select * from t1 order by col1;
drop table t1;


#
# Check that invalidating dictionary cache works
#

CREATE TABLE t1 (
  a INT NOT NULL,
  b INT NOT NULL
) ENGINE=ndbcluster;

INSERT INTO t1 VALUES (9410,9412);

connect (con1,localhost,,,test);
connect (con2,localhost,,,test);

connection con1;
ALTER TABLE t1 ADD COLUMN c int not null;
select * from t1;

connection con2;
select * from t1;
alter table t1 drop c;

connection con1;
select * from t1;
drop table t1;

connection con2;
--error 1146
select * from t1;

#--disable_warnings
#DROP TABLE IF EXISTS t2;
#--enable_warnings
Loading