Home > Archives > April 2008 Archive
April 2008 Archive
MySQL Proxy
- April 18, 2008 1:59 PM
MySQL Proxy
C-based
Luaは、会場のみんなはほとんど使っていなかった。
ラウンドロビンでスレーブへ
スクリプトは得に書く必要なし
luaでカスタマイズ可能
lib/proxy/balance.lua
スレーブをかなり意識した作りになっている。
現在はアルファ
レプリケーションログをトラックする
IO, SQLスレッドを監視
かなり遅れている(設定した時間以上)スレーブは、無視したり。
MySQL Enterprise Monitorと統合
a passive connection poolを維持
client closes connection
proxy adds connection to the pool
less connection overhear
examples/tutorial-keepalive.lua
MySQL Connection Manager
Enterprise Product
更新はマスターへ、参照はスレーブへ振り分け
ただし、stateless SQLが必要
lib/rw-splitting.lua
read write splitting
auto_increment
insert
select last insert id
sql_calc_found_rows
temporary tables
session variables
show slave status
なども、luaスクリプトで制御
sharding
レンジで、またはlookup tableで分散させる、ってdatabase partitioningのことか?
Replication Threadからは独立
read scale out hot spot safe
hot spots in writing need reorg
hscale 0.1
select ... where user_id=176
select /* shard=1 */ ...
こんな感じで、更新も分散させるのかな?
SELECTは全てのshardで実行
UNIONs result-set internally
Aggregation aware, MAX(), SUM(), MIN(), AVG()
MySQL Query AnalyzerがEnterprise Monitor内に追加される。(later this year)
new in 0.7.0ってことは、1.0はまだだね。
----------
- Comments (Close): 0
- TrackBack (Close): 0
MySQL Cluster with Replication for Financial Transactions
- April 18, 2008 2:40 AM
ブラジルの会社
携帯電話のSMSを使った支払いシステム
少額決済にも対応
CRM, Billing, Collection, Credit,
26 SQLNode
6 DataNode
Authentication用
8 SQLNode
4 DataNode
で、ふたつをレプリケーション
Report用には、MyISAMへレプリケーション
Datacenter2にも、レプリケーション
26SQL Nodeのうち、
ほとんど(70%)がHistory Dataで、それらは、MyISAMへレプリケーションしてしまう。
6SQL Nodeのうち、、、
DataCenter1と2は10MBのMetro Linkで接続
HAのためにレプリケーションを利用している。
CGE
Cluster Jumpstartを購入した
2006年
FK、長いトランザクション、sub queriesなどの制限
自分たちは、very skiled team
で、未だにサポートは買ってない。
-----
40台もサーバーがあって、ライセンス料は?
-----
安いサーバーを沢山使ってる
shared diskは使わない
プレゼンは30分で終わった
データのサイズ10GB/month
DataNodeは16GBのメモリ
不要なトランザクションは、レプリでMyISAMへ移動するのがミソっぽいな。
CGE
4台で、マスター、スレーブを
conflict
6.3でconflict detectionが入ったので、おすすめ
ライセンス払ってない!!!!!
- Comments (Close): 0
- TrackBack (Close): 0
MySQL Cluster Performance by Mikael
- April 18, 2008 2:39 AM
aspects of performance
response times
throughput
low variation of response times
experience base
dbt2(tpc-c)
tpc-w
prototype
benchmark using NDB API
possbiel areas hot to improve performance
どうやって性能を改善させるか
ensure proper partitioning of your tables
use of new features in MySQL Cluster CGE 6.3
HW
use of features in MySQL Cluster 5.0
パーティショニングを効果的に使う、ってどういうことか?
MySQL Cアプリケーションと、MySQL Cluster Cアプリケーションの比較
sync
性能は3倍、レスポンスタイムは半分になった
async
6, 1/4
性能が重要な場合はNDB API使うことになる
CGE 6.3.13での新機能
polling based communication
epoll replacing select system call(linux)
send buffer gathering
real-time scheduler for threads
lock threads to CPU
distribution awareness
avoid read bofore Update/Delete with PK
polling based communication
CPUは余計に使うけどレスポンスタイムは向上する
real-time schedulingと一緒に使うと、かなりいい
interrupt handling in dolphin supersockts
dolphin HW has checksums inegrated
socket interface to interrupts
interrupts enabled when no data available in select/poll call where timeout is > 0
polling-based communication benchmark results
CPUに余裕がある場合には性能改善した
epoll replacint select system call
select system call in large clustersのオーバーヘッドが減った
Interl e1000 Ethernet driverのinterruptオーバーヘッドは増えた
32ノード間今日では20%性能改善
extra round of execution before sending messages
setting threads to real-time
main thread: lower priority
maintenance thread: higher priority
なのでメンテナンススレッド
locking threads to CPU's
Connection thread
watch dog
file system thread
などを固定する
例
CPU0
メンテナンススレッド
CPU1
メインスレッド
Super Socket
4コアの場合は、
CPU0
Interrupt Handling
メンテナンススレッド
CPU1
メイン
Ethernet
CPU2
メイン
Ethernet
CPU3
メイン
Ethernet
こんな構成にする
old "thruths" revisited
以前は1ノード1コンピュータだったけど、今は違う
distribution awareness
ex. SELECT * FROM t WHERE pk=x;
パーティションにマッピングしてしまうと、2倍まで性能改善する
けど、どうやって???
remove read before PK update
update t set a = const1 where pk=x;
こんなクエリは改善した
ensure proper partitioning of data model
TC
Primary
Backup
Backup
の順番で2phase commitしていく
パーティショニング
partition by key(warehouse_id)
partition by hash(warehouse_id)
DBT-2は、こんな風にしてパーテョニングを設定した
その他のパーティショニング
一つのノードグループだけをスキャンするようなケース
partition by key(id) (partition p0 nodegroup 0);
こんな感じで
use of features in 5.0
lock memory
batching of IN(,,,) pk access
insert batching
condition pushdown
lock memory in main memory
ensure no swapping occurs in NDB Kernel
batching in (...) w/ pk
INでまとめてSELECT した方が、10倍速い
select * from t where pk=x
を100回繰り返すよりも
bulk insertも、同じく100倍速い
CGE6.4
multi threaded data nodes
だけど、今のところDBT-2には効果なし
NDB API経由の場合には40%性能改善したけど
HW
L2 cache
→いくつかを雑誌記事に追加してもいいかも。SELECT INの効果とか
DataNodeをローカルに一つ増やして性能改善するか、とか
DBT-2
DataNodeの3倍までSQL Nodeを増やしての性能改善は続いた
→まだ最適ノード数の探索は続きそう
- Comments (Close): 0
- TrackBack (Close): 0
MySQL Cluster Tutorialメモ
- April 15, 2008 8:46 AM
Tutorial, MySQL Cluster
grant
revoke
triggers
sp
views
などは、全てのSQLノードで実行する必要がある。
→MySQL Clusterで注意するSQLクエリ、MySQL Cluster Replicationで注意するSQLクエリをまとめるといいかも。
FKはサポートしていないよね。
explain exendedでクエリを確認する。
MySQL Clusterはread committedだけサポートするので、mysqldumpでは、not consisentなバックアップしか取れない
max no of concurrent operations, transactions
max no of ...
...
batch size per local scan
.
.
.
- Comments (Close): 0
- TrackBack (Close): 0
トリガーの制限
- April 10, 2008 4:45 PM
Q.
トリガーなどで、あるテーブルにデータが挿入されたタイミングで、挿入されたデータと同じ名前のテーブルを、簡単に作成することが出来るか。
A.
できない。
1.「挿入されたデータを使って、」のように動的なSQLはトリガーではサポートしていない。
2.トリガーでは、CREATE TABLEのような、内部でCOMMITするステートメントを記述できない。
内部でCOMMITを発行するステートメントのリストは、ここ。
http://dev.mysql.com/doc/refman/5.1/en/implicit-commit.html
トリガーやストアドルーチンの制限は、ここ。
http://dev.mysql.com/doc/refman/5.0/en/routine-restrictions.html
http://dev.mysql.com/doc/refman/5.0/en/using-triggers.html
やりたいことは、プロシージャを使えばできそう。
CREATE PROCEDURE tset_proc(IN tableName varchar(64), IN nantokaData INT) BEGIN
INSERT INTO tableA VALUES (tableName, someData);
SET @sql := CONCAT('CREATE TABLE ', tableName, ' ( fieldName INT)');
PREPARE myStatement FROM @sql;
EXECUTE myStatement;
END
- Comments (Close): 0
- TrackBack (Close): 0
MySQL Clusterチューニングメモ(まだ途中)
- April 9, 2008 7:11 PM
とりあえず、4点。
このうちの1と3はCGEのみ?
1.Data Nodeへのコネクションプーリング
http://johanandersson.blogspot.com/#multiconnect
[mysqld] ... ndb-cluster-connection-pool=10
http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-mysqld-command-options.html
SQL NodeとData Nodeのプーリングを設定する。
通常は1だけど、クライアント数によっては、増やすといいかも。
2.秘密のパラメータと推奨値
まだドキュメント化されていないもの。
英文説明部分は、2005/9にMikaelからもらったメールを引用した。
ndb-force-send=1
5.1のマニュアルに記載なし。
Default set to 1 (4.1) Try setting it to 0This parameter enables an adaptive protocol that waits before actually sending off the messages to the cluster.
This is by default set for optimal performance in systems with small number of connections. Using large number of connections (as you do) it should be beneficial to reset this parameter.
ndb-use-exact-count=0
5.1のマニュアルに記載なし。
4.1の時は、このパラメータを0にすることで、最も性能が向上した。
Default set to 1 (4.1) Try setting it to 0When this is set it gives exact counts of number of records in a table during query planning. This can be beneficial for queries executing for a long time and also for fast execution of SELECT
count(*) from table x. For small primary key lookups (as you test) it is very beneficial to reset this parameter.
engine-condition-pushdown=1
WHERE節での絞り込みを、DataNodeレベルで実行する。
5.1では、デフォルトでオンになっている。
3.同時実行性能/スレッド関連
MySQL-5.1.22-ndb-6.3.4で追加されたオプション。
http://johanandersson.blogspot.com/#realtime
RealtimeScheduler=1 LockExecuteThreadToCPU=[cpuid] LockMaintThreadsToCPU=[cpuid] SchedulerExecutionTimer=80 (ms) SchedulerSpinTimer=400 (ms)
この辺とかをチューニング。
MySQL :: MySQL 5.1 Reference Manual :: 16.4.4.5 Defining Data Nodes
Realtime Performance ParametersThe [ndbd] parameters discussed in this section are used in scheduling and locking of threads to specific CPUs on multiprocessor data node hosts. They were introduced in MySQL 5.1.22-ndb-6.3.4.
*
LockExecuteThreadToCPU
This parameter specifies the ID of the CPU assigned to handle the NDBCluster execution thread.
The value of this parameter is an integer in the range 0 to 65535 (inclusive). The default is 65535.
*LockMaintThreadsToCPU
This parameter specifies the ID of the CPU assigned to handle NDBCluster maintenance threads.
The value of this parameter is an integer in the range 0 to 65535 (inclusive). The default is 65535.
*RealtimeScheduler
Setting this parameter to 1 enables real-time scheduling of NDBCluster threads.
The default is 0 (scheduling disabled).
*SchedulerExecutionTimer
This parameter specifies the time in microseconds for threads to be executed in the scheduler before being sent.
The default is 50 μsec.
*SchedulerSpinTimer
This parameter specifies the time in microseconds for threads to be executed in the scheduler before sleeping.
The default value is 0.
4.ログ関連
http://johanandersson.blogspot.com/2007/05/good-configuration.html
- Comments (Close): 0
- TrackBack (Close): 0
Case Sensitivity
- April 8, 2008 6:21 PM
MySQL :: MySQL 5.0 Reference Manual :: 8.2.2 Identifier Case Sensitivity
By default, table aliases are case sensitive on Unix, but not so on Windows or Mac OS X.
Macは大文字小文字区別しないと思いきや、区別する。(テーブル名)
- Comments (Close): 0
- TrackBack (Close): 0
DB Magazineの1ページあたりの文字数
- April 8, 2008 4:14 PM
は、2,400文字
10ページだと、24,000文字
ただし、これは図や表が全く無い場合。
実際には図や表を多用すると、半分~2/3くらいに文字数は減るので、実際には12,000~15,000文字くらいか。
- Comments (Close): 0
- TrackBack (Close): 0
sar
- April 8, 2008 3:52 PM
4年前にIPAの検証で利用したcollect_data.shが見つかった。
collect_data.shはDBTで利用していたファイルで、これを流用させてもらっていた。
このファイルをいくつか修正した記憶があるのだけど、どこを修正したのか、またこれが最終版だったかは、不明。。。
sar -A -o <ファイル名> <インターバル> <カウント>
でファイル保存しておいて、
sar -u -f <ファイル名>
で展開しているように見えるけど。。。
#!/bin/sh if [ $# -ne 4 ]; then echo "Usage: ./collect_data.sh" exit fi INTERVAL=$1
COUNT=$2
CPUS=$3
RESULTS_PATH=$4/$HOSTNAME.`date "+%Y%m%d_%H%M%S"`
RUN_DURATION=$(($INTERVAL * $COUNT))
mkdir $RESULTS_PATH#get database statistics
#./db_stats.sh $SID1 $RESULTS_PATH $COUNT $INTERVAL &if [ -f ./run.sar.data ]; then
rm ./run.sar.data
fi#sar -u -U ALL -d -b -B -r -q -W -o run.sar.data $1 $2 &
#sar -u -I ALL -P ALL -d -B -r -W -o run.sar.data $1 $2 &
sar -A -o run.sar.data $1 $2 &
sh ./io.sh $1 $2 $RESULTS_PATH &
sh ./runtop.sh $1 $2 $RESULTS_PATH &#What is clearprof...
#clearprof
echo "sleep for $RUN_DURATION seconds..."
sleep $RUN_DURATION#What is getprof...
#getprof
echo "cpu is $CPUS"
echo "Cpu Statistics (sar -u ) ">$RESULTS_PATH/all.cpu.txt
echo `uname -a `>>$RESULTS_PATH/all.cpu.txt
sar -u -f run.sar.data | tee -a ./run.sar.data.cpu >> $RESULTS_PATH/all.cpu.txt#reformatting the cpu data files
i=0
while [ "$i" -lt "$CPUS" ]
do
echo "reformatting cpu$i"
sleep 2
echo "CPU Statistics CPU$i (sar -u)" > $RESULTS_PATH/cpu$i.csv
echo `uname -a` >> $RESULTS_PATH/cpu$i.csv
echo "%user,%nice,%system,%idle">>$RESULTS_PATH/cpu$i.csv
sar -u -I ALL -f run.sar.data | tee -a ./run.sar.data.cpu.$i | awk '{ if (NR>2) { if ($1!="Average:" && $3=="'$i'") { print $4","$5","$6","$7;} else { if ($1=="Average:" && $2=="'$i'") { print $3","$4","$5","$6;}}}}'>>$RESULTS_PATH/cpu$i.csv
i=$(($i+1))
done#reformatting the io data files
echo "reformatting io data files"
for i in `iostat | egrep '^dev' | awk '{print $1}'`
do
echo "Disk IO (iostat -d) " > $RESULTS_PATH/$i.csv
echo `uname -a` >>$RESULTS_PATH/$i.csv
echo "tps,blk_read/s,blk_wrtn/s,blk_read,blk_wrtn" >>$RESULTS_PATH/$i.csv
cat $RESULTS_PATH/io.txt| grep "$i" | awk '{ print $2","$3","$4","$5","$6}' >>$RESULTS_PATH/$i.csv
done#reformatting the paging data files
echo "reformatting paging data files"
echo "Paging (sar -B) " > $RESULTS_PATH/paging.txt
echo "Paging (sar -B) " > $RESULTS_PATH/paging.csv
echo `uname -a` >>$RESULTS_PATH/paging.txt
echo `uname -a` >>$RESULTS_PATH/paging.csv
sar -B -f run.sar.data | tee -a ./run.sar.data.page | tee -a $RESULTS_PATH/paging.txt | awk '{ if (NR>2) { if ($1!="Average:") print $3","$4","$5","$6","$7","$8; else { print $2","$3","$4","$5","$6","$7};}}'>>$RESULTS_PATH/paging.csv#reformatting the memory data files
echo "reformatting memory data files"
echo "Memory (sar -r) " > $RESULTS_PATH/memory.txt
echo "Memory (sar -r) " > $RESULTS_PATH/memory.csv
echo `uname -a` >>$RESULTS_PATH/memory.txt
echo `uname -a` >>$RESULTS_PATH/memory.csv
sar -r -f run.sar.data | tee -a ./run.sar.data.mem | tee -a $RESULTS_PATH/memory.txt | awk '{ if (NR>2) { if ($1!="Average:") print $3","$4","$5","$6","$7","$8","$9","$10","$11; else { print $2","$3","$4","$5","$6","$7","$8","$9","$10};}}'>>$RESULTS_PATH/memory.csv#reformatting the processor queue data files
echo "reformatting queue data files"
echo "Load (sar -q) " > $RESULTS_PATH/queue.txt
echo "Load (sar -q) " > $RESULTS_PATH/queue.csv
echo `uname -a` >>$RESULTS_PATH/queue.txt
echo `uname -a` >>$RESULTS_PATH/queue.csv
sar -q -f run.sar.data | tee -a ./run.sar.data.queue | tee -a $RESULTS_PATH/queue.txt | awk '{ if (NR>2) { if ($1!="Average:") { print $3","$4","$5","$6;} else { print $2","$3","$4","$5;}}}'>>$RESULTS_PATH/queue.csv#reformatting the processor queue data files
echo "reformatting swap data files"
echo "Swap (sar -W)" >$RESULTS_PATH/swap.txt
echo "Swap (sar -W)" >$RESULTS_PATH/swap.csv
echo `uname -a` >>$RESULTS_PATH/swap.txt
echo `uname -a` >>$RESULTS_PATH/swap.csv
sar -W -f run.sar.data | tee -a ./run.sar.data.swap | tee -a $RESULTS_PATH/swap.txt | awk '{ if (NR>2) { if ($1!="Average:") {print $3","$4;} else { print $2","$3;}}}'>>$RESULTS_PATH/swap.csv#network
echo `uname -a` >>$RESULTS_PATH/network.txt
sar -n DEV -f run.sar.data > $RESULTS_PATH/network.txt#../../tools/results --mixfile ../../dbdriver/mix.log --outputdir $RESULTS_PATH > $RESULTS_PATH/BT
- Comments (Close): 0
- TrackBack (Close): 0
/Users/hirohama/Documents/2008/mysql-cluster/mysql-5.1-telco-6.2/mysql-test/suite/ndb/r/ndb_alter_table_online.reject
- April 8, 2008 2:09 PM
まだ5.1ではオンラインでのスキーマ変更は対応していなかったと思うので、問題無い。
DROP TABLE IF EXISTS t1;
*******************************
* basic online alter tests
*******************************
CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
INSERT INTO t1 values (1,1);ndb_show_tables completed.....
set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
truncate ndb_show_tables_results;
*******************************
* Alter Table online add column
*******************************
* Add column c as CHAR
*******************************
ALTER TABLE t1 ADD c CHAR(19);ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
INSERT INTO t1 values (2,1,"a");
SELECT * FROM t1 ORDER BY a;
a b c
1 1 NULL
2 1 a
UPDATE t1 SET c='b' where a = 2;
SELECT * FROM t1 ORDER BY a;
a b c
1 1 NULL
2 1 b
DROP TABLE t1;
*******************************
* Alter Table online add column
*******************************
* Add column c as nullable INT
*******************************
CREATE TABLE t1 (a INT UNSIGNED KEY, b VARCHAR(19)) ENGINE NDB;
INSERT INTO t1 values (1,"a");ndb_show_tables completed.....
set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
truncate ndb_show_tables_results;
ALTER TABLE t1 ADD c INT;
Warnings:
Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMNndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
INSERT INTO t1 values (2,"a",1);
SELECT * FROM t1 ORDER BY a;
a b c
1 a NULL
2 a 1
UPDATE t1 SET c = 2 where a = 2;
SELECT * FROM t1 ORDER BY a;
a b c
1 a NULL
2 a 2
DROP TABLE t1;
*******************************
* Alter Table online add column
*******************************
* Add column c as nullable INT
*******************************
CREATE TABLE t1 (a INT UNSIGNED KEY, b INT COLUMN_FORMAT DYNAMIC) ENGINE NDB;
INSERT INTO t1 values (1,1);ndb_show_tables completed.....
set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
truncate ndb_show_tables_results;
ALTER TABLE t1 ADD c INT;
Warnings:
Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMNndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
INSERT INTO t1 values (2,1,1);
SELECT * FROM t1 ORDER BY a;
a b c
1 1 NULL
2 1 1
UPDATE t1 SET c = 2 where a = 2;
SELECT * FROM t1 ORDER BY a;
a b c
1 1 NULL
2 1 2
*******************************
* Create online Index ci
*******************************
CREATE ONLINE INDEX ci on t1(c);ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
*******************************
* Create offline Index ci2
*******************************
CREATE OFFLINE INDEX ci2 on t1(c);ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
truncate ndb_show_tables_results;
*******************************
* Drop online Index ci
*******************************
DROP ONLINE INDEX ci on t1;ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
*******************************
* Drop offline Index ci2
*******************************
DROP OFFLINE INDEX ci2 on t1;ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
DROP TABLE t1;
*******************************
* basic concurent online alter test
*******************************
* With Commit
*******************************
CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB;
begin;
update t1 set b = 0 where a = 1;
update t1 set b = 1 where a = 2;
delete from t1 where a = 3;
insert into t1 values (5,5),(6,6);
update t1 set b = 0 where a = 6;
ALTER TABLE t1 ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255);
Warnings:
Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
update t1 set b = 0 where a = 2;
update t1 set b = 0 where a = 4;
update t1 set b = 0 where a = 5;
insert into t1 values (7,0,null,null,null),(8,0,'8','8','8');
commit;
SELECT * FROM t1 ORDER BY a;
a b c d e
1 0 NULL NULL NULL
2 0 NULL NULL NULL
4 0 NULL NULL NULL
5 0 NULL NULL NULL
6 0 NULL NULL NULL
7 0 NULL NULL NULL
8 0 8 8 8
DROP TABLE t1;
*******************************
* basic concurent online alter test
*******************************
* With Rollback
*******************************
CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ENGINE NDB;
begin;
update t1 set b = 0 where a = 1;
update t1 set b = 1 where a = 2;
delete from t1 where a = 3;
insert into t1 values (5,5),(6,6);
update t1 set b = 0 where a = 6;
ALTER TABLE t1 ADD c CHAR(19), ADD d VARCHAR(255), ADD e char(255);
Warnings:
Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
update t1 set b = 0 where a = 2;
update t1 set b = 0 where a = 4;
update t1 set b = 0 where a = 5;
insert into t1 values (7,0,null,null,null),(8,0,'8','8','8');
rollback;
SELECT * FROM t1 ORDER BY a;
a b c d e
1 1 NULL NULL NULL
2 2 NULL NULL NULL
3 3 NULL NULL NULL
4 4 NULL NULL NULL
DROP TABLE t1;
*******************************
* The following ALTER operations are not supported on-line
*******************************
* Not supported Test#1
*******************************
CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=FIXED ENGINE NDB;
INSERT INTO t1 values (1,1);ndb_show_tables completed.....
set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
truncate ndb_show_tables_results;
ALTER ONLINE TABLE t1 ADD c CHAR(19);
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD c CHAR(19)'ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
ALTER TABLE t1 ADD c CHAR(19);
INSERT INTO t1 values (2,1,"a");
SELECT * FROM t1 ORDER BY a;
a b c
1 1 NULL
2 1 a
UPDATE t1 SET c = 'b' where a = 2;
SELECT * FROM t1 ORDER BY a;
a b c
1 1 NULL
2 1 b
DROP TABLE t1;
*******************************
* Not supported Test#2
*******************************
CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
INSERT INTO t1 values (1,1);ndb_show_tables completed.....
set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
truncate ndb_show_tables_results;
ALTER ONLINE TABLE t1 ADD c CHAR(19) DEFAULT 17;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD c CHAR(19) DEFAULT 17'ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
ALTER TABLE t1 ADD c CHAR(19) DEFAULT 17;
INSERT INTO t1 values (2,1,"a");
SELECT * FROM t1 ORDER BY a;
a b c
1 1 17
2 1 a
UPDATE t1 SET c = 'b' where a = 2;
SELECT * FROM t1 ORDER BY a;
a b c
1 1 17
2 1 b
*******************************
* Not supported Test#3
*******************************ndb_show_tables completed.....
set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
truncate ndb_show_tables_results;
ALTER ONLINE TABLE t1 ADD d INT AFTER b;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD d INT AFTER b'ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
ALTER TABLE t1 ADD d INT AFTER b;ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
INSERT INTO t1 VALUES(3,1,1,'b');
SELECT * FROM t1 ORDER BY a;
a b d c
1 1 NULL 17
2 1 NULL b
3 1 1 b
UPDATE t1 SET d = 2 where a = 3;
SELECT * FROM t1 ORDER BY a;
a b d c
1 1 NULL 17
2 1 NULL b
3 1 2 b
*******************************
* Not supported Test#4
*******************************ndb_show_tables completed.....
set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
truncate ndb_show_tables_results;
ALTER ONLINE TABLE t1 ENGINE MYISAM;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ENGINE MYISAM'ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
DROP TABLE t1;
*******************************
* Not supported Test#5
*******************************
CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
INSERT INTO t1 values (1,1);ndb_show_tables completed.....
set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
truncate ndb_show_tables_results;
ALTER ONLINE TABLE t1 ADD c TIMESTAMP;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD c TIMESTAMP'ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
ALTER TABLE t1 ADD c TIMESTAMP;
INSERT INTO t1 values (2,2,'2007-09-19 18:46:02');
SELECT * FROM t1 ORDER BY a;
a b c
1 1 0000-00-00 00:00:00
2 2 2007-09-19 18:46:02
UPDATE t1 SET c = '2007-10-22 16:35:06' where a = 2;
SELECT * FROM t1 ORDER BY a;
a b c
1 1 0000-00-00 00:00:00
2 2 2007-10-22 16:35:06
DROP TABLE t1;
*******************************
* Not supported Test#6
*******************************
CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
INSERT INTO t1 values (1,1);ndb_show_tables completed.....
set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
truncate ndb_show_tables_results;
ALTER ONLINE TABLE t1 ADD c CHAR(19) NOT NULL;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD c CHAR(19) NOT NULL'ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
ALTER TABLE t1 ADD c CHAR(19) NOT NULL;
INSERT INTO t1 values (2,1,"a");
SELECT * FROM t1 ORDER BY a;
a b c
1 1
2 1 a
UPDATE t1 SET c = 'b' where a = 2;
SELECT * FROM t1 ORDER BY a;
a b c
1 1
2 1 b
DROP TABLE t1;
*******************************
* Not supported Test#7
*******************************
CREATE TABLE t1 (a INT UNSIGNED KEY, b INT UNSIGNED) ROW_FORMAT=DYNAMIC ENGINE NDB;
INSERT INTO t1 values (1,1);ndb_show_tables completed.....
set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
truncate ndb_show_tables_results;
ALTER ONLINE TABLE t1 ADD c CHAR(19) COLUMN_FORMAT FIXED;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD c CHAR(19) COLUMN_FORMAT FIXED'ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
ALTER TABLE t1 ADD c CHAR(19) COLUMN_FORMAT FIXED;
INSERT INTO t1 values (2,1,"a");
SELECT * FROM t1 ORDER BY a;
a b c
1 1 NULL
2 1 a
UPDATE t1 SET c = 'b' WHERE a = 2;
SELECT * FROM t1 ORDER BY a;
a b c
1 1 NULL
2 1 b
DROP TABLE t1;
*******************************
* Not supported Test#8
* Ndb doesn't support renaming attributes on-line
*******************************
CREATE TABLE t1 (
auto int(5) unsigned NOT NULL auto_increment,
string char(10),
vstring varchar(10),
bin binary(2),
vbin varbinary(7),
tiny tinyint(4) DEFAULT '0' NOT NULL ,
short smallint(6) DEFAULT '1' NOT NULL ,
medium mediumint(8) DEFAULT '0' NOT NULL,
long_int int(11) DEFAULT '0' NOT NULL,
longlong bigint(13) DEFAULT '0' NOT NULL,
real_float float(13,1) DEFAULT 0.0 NOT NULL,
real_double double(16,4),
real_decimal decimal(16,4),
utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
ulong int(11) unsigned DEFAULT '0' NOT NULL,
ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
bits bit(3),
options enum('zero','one','two','three','four') not null,
flags set('zero','one','two','three','four') not null,
date_field date,
year_field year,
time_field time,
date_time datetime,
time_stamp timestamp,
PRIMARY KEY (auto)
) engine=ndb;ndb_show_tables completed.....
set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
truncate ndb_show_tables_results;
alter online table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
ERROR 42000: This version of MySQL doesn't yet support 'alter online table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL'ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
alter table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
create index i1 on t1(medium);
alter table t1 add index i2(new_tiny);
drop index i1 on t1;ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
DROP TABLE t1;
****************************************
* Adding dropping primary key
****************************************
CREATE TABLE t1 (a INT UNSIGNED NOT NULL) ENGINE NDB;
$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
PRIMARY KEY($PK) - UniqueHashIndex
ALTER ONLINE TABLE t1 ADD PRIMARY KEY (a);
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD PRIMARY KEY (a)'
ALTER OFFLINE TABLE t1 ADD PRIMARY KEY (a);
a Unsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
PRIMARY KEY(a) - UniqueHashIndex
PRIMARY(a) - OrderedIndex
ALTER ONLINE TABLE t1 DROP PRIMARY KEY;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 DROP PRIMARY KEY'
ALTER OFFLINE TABLE t1 DROP PRIMARY KEY;
$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
PRIMARY KEY($PK) - UniqueHashIndex
CREATE ONLINE UNIQUE INDEX pk ON t1(a);
ERROR 42000: This version of MySQL doesn't yet support 'CREATE ONLINE UNIQUE INDEX pk ON t1(a)'
CREATE OFFLINE UNIQUE INDEX pk ON t1(a);
a Unsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
PRIMARY KEY(a) - UniqueHashIndex
ALTER ONLINE TABLE t1 DROP INDEX PK;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 DROP INDEX PK'
ALTER OFFLINE TABLE t1 DROP INDEX PK;
$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
PRIMARY KEY($PK) - UniqueHashIndex
DROP TABLE t1;
CREATE TABLE t1 (a INT UNSIGNED) ENGINE NDB;
ALTER ONLINE TABLE t1 ADD b INT UNIQUE;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD b INT UNIQUE'
ALTER OFFLINE TABLE t1 ADD b INT UNIQUE;
$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
PRIMARY KEY($PK) - UniqueHashIndex
ALTER ONLINE TABLE t1 ADD c INT NOT NULL UNIQUE;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD c INT NOT NULL UNIQUE'
ALTER OFFLINE TABLE t1 ADD c INT NOT NULL UNIQUE;
c Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
PRIMARY KEY(c) - UniqueHashIndex
DROP TABLE t1;
****************************************
* Add column c as nullable TEXT and BLOB
****************************************
CREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT KEY, b INT DEFAULT 2 COLUMN_FORMAT DYNAMIC) ENGINE NDB;ndb_show_tables completed.....
set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
truncate ndb_show_tables_results;
ALTER ONLINE TABLE t1 ADD c TEXT;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD c TEXT'ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
ALTER ONLINE TABLE t1 ADD d BLOB;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD d BLOB'ndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
DROP TABLE t1;
CREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT KEY, b INT COLUMN_FORMAT DYNAMIC) ENGINE NDB;ndb_show_tables completed.....
set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
truncate ndb_show_tables_results;
*******************************
* Add column c as nullable FLOAT
*******************************
ALTER ONLINE TABLE t1 ADD c FLOAT;
Warnings:
Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
*******************************
* Add column d as nullable DOUBLE
*******************************
ALTER ONLINE TABLE t1 ADD d DOUBLE UNSIGNED;
Warnings:
Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
*******************************
* Add column e as nullable DECIMAL
*******************************
ALTER ONLINE TABLE t1 ADD e DECIMAL(5,2);
Warnings:
Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
*******************************
* Add column f as nullable DATETIME
*******************************
ALTER ONLINE TABLE t1 ADD f DATETIME;
Warnings:
Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMN
*******************************
* Add column g as nullable BINARY
*******************************
ALTER TABLE t1 ADD g BINARY(4);
Warnings:
Warning 1478 Converted FIXED field to DYNAMIC to enable on-line ADD COLUMNndb_show_tables completed.....
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
't1'
truncate ndb_show_tables_results;
SELECT COUNT(*) FROM t1 WHERE c IS NULL;
COUNT(*)
5
SELECT COUNT(*) FROM t1 WHERE d IS NULL;
COUNT(*)
10
SELECT COUNT(*) FROM t1 WHERE e IS NULL;
COUNT(*)
15
SELECT COUNT(*) FROM t1 WHERE f IS NULL;
COUNT(*)
20
SELECT COUNT(*) FROM t1 WHERE g IS NULL;
COUNT(*)
25
UPDATE t1 SET c = 3.402823466E+38, d = 1.2686868689898E+308, e = 666.66, f = '2007-10-23 23:23:23', g = '1111' WHERE a = 1;
SELECT * FROM t1 WHERE a = 1 or a = 10 or a = 20 or a = 30 ORDER BY a;
a b c d e f g
1 5 3.40282e+38 1.2686868689898e+308 666.66 2007-10-23 23:23:23 1111
10 1 -3.40282e+38 NULL NULL NULL NULL
20 1 -3.40282e+38 1.7976931348623e+308 345.21 NULL NULL
30 1 -3.40282e+38 1.7976931348623e+308 345.21 1000-01-01 00:00:00 0101
*********************************
* Backup and restore tables w/ new column
*********************************
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM test.backup_info;
LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
SELECT @the_backup_id:=backup_id FROM test.backup_info;
@the_backup_id:=backup_id
DROP TABLE test.backup_info;
DROP TABLE t1;
ForceVarPart: 1
DROP TABLE t1;
*********************************
* Disk Data error testing
*********************************
set storage_engine=ndb;
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M;
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
ENGINE NDB;
CREATE TABLE t1
(pk1 INT NOT NULL PRIMARY KEY, b INT COLUMN_FORMAT DYNAMIC)
TABLESPACE ts1 STORAGE DISK
ENGINE=NDB;
Warnings:
Warning 1478 DYNAMIC column b with STORAGE DISK is not supported, column will become FIXED
ALTER ONLINE TABLE t1 CHANGE b b_1 INT COLUMN_FORMAT DYNAMIC;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 CHANGE b b_1 INT COLUMN_FORMAT DYNAMIC'
ALTER ONLINE TABLE t1 ADD COLUMN c INT COLUMN_FORMAT DYNAMIC;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD COLUMN c INT COLUMN_FORMAT DYNAMIC'
ALTER ONLINE TABLE t1 ADD COLUMN d FLOAT COLUMN_FORMAT DYNAMIC;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD COLUMN d FLOAT COLUMN_FORMAT DYNAMIC'
ALTER ONLINE TABLE t1 ADD COLUMN e DOUBLE COLUMN_FORMAT DYNAMIC;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD COLUMN e DOUBLE COLUMN_FORMAT DYNAMIC'
ALTER ONLINE TABLE t1 ADD COLUMN f DATETIME COLUMN_FORMAT DYNAMIC;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD COLUMN f DATETIME COLUMN_FORMAT DYNAMIC'
ALTER ONLINE TABLE t1 ADD COLUMN g DECIMAL(5,2) COLUMN_FORMAT DYNAMIC;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD COLUMN g DECIMAL(5,2) COLUMN_FORMAT DYNAMIC'
ALTER ONLINE TABLE t1 ADD COLUMN h CHAR(20) COLUMN_FORMAT DYNAMIC;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD COLUMN h CHAR(20) COLUMN_FORMAT DYNAMIC'
ALTER ONLINE TABLE t1 ADD COLUMN h VARCHAR(20) COLUMN_FORMAT DYNAMIC;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD COLUMN h VARCHAR(20) COLUMN_FORMAT DYNAMIC'
ALTER ONLINE TABLE t1 ADD COLUMN h BINARY(20) COLUMN_FORMAT DYNAMIC;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD COLUMN h BINARY(20) COLUMN_FORMAT DYNAMIC'
ALTER ONLINE TABLE t1 ADD COLUMN h VARBINARY(20) COLUMN_FORMAT DYNAMIC;
ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD COLUMN h VARBINARY(20) COLUMN_FORMAT DYNAMIC'
DROP TABLE t1;
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat'
ENGINE = NDB;
DROP TABLESPACE ts1
ENGINE = NDB;
DROP LOGFILE GROUP lg1
ENGINE =NDB;
********************
* ROW_FORMAT testing
********************
CREATE TABLE t1
(pk1 INT NOT NULL PRIMARY KEY, b INT COLUMN_FORMAT DYNAMIC)ROW_FORMAT=FIXED
ENGINE=NDB;
Warnings:
Warning 1478 Row format FIXED incompatible with dynamic attribute b
-- t1 --
Version: #
Fragment type: 5
K Value: 6
Min load factor: 78
Max load factor: 80
Temporary table: no
Number of attributes: 2
Number of primary keys: 1
Length of frm data: 256
Row Checksum: 1
Row GCI: 1
SingleUserMode: 0
ForceVarPart: 0
TableStatus: Retrieved
-- Attributes --
pk1 Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
b Int NULL AT=FIXED ST=MEMORY DYNAMIC-- Indexes --
PRIMARY KEY(pk1) - UniqueHashIndex
PRIMARY(pk1) - OrderedIndex
NDBT_ProgramExit: 0 - OKDROP TABLE t1;
CREATE TABLE t1
(pk1 INT NOT NULL COLUMN_FORMAT FIXED PRIMARY KEY,
b INT COLUMN_FORMAT FIXED)ROW_FORMAT=DYNAMIC ENGINE=NDB;
-- t1 --
Version: #
Fragment type: 5
K Value: 6
Min load factor: 78
Max load factor: 80
Temporary table: no
Number of attributes: 2
Number of primary keys: 1
Length of frm data: 256
Row Checksum: 1
Row GCI: 1
SingleUserMode: 0
ForceVarPart: 1
TableStatus: Retrieved
-- Attributes --
pk1 Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
b Int NULL AT=FIXED ST=MEMORY-- Indexes --
PRIMARY KEY(pk1) - UniqueHashIndex
PRIMARY(pk1) - OrderedIndex
NDBT_ProgramExit: 0 - OK********************
* Cleanup Section
********************
DROP TABLE t1;
DROP TABLE ndb_show_tables_results;
- Comments (Close): 0
- TrackBack (Close): 0
ndbテストスイートの結果
- April 8, 2008 1:44 PM
mysql-test@macbook$ cat hirohama0408.log
Logging: ./mysql-test-run.pl --force --suite=ndb
MySQL Version 5.1.23
Using dynamic switching of binlog format
Using ndbcluster when necessary, mysqld supports it
Setting mysqld to support SSL connections
Binaries are debug compiled
Using MTR_BUILD_THREAD = 0
Using MASTER_MYPORT = 9306
Using MASTER_MYPORT1 = 9307
Using SLAVE_MYPORT = 9308
Using SLAVE_MYPORT1 = 9309
Using SLAVE_MYPORT2 = 9310
Using NDBCLUSTER_PORT = 9311
Using NDBCLUSTER_PORT_SLAVE = 9312
Using IM_PORT = 9313
Using IM_MYSQLD1_PORT = 9314
Using IM_MYSQLD2_PORT = 9315
Killing Possible Leftover Processes
Removing Stale Files
Creating Directories
Installing Master Database
Installing Master Database
Installing Master Cluster
Saving snapshot of installed databases
=======================================================TEST RESULT TIME (ms)
-------------------------------------------------------ndb.loaddata_autocom_ndb [ pass ] 6133
ndb.ndb_alter_table [ pass ] 53418
ndb.ndb_alter_table2 [ pass ] 5603
ndb.ndb_alter_table3 [ pass ] 6072
ndb.ndb_alter_table_backup [ pass ] 15926
ndb.ndb_alter_table_online [ fail ]--- /Users/hirohama/Documents/2008/mysql-cluster/mysql-5.1-telco-6.2/mysql-test/suite/ndb/r/ndb_alter_table_online.result 2008-03-12 22:00:42.000000000 +0300
+++ /Users/hirohama/Documents/2008/mysql-cluster/mysql-5.1-telco-6.2/mysql-test/suite/ndb/r/ndb_alter_table_online.reject 2008-04-08 06:33:10.000000000 +0300
@@ -118,6 +118,7 @@
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
+'t1'
set @t1_id = (select id from ndb_show_tables_results where name like '%t1%' and type like '%UserTable%');
truncate ndb_show_tables_results;
*******************************
@@ -140,6 +141,7 @@
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
+'t1'
truncate ndb_show_tables_results;
DROP TABLE t1;
*******************************
@@ -289,6 +291,7 @@
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
+'t1'
truncate ndb_show_tables_results;
INSERT INTO t1 VALUES(3,1,1,'b');
SELECT * FROM t1 ORDER BY a;
@@ -469,6 +472,7 @@
select name from ndb_show_tables_results where id = @t1_id and name like '%t1%' and type like '%UserTable%';
name
+'t1'
truncate ndb_show_tables_results;
DROP TABLE t1;
****************************************mysqltest: Result content mismatch
Stopping All Servers
Restoring snapshot of databases
Resuming Testsndb.ndb_alter_table_online2 [ fail ] timeout
Stopping All Servers
Restoring snapshot of databases
Resuming Testsndb.ndb_auto_increment [ pass ] 25936
ndb.ndb_autoinc [ pass ] 1492
ndb.ndb_basic [ pass ] 64177
ndb.ndb_bitfield [ pass ] 7158
ndb.ndb_blob [ pass ] 33927
ndb.ndb_blob_partition [ pass ] 8406
ndb.ndb_blob_restore [ pass ] 41856
ndb.ndb_bug26793 [ pass ] 2675
ndb.ndb_bug31477 [ pass ] 9023
ndb.ndb_cache [ pass ] 1611
ndb.ndb_cache2 [ pass ] 7064
ndb.ndb_cache_multi [ pass ] 1770
ndb.ndb_cache_multi2 [ pass ] 2189
ndb.ndb_charset [ pass ] 18847
ndb.ndb_column_properties [ pass ] 36353
ndb.ndb_condition_pushdown [ pass ] 14993
ndb.ndb_config [ pass ] 2633
ndb.ndb_config2 [ pass ] 322
ndb.ndb_cursor [ pass ] 2940
ndb.ndb_database [ pass ] 1915
ndb.ndb_dd_alter [ pass ] 71621
ndb.ndb_dd_basic [ pass ] 26558
ndb.ndb_dd_ddl [ pass ] 29694
ndb.ndb_dd_disk2memory [ pass ] 34443
ndb.ndb_dd_dump [ pass ] 33594
ndb.ndb_dd_restore_compat [ pass ] 16149
ndb.ndb_dd_sql_features [ pass ] 47003
ndb.ndb_gis [ pass ] 53976
ndb.ndb_index [ pass ] 2628
ndb.ndb_index_ordered [ pass ] 31615
ndb.ndb_index_unique [ pass ] 40957
ndb.ndb_insert [ pass ] 11010
ndb.ndb_limit [ pass ] 6774
ndb.ndb_load [ pass ] 2436
ndb.ndb_loaddatalocal [ pass ] 17707
ndb.ndb_lock [ pass ] 24217
ndb.ndb_lock_table [ pass ] 973
ndb.ndb_minmax [ pass ] 4367
ndb.ndb_multi [ pass ] 12431
ndb.ndb_multi_row [ pass ] 9318
ndb.ndb_partition_error [ pass ] 4251
ndb.ndb_partition_error2 [ disabled ] HF is not sure if the test can work as internded on all the platforms
ndb.ndb_partition_key [ pass ] 27305
ndb.ndb_partition_list [ pass ] 2717
ndb.ndb_partition_range [ pass ] 28697
ndb.ndb_read_multi_range [ pass ] 26354
ndb.ndb_rename [ pass ] 4139
ndb.ndb_replace [ pass ] 10375
ndb.ndb_restore [ pass ] 117716
ndb.ndb_restore_compat [ skipped ] Test requires: 'case_sensitive_file_system'
ndb.ndb_restore_different_endian_data [ pass ] 40877
ndb.ndb_restore_partition [ pass ] 98768
ndb.ndb_restore_print [ pass ] 18583
ndb.ndb_row_format [ pass ] 21655
ndb.ndb_single_user [ pass ] 27785
ndb.ndb_sp [ pass ] 2756
ndb.ndb_subquery [ pass ] 10385
ndb.ndb_temporary [ pass ] 1400
ndb.ndb_transaction [ pass ] 10947
ndb.ndb_trigger [ pass ] 15997
ndb.ndb_truncate [ pass ] 4130
ndb.ndb_types [ pass ] 3101
ndb.ndb_update [ pass ] 8941
ndb.ndb_update_no_read [ pass ] 2195
ndb.ndb_view [ pass ] 1003
ndb.ndbapi [ skipped ] Test requires: 'have_ndbapi_examples'
ndb.ps_7ndb [ pass ] 11973
ndb.strict_autoinc_5ndb [ pass ] 1490
-------------------------------------------------------
Stopping All Servers
Failed 2/72 tests, 97.22% were successful.The log files in var/log may give you some hint
of what went wrong.
If you want to report this error, please read first the documentation at
http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html
The servers were restarted 9 times
Spent 1353.450 of 2691 seconds executing testcasesmysql-test-run in default mode: *** Failing the test(s): ndb.ndb_alter_table_online ndb.ndb_alter_table_online2
mysql-test@macbook$
- Comments (Close): 0
- TrackBack (Close): 0
ndbテストスイート実行
- April 8, 2008 12:29 PM
mysql-test@macbook$ perl ./mysql-test-run.pl --force --suite=ndb > hirohama0408.log & [1] 12543 mysql-test@macbook$ 080408 12:28:27 [Warning] Setting lower_case_table_names=2 because file system for /tmp/PpOTzMnbpd/ is case insensitivemysql-test@macbook$ pwd
/Users/hirohama/Documents/2008/mysql-cluster/mysql-5.1-telco-6.2/mysql-test
展開したバイナリではうまく動かなかった。
MySQL Cluster起動後、次のオプションを使ってもダメだった。
--extern
--mysqld="socketファイルの指定"
- Comments (Close): 0
- TrackBack (Close): 0
make bin-distとmake_binary_distributionの違い
- April 1, 2008 11:24 AM
make bin-distだと、stripされてしまう。
no-stripオプションを付けるには、make_binary_distributionしかない。
- Comments (Close): 0
- TrackBack (Close): 0
mysql.bkbits.net
- April 1, 2008 11:23 AM
annotate: 誰が、どのバージョンで変更したか
TAG: ここをポイントに見ていくと、MySQLのどのバージョンで、どこまでのChange Setを反映しているかが分かる
- Comments (Close): 0
- TrackBack (Close): 0