summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2004-09-24 16:58:25 +0000
committerunknown <tomas@poseidon.ndb.mysql.com>2004-09-24 16:58:25 +0000
commitd6c1a39a1523999ec0bc170a54257104f2ad5528 (patch)
tree4171316b3f027de3e55247678c0813da444bef34 /mysql-test
parent5ef32b5826eec955da526b06152ff0aa414e3740 (diff)
downloadmariadb-git-d6c1a39a1523999ec0bc170a54257104f2ad5528.tar.gz
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
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/mysql-test-run.sh22
-rw-r--r--mysql-test/ndb/ndb_config_2_node.ini1
-rw-r--r--mysql-test/ndb/ndbcluster.sh5
-rw-r--r--mysql-test/r/ndb_alter_table.result19
-rw-r--r--mysql-test/t/ndb_alter_table.test31
5 files changed, 74 insertions, 4 deletions
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index 41dc3c419f0..1765bf4504b 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -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
diff --git a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/ndb/ndb_config_2_node.ini
index cc0f940efe3..8c89d2aa2cc 100644
--- a/mysql-test/ndb/ndb_config_2_node.ini
+++ b/mysql-test/ndb/ndb_config_2_node.ini
@@ -6,6 +6,7 @@ IndexMemory= CHOOSE_IndexMemory
Diskless= CHOOSE_Diskless
TimeBetweenWatchDogCheck= 30000
DataDir= CHOOSE_FILESYSTEM
+MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
[ndbd]
HostName= CHOOSE_HOSTNAME_1
diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh
index f143242371f..a1b6400d753 100644
--- a/mysql-test/ndb/ndbcluster.sh
+++ b/mysql-test/ndb/ndbcluster.sh
@@ -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 \
diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result
index 8143e34ecc2..a36536b878d 100644
--- a/mysql-test/r/ndb_alter_table.result
+++ b/mysql-test/r/ndb_alter_table.result
@@ -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
diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test
index 3cdddfa8dce..96270d94dcb 100644
--- a/mysql-test/t/ndb_alter_table.test
+++ b/mysql-test/t/ndb_alter_table.test
@@ -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