Monday, January 16, 2012

[Level 2] CSV storage engine testing for MySQL.

For testing CSV storage engine for MySQL,
I wrote a testing script as the following.
#!/usr/bin/bash -vx
cat > /tmp/test_csv.CSV <<EOF
1,"Tom",90,90,80
2,"Stanley",80,100,100
3,"Joseph",70,80,90
4,"Christy",80,80,100
5,"Chantelle",60,60,60
EOF
mysql -uroot -p -e "create table test_csv ( no int not null, name varchar(32) not null, chi int not null, eng int not null, math int not null) engine=CSV;" world
cp /tmp/test_csv.CSV /var/lib/mysql/world/test_csv.CSV
mysql -uroot -p -e "flush table test_csv; select * from test_csv;" world
Wish this helps.
regards,
Stanley Huang