#At file:///home/msvensson/mysql/6.3/ based on revid:jonas@stripped90o3
3159 Magnus Blåudd 2009-11-08 [merge]
Merge
added:
mysql-test/suite/ndb_big/
mysql-test/suite/ndb_big/bug37983.test
mysql-test/suite/ndb_big/end_timer.inc
mysql-test/suite/ndb_big/my.cnf
mysql-test/suite/ndb_big/run_query_with_retry.inc
mysql-test/suite/ndb_big/start_timer.inc
mysql-test/suite/ndb_big/suite.inc
=== added directory 'mysql-test/suite/ndb_big'
=== added file 'mysql-test/suite/ndb_big/bug37983.test'
--- a/mysql-test/suite/ndb_big/bug37983.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb_big/bug37983.test 2009-11-08 21:12:10 +0000
@@ -0,0 +1,56 @@
+source suite.inc;
+source include/have_ndb.inc;
+result_format 2;
+
+select version();
+
+CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL,
+ `c3` text,
+ PRIMARY KEY (`c1`) USING BTREE
+) ENGINE=ndbcluster DEFAULT CHARSET=utf8;
+
+## Load table...
+disable_query_log;
+let $i=1000;
+while ($i)
+{
+ let $batch = 400; # Number of values to INSERT per batch
+ let $separator = ;
+ let $sql = INSERT t1 (c1, c3) VALUES;
+ while($batch)
+ {
+ let $sql=$sql$separator($i*1000+$batch, REPEAT('ks87', 512*RAND()));
+ dec $batch;
+ let $separator = ,;
+ }
+
+ source run_query_with_retry.inc;
+
+ dec $i;
+}
+enable_query_log;
+
+## Check number of records in table..
+let $count = `select count(*) from t1`;
+if (!`select $count = 400000`)
+{
+ echo got: $count, expected: 400000;
+ die Wrong number of records loaded into table;
+}
+echo Table has $count number of records;
+
+# Measure the time to run the query three times
+source start_timer.inc;
+# This is currently a very bad query for MySQL Cluster since
+# each record has to be fetched into the mysql in order
+# to see if it fulfills the where clause
+select count(*) from t1 where length(c3) < 256;
+select count(*) from t1 where length(c3) < 256;
+select count(*) from t1 where length(c3) < 256;
+source end_timer.inc;
+
+drop table t1;
+
+## Test suceeded
+exit;
=== added file 'mysql-test/suite/ndb_big/end_timer.inc'
--- a/mysql-test/suite/ndb_big/end_timer.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb_big/end_timer.inc 2009-11-08 21:12:10 +0000
@@ -0,0 +1,6 @@
+--disable_query_log
+set @end = now();
+let $_elapsed = `select TIMEDIFF(@end, @start)`;
+--disable_query_log
+echo Elapsed time: $_elapsed;
+
=== added file 'mysql-test/suite/ndb_big/my.cnf'
--- a/mysql-test/suite/ndb_big/my.cnf 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb_big/my.cnf 2009-11-08 21:12:10 +0000
@@ -0,0 +1,68 @@
+#
+# Real world MySQL Cluster configuration suited
+# to be run on a developer machine
+#
+# The configuration is tuned according to best
+# practice with the limitation that all processes
+# are run on one host with 4Gb RAM
+#
+
+!include include/default_mysqld.cnf
+
+[cluster_config.1]
+ndbd=,
+ndb_mgmd=
+mysqld=
+
+DataMemory=700M
+IndexMemory=220M
+MaxNoOfConcurrentOperations=32768
+StringMemory=25
+MaxNoOfTables=12800
+MaxNoOfOrderedIndexes=12800
+MaxNoOfUniqueHashIndexes=12800
+MaxNoOfAttributes=128000
+DiskCheckpointSpeedInRestart=100M
+FragmentLogFileSize=256M
+InitFragmentLogFiles=FULL
+NoOfFragmentLogFiles=11
+TimeBetweenLocalCheckpoints=20
+TimeBetweenGlobalCheckpoints=2000
+TimeBetweenEpochs=100
+MemReportFrequency=30
+LogLevelStartup=15
+LogLevelShutdown=15
+LogLevelCheckpoint=8
+LogLevelNodeRestart=15
+BackupMaxWriteSize=1M
+BackupDataBufferSize=16M
+BackupLogBufferSize=4M
+BackupMemory=20M
+ODirect=1
+TimeBetweenWatchDogCheckInitial=60000
+TransactionInactiveTimeout=30000
+RealtimeScheduler=1
+SchedulerExecutionTimer=80
+SchedulerSpinTimer=40
+SharedGlobalMemory=20M
+DiskPageBufferMemory=64M
+BatchSizePerLocalScan=512
+
+[cluster_config.TCP.1]
+SendBufferMemory=2M
+ReceiveBufferMemory=2M
+
+[cluster_config.mysqld.1.1]
+BatchSize=512
+BatchByteSize=1024K
+
+[mysqld]
+# Make all mysqlds use cluster
+ndbcluster
+
+ndb-cluster-connection-pool=1
+ndb-force-send=1
+ndb-use-exact-count=0
+ndb-extra-logging=1
+ndb-autoincrement-prefetch-sz=256
+engine-condition-pushdown=1
=== added file 'mysql-test/suite/ndb_big/run_query_with_retry.inc'
--- a/mysql-test/suite/ndb_big/run_query_with_retry.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb_big/run_query_with_retry.inc 2009-11-08 21:12:10 +0000
@@ -0,0 +1,26 @@
+#
+# Run the built query in $sql, retry temporary errors
+#
+
+let $_continue = 1;
+let $_retry = 0;
+while($_continue)
+{
+ error 0,1297; # Allow OK or temporary error
+ eval $sql; # Run the query
+
+ if (!$mysql_errno)
+ {
+ # Query suceeded, break the retry loop
+ let $_continue = 0;
+ }
+
+ if ($mysql_errno)
+ {
+ # Query failed
+ inc $_retry;
+ echo Query failed with temporary error, retry: $_retry;
+
+ sleep 0.1;
+ }
+}
=== added file 'mysql-test/suite/ndb_big/start_timer.inc'
--- a/mysql-test/suite/ndb_big/start_timer.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb_big/start_timer.inc 2009-11-08 21:12:10 +0000
@@ -0,0 +1,4 @@
+--disable_query_log
+echo Starting timer...;
+set @start = now();
+--enable_query_log
=== added file 'mysql-test/suite/ndb_big/suite.inc'
--- a/mysql-test/suite/ndb_big/suite.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb_big/suite.inc 2009-11-08 21:12:10 +0000
@@ -0,0 +1,8 @@
+#
+# Setups and checks common for all tests in this suite
+#
+if ($MTR_MEM)
+{
+ die Cant run these tests with filesystem in RAM;
+}
+
Attachment: [text/bzr-bundle] bzr/magnus.blaudd@sun.com-20091108211242-eh40wu97p9fbgujf.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-6.3 branch (magnus.blaudd:3159) | Magnus Blåudd | 8 Nov 2009 |