MySQL Community Edition jest bezpłatną wersją najpopularniejszego na świecie serwera baz danych, wspieraną przez aktywną społeczność developerów i entuzjastów open source.
Kompiluję najnowszą wersję z gałęzi 5.1, pomimo że dostępna jest już stabilna wersja 5.5 i rozwojowa 5.6. Wynika to z tego, że obecnie używamy wersji z gałęzi 5.0, a instrukcja upgradeu przewiduje stopniowe podnoszenie wersji, czyli najpierw do 5.1 a dopiero później do 5.5.
Poniżej zapis sesji konfiguracji i kompilacji MySQL 5.1.57. Skrypt do kompilacji w załączeniu.
soft@wega:~/mysql% ./drf_mysql-5.1.57_conf
cc: Sun C 5.10 SunOS_sparc 2009/06/03
usage: cc [ options] files. Use 'cc -flags' for details
MANPATH=/usr/local/share/man:/usr/local/man:/usr/share/man
PATH=/usr/local/bin:/usr/bin:/opt/SUNWspro/bin:/usr/ccs/bin
CFLAGS=-xO4 -mt -fsimple=1 -ftrap=%none -xbuiltin=%all -xlibmil -xlibmopt -xstrconst -xarch=native -I/usr/local/ssl/include -I/usr/local/include
CXXFLAGS=-xO3 -noex -mt -fsimple=1 -ftrap=%none -xbuiltin=%all -xlibmil -xlibmopt -xarch=native -I/usr/local/ssl/include -I/usr/local/include
LDFLAGS=-L/usr/local/ssl/lib -R/usr/local/ssl/lib -L/usr/local/lib -R/usr/local/lib
=============================================
dmake clean [y|n] ?
n
=============================================
Konfiguracja:
configure [y|n] ?
y
checking build system type... sparc-sun-solaris2.10
checking host system type... sparc-sun-solaris2.10
checking target system type... sparc-sun-solaris2.10
...
config.status: executing default commands
Thank you for choosing MySQL!
Remember to check the platform specific part of the reference manual
for hints about installing MySQL on your platform.
Also have a look at the files in the Docs directory.
=============================================
Kompilacja:
dmake [y|n] ?
y
Making all in .
Making all in include
dmake all-am
...
source='item_geofunc.cc' object='item_geofunc.o' libtool=no \
DEPDIR=.deps depmode=none /bin/bash ../depcomp \
CC -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr/local/mysql-5.1.57\"" -DMYSQL_DATADIR="\"/data/var/mysql\"" -DSHAREDIR="\"/usr/local/mysql-5.1.57/share/mysql\"" -DPLUGINDIR="\"/usr/local/mysql-5.1.57/lib/mysql/plugin\"" -DHAVE_EVENT_SCHEDULER -DHAVE_CONFIG_H -I. -I../include -I../include -I../include -I../regex -I. -I/usr/local/ssl/include -xO3 -noex -mt -fsimple=1 -ftrap=%none -xbuiltin=%all -xlibmil -xlibmopt -xarch=native -I/usr/local/ssl/include -I/usr/local/include -DHAVE_RWLOCK_T -c -o item_geofunc.o item_geofunc.cc
...
libtool: link: CC -xO3 -noex -mt -fsimple=1 -ftrap=%none -xbuiltin=%all -xlibmil -xlibmopt -xarch=native -I/usr/local/ssl/include -I/usr/local/include -DHAVE_RWLOCK_T -o mysqlmanager mysqlmanager-command.o mysqlmanager-mysqlmanager.o mysqlmanager-manager.o mysqlmanager-log.o mysqlmanager-thread_registry.o mysqlmanager-listener.o mysqlmanager-protocol.o mysqlmanager-mysql_connection.o mysqlmanager-user_map.o mysqlmanager-messages.o mysqlmanager-commands.o mysqlmanager-instance.o mysqlmanager-instance_map.o mysqlmanager-instance_options.o mysqlmanager-buffer.o mysqlmanager-parse.o mysqlmanager-guardian.o mysqlmanager-parse_output.o mysqlmanager-user_management_commands.o mysqlmanager-angel.o -L/usr/local/ssl/lib -L/usr/local/lib ./.libs/liboptions.a -lpthread -lthread -lpthread -lthread -lpthread -lthread -lpthread -lthread libnet.a ../../vio/libvio.a ../../mysys/libmysys.a ../../strings/libmystrings.a ../../dbug/libdbug.a -L/usr/local/ssl/lib/ -lssl -lcrypto -lz -lpthread -lthread -lposix4 -lsocket -lnsl -lm -lpthread -lthread -mt -R/usr/local/ssl/lib -R/usr/local/lib
Making all in win
Compilation successful
=============================================
Testowanie:
Test (dmake test) [y|n] ?
y
dmake force=--force test
cd unittest && dmake test
perl unit.pl run mytap mysys strings ../storage/archive ../storage/blackhole ../storage/csv ../storage/example ../storage/federated ../storage/heap ../storage/innobase ../storage/innodb_plugin ../storage/myisam ../storage/myisammrg ../plugin/daemon_example ../plugin/fulltext
Running tests: mytap mysys strings ../storage/archive ../storage/blackhole ../storage/csv ../storage/example ../storage/federated ../storage/heap ../storage/innobase ../storage/innodb_plugin ../storage/myisam ../storage/myisammrg ../plugin/daemon_example ../plugin/fulltext
mytap/t/basic-t.....ok
2/5 skipped: Sensa fragoli
mysys/base64-t......ok
mysys/bitmap-t......ok
strings/strings-t...ok
All tests successful, 2 subtests skipped.
Files=4, Tests=3029, 6 wallclock secs ( 5.58 cusr + 0.06 csys = 5.64 CPU)
cd mysql-test ; \
/usr/bin/perl ./mysql-test-run.pl --force --mysqld=--binlog-format=mixed
Logging: ./mysql-test-run.pl --force --mysqld=--binlog-format=mixed
110520 12:35:48 [Note] Plugin 'FEDERATED' is disabled.
MySQL Version 5.1.57
Using binlog format 'mixed'
Checking supported features...
- skipping ndbcluster
- SSL connections supported
Collecting tests...
- adding combinations for binlog
- adding combinations for rpl
vardir: /home/soft/mysql/mysql-5.1.57/mysql-test/var
Checking leftover processes...
Removing old var directory...
Creating var directory '/home/soft/mysql/mysql-5.1.57/mysql-test/var'...
Installing system database...
Using server port 41195
==============================================================================
TEST RESULT TIME (ms)
------------------------------------------------------------
worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
binlog.binlog_multi_engine [ skipped ] No ndbcluster tests(--skip-ndbcluster)
rpl_ndb.rpl_ndb_2innodb [ skipped ] No ndbcluster tests(--skip-ndbcluster)
rpl_ndb.rpl_ndb_2myisam [ skipped ] No ndbcluster tests(--skip-ndbcluster)
...
Could not execute 'check-testcase' before testcase 'federated.federated_innodb' (res: 1):
/home/soft/mysql/mysql-5.1.57/client/mysqltest: line 61: /usr/local/bin/sed: No such file or directory
...
Testy wywalają się na braku seda. Oczywiście mamy seda w systemie, nawet dwa. Solarisowy jest w /usr/bin, a GNU sed, którego kompilowałem wcześniej jest w /usr/local/bin lecz pod nazwą gsed. Nie wiedzieć czemu skrypt do testów chce mieć seda pod nazwą /usr/local/bin/sed. Dajmy mu więc to czego chce:
# cd /usr/local/bin
# ln -s gsed sed
Powtarzamy test:
Test (dmake test) [y|n] ?
y
dmake force=--force test
cd unittest && dmake test
...
rpl.rpl_sporadic_master [ fail ]
Test ended at 2011-05-20 12:46:46
CURRENT_TEST: rpl.rpl_sporadic_master
mysqltest: At line 20: query 'flush logs' failed: 4: Error on close of './master-bin.000001' (Errcode: 22)
The result from queries just before the failure was:
include/master-slave.inc
[connection master]
create table t2(n int);
create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL),(NULL);
truncate table t1;
insert into t1 values (4),(NULL);
stop slave;
start slave;
insert into t1 values (NULL),(NULL);
- saving '/home/soft/mysql/mysql-5.1.57/mysql-test/var/log/rpl.rpl_sporadic_master/' to '/home/soft/mysql/mysql-5.1.57/mysql-test/var/log/rpl.rpl_sporadic_master/'
Retrying test rpl.rpl_sporadic_master, attempt(2/3)...
rpl.rpl_sporadic_master [ retry-fail ]
Test ended at 2011-05-20 12:46:54
CURRENT_TEST: rpl.rpl_sporadic_master
mysqltest: At line 20: query 'flush logs' failed: 4: Error on close of './master-bin.000001' (Errcode: 22)
The result from queries just before the failure was:
include/master-slave.inc
[connection master]
create table t2(n int);
create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL),(NULL);
truncate table t1;
insert into t1 values (4),(NULL);
stop slave;
start slave;
insert into t1 values (NULL),(NULL);
- saving '/home/soft/mysql/mysql-5.1.57/mysql-test/var/log/rpl.rpl_sporadic_master/' to '/home/soft/mysql/mysql-5.1.57/mysql-test/var/log/rpl.rpl_sporadic_master/'
Test rpl.rpl_sporadic_master has failed 2 times, no more retries!
rpl.rpl_row_mysqlbinlog [ skipped ] Doesn't support --binlog-format='mixed'
rpl.rpl_loaddata_map [ skipped ] Doesn't support --binlog-format='mixed'
rpl.rpl_cross_version [ pass ] 1463
...
I znów problemy. Ale możecie ich nie doświadczyć jeśli robicie to wszystko na lokalnych dyskach. Ja mam to podpięte przez NFS, stąd wynikają problemy w tym wypadku. Można to obejść kopiując cały katalog na dysk lokalny lub choćby do /tmp i tam puścić testy:
soft@wega:~/mysql% cp -Rp mysql-5.1.57 /tmp
soft@wega:~/mysql% cd /tmp/mysql-5.1.57
soft@wega:/tmp/mysql-5.1.57% dmake test
dmake force=--force test
cd unittest && dmake test
...
rpl.rpl_sporadic_master [ pass ] 398
rpl.rpl_row_mysqlbinlog [ skipped ] Doesn't support --binlog-format='mixed'
rpl.rpl_loaddata_map [ skipped ] Doesn't support --binlog-format='mixed'
rpl.rpl_cross_version [ pass ] 549
...
Już lepiej, a do tego skrócił się czas testowania.
main.mysql_client_test [ fail ]
Test ended at 2011-05-20 13:15:12
CURRENT_TEST: main.mysql_client_test
mysqltest: At line 15: command "$MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1" failed
Output from before failure:
exec of '/tmp/mysql-5.1.57/tests/mysql_client_test --defaults-file=/tmp/mysql-5.1.57/mysql-test/var/my.cnf --testcase --vardir=/tmp/mysql-5.1.57/mysql-test/var --getopt-ll-test=25600M >> /tmp/mysql-5.1.57/mysql-test/var/log/mysql_client_test.out.log 2>&1' failed, error: 256, status: 1, errno: 29
The result from queries just before the failure was:
SET @old_general_log= @@global.general_log;
SET @old_slow_query_log= @@global.slow_query_log;
- saving '/tmp/mysql-5.1.57/mysql-test/var/log/main.mysql_client_test/' to '/tmp/mysql-5.1.57/mysql-test/var/log/main.mysql_client_test/'
Only 547 of 1048 completed.
mysql-test-run: *** ERROR: Not all tests completed
*** Error code 1
dmake: Fatal error: Command failed for target `test-ns'
...
Jak widać to jeszcze nie koniec problemów. Ten jednak jest opisany i zgłoszony.
soft@wega:/tmp/mysql-5.1.57% dmake test-force
Kilka testów jeszcze się obala ze względu przez wybrany domyślnie przeze mnie character-set=utf8, podczas gdy oczekiwany jest latin1.
------------------------------------------------------------
The servers were restarted 163 times
Spent 1121.202 of 2262 seconds executing testcases
Completed: Failed 6/730 tests, 99.18% were successful.
Failing test(s): main.mysql_client_test main.information_schema main.mysql_comments main.mysql_upgrade main.outfile_loaddata main.select
The log files in var/log may give you some hint of what went wrong.
dmake install po przełączeniu na roota. Później jeszcze dorabiam link symboliczny w /usr/local.
# cd /usr/local
# ln -s mysql-5.1.57 mysql
# /usr/local/mysql/bin/mysql --version
/usr/local/mysql/bin/mysql Ver 14.14 Distrib 5.1.57, for sun-solaris2.10 (sparc) using readline 5.1