summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorjimw@mysql.com <>2006-04-11 18:54:24 -0700
committerjimw@mysql.com <>2006-04-11 18:54:24 -0700
commit276109b155b017a509801b19f76d81feca460707 (patch)
tree24f79d4012d38ba95416a1379bdf4c392e02e0cb /mysql-test
parentb02463c15aea36ddcd5b4f7d0f5b4594b5c84f62 (diff)
downloadmariadb-git-276109b155b017a509801b19f76d81feca460707.tar.gz
Remove old cruft from the tree: mysqltestmanager, mysql_test_run_new,
and various stuff in Docs/. Also move the certificates used for testing into mysql-test/std_data from the top-level SSL directory (now gone).
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/Makefile.am14
-rw-r--r--mysql-test/init_db.sql58
-rw-r--r--mysql-test/my_create_tables.c673
-rw-r--r--mysql-test/my_manage.c887
-rw-r--r--mysql-test/my_manage.h137
-rw-r--r--mysql-test/mysql-test-run.sh153
-rw-r--r--mysql-test/mysql_test_run_new.c1933
-rw-r--r--mysql-test/std_data/cacert.pem21
-rw-r--r--mysql-test/std_data/client-cert.pem67
-rw-r--r--mysql-test/std_data/client-key.pem15
-rw-r--r--mysql-test/std_data/server-cert.pem67
-rw-r--r--mysql-test/std_data/server-key.pem15
12 files changed, 208 insertions, 3832 deletions
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index 067435f0189..dcf2b49adfc 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -32,9 +32,6 @@ test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem
CLEANFILES = $(GENSCRIPTS) $(test_DATA)
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I..
-EXTRA_PROGRAMS = mysql_test_run_new
-noinst_HEADERS = my_manage.h
-mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c
dist-hook:
@@ -106,17 +103,6 @@ install-data-local:
uninstall-local:
@RM@ -f -r $(DESTDIR)$(testdir)
-std_data/client-key.pem:
- @CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data
-std_data/client-cert.pem:
- @CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data
-std_data/cacert.pem:
- @CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data
-std_data/server-cert.pem:
- @CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data
-std_data/server-key.pem:
- @CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data
-
SUFFIXES = .sh
.sh:
diff --git a/mysql-test/init_db.sql b/mysql-test/init_db.sql
deleted file mode 100644
index 63483af00d6..00000000000
--- a/mysql-test/init_db.sql
+++ /dev/null
@@ -1,58 +0,0 @@
-CREATE DATABASE mysql;
-CREATE DATABASE test;
-
-USE mysql;
-
-
-CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,References_priv enum('N','Y') DEFAULT 'N' NOT NULL,Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,PRIMARY KEY Host (Host,Db,User),KEY User (User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges';
-
-INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');
-INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');
-
-
-CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,References_priv enum('N','Y') DEFAULT 'N' NOT NULL,Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,PRIMARY KEY Host (Host,Db)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges';
-
-CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Password char(41) binary DEFAULT '' NOT NULL,Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,File_priv enum('N','Y') DEFAULT 'N' NOT NULL,Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,References_priv enum('N','Y') DEFAULT 'N' NOT NULL,Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL,Super_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL,Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL,ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL,ssl_cipher BLOB NOT NULL,x509_issuer BLOB NOT NULL,x509_subject BLOB NOT NULL,max_questions int(11) unsigned DEFAULT 0 NOT NULL,max_updates int(11) unsigned DEFAULT 0 NOT NULL,max_connections int(11) unsigned DEFAULT 0 NOT NULL,PRIMARY KEY Host (Host,User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges';
-
-INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
-INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
-INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0);
-
-CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL,ret tinyint(1) DEFAULT '0' NOT NULL,dl char(128) DEFAULT '' NOT NULL,type enum ('function','aggregate') NOT NULL,PRIMARY KEY (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions';
-
-CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Table_name char(64) binary DEFAULT '' NOT NULL,Grantor char(77) DEFAULT '' NOT NULL,Timestamp timestamp(14),Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL,Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,PRIMARY KEY (Host,Db,User,Table_name),KEY Grantor (Grantor)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges';
-
-CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Table_name char(64) binary DEFAULT '' NOT NULL,Column_name char(64) binary DEFAULT '' NOT NULL,Timestamp timestamp(14),Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,PRIMARY KEY (Host,Db,User,Table_name,Column_name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges';
-
-CREATE TABLE help_topic (help_topic_id int unsigned not null,name varchar(64) not null,help_category_id smallint unsigned not null,description text not null,example text not null,url varchar(128) not null,primary key (help_topic_id),unique index (name)) engine=MyISAM CHARACTER SET utf8 comment='help topics';
-
-CREATE TABLE help_category (help_category_id smallint unsigned not null,name varchar(64) not null,parent_category_id smallint unsigned null,url varchar(128) not null,primary key (help_category_id),unique index (name)) engine=MyISAM CHARACTER SET utf8 comment='help categories';
-
-CREATE TABLE help_keyword (help_keyword_id int unsigned not null,name varchar(64) not null,primary key (help_keyword_id),unique index (name)) engine=MyISAM CHARACTER SET utf8 comment='help keywords';
-
-CREATE TABLE help_relation (help_topic_id int unsigned not null references help_topic,help_keyword_id int unsigned not null references help_keyword,primary key (help_keyword_id, help_topic_id)) engine=MyISAM CHARACTER SET utf8 comment='keyword-topic relation';
-
-CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) engine=MyISAM CHARACTER SET utf8 comment='Time zone names';
-
-INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES ('MET', 1), ('UTC', 2), ('Universal', 2), ('Europe/Moscow',3), ('leap/Europe/Moscow',4), ('Japan', 5);
-
-
-CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment,Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) engine=MyISAM CHARACTER SET utf8 comment='Time zones';
-
-INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N');
-
-
-CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) engine=MyISAM CHARACTER SET utf8 comment='Time zone transitions';
-
-INSERT INTO time_zone_transition (Time_zone_id, Transition_time, Transition_type_id) VALUES (1, -1693706400, 0) ,(1, -1680483600, 1),(1, -1663455600, 2) ,(1, -1650150000, 3),(1, -1632006000, 2) ,(1, -1618700400, 3),(1, -938905200, 2) ,(1, -857257200, 3),(1, -844556400, 2) ,(1, -828226800, 3),(1, -812502000, 2) ,(1, -796777200, 3),(1, 228877200, 2) ,(1, 243997200, 3),(1, 260326800, 2) ,(1, 276051600, 3),(1, 291776400, 2) ,(1, 307501200, 3),(1, 323830800, 2) ,(1, 338950800, 3),(1, 354675600, 2) ,(1, 370400400, 3),(1, 386125200, 2) ,(1, 401850000, 3),(1, 417574800, 2) ,(1, 433299600, 3),(1, 449024400, 2) ,(1, 465354000, 3),(1, 481078800, 2) ,(1, 496803600, 3),(1, 512528400, 2) ,(1, 528253200, 3),(1, 543978000, 2) ,(1, 559702800, 3),(1, 575427600, 2) ,(1, 591152400, 3),(1, 606877200, 2) ,(1, 622602000, 3),(1, 638326800, 2) ,(1, 654656400, 3),(1, 670381200, 2) ,(1, 686106000, 3),(1, 701830800, 2) ,(1, 717555600, 3),(1, 733280400, 2) ,(1, 749005200, 3),(1, 764730000, 2) ,(1, 780454800, 3),(1, 796179600, 2) ,(1, 811904400, 3),(1, 828234000, 2) ,(1, 846378000, 3),(1, 859683600, 2) ,(1, 877827600, 3),(1, 891133200, 2) ,(1, 909277200, 3),(1, 922582800, 2) ,(1, 941331600, 3),(1, 954032400, 2) ,(1, 972781200, 3),(1, 985482000, 2) ,(1, 1004230800, 3),(1, 1017536400, 2) ,(1, 1035680400, 3),(1, 1048986000, 2) ,(1, 1067130000, 3),(1, 1080435600, 2) ,(1, 1099184400, 3),(1, 1111885200, 2) ,(1, 1130634000, 3),(1, 1143334800, 2) ,(1, 1162083600, 3),(1, 1174784400, 2) ,(1, 1193533200, 3),(1, 1206838800, 2) ,(1, 1224982800, 3),(1, 1238288400, 2) ,(1, 1256432400, 3),(1, 1269738000, 2) ,(1, 1288486800, 3),(1, 1301187600, 2) ,(1, 1319936400, 3),(1, 1332637200, 2) ,(1, 1351386000, 3),(1, 1364691600, 2) ,(1, 1382835600, 3),(1, 1396141200, 2) ,(1, 1414285200, 3),(1, 1427590800, 2) ,(1, 1445734800, 3),(1, 1459040400, 2) ,(1, 1477789200, 3),(1, 1490490000, 2) ,(1, 1509238800, 3),(1, 1521939600, 2) ,(1, 1540688400, 3),(1, 1553994000, 2) ,(1, 1572138000, 3),(1, 1585443600, 2) ,(1, 1603587600, 3),(1, 1616893200, 2) ,(1, 1635642000, 3),(1, 1648342800, 2) ,(1, 1667091600, 3),(1, 1679792400, 2) ,(1, 1698541200, 3),(1, 1711846800, 2) ,(1, 1729990800, 3),(1, 1743296400, 2) ,(1, 1761440400, 3),(1, 1774746000, 2) ,(1, 1792890000, 3),(1, 1806195600, 2) ,(1, 1824944400, 3),(1, 1837645200, 2) ,(1, 1856394000, 3),(1, 1869094800, 2) ,(1, 1887843600, 3),(1, 1901149200, 2) ,(1, 1919293200, 3),(1, 1932598800, 2) ,(1, 1950742800, 3),(1, 1964048400, 2) ,(1, 1982797200, 3),(1, 1995498000, 2) ,(1, 2014246800, 3),(1, 2026947600, 2) ,(1, 2045696400, 3),(1, 2058397200, 2) ,(1, 2077146000, 3),(1, 2090451600, 2) ,(1, 2108595600, 3),(1, 2121901200, 2) ,(1, 2140045200, 3),(3, -1688265000, 2) ,(3, -1656819048, 1),(3, -1641353448, 2) ,(3, -1627965048, 3),(3, -1618716648, 1) ,(3, -1596429048, 3),(3, -1593829848, 5) ,(3, -1589860800, 4),(3, -1542427200, 5) ,(3, -1539493200, 6),(3, -1525323600, 5) ,(3, -1522728000, 4),(3, -1491188400, 7) ,(3, -1247536800, 4),(3, 354920400, 5) ,(3, 370728000, 4),(3, 386456400, 5) ,(3, 402264000, 4),(3, 417992400, 5) ,(3, 433800000, 4),(3, 449614800, 5) ,(3, 465346800, 8),(3, 481071600, 9) ,(3, 496796400, 8),(3, 512521200, 9) ,(3, 528246000, 8),(3, 543970800, 9) ,(3, 559695600, 8),(3, 575420400, 9) ,(3, 591145200, 8),(3, 606870000, 9) ,(3, 622594800, 8),(3, 638319600, 9) ,(3, 654649200, 8),(3, 670374000, 10) ,(3, 686102400, 11),(3, 695779200, 8) ,(3, 701812800, 5),(3, 717534000, 4) ,(3, 733273200, 9),(3, 748998000, 8) ,(3, 764722800, 9),(3, 780447600, 8) ,(3, 796172400, 9),(3, 811897200, 8) ,(3, 828226800, 9),(3, 846370800, 8) ,(3, 859676400, 9),(3, 877820400, 8) ,(3, 891126000, 9),(3, 909270000, 8) ,(3, 922575600, 9),(3, 941324400, 8) ,(3, 954025200, 9),(3, 972774000, 8) ,(3, 985474800, 9),(3, 1004223600, 8) ,(3, 1017529200, 9),(3, 1035673200, 8) ,(3, 1048978800, 9),(3, 1067122800, 8) ,(3, 1080428400, 9),(3, 1099177200, 8) ,(3, 1111878000, 9),(3, 1130626800, 8) ,(3, 1143327600, 9),(3, 1162076400, 8) ,(3, 1174777200, 9),(3, 1193526000, 8) ,(3, 1206831600, 9),(3, 1224975600, 8) ,(3, 1238281200, 9),(3, 1256425200, 8) ,(3, 1269730800, 9),(3, 1288479600, 8) ,(3, 1301180400, 9),(3, 1319929200, 8) ,(3, 1332630000, 9),(3, 1351378800, 8) ,(3, 1364684400, 9),(3, 1382828400, 8) ,(3, 1396134000, 9),(3, 1414278000, 8) ,(3, 1427583600, 9),(3, 1445727600, 8) ,(3, 1459033200, 9),(3, 1477782000, 8) ,(3, 1490482800, 9),(3, 1509231600, 8) ,(3, 1521932400, 9),(3, 1540681200, 8) ,(3, 1553986800, 9),(3, 1572130800, 8) ,(3, 1585436400, 9),(3, 1603580400, 8) ,(3, 1616886000, 9),(3, 1635634800, 8) ,(3, 1648335600, 9),(3, 1667084400, 8) ,(3, 1679785200, 9),(3, 1698534000, 8) ,(3, 1711839600, 9),(3, 1729983600, 8) ,(3, 1743289200, 9),(3, 1761433200, 8) ,(3, 1774738800, 9),(3, 1792882800, 8) ,(3, 1806188400, 9),(3, 1824937200, 8) ,(3, 1837638000, 9),(3, 1856386800, 8) ,(3, 1869087600, 9),(3, 1887836400, 8) ,(3, 1901142000, 9),(3, 1919286000, 8) ,(3, 1932591600, 9),(3, 1950735600, 8) ,(3, 1964041200, 9),(3, 1982790000, 8) ,(3, 1995490800, 9),(3, 2014239600, 8) ,(3, 2026940400, 9),(3, 2045689200, 8) ,(3, 2058390000, 9),(3, 2077138800, 8) ,(3, 2090444400, 9),(3, 2108588400, 8) ,(3, 2121894000, 9),(3, 2140038000, 8),(4, -1688265000, 2) ,(4, -1656819048, 1),(4, -1641353448, 2) ,(4, -1627965048, 3),(4, -1618716648, 1) ,(4, -1596429048, 3),(4, -1593829848, 5) ,(4, -1589860800, 4),(4, -1542427200, 5) ,(4, -1539493200, 6),(4, -1525323600, 5) ,(4, -1522728000, 4),(4, -1491188400, 7) ,(4, -1247536800, 4),(4, 354920409, 5) ,(4, 370728010, 4),(4, 386456410, 5) ,(4, 402264011, 4),(4, 417992411, 5) ,(4, 433800012, 4),(4, 449614812, 5) ,(4, 465346812, 8),(4, 481071612, 9) ,(4, 496796413, 8),(4, 512521213, 9) ,(4, 528246013, 8),(4, 543970813, 9) ,(4, 559695613, 8),(4, 575420414, 9) ,(4, 591145214, 8),(4, 606870014, 9) ,(4, 622594814, 8),(4, 638319615, 9) ,(4, 654649215, 8),(4, 670374016, 10) ,(4, 686102416, 11),(4, 695779216, 8) ,(4, 701812816, 5),(4, 717534017, 4) ,(4, 733273217, 9),(4, 748998018, 8) ,(4, 764722818, 9),(4, 780447619, 8) ,(4, 796172419, 9),(4, 811897219, 8) ,(4, 828226820, 9),(4, 846370820, 8) ,(4, 859676420, 9),(4, 877820421, 8) ,(4, 891126021, 9),(4, 909270021, 8) ,(4, 922575622, 9),(4, 941324422, 8) ,(4, 954025222, 9),(4, 972774022, 8) ,(4, 985474822, 9),(4, 1004223622, 8) ,(4, 1017529222, 9),(4, 1035673222, 8) ,(4, 1048978822, 9),(4, 1067122822, 8) ,(4, 1080428422, 9),(4, 1099177222, 8) ,(4, 1111878022, 9),(4, 1130626822, 8) ,(4, 1143327622, 9),(4, 1162076422, 8) ,(4, 1174777222, 9),(4, 1193526022, 8) ,(4, 1206831622, 9),(4, 1224975622, 8) ,(4, 1238281222, 9),(4, 1256425222, 8) ,(4, 1269730822, 9),(4, 1288479622, 8) ,(4, 1301180422, 9),(4, 1319929222, 8) ,(4, 1332630022, 9),(4, 1351378822, 8) ,(4, 1364684422, 9),(4, 1382828422, 8) ,(4, 1396134022, 9),(4, 1414278022, 8) ,(4, 1427583622, 9),(4, 1445727622, 8) ,(4, 1459033222, 9),(4, 1477782022, 8) ,(4, 1490482822, 9),(4, 1509231622, 8) ,(4, 1521932422, 9),(4, 1540681222, 8) ,(4, 1553986822, 9),(4, 1572130822, 8) ,(4, 1585436422, 9),(4, 1603580422, 8) ,(4, 1616886022, 9),(4, 1635634822, 8) ,(4, 1648335622, 9),(4, 1667084422, 8) ,(4, 1679785222, 9),(4, 1698534022, 8) ,(4, 1711839622, 9),(4, 1729983622, 8) ,(4, 1743289222, 9),(4, 1761433222, 8) ,(4, 1774738822, 9),(4, 1792882822, 8) ,(4, 1806188422, 9),(4, 1824937222, 8) ,(4, 1837638022, 9),(4, 1856386822, 8) ,(4, 1869087622, 9),(4, 1887836422, 8) ,(4, 1901142022, 9),(4, 1919286022, 8) ,(4, 1932591622, 9),(4, 1950735622, 8) ,(4, 1964041222, 9),(4, 1982790022, 8) ,(4, 1995490822, 9),(4, 2014239622, 8) ,(4, 2026940422, 9),(4, 2045689222, 8) ,(4, 2058390022, 9),(4, 2077138822, 8) ,(4, 2090444422, 9),(4, 2108588422, 8) ,(4, 2121894022, 9),(4, 2140038022, 8);
-
-
-CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) engine=MyISAM CHARACTER SET utf8 comment='Time zone transition types';
-
-INSERT INTO time_zone_transition_type (Time_zone_id,Transition_type_id, Offset, Is_DST, Abbreviation) VALUES (1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET') ,(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET') ,(2, 0, 0, 0, 'UTC') ,(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST') ,(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST') ,(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD') ,(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET') ,(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD') ,(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET') ,(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST') ,(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST') ,(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD') ,(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET') ,(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD') ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET') ,(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST');
-
-CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones';
-
-INSERT INTO time_zone_leap_second (Transition_time, Correction) VALUES (78796800, 1) ,(94694401, 2) ,(126230402, 3) ,(157766403, 4) ,(189302404, 5) ,(220924805, 6) ,(252460806, 7) ,(283996807, 8) ,(315532808, 9) ,(362793609, 10) ,(394329610, 11) ,(425865611, 12) ,(489024012, 13) ,(567993613, 14) ,(631152014, 15) ,(662688015, 16) ,(709948816, 17) ,(741484817, 18) ,(773020818, 19) ,(820454419, 20) ,(867715220, 21) ,(915148821, 22);
-
-
diff --git a/mysql-test/my_create_tables.c b/mysql-test/my_create_tables.c
deleted file mode 100644
index 06a6fabf022..00000000000
--- a/mysql-test/my_create_tables.c
+++ /dev/null
@@ -1,673 +0,0 @@
-#include <stdio.h>
-#include <errno.h>
-#ifndef __WIN__
-#include <dirent.h>
-#endif
-#include <string.h>
-#ifdef __NETWARE__
-#include <screen.h>
-#include <proc.h>
-#else
-#include <sys/types.h>
-#ifndef __WIN__
-#include <sys/wait.h>
-#include <unistd.h>
-#else
-#include <direct.h>
-#include <stdlib.h>
-#include <stdio.h>
-#endif
-#endif
-#include <ctype.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <assert.h>
-#include "my_manage.h"
-
-/*
- Synopsis:
- This function testes a exist file
-
-Arguments:
- mdata: path to data
- file_name: name of file
-Output:
- A zero value indicates that file is exist.
-*/
-bool test_sys_file(const char *mdata,const char *file_name)
-{
- struct stat file;
- char path_file_name[PATH_MAX];
- snprintf(path_file_name, PATH_MAX, "%s/%s", mdata, file_name);
- return(stat(path_file_name,&file));
-}
-
-/*
- Synopsis:
- This function creates a file with sql requstes for creating
- system data files.
-
-Arguments:
- mdata: path to data
- output_file: file name for output file
- test: to create system files with test data
-Output:
- A zero value indicates a success.
-*/
-bool create_system_files(const char *mdata,const char *output_file, bool test)
-{
- FILE *out;
-
- out = fopen(output_file, "w+");
-
- if (!out)
- return 1;
-
- if (test_sys_file(mdata,"mysql"))
- {
- fprintf(out,"CREATE DATABASE mysql;\n");
- }
-
- if (test && test_sys_file(mdata,"test"))
- {
- fprintf(out,"CREATE DATABASE test;\n");
- }
-
- fprintf(out,"USE mysql;\n");
-
- if (test_sys_file(mdata,"mysql/db.frm"))
- {
- fprintf(out,
- "CREATE TABLE db ("
- "Host char(60) binary DEFAULT '' NOT NULL,"
- "Db char(64) binary DEFAULT '' NOT NULL,"
- "User char(16) binary DEFAULT '' NOT NULL,"
- "Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "PRIMARY KEY Host (Host,Db,User),"
- "KEY User (User))"
- "engine=MyISAM "
- "CHARACTER SET utf8 COLLATE utf8_bin "
- "comment='Database privileges';\n");
-
- if (test)
- {
- fprintf(out,"INSERT INTO db VALUES ('%%','test','','Y','Y','Y','Y'"
- ",'Y','Y','N','Y','Y','Y','Y','Y');\n");
- fprintf(out,"INSERT INTO db VALUES ('%%','test\\_%%','','Y','Y','Y'"
- ",'Y','Y','Y','N','Y','Y','Y','Y','Y');\n");
- }
- }
-
- if (test_sys_file(mdata,"mysql/host.frm"))
- {
- fprintf(out,
- "CREATE TABLE host ("
- "Host char(60) binary DEFAULT '' NOT NULL,"
- "Db char(64) binary DEFAULT '' NOT NULL,"
- "Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "PRIMARY KEY Host (Host,Db))"
- "engine=MyISAM "
- "CHARACTER SET utf8 COLLATE utf8_bin "
- "comment='Host privileges; Merged with database privileges';\n");
- }
-
-
- if (test_sys_file(mdata,"mysql/user.frm"))
- {
-#ifdef __WIN__
- WSADATA wsa_data;
-#endif
- char hostname[FN_REFLEN];
-
-#ifdef __WIN__
- if (WSAStartup(MAKEWORD( 2, 2 ),&wsa_data))
- return 1;
-#endif
- if (gethostname(hostname, FN_REFLEN))
- return 1;
-#ifdef __WIN__
- WSACleanup( );
-#endif
-
- if (strchr(hostname, '.') == NULL)
- strcat(hostname, "%");
-
- fprintf(out,
- "CREATE TABLE user ("
- "Host char(60) binary DEFAULT '' NOT NULL,"
- "User char(16) binary DEFAULT '' NOT NULL,"
- "Password char(41) binary DEFAULT '' NOT NULL,"
- "Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "File_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Super_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- "ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL,"
- "ssl_cipher BLOB NOT NULL,"
- "x509_issuer BLOB NOT NULL,"
- "x509_subject BLOB NOT NULL,"
- "max_questions int(11) unsigned DEFAULT 0 NOT NULL,"
- "max_updates int(11) unsigned DEFAULT 0 NOT NULL,"
- "max_connections int(11) unsigned DEFAULT 0 NOT NULL,"
- "PRIMARY KEY Host (Host,User)"
- ") engine=MyISAM "
- "CHARACTER SET utf8 COLLATE utf8_bin "
- "comment='Users and global privileges';\n");
-
-
- if (test)
- {
- fprintf(out,
- "INSERT INTO user VALUES ('localhost','root',''"
- ",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'"
- ",'Y','Y','Y','Y','Y','','','','',0,0,0);\n");
- fprintf(out,
- "INSERT INTO user VALUES ('%s','root','','Y','Y',"
- "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',"
- "'Y','Y','Y','Y','','','','',0,0,0);\n",hostname);
- fprintf(out,
- "REPLACE INTO user VALUES ('127.0.0.1','root','',"
- "'Y','Y','Y','Y','Y','Y',"
- "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'"
- ",'Y','','','','',0,0,0);\n");
- fprintf(out,"INSERT INTO user (host,user) values ('localhost','');\n");
- fprintf(out,"INSERT INTO user (host,user) values ('%s','');\n",hostname);
- }
- else
- {
- fprintf(out,
- "INSERT INTO user VALUES ('localhost','root','',"
- "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',"
- "'Y','Y','Y','Y','','','','',0,0,0);\n");
-#ifndef __WIN__
- fprintf(out,
- "INSERT INTO user VALUES ('%s','root','','Y','Y',"
- "'Y','Y','Y','Y','Y','Y'"
- "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','',''"
- ",'','',0,0,0);\n",hostname);
- fprintf(out,"INSERT INTO user (host,user) values ('%s','');\n",hostname);
- fprintf(out,"INSERT INTO user (host,user) values ('localhost','');\n");
-#else
- fprintf(out,
- "INSERT INTO user VALUES ('localhost','','','Y','Y','Y'"
- ",'Y','Y','Y','Y','Y','Y'"
- ",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','',"
- "'','',0,0,0);\n");
-#endif
- }
- }
-
-
- if (test_sys_file(mdata,"mysql/func.frm"))
- {
- fprintf(out,
- "CREATE TABLE func ("
- "name char(64) binary DEFAULT '' NOT NULL,"
- "ret tinyint(1) DEFAULT '0' NOT NULL,"
- "dl char(128) DEFAULT '' NOT NULL,"
- "type enum ('function','aggregate') NOT NULL,"
- "PRIMARY KEY (name)"
- ") engine=MyISAM "
- "CHARACTER SET utf8 COLLATE utf8_bin "
- "comment='User defined functions';\n");
- }
-
- if (test_sys_file(mdata,"mysql/tables_priv.frm"))
- {
- fprintf(out,
- "CREATE TABLE tables_priv ("
- "Host char(60) binary DEFAULT '' NOT NULL,"
- "Db char(64) binary DEFAULT '' NOT NULL,"
- "User char(16) binary DEFAULT '' NOT NULL,"
- "Table_name char(64) binary DEFAULT '' NOT NULL,"
- "Grantor char(77) DEFAULT '' NOT NULL,"
- "Timestamp timestamp(14),"
- "Table_priv set('Select','Insert','Update','Delete',"
- "'Create','Drop','Grant','References','Index','Alter')"
- " DEFAULT '' NOT NULL,"
- "Column_priv set('Select','Insert','Update','References')"
- " DEFAULT '' NOT NULL,"
- "PRIMARY KEY (Host,Db,User,Table_name),"
- "KEY Grantor (Grantor)"
- ") engine=MyISAM "
- "CHARACTER SET utf8 COLLATE utf8_bin "
- "comment='Table privileges';\n");
- }
-
- if (test_sys_file(mdata,"mysql/columns_priv.frm"))
- {
- fprintf(out,
- "CREATE TABLE columns_priv ("
- "Host char(60) binary DEFAULT '' NOT NULL,"
- "Db char(64) binary DEFAULT '' NOT NULL,"
- "User char(16) binary DEFAULT '' NOT NULL,"
- "Table_name char(64) binary DEFAULT '' NOT NULL,"
- "Column_name char(64) binary DEFAULT '' NOT NULL,"
- "Timestamp timestamp(14),"
- "Column_priv set('Select','Insert','Update','References')"
- " DEFAULT '' NOT NULL,"
- "PRIMARY KEY (Host,Db,User,Table_name,Column_name)"
- ") engine=MyISAM "
- "CHARACTER SET utf8 COLLATE utf8_bin "
- "comment='Column privileges';\n");
- }
-
- if (test_sys_file(mdata,"mysql/help_topic.frm"))
- {
- fprintf(out,
- "CREATE TABLE help_topic ("
- "help_topic_id int unsigned not null,"
- "name varchar(64) not null,"
- "help_category_id smallint unsigned not null,"
- "description text not null,"
- "example text not null,"
- "url varchar(128) not null,"
- "primary key (help_topic_id),"
- "unique index (name)"
- ") engine=MyISAM "
- "CHARACTER SET utf8 "
- "comment='help topics';\n");
- }
-
- if (test_sys_file(mdata,"mysql/help_category.frm"))
- {
- fprintf(out,
- "CREATE TABLE help_category ("
- "help_category_id smallint unsigned not null,"
- "name varchar(64) not null,"
- "parent_category_id smallint unsigned null,"
- "url varchar(128) not null,"
- "primary key (help_category_id),"
- "unique index (name)"
- ") engine=MyISAM "
- "CHARACTER SET utf8 "
- "comment='help categories';\n");
- }
-
- if (test_sys_file(mdata,"mysql/help_keyword.frm"))
- {
- fprintf(out,
- "CREATE TABLE help_keyword ("
- "help_keyword_id int unsigned not null,"
- "name varchar(64) not null,"
- "primary key (help_keyword_id),"
- "unique index (name)"
- ") engine=MyISAM "
- "CHARACTER SET utf8 "
- "comment='help keywords';\n");
- }
-
- if (test_sys_file(mdata,"mysql/help_relation.frm"))
- {
- fprintf(out,
- "CREATE TABLE help_relation ("
- "help_topic_id int unsigned not null references help_topic,"
- "help_keyword_id int unsigned not null references help_keyword,"
- "primary key (help_keyword_id, help_topic_id)"
- ") engine=MyISAM "
- "CHARACTER SET utf8 "
- "comment='keyword-topic relation';\n");
- }
-
- if (test_sys_file(mdata,"mysql/time_zone_name.frm"))
- {
- fprintf(out,
- "CREATE TABLE time_zone_name ("
- "Name char(64) NOT NULL,"
- "Time_zone_id int unsigned NOT NULL,"
- "PRIMARY KEY Name (Name)"
- ") engine=MyISAM CHARACTER SET utf8 "
- "comment='Time zone names';\n");
-
- if (test)
- {
- fprintf(out,
- "INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES"
- "('MET', 1), ('UTC', 2), ('Universal', 2), "
- "('Europe/Moscow',3), ('leap/Europe/Moscow',4),"
- "('Japan', 5);\n");
-
- }
- }
-
-
- if (test_sys_file(mdata,"mysql/time_zone.frm"))
- {
- fprintf(out,
- "CREATE TABLE time_zone ("
- "Time_zone_id int unsigned NOT NULL auto_increment,"
- "Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,"
- "PRIMARY KEY TzId (Time_zone_id)"
- ") engine=MyISAM CHARACTER SET utf8 "
- "comment='Time zones';\n");
-
- if (test)
- {
- fprintf(out,"INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)"
- "VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N');\n");
- }
- }
-
- if (test_sys_file(mdata,"mysql/time_zone_transition.frm"))
- {
- fprintf(out,
- "CREATE TABLE time_zone_transition ("
- "Time_zone_id int unsigned NOT NULL,"
- "Transition_time bigint signed NOT NULL,"
- "Transition_type_id int unsigned NOT NULL,"
- "PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)"
- ") engine=MyISAM CHARACTER SET utf8 "
- "comment='Time zone transitions';\n");
-
- if (test)
- {
- fprintf(out,
- "INSERT INTO time_zone_transition"
- "(Time_zone_id, Transition_time, Transition_type_id)"
- "VALUES"
- " (1, -1693706400, 0) ,(1, -1680483600, 1)"
- ",(1, -1663455600, 2) ,(1, -1650150000, 3)"
- ",(1, -1632006000, 2) ,(1, -1618700400, 3)"
- ",(1, -938905200, 2) ,(1, -857257200, 3)"
- ",(1, -844556400, 2) ,(1, -828226800, 3)"
- ",(1, -812502000, 2) ,(1, -796777200, 3)"
- ",(1, 228877200, 2) ,(1, 243997200, 3)"
- ",(1, 260326800, 2) ,(1, 276051600, 3)"
- ",(1, 291776400, 2) ,(1, 307501200, 3)"
- ",(1, 323830800, 2) ,(1, 338950800, 3)"
- ",(1, 354675600, 2) ,(1, 370400400, 3)"
- ",(1, 386125200, 2) ,(1, 401850000, 3)"
- ",(1, 417574800, 2) ,(1, 433299600, 3)"
- ",(1, 449024400, 2) ,(1, 465354000, 3)"
- ",(1, 481078800, 2) ,(1, 496803600, 3)"
- ",(1, 512528400, 2) ,(1, 528253200, 3)"
- ",(1, 543978000, 2) ,(1, 559702800, 3)"
- ",(1, 575427600, 2) ,(1, 591152400, 3)"
- ",(1, 606877200, 2) ,(1, 622602000, 3)"
- ",(1, 638326800, 2) ,(1, 654656400, 3)"
- ",(1, 670381200, 2) ,(1, 686106000, 3)"
- ",(1, 701830800, 2) ,(1, 717555600, 3)"
- ",(1, 733280400, 2) ,(1, 749005200, 3)"
- ",(1, 764730000, 2) ,(1, 780454800, 3)"
- ",(1, 796179600, 2) ,(1, 811904400, 3)"
- ",(1, 828234000, 2) ,(1, 846378000, 3)"
- ",(1, 859683600, 2) ,(1, 877827600, 3)"
- ",(1, 891133200, 2) ,(1, 909277200, 3)"
- ",(1, 922582800, 2) ,(1, 941331600, 3)"
- ",(1, 954032400, 2) ,(1, 972781200, 3)"
- ",(1, 985482000, 2) ,(1, 1004230800, 3)"
- ",(1, 1017536400, 2) ,(1, 1035680400, 3)"
- ",(1, 1048986000, 2) ,(1, 1067130000, 3)"
- ",(1, 1080435600, 2) ,(1, 1099184400, 3)"
- ",(1, 1111885200, 2) ,(1, 1130634000, 3)"
- ",(1, 1143334800, 2) ,(1, 1162083600, 3)"
- ",(1, 1174784400, 2) ,(1, 1193533200, 3)"
- ",(1, 1206838800, 2) ,(1, 1224982800, 3)"
- ",(1, 1238288400, 2) ,(1, 1256432400, 3)"
- ",(1, 1269738000, 2) ,(1, 1288486800, 3)"
- ",(1, 1301187600, 2) ,(1, 1319936400, 3)"
- ",(1, 1332637200, 2) ,(1, 1351386000, 3)"
- ",(1, 1364691600, 2) ,(1, 1382835600, 3)"
- ",(1, 1396141200, 2) ,(1, 1414285200, 3)"
- ",(1, 1427590800, 2) ,(1, 1445734800, 3)"
- ",(1, 1459040400, 2) ,(1, 1477789200, 3)"
- ",(1, 1490490000, 2) ,(1, 1509238800, 3)"
- ",(1, 1521939600, 2) ,(1, 1540688400, 3)"
- ",(1, 1553994000, 2) ,(1, 1572138000, 3)"
- ",(1, 1585443600, 2) ,(1, 1603587600, 3)"
- ",(1, 1616893200, 2) ,(1, 1635642000, 3)"
- ",(1, 1648342800, 2) ,(1, 1667091600, 3)"
- ",(1, 1679792400, 2) ,(1, 1698541200, 3)"
- ",(1, 1711846800, 2) ,(1, 1729990800, 3)"
- ",(1, 1743296400, 2) ,(1, 1761440400, 3)"
- ",(1, 1774746000, 2) ,(1, 1792890000, 3)"
- ",(1, 1806195600, 2) ,(1, 1824944400, 3)"
- ",(1, 1837645200, 2) ,(1, 1856394000, 3)"
- ",(1, 1869094800, 2) ,(1, 1887843600, 3)"
- ",(1, 1901149200, 2) ,(1, 1919293200, 3)"
- ",(1, 1932598800, 2) ,(1, 1950742800, 3)"
- ",(1, 1964048400, 2) ,(1, 1982797200, 3)"
- ",(1, 1995498000, 2) ,(1, 2014246800, 3)"
- ",(1, 2026947600, 2) ,(1, 2045696400, 3)"
- ",(1, 2058397200, 2) ,(1, 2077146000, 3)"
- ",(1, 2090451600, 2) ,(1, 2108595600, 3)"
- ",(1, 2121901200, 2) ,(1, 2140045200, 3)"
- ",(3, -1688265000, 2) ,(3, -1656819048, 1)"
- ",(3, -1641353448, 2) ,(3, -1627965048, 3)"
- ",(3, -1618716648, 1) ,(3, -1596429048, 3)"
- ",(3, -1593829848, 5) ,(3, -1589860800, 4)"
- ",(3, -1542427200, 5) ,(3, -1539493200, 6)"
- ",(3, -1525323600, 5) ,(3, -1522728000, 4)"
- ",(3, -1491188400, 7) ,(3, -1247536800, 4)"
- ",(3, 354920400, 5) ,(3, 370728000, 4)"
- ",(3, 386456400, 5) ,(3, 402264000, 4)"
- ",(3, 417992400, 5) ,(3, 433800000, 4)"
- ",(3, 449614800, 5) ,(3, 465346800, 8)"
- ",(3, 481071600, 9) ,(3, 496796400, 8)"
- ",(3, 512521200, 9) ,(3, 528246000, 8)"
- ",(3, 543970800, 9) ,(3, 559695600, 8)"
- ",(3, 575420400, 9) ,(3, 591145200, 8)"
- ",(3, 606870000, 9) ,(3, 622594800, 8)"
- ",(3, 638319600, 9) ,(3, 654649200, 8)"
- ",(3, 670374000, 10) ,(3, 686102400, 11)"
- ",(3, 695779200, 8) ,(3, 701812800, 5)"
- ",(3, 717534000, 4) ,(3, 733273200, 9)"
- ",(3, 748998000, 8) ,(3, 764722800, 9)"
- ",(3, 780447600, 8) ,(3, 796172400, 9)"
- ",(3, 811897200, 8) ,(3, 828226800, 9)"
- ",(3, 846370800, 8) ,(3, 859676400, 9)"
- ",(3, 877820400, 8) ,(3, 891126000, 9)"
- ",(3, 909270000, 8) ,(3, 922575600, 9)"
- ",(3, 941324400, 8) ,(3, 954025200, 9)"
- ",(3, 972774000, 8) ,(3, 985474800, 9)"
- ",(3, 1004223600, 8) ,(3, 1017529200, 9)"
- ",(3, 1035673200, 8) ,(3, 1048978800, 9)"
- ",(3, 1067122800, 8) ,(3, 1080428400, 9)"
- ",(3, 1099177200, 8) ,(3, 1111878000, 9)"
- ",(3, 1130626800, 8) ,(3, 1143327600, 9)"
- ",(3, 1162076400, 8) ,(3, 1174777200, 9)"
- ",(3, 1193526000, 8) ,(3, 1206831600, 9)"
- ",(3, 1224975600, 8) ,(3, 1238281200, 9)"
- ",(3, 1256425200, 8) ,(3, 1269730800, 9)"
- ",(3, 1288479600, 8) ,(3, 1301180400, 9)"
- ",(3, 1319929200, 8) ,(3, 1332630000, 9)"
- ",(3, 1351378800, 8) ,(3, 1364684400, 9)"
- ",(3, 1382828400, 8) ,(3, 1396134000, 9)"
- ",(3, 1414278000, 8) ,(3, 1427583600, 9)"
- ",(3, 1445727600, 8) ,(3, 1459033200, 9)"
- ",(3, 1477782000, 8) ,(3, 1490482800, 9)"
- ",(3, 1509231600, 8) ,(3, 1521932400, 9)"
- ",(3, 1540681200, 8) ,(3, 1553986800, 9)"
- ",(3, 1572130800, 8) ,(3, 1585436400, 9)"
- ",(3, 1603580400, 8) ,(3, 1616886000, 9)"
- ",(3, 1635634800, 8) ,(3, 1648335600, 9)"
- ",(3, 1667084400, 8) ,(3, 1679785200, 9)"
- ",(3, 1698534000, 8) ,(3, 1711839600, 9)"
- ",(3, 1729983600, 8) ,(3, 1743289200, 9)"
- ",(3, 1761433200, 8) ,(3, 1774738800, 9)"
- ",(3, 1792882800, 8) ,(3, 1806188400, 9)"
- ",(3, 1824937200, 8) ,(3, 1837638000, 9)"
- ",(3, 1856386800, 8) ,(3, 1869087600, 9)"
- ",(3, 1887836400, 8) ,(3, 1901142000, 9)"
- ",(3, 1919286000, 8) ,(3, 1932591600, 9)"
- ",(3, 1950735600, 8) ,(3, 1964041200, 9)"
- ",(3, 1982790000, 8) ,(3, 1995490800, 9)"
- ",(3, 2014239600, 8) ,(3, 2026940400, 9)"
- ",(3, 2045689200, 8) ,(3, 2058390000, 9)"
- ",(3, 2077138800, 8) ,(3, 2090444400, 9)"
- ",(3, 2108588400, 8) ,(3, 2121894000, 9)"
- ",(3, 2140038000, 8)"
- ",(4, -1688265000, 2) ,(4, -1656819048, 1)"
- ",(4, -1641353448, 2) ,(4, -1627965048, 3)"
- ",(4, -1618716648, 1) ,(4, -1596429048, 3)"
- ",(4, -1593829848, 5) ,(4, -1589860800, 4)"
- ",(4, -1542427200, 5) ,(4, -1539493200, 6)"
- ",(4, -1525323600, 5) ,(4, -1522728000, 4)"
- ",(4, -1491188400, 7) ,(4, -1247536800, 4)"
- ",(4, 354920409, 5) ,(4, 370728010, 4)"
- ",(4, 386456410, 5) ,(4, 402264011, 4)"
- ",(4, 417992411, 5) ,(4, 433800012, 4)"
- ",(4, 449614812, 5) ,(4, 465346812, 8)"
- ",(4, 481071612, 9) ,(4, 496796413, 8)"
- ",(4, 512521213, 9) ,(4, 528246013, 8)"
- ",(4, 543970813, 9) ,(4, 559695613, 8)"
- ",(4, 575420414, 9) ,(4, 591145214, 8)"
- ",(4, 606870014, 9) ,(4, 622594814, 8)"
- ",(4, 638319615, 9) ,(4, 654649215, 8)"
- ",(4, 670374016, 10) ,(4, 686102416, 11)"
- ",(4, 695779216, 8) ,(4, 701812816, 5)"
- ",(4, 717534017, 4) ,(4, 733273217, 9)"
- ",(4, 748998018, 8) ,(4, 764722818, 9)"
- ",(4, 780447619, 8) ,(4, 796172419, 9)"
- ",(4, 811897219, 8) ,(4, 828226820, 9)"
- ",(4, 846370820, 8) ,(4, 859676420, 9)"
- ",(4, 877820421, 8) ,(4, 891126021, 9)"
- ",(4, 909270021, 8) ,(4, 922575622, 9)"
- ",(4, 941324422, 8) ,(4, 954025222, 9)"
- ",(4, 972774022, 8) ,(4, 985474822, 9)"
- ",(4, 1004223622, 8) ,(4, 1017529222, 9)"
- ",(4, 1035673222, 8) ,(4, 1048978822, 9)"
- ",(4, 1067122822, 8) ,(4, 1080428422, 9)"
- ",(4, 1099177222, 8) ,(4, 1111878022, 9)"
- ",(4, 1130626822, 8) ,(4, 1143327622, 9)"
- ",(4, 1162076422, 8) ,(4, 1174777222, 9)"
- ",(4, 1193526022, 8) ,(4, 1206831622, 9)"
- ",(4, 1224975622, 8) ,(4, 1238281222, 9)"
- ",(4, 1256425222, 8) ,(4, 1269730822, 9)"
- ",(4, 1288479622, 8) ,(4, 1301180422, 9)"
- ",(4, 1319929222, 8) ,(4, 1332630022, 9)"
- ",(4, 1351378822, 8) ,(4, 1364684422, 9)"
- ",(4, 1382828422, 8) ,(4, 1396134022, 9)"
- ",(4, 1414278022, 8) ,(4, 1427583622, 9)"
- ",(4, 1445727622, 8) ,(4, 1459033222, 9)"
- ",(4, 1477782022, 8) ,(4, 1490482822, 9)"
- ",(4, 1509231622, 8) ,(4, 1521932422, 9)"
- ",(4, 1540681222, 8) ,(4, 1553986822, 9)"
- ",(4, 1572130822, 8) ,(4, 1585436422, 9)"
- ",(4, 1603580422, 8) ,(4, 1616886022, 9)"
- ",(4, 1635634822, 8) ,(4, 1648335622, 9)"
- ",(4, 1667084422, 8) ,(4, 1679785222, 9)"
- ",(4, 1698534022, 8) ,(4, 1711839622, 9)"
- ",(4, 1729983622, 8) ,(4, 1743289222, 9)"
- ",(4, 1761433222, 8) ,(4, 1774738822, 9)"
- ",(4, 1792882822, 8) ,(4, 1806188422, 9)"
- ",(4, 1824937222, 8) ,(4, 1837638022, 9)"
- ",(4, 1856386822, 8) ,(4, 1869087622, 9)"
- ",(4, 1887836422, 8) ,(4, 1901142022, 9)"
- ",(4, 1919286022, 8) ,(4, 1932591622, 9)"
- ",(4, 1950735622, 8) ,(4, 1964041222, 9)"
- ",(4, 1982790022, 8) ,(4, 1995490822, 9)"
- ",(4, 2014239622, 8) ,(4, 2026940422, 9)"
- ",(4, 2045689222, 8) ,(4, 2058390022, 9)"
- ",(4, 2077138822, 8) ,(4, 2090444422, 9)"
- ",(4, 2108588422, 8) ,(4, 2121894022, 9)"
- ",(4, 2140038022, 8), (5, -1009875600, 1);\n");
-
-
- }
- }
-
- if (test_sys_file(mdata,"mysql/time_zone_transition_type.frm"))
- {
- fprintf(out,
- "CREATE TABLE time_zone_transition_type ("
- "Time_zone_id int unsigned NOT NULL,"
- "Transition_type_id int unsigned NOT NULL,"
- "Offset int signed DEFAULT 0 NOT NULL,"
- "Is_DST tinyint unsigned DEFAULT 0 NOT NULL,"
- "Abbreviation char(8) DEFAULT '' NOT NULL,"
- "PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)"
- ") engine=MyISAM CHARACTER SET utf8 "
- "comment='Time zone transition types';\n");
-
- if (test)
- {
- fprintf(out,
- "INSERT INTO time_zone_transition_type (Time_zone_id,"
- "Transition_type_id, Offset, Is_DST, Abbreviation) VALUES"
- "(1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET')"
- ",(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET')"
- ",(2, 0, 0, 0, 'UTC')"
- ",(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST')"
- ",(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST')"
- ",(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD')"
- ",(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET')"
- ",(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD')"
- ",(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET')"
- ",(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST')"
- ",(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST')"
- ",(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')"
- ",(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')"
- ",(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')"
- ",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET')"
- ",(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST');\n");
-
- }
- }
-
- if (test_sys_file(mdata,"mysql/time_zone_leap_second.frm"))
- {
- fprintf(out,
- "CREATE TABLE time_zone_leap_second ("
- "Transition_time bigint signed NOT NULL,"
- "Correction int signed NOT NULL,"
- "PRIMARY KEY TranTime (Transition_time)"
- ") engine=MyISAM CHARACTER SET utf8 "
- "comment='Leap seconds information for time zones';\n");
-
- if (test)
- {
- fprintf(out,
- "INSERT INTO time_zone_leap_second "
- "(Transition_time, Correction) VALUES "
- "(78796800, 1) ,(94694401, 2) ,(126230402, 3)"
- ",(157766403, 4) ,(189302404, 5) ,(220924805, 6)"
- ",(252460806, 7) ,(283996807, 8) ,(315532808, 9)"
- ",(362793609, 10) ,(394329610, 11) ,(425865611, 12)"
- ",(489024012, 13) ,(567993613, 14) ,(631152014, 15)"
- ",(662688015, 16) ,(709948816, 17) ,(741484817, 18)"
- ",(773020818, 19) ,(820454419, 20) ,(867715220, 21)"
- ",(915148821, 22);\n");
- }
- }
-
- return fclose(out);
-}
diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c
deleted file mode 100644
index e5d1be42f95..00000000000
--- a/mysql-test/my_manage.c
+++ /dev/null
@@ -1,887 +0,0 @@
-/*
- Copyright (c) 2003 Novell, Inc. All Rights Reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <stdio.h>
-#include <errno.h>
-#ifndef __WIN__
-#include <dirent.h>
-#endif
-#include <string.h>
-#ifdef __NETWARE__
-#include <screen.h>
-#include <proc.h>
-#else
-#include <sys/types.h>
-#ifndef __WIN__
-#include <sys/wait.h>
-#include <unistd.h>
-#include <signal.h>
-#include <fnmatch.h> /* FIXME HAVE_FNMATCH_H or something */
-#else
-#include <direct.h>
-#include <stdlib.h>
-#include <stdio.h>
-#endif
-#endif
-#include <ctype.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <assert.h>
-
-#include "my_manage.h"
-
-#ifndef __NETWARE__
-#define ASSERT assert
-extern char **environ;
-#endif
-
-
-
-/******************************************************************************
-
- macros
-
-******************************************************************************/
-
-/******************************************************************************
-
- global variables
-
-******************************************************************************/
-
-/******************************************************************************
-
- functions
-
-******************************************************************************/
-
-/******************************************************************************
-
- init_args()
-
- Init an argument list.
-
-******************************************************************************/
-
-void init_args(arg_list_t *al)
-{
- ASSERT(al != NULL);
-
- al->argc= 0;
- al->size= ARG_BUF;
- al->argv= malloc(al->size * sizeof(char *));
- ASSERT(al->argv != NULL);
-
- return;
-}
-
-/******************************************************************************
-
- add_arg()
-
- Add an argument to a list.
-
-******************************************************************************/
-
-void add_arg(arg_list_t *al, const char *format, ...)
-{
- va_list ap;
- char temp[FN_REFLEN];
-
- ASSERT(al != NULL);
-
- /* increase size */
- if (al->argc >= (int)al->size)
- {
- al->size+= ARG_BUF;
- al->argv= realloc(al->argv, al->size * sizeof(char *));
- ASSERT(al->argv != NULL);
- }
-
- if (format)
- {
- va_start(ap, format);
- vsprintf(temp, format, ap);
- va_end(ap);
-
- al->argv[al->argc]= malloc(strlen(temp)+1);
- ASSERT(al->argv[al->argc] != NULL);
- strcpy(al->argv[al->argc], temp);
-
- ++(al->argc);
- }
- else
- {
- al->argv[al->argc]= NULL;
- }
-
- return;
-}
-
-/******************************************************************************
-
- free_args()
-
- Free an argument list.
-
-******************************************************************************/
-
-void free_args(arg_list_t *al)
-{
- int i;
-
- ASSERT(al != NULL);
-
- for (i= 0; i < al->argc; i++)
- {
- ASSERT(al->argv[i] != NULL);
- free(al->argv[i]);
- al->argv[i]= NULL;
- }
-
- free(al->argv);
- al->argc= 0;
- al->argv= NULL;
-
- return;
-}
-
-/******************************************************************************
-
- sleep_until_file_deleted()
-
- Sleep until the given file is no longer found.
-
-******************************************************************************/
-
-#ifndef __WIN__
-int sleep_until_file_deleted(char *pid_file)
-#else
-int sleep_until_file_deleted(HANDLE pid_file)
-#endif
-{
- int err= 0; /* Initiate to supress warning */
-#ifndef __WIN__
- struct stat buf;
- int i;
-
- for (i= 0; (i < TRY_MAX) && (err= !stat(pid_file, &buf)); i++) sleep(1);
-
- if (err != 0) err= errno;
-#else
- err= (WaitForSingleObject(pid_file, TRY_MAX*1000) == WAIT_TIMEOUT);
-#endif
- return err;
-}
-
-/******************************************************************************
-
- sleep_until_file_exists()
-
- Sleep until the given file exists.
-
-******************************************************************************/
-
-#ifndef __WIN__
-int sleep_until_file_exists(char *pid_file)
-#else
-int sleep_until_file_exists(HANDLE pid_file)
-#endif
-{
- int err= 0; /* Initiate to supress warning */
-#ifndef __WIN__
- struct stat buf;
- int i;
-
- for (i= 0; (i < TRY_MAX) && (err= stat(pid_file, &buf)); i++) sleep(1);
-
- if (err != 0) err= errno;
-#else
- err= (WaitForSingleObject(pid_file, TRY_MAX*1000) == WAIT_TIMEOUT);
-#endif
- return err;
-}
-
-/******************************************************************************
-
- wait_for_server_start()
-
- Wait for the server on the given port to start.
-
-******************************************************************************/
-
-int wait_for_server_start(char *bin_dir __attribute__((unused)),
- char *mysqladmin_file,
- char *user, char *password, int port,char *tmp_dir)
-{
- arg_list_t al;
- int err= 0;
- char trash[FN_REFLEN];
-
- /* mysqladmin file */
- snprintf(trash, FN_REFLEN, "%s/trash.out",tmp_dir);
-
- /* args */
- init_args(&al);
- add_arg(&al, "%s", mysqladmin_file);
- add_arg(&al, "--no-defaults");
- add_arg(&al, "--port=%u", port);
- add_arg(&al, "--user=%s", user);
- add_arg(&al, "--password=%s", password);
- add_arg(&al, "--silent");
- add_arg(&al, "--host=localhost");
-
-#ifndef __NETWARE__
- add_arg(&al, "--connect_timeout=10");
- add_arg(&al, "-w");
- add_arg(&al, "--protocol=tcp");
-#endif
- add_arg(&al, "ping");
-
- /*
- NetWare does not support the connect timeout in the TCP/IP stack
- -- we will try the ping multiple times
- */
-#ifndef __WIN__
- {
- int i;
- for (i= 0;
- (i < TRY_MAX) && (err= spawn(mysqladmin_file, &al, TRUE, NULL,
- trash, NULL, NULL));
- i++)
- sleep(1);
- }
-#else
- err= spawn(mysqladmin_file, &al, TRUE, NULL,trash, NULL, NULL);
-#endif
-
- /* free args */
- free_args(&al);
-
- return err;
-}
-
-/******************************************************************************
-
- spawn()
-
- Spawn the given path with the given arguments.
-
-******************************************************************************/
-
-#ifdef __NETWARE__
-int spawn(char *path, arg_list_t *al, int join, char *input,
- char *output, char *error, char *pid_file)
-{
- pid_t pid;
- int result= 0;
- wiring_t wiring= { FD_UNUSED, FD_UNUSED, FD_UNUSED };
- unsigned long flags= PROC_CURRENT_SPACE | PROC_INHERIT_CWD;
-
- /* open wiring */
- if (input)
- wiring.infd= open(input, O_RDONLY);
-
- if (output)
- wiring.outfd= open(output, O_WRONLY | O_CREAT | O_TRUNC);
-
- if (error)
- wiring.errfd= open(error, O_WRONLY | O_CREAT | O_TRUNC);
-
- /* procve requires a NULL */
- add_arg(al, NULL);
-
- /* go */
- pid= procve(path, flags, NULL, &wiring, NULL, NULL, 0,
- NULL, (const char **)al->argv);
-
- /* close wiring */
- if (wiring.infd != -1)
- close(wiring.infd);
-
- if (wiring.outfd != -1)
- close(wiring.outfd);
-
- if (wiring.errfd != -1)
- close(wiring.errfd);
-
- return result;
-}
-#elif __WIN__
-
-int spawn(char *path, arg_list_t *al, int join, char *input,
- char *output, char *error, HANDLE *pid)
-{
- bool result;
- int i;
- STARTUPINFO startup_info;
- PROCESS_INFORMATION process_information;
- DWORD exit_code;
- char win_args[1024]= "";
-
- /* Skip the first parameter */
- for (i= 1; i < al->argc; i++)
- {
- ASSERT(al->argv[i] != NULL);
- strcat(win_args,al->argv[i]);
- strcat(win_args," ");
- }
-
- memset(&startup_info,0,sizeof(STARTUPINFO));
- startup_info.cb= sizeof(STARTUPINFO);
-
- if (input)
- freopen(input, "rb", stdin);
-
- if (output)
- freopen(output, "wb", stdout);
-
- if (error)
- freopen(error, "wb", stderr);
-
- result= CreateProcess(
- path,
- (LPSTR)&win_args,
- NULL,
- NULL,
- TRUE,
- 0,
- NULL,
- NULL,
- &startup_info,
- &process_information
- );
-
- if (result && process_information.hProcess)
- {
- if (join)
- {
- if (WaitForSingleObject(process_information.hProcess, mysqld_timeout)
- == WAIT_TIMEOUT)
- {
- exit_code= -1;
- }
- else
- {
- GetExitCodeProcess(process_information.hProcess, &exit_code);
- }
- CloseHandle(process_information.hProcess);
- }
- else
- {
- exit_code= 0;
- }
- if (pid != NULL)
- *pid= process_information.hProcess;
- }
- else
- {
- exit_code= -1;
- }
- if (input)
- freopen("CONIN$","rb",stdin);
- if (output)
- freopen("CONOUT$","wb",stdout);
- if (error)
- freopen("CONOUT$","wb",stderr);
-
- return exit_code;
-}
-#else
-int spawn(char *path, arg_list_t *al, int join, char *input,
- char *output, char *error, char *pid_file __attribute__((unused)))
-{
- pid_t pid;
- int res_exec= 0;
- int result= 0;
-
- pid= fork();
-
- if (pid == -1)
- {
- fprintf(stderr, "fork was't created\n");
- /* We can't create the fork...exit with error */
- return EXIT_FAILURE;
- }
-
- if (pid > 0)
- {
- /* The parent process is waiting for child process if join is not zero */
- if (join)
- {
- waitpid(pid, &result, 0);
- if (WIFEXITED(result) != 0)
- {
- result= WEXITSTATUS(result);
- }
- else
- {
- result= EXIT_FAILURE;
- }
- }
- }
- else
- {
-
- /* Child process */
- add_arg(al, NULL);
-
- /* Reassign streams */
- if (input)
- freopen(input, "r", stdin);
-
- if (output)
- freopen(output, "w", stdout);
-
- if (error)
- freopen(error, "w", stderr);
-
- /* Spawn the process */
- if ((res_exec= execve(path, al->argv, environ)) < 0)
- exit(EXIT_FAILURE);
-
- /* Restore streams */
- if (input)
- freopen("/dev/tty", "r", stdin);
-
- if (output)
- freopen("/dev/tty", "w", stdout);
-
- if (error)
- freopen("/dev/tty", "w", stderr);
-
- exit(0);
- }
-
- return result;
-}
-#endif
-/******************************************************************************
-
- stop_server()
-
- Stop the server with the given port and pid file.
-
-******************************************************************************/
-
-int stop_server(char *bin_dir __attribute__((unused)), char *mysqladmin_file,
- char *user, char *password, int port,
-#ifndef __WIN__
- char *pid_file,
-#else
- HANDLE pid_file,
-#endif
- char *tmp_dir)
-{
- arg_list_t al;
- int err= 0;
- char trash[FN_REFLEN];
-
- snprintf(trash, FN_REFLEN, "%s/trash.out",tmp_dir);
-
- /* args */
- init_args(&al);
- add_arg(&al, "%s", mysqladmin_file);
- add_arg(&al, "--no-defaults");
- add_arg(&al, "--port=%u", port);
- add_arg(&al, "--user=%s", user);
- add_arg(&al, "--password=%s", password);
- add_arg(&al, "-O");
- add_arg(&al, "shutdown_timeout=20");
-#ifndef __NETWARE__
- add_arg(&al, "--protocol=tcp");
-#endif
- add_arg(&al, "shutdown");
-
- /* spawn */
- if ((err= spawn(mysqladmin_file, &al, TRUE, NULL,
- trash, NULL, NULL)) == 0)
- {
- sleep_until_file_deleted(pid_file);
- }
- else
- {
-#ifndef __WIN__
- pid_t pid= get_server_pid(pid_file);
-
- /* shutdown failed - kill server */
- kill_server(pid);
-
- sleep(TRY_MAX);
-
- /* remove pid file if possible */
- err= remove(pid_file);
-#else
- TerminateProcess(pid_file,err);
-#endif
- }
-
- /* free args */
- free_args(&al);
-
- return err;
-}
-
-/******************************************************************************
-
- get_server_pid()
-
- Get the VM id with the given pid file.
-
-******************************************************************************/
-
-#ifndef __WIN__
-pid_t get_server_pid(char *pid_file)
-{
- char buf[FN_REFLEN];
- int fd, err;
- char *p;
- pid_t id= 0;
-
- /* discover id */
- fd= open(pid_file, O_RDONLY);
-
- err= read(fd, buf, FN_REFLEN);
-
- close(fd);
-
- if (err > 0)
- {
- /* terminate string */
- if ((p= strchr(buf, '\n')) != NULL)
- {
- *p= '\0';
-
- /* check for a '\r' */
- if ((p= strchr(buf, '\r')) != NULL)
- {
- *p= '\0';
- }
- }
- else
- {
- buf[err]= '\0';
- }
-
- id= strtol(buf, NULL, 0);
- }
-
- return id;
-}
-
-/******************************************************************************
-
- kill_server()
-
- Force a kill of the server with the given pid.
-
-******************************************************************************/
-
-void kill_server(pid_t pid)
-{
- if (pid > 0)
- {
-#if !defined(__NETWARE__)
- /* Send SIGTERM to pid */
- kill(pid, SIGTERM);
-#else /* __NETWARE__ */
- /* destroy vm */
- NXVmDestroy(pid);
-#endif
- }
-}
-#endif
-/******************************************************************************
-
- del_tree()
-
- Delete the directory and subdirectories.
-
-******************************************************************************/
-
-void del_tree(char *dir)
-{
-#ifndef __WIN__
- DIR *parent= opendir(dir);
- struct dirent *entry;
- char temp[FN_REFLEN];
-
- if (parent == NULL)
- {
- return;
- }
-
- while ((entry= readdir(parent)) != NULL)
- {
- /* create long name */
- snprintf(temp, FN_REFLEN, "%s/%s", dir, entry->d_name);
-
- if (entry->d_name[0] == '.')
- {
- /* Skip */
- }
- else
- {
-/* FIXME missing test in acinclude.m4 */
-#ifndef STRUCT_DIRENT_HAS_D_TYPE
- struct stat st;
-
- if (lstat(entry->d_name, &st) == -1)
- {
- /* FIXME error */
- return;
- }
- if (S_ISDIR(st.st_mode))
-#else
- if (S_ISDIR(entry->d_type))
-#endif
- {
- /* delete subdirectory */
- del_tree(temp);
- }
- else
- {
- /* remove file */
- remove(temp);
- }
- }
- }
- /* remove directory */
- rmdir(dir);
-#else
- struct _finddata_t parent;
-#if defined(_MSC_VER) && _MSC_VER > 1200
- intptr_t handle;
-#else
- long handle;
-#endif /* _MSC_VER && _MSC_VER > 1200 */
- char temp[FN_REFLEN];
- char mask[FN_REFLEN];
-
- snprintf(mask,FN_REFLEN,"%s/*.*",dir);
-
- if ((handle=_findfirst(mask,&parent)) == -1L)
- {
- return;
- }
-
- do
- {
- /* create long name */
- snprintf(temp, FN_REFLEN, "%s/%s", dir, parent.name);
- if (parent.name[0] == '.')
- {
- /* Skip */
- }
- else
- if (parent.attrib & _A_SUBDIR)
- {
- /* delete subdirectory */
- del_tree(temp);
- }
- else
- {
- /* remove file */
- remove(temp);
- }
- } while (_findnext(handle,&parent) == 0);
-
- _findclose(handle);
-
- /* remove directory */
- _rmdir(dir);
-#endif
-}
-
-/******************************************************************************
-
- removef()
-
-******************************************************************************/
-
-int removef(const char *format, ...)
-{
-#ifdef __NETWARE__
- va_list ap;
- char path[FN_REFLEN];
-
- va_start(ap, format);
-
- vsnprintf(path, FN_REFLEN, format, ap);
-
- va_end(ap);
- return remove(path);
-
-#elif __WIN__
- {
- va_list ap;
- char path[FN_REFLEN];
- struct _finddata_t parent;
-#if defined(_MSC_VER) && _MSC_VER > 1200
- intptr_t handle;
-#else
- long handle;
-#endif /* _MSC_VER && _MSC_VER > 1200 */
- char temp[FN_REFLEN];
- char *p;
-
- va_start(ap, format);
-
- vsnprintf(path, FN_REFLEN, format, ap);
-
- va_end(ap);
-
- p= path + strlen(path);
- while (*p != '\\' && *p != '/' && p > path) p--;
-
- if ((handle=_findfirst(path,&parent)) == -1L)
- {
- /* if there is not files....it's ok */
- return 0;
- }
-
- *p= '\0';
-
- do
- {
- if (! (parent.attrib & _A_SUBDIR))
- {
- snprintf(temp, FN_REFLEN, "%s/%s", path, parent.name);
- remove(temp);
- }
- }while (_findnext(handle,&parent) == 0);
-
- _findclose(handle);
- }
-#else
- DIR *parent;
- struct dirent *entry;
- char temp[FN_REFLEN];
- va_list ap;
- char path[FN_REFLEN];
- char *p;
- /* Get path with mask */
- va_start(ap, format);
-
- vsnprintf(path, FN_REFLEN, format, ap);
-
- va_end(ap);
-
- p= path + strlen(path);
- while (*p != '\\' && *p != '/' && p > path) p--;
- *p= '\0';
- p++;
-
- parent= opendir(path);
-
- if (parent == NULL)
- {
- return 1; /* Error, directory missing */
- }
-
- while ((entry= readdir(parent)) != NULL)
- {
- /* entry is not directory and entry matches with mask */
-#ifndef STRUCT_DIRENT_HAS_D_TYPE
- struct stat st;
-
- /* create long name */
- snprintf(temp, FN_REFLEN, "%s/%s", path, entry->d_name);
-
- if (lstat(temp, &st) == -1)
- {
- return 1; /* Error couldn't lstat file */
- }
-
- if (!S_ISDIR(st.st_mode) && !fnmatch(p, entry->d_name,0))
-#else
- if (!S_ISDIR(entry->d_type) && !fnmatch(p, entry->d_name,0))
-#endif
- {
- /* create long name */
- snprintf(temp, FN_REFLEN, "%s/%s", path, entry->d_name);
- /* Delete only files */
- remove(temp);
- }
- }
-#endif
- return 0;
-}
-
-/******************************************************************************
-
- get_basedir()
-
-******************************************************************************/
-
-void get_basedir(char *argv0, char *basedir)
-{
- char temp[FN_REFLEN];
- char *p;
- int position;
-
- ASSERT(argv0 != NULL);
- ASSERT(basedir != NULL);
-
- strcpy(temp, strlwr(argv0));
- while ((p= strchr(temp, '\\')) != NULL) *p= '/';
-
- if ((position= strinstr(temp, "/bin/")) != 0)
- {
- p= temp + position;
- *p= '\0';
- strcpy(basedir, temp);
- }
-}
-
-uint strinstr(reg1 const char *str,reg4 const char *search)
-{
- reg2 my_string i,j;
- my_string start= (my_string) str;
-
- skipp:
- while (*str != '\0')
- {
- if (*str++ == *search)
- {
- i=(my_string) str;
- j= (my_string) search+1;
- while (*j)
- if (*i++ != *j++) goto skipp;
- return ((uint) (str - start));
- }
- }
- return (0);
-}
-
-/******************************************************************************
-
- remove_empty_file()
-
-******************************************************************************/
-
-void remove_empty_file(const char *file_name)
-{
- struct stat file;
-
- if (!stat(file_name,&file))
- {
- if (!file.st_size)
- remove(file_name);
- }
-}
diff --git a/mysql-test/my_manage.h b/mysql-test/my_manage.h
deleted file mode 100644
index 5df77b01af8..00000000000
--- a/mysql-test/my_manage.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- Copyright (c) 2002 Novell, Inc. All Rights Reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef _MY_MANAGE
-#define _MY_MANAGE
-
-/******************************************************************************
-
- includes
-
-******************************************************************************/
-
-#include <stdlib.h>
-#ifndef __WIN__
-#include <unistd.h>
-#endif
-#ifndef __NETWARE__
-#include <string.h>
-#include <my_global.h>
-#include <m_string.h>
-
-#ifndef __WIN__
-#define strnicmp strncasecmp
-#define strlwr(STRARG) (STRARG)
-#else
-int my_vsnprintf_(char *to, size_t n, const char* value, ...);
-#endif
-#endif
-
-/******************************************************************************
-
- macros
-
-******************************************************************************/
-
-#define ARG_BUF 10
-#define TRY_MAX 5
-
-#ifdef __WIN__
-#define PATH_MAX _MAX_PATH
-#define NAME_MAX _MAX_FNAME
-#define kill(A,B) TerminateProcess((HANDLE)A,0)
-#define NOT_NEED_PID 0
-#define MASTER_PID 1
-#define SLAVE_PID 2
-#define mysqld_timeout 60000
-
-int pid_mode;
-bool run_server;
-bool skip_first_param;
-
-#define snprintf _snprintf
-#define vsnprintf _vsnprintf
-#endif
-
-
-/******************************************************************************
-
- structures
-
-******************************************************************************/
-
-typedef struct
-{
-
- int argc;
- char **argv;
-
- size_t size;
-
-} arg_list_t;
-
-#ifdef __WIN__
-typedef int pid_t;
-#endif
-/******************************************************************************
-
- global variables
-
-******************************************************************************/
-
-/******************************************************************************
-
- prototypes
-
-******************************************************************************/
-
-void init_args(arg_list_t *);
-void add_arg(arg_list_t *, const char *, ...);
-void free_args(arg_list_t *);
-
-#ifndef __WIN__
-int sleep_until_file_exists(char *);
-int sleep_until_file_deleted(char *);
-#else
-int sleep_until_file_exists(HANDLE);
-int sleep_until_file_deleted(HANDLE);
-#endif
-int wait_for_server_start(char *, char *, char *, char *, int,char *);
-
-#ifndef __WIN__
-int spawn(char *, arg_list_t *, int, char *, char *, char *, char *);
-#else
-int spawn(char *, arg_list_t *, int , char *, char *, char *, HANDLE *);
-#endif
-
-#ifndef __WIN__
-int stop_server(char *, char *, char *, char *, int, char *,char *);
-pid_t get_server_pid(char *);
-void kill_server(pid_t pid);
-#else
-int stop_server(char *, char *, char *, char *, int, HANDLE,char *);
-#endif
-void del_tree(char *);
-int removef(const char *, ...);
-
-void get_basedir(char *, char *);
-void remove_empty_file(const char *file_name);
-
-bool create_system_files(const char *mdata,const char *output_file, bool test);
-
-#endif /* _MY_MANAGE */
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index e63db73d8f4..cb6fb0af0e8 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -250,12 +250,8 @@ MASTER_MYPORT=9306
SLAVE_RUNNING=0
SLAVE_MYHOST=127.0.0.1
SLAVE_MYPORT=9308 # leave room for 2 masters for cluster tests
-MYSQL_MANAGER_PORT=9305 # needs to be out of the way of slaves
NDBCLUSTER_PORT=9350
NDBCLUSTER_PORT_SLAVE=9358
-MYSQL_MANAGER_PW_FILE=$MYSQL_TEST_DIR/var/tmp/manager.pwd
-MYSQL_MANAGER_LOG=$MYSQL_TEST_DIR/var/log/manager.log
-MYSQL_MANAGER_USER=root
#
# To make it easier for different devs to work on the same host,
@@ -269,14 +265,12 @@ MYSQL_MANAGER_USER=root
#
if [ -n "$MTR_BUILD_THREAD" ] ; then
MASTER_MYPORT=`expr $MTR_BUILD_THREAD '*' 10 + 10000`
- MYSQL_MANAGER_PORT=`expr $MASTER_MYPORT + 2`
SLAVE_MYPORT=`expr $MASTER_MYPORT + 3`
NDBCLUSTER_PORT=`expr $MASTER_MYPORT + 6`
NDBCLUSTER_PORT_SLAVE=`expr $MASTER_MYPORT + 7`
echo "Using MTR_BUILD_THREAD = $MTR_BUILD_THREAD"
echo "Using MASTER_MYPORT = $MASTER_MYPORT"
- echo "Using MYSQL_MANAGER_PORT = $MYSQL_MANAGER_PORT"
echo "Using SLAVE_MYPORT = $SLAVE_MYPORT"
echo "Using NDBCLUSTER_PORT = $NDBCLUSTER_PORT"
echo "Using NDBCLUSTER_PORT_SLAVE = $NDBCLUSTER_PORT_SLAVE"
@@ -361,7 +355,6 @@ while test $# -gt 0; do
--user=*) DBUSER=`$ECHO "$1" | $SED -e "s;--user=;;"` ;;
--force) FORCE=1 ;;
--timer) USE_TIMER=1 ;;
- --verbose-manager) MANAGER_QUIET_OPT="" ;;
--old-master) MASTER_40_ARGS="";;
--master-binary=*)
MASTER_MYSQLD=`$ECHO "$1" | $SED -e "s;--master-binary=;;"` ;;
@@ -407,7 +400,6 @@ while test $# -gt 0; do
LOCAL_MASTER=1 ;;
--master_port=*) MASTER_MYPORT=`$ECHO "$1" | $SED -e "s;--master_port=;;"` ;;
--slave_port=*) SLAVE_MYPORT=`$ECHO "$1" | $SED -e "s;--slave_port=;;"` ;;
- --manager-port=*) MYSQL_MANAGER_PORT=`$ECHO "$1" | $SED -e "s;--manager_port=;;"` ;;
--ndbcluster_port=*) NDBCLUSTER_PORT=`$ECHO "$1" | $SED -e "s;--ndbcluster_port=;;"` ;;
--ndbcluster-port=*) NDBCLUSTER_PORT=`$ECHO "$1" | $SED -e "s;--ndbcluster-port=;;"` ;;
--ndbcluster-port-slave=*) NDBCLUSTER_PORT_SLAVE=`$ECHO "$1" | $SED -e "s;--ndbcluster-port-slave=;;"` ;;
@@ -423,11 +415,6 @@ while test $# -gt 0; do
MYSQL_TEST_SSL_OPTS="--ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem \
--ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem \
--ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem" ;;
- --no-manager | --skip-manager) USE_MANAGER=0 ;;
- --manager)
- USE_MANAGER=1
- USE_RUNNING_SERVER=0
- ;;
--start-and-exit)
START_AND_EXIT=1
;;
@@ -645,7 +632,6 @@ fi
#--
MYRUN_DIR=$MYSQL_TEST_DIR/var/run
-MANAGER_PID_FILE="$MYRUN_DIR/manager.pid"
MASTER_MYDDIR="$MYSQL_TEST_DIR/var/master-data"
MASTER_MYSOCK="$MYSQL_TMP_DIR/master.sock"
@@ -759,9 +745,6 @@ if [ x$SOURCE_DIST = x1 ] ; then
MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
WAIT_PID="$BASEDIR/extra/mysql_waitpid"
MYSQL_MY_PRINT_DEFAULTS="$BASEDIR/extra/my_print_defaults"
- MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqltestmanagerc"
- MYSQL_MANAGER="$BASEDIR/tools/mysqltestmanager"
- MYSQL_MANAGER_PWGEN="$CLIENT_BINDIR/mysqltestmanager-pwgen"
MYSQL="$CLIENT_BINDIR/mysql"
LANGUAGE="$BASEDIR/sql/share/english/"
CHARSETSDIR="$BASEDIR/sql/share/charsets"
@@ -822,9 +805,6 @@ else
MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
WAIT_PID="$CLIENT_BINDIR/mysql_waitpid"
MYSQL_MY_PRINT_DEFAULTS="$CLIENT_BINDIR/my_print_defaults"
- MYSQL_MANAGER="$CLIENT_BINDIR/mysqltestmanager"
- MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqltestmanagerc"
- MYSQL_MANAGER_PWGEN="$CLIENT_BINDIR/mysqltestmanager-pwgen"
MYSQL="$CLIENT_BINDIR/mysql"
INSTALL_DB="./install_test_db --bin"
MYSQL_FIX_SYSTEM_TABLES="$CLIENT_BINDIR/mysql_fix_privilege_tables"
@@ -1214,96 +1194,27 @@ abort_if_failed()
fi
}
-start_manager()
+launch_in_background()
{
- if [ $USE_MANAGER = 0 ] ; then
- echo "Manager disabled, skipping manager start."
- $RM -f $MYSQL_MANAGER_LOG
+ echo $@ | /bin/sh >> $CUR_MYERR 2>&1 &
+ sleep 2 #hack
return
- fi
- $ECHO "Starting MySQL Manager"
- if [ -f "$MANAGER_PID_FILE" ] ; then
- kill `cat $MANAGER_PID_FILE`
- sleep 1
- if [ -f "$MANAGER_PID_FILE" ] ; then
- kill -9 `cat $MANAGER_PID_FILE`
- sleep 1
- fi
- fi
-
- $RM -f $MANAGER_PID_FILE
- MYSQL_MANAGER_PW=`$MYSQL_MANAGER_PWGEN -u $MYSQL_MANAGER_USER \
- -o $MYSQL_MANAGER_PW_FILE`
- $MYSQL_MANAGER --log=$MYSQL_MANAGER_LOG --port=$MYSQL_MANAGER_PORT \
- --password-file=$MYSQL_MANAGER_PW_FILE --pid-file=$MANAGER_PID_FILE
- abort_if_failed "Could not start MySQL manager"
- mysqltest_manager_args="--manager-host=localhost \
- --manager-user=$MYSQL_MANAGER_USER \
- --manager-password=$MYSQL_MANAGER_PW \
- --manager-port=$MYSQL_MANAGER_PORT \
- --manager-wait-timeout=$START_WAIT_TIMEOUT"
- MYSQL_TEST="$MYSQL_TEST $mysqltest_manager_args"
- MYSQL_TEST_ARGS="$MYSQL_TEST_ARGS $mysqltest_manager_args"
- while [ ! -f $MANAGER_PID_FILE ] ; do
- sleep 1
- done
- echo "Manager started"
}
-stop_manager()
-{
- if [ $USE_MANAGER = 0 ] ; then
- return
- fi
- $MYSQL_MANAGER_CLIENT $MANAGER_QUIET_OPT -u$MYSQL_MANAGER_USER \
- -p$MYSQL_MANAGER_PW -P $MYSQL_MANAGER_PORT <<EOF
-shutdown
-EOF
- echo "Manager terminated"
-
-}
-
-manager_launch()
-{
- ident=$1
- shift
- if [ $USE_MANAGER = 0 ] ; then
- echo $@ | /bin/sh >> $CUR_MYERR 2>&1 &
- sleep 2 #hack
- return
- fi
- $MYSQL_MANAGER_CLIENT $MANAGER_QUIET_OPT --user=$MYSQL_MANAGER_USER \
- --password=$MYSQL_MANAGER_PW --port=$MYSQL_MANAGER_PORT <<EOF
-def_exec $ident "$@"
-set_exec_stdout $ident $CUR_MYERR
-set_exec_stderr $ident $CUR_MYERR
-set_exec_con $ident root localhost $CUR_MYSOCK
-start_exec $ident $START_WAIT_TIMEOUT
-EOF
- abort_if_failed "Could not execute manager command"
-}
-
-manager_term()
+shutdown_mysqld()
{
pid=$1
ident=$2
- if [ $USE_MANAGER = 0 ] ; then
- # Shutdown time must be high as slave may be in reconnect
- $MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock$3 --connect_timeout=5 --shutdown_timeout=70 shutdown >> $MYSQL_MANAGER_LOG 2>&1
- res=$?
- # Some systems require an extra connect
- $MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock$3 --connect_timeout=1 ping >> $MYSQL_MANAGER_LOG 2>&1
- if test $res = 0
- then
- wait_for_pid $pid
- fi
- return $res
+ # Shutdown time must be high as slave may be in reconnect
+ $MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock$3 --connect_timeout=5 --shutdown_timeout=70 shutdown >> $MYSQL_MANAGER_LOG 2>&1
+ res=$?
+ # Some systems require an extra connect
+ $MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock$3 --connect_timeout=1 ping >> $MYSQL_MANAGER_LOG 2>&1
+ if test $res = 0
+ then
+ wait_for_pid $pid
fi
- $MYSQL_MANAGER_CLIENT $MANAGER_QUIET_OPT --user=$MYSQL_MANAGER_USER \
- --password=$MYSQL_MANAGER_PW --port=$MYSQL_MANAGER_PORT <<EOF
-stop_exec $ident $STOP_WAIT_TIMEOUT
-EOF
- abort_if_failed "Could not execute manager command"
+ return $res
}
start_ndbcluster()
@@ -1486,7 +1397,7 @@ start_master()
if [ x$DO_DDD = x1 ]
then
$ECHO "set args $master_args" > $GDB_MASTER_INIT$1
- manager_launch master ddd -display $DISPLAY --debugger \
+ launch_in_background master ddd -display $DISPLAY --debugger \
"gdb -x $GDB_MASTER_INIT$1" $MASTER_MYSQLD
elif [ x$DO_GDB = x1 ]
then
@@ -1507,11 +1418,11 @@ end
r
EOF
fi ) > $GDB_MASTER_INIT$1
- manager_launch master $XTERM -display $DISPLAY \
+ launch_in_background master $XTERM -display $DISPLAY \
-title "Master" -e gdb -x $GDB_MASTER_INIT$1 $MASTER_MYSQLD
fi
else
- manager_launch master $MASTER_MYSQLD $master_args
+ launch_in_background master $MASTER_MYSQLD $master_args
fi
sleep_until_file_created $MASTER_MYPID$1 $wait_for_master
wait_for_master=$SLEEP_TIME_FOR_SECOND_MASTER
@@ -1644,7 +1555,7 @@ start_slave()
if [ x$DO_DDD = x1 ]
then
$ECHO "set args $slave_args" > $GDB_SLAVE_INIT
- manager_launch $slave_ident ddd -display $DISPLAY --debugger \
+ launch_in_background $slave_ident ddd -display $DISPLAY --debugger \
"gdb -x $GDB_SLAVE_INIT" $SLAVE_MYSQLD
elif [ x$DO_GDB = x1 ]
then
@@ -1665,11 +1576,11 @@ end
r
EOF
fi ) > $GDB_SLAVE_INIT
- manager_launch $slave_ident $XTERM -display $DISPLAY -title "Slave" -e \
+ launch_in_background $slave_ident $XTERM -display $DISPLAY -title "Slave" -e \
gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD
fi
else
- manager_launch $slave_ident $SLAVE_MYSQLD $slave_args
+ launch_in_background $slave_ident $SLAVE_MYSQLD $slave_args
fi
eval "SLAVE$1_RUNNING=1"
sleep_until_file_created $slave_pid $wait_for_slave
@@ -1701,7 +1612,7 @@ stop_slave ()
if [ x$this_slave_running = x1 ]
then
pid=`$CAT $slave_pid`
- manager_term $pid $slave_ident
+ shutdown_mysqld $pid $slave_ident
if [ $? != 0 ] && [ -f $slave_pid ]
then # try harder!
$ECHO "slave not cooperating with mysqladmin, will try manual kill"
@@ -1748,7 +1659,7 @@ stop_master ()
# MASTER_RUNNING=0 to get cleanup when calling start_master().
if [ x$USE_EMBEDDED_SERVER != x1 ] ; then
pid=`$CAT $MASTER_MYPID$1`
- manager_term $pid master $1
+ shutdown_mysqld $pid master $1
if [ $? != 0 ] && [ -f $MASTER_MYPID$1 ]
then # try harder!
$ECHO "master not cooperating with mysqladmin, will try manual kill"
@@ -2074,7 +1985,6 @@ run_testcase ()
[ -z "$DO_DDD" ] && [ -z "$USE_EMBEDDED_SERVER" ]
then
mysql_stop
- stop_manager
fi
exit 1
fi
@@ -2244,18 +2154,6 @@ then
rm $MASTER_MYPID $MASTER_MYPID"1" $SLAVE_MYPID
fi
- # Kill any running managers
- if [ -f "$MANAGER_PID_FILE" ]
- then
- kill `cat $MANAGER_PID_FILE`
- sleep 1
- if [ -f "$MANAGER_PID_FILE" ]
- then
- kill -9 `cat $MANAGER_PID_FILE`
- sleep 1
- fi
- fi
-
# just to force stopping anything from previous runs
USE_NDBCLUSTER_OPT=$USE_NDBCLUSTER
stop_ndbcluster
@@ -2279,10 +2177,8 @@ then
USE_NDBCLUSTER_OPT=
fi
- start_manager
-
-# Do not automagically start daemons if we are in gdb or running only one test
-# case
+# Do not automagically start daemons if we are in gdb or running only one
+# test case
if [ -z "$DO_GDB" ] && [ -z "$DO_DDD" ]
then
mysql_start
@@ -2329,7 +2225,6 @@ then
fi
cd $savedir
mysql_stop
- stop_manager
exit
fi
@@ -2351,7 +2246,6 @@ then
if [ $USE_RUNNING_SERVER -eq 0 ] ; then
mysql_stop
- stop_manager
fi
exit
@@ -2398,7 +2292,6 @@ if [ -z "$DO_GDB" ] && [ $USE_RUNNING_SERVER -eq 0 ] && [ -z "$DO_DDD" ]
then
mysql_stop
fi
-stop_manager
report_stats
$ECHO
diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c
deleted file mode 100644
index 79db71fa274..00000000000
--- a/mysql-test/mysql_test_run_new.c
+++ /dev/null
@@ -1,1933 +0,0 @@
-/*
- Copyright (c) 2002, 2003 Novell, Inc. All Rights Reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#ifndef __WIN__
-#include <dirent.h>
-#endif
-#include <string.h>
-#ifdef __NETWARE__
-#include <screen.h>
-#include <nks/vm.h>
-#endif
-#include <ctype.h>
-#include <sys/stat.h>
-#ifndef __WIN__
-#include <unistd.h>
-#endif
-#include <fcntl.h>
-#ifdef __NETWARE__
-#include <sys/mode.h>
-#endif
-#ifdef __WIN__
-#include <windows.h>
-#include <shlwapi.h>
-#include <direct.h>
-#endif
-
-#include "my_manage.h"
-
-/******************************************************************************
-
- macros
-
-******************************************************************************/
-
-#define HEADER "TEST RESULT \n"
-#define DASH "-------------------------------------------------------\n"
-
-#define NW_TEST_SUFFIX ".nw-test"
-#define NW_RESULT_SUFFIX ".nw-result"
-#define TEST_SUFFIX ".test"
-#define RESULT_SUFFIX ".result"
-#define REJECT_SUFFIX ".reject"
-#define OUT_SUFFIX ".out"
-#define ERR_SUFFIX ".err"
-
-const char *TEST_PASS= "[ pass ]";
-const char *TEST_SKIP= "[ skip ]";
-const char *TEST_FAIL= "[ fail ]";
-const char *TEST_BAD= "[ bad ]";
-const char *TEST_IGNORE= "[ignore]";
-
-/******************************************************************************
-
- global variables
-
-******************************************************************************/
-
-#ifdef __NETWARE__
-static char base_dir[FN_REFLEN]= "sys:/mysql";
-#else
-static char base_dir[FN_REFLEN]= "..";
-#endif
-static char db[FN_LEN]= "test";
-static char user[FN_LEN]= "root";
-static char password[FN_LEN]= "";
-
-int master_port= 9306;
-int slave_port= 9307;
-
-#if !defined(__NETWARE__) && !defined(__WIN__)
-static char master_socket[FN_REFLEN]= "./var/tmp/master.sock";
-static char slave_socket[FN_REFLEN]= "./var/tmp/slave.sock";
-#endif
-
-#define MAX_COUNT_TESTES 1024
-
-#ifdef __WIN__
-# define sting_compare_func _stricmp
-#else
-# ifdef HAVE_STRCASECMP
-# define sting_compare_func strcasecmp
-# else
-# define sting_compare_func strcmp
-# endif
-#endif
-
-/* comma delimited list of tests to skip or empty string */
-#ifndef __WIN__
-static char skip_test[FN_REFLEN]= " lowercase_table3 , system_mysql_db_fix ";
-#else
-/*
- The most ignore testes contain the calls of system command
-
- lowercase_table3 is disabled by Gerg
- system_mysql_db_fix is disabled by Gerg
- sp contains a command system
- rpl_EE_error contains a command system
- rpl_loaddatalocal contains a command system
- ndb_autodiscover contains a command system
- rpl_rotate_logs contains a command system
- repair contains a command system
- rpl_trunc_binlog contains a command system
- mysqldump contains a command system
- rpl000001 makes non-exit loop...temporary skiped
-*/
-static char skip_test[FN_REFLEN]=
-" lowercase_table3 ,"
-" system_mysql_db_fix ,"
-" sp ,"
-" rpl_EE_error ,"
-" rpl_loaddatalocal ,"
-" ndb_autodiscover ,"
-" rpl_rotate_logs ,"
-" repair ,"
-" rpl_trunc_binlog ,"
-" mysqldump ,"
-" rpl000001 ,"
-
-" derived ,"
-" group_by ,"
-" select ,"
-" rpl000015 ,"
-" subselect ";
-#endif
-static char ignore_test[FN_REFLEN]= "";
-
-static char bin_dir[FN_REFLEN];
-static char mysql_test_dir[FN_REFLEN];
-static char test_dir[FN_REFLEN];
-static char mysql_tmp_dir[FN_REFLEN];
-static char result_dir[FN_REFLEN];
-static char master_dir[FN_REFLEN];
-static char slave_dir[FN_REFLEN];
-static char slave1_dir[FN_REFLEN];
-static char slave2_dir[FN_REFLEN];
-static char lang_dir[FN_REFLEN];
-static char char_dir[FN_REFLEN];
-
-static char mysqladmin_file[FN_REFLEN];
-static char mysqld_file[FN_REFLEN];
-static char mysqltest_file[FN_REFLEN];
-#ifndef __WIN__
-static char master_pid[FN_REFLEN];
-static char slave_pid[FN_REFLEN];
-static char sh_file[FN_REFLEN]= "/bin/sh";
-#else
-static HANDLE master_pid;
-static HANDLE slave_pid;
-#endif
-
-static char master_opt[FN_REFLEN]= "";
-static char slave_opt[FN_REFLEN]= "";
-
-static char slave_master_info[FN_REFLEN]= "";
-
-static char master_init_script[FN_REFLEN]= "";
-static char slave_init_script[FN_REFLEN]= "";
-
-/* OpenSSL */
-static char ca_cert[FN_REFLEN];
-static char server_cert[FN_REFLEN];
-static char server_key[FN_REFLEN];
-static char client_cert[FN_REFLEN];
-static char client_key[FN_REFLEN];
-
-int total_skip= 0;
-int total_pass= 0;
-int total_fail= 0;
-int total_test= 0;
-
-int total_ignore= 0;
-
-int use_openssl= FALSE;
-int master_running= FALSE;
-int slave_running= FALSE;
-int skip_slave= TRUE;
-int single_test= TRUE;
-
-int restarts= 0;
-
-FILE *log_fd= NULL;
-
-static char argument[FN_REFLEN];
-
-/******************************************************************************
-
- functions
-
-******************************************************************************/
-
-/******************************************************************************
-
- prototypes
-
-******************************************************************************/
-
-void report_stats();
-void install_db(char *);
-void mysql_install_db();
-void start_master();
-void start_slave();
-void mysql_start();
-void stop_slave();
-void stop_master();
-void mysql_stop();
-void mysql_restart();
-int read_option(char *, char *);
-void run_test(char *);
-void setup(char *);
-void vlog(const char *, va_list);
-void mlog(const char *, ...);
-void log_info(const char *, ...);
-void log_error(const char *, ...);
-void log_errno(const char *, ...);
-void die(const char *);
-char *str_tok(char* dest, char *string, const char *delim);
-#ifndef __WIN__
-void run_init_script(const char *script_name);
-#endif
-/******************************************************************************
-
- report_stats()
-
- Report the gathered statistics.
-
-******************************************************************************/
-
-void report_stats()
-{
- if (total_fail == 0)
- {
- mlog("\nAll %d test(s) were successful.\n", total_test);
- }
- else
- {
- double percent= ((double)total_pass / total_test) * 100;
-
- mlog("\nFailed %u/%u test(s), %.02f%% successful.\n",
- total_fail, total_test, percent);
- mlog("\nThe .out and .err files in %s may give you some\n", result_dir);
- mlog("hint of what when wrong.\n");
- mlog("\nIf you want to report this error, please first read "
- "the documentation\n");
- mlog("at: http://www.mysql.com/doc/M/y/MySQL_test_suite.html\n");
- }
-}
-
-/******************************************************************************
-
- install_db()
-
- Install the a database.
-
-******************************************************************************/
-
-void install_db(char *datadir)
-{
- arg_list_t al;
- int err;
- char input[FN_REFLEN];
- char output[FN_REFLEN];
- char error[FN_REFLEN];
-
- /* input file */
-#ifdef __NETWARE__
- snprintf(input, FN_REFLEN, "%s/bin/init_db.sql", base_dir);
-#else
- snprintf(input, FN_REFLEN, "%s/mysql-test/init_db.sql", base_dir);
-#endif
- snprintf(output, FN_REFLEN, "%s/install.out", datadir);
- snprintf(error, FN_REFLEN, "%s/install.err", datadir);
-
- if (create_system_files(datadir,input, TRUE))
- die("Unable to create init_db.sql.");
- /* args */
- init_args(&al);
- add_arg(&al, mysqld_file);
- add_arg(&al, "--no-defaults");
- add_arg(&al, "--bootstrap");
- add_arg(&al, "--skip-grant-tables");
- add_arg(&al, "--basedir=%s", base_dir);
- add_arg(&al, "--datadir=%s", datadir);
- add_arg(&al, "--skip-innodb");
- add_arg(&al, "--skip-ndbcluster");
- add_arg(&al, "--skip-bdb");
-#ifndef __NETWARE__
- add_arg(&al, "--character-sets-dir=%s", char_dir);
- add_arg(&al, "--language=%s", lang_dir);
-#endif
-// added
- add_arg(&al, "--default-character-set=latin1");
- add_arg(&al, "--innodb_data_file_path=ibdata1:50M");
-
- /* spawn */
- if ((err= spawn(mysqld_file, &al, TRUE, input, output, error, NULL)) != 0)
- {
- die("Unable to create database.");
- }
-
- /* free args */
- free_args(&al);
-}
-
-/******************************************************************************
-
- mysql_install_db()
-
- Install the test databases.
-
-******************************************************************************/
-
-void mysql_install_db()
-{
- char temp[FN_REFLEN];
-
- /* var directory */
- snprintf(temp, FN_REFLEN, "%s/var", mysql_test_dir);
-
- /* create var directory */
-#ifndef __WIN__
- mkdir(temp, S_IRWXU);
- /* create subdirectories */
- mlog("Creating test-suite folders...\n");
- snprintf(temp, FN_REFLEN, "%s/var/run", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, FN_REFLEN, "%s/var/tmp", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, FN_REFLEN, "%s/var/master-data", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, FN_REFLEN, "%s/var/master-data/mysql", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, FN_REFLEN, "%s/var/master-data/test", mysql_test_dir);
- mkdir(temp, S_IRWXU);
-
- snprintf(temp, FN_REFLEN, "%s/var/slave-data", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, FN_REFLEN, "%s/var/slave-data/mysql", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, FN_REFLEN, "%s/var/slave-data/test", mysql_test_dir);
- mkdir(temp, S_IRWXU);
-
- snprintf(temp, FN_REFLEN, "%s/var/slave1-data", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, FN_REFLEN, "%s/var/slave1-data/mysql", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, FN_REFLEN, "%s/var/slave1-data/test", mysql_test_dir);
- mkdir(temp, S_IRWXU);
-
- snprintf(temp, FN_REFLEN, "%s/var/slave2-data", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, FN_REFLEN, "%s/var/slave2-data/mysql", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, FN_REFLEN, "%s/var/slave2-data/test", mysql_test_dir);
- mkdir(temp, S_IRWXU);
-#else
- mkdir(temp);
- /* create subdirectories */
- mlog("Creating test-suite folders...\n");
- snprintf(temp, FN_REFLEN, "%s/var/run", mysql_test_dir);
- mkdir(temp);
- snprintf(temp, FN_REFLEN, "%s/var/tmp", mysql_test_dir);
- mkdir(temp);
- snprintf(temp, FN_REFLEN, "%s/var/master-data", mysql_test_dir);
- mkdir(temp);
- snprintf(temp, FN_REFLEN, "%s/var/master-data/mysql", mysql_test_dir);
- mkdir(temp);
- snprintf(temp, FN_REFLEN, "%s/var/master-data/test", mysql_test_dir);
- mkdir(temp);
- snprintf(temp, FN_REFLEN, "%s/var/slave-data", mysql_test_dir);
- mkdir(temp);
- snprintf(temp, FN_REFLEN, "%s/var/slave-data/mysql", mysql_test_dir);
- mkdir(temp);
- snprintf(temp, FN_REFLEN, "%s/var/slave-data/test", mysql_test_dir);
- mkdir(temp);
-#endif
-
- /* install databases */
- mlog("Creating test databases for master... \n");
- install_db(master_dir);
- mlog("Creating test databases for slave... \n");
- install_db(slave_dir);
- install_db(slave1_dir);
- install_db(slave2_dir);
-}
-
-/******************************************************************************
-
- start_master()
-
- Start the master server.
-
-******************************************************************************/
-
-void start_master()
-{
- arg_list_t al;
- int err;
- char master_out[FN_REFLEN];
- char master_err[FN_REFLEN];
- char temp2[FN_REFLEN];
-
- /* remove old berkeley db log files that can confuse the server */
- removef("%s/log.*", master_dir);
-
- /* remove stale binary logs */
- removef("%s/var/log/*-bin.*", mysql_test_dir);
-
- /* remove stale binary logs */
- removef("%s/var/log/*.index", mysql_test_dir);
-
- /* remove master.info file */
- removef("%s/master.info", master_dir);
-
- /* remove relay files */
- removef("%s/var/log/*relay*", mysql_test_dir);
-
- /* remove relay-log.info file */
- removef("%s/relay-log.info", master_dir);
-
- /* init script */
- if (master_init_script[0] != 0)
- {
-#ifdef __NETWARE__
- /* TODO: use the scripts */
- if (strinstr(master_init_script, "repair_part2-master.sh") != 0)
- {
- FILE *fp;
-
- /* create an empty index file */
- snprintf(temp, FN_REFLEN, "%s/test/t1.MYI", master_dir);
- fp= fopen(temp, "wb+");
-
- fputs("1", fp);
-
- fclose(fp);
- }
-#elif !defined(__WIN__)
- run_init_script(master_init_script);
-#endif
- }
-
- /* redirection files */
- snprintf(master_out, FN_REFLEN, "%s/var/run/master%u.out",
- mysql_test_dir, restarts);
- snprintf(master_err, FN_REFLEN, "%s/var/run/master%u.err",
- mysql_test_dir, restarts);
-#ifndef __WIN__
- snprintf(temp2,FN_REFLEN,"%s/var",mysql_test_dir);
- mkdir(temp2,S_IRWXU);
- snprintf(temp2,FN_REFLEN,"%s/var/log",mysql_test_dir);
- mkdir(temp2,S_IRWXU);
-#else
- snprintf(temp2,FN_REFLEN,"%s/var",mysql_test_dir);
- mkdir(temp2);
- snprintf(temp2,FN_REFLEN,"%s/var/log",mysql_test_dir);
- mkdir(temp2);
-#endif
- /* args */
- init_args(&al);
- add_arg(&al, "%s", mysqld_file);
- add_arg(&al, "--no-defaults");
- add_arg(&al, "--log-bin=%s/var/log/master-bin",mysql_test_dir);
- add_arg(&al, "--server-id=1");
- add_arg(&al, "--basedir=%s", base_dir);
- add_arg(&al, "--port=%u", master_port);
-#if !defined(__NETWARE__) && !defined(__WIN__)
- add_arg(&al, "--socket=%s",master_socket);
-#endif
- add_arg(&al, "--local-infile");
- add_arg(&al, "--core");
- add_arg(&al, "--log-bin-trust-function-creators");
- add_arg(&al, "--datadir=%s", master_dir);
-#ifndef __WIN__
- add_arg(&al, "--pid-file=%s", master_pid);
-#endif
- add_arg(&al, "--character-sets-dir=%s", char_dir);
- add_arg(&al, "--tmpdir=%s", mysql_tmp_dir);
- add_arg(&al, "--language=%s", lang_dir);
-
- add_arg(&al, "--rpl-recovery-rank=1");
- add_arg(&al, "--init-rpl-role=master");
- add_arg(&al, "--default-character-set=latin1");
-// add_arg(&al, "--innodb_data_file_path=ibdata1:50M");
-#ifdef DEBUG /* only for debug builds */
- add_arg(&al, "--debug");
-#endif
-
- if (use_openssl)
- {
- add_arg(&al, "--ssl-ca=%s", ca_cert);
- add_arg(&al, "--ssl-cert=%s", server_cert);
- add_arg(&al, "--ssl-key=%s", server_key);
- }
-
- /* $MASTER_40_ARGS */
- add_arg(&al, "--rpl-recovery-rank=1");
- add_arg(&al, "--init-rpl-role=master");
-
- /* $SMALL_SERVER */
- add_arg(&al, "-O");
- add_arg(&al, "key_buffer_size=1M");
- add_arg(&al, "-O");
- add_arg(&al, "sort_buffer=256K");
- add_arg(&al, "-O");
- add_arg(&al, "max_heap_table_size=1M");
-
- /* $EXTRA_MASTER_OPT */
- if (master_opt[0] != 0)
- {
- char *p;
-
- p= (char *)str_tok(argument, master_opt, " \t");
- if (!strstr(master_opt, "timezone"))
- {
- while (p)
- {
- add_arg(&al, "%s", p);
- p= (char *)str_tok(argument, NULL, " \t");
- }
- }
- }
-
- /* remove the pid file if it exists */
-#ifndef __WIN__
- remove(master_pid);
-#endif
-
- /* spawn */
-#ifdef __WIN__
- if ((err= spawn(mysqld_file, &al, FALSE, NULL,
- master_out, master_err, &master_pid)) == 0)
-#else
- if ((err= spawn(mysqld_file, &al, FALSE, NULL,
- master_out, master_err, master_pid)) == 0)
-#endif
- {
- sleep_until_file_exists(master_pid);
-
- if ((err= wait_for_server_start(bin_dir, mysqladmin_file, user, password,
- master_port, mysql_tmp_dir)) == 0)
- {
- master_running= TRUE;
- }
- else
- {
- log_error("The master server went down early.");
- }
- }
- else
- {
- log_error("Unable to start master server.");
- }
-
- /* free_args */
- free_args(&al);
-}
-
-/******************************************************************************
-
- start_slave()
-
- Start the slave server.
-
-******************************************************************************/
-
-void start_slave()
-{
- arg_list_t al;
- int err;
- char slave_out[FN_REFLEN];
- char slave_err[FN_REFLEN];
-
- /* skip? */
- if (skip_slave) return;
-
- /* remove stale binary logs */
- removef("%s/*-bin.*", slave_dir);
-
- /* remove stale binary logs */
- removef("%s/*.index", slave_dir);
-
- /* remove master.info file */
- removef("%s/master.info", slave_dir);
-
- /* remove relay files */
- removef("%s/var/log/*relay*", mysql_test_dir);
-
- /* remove relay-log.info file */
- removef("%s/relay-log.info", slave_dir);
-
- /* init script */
- if (slave_init_script[0] != 0)
- {
-#ifdef __NETWARE__
- /* TODO: use the scripts */
- if (strinstr(slave_init_script, "rpl000016-slave.sh") != 0)
- {
- /* create empty master.info file */
- snprintf(temp, FN_REFLEN, "%s/master.info", slave_dir);
- close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO));
- }
- else if (strinstr(slave_init_script, "rpl000017-slave.sh") != 0)
- {
- FILE *fp;
-
- /* create a master.info file */
- snprintf(temp, FN_REFLEN, "%s/master.info", slave_dir);
- fp= fopen(temp, "wb+");
-
- fputs("master-bin.000001\n", fp);
- fputs("4\n", fp);
- fputs("127.0.0.1\n", fp);
- fputs("replicate\n", fp);
- fputs("aaaaaaaaaaaaaaab\n", fp);
- fputs("9306\n", fp);
- fputs("1\n", fp);
- fputs("0\n", fp);
-
- fclose(fp);
- }
- else if (strinstr(slave_init_script, "rpl_rotate_logs-slave.sh") != 0)
- {
- /* create empty master.info file */
- snprintf(temp, FN_REFLEN, "%s/master.info", slave_dir);
- close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO));
- }
-#elif !defined(__WIN__)
- run_init_script(slave_init_script);
-#endif
- }
-
- /* redirection files */
- snprintf(slave_out, FN_REFLEN, "%s/var/run/slave%u.out",
- mysql_test_dir, restarts);
- snprintf(slave_err, FN_REFLEN, "%s/var/run/slave%u.err",
- mysql_test_dir, restarts);
-
- /* args */
- init_args(&al);
- add_arg(&al, "%s", mysqld_file);
- add_arg(&al, "--no-defaults");
- add_arg(&al, "--log-bin=slave-bin");
- add_arg(&al, "--relay_log=slave-relay-bin");
- add_arg(&al, "--basedir=%s", base_dir);
-#if !defined(__NETWARE__) && !defined(__WIN__)
- add_arg(&al, "--socket=%s",slave_socket);
-#endif
- add_arg(&al, "--port=%u", slave_port);
- add_arg(&al, "--datadir=%s", slave_dir);
-#ifndef __WIN__
- add_arg(&al, "--pid-file=%s", slave_pid);
-#endif
- add_arg(&al, "--character-sets-dir=%s", char_dir);
- add_arg(&al, "--core");
- add_arg(&al, "--tmpdir=%s", mysql_tmp_dir);
- add_arg(&al, "--language=%s", lang_dir);
-
- add_arg(&al, "--exit-info=256");
- add_arg(&al, "--log-slave-updates");
- add_arg(&al, "--init-rpl-role=slave");
- add_arg(&al, "--skip-innodb");
- add_arg(&al, "--skip-slave-start");
- add_arg(&al, "--slave-load-tmpdir=../../var/tmp");
-
- add_arg(&al, "--report-user=%s", user);
- add_arg(&al, "--report-host=127.0.0.1");
- add_arg(&al, "--report-port=%u", slave_port);
-
- add_arg(&al, "--master-retry-count=10");
- add_arg(&al, "-O");
- add_arg(&al, "slave_net_timeout=10");
- add_arg(&al, "--log-slave-updates");
- add_arg(&al, "--log=%s/var/log/slave.log", mysql_test_dir);
- add_arg(&al, "--default-character-set=latin1");
- add_arg(&al, "--skip-ndbcluster");
-
-#ifdef DEBUG /* only for debug builds */
- add_arg(&al, "--debug");
-#endif
-
- if (use_openssl)
- {
- add_arg(&al, "--ssl-ca=%s", ca_cert);
- add_arg(&al, "--ssl-cert=%s", server_cert);
- add_arg(&al, "--ssl-key=%s", server_key);
- }
-
- /* slave master info */
- if (slave_master_info[0] != 0)
- {
- char *p;
-
- p= (char *)str_tok(argument, slave_master_info, " \t");
-
- while (p)
- {
- add_arg(&al, "%s", p);
- p= (char *)str_tok(argument, NULL, " \t");
- }
- }
- else
- {
- add_arg(&al, "--master-user=%s", user);
- add_arg(&al, "--master-password=%s", password);
- add_arg(&al, "--master-host=127.0.0.1");
- add_arg(&al, "--master-port=%u", master_port);
- add_arg(&al, "--master-connect-retry=1");
- add_arg(&al, "--server-id=2");
- add_arg(&al, "--rpl-recovery-rank=2");
- }
-
- /* small server */
- add_arg(&al, "-O");
- add_arg(&al, "key_buffer_size=1M");
- add_arg(&al, "-O");
- add_arg(&al, "sort_buffer=256K");
- add_arg(&al, "-O");
- add_arg(&al, "max_heap_table_size=1M");
-
-
- /* opt args */
- if (slave_opt[0] != 0)
- {
- char *p;
-
- p= (char *)str_tok(argument, slave_opt, " \t");
-
- while (p)
- {
- add_arg(&al, "%s", p);
- p= (char *)str_tok(argument, NULL, " \t");
- }
- }
-
- /* remove the pid file if it exists */
-#ifndef __WIN__
- remove(slave_pid);
-#endif
- /* spawn */
-#ifdef __WIN__
- if ((err= spawn(mysqld_file, &al, FALSE, NULL,
- slave_out, slave_err, &slave_pid)) == 0)
-#else
- if ((err= spawn(mysqld_file, &al, FALSE, NULL,
- slave_out, slave_err, slave_pid)) == 0)
-#endif
- {
- sleep_until_file_exists(slave_pid);
-
- if ((err= wait_for_server_start(bin_dir, mysqladmin_file, user, password,
- slave_port, mysql_tmp_dir)) == 0)
- {
- slave_running= TRUE;
- }
- else
- {
- log_error("The slave server went down early.");
- }
- }
- else
- {
- log_error("Unable to start slave server.");
- }
-
- /* free args */
- free_args(&al);
-}
-
-/******************************************************************************
-
- mysql_start()
-
- Start the mysql servers.
-
-******************************************************************************/
-
-void mysql_start()
-{
-
-
- printf("loading master...\r");
- start_master();
-
- printf("loading slave...\r");
- start_slave();
-
- /* activate the test screen */
-#ifdef __NETWARE__
- ActivateScreen(getscreenhandle());
-#endif
-}
-
-/******************************************************************************
-
- stop_slave()
-
- Stop the slave server.
-
-******************************************************************************/
-
-void stop_slave()
-{
- int err;
-
- /* running? */
- if (!slave_running) return;
-
- /* stop */
- if ((err= stop_server(bin_dir, mysqladmin_file, user, password,
- slave_port, slave_pid, mysql_tmp_dir)) == 0)
- {
- slave_running= FALSE;
- }
- else
- {
- log_error("Unable to stop slave server.");
- }
-}
-
-/******************************************************************************
-
- stop_master()
-
- Stop the master server.
-
-******************************************************************************/
-
-void stop_master()
-{
- int err;
-
- /* running? */
- if (!master_running) return;
-
- if ((err= stop_server(bin_dir, mysqladmin_file, user, password,
- master_port, master_pid, mysql_tmp_dir)) == 0)
- {
- master_running= FALSE;
- }
- else
- {
- log_error("Unable to stop master server.");
- }
-}
-
-/******************************************************************************
-
- mysql_stop()
-
- Stop the mysql servers.
-
-******************************************************************************/
-
-void mysql_stop()
-{
-
- stop_master();
-
- stop_slave();
-
- /* activate the test screen */
-#ifdef __NETWARE__
- ActivateScreen(getscreenhandle());
-#endif
-}
-
-/******************************************************************************
-
- mysql_restart()
-
- Restart the mysql servers.
-
-******************************************************************************/
-
-void mysql_restart()
-{
-/* log_info("Restarting the MySQL server(s): %u", ++restarts); */
-
- mysql_stop();
-
- mlog(DASH);
- sleep(1);
-
- mysql_start();
-}
-
-/******************************************************************************
-
- read_option()
-
- Read the option file.
-
-******************************************************************************/
-
-int read_option(char *opt_file, char *opt)
-{
- int fd, err;
- char *p;
- char buf[FN_REFLEN];
-
- /* copy current option */
- strncpy(buf, opt, FN_REFLEN);
-
- /* open options file */
- fd= open(opt_file, O_RDONLY);
- err= read(fd, opt, FN_REFLEN);
- close(fd);
-
- if (err > 0)
- {
- /* terminate string */
- if ((p= strchr(opt, '\n')) != NULL)
- {
- *p= 0;
-
- /* check for a '\r' */
- if ((p= strchr(opt, '\r')) != NULL)
- {
- *p= 0;
- }
- }
- else
- {
- opt[err]= 0;
- }
-
- /* check for $MYSQL_TEST_DIR */
- if ((p= strstr(opt, "$MYSQL_TEST_DIR")) != NULL)
- {
- char temp[FN_REFLEN];
-
- *p= 0;
-
- strcpy(temp, p + strlen("$MYSQL_TEST_DIR"));
- strcat(opt, mysql_test_dir);
- strcat(opt, temp);
- }
- /* Check for double backslash and replace it with single bakslash */
- if ((p= strstr(opt, "\\\\")) != NULL)
- {
- /* bmove is guranteed to work byte by byte */
- bmove(p, p+1, strlen(p)+1);
- }
- }
- else
- {
- /* clear option */
- *opt= 0;
- }
-
- /* compare current option with previous */
- return strcmp(opt, buf);
-}
-
-/******************************************************************************
-
- run_test()
-
- Run the given test case.
-
-******************************************************************************/
-
-void run_test(char *test)
-{
- char temp[FN_REFLEN];
- const char *rstr;
- int skip= FALSE, ignore=FALSE;
- int restart= FALSE;
- int flag= FALSE;
- struct stat info;
-
- /* skip tests in the skip list */
- snprintf(temp, FN_REFLEN, " %s ", test);
- skip= (strinstr(skip_test, temp) != 0);
- if (skip == FALSE)
- ignore= (strinstr(ignore_test, temp) != 0);
-
- snprintf(master_init_script, FN_REFLEN, "%s/%s-master.sh", test_dir, test);
- snprintf(slave_init_script, FN_REFLEN, "%s/%s-slave.sh", test_dir, test);
-#ifdef __WIN__
- if (! stat(master_init_script, &info))
- skip= TRUE;
- if (!stat(slave_init_script, &info))
- skip= TRUE;
-#endif
- if (ignore)
- {
- /* show test */
- mlog("%-46s ", test);
-
- /* ignore */
- rstr= TEST_IGNORE;
- ++total_ignore;
- }
- else if (!skip) /* skip test? */
- {
- char test_file[FN_REFLEN];
- char master_opt_file[FN_REFLEN];
- char slave_opt_file[FN_REFLEN];
- char slave_master_info_file[FN_REFLEN];
- char result_file[FN_REFLEN];
- char reject_file[FN_REFLEN];
- char out_file[FN_REFLEN];
- char err_file[FN_REFLEN];
- int err;
- arg_list_t al;
- /* skip slave? */
- flag= skip_slave;
- skip_slave= (strncmp(test, "rpl", 3) != 0);
- if (flag != skip_slave) restart= TRUE;
-
- /* create files */
- snprintf(master_opt_file, FN_REFLEN, "%s/%s-master.opt", test_dir, test);
- snprintf(slave_opt_file, FN_REFLEN, "%s/%s-slave.opt", test_dir, test);
- snprintf(slave_master_info_file, FN_REFLEN, "%s/%s.slave-mi",
- test_dir, test);
- snprintf(reject_file, FN_REFLEN, "%s/%s%s",
- result_dir, test, REJECT_SUFFIX);
- snprintf(out_file, FN_REFLEN, "%s/%s%s", result_dir, test, OUT_SUFFIX);
- snprintf(err_file, FN_REFLEN, "%s/%s%s", result_dir, test, ERR_SUFFIX);
-
- /* netware specific files */
- snprintf(test_file, FN_REFLEN, "%s/%s%s", test_dir, test, NW_TEST_SUFFIX);
- if (stat(test_file, &info))
- {
- snprintf(test_file, FN_REFLEN, "%s/%s%s", test_dir, test, TEST_SUFFIX);
- if (access(test_file,0))
- {
- printf("Invalid test name %s, %s file not found\n",test,test_file);
- return;
- }
- }
-
- snprintf(result_file, FN_REFLEN, "%s/%s%s",
- result_dir, test, NW_RESULT_SUFFIX);
- if (stat(result_file, &info))
- {
- snprintf(result_file, FN_REFLEN, "%s/%s%s",
- result_dir, test, RESULT_SUFFIX);
- }
-
- /* init scripts */
- if (stat(master_init_script, &info))
- master_init_script[0]= 0;
- else
- restart= TRUE;
-
- if (stat(slave_init_script, &info))
- slave_init_script[0]= 0;
- else
- restart= TRUE;
-
- /* read options */
- if (read_option(master_opt_file, master_opt)) restart= TRUE;
- if (read_option(slave_opt_file, slave_opt)) restart= TRUE;
- if (read_option(slave_master_info_file, slave_master_info)) restart= TRUE;
-
- /* cleanup previous run */
- remove(reject_file);
- remove(out_file);
- remove(err_file);
-
- /* start or restart? */
- if (!master_running) mysql_start();
- else if (restart) mysql_restart();
-
- /* show test */
- mlog("%-46s ", test);
-
- /* args */
- init_args(&al);
- add_arg(&al, "%s", mysqltest_file);
- add_arg(&al, "--no-defaults");
- add_arg(&al, "--port=%u", master_port);
-#if !defined(__NETWARE__) && !defined(__WIN__)
- add_arg(&al, "--socket=%s", master_socket);
- add_arg(&al, "--tmpdir=%s", mysql_tmp_dir);
-#endif
- add_arg(&al, "--database=%s", db);
- add_arg(&al, "--user=%s", user);
- add_arg(&al, "--password=%s", password);
- add_arg(&al, "--silent");
- add_arg(&al, "--basedir=%s/", mysql_test_dir);
- add_arg(&al, "--host=127.0.0.1");
- add_arg(&al, "--skip-safemalloc");
- add_arg(&al, "-v");
- add_arg(&al, "-R");
- add_arg(&al, "%s", result_file);
-
-
- if (use_openssl)
- {
- add_arg(&al, "--ssl-ca=%s", ca_cert);
- add_arg(&al, "--ssl-cert=%s", client_cert);
- add_arg(&al, "--ssl-key=%s", client_key);
- }
-
- /* spawn */
- err= spawn(mysqltest_file, &al, TRUE, test_file, out_file, err_file, NULL);
- /* free args */
- free_args(&al);
-
- remove_empty_file(out_file);
- remove_empty_file(err_file);
-
- if (err == 0)
- {
- /* pass */
- rstr= TEST_PASS;
- ++total_pass;
-
- /* increment total */
- ++total_test;
- }
- else if (err == 2)
- {
- /* skip */
- rstr= TEST_SKIP;
- ++total_skip;
- }
- else if (err == 1)
- {
- /* fail */
- rstr= TEST_FAIL;
- ++total_fail;
-
- /* increment total */
- ++total_test;
- }
- else
- {
- rstr= TEST_BAD;
- }
- }
- else /* early skips */
- {
- /* show test */
- mlog("%-46s ", test);
-
- /* skip */
- rstr= TEST_SKIP;
- ++total_skip;
- }
-
- /* result */
- mlog("%-14s\n", rstr);
-}
-
-/******************************************************************************
-
- vlog()
-
- Log the message.
-
-******************************************************************************/
-
-void vlog(const char *format, va_list ap)
-{
- vfprintf(stdout, format, ap);
- fflush(stdout);
-
- if (log_fd)
- {
- vfprintf(log_fd, format, ap);
- fflush(log_fd);
- }
-}
-
-/******************************************************************************
-
- log()
-
- Log the message.
-
-******************************************************************************/
-
-void mlog(const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
-
- vlog(format, ap);
-
- va_end(ap);
-}
-
-/******************************************************************************
-
- log_info()
-
- Log the given information.
-
-******************************************************************************/
-
-void log_info(const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
-
- mlog("-- INFO : ");
- vlog(format, ap);
- mlog("\n");
-
- va_end(ap);
-}
-
-/******************************************************************************
-
- log_error()
-
- Log the given error.
-
-******************************************************************************/
-
-void log_error(const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
-
- mlog("-- ERROR: ");
- vlog(format, ap);
- mlog("\n");
-
- va_end(ap);
-}
-
-/******************************************************************************
-
- log_errno()
-
- Log the given error and errno.
-
-******************************************************************************/
-
-void log_errno(const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
-
- mlog("-- ERROR: (%003u) ", errno);
- vlog(format, ap);
- mlog("\n");
-
- va_end(ap);
-}
-
-/******************************************************************************
-
- die()
-
- Exit the application.
-
-******************************************************************************/
-
-void die(const char *msg)
-{
- log_error(msg);
-#ifdef __NETWARE__
- pressanykey();
-#endif
- exit(-1);
-}
-
-/******************************************************************************
-
- setup()
-
- Setup the mysql test enviornment.
-
-******************************************************************************/
-
-void setup(char *file __attribute__((unused)))
-{
- char temp[FN_REFLEN];
-#if defined(__WIN__) || defined(__NETWARE__)
- char file_path[FN_REFLEN*2];
-#endif
- char *p;
- int position;
-
- /* set the timezone for the timestamp test */
-#ifdef __WIN__
- _putenv( "TZ=GMT-3" );
-#else
- putenv((char *)"TZ=GMT-3");
-#endif
- /* find base dir */
-#ifdef __NETWARE__
- strcpy(temp, strlwr(file));
- while ((p= strchr(temp, '\\')) != NULL) *p= '/';
-#else
- getcwd(temp, FN_REFLEN);
- position= strlen(temp);
- temp[position]= '/';
- temp[position+1]= 0;
-#ifdef __WIN__
- while ((p= strchr(temp, '\\')) != NULL) *p= '/';
-#endif
-#endif
-
- if ((position= strinstr(temp, "/mysql-test/")) != 0)
- {
- p= temp + position - 1;
- *p= 0;
- strcpy(base_dir, temp);
- }
-
- log_info("Currect directory: %s",base_dir);
-
-#ifdef __NETWARE__
- /* setup paths */
- snprintf(bin_dir, FN_REFLEN, "%s/bin", base_dir);
- snprintf(mysql_test_dir, FN_REFLEN, "%s/mysql-test", base_dir);
- snprintf(test_dir, FN_REFLEN, "%s/t", mysql_test_dir);
- snprintf(mysql_tmp_dir, FN_REFLEN, "%s/var/tmp", mysql_test_dir);
- snprintf(result_dir, FN_REFLEN, "%s/r", mysql_test_dir);
- snprintf(master_dir, FN_REFLEN, "%s/var/master-data", mysql_test_dir);
- snprintf(slave_dir, FN_REFLEN, "%s/var/slave-data", mysql_test_dir);
- snprintf(lang_dir, FN_REFLEN, "%s/share/english", base_dir);
- snprintf(char_dir, FN_REFLEN, "%s/share/charsets", base_dir);
-
-#ifdef HAVE_OPENSSL
- use_openssl= TRUE;
-#endif /* HAVE_OPENSSL */
-
- /* OpenSSL paths */
- snprintf(ca_cert, FN_REFLEN, "%s/std_data/cacert.pem", mysql_test_dir);
- snprintf(server_cert, FN_REFLEN, "%s/std_data/server-cert.pem", mysql_test_dir);
- snprintf(server_key, FN_REFLEN, "%s/std_data/server-key.pem", mysql_test_dir);
- snprintf(client_cert, FN_REFLEN, "%s/std_data/client-cert.pem", mysql_test_dir);
- snprintf(client_key, FN_REFLEN, "%s/std_data/client-key.pem", mysql_test_dir);
-
- /* setup files */
- snprintf(mysqld_file, FN_REFLEN, "%s/mysqld", bin_dir);
- snprintf(mysqltest_file, FN_REFLEN, "%s/mysqltest", bin_dir);
- snprintf(mysqladmin_file, FN_REFLEN, "%s/mysqladmin", bin_dir);
- snprintf(master_pid, FN_REFLEN, "%s/var/run/master.pid", mysql_test_dir);
- snprintf(slave_pid, FN_REFLEN, "%s/var/run/slave.pid", mysql_test_dir);
-#elif __WIN__
- /* setup paths */
-#ifdef _DEBUG
- snprintf(bin_dir, FN_REFLEN, "%s/client_debug", base_dir);
-#else
- snprintf(bin_dir, FN_REFLEN, "%s/client_release", base_dir);
-#endif
- snprintf(mysql_test_dir, FN_REFLEN, "%s/mysql-test", base_dir);
- snprintf(test_dir, FN_REFLEN, "%s/t", mysql_test_dir);
- snprintf(mysql_tmp_dir, FN_REFLEN, "%s/var/tmp", mysql_test_dir);
- snprintf(result_dir, FN_REFLEN, "%s/r", mysql_test_dir);
- snprintf(master_dir, FN_REFLEN, "%s/var/master-data", mysql_test_dir);
- snprintf(slave_dir, FN_REFLEN, "%s/var/slave-data", mysql_test_dir);
- snprintf(lang_dir, FN_REFLEN, "%s/share/english", base_dir);
- snprintf(char_dir, FN_REFLEN, "%s/share/charsets", base_dir);
-
-#ifdef HAVE_OPENSSL
- use_openssl= TRUE;
-#endif /* HAVE_OPENSSL */
-
- /* OpenSSL paths */
- snprintf(ca_cert, FN_REFLEN, "%s/std_data/cacert.pem", mysql_test_dir);
- snprintf(server_cert, FN_REFLEN, "%s/std_data/server-cert.pem", mysql_test_dir);
- snprintf(server_key, FN_REFLEN, "%s/std_data/server-key.pem", mysql_test_dir);
- snprintf(client_cert, FN_REFLEN, "%s/std_data/client-cert.pem", mysql_test_dir);
- snprintf(client_key, FN_REFLEN, "%s/std_data/client-key.pem", mysql_test_dir);
-
- /* setup files */
-#ifdef _DEBUG
- snprintf(mysqld_file, FN_REFLEN, "%s/mysqld-debug.exe", bin_dir);
-#else
- snprintf(mysqld_file, FN_REFLEN, "%s/mysqld.exe", bin_dir);
-#endif
- snprintf(mysqltest_file, FN_REFLEN, "%s/mysqltest.exe", bin_dir);
- snprintf(mysqladmin_file, FN_REFLEN, "%s/mysqladmin.exe", bin_dir);
-#else
- /* setup paths */
- snprintf(bin_dir, FN_REFLEN, "%s/client", base_dir);
- snprintf(mysql_test_dir, FN_REFLEN, "%s/mysql-test", base_dir);
- snprintf(test_dir, FN_REFLEN, "%s/t", mysql_test_dir);
- snprintf(mysql_tmp_dir, FN_REFLEN, "%s/var/tmp", mysql_test_dir);
- snprintf(result_dir, FN_REFLEN, "%s/r", mysql_test_dir);
- snprintf(master_dir, FN_REFLEN, "%s/var/master-data", mysql_test_dir);
- snprintf(slave_dir, FN_REFLEN, "%s/var/slave-data", mysql_test_dir);
- snprintf(slave1_dir, FN_REFLEN, "%s/var/slave1-data", mysql_test_dir);
- snprintf(slave2_dir, FN_REFLEN, "%s/var/slave2-data", mysql_test_dir);
- snprintf(lang_dir, FN_REFLEN, "%s/sql/share/english", base_dir);
- snprintf(char_dir, FN_REFLEN, "%s/sql/share/charsets", base_dir);
-
-#ifdef HAVE_OPENSSL
- use_openssl= TRUE;
-#endif /* HAVE_OPENSSL */
-
- /* OpenSSL paths */
- snprintf(ca_cert, FN_REFLEN, "%s/std_data/cacert.pem", mysql_test_dir);
- snprintf(server_cert, FN_REFLEN, "%s/std_data/server-cert.pem", mysql_test_dir);
- snprintf(server_key, FN_REFLEN, "%s/std_data/server-key.pem", mysql_test_dir);
- snprintf(client_cert, FN_REFLEN, "%s/std_data/client-cert.pem", mysql_test_dir);
- snprintf(client_key, FN_REFLEN, "%s/std_data/client-key.pem", mysql_test_dir);
-
- /* setup files */
- snprintf(mysqld_file, FN_REFLEN, "%s/sql/mysqld", base_dir);
- snprintf(mysqltest_file, FN_REFLEN, "%s/mysqltest", bin_dir);
- snprintf(mysqladmin_file, FN_REFLEN, "%s/mysqladmin", bin_dir);
- snprintf(master_pid, FN_REFLEN, "%s/var/run/master.pid", mysql_test_dir);
- snprintf(slave_pid, FN_REFLEN, "%s/var/run/slave.pid", mysql_test_dir);
-
- snprintf(master_socket,FN_REFLEN, "%s/var/tmp/master.sock", mysql_test_dir);
- snprintf(slave_socket,FN_REFLEN, "%s/var/tmp/slave.sock", mysql_test_dir);
-
-#endif
- /* create log file */
- snprintf(temp, FN_REFLEN, "%s/mysql-test-run.log", mysql_test_dir);
- if ((log_fd= fopen(temp, "w+")) == NULL)
- {
- log_errno("Unable to create log file.");
- }
-
- /* prepare skip test list */
- while ((p= strchr(skip_test, ',')) != NULL) *p= ' ';
- strcpy(temp, strlwr(skip_test));
- snprintf(skip_test, FN_REFLEN, " %s ", temp);
-
- /* environment */
-#ifdef __NETWARE__
- setenv("MYSQL_TEST_DIR", mysql_test_dir, 1);
- snprintf(file_path, FN_REFLEN*2,
- "%s/client/mysqldump --no-defaults -u root --port=%u",
- bin_dir, master_port);
- setenv("MYSQL_DUMP", file_path, 1);
- snprintf(file_path, FN_REFLEN*2,
- "%s/client/mysqlbinlog --no-defaults --local-load=%s",
- bin_dir, mysql_tmp_dir);
- setenv("MYSQL_BINLOG", file_path, 1);
-#elif __WIN__
- snprintf(file_path,FN_REFLEN,"MYSQL_TEST_DIR=%s",mysql_test_dir);
- _putenv(file_path);
- snprintf(file_path, FN_REFLEN*2,
- "MYSQL_DUMP=%s/mysqldump.exe --no-defaults -uroot --port=%u",
- bin_dir, master_port);
- _putenv(file_path);
- snprintf(file_path, FN_REFLEN*2,
- "MYSQL_BINLOG=%s/mysqlbinlog.exe --no-defaults --local-load=%s",
- bin_dir, mysql_tmp_dir);
- _putenv(file_path);
-
- snprintf(file_path, FN_REFLEN*2,
- "TESTS_BINDIR=%s/tests", base_dir);
- _putenv(file_path);
-
- snprintf(file_path, FN_REFLEN*2,
- "CHARSETSDIR=%s/sql/share/charsets", base_dir);
- _putenv(file_path);
-
- snprintf(file_path, FN_REFLEN*2,
- "MYSQL=%s/mysql --port=%u ",
- bin_dir, master_port);
- _putenv(file_path);
-
- snprintf(file_path, FN_REFLEN*2,
- "MYSQL_FIX_SYSTEM_TABLES=%s/scripts/mysql_fix_privilege_tables --no-defaults "
- "--host=localhost --port=%u "
- "--basedir=%s --bindir=%s --verbose",
- base_dir,master_port, base_dir, bin_dir);
- _putenv(file_path);
-
- snprintf(file_path, FN_REFLEN*2,
- "NDB_TOOLS_DIR=%s/ndb/tools", base_dir);
- _putenv(file_path);
-
- snprintf(file_path, FN_REFLEN*2,
- "CLIENT_BINDIR=%s", bin_dir);
- _putenv(file_path);
-
- snprintf(file_path, FN_REFLEN*2,
- "MYSQL_CLIENT_TEST=%s/tests/mysql_client_test --no-defaults --testcase "
- "--user=root --port=%u --silent",
- base_dir, master_port);
- _putenv(file_path);
-
-#else
- {
- static char env_MYSQL_TEST_DIR[FN_REFLEN*2];
- static char env_MYSQL_DUMP[FN_REFLEN*2];
- static char env_MYSQL_BINLOG[FN_REFLEN*2];
- static char env_MASTER_MYSOCK[FN_REFLEN*2];
- static char env_TESTS_BINDIR[FN_REFLEN*2];
- static char env_CHARSETSDIR[FN_REFLEN*2];
- static char env_MYSQL[FN_REFLEN*2];
- static char env_MYSQL_FIX_SYSTEM_TABLES[FN_REFLEN*2];
- static char env_CLIENT_BINDIR[FN_REFLEN*2];
- static char env_MYSQL_CLIENT_TEST[FN_REFLEN*2];
- static char env_NDB_TOOLS_DIR[FN_REFLEN*2];
- static char env_NDB_MGM[FN_REFLEN*2];
- static char env_NDB_BACKUP_DIR[FN_REFLEN*2];
- static char env_NDB_TOOLS_OUTPUT[FN_REFLEN*2];
-
- snprintf(env_MYSQL_TEST_DIR,FN_REFLEN*2,
- "MYSQL_TEST_DIR=%s",mysql_test_dir);
- putenv(env_MYSQL_TEST_DIR);
-
- snprintf(env_MYSQL_DUMP, FN_REFLEN*2,"MYSQL_DUMP=%s/mysqldump --no-defaults "
- "-uroot --port=%u --socket=%s ",
- bin_dir, master_port, master_socket);
- putenv(env_MYSQL_DUMP);
-
- snprintf(env_MYSQL_BINLOG, FN_REFLEN*2,
- "MYSQL_BINLOG=%s/mysqlbinlog --no-defaults --local-load=%s -uroot ",
- bin_dir, mysql_tmp_dir);
- putenv(env_MYSQL_BINLOG);
-
- snprintf(env_MASTER_MYSOCK, FN_REFLEN*2,
- "MASTER_MYSOCK=%s", master_socket);
- putenv(env_MASTER_MYSOCK);
-
- snprintf(env_TESTS_BINDIR, FN_REFLEN*2,
- "TESTS_BINDIR=%s/tests", base_dir);
- putenv(env_TESTS_BINDIR);
-
- snprintf(env_CHARSETSDIR, FN_REFLEN*2,
- "CHARSETSDIR=%s/sql/share/charsets", base_dir);
- putenv(env_CHARSETSDIR);
-
- snprintf(env_MYSQL, FN_REFLEN*2,
- "MYSQL=%s/mysql --port=%u --socket=%s -uroot ",
- bin_dir, master_port, master_socket);
- putenv(env_MYSQL);
-
- snprintf(env_MYSQL_FIX_SYSTEM_TABLES, FN_REFLEN*2,
- "MYSQL_FIX_SYSTEM_TABLES=%s/scripts/mysql_fix_privilege_tables --no-defaults "
- "--host=localhost --port=%u --socket=%s "
- "--basedir=%s --bindir=%s --verbose -uroot ",
- base_dir,master_port, master_socket, base_dir, bin_dir);
- putenv(env_MYSQL_FIX_SYSTEM_TABLES);
-
-
- snprintf(env_CLIENT_BINDIR, FN_REFLEN*2,
- "CLIENT_BINDIR=%s", bin_dir);
- putenv(env_CLIENT_BINDIR);
-
- snprintf(env_MYSQL_CLIENT_TEST, FN_REFLEN*2,
- "MYSQL_CLIENT_TEST=%s/tests/mysql_client_test --no-defaults --testcase "
- "--user=root --socket=%s --port=%u --silent",
- base_dir, master_socket, master_port);
- putenv(env_MYSQL_CLIENT_TEST);
-
- // NDB
-
- snprintf(env_NDB_TOOLS_DIR, FN_REFLEN*2,
- "NDB_TOOLS_DIR=%s/ndb/tools", base_dir);
- putenv(env_NDB_TOOLS_DIR);
-
- snprintf(env_NDB_MGM, FN_REFLEN*2,
- "NDB_MGM=%s/ndb/src/mgmclient/ndb_mgm", base_dir);
- putenv(env_NDB_MGM);
-
- //NDBCLUSTER_PORT=9350
- snprintf(env_NDB_BACKUP_DIR, FN_REFLEN*2,
- "NDB_BACKUP_DIR=%s/var/ndbcluster-%i", mysql_test_dir, 9350);
- putenv(env_NDB_BACKUP_DIR);
-
- snprintf(env_NDB_TOOLS_OUTPUT, FN_REFLEN*2,
- "NDB_TOOLS_OUTPUT=%s/var/log/ndb_tools.log", mysql_test_dir);
- putenv(env_NDB_TOOLS_OUTPUT);
-
- putenv((char *)"NDB_STATUS_OK=1");
-
-// NDB_MGM="$BASEDIR/ndb/src/mgmclient/ndb_mgm"
-// NDB_BACKUP_DIR=$MYSQL_TEST_DIR/var/ndbcluster-$NDBCLUSTER_PORT
-// NDB_TOOLS_OUTPUT=$MYSQL_TEST_DIR/var/log/ndb_tools.log
- }
-
-#endif
-
-#ifndef __WIN__
- putenv((char *)"MASTER_MYPORT=9306");
- putenv((char *)"SLAVE_MYPORT=9307");
- putenv((char *)"MYSQL_TCP_PORT=3306");
-
-#else
- _putenv("MASTER_MYPORT=9306");
- _putenv("SLAVE_MYPORT=9307");
- _putenv("MYSQL_TCP_PORT=3306");
-#endif
-
-}
-
-/*
- Compare names of testes for right order
-*/
-int compare( const void *arg1, const void *arg2 )
-{
- return sting_compare_func( * ( char** ) arg1, * ( char** ) arg2 );
-}
-
-
-
-/******************************************************************************
-
- main()
-
-******************************************************************************/
-
-int main(int argc, char **argv)
-{
- int is_ignore_list= 0;
- char **names= 0;
- char **testes= 0;
- int name_index;
- int index;
- char var_dir[FN_REFLEN];
- /* setup */
- setup(argv[0]);
-
- /* delete all file in var */
- snprintf(var_dir,FN_REFLEN,"%s/var",mysql_test_dir);
- del_tree(var_dir);
-
- /*
- The --ignore option is comma saperated list of test cases to skip and
- should be very first command line option to the test suite.
-
- The usage is now:
- mysql_test_run --ignore=test1,test2 test3 test4
- where test1 and test2 are test cases to ignore
- and test3 and test4 are test cases to run.
- */
- if (argc >= 2 && !strnicmp(argv[1], "--ignore=", sizeof("--ignore=")-1))
- {
- char *temp, *token;
- temp= strdup(strchr(argv[1],'=') + 1);
- for (token=str_tok(argument, temp, ","); token != NULL;
- token=str_tok(argument, NULL, ","))
- {
- if (strlen(ignore_test) + strlen(token) + 2 <= FN_REFLEN-1)
- sprintf(ignore_test+strlen(ignore_test), " %s ", token);
- else
- {
- free(temp);
- die("ignore list too long.");
- }
- }
- free(temp);
- is_ignore_list= 1;
- }
- /* header */
-#ifndef __WIN__
- mlog("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE);
-#else
- mlog("MySQL Server ---, for %s (%s)\n\n", SYSTEM_TYPE, MACHINE_TYPE);
-#endif
-
- mlog("Initializing Tests...\n");
-
- /* install test databases */
- mysql_install_db();
-
- mlog("Starting Tests...\n");
-
- mlog("\n");
- mlog(HEADER);
- mlog(DASH);
-
- if ( argc > 1 + is_ignore_list )
- {
- int i;
-
- /* single test */
- single_test= TRUE;
-
- for (i= 1 + is_ignore_list; i < argc; i++)
- {
- /* run given test */
- run_test(argv[i]);
- }
- }
- else
- {
- /* run all tests */
- testes= malloc(MAX_COUNT_TESTES*sizeof(void*));
- if (!testes)
- die("can not allcate memory for sorting");
- names= testes;
- name_index= 0;
-#ifndef __WIN__
- struct dirent *entry;
- DIR *parent;
- char test[FN_LEN];
- int position;
-
- /* FIXME are we sure the list is sorted if using readdir()? */
- if ((parent= opendir(test_dir)) == NULL) /* Not thread safe */
- die("Unable to open tests directory.");
- else
- {
- while ((entry= readdir(parent)) != NULL) /* Not thread safe */
- {
- strcpy(test, strlwr(entry->d_name));
- /* find the test suffix */
- if ((position= strinstr(test, TEST_SUFFIX)) != 0)
- {
- if (name_index < MAX_COUNT_TESTES)
- {
- /* null terminate at the suffix */
- *(test + position - 1)= '\0';
- /* insert test */
- *names= malloc(FN_REFLEN);
- strcpy(*names,test);
- names++;
- name_index++;
- }
- else
- die("can not sort files, array is overloaded");
- }
- }
- closedir(parent);
- }
-#else
- {
- struct _finddata_t dir;
- int* handle;
- char test[FN_LEN];
- char mask[FN_REFLEN];
- int position;
-
- /* single test */
- single_test= FALSE;
-
- snprintf(mask,FN_REFLEN,"%s/*.test",test_dir);
-
- if ((handle=_findfirst(mask,&dir)) == -1L)
- {
- die("Unable to open tests directory.");
- }
-
-
- do
- {
- if (!(dir.attrib & _A_SUBDIR))
- {
- strcpy(test, strlwr(dir.name));
-
- /* find the test suffix */
- if ((position= strinstr(test, TEST_SUFFIX)) != 0)
- {
- if (name_index < MAX_COUNT_TESTES)
- {
- /* null terminate at the suffix */
- *(test + position - 1)= '\0';
- /* insert test */
- *names= malloc(FN_REFLEN);
- strcpy(*names,test);
- names++;
- name_index++;
- }
- else
- die("can not sort files, array is overloaded");
- }
- }
- }while (_findnext(handle,&dir) == 0);
-
- _findclose(handle);
- }
-#endif
- qsort( (void *)testes, name_index, sizeof( char * ), compare );
-
- for (index= 0; index < name_index; index++)
- {
- run_test(testes[index]);
- free(testes[index]);
- }
-
- free(testes);
- }
-
- /* stop server */
- mysql_stop();
-
- mlog(DASH);
- mlog("\n");
-
- mlog("Ending Tests...\n");
-
- /* report stats */
- report_stats();
-
- /* close log */
- if (log_fd) fclose(log_fd);
-
- /* keep results up */
-#ifdef __NETWARE__
- pressanykey();
-#endif
- return 0;
-}
-
-
-/*
- Synopsis:
- This function breaks the string into a sequence of tokens. The difference
- between this function and strtok is that it respects the quoted string i.e.
- it skips any delimiter character within the quoted part of the string.
- It return tokens by eliminating quote character. It modifies the input string
- passed. It will work with whitespace delimeter but may not work properly with
- other delimeter. If the delimeter will contain any quote character, then
- function will not tokenize and will return null string.
- e.g. if input string is
- --init-slave="set global max_connections=500" --skip-external-locking
- then the output will two string i.e.
- --init-slave=set global max_connections=500
- --skip-external-locking
-
-Arguments:
- string: input string
- delim: set of delimiter character
-Output:
- return the null terminated token of NULL.
-*/
-char *str_tok(char* dest, char *string, const char *delim)
-{
- char *token;
- char *ptr_end_token= NULL;
- char *ptr_quote= NULL;
- char *ptr_token= NULL;
- int count_quotes= 0;
-
- *dest = '\0';
- if (strchr(delim,'\'') || strchr(delim,'\"'))
- return NULL;
-
- token= (char*)strtok(string, delim);
- if (token)
- {
- /* double quote is found */
- if (strchr(token,'\"'))
- {
- do
- {
- if (count_quotes & 1)
- {
- if (*dest == '\0')
- sprintf(dest,"%s", ptr_token);
- else
- sprintf(dest,"%s %s", dest, ptr_token);
- ptr_token= (char*)strtok(NULL, delim);
- if (!ptr_token)
- break;
- }
- else
- {
- ptr_token= token;
- }
- if (ptr_quote = strchr(ptr_token,'\"'))
- {
- ptr_end_token= ptr_token + strlen(ptr_token);
- do
- {
-#ifndef __WIN__
- bmove(ptr_quote, ptr_quote+1, ptr_end_token - ptr_quote);
-#endif
- count_quotes++;
- } while (ptr_quote != NULL && (ptr_quote = strchr(ptr_quote+1,'\"')));
- }
- /* there are unpair quotes we have to search next quote*/
- } while (count_quotes & 1);
- if (ptr_token != NULL)
- {
- if (*dest == '\0')
- sprintf(dest,"%s", ptr_token);
- else
- sprintf(dest,"%s %s",dest,ptr_token);
- }
- }
- else
- {
- sprintf(dest,"%s",token);
- }
- }
- return token ? dest : NULL;
-}
-
-#ifndef __WIN__
-/*
- Synopsis:
- This function run scripts files on Linux and Netware
-
-Arguments:
- script_name: name of script file
-
-Output:
- nothing
-*/
-
-void run_init_script(const char *script_name)
-{
- arg_list_t al;
- int err;
-
- /* args */
- init_args(&al);
- add_arg(&al, sh_file);
- add_arg(&al, script_name);
-
- /* spawn */
- if ((err= spawn(sh_file, &al, TRUE, NULL, NULL, NULL, NULL)) != 0)
- {
- die("Unable to run script.");
- }
-
- /* free args */
- free_args(&al);
-}
-#endif
diff --git a/mysql-test/std_data/cacert.pem b/mysql-test/std_data/cacert.pem
new file mode 100644
index 00000000000..a63dae57767
--- /dev/null
+++ b/mysql-test/std_data/cacert.pem
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDcTCCAtqgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBiDELMAkGA1UEBhMCU0Ux
+EDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCMSEwHwYDVQQDExhB
+YnN0cmFjdCBNeVNRTCBEZXZlbG9wZXIxMTAvBgkqhkiG9w0BCQEWImFic3RyYWN0
+Lm15c3FsLmRldmVsb3BlckBteXNxbC5jb20wHhcNMDMwOTEyMTYxNDE2WhcNMTMw
+OTA5MTYxNDE2WjCBiDELMAkGA1UEBhMCU0UxEDAOBgNVBAcTB1VwcHNhbGExETAP
+BgNVBAoTCE15U1FMIEFCMSEwHwYDVQQDExhBYnN0cmFjdCBNeVNRTCBEZXZlbG9w
+ZXIxMTAvBgkqhkiG9w0BCQEWImFic3RyYWN0Lm15c3FsLmRldmVsb3BlckBteXNx
+bC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKrT7zp5tp5djXp+TEQs
+5ZEds1XUglp/EQUQ1FMMb1Xe6gqJsQ62O+jsUe0nrUjXBrUCUy49k6mcnmQtZREj
+l1pWKmzx1fgcYpxTwxaY7IKB2jik5IWprhVPmSQ+AWss43oolXMZWR+csKehqm3j
++YNZc9NsR4ydE71l0VEtJEQvAgMBAAGjgegwgeUwHQYDVR0OBBYEFIiYZdnz8osD
+HWZgYSP6rXNt02iSMIG1BgNVHSMEga0wgaqAFIiYZdnz8osDHWZgYSP6rXNt02iS
+oYGOpIGLMIGIMQswCQYDVQQGEwJTRTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UE
+ChMITXlTUUwgQUIxITAfBgNVBAMTGEFic3RyYWN0IE15U1FMIERldmVsb3BlcjEx
+MC8GCSqGSIb3DQEJARYiYWJzdHJhY3QubXlzcWwuZGV2ZWxvcGVyQG15c3FsLmNv
+bYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4GBAGIL22MCIU/0sKDp
+pZIhoabvNVDTfuhtene+WBCrzCzGXPZjB4+b/KAJJNvOR4zi43Kk7euu+PENs9M7
+nKpInMdhvT1RcCnUHJ3jBCvDDzXab2msqn3rxhwetWWbfE0OeEn/PoQcwiZCe7x5
+h+Zz+oUbvsEe4DjtDVgG4UH9nSSS
+-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/client-cert.pem b/mysql-test/std_data/client-cert.pem
new file mode 100644
index 00000000000..4c81162c911
--- /dev/null
+++ b/mysql-test/std_data/client-cert.pem
@@ -0,0 +1,67 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 1 (0x1)
+ Signature Algorithm: md5WithRSAEncryption
+ Issuer: C=SE, L=Uppsala, O=MySQL AB, CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com
+ Validity
+ Not Before: Sep 12 16:21:19 2003 GMT
+ Not After : Sep 9 16:21:19 2013 GMT
+ Subject: C=SE, L=Uppsala, O=MySQL AB, CN=MySQL Client/Email=abstract.mysql.developer@mysql.com
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:c4:03:0a:ee:e3:b1:12:fc:ee:b4:19:f4:e1:60:
+ 1d:e0:28:c3:96:2d:df:82:69:cd:74:7c:54:58:d0:
+ ae:b3:59:3f:0c:19:1c:99:10:a6:12:c9:cf:3a:64:
+ 05:43:8e:bf:d2:65:36:80:91:0b:65:b0:27:26:38:
+ c9:23:d8:36:a2:4a:f0:f7:c0:2f:68:38:70:01:27:
+ 29:ff:b2:c5:52:e1:6b:f1:c8:d7:c3:5c:ee:f0:37:
+ 6c:2a:9b:96:1a:05:9e:eb:33:a2:39:5a:77:66:62:
+ 27:75:1f:2f:6f:38:da:e5:9f:78:af:ca:6b:22:3f:
+ 57:2b:bc:a6:8f:47:d1:99:6f
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Basic Constraints:
+ CA:FALSE
+ Netscape Comment:
+ OpenSSL Generated Certificate
+ X509v3 Subject Key Identifier:
+ 80:81:A9:22:EB:AB:D6:CA:7E:3F:8D:BB:D1:AC:2A:F4:87:9D:13:29
+ X509v3 Authority Key Identifier:
+ keyid:88:98:65:D9:F3:F2:8B:03:1D:66:60:61:23:FA:AD:73:6D:D3:68:92
+ DirName:/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com
+ serial:00
+
+ Signature Algorithm: md5WithRSAEncryption
+ 86:17:1c:f3:9f:10:1b:75:47:03:ca:54:ea:ef:f7:15:54:8d:
+ 8f:58:c9:64:7d:de:2e:bf:ea:a6:5d:72:56:c9:81:be:bb:1c:
+ 78:a5:91:d6:f8:77:df:9d:d2:cb:94:d9:06:61:4f:05:21:22:
+ 2a:ea:9e:c3:8b:4d:fe:94:c7:98:61:cd:7e:88:19:c9:92:01:
+ 1f:10:5b:c6:16:95:99:9b:32:01:3a:89:df:fa:0a:89:ac:fa:
+ b5:40:55:7a:ca:0a:bd:5d:8b:06:d8:7e:e1:44:8c:70:c8:63:
+ c7:77:6a:37:3d:a4:ac:57:dc:00:c1:c1:f3:72:17:5b:50:95:
+ ee:b7
+-----BEGIN CERTIFICATE-----
+MIIDkTCCAvqgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBiDELMAkGA1UEBhMCU0Ux
+EDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCMSEwHwYDVQQDExhB
+YnN0cmFjdCBNeVNRTCBEZXZlbG9wZXIxMTAvBgkqhkiG9w0BCQEWImFic3RyYWN0
+Lm15c3FsLmRldmVsb3BlckBteXNxbC5jb20wHhcNMDMwOTEyMTYyMTE5WhcNMTMw
+OTA5MTYyMTE5WjB8MQswCQYDVQQGEwJTRTEQMA4GA1UEBxMHVXBwc2FsYTERMA8G
+A1UEChMITXlTUUwgQUIxFTATBgNVBAMTDE15U1FMIENsaWVudDExMC8GCSqGSIb3
+DQEJARYiYWJzdHJhY3QubXlzcWwuZGV2ZWxvcGVyQG15c3FsLmNvbTCBnzANBgkq
+hkiG9w0BAQEFAAOBjQAwgYkCgYEAxAMK7uOxEvzutBn04WAd4CjDli3fgmnNdHxU
+WNCus1k/DBkcmRCmEsnPOmQFQ46/0mU2gJELZbAnJjjJI9g2okrw98AvaDhwAScp
+/7LFUuFr8cjXw1zu8DdsKpuWGgWe6zOiOVp3ZmIndR8vbzja5Z94r8prIj9XK7ym
+j0fRmW8CAwEAAaOCARQwggEQMAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9w
+ZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBSAgaki66vWyn4/
+jbvRrCr0h50TKTCBtQYDVR0jBIGtMIGqgBSImGXZ8/KLAx1mYGEj+q1zbdNokqGB
+jqSBizCBiDELMAkGA1UEBhMCU0UxEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoT
+CE15U1FMIEFCMSEwHwYDVQQDExhBYnN0cmFjdCBNeVNRTCBEZXZlbG9wZXIxMTAv
+BgkqhkiG9w0BCQEWImFic3RyYWN0Lm15c3FsLmRldmVsb3BlckBteXNxbC5jb22C
+AQAwDQYJKoZIhvcNAQEEBQADgYEAhhcc858QG3VHA8pU6u/3FVSNj1jJZH3eLr/q
+pl1yVsmBvrsceKWR1vh3353Sy5TZBmFPBSEiKuqew4tN/pTHmGHNfogZyZIBHxBb
+xhaVmZsyATqJ3/oKiaz6tUBVesoKvV2LBth+4USMcMhjx3dqNz2krFfcAMHB83IX
+W1CV7rc=
+-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/client-key.pem b/mysql-test/std_data/client-key.pem
new file mode 100644
index 00000000000..58fa805e620
--- /dev/null
+++ b/mysql-test/std_data/client-key.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQDEAwru47ES/O60GfThYB3gKMOWLd+Cac10fFRY0K6zWT8MGRyZ
+EKYSyc86ZAVDjr/SZTaAkQtlsCcmOMkj2DaiSvD3wC9oOHABJyn/ssVS4WvxyNfD
+XO7wN2wqm5YaBZ7rM6I5WndmYid1Hy9vONrln3ivymsiP1crvKaPR9GZbwIDAQAB
+AoGAcR7IaoGhKbIrGGl6d67+zuT3q24h9aOV3Mn7653TlNHGnvbHGFcRYPpyy+H5
+X7m8XnHm+F+80hzNGzPecP9Q12oPOyoZgeQn6bTK73OFkNcX7FAkNdyH4xVhf2aK
+YOzTcQfq3gRCqXtVIg4qBShTMjJLE31R8H430Or62XmJgFECQQDjP+Kz+ecQwuTB
+HADLm+GQgceIB1kLgdQoZ3deUxGvqtVImuDRViSM0F2srfJ4GfkEDhc27UI5f6ir
+ZTOw4ww7AkEA3M9wCPgWNtbOXbYjaNA0IzHcjMDxQDVvJAmb3EiZlKQp4EfrESxR
+ly/u08TyfwrK6q5WS7xE0ad8+95G1af4XQJBAI9+3ME20SB1YItMCniHYwSj3oHX
+2fN5NKWax/Zoz+c0IV+qZMHq+kNso2oRoOUTyXk1CJWndcTnBnPMALr2c9cCQQCZ
+VL7Cq6uZVx6kemcqUHH0AprZbt3YLYLI7pc5p3xmeHzPzoEQQstBhjp8+aU+zPrN
+blRkcQ8E2x5yNA7SLLrNAkAhzkA+EK8hc0f9W3ncy+py0Rn0i5Ay0N3T715vkThf
+CfOHE3L91dLlmYpL5xVqOpugY/2sHyxwctv97DgS6tHZ
+-----END RSA PRIVATE KEY-----
diff --git a/mysql-test/std_data/server-cert.pem b/mysql-test/std_data/server-cert.pem
new file mode 100644
index 00000000000..debf7026e3c
--- /dev/null
+++ b/mysql-test/std_data/server-cert.pem
@@ -0,0 +1,67 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 2 (0x2)
+ Signature Algorithm: md5WithRSAEncryption
+ Issuer: C=SE, L=Uppsala, O=MySQL AB, CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com
+ Validity
+ Not Before: Sep 12 16:22:06 2003 GMT
+ Not After : Sep 9 16:22:06 2013 GMT
+ Subject: C=SE, L=Uppsala, O=MySQL AB, CN=MySQL Server/Email=abstract.mysql.developer@mysql.com
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:e9:86:7a:55:84:88:4c:be:a4:f8:92:73:30:12:
+ 49:0b:7a:85:87:39:34:39:0d:7d:0b:8d:18:c2:17:
+ 95:13:52:d2:3f:55:10:57:c8:3f:5a:f5:b2:fa:8b:
+ d0:67:49:cc:aa:82:fc:9f:ce:00:b4:73:f3:36:d2:
+ 3a:d3:c2:b0:0e:14:c3:d4:b2:21:74:a1:f0:31:81:
+ 60:87:98:73:5c:10:c1:b1:1a:4d:f1:f3:b0:98:3f:
+ f0:d7:97:9b:2b:fd:d5:21:79:b2:2f:eb:64:15:c9:
+ 9b:9d:fc:9e:2d:d4:f8:04:5b:ea:a9:75:4b:42:c3:
+ 3d:0e:4d:2a:a8:b8:ca:99:8d
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Basic Constraints:
+ CA:FALSE
+ Netscape Comment:
+ OpenSSL Generated Certificate
+ X509v3 Subject Key Identifier:
+ 6E:E4:9B:6A:C5:EA:E4:E6:C7:EF:D7:1E:C8:63:45:60:2B:1B:D4:D4
+ X509v3 Authority Key Identifier:
+ keyid:88:98:65:D9:F3:F2:8B:03:1D:66:60:61:23:FA:AD:73:6D:D3:68:92
+ DirName:/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com
+ serial:00
+
+ Signature Algorithm: md5WithRSAEncryption
+ 31:77:69:b9:bd:ab:29:f3:fc:5a:09:16:6f:5d:42:ea:ba:01:
+ 55:69:e3:75:cf:b8:d1:b7:b9:bf:da:63:85:8c:48:92:06:60:
+ 76:97:e0:00:78:4b:ad:da:ab:6a:90:6d:8b:03:a8:b1:e9:09:
+ 78:e1:29:98:56:12:60:6b:42:fe:e8:a7:c4:f8:d6:15:07:e8:
+ 2b:c2:d8:8a:e5:1b:2e:51:08:9b:56:e3:b3:7a:4c:3e:e5:be:
+ 4a:4d:f8:65:7b:a8:21:e0:ca:fe:8b:ab:d7:ec:f2:2d:f7:d0:
+ bf:d7:c5:23:1c:08:d8:aa:57:c7:f3:5f:ba:33:3f:78:d1:f4:
+ 8e:5e
+-----BEGIN CERTIFICATE-----
+MIIDkTCCAvqgAwIBAgIBAjANBgkqhkiG9w0BAQQFADCBiDELMAkGA1UEBhMCU0Ux
+EDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCMSEwHwYDVQQDExhB
+YnN0cmFjdCBNeVNRTCBEZXZlbG9wZXIxMTAvBgkqhkiG9w0BCQEWImFic3RyYWN0
+Lm15c3FsLmRldmVsb3BlckBteXNxbC5jb20wHhcNMDMwOTEyMTYyMjA2WhcNMTMw
+OTA5MTYyMjA2WjB8MQswCQYDVQQGEwJTRTEQMA4GA1UEBxMHVXBwc2FsYTERMA8G
+A1UEChMITXlTUUwgQUIxFTATBgNVBAMTDE15U1FMIFNlcnZlcjExMC8GCSqGSIb3
+DQEJARYiYWJzdHJhY3QubXlzcWwuZGV2ZWxvcGVyQG15c3FsLmNvbTCBnzANBgkq
+hkiG9w0BAQEFAAOBjQAwgYkCgYEA6YZ6VYSITL6k+JJzMBJJC3qFhzk0OQ19C40Y
+wheVE1LSP1UQV8g/WvWy+ovQZ0nMqoL8n84AtHPzNtI608KwDhTD1LIhdKHwMYFg
+h5hzXBDBsRpN8fOwmD/w15ebK/3VIXmyL+tkFcmbnfyeLdT4BFvqqXVLQsM9Dk0q
+qLjKmY0CAwEAAaOCARQwggEQMAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9w
+ZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBRu5Jtqxerk5sfv
+1x7IY0VgKxvU1DCBtQYDVR0jBIGtMIGqgBSImGXZ8/KLAx1mYGEj+q1zbdNokqGB
+jqSBizCBiDELMAkGA1UEBhMCU0UxEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoT
+CE15U1FMIEFCMSEwHwYDVQQDExhBYnN0cmFjdCBNeVNRTCBEZXZlbG9wZXIxMTAv
+BgkqhkiG9w0BCQEWImFic3RyYWN0Lm15c3FsLmRldmVsb3BlckBteXNxbC5jb22C
+AQAwDQYJKoZIhvcNAQEEBQADgYEAMXdpub2rKfP8WgkWb11C6roBVWnjdc+40be5
+v9pjhYxIkgZgdpfgAHhLrdqrapBtiwOosekJeOEpmFYSYGtC/uinxPjWFQfoK8LY
+iuUbLlEIm1bjs3pMPuW+Sk34ZXuoIeDK/our1+zyLffQv9fFIxwI2KpXx/NfujM/
+eNH0jl4=
+-----END CERTIFICATE-----
diff --git a/mysql-test/std_data/server-key.pem b/mysql-test/std_data/server-key.pem
new file mode 100644
index 00000000000..4292dc79929
--- /dev/null
+++ b/mysql-test/std_data/server-key.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXgIBAAKBgQDphnpVhIhMvqT4knMwEkkLeoWHOTQ5DX0LjRjCF5UTUtI/VRBX
+yD9a9bL6i9BnScyqgvyfzgC0c/M20jrTwrAOFMPUsiF0ofAxgWCHmHNcEMGxGk3x
+87CYP/DXl5sr/dUhebIv62QVyZud/J4t1PgEW+qpdUtCwz0OTSqouMqZjQIDAQAB
+AoGBALTq11nrjIEQbdSZ+R1z/R0kddB2U+wjdA3/6P9tr7PBxVsFdtzbKaI5mcib
+iwCKX0J2qmrP+SHUdsexBZxLR4KV/Z55v9Pym99Dy+DxDA95zURyCMKRBIzlU5uN
+F7USEQoltLUCsmZwNWdit0gfxSWdddkHNuI0uxTzHwuDcUlNAkEA/76zVremngNL
+DlekM9NPn/8E/TXBHN1b1jdUKd7WymSJykdcm3viU98dFNZFWF8B0jiTcuBKXgpR
+vTShNab/swJBAOnCGp554BLhioTyyk8qjRLt3xEsjsDljJULHVLYWcUqIkMf97GL
+VLBhl6ZEI9i0WduqvgZ+Bacd0uHqIHz1Yb8CQQDm1CjqTDiGxlIoT9JVNJTZxEOs
+h6gVdXY+kxHT+N3FL5luiZp8fAR7zxVgiUVtzdLG+2madfapiobcT3RyCJkhAkBI
+64AaR7KasTjg2Ew7/e4cJZAcb2XozrLYG6t+GHeIhehCQEqoW+qDSy5fc4orI7eU
+SuMUa2OgCjGqv7p6wKFJAkEAznmum/MbVOBpC4FsdnIGkxyFKIbh2OLY2aUb2KkK
+Ouf4S8Y5Ldgszi0fnDPRaxWJzewwZKvcff2zj+mYZeAXbA==
+-----END RSA PRIVATE KEY-----